# LORA gateway

# Receiving data from LORA signal

Subscribe to all the messages with mosquitto or open your MQTT client software:

sudo mosquitto_sub -t +/# -v

Generate your LORA signals by using another TTGO LORA module, you can flash the sender program from this repository

Once one board flashed with OMG and the other with the sender program you should receive regular packets.

# Send data by MQTT to convert it on LORA signal

mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoLORA -m '{"message":"test8"}'

This command will send by LORA the message "test8" and use the default parameters defined in config_LORA.h

If you want to test that your sending works you can use another TTGO LORA module, you can flash the receiver program from this repository

# Send data by MQTT with advanced LORA parameters

LORA sending support the following parameters that should be specified in the json message;

  • txpower: 2 to 20
  • spreadingfactor: 6 to 12. If a spreading factor of 6 is set, implicit header mode must be used to transmit and receive * * packets.
  • frequency: 433E6, 866E6, 915E6
  • signalbandwidth: 7.8E3, 10.4E3, 15.6E3, 20.8E3, 31.25E3, 41.7E3, 62.5E3, 125E3, and 250E3
  • codingrate: 5 to 8
  • preamblelength: 6 to 65535
  • syncword: byte
  • enablecrc: boolean

More info on where the LORA library is born @sandeepmistry

Example: mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoLORA -m '{"message":"test8","txpower":17,}'

will make LORA use the a txpower of 17 when sending the message "test8"