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.
Thanks in advance.
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.
Thanks in advance.
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.
I spotted this:
- 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.
Thanks again.
There is some example arduino code here URM14 Industrial Ultrasonic Sensor Example Code for Arduino | DFRobot Wiki that shows what addresses to use and registers to write and read. Hopefully that will give you a clue.