![]() ![]() ![]() ![]() To make life easier I do all my Modbus work on Node-Red. To use that all I need to know is the IP address of the stick (set up as static) and the port of the inbuilt server. Inside the stick is a server port that can communicate Modbus TCP. The data logging stick I have is effectively also a RS485/TCP dongle. The adaptor RS485 port is wired to the inverter RS485 port, the adaptor ethernet port is plugged into my router/network, and my HA talks over TCP. OK but the inverter is in the garage, so I bought an RS485 to ethernet adaptor instead. To connect to my solar inverter device I can use a USB to RS485 dongle on my HA and a pair of wires from the dongle to the RS485 port The stick talks Modbus over RS485, and then talks over the network to the internet. It has a RS485 port, into which usually sits a data logging stick. I have a solar inverter that is a Modbus device. There has to be an address, both IP and port, where Modbus commands can be received. Raspberry pi modbus server serial#The practical bit now sits with the device you are trying to talk to, since that has to expose Modbus to the world either via a serial port, or via a TCP network port eg over WiFi. Your computer can talk over TCP to any IP address on the network. How does this work? Well you need no adaptor on the computer provided you have a network connection. This is either hard wired or WiFi, but this can be used to carry Modbus commands, just over TCP rather than RS485 serial. Wire that to the Modbus device RS485 port, and bingo, Bob’s your uncle!Īll computers though do have TCP ports - the network port. Purchase a USB to RS485 dongle/device/thingy adaptor and your computer can be set up with a serial port that talks RS485. USB ports are actually serial ports, but almost everything uses them now and all we have to do is plug them in. Well, most home computers these days don’t have old type RS232 serial ports. Raspberry pi modbus server driver#Software (say HA) on my computer can format the correct things to say in Modbus to ask what is in register 1001 on device 1, push this to my computer serial port driver so that the serial port waggles the lines up and down correctly, the device I am talking to can read the waggles, reformat this into Modbus, and the software running on the device recognises this as ‘please tell me what is in register 1001’ and it response in reverse.Īll well and good, but what about Modbus over TCP I hear you ask. If both serial ports use RS485, and we get the baud rate, parity, stop bits and the wires round the right way, it will all work. So - for serial communication a device will have a serial port to which we need to connect our computer via a similar serial port. The good news is that, as long as you have the right hardware, the software usually looks after the rest. Modbus therefore now comes in two flavours - Modbus over serial (dedicated pair of wires) and Modbus over TCP (network/internet). Since ethernet networks have become common, Modbus can also operate over TCP (the communication protocol used in computer networks). Modbus started out by being over RS485, and most devices still use this standard. Devices are all connected to two wires in a long daisy chain. RS485 is a standard that operates over long distances for, mostly, industrial use. This is two wires (plus a ground if you insist) where the wires can be +/- or -/+, and the switching between the two states provides the basic binary communication. The basic one is RS232, but these days most devices are designed to use RS485. Speaking therefore needs an address (ID) a register and type of register, and if writing, the data to write.Īll this is designed to run over some physical communication, and for industrial controllers that is usually a serial coms link. Many slave devices can sit on the bus, each with an ID address, and wait to be spoken to. As it is a ‘bus’ one device (and one only) can be a master and initiate the conversation. Devices are mostly slaves, where they sit there and wait to be spoken to. To work with a Modbus device we need to talk to it and either ask what is in a register or try and write a value to a register. Executive summary: you don’t need any hardware, just the IP address and port number of the heating system/controller, which should be connected to your local network along with your Raspberry Pi. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |