No data in mosuitto_sub


#1

I’m looking for a way to store payloads in database and I’ve read on this forum that good way to do it is to subscribe to MQTT topic. I have LoRa stack installed by default docker installator. Host machine is Debian. I have MQTT up and running on default 1883 port.
I can see data in web ui:

Bo no data in mosquitto_sub:

Zrzut%20ekranu%20z%202019-03-15%2015-07-17

What am I doing wrong?


#2

Try subscribing to ‘application/#’ in case you got the application id wrong (it should be in the URL of the page you were viewing before).

Or for that matter just subscribe to ‘#’ and see everything including the raw encrypted packets to/from gateways and various housekeeping. Unless you have a huge number of devices nearby it won’t be an extreme flood and will give you some sense of what is / isn’t working.

Perhaps you connected to the wrong broker? You aren’t specifying to presumably it assumes localhost and a default port.

And don’t run mosquitto_sub as root. There’s no reason to - at most the broker would need privileged port access. The client does not; any permission issues are between the client and broker and related plug-ins, not between the client and the host os.


#3

Thanks, but unfortunately it doesn’t help :frowning:
Results of subscribing to ‘#’ are also empty (in debug mode there is only ‘sending CONNECT’…)
I run mosquitto_sub on Debian host OS, maybe it should be run from inside of one of docker containers? (but I can’t find ‘mosquitto_sub’ command there…)


#4

Seems like you may have multiple brokers running, with the data going to a different one.

If it’s running in a container you would need to figure out how that looks to the hosting machine as a network target (probably it maps to some port…)


#5

I’ve just found out that I can successfully subscribe to MQTT from outside (another machine) with mosquitto_sub -v -t ‘#’ -h some.external.IPv4.address, but surprisingly it doesn’t work from within machine where LoraServer is hosted…