Skip to content

LoRaMqttSample.py is a code sample for the MQTT protocol, written in Python

License

Notifications You must be signed in to change notification settings

TatianaNeuer/LiveObjects-samples-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LoRa MQTT Client Sample

LoRa MQTT Client Sample is a code sample for the MQTT protocol, written in Python.

Quick start

Download

clone from GitHub:

$ git clone https://github.com/Orange-OpenSource/LiveObjects-samples-python.git

Prerequisites

Version of Python : tested with 2.7.10 and 3.5.2

This sample of code use the paho library. You should download the library with the pip tool

pip install paho-mqtt

In order to retrieve data, a valide LoRa device must be provisionned on your account. You should have a valid API-KEY with LORA_USER role.

First use

  1. Open the LoMqttConf.py and replace the API-KEY with yours
  2. Open the LoRaMqqtSample.py. In the on_connect() function, comment, uncomment or modify subscriptions (all devices PubSub, specific device PubSub or FIFO)
  3. Run the LoRaMqttSample.py

Structure

This sample contains 3 files :

  • LoRaMqttSample.py : The main file, using the LoMqttClient class in order to retrieve LoRa data.
  • LoMqttConf.py : The configuration file, filled with your API-KEY
  • LoMqttClient.py : A class wrapping the Paho MQTT client, adding the Live Objects specificies.

License

Copyright (c) 2015 — 2016 Orange

This code is released under the BSD3 license. See the LICENSE file for more information.

Contact

About

LoRaMqttSample.py is a code sample for the MQTT protocol, written in Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages