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

MQTT Daemon Not Connecting to MQ Broker #3

Closed
preeefix opened this issue Apr 18, 2020 · 5 comments
Closed

MQTT Daemon Not Connecting to MQ Broker #3

preeefix opened this issue Apr 18, 2020 · 5 comments
Labels
bug Something isn't working MQTT Something related to the MQTT broker.
Milestone

Comments

@preeefix
Copy link
Collaborator

Yi-Hack-Allwinner Version: 0.1.2

Description:

Using the web interface to configure the MQTT then rebooting the camera does not show that the camera is connecting to the MQ Broker.

In this case, I'm using Mosquitto MQ running on a Raspberry Pi under Docker. Connecting to port 1883.

Checking the Mosquitto logs, I don't see a connection attempt to the broker.

@preeefix preeefix added the bug Something isn't working label Apr 18, 2020
@preeefix preeefix added this to the 0.2 milestone Apr 18, 2020
@preeefix preeefix changed the title MQTT Motion Not Connecting to MQ Broker MQTT Daemon Not Connecting to MQ Broker Apr 18, 2020
@preeefix preeefix added the MQTT Something related to the MQTT broker. label Apr 18, 2020
@roleoroleo
Copy link
Owner

roleoroleo commented Apr 18, 2020

Log in with ssh and run the program manually:

root@yi-hack:~# killall mqttv4
root@yi-hack:~# LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/yi-hack/lib
root@yi-hack:~# /home/yi-hack/bin/mqttv4

You should see a log like this:

Starting mqttv4 v0.0.3
Trying to connect... Client yi-cam-a sending CONNECT
Client yi-cam-a received CONNACK (0)
. connected!
CALLBACK MOTION STOP
Client yi-cam-a sending PUBLISH (d0, q1, r0, m1, 'home-assistant/bedroom/motion_detection', ... (3 bytes))
Client yi-cam-a received PUBACK (Mid: 1)
CALLBACK MOTION START
Client yi-cam-a sending PUBLISH (d0, q1, r0, m2, 'home-assistant/bedroom/motion_detection', ... (2 bytes))
Client yi-cam-a received PUBACK (Mid: 2)

Post your log.

@roleoroleo
Copy link
Owner

Check if the client id is correct.
If you have more than 1 cam you must use different names otherwise the server will drop the connections.

@preeefix
Copy link
Collaborator Author


root@xiaoyi:~# killall mqttv4
killall: mqttv4: no process killed
root@xiaoyi:~# LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/yi-hack/lib
root@xiaoyi:~# /home/yi-hack/bin/mqttv4
Starting mqttv4 v0.0.3
Can't open file "/home/yi-hack-v4/etc/mqttv4.conf": No such file or directory
Cannot open config file. Skipping.
Trying to connect... Unable to connect (Connection refused).
Unable to connect (Connection refused).
Unable to connect (Connection refused).
Unable to connect (Connection refused).
Unable to connect (Connection refused).
Unable to connect (Connection refused).

As discussed in Discord, it looks like a missing space in the setup script. There's no symlink between yi-hack-v4 and yi-hack.

@roleoroleo
Copy link
Owner

roleoroleo commented Apr 18, 2020

Fixed here:
0f22892

Tested removing manually the link .
After the reboot the link is ok and mqttv4 is running.

@preeefix
Copy link
Collaborator Author

Issue fixed in 0f22892, closing issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working MQTT Something related to the MQTT broker.
Projects
None yet
Development

No branches or pull requests

2 participants