Hi - I’m on my first HASS day! It’s been pretty great.
Wondering if I have a bug here in Arduino+Firmata+PyMata+hass, or if there’s a better way to resolve my problem.
Context: I’ve got a Arduino with the latest firmata firmware, I get exceptions in hass saying
- “The version of the StandardFirmata sketch was notdetected. This may lead to side effects”
- “serial.serialutil.SerialException: Attempting to use a port that is not open”
Things I’ve tried:
Rebooting, disconnecting powerring off.
Connecting successfully using PyMata (same version) to the arduino from within Raspbian, and inside the hass docker image I’m running
The only thing that seems to fix it is if I add “BOARD._board=PyMata(port)”, to this segment of code in init.py in the arduino component folder.
`
try:
BOARD = ArduinoBoard(port)
except (serial.serialutil.SerialException, FileNotFoundError):
_LOGGER.error(“Your port %s is not accessible”, port)
return False
BOARD._board=PyMata(port)
try:
if BOARD.get_firmata()[1] <= 2:
_LOGGER.error(“The StandardFirmata sketch should be 2.2 or newer”)
return False
`
I realize initializing that way is bad form, but it seems to be the only thing that fixes it. It could be indicative of a threading issue maybe? Can I solve this a different way?