Skip to content
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

Limitation of Unit ID #159

Closed
Winni66 opened this issue Feb 22, 2024 · 3 comments · Fixed by #160
Closed

Limitation of Unit ID #159

Winni66 opened this issue Feb 22, 2024 · 3 comments · Fixed by #160

Comments

@Winni66
Copy link

Winni66 commented Feb 22, 2024

Is your feature request related to a problem? Please describe.
I'm quite new to Modbus topic. This library is used within one Smarthome solution called Edomi. I'm using a Webasto Wallbox which uses Unit ID 255 and unfortunately this library allowes only ID up to 247. It's not possible to change.

Describe the solution you'd like
Would it be possible to disable ID limitation? I'm not able to build my own library for that, because I don't have the skills.

@aldas
Copy link
Owner

aldas commented Feb 22, 2024

As a immediate workaround - you can change the unitID value after packet has been created.

$packet = new ReadHoldingRegistersRequest($startAddress, $quantity, $unitID); 
$packet[6] = 255;

For example: unit ID is 7th byte for FC3 request.

* Example packet: \x00\x01\x00\x00\x00\x06\x01\x03\x00\x6B\x00\x01
* \x00\x01 - transaction id
* \x00\x00 - protocol id
* \x00\x06 - number of bytes in the message (PDU = ProtocolDataUnit) to follow
* \x01 - unit id
* \x03 - function code
* \x00\x6B - start address
* \x00\x01 - holding registers quantity to return

@Winni66
Copy link
Author

Winni66 commented Feb 22, 2024 via email

@aldas
Copy link
Owner

aldas commented Feb 23, 2024

I think you could create custom patch for PHP 7 to remove that validation check and let composer to apply it.

See

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants