Can anyone confirm that the pin connections to the UART board TXD and RXD are the same as the usual A and B connections on other RS485 connections, and does it matter which way round they are connected? Many thanks
Are you talking about the FTDI connector? The UART is not RS485, which is a balanced line. It’s not even RS232, although that is closer, because the voltage is only 3.3 V.
Of course it matters which way round! Generally, you send data on the Tx pin and receive it on the Rx pin.
If you’re talking about the one from the OEM Shop and an emonTx, Tx goes to TXD and Rx goes to RXD. It’s actually the emonTx that’s wrongly labelled as it receives data from TXD on the programmer on Tx pin of the FTDI connector, which is connected on the p.c.b. to RXD (D0) on the processor, and transmits it from TXD (D1) on the pin labelled Rx on the FTDI connector to RXD on the programmer.
So the interface is capable of full duplex operation.
The Raspberry Pi is not an RS485 device.
I’m not that up on RS485 but it’s my understanding it is a bus for multiple devices.
The UART on the Pi’s GPIO is a “one to one” connection and yes it does matter which way the pins are connected, the tx pin will transmit to the other device’s Rx pin and the Pi’s Rx pin will listen to the other device’s Tx pin.
It is more akin to rs232 than rs485 but at 3.3v max.
To use rs485 on a Pi you will need a rs485 usb adapter or I believe there are also some adapters that can attach to the GPIO.
RS-485 is an enhanced variant of RS-422. (up to 32 transmitter and/or receiver devices)
Like RS-422, (which can handle a maximum of 10 devices) it will work fine configured point-to-point. i.e. non-multi-drop, configuration. i.e. a single pair of transmitter and/or receiver devices.
And if it uses only one channel and only one pair of wires to communicate over, it can only be half-duplex. You need two pairs and a separate transmitter and receiver on each device for full duplex, and then it gets very messy.
I only need to transmit one way from emonpi to a device, and the message contents are known and understood. I am currently using an FTDI chip USB to RS485, but bought the emonPi as well as I was unsure of driver compatibility issues. The FTDI works well and I (mis)understood the UART board was an equivalent. Just for fun I will try connecting the UART board using TXD as the Data + (A) and RXD as the Data - (B). Many thanks.
RS-232 and RS-485 interface hardware are very different animals, i.e. not compatible with each other.
Unfortunately your USB to RS-485 adapter wont work with your UART board
However, I have seen some USB to RS-232/485 adapters that have jumpers to allow selecting the operating mode.
If by chance you have one that’s configurable, then all you need to do is configure it for RS-232 operation and you should be good to go. If not, you’ll need to get an adapter with RS-232 capability.
What device(s) are do you currently have working?
Leads me to believe it’s an all in one usb device like these USB RS485 Cable Series - FTDI
throws me again! which “UART board” ? equivalent to what?
If by “UART board” you mean the GPIO serial pins of the Pi are the equivalent of your adapter and will connect to the rs485 device directly, then no it isn’t, all 3 of us have explained that,
If your “FTDI chip USB to RS485” is actually more than one device that you can split eg you are using a “usb to serial” adapter with a “serial to rs485” adapter then yes the emonPi can replace the “usb to serial” adapter and the “serial to rs485” should connect to and work with the Pi’s GPIO, But this will then be a simple Rx and Tx crossover, Not rs485 A and B or data+ and data- connections.
On that search list I linked is a thread Simple invasive 3-phase energy monitor in which Jörg has built a “rs485pi” to do the job you seem to be describing, this is the schematic, But there are many more posts on old forums where most users have just opted for a simple and cheap one piece usb to rs485 adapter and plugged that into the accessible usb ports of the emonPi.
EDIT - having just read through this again expecting I had missed something vital I now wonder if your current working setup involves a “Programmer USB to serial UART” (from the thread title) and a second "Serial to rs485 device as I describe above, if so YES the emonPi can replace that “programmer” but the connections are Rx to Tx and Tx to Rx, nothing to do with rs485 and that may be where the confusion lays.
As a rule if you have a Pi and few jumper wires, you have no real need for a “USB programmer” .
You need to tell us exactly what you’ve got in the way of hardware, and exactly what your requirements are, because what you’ve written so far is disjointed and the rest of us are making assumptions based on what we’ve inferred from the snippets you’ve given us.
I have the desire to charge my EV using Solar Power only. I could not purchase a commercial unit so decided to try to join together emonPi and Smart EVSE. I am inexperienced in this type of work, and was advised by the good folk at emonPi to use these forums to get help.
One question I asked on another forum was how to get a serial connection between these systems, the specification being “Send buffer over RS485. Use PPP in HDLC-like Framing for transfers for protocol spec see: http://tools.ietf.org/html/rfc1662. Compatible with existing RS485 line used on SMA solar inverters” plus the actual packet structure. I was advised to buy USB to Serial hardware, such as the emonPi UART board. I purchased this board, and read in the emonPi shop detailed description that it “This programming cable performs the same function as an FTDI cable but use a different chipset”. Thats why I thought they were equivalent; sorry about that.
So I also bought a USB RS485 FTDI device and a lower cost USB device purporting to be a USB to RS485.
The lower cost device only has two connections labelled A and B. Because of this simplicity I tried this first. It did not work. I then tried the FTDI, which again didn’t work. More research showed that I needed to connect the ground, that RS485 is a three wire system (RS485 - RS485 Cables – Why you need 3 wires for 2 (two) wire RS485 - Chipkin Automation Systems). Connecting the third wire (ground) proved successful and the systems communicated. In my case, probably the length of cable between the devices, or its route, prevented the use of the 2 connector commercial so called USB to RS485.
And so to my original question - how to connect the emonPi UART board? As per my earlier post, I tried it, connecting TXD, RXD and Gnd to the EVSE A, B, and Gnd.
It works perfectly.
EmonPi and Smart EVSE are connected and the emonPi packets reach the EVSE and are properly dealt with, exactly like the FTDI chip.
The only failure is the cheap commercial 2 wire device.
Thank you to everyone who tried to help; sorry I appeared to ask the wrong question.
EDIT: The only reason I called it a Programmer - USB to serial UART is because that is what emonPi label this device - Programmer - USB to serial UART - Shop | OpenEnergyMonitor
Yes the pinout from the USB to UART programmer sold via the shop is identical to the FTDI cable pinout. See photo: