emonTx stops sending data

Yep, There are many posts on doing this type of thing.

The most common is the “serial-direct” method which connects the serial port of an emonTx to the serial port on the Pi’s GPIO, but that is not possible on an emonPi because the emonpi board is already using the GPIO serial port.

The alternative “serial-direct” method of connection is to use a usb to serial converter attached to the emonTx serial port and using an USB port on the emonPi, this is configured exactly the same way as the above except the serial port defined in emonhub.conf will be something like /dev/ttyUSB0 rather than /dev/ttyAMA0.

The slight difficulty comes when connecting more than one emonTx to the emonPi via USB, because of the way the /dev/ttyUSB0 and /dev/ttyUSB1 addresses are dynamically issued at boot time on a first discovered first served basis, so one day emonTx A could be /dev/ttyUSB0 and emonTx B would be /dev/ttyUSB1, after a reboot it maybe the other way round, as long as the emonTx’s are passing a node Id as part of the payload this shouldn’t matter much, but the default sketch on the emonTx does not include the node id in the payload. So there are 2 ways to handle this and that is to change the sketches to send node id and not care about the “/de/” addresses or you can specifically buy FTDI FT232L usb to serial adapters which have unique identifiers and add a simple udev rule to the emonPi so that the emonTx (or rather their respective serial adapters) are always recognized and addressed the same way.

I regularly use the latter method to build 3ph monitors that do not rely on RF, I mont the serial adapters on the emonTx boards where the battery holder is currently, with a double sided sticky pad and connect all 3 to a Pi 3(not an emonPi) See the Does the emonTx Shield need an actual Arduino? - #18 by pb66 thread for some more info and pics.

Probably more suited to your application I have also installed some single “usb converted” emonTx’s that are cased with the FTDI adapter slightly more in-board so a USB lead can be attached and led out of the casing by drilling a hole in the perspex end, close to the edge and “slotting” it to the edge with a couple of short hacksaw cuts.

In the lower pic you can see I have also cut a slot for the 6way ribbon cable, I chose to do it this way rather than connect inside the case so the original connector is retained and accessible without a screwdriver.

[ignore the red, yellow and brown wires and the extra socket stuck on the side, this one is also converted for 5 CT’s. ]