Hilscher Community Forum
NPIX-RS485 with auto direction control now available - Printable Version

+- Hilscher Community Forum (https://forum.hilscher.com)
+-- Forum: netPI 3 - Docker featuring Industrial Raspberry Pi 3 platform (https://forum.hilscher.com/forum-1.html)
+--- Forum: Hardware (https://forum.hilscher.com/forum-4.html)
+--- Thread: NPIX-RS485 with auto direction control now available (/thread-481.html)

Pages: 1 2


NPIX-RS485 with auto direction control now available - Armin@netPI - August-26th-2019

We changed the RS-485 transceiver used on module NIOT-E-NPIX-RS485 in REV#2.

The new part - MAX13488E - features auto direction control and is switching between TX (transmit) and RX (receive) mode automatically and instantly once you enabled it by a GPIO. The advantage now is to be no longer compelled to handle switching in software by a non-realtime driver that is causing jitter of the switching times switching from TX mode back to RX mode after a request has been sent. If then a responder is sending back data too fast it could easily happen that the first incoming chars are getting lost if the switching was too long.

The MAX13488E is pin compatible to the previous used transceiver SN65ALS176 in #REV1. Instead of using the TX_EN pin to switch between TX/RX as done before on #REV1 you have now just to set the TX_EN pin to "high" state a single time and automatic direction control gets enabled.

With Node-RED for example you could just inject a "true" to a rpi gpio node directed to GPIO17 (TX_EN) and you are done:

Code:
[{"id":"287692d1.c61e06","type":"inject","z":"d31910c1.fd0618","name":"","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":295.5,"y":599,"wires":[["6bbb3ed9.4bb6d8"]]},{"id":"6bbb3ed9.4bb6d8","type":"rpi-gpio out","z":"d31910c1.fd0618","name":"","pin":"11","set":"","level":"0","freq":"","out":"out","x":483.5,"y":599,"wires":[]}]


After pulling the TX_EN pin to high state the NPIX-RS485 module will get compatible with any serial communicating program or Node-RED node.

Download the latest NPIX modules documentation highlighting the #REV1/#REV2 modules' difference in the download section here. Please keep also in mind that the used serial port named "Mini UART" used has also restrictions and check if it fulfils your protocol requirements.

Thx
Armin


RE: NPIX-RS485 with auto direction control now available - EnergyKonnex - May-12th-2020

Hi Armin,
I have just received the new NPIX-RS485, unfortunately I cant get it to work. I am running the latest firmware on the NIOT-E-NPI3-51-EN-RE. Last night I installed the newest Docker container and set the port to /dev/ttyS0. I am running the hilschernetpi/netpi-nodered container with the new node-red 1.0.6. I have tried activating the GPIO 17 like you suggested in node-red. I get the following error “nrgpio python command not running” If I do the same setup on a raspberry PI with USB-modbus, it runs no problem. Any ideas?
Thanks


RE: NPIX-RS485 with auto direction control now available - Armin@netPI - May-13th-2020

Hi there,

can you tell me which gpio node you have been using during your test?

The one that I am always using is Raspberry Pi GPIO named "node-red-node-pi-gpio" https://flows.nodered.org/node/node-red-node-pi-gpio. It needs to be post installed.

Then it goes with charm if you setup the container as described in the README like this

a.) privileged mode on
b.) /dev/ttyS0 devicemapped
b.) MOST IMPORTANT /dev/gpiomem mapped

Here is  my screen shot of setting the GPIO right

   

But I am wondering that this GPIO node is not part of the standard Node-RED library and installation. I hardly can remember but I thought it is installed along with Node-RED always by default

But nevertheless in Node-RED 1.0.6 it is no longer there. It would be good to have this node in hilschernetpi/netpi-nodered container installed by default too. I will generate a new version for the community including this node then today. Then everybody is on the same level and this forum topic "RS-485 ..." do not create misunderstandings any more.


Thx
Armin


RE: NPIX-RS485 with auto direction control now available - EnergyKonnex - May-13th-2020

Hi Armin,

You are really on the ball, thanks for your swift reply. I will wait for your new version of Node-Red and get back to you with the results.


RE: NPIX-RS485 with auto direction control now available - Armin@netPI - May-14th-2020

The container "hilschernetpi/netpi-nodered:latest" has now been updated and is available for download


RE: NPIX-RS485 with auto direction control now available - EnergyKonnex - May-14th-2020

Thanks Armin,

I will download it and give it a try.


RE: NPIX-RS485 with auto direction control now available - Armin@netPI - May-14th-2020

I made also an official version of the container "hilschernetpi/netpi-nodered:1.5.2". It is now ready to deploy after it has been created on Docker Hub automatically.


RE: NPIX-RS485 with auto direction control now available - EnergyKonnex - May-15th-2020

Hi Armin, I am getting this error, any idea's?


RE: NPIX-RS485 with auto direction control now available - Armin@netPI - May-15th-2020

Let me checkthis myself. Indeed as this point I have changed something in the building process.

I will be back to you.


RE: NPIX-RS485 with auto direction control now available - Armin@netPI - May-15th-2020

I see the same. This is a bug. I need to correct it. My fault.

There is a temporary work around for this. Before you start the container ou have to specifiy the entrypoint where the container starts manually: /etc/init.d/entrypoint.sh

See my screen shot

   


In the background I have correct the container. It is already buiiling on Docker Hub. Building will take 3 hours.