Great video. Only the delay node of 500mSec is not needed. You can enter, for example, 0.2 (seconds) in the interval field of the inject node. Which gives 200 mSec intervals.
Well, that's exactly what I need. Thanks a lot, fits perfectly to my needs. Just moving from Homeassistant implementation of Modus, which is actually not working very well, to such a kind modbus2mqtt converter.
There are still so many products that use modbus on the market, and usually on affordable price. Even this is an ageing protocol, it does not appear to be dying any time soon
@@csongorvarga A good, simple, reliable protocol deserves to last. It was never considered "fast" but more than enough for its target use case. Also the hardware was so simple to install..
What hardware do you typically run your Flows on? Would Node-Red work on 8-bit microcontrollers and RS485? I'm ordering a Pi-Zero and EsspressIf boards.. any thoughts on using python to talk to a modbus temperature sensor (RS485)? For example, I see lots of options but not sure the difference: minimalmodbus , stephane/libmodbus , ClassicDIY/ModbusTool, eModbus/eModbus , modbus-esp8266 , QModMaster , rossmann-engineering/EasyModbusTCP_NET , EasyModbusTCP/UDP/RTU _NET? BTW, modbus kinda looks like CanOpen.. is there any connection?
I am running my Node-Red on a Dell Optiplex micro PC with Linux. So it is a lot more powerful than a usual raspberry pi setup. Node-Red needs a proper computer to run on, no microcontrollers. Back in the day before Node-Red, I use this python script to read my solar inverter over modbus serial. That should get you started: github.com/SteveNew/GrowattRpi. I have no heard of these libraries, there must be tons of implementation of the protocol. Modbus is a very simple master-slave protocol, where a master manages the communication. On a can network all the nodes can communicate and need to handle collision. So it is quite a different concept.
I have an issue, that queue periodically stops. I assume there might be some issue with respond and workflow stops since message with "next" topic is not emitted. Can I add repeat interval on "next" inject node to overcome this?
Yes, you can do that. Next skips to the next request, so worst case scenario you loose a request. But if it is only queries (get functions), it will be retrieved next time.
Hi Csongor. I am currently using node-red for several connections and I have problems with the modbus server that I mount on node-red, after a while it stops working and I have to disable and enable that flow to get the server up. The whole project has OPC-UA, MQTT and Modbus communications, all in different flows. Using the node "ModBus-Server" or "ModBus-Flex-Server" I can raise a Modbus server or Modbus slave and configuring it with local ip address in "bind-addres" and in Port I put 55380, the problem is that it works for a while and then it stops working. I can't find what the problem is and it only crashes if it is working with other flows with OPC and MQTT communications. All other communications are working properly
This sounds like a complex problem. I had somewhat similar issues when I was using the modbus getter, but after moving to the flex it was OK. Do you get any exceptions or warnings from any of the modbus nodes? Any information in the logs?
Very nice Video! I have a problem with my setup. I need to read a scalefactor and the corresponding value at the same time but they are pretty far apart so the addresses are over 200 registers apart. How would you read them simultaneously? I am reading a solar inverter with a sunspec model. Just for reference :) Any ideas?
Thanks. I have similar cases, I think for one of my energy monitor, that voltages and currents are in a first 10-15 registers, and a final accumulated consumption is around register 343. I read the first 10 registers, and next I read the rest of 3-4 starting from 343. Do them is separete requests
But do you think that the request is fast enough? The scalefactor determines the power of ten for the value, so it needs to be read simultaneously or in very short succession. I'll try to trigger the scalefactor read with the value read. Maybe that works.
Great Video! Really helped with a complex industrial modbus integration. Many thanks!!
Great video. Only the delay node of 500mSec is not needed. You can enter, for example, 0.2 (seconds) in the interval field of the inject node. Which gives 200 mSec intervals.
Thanks!
Genius. Solved a big issue we have had for some time with a an industrial installation with multiple nodes causing the the ModBus to hung. Thanks!
I hang similar issue for at least 2 years until I spent the time to dig in and understand this.
Well, that's exactly what I need. Thanks a lot, fits perfectly to my needs. Just moving from Homeassistant implementation of Modus, which is actually not working very well, to such a kind modbus2mqtt converter.
Very good video! Thank you! At 5:30: You can input a faction of a second in the inject node (0,5) and so you can get rid of the quirky 500ms delay.
Thanks. I don't know why I did not try that.
Looking at this I just love the simplicity of MQTT ;-)
Yes it is, but if you need some (especially industrial) device, it will most probably use modbus or some other protocol than MQTT.
Thanks very much this is very helpful
I have not used MODBUS in a number of decades :( This is certainly simpler than the hoops we had to jump through back in the day..
There are still so many products that use modbus on the market, and usually on affordable price. Even this is an ageing protocol, it does not appear to be dying any time soon
@@csongorvarga A good, simple, reliable protocol deserves to last. It was never considered "fast" but more than enough for its target use case. Also the hardware was so simple to install..
What hardware do you typically run your Flows on? Would Node-Red work on 8-bit microcontrollers and RS485?
I'm ordering a Pi-Zero and EsspressIf boards.. any thoughts on using python to talk to a modbus temperature sensor (RS485)?
For example, I see lots of options but not sure the difference: minimalmodbus , stephane/libmodbus , ClassicDIY/ModbusTool, eModbus/eModbus , modbus-esp8266 , QModMaster , rossmann-engineering/EasyModbusTCP_NET , EasyModbusTCP/UDP/RTU _NET?
BTW, modbus kinda looks like CanOpen.. is there any connection?
I am running my Node-Red on a Dell Optiplex micro PC with Linux. So it is a lot more powerful than a usual raspberry pi setup. Node-Red needs a proper computer to run on, no microcontrollers. Back in the day before Node-Red, I use this python script to read my solar inverter over modbus serial. That should get you started: github.com/SteveNew/GrowattRpi. I have no heard of these libraries, there must be tons of implementation of the protocol.
Modbus is a very simple master-slave protocol, where a master manages the communication. On a can network all the nodes can communicate and need to handle collision. So it is quite a different concept.
I have an issue, that queue periodically stops. I assume there might be some issue with respond and workflow stops since message with "next" topic is not emitted. Can I add repeat interval on "next" inject node to overcome this?
Yes, you can do that. Next skips to the next request, so worst case scenario you loose a request. But if it is only queries (get functions), it will be retrieved next time.
Make video on Node red msg queue
What do you mean msg queue?
How to send Modbus commands using node-red
For example 01 03 00 00 00 01 84 0A
How to play
Either with the modbus-write or the modbus-write-flex node. But you need to specify modbus parameters like function, start adddress and quantity.
Something intresting
Hi Csongor. I am currently using node-red for several connections and I have problems with the modbus server that I mount on node-red, after a while it stops working and I have to disable and enable that flow to get the server up.
The whole project has OPC-UA, MQTT and Modbus communications, all in different flows.
Using the node "ModBus-Server" or "ModBus-Flex-Server" I can raise a Modbus server or Modbus slave and configuring it with local ip address in "bind-addres" and in Port I put 55380, the problem is that it works for a while and then it stops working.
I can't find what the problem is and it only crashes if it is working with other flows with OPC and MQTT communications. All other communications are working properly
This sounds like a complex problem. I had somewhat similar issues when I was using the modbus getter, but after moving to the flex it was OK. Do you get any exceptions or warnings from any of the modbus nodes? Any information in the logs?
Very nice Video!
I have a problem with my setup. I need to read a scalefactor and the corresponding value at the same time but they are pretty far apart so the addresses are over 200 registers apart. How would you read them simultaneously? I am reading a solar inverter with a sunspec model. Just for reference :) Any ideas?
Thanks. I have similar cases, I think for one of my energy monitor, that voltages and currents are in a first 10-15 registers, and a final accumulated consumption is around register 343. I read the first 10 registers, and next I read the rest of 3-4 starting from 343. Do them is separete requests
But do you think that the request is fast enough?
The scalefactor determines the power of ten for the value, so it needs to be read simultaneously or in very short succession. I'll try to trigger the scalefactor read with the value read. Maybe that works.
@@ThePollution666 I think reading two shorter ranges of registers is quicker than reading a very larger range in a single request.
In my case worked for a while, i just deployed and says no data.
Where does it say no data?
@@csongorvarga solved, was a problem of modbus itself, unable to send data then the status of function filled gray and text no data
Sadly, I am too unfamiliar to follow the explanations.