You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm using a Seeedstudio USB-CANalyzer interface with a bitrate of 500,000. I am communicating with a battery that uses extended arbitration ID. I want to know how long does it take for my battery to enter Sleep Mode (stop sending CAN messages). Hence I am using the next code:
Currently I have let my script run but randomly I would get the next exception raised.
Exception has occurred:
TypeError
ord() expected a character, but string of length 0 found
line 29, in main
msg = Bus.recv(timeout=2)
TypeError: ord() expected a character, but string of length 0 found
The manufacturer comments the time to enter sleep mode, if the battery is not in use, is a bit longer than 2 hours. Altough I could come around with a quick fix or just assume manufacturer is correct, I wonder if there is something I am skipping or I should consider to understand better this error.
It's interesting to see the comment here that ser.read can return an empty string, and yet this possibility is seemingly not catered for in various places, e.g. on lines 259 or 280.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Hi, I'm using a Seeedstudio USB-CANalyzer interface with a bitrate of 500,000. I am communicating with a battery that uses extended arbitration ID. I want to know how long does it take for my battery to enter Sleep Mode (stop sending CAN messages). Hence I am using the next code:
Currently I have let my script run but randomly I would get the next exception raised.
Exception has occurred:
TypeError
ord() expected a character, but string of length 0 found
line 29, in main
msg = Bus.recv(timeout=2)
TypeError: ord() expected a character, but string of length 0 found
The manufacturer comments the time to enter sleep mode, if the battery is not in use, is a bit longer than 2 hours. Altough I could come around with a quick fix or just assume manufacturer is correct, I wonder if there is something I am skipping or I should consider to understand better this error.
Thank you!
All reactions