Serial Port Demo
In this demo we demonstrate how to connect an application on ModuCop with a IOU06 COM port. We use a cable to loop the RS422/485 transmit pins to the receive pins so that all characters sent to the COM port are echoed back.
Preparation steps:
- Connect a PC and ModuCop to the same network (for example via Ethernet switch or Wi-Fi access point)
- From the PC, log in to the ModuCop via SSH
Check whether IOU06 COM ports are recognized on ModuCop
ModuCop's Linux image automatically detects COM ports of io4edge devices.
For each detected COM port, a Linux device /dev/tty<device-ID>-com is created. For example, if your IOU06 device ID is S101-IOU06-USB-EXT-1, you will find the following TTY device:
root@moducop-cpu01:~# ls -l /dev/ttyS101-IOU06-USB-EXT-1*
crw-rw---- 1 root dialout 199, 3 Jul 28 13:33 /dev/ttyS101-IOU06-USB-EXT-1-com
If you don't see this device, but you see a -can device, clear the CAN configuration to activate the COM port.
On your ModuCop, run:
io4edge-cli -d S101-IOU06-USB-EXT-1 set-parameter can-config ""
# Restart to apply parameters
io4edge-cli -d S101-IOU06-USB-EXT-1 restart
Function Test
Create a hardware loop between the RS422/485 transmit pins and the receive pins of the COM1 RS232 interface. Connect pin 1 to 4 and 6 to 9 of the CAN/COM port D-sub connector:
Rev. 0
Rev. 1
Start the minicom terminal program on ModuCop:
root@moducop-cpu01:~# minicom -D /dev/ttyS101-IOU06-USB-EXT-1-com1 -b 115200
CTRL-A followed by O (O like Omega)
┌─────[configuration]──────┐
│ Filenames and paths │
│ File transfer protocols │
│ Serial port setup │
│ Modem and dialing │
│ Screen and keyboard │
│ Save setup as dfl │
│ Save setup as.. │
│ Exit │
└──────────────────────────┘
Serial Port Setup
* Press F
Then hardware flow control should be off:
F - Hardware Flow Control : No
ESC and you are back in the main screen of minicom.
Now type some character, and you should see that the characters are echoed back, due to the hardware loop we have created!
Welcome to minicom 2.7.1
OPTIONS: I18n
Compiled on Apr 18 2017, 09:55:23.
Port /dev/ttyS101-IOU06-USB-EXT-1-com, 13:45:27
Press CTRL-A Z for help on special keys
dddddddddddd..ffffdddddddddddddddd
To leave minicom, type CTRL-A, followed by x.