Presence Server doesn't detect anything

28 views
Skip to first unread message

Michael Smits

unread,
Mar 24, 2018, 6:31:52 AM3/24/18
to Happy Bubbles
Hi Guys,

I followed the instructions for the installation on the PI3, everything went well but there won't show up any BLE device.
I configured the HappyBubble and set up the ip address of the pi in the mqtt settings, on the homepage it shows it's connected (wifi & mqtt).
When i hold the button for 5 seconds to go out of the configuration mode, the happybubble itself does detect devices (as i can see with the green blinking led), but in the presence server nothing came up.
They're both in the same network and i can ping the HappyBubble from the Raspberry pi. 

Can someone help me please? :) 

Thank you!

Michael Smits

unread,
Mar 24, 2018, 6:33:41 AM3/24/18
to Happy Bubbles
Oh - btw, when i go back in configuration mode it says; wifi connected, mqtt disconnected. When i click on the update button on the mqtt server settings its connected again. 
Don't know if thats normal?

Op zaterdag 24 maart 2018 10:31:52 UTC schreef Michael Smits:

Michael Smits

unread,
Mar 24, 2018, 6:41:52 AM3/24/18
to Happy Bubbles
Some additional info:

The mosquitto server is running; the last line of the logfile:

1521887870: New client connected from 192.168.178.128 as happy-bubbles-ble (c1, k60).
1521888029: New connection from 192.168.178.128 on port 1883.

Michael Smits

unread,
Mar 24, 2018, 8:32:29 AM3/24/18
to Happy Bubbles
Another additional info;

The presence server is connected to my Home-Assistant mqtt server, but the presence server showing none devices.
As soon as i remove this part from the presence.service; (the part in bold)
ExecStart=/home/pi/presence/presence -http_host_path=0.0.0.0:5555 -mqtt_host "192.168.178.15:1883" -mqtt_username "here_my_username" -mqtt_password "here_my_password"

It starts showing devices in the presence server, but now it's not connected to my mqtt server. Do i make a mistake in the syntax? Do i need to remove the quotes around the ip/username/password?

Thank you!


Michael Smits

unread,
Mar 24, 2018, 9:08:43 AM3/24/18
to Happy Bubbles
I'm sorry for spamming;

Maybe it has something to do with my setup;

I have two raspberry pi's:

1. Home Assistant (192.168.178.15:1883)
2. Presence Server (192.168.178.195)

I think i'm changing the local mqtt server address in the config file which the webinterface is listening to? Or doesn't this make sence? It needs to report to the mqtt server of the 192.168.178.15.

nemik

unread,
Mar 24, 2018, 10:14:44 AM3/24/18
to Happy Bubbles
Michael,

No worries about spamming, in fact thanks for posting all this because I'm sure you aren't the only one solving this problem, so it will help others too as they debug their own setups.

It definitely sounds like you're mixing up your MQTT brokers. Last I read, the built-in Python MQTT broker in Home Assistant isn't great and as compliant with the MQTT specs as mosquitto which is the one I'd recommend. Are you running a second mosquitto broker on the .195 pi? The fact that it works at all when you leave out those arguments in bold ("mqtt_host", etc) means you probably are. If you don't include "mqtt_host" argument when running the server, it will default to localhost so I guess you must have on there. But then you also need to point your Happy Bubbles detectors (in their config menu) to the same broker that the presence server is pointing to. Both the detector and the presence server are MQTT clients that need to connect to the same broker.

If you really want both to point to the .15 then you need to point your detectors there (to .15) as well as the presence server. I think that might be where the confusion lies, the detectors don't need to connect to the same IP as the presence server, they need to connect to the same MQTT broker the presence server connects to.

I hope this helps and makes sense, I realize it can be confusing. Best of luck!
Message has been deleted

Michael Smits

unread,
Mar 24, 2018, 10:44:42 AM3/24/18
to Happy Bubbles
Hi Nemik,
Thanks for your reply. That makes sence!
I thought the detectors needed to point to the presence server, and the presence server to the Home Assistant mqtt in order to make the presence server work.

So if I'm correct: when I point the detectors to the .15 address the presence server gui is filled with devices? And I have the functionality of the presence server as well?

Btw - on my Home Assistant I have the mosquito mqtt installed (hassio repository), but your advise is to use the mqtt mosquito (standalone) on the presence server? Maybe also better to separate the mqtt and Home assistant for CPU?

Thanks again for your help!

nemik

unread,
Mar 24, 2018, 10:47:48 AM3/24/18
to Happy Bubbles
Michael,

Yes, that's correct. As I said, the detectors and the presence server are both MQTT clients that connect to a single broker. The detectors just publish the BLE advertisements they see to it, and the presence server subscribes to see those and correlate them together from multiple detectors to figure out which one a beacon is closest to. 

Main point is, if you point your detectors to the .15 address, then the "mqtt_host" argument when running the presence server also must be set to the .15 address.

As for broker, as long as you're running mosquitto you're fine, the one from hassio is fine, no need to change. I think a long time ago Home Assistant had its own built-in MQTT server which wasn't recommended. But I don't really use Home Assistant much (I prefer Node-Red) so I'm not sure about this. Your setup sounds fine.
Reply all
Reply to author
Forward
0 new messages