borpin
(Brian Orpin)
31 January 2023 18:05
6
Robert.Wall:
The way I read this, it’s a permanent serial data connection that’s required - which implies the USB port on the Pi must always be the same, else intervention will possibly be needed after each reboot.
Locking the USB is nice, but not imperative. RPiOS usually restarts with the same ports and has been mentioned before. That command though was in a thread about FTDI.
Indeed it would, HOWEVER!
Be aware that the /dev/ttyUSB* addresses are dynamically issued at boot up or as each device is connected/comes online, so there are no guarantees that the 3 devices will always use the same node id’s, it very much depends on who gets what address first.
The “problem” here is that because the emonESP output format is aimed solely at a close coupled emonESP that recieves input from that one emontx only, there is no node id passed in the frame of data.
You have 3 opt…
Has some thoughts, but again this refers to FTDI adapters to a UART, not to the USB port on the TX4.
[edit]
But @Bill.Thomson posted this a while back (might be good for the docs)
By adding some rules to the /etc/udev/rules.d directory, you can force Linux to always use the same
USB serial device which you can refer to by a more meaningful name.
e.g. You have 2 USB-to-RS485 adapters. One is FTDI based, the other CH340 based.
You want to use them both on the same Raspberry Pi to read two modbus instruments.
The problem is sometimes the OS enumerates the adapters in opposite order. i.e. what was
/dev/ttyUSB0 at last boot time is now /dev/ttyUSB1 and vice-versa.
Adding…