Compare commits
6 Commits
cf1c0d1737
..
2019.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 32df3b9a2d | |||
| 764d42095c | |||
| cb1de9bc8c | |||
| 715d0ee1a8 | |||
| 3f92cc41a1 | |||
| 66a23299f3 |
@@ -10,4 +10,7 @@ sensors/HX711
|
||||
|
||||
*.bin
|
||||
devices.txt
|
||||
|
||||
# mbed vscode export generated files
|
||||
GettingStarted.html
|
||||
.vscode
|
||||
@@ -13,13 +13,30 @@ mbed toolchain GCC_ARM
|
||||
mbed target NUCLEO_L073RZ
|
||||
# set-up the compiler path if needed
|
||||
mbed config -G GCC_ARM_PATH /opt/gcc-arm-none-eabi-7-2017-q4-major/bin
|
||||
cp mbed_app.json.sample mbed_app.json
|
||||
# modify lora.device-eui, lora.application-eui and lora.application-key in mbed_app.json
|
||||
# or use the provided script to change them into the binary file
|
||||
```
|
||||
|
||||
### Bootstrap mode
|
||||
|
||||
This mode is used to initialize a mbed NVStore on the flash and store board-specific parameters.
|
||||
To compile the bootstrap binary you have to set "mode-bootstrap" to true into mbed_app.json and set
|
||||
lorawan EUIs and key.
|
||||
|
||||
```
|
||||
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 flash the board and start it. You can check the serial console to see reporting.
|
||||
|
||||
### Production mode
|
||||
|
||||
Just reset "mode-boostrap" to false and compile it (you can delete BUILD folder from previous compilation) :
|
||||
|
||||
```
|
||||
mbed compile --profile profiles/release.json
|
||||
```
|
||||
|
||||
In this mode, lorawan parameters are ignored (because the program get it from the flash) but
|
||||
leave it as-is because they are used to determine the stored size ot the euis and key.
|
||||
|
||||
## Notes
|
||||
|
||||
|
||||
@@ -133,8 +133,6 @@ int main(void) {
|
||||
uint16_t key;
|
||||
uint16_t readsize;
|
||||
|
||||
connect.connect_type = LORAWAN_CONNECTION_OTAA;
|
||||
|
||||
// NVStore is a sigleton, get its instance
|
||||
NVStore &nvstore = NVStore::get_instance();
|
||||
|
||||
@@ -164,6 +162,7 @@ int main(void) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
connect.connect_type = LORAWAN_CONNECTION_OTAA;
|
||||
connect.connection_u.otaa.app_eui = const_cast<uint8_t *>(app_eui);
|
||||
connect.connection_u.otaa.dev_eui = const_cast<uint8_t *>(dev_eui);
|
||||
connect.connection_u.otaa.app_key = const_cast<uint8_t *>(app_key);
|
||||
|
||||
+7
-6
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"config": {
|
||||
"mode-bootstrap": { "value": "false" },
|
||||
"mode-bootstrap": { "value": false },
|
||||
"tx-timer": { "value": 600000 },
|
||||
"lora-radio": {
|
||||
"help": "Which radio to use (options: SX1272,SX1276)",
|
||||
@@ -25,20 +25,20 @@
|
||||
"lora-ant-switch": { "value": "NC" },
|
||||
"lora-pwr-amp-ctl": { "value": "NC" },
|
||||
"lora-tcxo": { "value": "NC" },
|
||||
"battery-enabled": { "value": "false" },
|
||||
"battery-enabled": { "value": false },
|
||||
"battery-lpp-id": { "value": 1 },
|
||||
"battery-in-lpp": { "value": "false" },
|
||||
"battery-in-lpp": { "value": false },
|
||||
"battery-adc": { "value": "NC" },
|
||||
"battery-min": { "value": "3.20f" },
|
||||
"battery-max": { "value": "4.15f" },
|
||||
"battery-ratio": { "value": "2.0f" },
|
||||
"hx711-enabled": { "value": "false" },
|
||||
"hx711-enabled": { "value": false },
|
||||
"hx711-lpp-id": { "value": 2 },
|
||||
"hx711-clk": { "value": "NC" },
|
||||
"hx711-data": { "value": "NC" },
|
||||
"hx711-scale": { "value": "1.0f" },
|
||||
"hx711-offset": { "value": 0 },
|
||||
"dht-enabled": { "value": "false" },
|
||||
"dht-enabled": { "value": false },
|
||||
"dht-temp-lpp-id": { "value": 3 },
|
||||
"dht-hum-lpp-id": { "value": 4 },
|
||||
"dht-type": { "value": "DHT::DHT22" },
|
||||
@@ -46,11 +46,12 @@
|
||||
},
|
||||
"target_overrides": {
|
||||
"*": {
|
||||
"mode-bootstrap": false,
|
||||
"tx-timer": 600000,
|
||||
"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": true,
|
||||
"lora.phy": 0,
|
||||
"lora.device-eui": "{ 0xAB, 0xBA, 0xAB, 0xBA, 0xAB, 0xBA, 0xAB, 0xBA }",
|
||||
|
||||
Reference in New Issue
Block a user