-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I got an error using mbpoll: #75
Comments
I advise you to consult https://www.modbus.org/docs/Modbus_over_serial_line_V1_02.pdf |
In that document, on page 7, it says devices can only have unique addresses assigned from 1 to 247. But then on page 8 it goes on to say addresses from 0 to 255 are valid, with 0 being a broadcast address and 248 to 255 being reserved for future use. mbpoll does not currently allow submissions on this broadcast address 0 when in RTU mode, and it also does not permit using any of these reserved addresses even though the spec does not prevent their use, it just says you must not assign these IDs to devices. There are a number of devices around that use address 0 for setting their assigned address (so you can change the device address when you don't know what it currently is set to) as well as devices that use 255 for a similar purpose, even though technically listening on address 255 is not defined in the standard. I think mbpoll should at least allow you to send messages on all 255 addresses listed in the spec, because it's a very useful tool when debugging and being able to push the limits of the standard when you need to is what makes tools like this so powerful. At the very least I think it should support address 0 out of the box given that this is defined in the standard. |
Also this seems like a similar issue to #39 |
I pluged a waveshare usb->RS485 dongle and the port appeared is /dev/ttyACM0. I used the comand:
sudo mbpoll -a 255 -b 9600 -d 8 -s 1 -P none -t 3 -r 1 -c 2 /dev/ttyACM0
And I got:
mbpoll: modbus-rtu.c:110: _modbus_rtu_build_request_basis: Assertion `ctx->slave != -1' failed.
May you help me?
The text was updated successfully, but these errors were encountered: