mc-Things

mc-Platform => mc-Platform General => Topic started by: kbrooking on November 28, 2016, 07:55:19 pm

Title: Beacon Question
Post by: kbrooking on November 28, 2016, 07:55:19 pm
As per the Beaconing white paper, when sending beacons over MQTT, the topic defaults to  “mcThings/beacon/{GatewayUID}/{DeviceUID}”. Is this correct? We do not need to set the topic as we do when we use Lplan.Publish?

If so, could I then subscribe to “mcThings/beacon” and get beacons from all GW and modules?
Title: Re: Beacon Question
Post by: mc-John on November 28, 2016, 09:31:06 pm
The topic is programmed in the gateway itself and described in page 7 of the white papers and is correct. See also the example on page 8.

You can use wildcards to subscribe to all gateways and devices. Google "MQTT subscribe wildcards" and you will find a lot of examples.
Title: Re: Beacon Question
Post by: Nick_W on December 02, 2016, 09:55:18 pm
Checkout my beacon_decode.py program for an example of one way of reading/decoding beacons via mqtt or UDP socket.

This decodes my beacon data format, but you can use any format you like, it's just 4 bytes.

https://github.com/NickWaterton/beacon_decode (https://github.com/NickWaterton/beacon_decode)