sudo apt install libssl-dev
sudo apt install gcc
sudo apt install make
sudo apt install minicom
tar xvfz moxa-real-tty-linux-kernel-5_x-driver-v5_2.tgz
cd moxa
sudo ./mxinst
Результат:
Installation process is completed.
The all driver files are installed on /usr/lib/npreal2/driver.
./mxaddsvr 10.10.10.238 1
Adding Server...
ttyr00, cur00
Added RealCom server: ip : 10.10.10.238
mknod -m 666 ttyr00 c 33 0
mknod -m 666 cur00 c 38 0
Complete.
dmesg | grep tty
[ 0.469616] printk: console [tty0] enabled [2421173.422369] [ 1358] 0 1358 1457 380 49152 0 0 agetty [2436692.786432] MOXA Async/NPort server family Real TTY driver ttymajor 33 calloutmajor 38 verbose 1 (Ver5.2) [2436692.909521] MOXA Async/NPort server family Real TTY driver ttymajor 33 calloutmajor 38 verbose 0 (Ver5.2)
First have a look at the permissions on that file
ls -l /dev/ttyr00
sudo chown admin /dev/ttyr00
You will want read.write access, if this is a shared system then you should consider the security consequences of opening it up for everyone.
sudo chmod o+rw /dev/ttyr00
sudo usermod -a -G tty admin
sudo chgrp tty /dev/ttyr00
sudo chmod 666 /dev/ttyr00
экран настроек приложения с параметром -s
minicom -s
Для подключения к устройству
sudo minicom -D /dev/ttyr00
Для выхода:CTRL+A → Z → X
A very simple crude method to write to the file, would use the simple echo command.
echo -ne '\033[2J' > /dev/ttyr00
to read
cat -v < /dev/ttyr00
cd /usr/lib/npreal2/driver
./mxdelsvr <IP>