Closed Lanruo555 closed 2 years ago
@imbeacon @samson0v Can you take up some time to help me solve this problem? Thanks a lot !
Hi
device disconnected or multiple access on port?
Could mean that multiple processes are trying to read serial port at the same time. Do you have any other process/program that is attached to that exact serial port?
Another thing that could cause this is that you are setting "host": none
on each slave. Try deleting that line its not necessary.
you can checkout docs https://thingsboard.io/docs/iot-gateway/config/modbus/?modbusConnection=serial for setting up serial modbus communication
Sam
I have already solved this problem.
Describe the issue Create description about your issue, and your actions to solve it. I created a gateway device and two subdevices on the things board platform and set their association as: the gateway device contains two subdevices.Their attribute values, telemetry values, and shared attribute values are also configured in the profile modbus_new.json.When I configure any other device in the modbus_new.json that always works fine, but when I configure both devices simultaneously, I get the error.
Configuration (Attach your configuration file) Notate: Remove Access token from file if you want to attach a tb_gateway.yaml { "master": { "slaves": [ { "unitId": 1, "deviceName": "test1", "attributesPollPeriod": 5000, "timeseriesPollPeriod": 5000, "sendDataOnlyOnChange": false, "attributes": [ { "byteOrder": "BIG", "tag": "temperature", "type": "bytes", "functionCode": 3, "registerCount": 1, "address": 1 } ], "timeseries": [ { "tag": "distance", "type": "bytes", "functionCode": 3, "objectsCount": 1, "address": 2 } ], "attributeUpdates": [ { "tag": "shared_value_1", "type": "32uint", "functionCode": 6, "objectsCount": 2, "address": 3 }, { "tag": "shared_value_2", "type": "32uint", "functionCode": 6, "objectsCount": 2, "address": 4 } ], "rpc": [ { "tag": "bearing_bpfo", "type": "32uint", "functionCode": 6, "objectsCount": 2, "address": 5 } ], "host": null, "port": "/dev/ttyUSB0", "type": "serial", "method": "rtu", "timeout": 35, "byteOrder": "BIG", "wordOrder": "BIG", "retries": null, "retryOnEmpty": null, "retryOnInvalid": null, "baudrate": 9600, "pollPeriod": 5000, "connectAttemptCount":1 }, { "unitId":2, "deviceName":"Test2", "attributesPollPeriod":5000, "timeseriesPollPeriod":5000, "sendDataOnlyOnChange":false, "attributes":[ { "byteOrder":"BIG", "tag":"temperature", "type":"bytes", "functionCode":3, "registerCount":1, "address":10 } ], "timeseries":[ { "tag":"distance", "type":"bytes", "functionCode":3, "objectsCount":1, "address":11 } ], "attributeUpdates":[ { "tag":"shared_value_1", "type":"32uint", "functionCode":6, "objectsCount":2, "address":12 } ], "host":null, "port":"/dev/ttyUSB0", "type":"serial", "method":"rtu", "timeout":35, "byteOrder":"BIG", "wordOrder":"BIG", "retries":null, "retryOnEmpty":null, "retryOnInvalid":null, "baudrate":9600, "pollPeriod":5000, "connectAttemptCount":5 } ] },
"slave": null }
Connector name (If you need help with some connector/converter): Modbus Connector
Error traceback (If it was raised):
Versions (please complete the following information):