Initialization
Before starting to use a module, it needs to be initialized. During this process, Waspmote's SPI bus has to be opened to communicate with the module, and the LoRa module's switch has to be set on.
This module does not save the configuration. So, the network settings as the mode or the channel MUST be configured every time it is switched on.
Setting on
It initializes all the global variables, opens the SPI bus and switches the LoRa module on.
When setting on, the module always has the configuration by default shown in the next table:
Global variable | Description | Initial value |
| activated mode |
|
| bandwidth to use in LoRa mode |
|
| coding rate to use in LoRa mode |
|
| spreading factor to use in LoRa mode |
|
| transmission frequency channel |
|
| specifies if header is enabled |
|
| specifies if CRC is enabled |
|
| power transmission level | 15 |
Also, there are other global variables initialized when this function is called, shown in the following table:
Global variable | Description | Initial value |
| packet number to send | 0 |
| specifies if packet is correctly received |
|
| number of the current retrying that is being executed in the protocol | 0 |
| maximum number of retries permitted in each case | 3 |
Example of use:
Setting off
It closes the SPI and switches the SX1272 module off.
Example of use:
Last updated