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

Add modbus input validation? #23

Open
sandervandegeijn opened this issue Nov 7, 2021 · 2 comments
Open

Add modbus input validation? #23

sandervandegeijn opened this issue Nov 7, 2021 · 2 comments

Comments

@sandervandegeijn
Copy link

I'm still running the 2.17 firmware, but it does crash sometimes when modbus is used (integrated it myself using my https://github.com/ict-one-nl/Modbus2Mqtt library). Looking at the code - maybe I'm looking in the wrong place - but I don't seem to see input validation (expecting an int, make sure it's a valid int) on incoming modbus traffic.

I suspect this could be the issue of my stability issues, in the 2.20 firmware I'm not seeing it either (but I'm not a C++ crack so bear with me :) )

@mstegen
Copy link
Member

mstegen commented Nov 7, 2021

Can you give me an example in the code? All modbus registers are 16 bit wide, what the purpose of this data is, depends on the modbus device. It can be a signed or unsigned 16 bit integer, the MSB or LSB of a 32 bit integer, or half of floating point number.

@IgorYbema
Copy link

Isn't this just because you are using modbus itself wrong as a protocol? Your mqtt gateway as a master talking to smartevse as a master isn't supported in modbus. Bad timing and both master are active at the same time.

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

No branches or pull requests

3 participants