contain lorawan with serial_rx enabled
Dependencies: pulga-lorawan-drv SPI_MX25R Si1133 BME280
Revision 59:a4fc1efb1569, committed 2019-12-10
- Comitter:
- pancotinho
- Date:
- Tue Dec 10 13:08:45 2019 +0000
- Parent:
- 58:4d1114ac60aa
- Child:
- 60:c4f9e9202fb4
- Commit message:
- commit lorawan
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/BME280.lib Tue Dec 10 13:08:45 2019 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/users/MACRUM/code/BME280/#c1f1647004c4
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/BMI160_driver.lib Tue Dec 10 13:08:45 2019 +0000 @@ -0,0 +1,1 @@ +https://github.com/BoschSensortec/BMI160_driver.git/#a23022cc3208fe367d886c65df2f025e80203037
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/BMM150-Sensor-API.lib Tue Dec 10 13:08:45 2019 +0000 @@ -0,0 +1,1 @@ +https://github.com/BoschSensortec/BMM150-Sensor-API.git/#3ee41a2285823374fca80c258e93c031caa9715c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Si1133.lib Tue Dec 10 13:08:45 2019 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/teams/SiliconLabs/code/Si1133/#f780ca9105bb
--- a/main.cpp Tue Oct 08 14:01:59 2019 +0100 +++ b/main.cpp Tue Dec 10 13:08:45 2019 +0000 @@ -21,9 +21,10 @@ #include "events/EventQueue.h" // Application helpers -#include "DummySensor.h" +//#include "DummySensor.h" #include "trace_helper.h" #include "lora_radio_helper.h" +#include "BME280.h" using namespace events; @@ -53,12 +54,20 @@ /** * Dummy pin for dummy sensor */ -#define PC_9 0 +//#define PC_9 0 /** * Dummy sensor class object */ -DS1820 ds1820(PC_9); +//DS1820 ds1820(PC_9); +BME280 sensor_amb(P0_13, P0_15, 0x77 << 1) ; + +/** + * Sensors Variables + */ + uint32_t lux = 0; + uint32_t amb = 0; + float sensor_get = 0; /** * This event queue is the global event queue for both the @@ -90,6 +99,10 @@ /** * Entry point for application */ + +mbed::DigitalOut _alive_led(P1_13, 1); +mbed::DigitalOut _actuated_led(P1_14,0); + int main(void) { // setup tracing @@ -138,7 +151,8 @@ } printf("\r\n Connection - In Progress ...\r\n"); - + +_actuated_led =1; // make your event queue dispatching events forever ev_queue.dispatch_forever(); @@ -154,18 +168,23 @@ int16_t retcode; int32_t sensor_value; - if (ds1820.begin()) { + /* if (ds1820.begin()) { ds1820.startConversion(); sensor_value = ds1820.read(); printf("\r\n Dummy Sensor Value = %d \r\n", sensor_value); - ds1820.startConversion(); + ds1820.startConversion(); + sensor_value++; + } else { printf("\r\n No sensor found \r\n"); return; - } + }*/ + + sensor_amb.initialize(); + sensor_get = sensor_amb.getTemperature(); - packet_len = sprintf((char *) tx_buffer, "Dummy Sensor Value is %d", - sensor_value); + packet_len = sprintf((char *) tx_buffer, "Temperature Sensor Value is %d", + sensor_get); retcode = lorawan.send(MBED_CONF_LORA_APP_PORT, tx_buffer, packet_len, MSG_UNCONFIRMED_FLAG); @@ -236,8 +255,11 @@ } break; case TX_TIMEOUT: + printf("\r\n Transmission Error TX_Timeout"); case TX_ERROR: + printf("\r\n Transmission Error TX_Error"); case TX_CRYPTO_ERROR: + printf("\r\n Transmission Error TX_Crypto_Error"); case TX_SCHEDULING_ERROR: printf("\r\n Transmission Error - EventCode = %d \r\n", event); // try again @@ -250,6 +272,7 @@ receive_message(); break; case RX_TIMEOUT: + printf("\r\n Transmission Error RX_Timeout"); case RX_ERROR: printf("\r\n Error in reception - Code = %d \r\n", event); break;
--- a/mbed-lora-radio-drv.lib Tue Oct 08 14:01:59 2019 +0100 +++ b/mbed-lora-radio-drv.lib Tue Dec 10 13:08:45 2019 +0000 @@ -1,1 +1,1 @@ -https://github.com/ARMmbed/mbed-semtech-lora-rf-drivers#6012fa43cf9f2cae46fa9d424fe4051d00e157a2 +https://github.com/ARMmbed/mbed-semtech-lora-rf-drivers/#6012fa43cf9f2cae46fa9d424fe4051d00e157a2
--- a/mbed-os.lib Tue Oct 08 14:01:59 2019 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -https://github.com/ARMmbed/mbed-os/#b6e5a0a8afa34dec9dae8963778aebce0c82a54b
--- a/mbed_app.json Tue Oct 08 14:01:59 2019 +0100 +++ b/mbed_app.json Tue Dec 10 13:08:45 2019 +0000 @@ -2,7 +2,7 @@ "config": { "lora-radio": { "help": "Which radio to use (options: SX126X, SX1272, SX1276) -- See config/ dir for example configs", - "value": "SX1276" + "value": "SX1272" }, "main_stack_size": { "value": 4096 }, @@ -28,17 +28,22 @@ "target_overrides": { "*": { "platform.stdio-convert-newlines": true, - "platform.stdio-baud-rate": 115200, - "platform.default-serial-baud-rate": 115200, - "lora.over-the-air-activation": true, + "platform.stdio-baud-rate": 9600, + "platform.default-serial-baud-rate": 9600, + "lora.over-the-air-activation": false, "lora.duty-cycle-on": true, - "lora.phy": "EU868", - "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 }" + "lora.phy": "AU915", + "lora.device-eui": "{0x2f, 0xc6, 0xaa, 0xf2, 0x8b, 0x61, 0x4f, 0x8a}", + "lora.application-eui": "{0x65, 0x48, 0x59, 0x64, 0x52, 0xd4, 0xc5, 0xd5}", + "lora.application-key": "{0xa8, 0xdc, 0xc6, 0x31, 0x35, 0x38, 0x90, 0xf7, 0x0b, 0x5c, 0x5e, 0xf6, 0x5a, 0x87, 0x9c, 0xd0}", + "lora.appskey": "{ 0x8e, 0x28, 0xac, 0x67, 0x5b, 0xfe, 0x1c, 0xea, 0x4c, 0x2a, 0xeb, 0x15, 0x87, 0x22, 0xe6, 0x6a}", + "lora.nwkskey": "{ 0xaa, 0x68, 0xae, 0x6e, 0x14, 0x65, 0x3a, 0xa5, 0x18, 0x38, 0x00, 0x42, 0xe3, 0x17, 0xd4, 0x8e}", + "lora.device-address": "0xc03b0ff0" }, "K64F": { + "target.features_add": ["BLE"], + "target.extra_labels_add": ["CORDIO", "CORDIO_BLUENRG"], "lora-spi-mosi": "D11", "lora-spi-miso": "D12", "lora-spi-sclk": "D13", @@ -280,6 +285,47 @@ "lora-ant-switch": "NC", "lora-pwr-amp-ctl": "NC", "lora-tcxo": "NC" + }, + "NUCLEO_F401RE": { + "target.features_add": ["BLE"], + "target.extra_labels_add": ["CORDIO", "CORDIO_BLUENRG"] + }, + "DISCO_L475VG_IOT01A": { + "target.features_add": ["BLE"], + "target.extra_labels_add": ["CORDIO", "CORDIO_BLUENRG"] + }, + "NRF52840_DK": { + "target.features_add": ["BLE"], + "target.extra_labels_add": ["CORDIO", "CORDIO_LL", "SOFTDEVICE_N ONE", "NORDIC_CORDIO"], + "target.extra_labels_remove": ["SOFTDEVICE_COMMON", "SOFTDEVICE_S140_FULL", "NORDIC_SOFTDEVICE"], + "target.lf_clock_src": "NRF_LF_SRC_RC", + "target.lf_clock_rc_calib_timer_interval": 16, + "target.lf_clock_rc_calib_mode_config": 2, + "target.macros_add": ["NRFX_GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS=4"], + "lora-spi-mosi": "P0_4", + "lora-spi-miso": "P0_6", + "lora-spi-sclk": "P0_8", + "lora-cs": "P0_26", + "lora-reset": "P1_15", + "lora-dio0": "P0_12", + "lora-dio1": "P0_14", + "lora-dio2": "P1_8", + "lora-dio3": "P1_9", + "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": "NC", + "lora-pwr-amp-ctl": "NC", + "lora-tcxo": "NC" + + }, + "NRF52_DK": { + "target.features_add": ["BLE"], + "target.extra_labels_add": ["CORDIO", "CORDIO_LL", "SOFTDEVICE_NONE", "NORDIC_CORDIO"], + "target.extra_labels_remove": ["SOFTDEVICE_COMMON", "SOFTDEVICE_S132_FULL", "NORDIC_SOFTDEVICE"] } }, "macros": ["MBEDTLS_USER_CONFIG_FILE=\"mbedtls_lora_config.h\""]
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed_coragem.lib Tue Dec 10 13:08:45 2019 +0000 @@ -0,0 +1,1 @@ +https://github.com/leiachewbacca/mbed_coragem/#b8dad0652c9cd2321126a590280a18a964e1eed0
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/shields/TARGET_CORDIO_BLUENRG.lib Tue Dec 10 13:08:45 2019 +0000 @@ -0,0 +1,1 @@ +https://github.com/ARMmbed/cordio-ble-x-nucleo-idb0xa1/#811f3fea7aa8083c0bbf378e1b51a8b131d7efcc