Skip to content
This repository has been archived by the owner on Dec 16, 2023. It is now read-only.

USB Hid to Mqtt stops working #4

Open
goose2600 opened this issue May 29, 2021 · 4 comments
Open

USB Hid to Mqtt stops working #4

goose2600 opened this issue May 29, 2021 · 4 comments

Comments

@goose2600
Copy link

Home Assistant: core-2021.5.5, supervisor-2021.04.3
Mosquitto broker: version: 6.0.1
USB Hid to Mqtt: 1.1.0

Few days ago, I noticed that USB Hid to Mqtt stopped working. Unfortunately I can't say exactly when it stopped working.

Apparently it connects to the MQTT broker (using a random client name, as "hbmqtt/>H]\ZKA2K97yvuHR"), and in the log I can see the right token while scanning a RFID tag, anyway the the MQTT broker does not receive any messages.
The USB Hid to Mqtt log shows this error: "Input stream read timeout"
Here is the full log: https://pastebin.com/nJgbKGBx

Could you please help me to fix the issue?

Thanks

@gregod
Copy link
Owner

gregod commented Jun 6, 2021

Hi,
so this is a timeout within the mqtt client code. My first guess would be either an unstable network connection to the mqtt server or an overloaded server.

Could you first verify that the issue persists when using a different mqtt server?
For example: mqtt://test.mosquitto.org as mqtt connection string. (This is a public world-readable server)

@goose2600
Copy link
Author

goose2600 commented Jun 23, 2021

Hi, sorry for the late reply (I was quite busy at work).

I tried the connection string suggested by you, but I still get the "Input stream read timeout" error.

I am pretty sure that my issue is not related to the network connection (all the things are on the same machine) and the mqtt server is working without any issues.

Full log: https://pastebin.com/Z7FBGHVS

Thanks for your support.

@matthias-homee
Copy link

Hi @goose2600,

I try to start this add-on as well.

Currently I receive this error message
ERROR:root:Device /dev/input/event0 could not be found. Please check device list above

When I verify this information at supervisor --> system --> hardware, it seems ok

  • /dev/input/event0 (path)
  • /dev/input/by-id/usb-HXGCoLtd_HIDKeys-event-kbd (device id)

Is there something more to do?

Thank you
Matthias

@goose2600
Copy link
Author

goose2600 commented Dec 20, 2021

I tried another mqtt server, instead of the Home Assistant mqtt addon: I still get the "Input stream read timeout" error, but the mqtt server receive the token number.
So, it seems the issue is related to Home Assistant mqtt addon, which is not receiving any message.

This is the log when publishing a message using hbmqtt_pub from command line:

bash-5.1# hbmqtt_pub --url mqtt://user:password@homeassistant -t usbhid/tokens -m 1234567890
[2021-12-20 11:22:41,748] :: INFO - hbmqtt_pub/218-69e9541e-usbhid-to-mqtt Connecting to broker
[2021-12-20 11:22:41,788] :: INFO - Finished processing state new exit callbacks.
[2021-12-20 11:22:41,789] :: INFO - Finished processing state connected enter callbacks.
[2021-12-20 11:22:41,790] :: INFO - hbmqtt_pub/218-69e9541e-usbhid-to-mqtt Publishing to 'usbhid/tokens'
[2021-12-20 11:22:41,796] :: INFO - Finished processing state connected exit callbacks.
[2021-12-20 11:22:41,796] :: INFO - Finished processing state disconnected enter callbacks.
[2021-12-20 11:22:41,797] :: INFO - hbmqtt_pub/218-69e9541e-usbhid-to-mqtt Disconnected from broker

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants