Serial data from EPC1512 to Node-Red
On EPC1522 with 2 serial ports, I am running Node-Red in an Docker. And within Node-Red I want to receive the serial data from one of the on board serial ports. On the Linux OS the on boards serial ports are registered as /dev/ttyS0 and /dev/ttyS1. On Node-Red I use node-red-node-serialport node. But I get the message: "serial port /dev/ttyS0 error: Error: Error: No such file or directory, cannot open /dev/ttyS0"
How to solve this?
Kind regards, Wilco
Comments
Is the serial device mounted by the container?
For example:
https://stackoverflow.com/questions/24225647/docker-a-way-to-give-access-to-a-host-usb-or-serial-device
Hi Martin,
Indeed; I've forgotten to connect the device to the container. But unfortunately it did not work...
For testing I installed the Node-Red app on the EPC1512, just to test it without Docker. But also in this case I get the same message: "serial port /dev/ttyS0 error: Error: Error: No such file or directory, cannot open /dev/ttyS0"
Now I actually wonder, are the serial ports connectable at all, also with a project in PLCnext-Engineer? In PLCnext-Engineer I can not find anything about the serial ports.
Also on the WBM there is no overview or settings for the serial ports. And as these are ports with multiple options (RS232/RS422/RS485), there shout be a way to configure this and finally use them.
I also checked the manuals, but I could not find any instructions.
So I still need your help ;)
Kind regards, Wilco
The EPC1512 has fw 2024.0.3 LTS
I assume that when you say EPC 1512, you mean EPC 1522.
Here are some relevant snippets that I've been able to find:
... however in this recent conversation, it was stated that the boot menu cannot be accessed by users:
The interfaces are traditional PC serial ports. They are represented as /dev/ttyS0 and /dev/ttyS1 by the Linux system.
The serial ports can be used from Python or C++, Shell script, or any program that supports traditional serial ports.
They should also work from the basic Node-Red serial nodes.
They will however not work with the Node-Red Modbus 485 support, because the EPC does not have hardware Transmit Enable/Flow control support.
I do not believe that there any function blocks that support the serial ports in PLC Next Engineer.
(internal reference: #249702)
So, to answer your questions/statements:
In PLCnext-Engineer I can not find anything about the serial ports.
That's correct. PLCnext Engineer does not support the serial ports on an EPC 1522 device.
Also on the WBM there is no overview or settings for the serial ports.
That's correct. Serial port settings on an EPC 1522 cannot be changed from WBM.
as these are ports with multiple options (RS232/RS422/RS485), there shout be a way to configure this and finally use them.
You would think so, but unfortunately that is currently not the case.
The serial ports should still be useable from the command line of the device, at least.
What is the result of this command on your device?
Hi Martin,
$ ls -lsah /dev/tty* gives the following reply:
/dev/tty /dev/tty13 /dev/tty19 /dev/tty24 /dev/tty3 /dev/tty35 /dev/tty40 /dev/tty46 /dev/tty51 /dev/tty57 /dev/tty62 /dev/ttyS1
/dev/tty0 /dev/tty14 /dev/tty2 /dev/tty25 /dev/tty30 /dev/tty36 /dev/tty41 /dev/tty47 /dev/tty52 /dev/tty58 /dev/tty63 /dev/ttyS2
/dev/tty1 /dev/tty15 /dev/tty20 /dev/tty26 /dev/tty31 /dev/tty37 /dev/tty42 /dev/tty48 /dev/tty53 /dev/tty59 /dev/tty7 /dev/ttyS3
/dev/tty10 /dev/tty16 /dev/tty21 /dev/tty27 /dev/tty32 /dev/tty38 /dev/tty43 /dev/tty49 /dev/tty54 /dev/tty6 /dev/tty8
/dev/tty11 /dev/tty17 /dev/tty22 /dev/tty28 /dev/tty33 /dev/tty39 /dev/tty44 /dev/tty5 /dev/tty55 /dev/tty60 /dev/tty9
/dev/tty12 /dev/tty18 /dev/tty23 /dev/tty29 /dev/tty34 /dev/tty4 /dev/tty45 /dev/tty50 /dev/tty56 /dev/tty61 /dev/ttyS0
$ dmesg | grep tty gives a more interesting result:
[ 0.000000] Command line: BOOT_IMAGE=/boot/bzImage root=PARTUUID=c2720dcc-dfb3-495c-bdf4-a357f7d3f464 rootwait init=/init rootrw=/dev/sda1 rootrwreset=no rw processor.max_cstate=0 intel_idle.max_cstate=0 rauc.slot=A earlyprintk=serial,tty1,115200,keep console=tty1,115200n8
[ 0.395749] Kernel command line: BOOT_IMAGE=/boot/bzImage root=PARTUUID=c2720dcc-dfb3-495c-bdf4-a357f7d3f464 rootwait init=/init rootrw=/dev/sda1 rootrwreset=no rw processor.max_cstate=0 intel_idle.max_cstate=0 rauc.slot=A earlyprintk=serial,tty1,115200,keep console=tty1,115200n8
[ 0.487472] printk: console [tty1] enabled
[ 1.074864] 00:01: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
[ 1.096342] 00:02: ttyS1 at I/O 0x2f8 (irq = 3, base_baud = 115200) is a 16550A
Kind regards, Wilco
Hello Martin,
Thanks for getting into this discussion.
I think it is a great loss if we can't control the serial ports on the EPC1512. I forces me to get an other similar device that does have these basic features available. So I hope the development team will find a proper way, soon, to incorporate the serial ports in PLCnext-Engineer and Node-Red.
One interesting thing in your reply: "They should also work from the basic Node-Red serial nodes." Does that mean the old fashion way (by ipkg), not by the app and not with a Docker?
For so far thanks for your help.
Unfortunately this is a (for now) a dead end.
Kind regards, Wilco