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

The application should restore a failed serial or mqtt connection or exit #4

Open
gucki opened this issue Apr 1, 2022 · 0 comments

Comments

@gucki
Copy link

gucki commented Apr 1, 2022

From time to time it happens that the communication with the USB stick crashed/ gets lost:

enocean2mqtt_1  | 2022-04-01 10:38:39,517 INFO: SerialCommunicator started
enocean2mqtt_1  | 2022-04-01 10:38:39,517 INFO: Succesfully connected to MQTT broker.
enocean2mqtt_1  | 2022-04-01 10:38:39,518 WARNING: Replacing Packet.optional with default value.
enocean2mqtt_1  | 2022-04-01 10:38:39,619 INFO: Sending packet
enocean2mqtt_1  | 2022-04-01 10:38:39,621 DEBUG: 0x05 ['0x8'] [] OrderedDict()
enocean2mqtt_1  | 2022-04-01 10:38:39,722 DEBUG: 0x02 ['0x0', '0xff', '0xc3', '0xc2', '0x80'] ['0xa'] OrderedDict()
enocean2mqtt_1  | 2022-04-01 10:38:39,722 INFO: got response packet: OK
enocean2mqtt_1  | 2022-04-01 11:24:28,074 ERROR: Serial port exception! (device disconnected or multiple access on port?)
enocean2mqtt_1  | 2022-04-01 11:24:28,079 INFO: SerialCommunicator stopped

Ideally, the application should try to restore the connection. However the easiest solution to implement (I assume) would be to just exit the application. When using Docker, Docker could then simply restart the container (restart: always).

The same handling should be implemented for the MQTT connection.

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

1 participant