4.3
Reconfiguring the sensor device using the AT_Master project
Edit firmware to change join mode, frequency band, device IDs, and keys. More parameters are reconfigurable.
The following examples show functions used to set these parameters in user firmware.
In file
main.c
:
#define JOIN_MODE OTAA_JOIN_MODE /*ABP_JOIN_MODE*/ /*LoRaWan join method*/
In file
lora_driver.c
:
•
Lora_SetDeviceBand(uint8_t DeviceBand)
→ Sets the band plan
•
LoRa_SetDeviceID(uint8_t *PtrDeviceID)
→ Sets the device ID (DevEUI)
•
LoRa_SetAppID(uint8_t *PtrAppID)
→ Sets the application identifier (AppEUI)
•
LoRa_SetDeviceAddress(uint32_t DeviceAddr)
→ Sets the device address (DevAddr)
•
LoRa_SetKey(ATCmd_t KeyType, uint8_t *PtrKey)
→ Sets the key configuration (APPKEY,
NWKSKE, APPSKEY)
•
Lora_UpdateConfigTable()
→ Updates the DCT content table with new values
The corresponding
Get
functions are also available.
Alternatively, it is possible to reconfigure the WM-SG-SM-42 module directly via its serial port by sending AT
commands from the PC. Refer to
Set additional options in the
hw_conf.h
file in folder
AT_Master
:
•
Low-power mode: enables/disables the low-power mode
•
Sensor-enable switch: enables reading the data from the sensors in the
expansion
board
UM2587
Reconfiguring the sensor device using the AT_Master project
UM2587
-
Rev 3
page 24/55