Node-RED-Modbus RTU CRC error

Hello,

i am new in using Node-RED, i try to communicate with a TH-AP Sensor with Modbus RTU. I get a Request on the Bus but the is any error in the Data Flow. Here you can see my settings from the USB-RS485 Interface and from my work Flow and the Errors. I hope i can geet anny help about my problem.

2021-02-12 17_00_25-Window

2021-02-12 17_02_06-Window

The Datasheet from the device is.

Here is the flow export:
[{"id":"96a6adf6.fea4d8","type":"modbus-read","z":"22176d01.2807aa","name":"","topic":"","showStatusActivities":true,"logIOActivities":true,"showErrors":true,"unitid":"1","dataType":"InputRegister","adr":"0","quantity":"3","rate":"1","rateUnit":"s","delayOnStart":false,"startDelayTime":"","server":"c798025a.13bcf8","useIOFile":true,"ioFile":"c7b5fb16.23291","useIOForPayload":true,"emptyMsgOnFail":false,"x":310,"y":340,"wires":[["330cf08f.d193b","cd4b95dd.699d5"],["775859f2.3e6f1","ec01dacb.70f0b","6a3aef4f.ff668"]]},{"id":"c798025a.13bcf8","type":"modbus-client","name":"","clienttype":"serial","bufferCommands":true,"stateLogEnabled":true,"queueLogEnabled":true,"tcpHost":"127.0.0.1","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB1","serialType":"RTU","serialBaudrate":"19200","serialDatabits":"8","serialStopbits":"1","serialParity":"even","serialConnectionDelay":"100","unit_id":"1","commandDelay":"1","clientTimeout":"1000","reconnectOnTimeout":true,"reconnectTimeout":"2000","parallelUnitIdsAllowed":true},{"id":"c7b5fb16.23291","type":"modbus-io-config","name":"mod","path":"mod.log","format":"utf8","addressOffset":""}]

Hi .. from the documentation it seems that the temperature is a 16bit value read only from one address 0

image

What happens if you change in your settings instead of Quantity 3 to only 1

Hello,

thanks fpr the answer i have change the quanti to 1 and i get this erros:
2021-02-13 10_25_37-Window 2021-02-13 10_25_55-Window

I don´t understand why it don´t work. on the device is a communication led the LED is blinking orange thats good, because the error led is off. The terminierung is set on the device.

That might be an issue with your installation or the node. fs-extra is either missing from your installation or damaged.

There are a few things to try...

1st, does the modbus nodes have some kinda file logging built in? Turn it off, does the error still happen.

2nd, reinstall the modbus nodes. Do you still get the fs-extra issue?

3rd, manually install fs-extra

Hello,

thanks for the fast feedback, i have do no.1 so the first problem is fixed.
Butt i don´t get anny data is my flow correct? 2021-02-13 10_59_44-Window

Can you explin me what i have to do after installing:

where i must do the adjustment : const fse = require('fs-extra')

I don´t understand wh my modbus don´t work? The LED on the device shows the correct coommunication/ request. But i dont get data

There could be many reasons but we can clearly see an issue with fs-extra, so solve that first.

Restart node-red.

You don't. So long as you installed fs-extra either in ~/home/pi/.node-red or the modbus folder, it should be found when you restart node-red.

Many thanks @Steve-Mcl that was the solution i get some valus after reboot. But somtimes i get CRC error Code

2021-02-13 12_02_28-Window

can you explain me how i can change the Data to °C and % ? 2021-02-13 12_02_28-Window

That could be down to noise (bad cabling) or config settings mismatch.

Which value is which?
What value are you expecting?
And ultimately, what do you want to do with these values?

Here you can see the Data, i want tp geht the Temperature, Humidity and the drew point temperature. THan i want to show it in a gauge or a chart.

By the looks of it, just divide each one by 10.

In a function node (after the modbus node) you could...

msg.data = msg.payload;
msg.payload = {
  temperature: msg.data[0] / 10.0,
  feuchte: msg.data[1] / 10.0,
  taupunkt: msg.data[2] / 10.0,
}
return msg;

Ps, if you don't reply to my message I don't get a notification. I only seen your thread reply by accident.

Hello,

thanks fpr the solution, but it don´t work is the return correct? or should it return temperature, feuchte, taupunkt;?

Try wiring the Function node with Steve's code in the top output of your Modbus read node and not the bottom.

i have tried this, but it don´t work

i have tried it, but i dont work i get the answer undefined

Its because in your Debug node (the one after the function) you are trying to log msg.payload.function

Use image

Thats where the msg is .. msg.payload.function doesnt exist .. undefined

Watch this detailed video playlist by the developers of Node-red.
It will solve most of your questions on basic msg manipulation.

thanks that was the solution the modbus communication work well:-)

Hello, i have two questions, if i want to get data from different modbus devices should i use some modbus read nodes with different adresses? Whats the best solutuion to read data from different modbus devices?

In the Dasboard Layout i don´t can change the size and the place from my gauge or chart!?
I have tryied to unlook the chart but i don´t can move or change the size.