Author Topic: Beacons & MQTT  (Read 111 times)

kbrooking

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
Beacons & MQTT
« on: December 02, 2016, 11:06:03 pm »
Iím still a bit confused about beacons.

By default the 120 will send a beacon every 10 seconds in low power mode correct? So if the gateway is programmed for MQTT will it automatically send the beacon to the MQTT server every 10 seconds as well or do you have to program the 120 to send the beacon manually using the Lplan.SendBeacon()command?

Social Buttons


mc-John

  • Global Moderator
  • Full Member
  • *****
  • Posts: 195
    • View Profile
Re: Beacons & MQTT
« Reply #1 on: December 05, 2016, 09:10:06 am »
You are correct, with the default settings, it will send the beacon every 10 seconds and you have to use the beacon command only if you want to change the timing. If you use MQTT it will send it over MQTT every 10 seconds

kbrooking

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
Re: Beacons & MQTT
« Reply #2 on: December 06, 2016, 11:14:50 pm »
Do you have an example on how to send a beacon with battery level & temp in the four user byte fields and change the time to send from 10 seconds to say 20 seconds?

Nick_W

  • Full Member
  • ***
  • Posts: 211
    • View Profile
Re: Beacons & MQTT
« Reply #3 on: January 17, 2017, 12:49:36 am »
Kbrooking

If you haven't found my github yet https://github.com/NickWaterton/mcScript I have examples of exactly that, plus a python program (beacon_decode.py) for receiving the beacons and converting them back to regular mqtt messages.

I currently support 12 data types (I think), such as temperature, battery, Rssi, humidity, pressure, altitude, boolean etc.

The data is converted to 24 bits, so there are limits on the range of numbers that can be sent, and you are limited to 2 decimal places, but the range is +/-32k, so enough for environmental sensors.