![]() |
netFIELD Compact Gateway Serial RS485 connection for application - Printable Version +- Hilscher Community Forum (https://forum.hilscher.com) +-- Forum: netFIELD Edge - Cloud managed Docker supporting Edge Gateways (https://forum.hilscher.com/forum-23.html) +--- Forum: Hardware (https://forum.hilscher.com/forum-26.html) +--- Thread: netFIELD Compact Gateway Serial RS485 connection for application (/thread-833.html) Pages:
1
2
|
netFIELD Compact Gateway Serial RS485 connection for application - DSongra - February-18th-2023 Dear Armin, Greetings! Hope you are doing well! I am working on netFIELD Compact Gateway (Version 2.3.0.4), making one demo setup kit for showcase/training purposes to our Indian customers & my colleagues. For this I have installed node-red docker container, and I have follow the steps as mentioned in document as below. but I am not able to communication Energy Meter, so how to verify the RS485 mode is activated? or is there any other settings to do. Terminal - sudo sh -c "echo 'mode=rs485' > /etc/default/uart1" systemctl restart uart1-mode In Node red docker container - --device=/dev/ttymxc0:/dev/ttymxc0 Br, Devendra RE: netFIELD Compact Gateway Serial RS485 connection for application - Armin@netPI - February-18th-2023 Well Devendra, I just can tell you right now that this forum will be closing in near future. All upcoming support questions will be handled through Hilschers standard support contact support@hilscher.com nowadays. I am no longer involved in any support activities. Also I have never tested RS232 and RS485 communications with netFIELD Compact. So I have no knowledge about it as I had before with netPI years before. All I can say is that the system test executed 2022 has been passed successfully at the time of the product release. So the RS485 interface must have been worked physically. Also I do not see any error in the manual and code description you are referencing. I also see an example how to start Node-RED successfully with Code: docker run -d -p 1880:1880 --device=/dev/ttymxc0:/dev/ttymxc0 --group-add dialout nodered/node-red So from a user perspective you have done everything well. For a simple tests without Node-RED you could call in your Linux terminal to print out a simple "hello" to the /dev/ttymxc0 Code: echo "hello" > /dev/ttymxc0 Of course you need a physical RS485 counterpart device like a RS485 to RS232 converter connected to your PC to see if this "hello" char string is coming out. This is the only check I see right now. If not you have to contact support@hilscher.com instead. RE: netFIELD Compact Gateway Serial RS485 connection for application - DSongra - February-18th-2023 Dear Armin, Thanks for your response and suggestion, I will check this and will update you. Br, Devendra RE: netFIELD Compact Gateway Serial RS485 connection for application - DSongra - February-20th-2023 Dear Armin, Good Morning! Yes, it is working I got a response in HyperTerminal Software on my PC. But this is not working in the Node-Red application, what it should show in the Modbus node Serial Port list, or do I need to manually write (/dev/ttymxc0) in the node-red Modbus node (attached screenshot). or How can I verify this in node-red docker container as you last time guided me for the USB interface. Br, Devendra RE: netFIELD Compact Gateway Serial RS485 connection for application - Armin@netPI - February-20th-2023 As far as I know is that the drop down list in modbus node does not auto-detect the serial port interfaces. So yes you have to configure "/dev/ttymxc0" manually. And I am happy to hear that you saw the "hello" coming out of the serial port. So we know your physics is working. This is a good start. RE: netFIELD Compact Gateway Serial RS485 connection for application - DSongra - February-21st-2023 Dear Armin, Good Evening! I have done the same and after deploying the node-red flow, the node-red container gets to stop and runs back again for a few seconds and again stops, or I have to recreate the container. So this issue is continuously happening. I tried node-red docker container version V2.2.3 & V3.0.2 but still the same issue, the container gets stopped. Could you please provide me some reference container setting screenshots, node-red version, or anything additional settings which you/the HQ team have done to run this? Br, Devendra RE: netFIELD Compact Gateway Serial RS485 connection for application - Armin@netPI - February-21st-2023 I tried it myself with Node-RED. Instead of installing Modbus node I just was installing the standard node-red serial port node first to make some basic tests. I configured the /dev/ttymxc0 also manually and after I deployed the Node-RED flow my Node-RED container was immediately crashing. After the crash I went back to my main Linux where I have started the container from and used the "docker logs <container ID>" command with the container ID of the crashed container. It said "segmentation fault". So the serial port node causes to crash the Node-RED. Since Node-RED is not Hilscher software, I cannot say why it crashes. I searched on the internet for such kind of problem and I found others having such an issue too in the past under different conditions https://github.com/serialport/node-serialport/issues/2438 https://discourse.nodered.org/t/segment-fault-error-occurs-when-deploy-node-red-node-serial-in-openwrt/63842 https://stackoverflow.com/questions/54129263/new-serialport-throws-segmentation-fault So it seems you are not alone with this problem. It seems Node-RED and the implementation of serial port function is buggy. In the end to be honest I can't tell you why the serial port function crashes. We have proved that unter normal Linux conditions using "echo 'hello' > ..." works, so the phyiscal hardware is properly working. It is the used software that does not work. I don't know how to help you now with 3rd party software now. RE: netFIELD Compact Gateway Serial RS485 connection for application - DSongra - February-21st-2023 Dear Armin, Yes, I am also getting this same error in the node-red log, I know this issue many people are facing but somewhere they have mentioned to modified the "docker-compose.yml" file and adding a serial interface & same is mentioned in our Compact Gateway User Manual page no. 20 (UM 02), So could you please let me know where can I get this Docker-Compose.yml file in our Gateway? because I have checked this into the docker demon & docker files directory but could not find it, might be I am looking at a different directory. Br, Devendra RE: netFIELD Compact Gateway Serial RS485 connection for application - Armin@netPI - February-21st-2023 There are two methods to start a docker container. Both methods are 100% equal, just the way is different Method 1: calling "docker" command line e.g "docker run <parameter1> <parameter2> <parameter3> <parameter4> ... <Container>" Methog 2: calling "docker-compose" command line e.g "docker-compose <compose-file> up" So instead of having a very very very long and anoying "docker run ...." command line using docker-compose is much more easier since all required parameters are inserted in a simple text file socalled docker-compose.yml file But the most important point is: either the one or the other method starts the container exactly in the same way. So there will never be a different in the behavior of the container afterwards You are asking about a docker-compose file. How to create own docker-compose files can be found in the very official specification. https://docs.docker.com/compose/compose-file/ For Node-RED there are also proposals of a compose file available on the official Node-RED homepage on https://nodered.org/docs/getting-started/docker. There is a chapter named "Docker Stack / Docker Compose" and there you find an example of a typical Node-RED docker-compose.yml file. You can copy and paste the contents to a physical file on your Linux and call it. RE: netFIELD Compact Gateway Serial RS485 connection for application - Armin@netPI - February-21st-2023 I tried at home with my netFIELD Compact and followed the instruction of this ticket https://github.com/node-red/node-red/issues/3461 to install an older version of the serial-port node within Node-RED. So I called the following line first Code: docker run -d -p 1880:1880 --device=/dev/ttymxc0:/dev/ttymxc0 --group-add dialout nodered/node-red Calling the command line above returned me the unique container ID after creation (yours will be different) Code: 47ba15267f49612a357846e56d32e8ad0184c127669300a19fa5af4d34b697ef Then I called the following line using the container ID to "jump" into the container (replace my container ID with your ID) Code: docker exec -it 47ba15267f49612a357846e56d32e8ad0184c127669300a19fa5af4d34b697ef /bin/sh Then I called the following commands to install the old version of serial port V0.15.0 in the container Code: cd /data After the exit the container needs a restart to get the container restarted and the old serial port node active (replace container ID with yours) Code: docker restart 47ba15267f49612a357846e56d32e8ad0184c127669300a19fa5af4d34b697ef Now the Node-RED container is restarted and includes for test purpose and old version of serial port node Now you can configure a serial port node in your flow using the device "/dev/ttymxc0". You can use a "Inject" node to inject a string "hello" to this node for tests. After you deploy your flow you see Node-RED is not crashing cause of using the old serial port node. This is the proof that the netFIELD Compact device is working fine with Node-RED on serial port. So the problems comes from newer version of Node-RED and serial port node. |