# Multiple emonTX Serial connections

**URL:** <https://community.openenergymonitor.org/t/multiple-emontx-serial-connections/15221>\
**Category:** emonPi\
**Created:** [27 August 2020 20:30 UTC](https://community.openenergymonitor.org/t/multiple-emontx-serial-connections/15221 "2020-08-27T20:30:21Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![pb66](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/pb66/32/27_2.png) [@pb66](https://community.openenergymonitor.org/u/pb66)\
**Post date:** [27 August 2020 22:58 UTC](https://community.openenergymonitor.org/t/multiple-emontx-serial-connections/15221/4 "2020-08-27T22:58:18Z")

</div>

> [@borpin](#):
>
> This should work (never tried it though).

> [@NA7KR](#):
>
> This worked

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 options

1. Cross your fingers and hope that the devices always get allocated the same address.

2. Change the emonTx FW’s to send a node id, using the original “serial-direct” space seperated values output eg _nodeid val1 val2 val3_ etc and use the original serial interfacer not the Tx3e interfacer in emonhub.

3. Use serial to USB adaptors that can have a unique id set so that the emonBase can identify the device and allocate it the correct address regardless of connection/boot order.

I always opt for FTDI usb serial adaptors that have a programmable eeprom and udev rules to match so my emonTx’s are not addressed as /dev/ttyUSB\* but as /dev/emonTx\* instead.

Some further reading if you are interested

> [@Can I hang 4X emonTx via wire on one emonPi/Base?](https://community.openenergymonitor.org/t/can-i-hang-4x-emontx-via-wire-on-one-emonpi-base/11635/14):
>
> What are you calling an emonHub device? Do you just mean a raspberry pi without an emonPi or RFM2Pi add-on board? I would still regard that as an emonBase. I have several RPi’s that have USB connected emonTx’s and run emonHub (software), I still refer to them as emonBases even though they have no ability to receive RFM transmissions. As would I. 2x RPi’s? 6x Tx’s and 6x USB adaptors, yes plus 2x good 5v AC adaptors (genuine RPi or good 3A+ with integral (micro-usb) leads) 2-6 AC:AC adapt…

> [@Does the emonTx Shield need an actual Arduino?](https://community.openenergymonitor.org/t/does-the-emontx-shield-need-an-actual-arduino/2198/21):
>
> Hi Dave, I currently use a separate serial interfacer in emonhub, for each emonTx. They will usually get automatically addressed as /dev/ttyUSB0, /dev/ttyUSB1, and /dev/ttyUSB2 but have no control over which is which (not so good!!!) but as long as the node id is written into the sketches payload this isn’t a problem until you have other USB devices and the addressing range gets altered. I use FTDI serial adapters with a writable eeprom and have added udev rules so emonTx’s are automatically r…

There is actually another method a “3a” if you like, where you use usb serial devices from 3 different vendors and use the vendor:product id’s and udev rules, Bill explain’s how in this thread

> [@How to match a ttyUSBX device to a USB Serial device](https://community.openenergymonitor.org/t/how-to-match-a-ttyusbx-device-to-a-usb-serial-device/8747):
>
> 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…

---

_[View the full topic](https://community.openenergymonitor.org/t/multiple-emontx-serial-connections/15221)._
