-
Notifications
You must be signed in to change notification settings - Fork 0
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
Sort out serComm #16
Comments
Controller comm parameters are 4800 baud, 8 data bits, 1 stop bit, no parity and no flow (so 9 bits total per word - I'm assuming it's a 16 bit word size but I have no good idea). No other comm options. TimePerBit (in sec) is 1 / baud rate, so that's ~208 microseconds per bit right there. With 9 bits per word, and 265 bytes total, that's 0.497 sec right there without any overhead or anything else. So 0.5 seconds is definitely too short. Le sigh. |
The way to fix this is to change serComm to read until the buffer is empty, not read for however long the timeout happens to be. I should just do that. |
Since I'm using pyserial, if I open the socket with See https://pyserial.readthedocs.io/en/latest/pyserial_api.html#serial.Serial.__init__ |
Had to fall back to 1.0 seconds because the LS325 and the Sunpower controllers were dropping/mangling responses! Annoying. |
For a Sunpower GenII cooler, the
STATE
command returns 265 bytes:For timeout values less than 0.75 sec, I was getting less than 265 bytes - seemed like 0.5 seconds would get ~208 bytes, causing this query to fail because some of it was left on the socket buffer 😞
The text was updated successfully, but these errors were encountered: