Mossquitto get data from another MQTT Broker - lollipop camera

Hi, im trying to get data from another MQTT Broker (Lollipop Baby Camera).
Im able to connect to that Broker via MQTT Explorer app with this confifguration:
obrázok
Username and password empty, encryption enabled, cert validation disabled.

Im trying to create mosquitto addon configuration in mosquitto.conf file. I have tried multiple things, but all the time it ends with:

1653175898: Connecting bridge (step 1) lollipop_mqtt (192.168.100.25:1883)
1653175898: Connecting bridge (step 2) lollipop_mqtt (192.168.100.25:1883)
1653175898: Client local.core-mosquitto.lollipop_mqtt closed its connection.

Example of configuration i was trying to use:

connection lollipop_mqtt
address 192.168.100.25:1883
bridge_insecure true
local_username <username>
local_password <password>
topic # in 0 lollipop/ <mainTopicId>/

Can someone help me with that config?

Where exactly are you entering that?

directly into mosquitto.conf file in share/mosquitto folder and i have changed customize in addon configuration to:

active: true
folder: mosquitto

I have solved that:
Export lollipop camera cert

  1. e.g in firefox navigate to camera mqtt server - https://<lollipop camera ip>:1883/
  2. in url bar click on ‘Not secure’
  3. navigate to cert dialog and certification path
  4. open lollipop.camera certificate
  5. save that lollipop.camera certificate as Base64 encoded cert

  6. copy that cert to e.g. \share\mosquitto\certs\ . My cert got name lollipop.crt

Change mosquitto addon config

  1. change in configuration customize section
    active: true

  2. create mosquitto.conf in \share\mosquitto\ (location is specified in that configuration customize section)

  3. paste this to mosquitto.conf and change to your ip, name, password, cert file location and topic.

connection lollipop_mqtt
address <lollipop camera ip>:1883
bridge_insecure true
notifications false
try_private false
bridge_cafile /share/mosquitto/certs/lollipop.crt
local_username <mqtt username>
local_password <mqtt password>
topic # in 0 lollipop/ <main camera topic>/
  1. restart mosquitto addon in hassio

And after that you can see in mqtt explorer
obrázok

How to get main camera topic?
You can use MQTT Explorer

  1. connect to lollipop camera (change ip to your lollipop camera ip):
    obrázok
    connect and you can see your main topic (some characters) here:
    obrázok

Source:
I was using this blog to get needed information: https://www.lafois.com/2022/02/04/lollipop-camera-reverse-engineering/
On that blog are steps how to get video stream into e.g. hassio.

mosquitto.conf documentation: https://mosquitto.org/man/mosquitto-conf-5.html

1 Like

Hi - I’m trying to set this up. Can you explain how to get this into home assistant? I have followed the steps to get to this point but I don’t know how to set up sensors to show up in home assistant.
Thanks!

Hi, have a look on this:

this is sensor configuration for noise:

mqtt:
  sensor:
    - name: Lollipop noise
      state_topic: "lollipop/liveNote"
      value_template: "{{ value_json.result.noise | round(1) }}"

there was change of this config in latest release, so when you are not on 2022.06 configuration looks little bit different. You can also have different topic in ‘state_topic’.

Noise like this is this not best sensor, because its updating every second, so it can store a lot values in database. I need to change it to ok/notOK value in that template. But you can create sensors of other topics like that.

got it thank you! Super helpful.
I’ve seen that, when there is a noise or movement, lollipop sends a preNotify channel. I’m thinking of using that instead to get values and possibly have time from last event or something. Bit complex and I’m still working my way through HA configs and how to set everything up.

@caear1987 is this still working for you? I cannot seem to get my mqtt broker to connect to lollipop.
I keep getting:
Connecting bridge lollipop_mqtt (192.168.1.208:1883)
but it doesn’t seem to connect and I cannot get any other logs / details.

I can connect directly via mqtt broker to the lollipop and see that it is publishing fine. I also have the certificate included etc per above. this was working fine but appears to have stopped working and unclear why.

Any ideas?

You can increase your mosquitto logging.

I have this in my mosquitto.conf file:

log_dest file /mosquitto/log/mosquitto.log
log_type all

Am I missing something?

Good question. Perhaps

connection_messages true

see mosquitto.conf man page | Eclipse Mosquitto for all options. Also I am not 100% sure if “all” includes “debug”.

hmmm it’s odd but I’m not getting the bridge showing up at all in the logs. It’s in my mosquitto.conf file and I know it’s picking all of the details from that file so unclear what is wrong.

Here is my mosquitto.conf. Am I doing something wrong? Is there any way to

persistence true
persistence_location /mosquitto/data/
listener 1883
log_dest file /mosquitto/log/mosquitto.log
log_type debug
log_timestamp_format %Y-%m-%dT%H:%M:%S
connection_messages true

## Authentication ##
#allow_anonymous false
password_file /mosquitto/config/password.txt

connection lollipop_mqtt
address 192.168.1.208:1883
bridge_insecure true
notifications false
try_private false
bridge_cafile /mosquitto/certs/lollipop.cer
local_username <username>
local_password <password>
topic # in 0 lollipop/ MElFAuie5o/

I’ve replaced my username and password with and

I probably don’t know enough about mqtt bridging to be any more help.

EDIT: maybe here Mosquitto MQTT Bridge-Usage and Configuration

For me its still working.

I have all files in share/mosquito folder and this link is in .conf file
bridge_cafile /share/mosquitto/certs/lollipop.crt

im not sure, but when you change mosquitto addon config (active true in customize section), .conf file need to be in share\mosquitto folder.
whats your files location?

thanks - I’m running HA core so have MQTT set up in a separate docker instance as opposed to within HA as an add-on (that option doesn’t exist for HA Core)

I can see the bridge in the logs now but it just says:

2022-09-14T21:05:37: Connecting bridge lollipop_mqtt (192.168.1.208:1883)

There’s no other logs and I have it on log_type debug. it’s very odd

ok - so turned out to be an issue w/ the new version of MQTT. I’ve downgraded to 2.0.14 and it works fine… sorry for the trouble

Out of interest, what version gave you trouble.

2.0.15 (latest)
See discussion here: 2.0.15 regression: bridge is not created, with "Expiring client local.xxx due to timeout" · Issue #2634 · eclipse/mosquitto · GitHub