Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 87f9232d49 | |||
| 2e3ad42102 | |||
| e71159cd35 | |||
| e93dc481e0 | |||
| 35a9f287ef | |||
| b5f75f9f18 |
@@ -15,7 +15,7 @@ mbed target NUCLEO_L073RZ
|
|||||||
mbed config -G GCC_ARM_PATH /opt/gcc-arm-none-eabi-7-2017-q4-major/bin
|
mbed config -G GCC_ARM_PATH /opt/gcc-arm-none-eabi-7-2017-q4-major/bin
|
||||||
cp mbed_app.json.sample mbed_app.json
|
cp mbed_app.json.sample mbed_app.json
|
||||||
# modify lora.device-eui, lora.application-eui and lora.application-key in mbed_app.json
|
# modify lora.device-eui, lora.application-eui and lora.application-key in mbed_app.json
|
||||||
mbed compile --profile minimal-printf/profiles/release.json
|
mbed compile --profile profiles/release.json
|
||||||
```
|
```
|
||||||
|
|
||||||
Then you can use stm32flash or - may be better - a stlink interface to copy the generated .bin file onto the RAK811.
|
Then you can use stm32flash or - may be better - a stlink interface to copy the generated .bin file onto the RAK811.
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
#include "lorawan/LoRaWANInterface.h"
|
#include "lorawan/LoRaWANInterface.h"
|
||||||
#include "lorawan/system/lorawan_data_structures.h"
|
#include "lorawan/system/lorawan_data_structures.h"
|
||||||
#include "mbed.h"
|
#include "mbed.h"
|
||||||
|
#include "nvstore.h"
|
||||||
|
|
||||||
#if MBED_CONF_APP_DHT_ENABLED
|
#if MBED_CONF_APP_DHT_ENABLED
|
||||||
#include "DHT.h"
|
#include "DHT.h"
|
||||||
@@ -17,12 +18,6 @@ using namespace events;
|
|||||||
|
|
||||||
uint8_t rx_buffer[LORAMAC_PHY_MAXPAYLOAD];
|
uint8_t rx_buffer[LORAMAC_PHY_MAXPAYLOAD];
|
||||||
|
|
||||||
/*
|
|
||||||
* Sets up an application dependent transmission timer in ms. Used only when Duty Cycling is off for
|
|
||||||
* testing
|
|
||||||
*/
|
|
||||||
#define TX_TIMER 30000 //600000
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maximum number of events for the event queue.
|
* Maximum number of events for the event queue.
|
||||||
* 16 is the safe number for the stack events, however, if application
|
* 16 is the safe number for the stack events, however, if application
|
||||||
@@ -43,6 +38,23 @@ static CayenneLPP cayenne(51);
|
|||||||
|
|
||||||
#if MBED_CONF_APP_BATTERY_ENABLED
|
#if MBED_CONF_APP_BATTERY_ENABLED
|
||||||
AnalogIn bat(MBED_CONF_APP_BATTERY_ADC);
|
AnalogIn bat(MBED_CONF_APP_BATTERY_ADC);
|
||||||
|
AnalogIn vrefint(ADC_VREF);
|
||||||
|
|
||||||
|
static float battery_voltage() {
|
||||||
|
float vbat = bat.read();
|
||||||
|
double vdd = (1.224f) / vrefint.read();
|
||||||
|
|
||||||
|
return vbat * MBED_CONF_APP_BATTERY_RATIO * vdd;
|
||||||
|
}
|
||||||
|
|
||||||
|
static uint8_t battery_level() {
|
||||||
|
float vbat = battery_voltage();
|
||||||
|
|
||||||
|
double ratio = 253.0f / (4.2f - 3.3f);
|
||||||
|
int value = ratio * (vbat - 3.4f) + 1.0f;
|
||||||
|
|
||||||
|
return value < 1 ? 1 : (value > 254 ? 254 : value);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if MBED_CONF_APP_DHT_ENABLED
|
#if MBED_CONF_APP_DHT_ENABLED
|
||||||
@@ -50,59 +62,86 @@ DHT dht(MBED_CONF_APP_DHT_DATA, MBED_CONF_APP_DHT_TYPE);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if MBED_CONF_APP_HX711_ENABLED
|
#if MBED_CONF_APP_HX711_ENABLED
|
||||||
HX711 loadcell(MBED_CONF_APP_HX711_CLK, MBED_CONF_APP_HX711_DATA);
|
HX711 loadcell(MBED_CONF_APP_HX711_DATA, MBED_CONF_APP_HX711_CLK);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//DigitalOut led(LED1, 1);
|
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
|
|
||||||
lorawan_status_t retcode;
|
lorawan_status_t retcode;
|
||||||
|
|
||||||
|
#if NVSTORE_ENABLED
|
||||||
|
NVStore &nvstore = NVStore::get_instance();
|
||||||
|
int rc;
|
||||||
|
uint16_t key;
|
||||||
|
// Values read or written by NVStore need to be aligned to a uint32_t address (even if their sizes
|
||||||
|
// aren't)
|
||||||
|
uint32_t value;
|
||||||
|
// Initialize NVstore. Note that it can be skipped, as it is lazily called by all other APIs
|
||||||
|
rc = nvstore.init();
|
||||||
|
printf("Init NVStore. \n");
|
||||||
|
// Show NVStore size, maximum number of keys and area addresses and sizes
|
||||||
|
printf("NVStore size is %d.\n", nvstore.size());
|
||||||
|
printf("NVStore max number of keys is %d (out of %d possible ones in this flash configuration).\n",
|
||||||
|
nvstore.get_max_keys(), nvstore.get_max_possible_keys());
|
||||||
|
printf("NVStore areas:\n");
|
||||||
|
for (uint8_t area = 0; area < NVSTORE_NUM_AREAS; area++) {
|
||||||
|
uint32_t area_address;
|
||||||
|
size_t area_size;
|
||||||
|
nvstore.get_area_params(area, area_address, area_size);
|
||||||
|
printf("Area %d: address 0x%08lx, size %d (0x%x).\n", area, area_address, area_size, area_size);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
printf("NVStore is disabled for this board\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
while(1) {
|
||||||
|
wait(1);
|
||||||
|
}
|
||||||
|
|
||||||
#if MBED_CONF_APP_HX711_ENABLED
|
#if MBED_CONF_APP_HX711_ENABLED
|
||||||
|
loadcell.powerDown();
|
||||||
loadcell.setScale(MBED_CONF_APP_HX711_SCALE);
|
loadcell.setScale(MBED_CONF_APP_HX711_SCALE);
|
||||||
loadcell.setOffset(MBED_CONF_APP_HX711_OFFSET);
|
loadcell.setOffset(MBED_CONF_APP_HX711_OFFSET);
|
||||||
loadcell.powerDown();
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Initialize LoRaWAN stack
|
// Initialize LoRaWAN stack
|
||||||
if(lorawan.initialize(&ev_queue) != LORAWAN_STATUS_OK) {
|
if(lorawan.initialize(&ev_queue) != LORAWAN_STATUS_OK) {
|
||||||
printf("\r\n LoRa initialization failed! \r\n");
|
debug("\r\n LoRa initialization failed! \r\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("\r\n Mbed LoRaWANStack initialized \r\n");
|
debug("\r\n Mbed LoRaWANStack initialized \r\n");
|
||||||
|
|
||||||
callbacks.events = mbed::callback(lora_event_handler);
|
callbacks.events = mbed::callback(lora_event_handler);
|
||||||
|
#if MBED_CONF_APP_BATTERY_ENABLED
|
||||||
|
callbacks.battery_level = mbed::callback(battery_level);
|
||||||
|
#endif
|
||||||
lorawan.add_app_callbacks(&callbacks);
|
lorawan.add_app_callbacks(&callbacks);
|
||||||
|
|
||||||
// Set number of retries in case of CONFIRMED messages
|
// Set number of retries in case of CONFIRMED messages
|
||||||
if(lorawan.set_confirmed_msg_retries(CONFIRMED_MSG_RETRY_COUNTER) != LORAWAN_STATUS_OK) {
|
if(lorawan.set_confirmed_msg_retries(CONFIRMED_MSG_RETRY_COUNTER) != LORAWAN_STATUS_OK) {
|
||||||
printf("\r\n set_confirmed_msg_retries failed! \r\n\r\n");
|
debug("\r\n set_confirmed_msg_retries failed! \r\n\r\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("\r\n CONFIRMED message retries : %d \r\n", CONFIRMED_MSG_RETRY_COUNTER);
|
debug("\r\n CONFIRMED message retries : %d \r\n", CONFIRMED_MSG_RETRY_COUNTER);
|
||||||
|
|
||||||
// Enable adaptive data rate
|
// Enable adaptive data rate
|
||||||
if(lorawan.enable_adaptive_datarate() != LORAWAN_STATUS_OK) {
|
if(lorawan.enable_adaptive_datarate() != LORAWAN_STATUS_OK) {
|
||||||
printf("\r\n enable_adaptive_datarate failed! \r\n");
|
debug("\r\n enable_adaptive_datarate failed! \r\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("\r\n Adaptive data rate (ADR) - Enabled \r\n");
|
debug("\r\n Adaptive data rate (ADR) - Enabled \r\n");
|
||||||
|
|
||||||
//led = 0;
|
|
||||||
|
|
||||||
retcode = lorawan.connect();
|
retcode = lorawan.connect();
|
||||||
|
|
||||||
if(retcode == LORAWAN_STATUS_OK || retcode == LORAWAN_STATUS_CONNECT_IN_PROGRESS) {
|
if(retcode == LORAWAN_STATUS_OK || retcode == LORAWAN_STATUS_CONNECT_IN_PROGRESS) {
|
||||||
} else {
|
} else {
|
||||||
printf("\r\n Connection error, code = %d \r\n", retcode);
|
debug("\r\n Connection error, code = %d \r\n", retcode);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("\r\n Connection - In Progress ...\r\n");
|
debug("\r\n Connection - In Progress ...\r\n");
|
||||||
|
|
||||||
// make your event queue dispatching events forever
|
// make your event queue dispatching events forever
|
||||||
ev_queue.dispatch_forever();
|
ev_queue.dispatch_forever();
|
||||||
@@ -116,25 +155,25 @@ int main(void) {
|
|||||||
static void send_message() {
|
static void send_message() {
|
||||||
int16_t retcode;
|
int16_t retcode;
|
||||||
|
|
||||||
#if MBED_CONF_APP_BATTERY_ENABLED
|
#if MBED_CONF_APP_BATTERY_ENABLED && MBED_CONF_APP_BATTERY_IN_LPP
|
||||||
float vbat = bat.read();
|
cayenne.addAnalogInput(1, battery_voltage());
|
||||||
vbat = vbat * 5 / 3 * 3.3f;
|
|
||||||
cayenne.addAnalogInput(1, vbat);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if MBED_CONF_APP_DHT_ENABLED
|
#if MBED_CONF_APP_DHT_ENABLED
|
||||||
int err = dht.read();
|
int err = dht.read();
|
||||||
if(err == DHT::SUCCESS) {
|
if(err == DHT::SUCCESS) {
|
||||||
cayenne.addTemperature(1, dht.getTemperature());
|
cayenne.addTemperature(1, dht.getTemperature());
|
||||||
cayenne.addRelativeHumidity(2, dht.getHumidity());
|
cayenne.addRelativeHumidity(1, dht.getHumidity());
|
||||||
} else {
|
} else {
|
||||||
printf("Error code : %d\r\n", err);
|
debug("Error code : %d\r\n", err);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if MBED_CONF_APP_HX711_ENABLED
|
#if MBED_CONF_APP_HX711_ENABLED
|
||||||
loadcell.powerUp();
|
loadcell.powerUp();
|
||||||
cayenne.addAnalogInput(2, loadcell.getUnits(5));
|
if(loadcell.waitReadyRetry(20, 100)) {
|
||||||
|
cayenne.addAnalogInput(2, loadcell.getUnits(5));
|
||||||
|
}
|
||||||
loadcell.powerDown();
|
loadcell.powerDown();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -147,12 +186,12 @@ static void send_message() {
|
|||||||
MSG_UNCONFIRMED_FLAG);
|
MSG_UNCONFIRMED_FLAG);
|
||||||
|
|
||||||
if(retcode < 0) {
|
if(retcode < 0) {
|
||||||
retcode == LORAWAN_STATUS_WOULD_BLOCK ? printf("send - WOULD BLOCK\r\n")
|
retcode == LORAWAN_STATUS_WOULD_BLOCK ? debug("send - WOULD BLOCK\r\n")
|
||||||
: printf("\r\n send() - Error code %d \r\n", retcode);
|
: debug("\r\n send() - Error code %d \r\n", retcode);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("\r\n %d bytes scheduled for transmission \r\n", retcode);
|
debug("\r\n %d bytes scheduled for transmission \r\n", retcode);
|
||||||
cayenne.reset();
|
cayenne.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -165,17 +204,17 @@ static void receive_message() {
|
|||||||
MSG_CONFIRMED_FLAG | MSG_UNCONFIRMED_FLAG);
|
MSG_CONFIRMED_FLAG | MSG_UNCONFIRMED_FLAG);
|
||||||
|
|
||||||
if(retcode < 0) {
|
if(retcode < 0) {
|
||||||
printf("\r\n receive() - Error code %d \r\n", retcode);
|
debug("\r\n receive() - Error code %d \r\n", retcode);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf(" Data:");
|
debug(" Data:");
|
||||||
|
|
||||||
for(uint8_t i = 0; i < retcode; i++) {
|
for(uint8_t i = 0; i < retcode; i++) {
|
||||||
printf("%x", rx_buffer[i]);
|
debug("%x", rx_buffer[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("\r\n Data Length: %d\r\n", retcode);
|
debug("\r\n Data Length: %d\r\n", retcode);
|
||||||
|
|
||||||
memset(rx_buffer, 0, LORAMAC_PHY_MAXPAYLOAD);
|
memset(rx_buffer, 0, LORAMAC_PHY_MAXPAYLOAD);
|
||||||
}
|
}
|
||||||
@@ -183,21 +222,21 @@ static void receive_message() {
|
|||||||
static void lora_event_handler(lorawan_event_t event) {
|
static void lora_event_handler(lorawan_event_t event) {
|
||||||
switch(event) {
|
switch(event) {
|
||||||
case CONNECTED:
|
case CONNECTED:
|
||||||
//led = 1;
|
debug("\r\n Connection - Successful \r\n");
|
||||||
printf("\r\n Connection - Successful \r\n");
|
|
||||||
if(MBED_CONF_LORA_DUTY_CYCLE_ON) {
|
if(MBED_CONF_LORA_DUTY_CYCLE_ON) {
|
||||||
send_message();
|
send_message();
|
||||||
} else {
|
} else {
|
||||||
ev_queue.call_every(TX_TIMER, send_message);
|
send_message();
|
||||||
|
ev_queue.call_every(MBED_CONF_APP_TX_TIMER, send_message);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case DISCONNECTED:
|
case DISCONNECTED:
|
||||||
ev_queue.break_dispatch();
|
ev_queue.break_dispatch();
|
||||||
printf("\r\n Disconnected Successfully \r\n");
|
debug("\r\n Disconnected Successfully \r\n");
|
||||||
break;
|
break;
|
||||||
case TX_DONE:
|
case TX_DONE:
|
||||||
printf("\r\n Message Sent to Network Server \r\n");
|
debug("\r\n Message Sent to Network Server \r\n");
|
||||||
if(MBED_CONF_LORA_DUTY_CYCLE_ON) {
|
if(MBED_CONF_LORA_DUTY_CYCLE_ON) {
|
||||||
send_message();
|
send_message();
|
||||||
}
|
}
|
||||||
@@ -206,22 +245,22 @@ static void lora_event_handler(lorawan_event_t event) {
|
|||||||
case TX_ERROR:
|
case TX_ERROR:
|
||||||
case TX_CRYPTO_ERROR:
|
case TX_CRYPTO_ERROR:
|
||||||
case TX_SCHEDULING_ERROR:
|
case TX_SCHEDULING_ERROR:
|
||||||
printf("\r\n Transmission Error - EventCode = %d \r\n", event);
|
debug("\r\n Transmission Error - EventCode = %d \r\n", event);
|
||||||
// try again
|
// try again
|
||||||
if(MBED_CONF_LORA_DUTY_CYCLE_ON) {
|
if(MBED_CONF_LORA_DUTY_CYCLE_ON) {
|
||||||
send_message();
|
send_message();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RX_DONE:
|
case RX_DONE:
|
||||||
printf("\r\n Received message from Network Server \r\n");
|
debug("\r\n Received message from Network Server \r\n");
|
||||||
receive_message();
|
receive_message();
|
||||||
break;
|
break;
|
||||||
case RX_TIMEOUT:
|
case RX_TIMEOUT:
|
||||||
case RX_ERROR:
|
case RX_ERROR:
|
||||||
printf("\r\n Error in reception - Code = %d \r\n", event);
|
debug("\r\n Error in reception - Code = %d \r\n", event);
|
||||||
break;
|
break;
|
||||||
case JOIN_FAILURE:
|
case JOIN_FAILURE:
|
||||||
printf("\r\n OTAA Failed - Check Keys \r\n");
|
debug("\r\n OTAA Failed - Check Keys \r\n");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
MBED_ASSERT("Unknown Event");
|
MBED_ASSERT("Unknown Event");
|
||||||
|
|||||||
+126
@@ -0,0 +1,126 @@
|
|||||||
|
{
|
||||||
|
"config": {
|
||||||
|
"tx-timer": { "value": 30000 },
|
||||||
|
"lora-radio": {
|
||||||
|
"help": "Which radio to use (options: SX1272,SX1276)",
|
||||||
|
"value": "SX1276"
|
||||||
|
},
|
||||||
|
"main_stack_size": { "value": 4096 },
|
||||||
|
"lora-spi-mosi": { "value": "NC" },
|
||||||
|
"lora-spi-miso": { "value": "NC" },
|
||||||
|
"lora-spi-sclk": { "value": "NC" },
|
||||||
|
"lora-cs": { "value": "NC" },
|
||||||
|
"lora-reset": { "value": "NC" },
|
||||||
|
"lora-dio0": { "value": "NC" },
|
||||||
|
"lora-dio1": { "value": "NC" },
|
||||||
|
"lora-dio2": { "value": "NC" },
|
||||||
|
"lora-dio3": { "value": "NC" },
|
||||||
|
"lora-dio4": { "value": "NC" },
|
||||||
|
"lora-dio5": { "value": "NC" },
|
||||||
|
"lora-rf-switch-ctl1": { "value": "NC" },
|
||||||
|
"lora-rf-switch-ctl2": { "value": "NC" },
|
||||||
|
"lora-txctl": { "value": "NC" },
|
||||||
|
"lora-rxctl": { "value": "NC" },
|
||||||
|
"lora-ant-switch": { "value": "NC" },
|
||||||
|
"lora-pwr-amp-ctl": { "value": "NC" },
|
||||||
|
"lora-tcxo": { "value": "NC" },
|
||||||
|
"battery-enabled": { "value": "false" },
|
||||||
|
"battery-in-lpp": { "value": "false" },
|
||||||
|
"battery-adc": { "value": "NC" },
|
||||||
|
"battery-ratio": { "value": "2.0f" },
|
||||||
|
"dht-enabled": { "value": "false" },
|
||||||
|
"dht-type": { "value": "DHT::DHT22" },
|
||||||
|
"dht-data": { "value": "NC" },
|
||||||
|
"hx711-enabled": { "value": "false" },
|
||||||
|
"hx711-clk": { "value": "NC" },
|
||||||
|
"hx711-data": { "value": "NC" },
|
||||||
|
"hx711-scale": { "value": "1.0f" },
|
||||||
|
"hx711-offset": { "value": 0 }
|
||||||
|
},
|
||||||
|
"target_overrides": {
|
||||||
|
"*": {
|
||||||
|
"platform.stdio-convert-newlines": true,
|
||||||
|
"platform.stdio-baud-rate": 115200,
|
||||||
|
"platform.default-serial-baud-rate": 115200,
|
||||||
|
"lora.app-port": 3,
|
||||||
|
"lora.over-the-air-activation": true,
|
||||||
|
"lora.duty-cycle-on": false,
|
||||||
|
"lora.phy": 0,
|
||||||
|
"lora.device-eui": "{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }",
|
||||||
|
"lora.application-eui": "{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }",
|
||||||
|
"lora.application-key": "{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }"
|
||||||
|
},
|
||||||
|
|
||||||
|
"NUCLEO_L073RZ": {
|
||||||
|
"main_stack_size": 1024,
|
||||||
|
"target.lpticker_lptim": 0,
|
||||||
|
"target.clock_source": "USE_PLL_HSI",
|
||||||
|
"lora.duty-cycle-on": false,
|
||||||
|
"tx-timer": 600000,
|
||||||
|
"lora-radio": "SX1272",
|
||||||
|
"lora-spi-mosi": "D11",
|
||||||
|
"lora-spi-miso": "D12",
|
||||||
|
"lora-spi-sclk": "D13",
|
||||||
|
"lora-cs": "D10",
|
||||||
|
"lora-reset": "A0",
|
||||||
|
"lora-dio0": "D2",
|
||||||
|
"lora-dio1": "D3",
|
||||||
|
"lora-dio2": "D4",
|
||||||
|
"lora-dio3": "D5",
|
||||||
|
"lora-dio4": "NC",
|
||||||
|
"lora-dio5": "NC",
|
||||||
|
"lora-rf-switch-ctl1": "NC",
|
||||||
|
"lora-rf-switch-ctl2": "NC",
|
||||||
|
"lora-txctl": "NC",
|
||||||
|
"lora-rxctl": "NC",
|
||||||
|
"lora-ant-switch": "A4",
|
||||||
|
"lora-pwr-amp-ctl": "NC",
|
||||||
|
"lora-tcxo": "NC",
|
||||||
|
"battery-enabled": true,
|
||||||
|
"battery-in-lpp": true,
|
||||||
|
"battery-adc": "A1",
|
||||||
|
"battery-ratio": "2.0f",
|
||||||
|
"dht-enabled": true,
|
||||||
|
"dht-data": "D8",
|
||||||
|
"dht-type": "DHT::DHT22",
|
||||||
|
"hx711-enabled": true,
|
||||||
|
"hx711-clk": "D6",
|
||||||
|
"hx711-data": "D7",
|
||||||
|
"hx711-scale": "21000.0f",
|
||||||
|
"hx711-offset": 59600,
|
||||||
|
"nvstore.max_keys": 20,
|
||||||
|
"nvstore.area_1_address": "0x0802e000",
|
||||||
|
"nvstore.area_1_size" : "0x1000",
|
||||||
|
"nvstore.area_2_address": "0x0802f000",
|
||||||
|
"nvstore.area_2_size" : "0x1000"
|
||||||
|
},
|
||||||
|
|
||||||
|
"MTB_RAK811": {
|
||||||
|
"lora-radio": "SX1276",
|
||||||
|
"lora-spi-mosi": "SPI_RF_MOSI",
|
||||||
|
"lora-spi-miso": "SPI_RF_MISO",
|
||||||
|
"lora-spi-sclk": "SPI_RF_SCK",
|
||||||
|
"lora-cs": "SPI_RF_CS",
|
||||||
|
"lora-reset": "SPI_RF_RESET",
|
||||||
|
"lora-dio0": "DIO0",
|
||||||
|
"lora-dio1": "DIO1",
|
||||||
|
"lora-dio2": "DIO2",
|
||||||
|
"lora-dio3": "DIO3",
|
||||||
|
"lora-dio4": "DIO4",
|
||||||
|
"lora-dio5": "NC",
|
||||||
|
"lora-rf-switch-ctl1": "NC",
|
||||||
|
"lora-rf-switch-ctl2": "NC",
|
||||||
|
"lora-txctl": "ANT_CTX_PA",
|
||||||
|
"lora-rxctl": "ANT_CRX_RX",
|
||||||
|
"lora-ant-switch": "NC",
|
||||||
|
"lora-pwr-amp-ctl": "NC",
|
||||||
|
"lora-tcxo": "RF_TCXO_EN",
|
||||||
|
"battery-enabled": true,
|
||||||
|
"battery-adc": "PA_2",
|
||||||
|
"dht-enabled": true,
|
||||||
|
"dht-data": "PA_1",
|
||||||
|
"dht-type": "DHT::DHT22"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"macros": ["MBEDTLS_USER_CONFIG_FILE=\"mbedtls_lora_config.h\""]
|
||||||
|
}
|
||||||
@@ -1,293 +0,0 @@
|
|||||||
{
|
|
||||||
"config": {
|
|
||||||
"lora-radio": {
|
|
||||||
"help": "Which radio to use (options: SX1272,SX1276)",
|
|
||||||
"value": "SX1276"
|
|
||||||
},
|
|
||||||
"main_stack_size": { "value": 4096 },
|
|
||||||
"lora-spi-mosi": { "value": "NC" },
|
|
||||||
"lora-spi-miso": { "value": "NC" },
|
|
||||||
"lora-spi-sclk": { "value": "NC" },
|
|
||||||
"lora-cs": { "value": "NC" },
|
|
||||||
"lora-reset": { "value": "NC" },
|
|
||||||
"lora-dio0": { "value": "NC" },
|
|
||||||
"lora-dio1": { "value": "NC" },
|
|
||||||
"lora-dio2": { "value": "NC" },
|
|
||||||
"lora-dio3": { "value": "NC" },
|
|
||||||
"lora-dio4": { "value": "NC" },
|
|
||||||
"lora-dio5": { "value": "NC" },
|
|
||||||
"lora-rf-switch-ctl1": { "value": "NC" },
|
|
||||||
"lora-rf-switch-ctl2": { "value": "NC" },
|
|
||||||
"lora-txctl": { "value": "NC" },
|
|
||||||
"lora-rxctl": { "value": "NC" },
|
|
||||||
"lora-ant-switch": { "value": "NC" },
|
|
||||||
"lora-pwr-amp-ctl": { "value": "NC" },
|
|
||||||
"lora-tcxo": { "value": "NC" },
|
|
||||||
"battery-enabled": { "value": "false" },
|
|
||||||
"battery-adc": { "value": "NC" },
|
|
||||||
"dht-enabled": { "value": "false" },
|
|
||||||
"dht-type": { "value": "DHT::DHT22" },
|
|
||||||
"dht-data": { "value": "NC" },
|
|
||||||
"hx711-enabled": { "value": "false" },
|
|
||||||
"hx711-clk": { "value": "NC" },
|
|
||||||
"hx711-data": { "value": "NC" },
|
|
||||||
"hx711-scale": { "value": "1.0f" },
|
|
||||||
"hx711-offset": { "value": 0 }
|
|
||||||
},
|
|
||||||
"target_overrides": {
|
|
||||||
"*": {
|
|
||||||
"platform.stdio-convert-newlines": true,
|
|
||||||
"platform.stdio-baud-rate": 115200,
|
|
||||||
"platform.default-serial-baud-rate": 115200,
|
|
||||||
"lora.app-port": 3,
|
|
||||||
"lora.over-the-air-activation": true,
|
|
||||||
"lora.duty-cycle-on": false,
|
|
||||||
"lora.phy": 0,
|
|
||||||
"lora.device-eui": "{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }",
|
|
||||||
"lora.application-eui": "{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }",
|
|
||||||
"lora.application-key": "{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }"
|
|
||||||
},
|
|
||||||
|
|
||||||
"K64F": {
|
|
||||||
"lora-spi-mosi": "D11",
|
|
||||||
"lora-spi-miso": "D12",
|
|
||||||
"lora-spi-sclk": "D13",
|
|
||||||
"lora-cs": "D10",
|
|
||||||
"lora-reset": "A0",
|
|
||||||
"lora-dio0": "D2",
|
|
||||||
"lora-dio1": "D3",
|
|
||||||
"lora-dio2": "D4",
|
|
||||||
"lora-dio3": "D5",
|
|
||||||
"lora-dio4": "D8",
|
|
||||||
"lora-dio5": "D9",
|
|
||||||
"lora-rf-switch-ctl1": "NC",
|
|
||||||
"lora-rf-switch-ctl2": "NC",
|
|
||||||
"lora-txctl": "NC",
|
|
||||||
"lora-rxctl": "NC",
|
|
||||||
"lora-ant-switch": "A4",
|
|
||||||
"lora-pwr-amp-ctl": "NC",
|
|
||||||
"lora-tcxo": "NC"
|
|
||||||
},
|
|
||||||
|
|
||||||
"DISCO_L072CZ_LRWAN1": {
|
|
||||||
"main_stack_size": 3072,
|
|
||||||
|
|
||||||
"lora-radio": "SX1276",
|
|
||||||
"lora-spi-mosi": "PA_7",
|
|
||||||
"lora-spi-miso": "PA_6",
|
|
||||||
"lora-spi-sclk": "PB_3",
|
|
||||||
"lora-cs": "PA_15",
|
|
||||||
"lora-reset": "PC_0",
|
|
||||||
"lora-dio0": "PB_4",
|
|
||||||
"lora-dio1": "PB_1",
|
|
||||||
"lora-dio2": "PB_0",
|
|
||||||
"lora-dio3": "PC_13",
|
|
||||||
"lora-dio4": "NC",
|
|
||||||
"lora-dio5": "NC",
|
|
||||||
"lora-rf-switch-ctl1": "NC",
|
|
||||||
"lora-rf-switch-ctl2": "NC",
|
|
||||||
"lora-txctl": "PC_2",
|
|
||||||
"lora-rxctl": "PA_1",
|
|
||||||
"lora-ant-switch": "NC",
|
|
||||||
"lora-pwr-amp-ctl": "PC_1",
|
|
||||||
"lora-tcxo": "PA_12"
|
|
||||||
},
|
|
||||||
|
|
||||||
"MTB_MURATA_ABZ": {
|
|
||||||
"lora-radio": "SX1276",
|
|
||||||
"lora-spi-mosi": "PA_7",
|
|
||||||
"lora-spi-miso": "PA_6",
|
|
||||||
"lora-spi-sclk": "PB_3",
|
|
||||||
"lora-cs": "PA_15",
|
|
||||||
"lora-reset": "PC_0",
|
|
||||||
"lora-dio0": "PB_4",
|
|
||||||
"lora-dio1": "PB_1",
|
|
||||||
"lora-dio2": "PB_0",
|
|
||||||
"lora-dio3": "PC_13",
|
|
||||||
"lora-dio4": "NC",
|
|
||||||
"lora-dio5": "NC",
|
|
||||||
"lora-rf-switch-ctl1": "NC",
|
|
||||||
"lora-rf-switch-ctl2": "NC",
|
|
||||||
"lora-txctl": "PC_2",
|
|
||||||
"lora-rxctl": "PA_1",
|
|
||||||
"lora-ant-switch": "NC",
|
|
||||||
"lora-pwr-amp-ctl": "PC_1",
|
|
||||||
"lora-tcxo": "PA_12"
|
|
||||||
},
|
|
||||||
|
|
||||||
"XDOT_L151CC": {
|
|
||||||
"lora-radio": "SX1272",
|
|
||||||
"lora-spi-mosi": "LORA_MOSI",
|
|
||||||
"lora-spi-miso": "LORA_MISO",
|
|
||||||
"lora-spi-sclk": "LORA_SCK",
|
|
||||||
"lora-cs": "LORA_NSS",
|
|
||||||
"lora-reset": "LORA_RESET",
|
|
||||||
"lora-dio0": "LORA_DIO0",
|
|
||||||
"lora-dio1": "LORA_DIO1",
|
|
||||||
"lora-dio2": "LORA_DIO2",
|
|
||||||
"lora-dio3": "LORA_DIO3",
|
|
||||||
"lora-dio4": "LORA_DIO4",
|
|
||||||
"lora-dio5": "NC",
|
|
||||||
"lora-rf-switch-ctl1": "NC",
|
|
||||||
"lora-rf-switch-ctl2": "NC",
|
|
||||||
"lora-txctl": "NC",
|
|
||||||
"lora-rxctl": "NC",
|
|
||||||
"lora-ant-switch": "NC",
|
|
||||||
"lora-pwr-amp-ctl": "NC",
|
|
||||||
"lora-tcxo": "NC"
|
|
||||||
},
|
|
||||||
|
|
||||||
"MTB_MTS_XDOT": {
|
|
||||||
"lora-radio": "SX1272",
|
|
||||||
"lora-spi-mosi": "LORA_MOSI",
|
|
||||||
"lora-spi-miso": "LORA_MISO",
|
|
||||||
"lora-spi-sclk": "LORA_SCK",
|
|
||||||
"lora-cs": "LORA_NSS",
|
|
||||||
"lora-reset": "LORA_RESET",
|
|
||||||
"lora-dio0": "LORA_DIO0",
|
|
||||||
"lora-dio1": "LORA_DIO1",
|
|
||||||
"lora-dio2": "LORA_DIO2",
|
|
||||||
"lora-dio3": "LORA_DIO3",
|
|
||||||
"lora-dio4": "LORA_DIO4",
|
|
||||||
"lora-dio5": "NC",
|
|
||||||
"lora-rf-switch-ctl1": "NC",
|
|
||||||
"lora-rf-switch-ctl2": "NC",
|
|
||||||
"lora-txctl": "NC",
|
|
||||||
"lora-rxctl": "NC",
|
|
||||||
"lora-ant-switch": "NC",
|
|
||||||
"lora-pwr-amp-ctl": "NC",
|
|
||||||
"lora-tcxo": "NC"
|
|
||||||
},
|
|
||||||
|
|
||||||
"LTEK_FF1705": {
|
|
||||||
"lora-radio": "SX1272",
|
|
||||||
"lora-spi-mosi": "LORA_MOSI",
|
|
||||||
"lora-spi-miso": "LORA_MISO",
|
|
||||||
"lora-spi-sclk": "LORA_SCK",
|
|
||||||
"lora-cs": "LORA_NSS",
|
|
||||||
"lora-reset": "LORA_RESET",
|
|
||||||
"lora-dio0": "LORA_DIO0",
|
|
||||||
"lora-dio1": "LORA_DIO1",
|
|
||||||
"lora-dio2": "LORA_DIO2",
|
|
||||||
"lora-dio3": "LORA_DIO3",
|
|
||||||
"lora-dio4": "LORA_DIO4",
|
|
||||||
"lora-dio5": "NC",
|
|
||||||
"lora-rf-switch-ctl1": "NC",
|
|
||||||
"lora-rf-switch-ctl2": "NC",
|
|
||||||
"lora-txctl": "NC",
|
|
||||||
"lora-rxctl": "NC",
|
|
||||||
"lora-ant-switch": "NC",
|
|
||||||
"lora-pwr-amp-ctl": "NC",
|
|
||||||
"lora-tcxo": "NC"
|
|
||||||
},
|
|
||||||
|
|
||||||
"MTS_MDOT_F411RE": {
|
|
||||||
"lora-radio": "SX1272",
|
|
||||||
"lora-spi-mosi": "LORA_MOSI",
|
|
||||||
"lora-spi-miso": "LORA_MISO",
|
|
||||||
"lora-spi-sclk": "LORA_SCK",
|
|
||||||
"lora-cs": "LORA_NSS",
|
|
||||||
"lora-reset": "LORA_RESET",
|
|
||||||
"lora-dio0": "LORA_DIO0",
|
|
||||||
"lora-dio1": "LORA_DIO1",
|
|
||||||
"lora-dio2": "LORA_DIO2",
|
|
||||||
"lora-dio3": "LORA_DIO3",
|
|
||||||
"lora-dio4": "LORA_DIO4",
|
|
||||||
"lora-dio5": "LORA_DIO5",
|
|
||||||
"lora-rf-switch-ctl1": "NC",
|
|
||||||
"lora-rf-switch-ctl2": "NC",
|
|
||||||
"lora-txctl": "LORA_TXCTL",
|
|
||||||
"lora-rxctl": "LORA_RXCTL",
|
|
||||||
"lora-ant-switch": "NC",
|
|
||||||
"lora-pwr-amp-ctl": "NC",
|
|
||||||
"lora-tcxo": "NC"
|
|
||||||
},
|
|
||||||
|
|
||||||
"MTB_ADV_WISE_1510": {
|
|
||||||
"lora-radio": "SX1276",
|
|
||||||
"lora-spi-mosi": "SPI_RF_MOSI",
|
|
||||||
"lora-spi-miso": "SPI_RF_MISO",
|
|
||||||
"lora-spi-sclk": "SPI_RF_SCK",
|
|
||||||
"lora-cs": "SPI_RF_CS",
|
|
||||||
"lora-reset": "SPI_RF_RESET",
|
|
||||||
"lora-dio0": "DIO0",
|
|
||||||
"lora-dio1": "DIO1",
|
|
||||||
"lora-dio2": "DIO2",
|
|
||||||
"lora-dio3": "DIO3",
|
|
||||||
"lora-dio4": "DIO4",
|
|
||||||
"lora-dio5": "DIO5",
|
|
||||||
"lora-rf-switch-ctl1": "NC",
|
|
||||||
"lora-rf-switch-ctl2": "NC",
|
|
||||||
"lora-txctl": "NC",
|
|
||||||
"lora-rxctl": "NC",
|
|
||||||
"lora-ant-switch": "ANT_SWITCH",
|
|
||||||
"lora-pwr-amp-ctl": "NC",
|
|
||||||
"lora-tcxo": "NC"
|
|
||||||
},
|
|
||||||
|
|
||||||
"MTB_RAK811": {
|
|
||||||
"lora-radio": "SX1276",
|
|
||||||
"lora-spi-mosi": "SPI_RF_MOSI",
|
|
||||||
"lora-spi-miso": "SPI_RF_MISO",
|
|
||||||
"lora-spi-sclk": "SPI_RF_SCK",
|
|
||||||
"lora-cs": "SPI_RF_CS",
|
|
||||||
"lora-reset": "SPI_RF_RESET",
|
|
||||||
"lora-dio0": "DIO0",
|
|
||||||
"lora-dio1": "DIO1",
|
|
||||||
"lora-dio2": "DIO2",
|
|
||||||
"lora-dio3": "DIO3",
|
|
||||||
"lora-dio4": "DIO4",
|
|
||||||
"lora-dio5": "NC",
|
|
||||||
"lora-rf-switch-ctl1": "NC",
|
|
||||||
"lora-rf-switch-ctl2": "NC",
|
|
||||||
"lora-txctl": "ANT_CTX_PA",
|
|
||||||
"lora-rxctl": "ANT_CRX_RX",
|
|
||||||
"lora-ant-switch": "NC",
|
|
||||||
"lora-pwr-amp-ctl": "NC",
|
|
||||||
"lora-tcxo": "RF_TCXO_EN",
|
|
||||||
"battery-enabled": true,
|
|
||||||
"battery-adc": "PA_2",
|
|
||||||
"dht-enabled": true,
|
|
||||||
"dht-data": "PA_1",
|
|
||||||
"dht-type": "DHT::DHT22"
|
|
||||||
},
|
|
||||||
|
|
||||||
"NUCLEO_L073RZ": {
|
|
||||||
"main_stack_size": 1024,
|
|
||||||
"target.lpticker_lptim": 0,
|
|
||||||
"target.clock_source": "USE_PLL_HSI",
|
|
||||||
"target.stdio_uart_tx": "PC_10",
|
|
||||||
"target.stdio_uart_rx": "PC_11",
|
|
||||||
"lora-radio": "SX1272",
|
|
||||||
"lora-spi-mosi": "D11",
|
|
||||||
"lora-spi-miso": "D12",
|
|
||||||
"lora-spi-sclk": "D13",
|
|
||||||
"lora-cs": "D10",
|
|
||||||
"lora-reset": "A0",
|
|
||||||
"lora-dio0": "D2",
|
|
||||||
"lora-dio1": "D3",
|
|
||||||
"lora-dio2": "D4",
|
|
||||||
"lora-dio3": "D5",
|
|
||||||
"lora-dio4": "NC",
|
|
||||||
"lora-dio5": "NC",
|
|
||||||
"lora-rf-switch-ctl1": "NC",
|
|
||||||
"lora-rf-switch-ctl2": "NC",
|
|
||||||
"lora-txctl": "NC",
|
|
||||||
"lora-rxctl": "NC",
|
|
||||||
"lora-ant-switch": "A4",
|
|
||||||
"lora-pwr-amp-ctl": "NC",
|
|
||||||
"lora-tcxo": "NC",
|
|
||||||
"battery-enabled": false,
|
|
||||||
"battery-adc": "PA_2",
|
|
||||||
"dht-enabled": true,
|
|
||||||
"dht-data": "D8",
|
|
||||||
"dht-type": "DHT::DHT22",
|
|
||||||
"hx711-enabled": true,
|
|
||||||
"hx711-clk": "D7",
|
|
||||||
"hx711-data": "D6",
|
|
||||||
"hx711-scale": "21000.0f",
|
|
||||||
"hx711-offset": -2000
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"macros": ["MBEDTLS_USER_CONFIG_FILE=\"mbedtls_lora_config.h\""]
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
https://github.com/ARMmbed/minimal-printf/#7a57a3e36a227a3e412cec55b0eeaf649b9fa7c9
|
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
{
|
||||||
|
"GCC_ARM": {
|
||||||
|
"common": ["-c", "-Wall", "-Wextra",
|
||||||
|
"-Wno-unused-parameter", "-Wno-missing-field-initializers",
|
||||||
|
"-fmessage-length=0", "-fno-exceptions", "-fno-builtin",
|
||||||
|
"-ffunction-sections", "-fdata-sections", "-funsigned-char",
|
||||||
|
"-MMD", "-fno-delete-null-pointer-checks",
|
||||||
|
"-fomit-frame-pointer", "-Os", "-DNDEBUG", "-g1"],
|
||||||
|
"asm": ["-x", "assembler-with-cpp"],
|
||||||
|
"c": ["-std=gnu99"],
|
||||||
|
"cxx": ["-std=gnu++98", "-fno-rtti", "-Wvla"],
|
||||||
|
"ld": ["-Wl,--gc-sections", "-Wl,--wrap,main", "-Wl,--wrap,_malloc_r",
|
||||||
|
"-Wl,--wrap,_free_r", "-Wl,--wrap,_realloc_r", "-Wl,--wrap,_memalign_r",
|
||||||
|
"-Wl,--wrap,_calloc_r", "-Wl,--wrap,exit", "-Wl,--wrap,atexit",
|
||||||
|
"-Wl,-n", "--specs=nano.specs", "-u _printf_float"]
|
||||||
|
},
|
||||||
|
"ARMC6": {
|
||||||
|
"common": ["-c", "--target=arm-arm-none-eabi", "-mthumb", "-Oz",
|
||||||
|
"-Wno-armcc-pragma-push-pop", "-Wno-armcc-pragma-anon-unions",
|
||||||
|
"-DMULADDC_CANNOT_USE_R7", "-fdata-sections",
|
||||||
|
"-fno-exceptions", "-MMD", "-D_LIBCPP_EXTERN_TEMPLATE(...)=",
|
||||||
|
"-fshort-enums", "-fshort-wchar"],
|
||||||
|
"asm": [],
|
||||||
|
"c": ["-D__ASSERT_MSG", "-std=gnu99"],
|
||||||
|
"cxx": ["-fno-rtti", "-std=gnu++98"],
|
||||||
|
"ld": ["--show_full_path", "--legacyalign"]
|
||||||
|
},
|
||||||
|
"ARM": {
|
||||||
|
"common": ["-c", "--gnu", "-Ospace", "--split_sections",
|
||||||
|
"--apcs=interwork", "--brief_diagnostics", "--restrict",
|
||||||
|
"--multibyte_chars", "-O3", "-DNDEBUG"],
|
||||||
|
"asm": [],
|
||||||
|
"c": ["--md", "--no_depend_system_headers", "--c99", "-D__ASSERT_MSG"],
|
||||||
|
"cxx": ["--cpp", "--no_rtti", "--no_vla"],
|
||||||
|
"ld": ["--show_full_path"]
|
||||||
|
},
|
||||||
|
"uARM": {
|
||||||
|
"common": ["-c", "--gnu", "-Ospace", "--split_sections",
|
||||||
|
"--apcs=interwork", "--brief_diagnostics", "--restrict",
|
||||||
|
"--multibyte_chars", "-O3", "-D__MICROLIB",
|
||||||
|
"--library_type=microlib", "-DMBED_RTOS_SINGLE_THREAD", "-DNDEBUG"],
|
||||||
|
"asm": [],
|
||||||
|
"c": ["--md", "--no_depend_system_headers", "--c99", "-D__ASSERT_MSG"],
|
||||||
|
"cxx": ["--cpp", "--no_rtti", "--no_vla"],
|
||||||
|
"ld": ["--library_type=microlib"]
|
||||||
|
},
|
||||||
|
"IAR": {
|
||||||
|
"common": [
|
||||||
|
"--no_wrap_diagnostics", "-e",
|
||||||
|
"--diag_suppress=Pa050,Pa084,Pa093,Pa082", "-Ohz", "-DNDEBUG", "--enable_restrict"],
|
||||||
|
"asm": [],
|
||||||
|
"c": ["--vla", "--diag_suppress=Pe546"],
|
||||||
|
"cxx": ["--guard_calls", "--no_static_destruction"],
|
||||||
|
"ld": ["--skip_dynamic_initialization", "--threaded_lib"]
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
https://github.com/atoy40/mbed-dht/#0aa899f3a68e02eec69e74a6f68c35249530d89d
|
https://github.com/atoy40/mbed-dht/#5e378f5eaf8d3ba88af711e035652d6277124a06
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
https://github.com/atoy40/mbed-hx711/#92640d4fcfc8f2128c3f3f54031cfafed5733bc8
|
https://github.com/atoy40/mbed-hx711/#30e787849a54a53c0e055e21ad45d0f7b2c982b6
|
||||||
|
|||||||
Reference in New Issue
Block a user