Hi,
I am working on a student project involve using iot2050 and Node-red to poll data.
So I connected my laptop to the iot2050 with an ethernet cable.I try to poll some number from a slave simulation program ( Modbus Slave) on my lap with a simple flow but it did not work.
My flow
[{"id":"4b33b8e7.cd2418","type":"tab","label":"TEST 2","disabled":false,"info":""},{"id":"761d864e.aa0488","type":"inject","z":"4b33b8e7.cd2418","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"1","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":170,"y":180,"wires":[["ec566e06.f820d"]]},{"id":"2cc1b935.4b8ff6","type":"modbus-flex-getter","z":"4b33b8e7.cd2418","name":"","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"server":"659784ca.45dbcc","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":false,"x":450,"y":180,"wires":[["c3e59b32.af2cb8"],["2d01a806.3793f8"]]},{"id":"c3e59b32.af2cb8","type":"modbus-response","z":"4b33b8e7.cd2418","name":"","registerShowMax":20,"x":690,"y":160,"wires":[]},{"id":"ec566e06.f820d","type":"function","z":"4b33b8e7.cd2418","name":"function 1","func":"msg.payload = { \n 'fc': 3, \n 'unitid': 1, \n 'address': 0, \n 'quantity': 10 } \nreturn msg\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":280,"y":240,"wires":[["2cc1b935.4b8ff6"]]},{"id":"2d01a806.3793f8","type":"debug","z":"4b33b8e7.cd2418","name":"debug 3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":660,"y":220,"wires":[]},{"id":"659784ca.45dbcc","type":"modbus-client","name":"","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"queueLogEnabled":false,"tcpHost":"192.168.200.5","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":"1","commandDelay":"1","clientTimeout":"1000","reconnectOnTimeout":true,"reconnectTimeout":"2000","parallelUnitIdsAllowed":true}]
I set my lap ip address to 192.168.200.5 and set Modbus Slave to listen to server 192.168.200.5 port 502.
I am very new to iot and Node-red in general so I do not know if the problem is node-red, hardware setup or outside factor.
If it is inappropriate to ask such problem here then I apologize.
Any help is appreciated.
Edit 1: I turned on error msg on the modbus-flex-getter node and in the Debug window, it said: "Error: Client Not Ready To Read At State init". Hope it provides some infomation.