-33-
v7.0
Connectivity
Generally, the user will add the information to be sent with the Frame library (
frame.addSensor()
). The Frame library
encapsulates it in a frame instance. Then, the user will pass this frame instance to the send function, which will encapsulate it
inside a packet. Finally, the LoRa module will encapsulate that in a RF packet and send it.
11.4.2. Using Frame class to create SX1272 packets
Frame is a class that allows the user to create data frames with a specified format. It is a very useful tool to set the payload of
the packet to be sent. It is recommended to read the Waspmote Data Frame Guide in order to understand the LoRa module
examples:
www.libelium.com/development/waspmote/documentation/data-frame-guide/
SX1272 sending Frame examples:
www.libelium.com/development/waspmote/examples/sx-05a-tx-lora-waspframe
www.libelium.com/development/waspmote/examples/sx-06a-tx-lora-ack-waspframe
www.libelium.com/development/waspmote/examples/sx-07a-tx-lora-ackwretries-waspframe
11.4.3. Sending data
This is the process to send a packet between SX1272 devices.
Send data
The API function responsible for sending data is called indicating the Destination Node Address and the payload data to send:
sx1272.sendPacketTimeout(destination, payload);
Related variables:
sx1272.packet_sent
→
stores the structure of the packet to send
SX1272 sending example:
www.libelium.com/development/waspmote/examples/sx-02a-tx-lora
The user may want to add services for more robust communication, like ACK confirmation or retries. In order to send ACK
confirmation, there are some special functions and a specific packet format, shown in the following figure. We also show
examples for these services next: