May 2020
Intermediate to advanced
262 pages
6h 48m
English
The LoraMessage class is built by importing the Pin, SPI, and SX127x classes. The SPI (Serial Peripheral Interface) class along with pins physically connected to the onboard LoRa module (on the ESP32 and represented by the Pin class) is used to instantiate a LoRa object using the SX127x class. After the LoRa object named lora is created, an endless while loop using lora checks for LoRa messages:
while True: if(lora.received_packet()): payload = lora.read_payload() status=str(payload)[18:-1] return (status)
The loop is broken once a message is received. A status of either True or False is extracted when the payload from the LoRa message is converted into a string and then stripped of the first 18 characters ([18]:[-1]). This converts ...
Read now
Unlock full access