[SOLVED] Hass.io addon USB open serial error - De Dietrich

I’m migrating from a Pi3 without HassIO to a brand new install using HassIO on a Pi4.

In my setup I have a python script that pulls data from my heater using serial interface and push it to MQTT (using https://github.com/enc-X/isystem-to-mqtt to be precise).

I have an issue with migrating this, I wrote a simple addon to be able to launch it (I’m familiar with Docker so I don’'t think I made a mistake here).

But when I start it, I get a serial.serialutil.SerialException: Port is already open.

I tried mapping my device by using auto_uart flag in config.json and then by using the devices binding, but without any change.

Does anybody have any idea of what can be using the port ? I looked around my setup and did not find anything related to it (I have a rfxtrx addressed by its id and a zwave stick also, which are working flawlessly).


As always, it is when you ask for help that you find a fix.
It seems that my problem was only due to a bug in code, I forked the repository, added a self.socket.close() before opening and everything now works flawlessly.

I think the python version I was using on my pi3 was not behaving the same way regarding this…

Issue closed :slight_smile: