In the LoRaWAN connection type, calculate all the measurements with the LoRaWAN Mote Application (demo) in Advanced Software Framework (ASF) 3.50.0.
In the LoRa connection type, calculate all the measurements with the Radio utility firmware available in the WLR089U0 (SAMR34 Module) Reference Design Package.
The following are the steps for the LoRaWAN connection type code modification from default:
DEMO_APP_ACTIVATION_TYPE
macro
and disabling (comment out the line) the same macro defined for Activation by
Personalization (ABP) mode in the conf_app.h
file.#define DEMO_APP_ACTIVATION_TYPE OVER_THE_AIR_ACTIVATION
//#define DEMO_APP_ACTIVATION_TYPE ACTIVATION_BY_PERSONALIZATION
conf_app.h
file. The macro DEMO_APP_TRANSMISSION_TYPE
is defined for both
unconfirmed and confirmed types and can be configured by commenting out the unused macro.#define DEMO_APP_TRANSMISSION_TYPE UNCONFIRMED
//#define DEMO_APP_TRANSMISSION_TYPE CONFIRMED
conf_app.h
file. The macro
DEMO_APP_ENDDEVICE_CLASS
sets the device class and can be
configured by commenting out the unused macro.#define DEMO_APP_ENDDEVICE_CLASS CLASS_A
//#define DEMO_APP_ENDDEVICE_CLASS CLASS_C
conf_app.h
file.#define DEMO_DEVICE_EUI {0xde, 0xaf, 0xfa, 0xce, 0xde, 0xaf, 0xfa, 0xce}
#define DEMO_JOIN_EUI {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12}
#define DEMO_APPLICATION_KEY {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12}
conf_regparams.h
file.#define MAC_DEF_TX_CURRENT_DATARATE_EU (DR0 or DR5)
sendData()
, add a
buffer to store and transmit the maximum application payload in the
enddevice_demo.c
file.#define EU_MAX_PAYLOAD_SIZE_DR5 234
#define EU_MAX_PAYLOAD_SIZE_DR0 43
uint8_t eu_max_payload_buffer_DR5[EU_MAX_PAYLOAD_SIZE_DR5] = {
0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xA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A,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,
0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA}
uint8_t eu_max_payload_buffer_DR0[EU_MAX_PAYLOAD_SIZE_DR0] =
{0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,
0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,
0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA};
//get_resource_data(TEMP_SENSOR,(uint8_t *)&cel_val);
//fahren_val = convert_celsius_to_fahrenheit(cel_val); //printf("\nTemperature:");
//snprintf(temp_sen_str,sizeof(temp_sen_str),"%.1fC/%.1fF\n",
cel_val,fahren_val);
//printf("%.1f\xf8 C/%.1f\xf8 F\n\r",cel_val, fahren_val);
//data_len = strlen(temp_sen_str);
// lorawanSendReq.buffer = &temp_sen_str;
data_len = EU_MAX_PAYLOAD_SIZE_DR5;
lorawanSendReq.buffer = &eu_max_payload_buffer_DR5;
lorawanSendReq.bufferLength = data_len;
//lorawanSendReq.bufferLength = data_len - 1;
lorawanSendReq.confirmed = DEMO_APP_TRANSMISSION_TYPE;
lorawanSendReq.port = DEMO_APP_FPORT;
data_len = EU_MAX_PAYLOAD_SIZE_DR0;
lorawanSendReq.buffer = &eu_max_payload_buffer_DR0;
lorawanSendReq.bufferLength = data_len;
//lorawanSendReq.bufferLength = data_len - 1;
lorawanSendReq.confirmed = DEMO_APP_TRANSMISSION_TYPE;
lorawanSendReq.port = DEMO_APP_FPORT;
MAC_CONFIRMABLE_UPLINK_REPETITIONS_MAX
macro holds the
configuration of the number of retransmissions applicable for the confirmed uplink
scenario in the lorawan_defs.h
file. #define MAC_CONFIRMABLE_UPLINK_REPITITIONS_MAX (2)