Skip to content

Accessing devices with Slave-ID 0 is impossible #37

@alphafalcon

Description

@alphafalcon

If I try to run
modbus 192.168.X.Y:502 -s 0 REGISTER
I get a TimeoutError. Sniffing with wireshark revealed that modbus-cli was sending a slave-id of 255.
I belive that this line is responsible, as 0 is interpreted als falsy and gets replaced by 255.

if not slave_id:

A possible fix would be adding a default of 255 to the command line argument -s and dropping the check referenced above. This should not change the behaviour, unless 0 is explicitly set on the commandline

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions