RS485 to Wireless and IoT Edge Computer

Hi everyone !

I am new to working with these devices, I am trying to connect the RS495 sensor with the IoT Edge Computer, but I don’t know how or where to start. The only platform that I use so far is Node-red but I don’t really know how to connect them.

Watch out if someone can help me.

Greetings.

Hi @fsaavedra,

So technically it is possible to send and receive data with an unknown device. The Node-Red library(ncd-red-wireless) was really developed to work with our sensors. However I have made some recent modifications to allow it to communicate with any device over the 900 mhz wireless connection.

You will need to update the ncd-red-wireless library on your IoT Edge Computer to the latest version(1.5.36). After that you can paste in this flow:

[{"id":"2e70bbd.54c9244","type":"tab","label":"Flow 7","disabled":false,"info":""},{"id":"94d32281.16c8f8","type":"ncd-gateway-node","z":"2e70bbd.54c9244","name":"","connection":"ec90bd0d.073368","unknown_devices":true,"outputs":2,"x":750,"y":480,"wires":[[],["ee2552c6.41cf18"]]},{"id":"ee2552c6.41cf18","type":"debug","z":"2e70bbd.54c9244","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":970,"y":480,"wires":[]},{"id":"488ebd1b.ab66f4","type":"inject","z":"2e70bbd.54c9244","name":"Trigger","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":350,"y":480,"wires":[["8fb3b7bc.6126d"]]},{"id":"8fb3b7bc.6126d","type":"function","z":"2e70bbd.54c9244","name":"Build Packet","func":"\n//change the address here to the address of your RS485 modem\nmsg.payload.address = \"00:13:a2:00:01:02:03:04\";\n\n//change this byte array to the data you want to send to the modem\nmsg.payload.data = [0xF8,0x99,0x00,0x00,0x28];\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":530,"y":480,"wires":[["94d32281.16c8f8"]]},{"id":"ec90bd0d.073368","type":"ncd-gateway-config","name":"Module","comm_type":"serial","ip_address":"","tcp_port":"2101","port":"/dev/ttyS1","baudRate":"115200","pan_id":"7FFF","rssi":false}]

You can edit the function node there to change the address to your rs485 modem and you can change the data bytes that are being transmitted to it. Any data received from the rs485 device should print to the debug pane in node-red. Just press the button next to the trigger node to test a transmission.

This is sort of free use at your own risk stuff. Wasn’t really developed for this type of use but it may work for you.

Hi Travis, thanks for your reply. I already installed the library “ncd-red-wireless” v 1.5.36, but I have doubts about where I have to copy the code you sent me, since in the shell in a box it does not enter by number of characters and in Node-red it does not I really know where it is installed.

Thanks in advance.

Greetings.

Hi,

The code I sent is a flow.

Copy that code to your clipboard.
Open the Node-Red Web UI.
Click the menu button in the upper right corner.
Hover over Import, then click Clipboard.
Paste the code into the field.
Click New Flow.
Click Import.

You should now see the flow I shared with you. If you have any questions please let me know.

Thank you,
Travis Elliott

Hi Travis!

Thanks for the reply again, What I’m trying to do is read data through the RS485 to wireless that I bought from you.

I did tests with the 3-phase current meter and I had no major problems connecting them, but this sensor does not even appear to me when resetting the device.

Copy your code and enter the MAC of the MODBUS sensor but I cannot receive data.

I leave you an outline of what I want to do.

Greetings and thanks.

NCD

That RS485 box is not a sensor. It’s really a modem. It was not intended to be used the way you are using it. However it should work. If it is transmitting data then you should be getting data in the debug log panel in Node-Red. Do you have that Debug panel open?

Hi Travis!

We want to use it as a translator of a sensor, that is, a sensor is measuring energy and other variables and communicates them through RS485 with the wireless sensor to the Edge Iot Computer. Yes, I have the debug mode open, but I have nothing connected on A and B, I only have the RS485 to wireless connected to 9VDC.

Maybe that’s why it doesn’t show any data, or would it still show me data even if I don’t have anything connected in A and B? Excuse my ignorance Travis but I’m new on this.

Greetings and thanks again.

If data comes into that modem it should transmit it wirelessly which should be received by the IoT Edge Computer and that should output from the bottom connector on the NCD Gateway Node which is an output for data from unknown devices.

@Bhaskar may be able to provide some troubleshooting/hardware tips for connecting your RS485 signal to the RS485 modem(I know little to nothing about the protocol).

in modbus protocol you will have to send a message from the master uin this case node red. once the PR55-34 receives this message it will send the message to modbus , modbus will response against that message… PR55-34 will collect that message and then sent it back to node red .

Hi guys, thanks for the reply,
So the PR55-34 (I suppose it is the RS485 to Wireless sensor) has to be connected yes or yes to some device (that is, to have A and B connected to any device) to be able to carry out tests? Because I have the PR55-34 connected only to power, perhaps that is why I am not receiving anything.

I thought that when I connected it, it would send me messages such as error or zero.

Thanks and regards.

as soon as PR55-34 powers up it will send a run message. so if you have a debug mode connected to wireless modem node ( in node red) you should see a “RUN” message.

In order to talk to modbus device you will have to connect to A and B

Hi Bhaskar !,
I have been trying to connect the PR55-34 and visualize it in node-network, but no message appears in debug mode. (Not so when I connect the 3-phase current meter, there it did show me a message.)

Attached images of connected, maybe I am doing something wrong.

Greetings.

You will need to print debug message from the wireless gateway node. like this flow

[{“id”:“7204632a.638b3c”,“type”:“debug”,“z”:“5a614edf.32654”,“name”:"",“active”:false,“tosidebar”:true,“console”:false,“tostatus”:false,“complete”:“true”,“targetType”:“full”,“statusVal”:"",“statusType”:“auto”,“x”:770,“y”:260,“wires”:[]},{“id”:“c701fd67.511d4”,“type”:“ncd-gateway-node”,“z”:“5a614edf.32654”,“name”:"",“connection”:“c7dd74a2.790d78”,“unknown_devices”:0,“outputs”:1,“x”:460,“y”:260,“wires”:[[“7204632a.638b3c”]]},{“id”:“c7dd74a2.790d78”,“type”:“ncd-gateway-config”,“name”:"",“comm_type”:“serial”,“ip_address”:"",“tcp_port”:“2101”,“port”:“COM5”,“baudRate”:“115200”,“pan_id”:“7fff”,“rssi”:false}]

Hi Bhaskar,

I can´t paste your flow in my Node-Red.

Grettings

@fsaavedra can you please share the flow you are using in Node-Red?

Yes!

[{“id”:“68541cb3.c2fb64”,“type”:“tab”,“label”:“Flow 1”,“disabled”:false,“info”:""},{“id”:“cd13ed0c.f5536”,“type”:“ncd-wireless-node”,“z”:“68541cb3.c2fb64”,“name”:“3ph”,“connection”:“837142ce.132b28”,“config_comm”:“837142ce.132b28”,“addr”:“00:13:A2:00:41:D5:EF:43”,“sensor_type”:“28”,“auto_config”:true,“node_id”:0,“delay”:300,“destination”:“0000FFFF”,“power”:4,“retries”:10,“pan_id”:“7FFF”,“change_enabled”:"",“change_pr”:“0”,“change_interval”:“0”,“cm_calibration”:“60.6”,“bp_altitude”:“0”,“bp_pressure”:“0”,“bp_temp_prec”:“0”,“bp_press_prec”:“0”,“amgt_accel”:“0”,“amgt_mag”:“0”,“amgt_gyro”:“0”,“impact_accel”:“0”,“impact_data_rate”:“4”,“impact_threshold”:25,“impact_duration”:1,“activ_interr_x”:1,“activ_interr_y”:2,“activ_interr_z”:4,“activ_interr_op”:8,“force_calibration_co2_auto_config”:"",“force_calibration_co2”:400,“filtering”:0,“data_rate”:5,“time_series”:0,“reading_type”:1,“output_data_rate_101”:0,“sampling_duration_101”:1,“x_axis_101”:"",“y_axis_101”:"",“z_axis_101”:"",“sampling_interval_101”:1,“full_scale_range_101”:1,“x”:90,“y”:120,“wires”:[[“e33ea6e5.049788”]]},{“id”:“baa5c3f3.6c8dd”,“type”:“debug”,“z”:“68541cb3.c2fb64”,“name”:"",“active”:false,“tosidebar”:true,“console”:false,“tostatus”:false,“complete”:“payload”,“x”:590,“y”:180,“wires”:[]},{“id”:“62fdde2d.3785”,“type”:“debug”,“z”:“68541cb3.c2fb64”,“name”:"",“active”:true,“tosidebar”:true,“console”:false,“tostatus”:false,“complete”:“true”,“x”:390,“y”:60,“wires”:[]},{“id”:“e33ea6e5.049788”,“type”:“function”,“z”:“68541cb3.c2fb64”,“name”:“function”,“func”:“var label1 = msg.topic;\nvar value1 = msg.payload.channel_1;\nvar value2 = msg.payload.channel_2;\nvar value3 = msg.payload.channel_3;\n\nmsg.payload = {\n [label1]: value1 , value2 , value3\n};\n\n\nmsg.payload.ubidotsDeviceLabel = “3PH”;\n\nreturn msg;”,“outputs”:1,“noerr”:0,“x”:400,“y”:120,“wires”:[[“baa5c3f3.6c8dd”]]},{“id”:“ba03ad81.235”,“type”:“ncd-gateway-node”,“z”:“68541cb3.c2fb64”,“name”:"",“connection”:“9d9ada87.3c6b08”,“unknown_devices”:false,“outputs”:1,“x”:110,“y”:60,“wires”:[[“62fdde2d.3785”]]},{“id”:“837142ce.132b28”,“type”:“ncd-gateway-config”,“z”:"",“name”:"",“comm_type”:“serial”,“ip_address”:"",“tcp_port”:“2101”,“port”:"/dev/ttyS1",“baudRate”:“115200”,“pan_id”:“7FFF”,“rssi”:false},{“id”:“9d9ada87.3c6b08”,“type”:“ncd-gateway-config”,“z”:"",“name”:“Module”,“comm_type”:“serial”,“ip_address”:"",“tcp_port”:“2101”,“port”:"/dev/ttyS1",“baudRate”:“115200”,“pan_id”:“7FFF”,“rssi”:false}]

This flow show me when I turn on the 3 phases current meter, but no de PR55-34

Grettings.

you can use this flow. it will print all the incoming message.
[{“id”:“fb30e8f3.e5baa8”,“type”:“tab”,“label”:“Flow 7”,“disabled”:false,“info”:""},{“id”:“3f7f0e22.97a9b2”,“type”:“ncd-gateway-node”,“z”:“fb30e8f3.e5baa8”,“name”:"",“connection”:“c7dd74a2.790d78”,“unknown_devices”:true,“outputs”:2,“x”:420,“y”:500,“wires”:[[“1c0ac5bf.fdcbea”],[“7005a310.65039c”]]},{“id”:“1c0ac5bf.fdcbea”,“type”:“debug”,“z”:“fb30e8f3.e5baa8”,“name”:"",“active”:true,“tosidebar”:true,“console”:false,“tostatus”:false,“complete”:“false”,“statusVal”:"",“statusType”:“auto”,“x”:740,“y”:500,“wires”:[]},{“id”:“7005a310.65039c”,“type”:“debug”,“z”:“fb30e8f3.e5baa8”,“name”:"",“active”:true,“tosidebar”:true,“console”:false,“tostatus”:false,“complete”:“false”,“statusVal”:"",“statusType”:“auto”,“x”:780,“y”:560,“wires”:[]},{“id”:“c7dd74a2.790d78”,“type”:“ncd-gateway-config”,“name”:"",“comm_type”:“serial”,“ip_address”:"",“tcp_port”:“2101”,“port”:“COM5”,“baudRate”:“115200”,“pan_id”:“7fff”,“rssi”:false}]

MAKE sure you change the serial device port to tty/S1.

Hi Bhaskar, Thanks for reply, but I can´t put your flow in my node red.

Greetings.

try this
[{“id”:“fe8bad37.c94ea”,“type”:“tab”,“label”:“Flow 8”,“disabled”:false,“info”:""},{“id”:“5f9415d8.2439ec”,“type”:“ncd-gateway-node”,“z”:“fe8bad37.c94ea”,“name”:"",“connection”:“c7dd74a2.790d78”,“unknown_devices”:true,“outputs”:2,“x”:500,“y”:380,“wires”:[[“5befeb89.3346a4”],[“ce1bc54d.d2d358”]]},{“id”:“5befeb89.3346a4”,“type”:“debug”,“z”:“fe8bad37.c94ea”,“name”:"",“active”:true,“tosidebar”:true,“console”:false,“tostatus”:false,“complete”:“false”,“statusVal”:"",“statusType”:“auto”,“x”:780,“y”:340,“wires”:[]},{“id”:“ce1bc54d.d2d358”,“type”:“debug”,“z”:“fe8bad37.c94ea”,“name”:"",“active”:true,“tosidebar”:true,“console”:false,“tostatus”:false,“complete”:“false”,“statusVal”:"",“statusType”:“auto”,“x”:800,“y”:420,“wires”:[]},{“id”:“c7dd74a2.790d78”,“type”:“ncd-gateway-config”,“name”:"",“comm_type”:“serial”,“ip_address”:"",“tcp_port”:“2101”,“port”:“COM5”,“baudRate”:“115200”,“pan_id”:“7fff”,“rssi”:false}]
flows (1).json (909 Bytes)

Hi Bhaskar,

I put your flow on my node red but still no message appears from the modbus sensor:

Could it be because I only have the negative and positive pins connected?
Or the other may be because I have not removed the jumpers from inside the PR55-34, which are set to 1,2 and 3.

I really don’t know why I’m not receiving data, since turning it on should send data right away like the 3-phase current sensor.

Greetings and thanks.