I'm fairly new to all this stuff and have not been able to figure out how to configure the Modbus Reader or Getter nodes to access data from the DFRobot URM14 Sensor. I'm using the WaveShare 2Channel RS485 SC16IS752+SP3485 board on a Pi. The Pi has been configured to see the board and I've verified that ttySC0 and ttySC1 do in fact exist.
I'm able to connect to the Sensor but what's perplexing me is how to setup the Modbus Nodes to read either the Distance or Internal Temperature Registers (i.e 0x05 & 0x06). I've also read somewhere that I'm supposed to setup an RS485 Server and that confuses me as well. Once I can get this working I will be connecting 6 of these sensors to the system and so I will need to change each units addresses.
Any help would be much appreciated. I'm hoping to just use the Modbus-contrib palette nodes because I'm clueless at this time on how to enter json code. I will continue to experiment because I like figuring things out myself however I've had no luck acquiring any data from the URM14 Transducer so far.
A quick look at that board seems to say it has an SPI interface - I'm not sure of any simple nodes that talk SPI. most times I have seen this folk use something like a python program to talk to the SPI and then forward that to Node-RED. But as you say they are appearing as ttySC0 and 1 then maybe try a simple serial port node set to the correct baud rate.
Waveshare also seem to do 4 channel USB connected devices that would expose the ports as simple serial ports (tty...) that may be simpler than the nSPI interface and then either the serial port node or modbus serial node may read it.
Sadly I have no experience with modbus nor any waveshare kit so can't really help with any specifics.
Home Assistant Limitations : On Home Assistant OS (HAOS) , the /dev/ttySC0 device may not be accessible due to containerization restrictions, even if it works on standard Raspberry Pi OS.
Not sure if that is relavent.
Also:
Configuration : Ensure the correct interrupt pin is specified in the overlay (e.g., int_pin=24 ) and that the I2C address is correct (default 0x48 ) if using the I2C variant.
Again, no idea if this is relevant. Like Dave, I don't use any of this kit.
If you can't work it out, you could try using a cheap ESP32 to act as the SPI host instead. Then either connect that to the Pi over serial or, get the ESP to send data direct to MQTT.
The 4 port usb -485 interface is only 20-30 usd so probably easier than trying to roll your own with an esp chip which just adds more variables to the mix.
The board isn't the issue, the issue is me. The board is properly recognized and the transducer is connected properly. What the issue is, is that I have no idea what to enter in the Modbus Read or Getter nodes to be able to read the sensor data. This is my first kick at the cat with a Modbus Device and I have no clue what parameters to enter into the nodes. So it's a stupid human problem not a hardware issue.
I've been studying the example code for several days but I'm unsure how to translate any of it into the Node Red Modbus Nodes. I've ordered some RS485 Boards for Arduino so I can run tests to see if I can figure this out. At this point many of the Modbus Node parameters don't make sense to me.
Can anybody shed some light on this, please. I've tried dozens of things and the Modbus nodes either output nothing or errors. I've never worked with anything that's RS485 before and I'm clueless where to start. I'm not looking for any json code, I hope that I can just fill in the node boxes and tabs to get output from this sensor.
You’d probably need to configure Raspbian properly for that board, set up the correct RS485 wiring, and use the appropriate baud rate and serial settings. It may also require assigning a Modbus address and configuring the sensor itself before communication works correctly. Also, as far as I remember, the RS485 markings are not always consistent between devices some use A/B while others use +/-.
The bus may also require 120-ohm termination resistors at the ends of the line, especially if you have multiple devices connected.
So this thread is going way off topic. All I'm asking for is some info on how to fill in the Modbus Read parameters. The system properly recognizes the hat and connects to it properly but I'm to stupid to figure out how to get any output from the node. Here's a screenshot of the node with the empty fields and the manual for the URM14.
Thanks for your response, I'm still not quite 100% sure if I'm entering these parameters into the Modbus Read node properly but it also looks like the transducer is bad. I received the MAX485 boards today for Arduino and I'm unable to get any data from the unit. I do have more of these on order and they should be here soon so hopefully I can verify this soon.
To everyone who helped me I very much appreciate the time you have taken to do so.
Once again thanks for everyone's help. I received the new units today and after 15 minutes of reconnection and configuration I have been able to read the first unit connected. Potentially I may have inadvertently changed the baud rate or address of the original unit or it may have been damaged since it had been hanging around for over a year and used for several mockups.