Serial Port Demo
In this demo we demonstrate how to connect an application on ModuCop with a IOU04 COM port. We use a cable to loop the RS232 transmit pin to the receive pin 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 IOU04 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<port> is created. For example, if your IOU04 device ID is S101-IOU04-USB-EXT-1, you will find the following TTY devices:
root@moducop-cpu01:~# ls -l /dev/ttyS101-IOU04-USB-EXT-1*
crw-rw---- 1 root dialout 199, 3 Jul 28 13:33 /dev/ttyS101-IOU04-USB-EXT-1-com1
crw-rw---- 1 root dialout 199, 4 Jul 28 13:33 /dev/ttyS101-IOU04-USB-EXT-1-com2
If you don't see these devices but you see a -can device, clear the CAN configuration to activate the COM ports.
On your ModuCop, run:
io4edge-cli -d S101-IOU04-USB-EXT-1 set-parameter can-config ""
# Restart to apply parameters
io4edge-cli -d S101-IOU04-USB-EXT-1 restart
Function Test
Create a hardware loop between the RS232 transmit and receive pins of the COM1 RS232 interface. Connect pin 2 and pin 3 of the COM port D-sub connector:
Start the minicom terminal program on ModuCop:
root@moducop-cpu01:~# minicom -D /dev/ttyS101-IOU04-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 characters, and you should see that the characters are echoed back due to the hardware loop.
Welcome to minicom 2.7.1
OPTIONS: I18n
Compiled on Apr 18 2017, 09:55:23.
Port /dev/ttyS101-IOU04-USB-EXT-1-com1, 13:45:27
Press CTRL-A Z for help on special keys
dddddddddddd..ffffdddddddddddddddd
To leave minicom, type CTRL-A, followed by x.