LoRa US Tx
This sample demonstrates transmitting board temperature over the LoRaWAN protocol. (For US version.)
To make Raspberry Pi communicate with the LoRa module, you should swap the serial ports of the Raspbian OS. Set "/dev/ttyAMA0" to 'serial0'. Also, disable the console on 'serial0'. For a how-to, visit swapping the serial ports topic.
To run the sample:
Download the sample code from https://github.com/Turta-io/LoRaHAT/blob/master/Samples/Python/lora_us_tx.py
Copy the sample code to a folder on the Raspberry Pi.
Open terminal, and then go to the folder you copied the sample.
Run the sample with the following command:
Sample Code
Result
When you run the sample, it reads and prints the board temperature. Then, it passes the payload to the LoRa module to be sent using the default radio frequency. The example output should be like this:
To stop the Python script, just press CTRL + C.
Last updated