end node on synchronous star LoRa network.

Dependencies:   SX127x sx12xx_hal TSL2561

radio chip selection

Radio chip driver is not included, allowing choice of radio device.
If you're using SX1272 or SX1276, then import sx127x driver into your program.
if you're using SX1261 or SX1262, then import sx126x driver into your program.
if you're using SX1280, then import sx1280 driver into your program.
If you're using NAmote72 or Murata discovery, then you must import only sx127x driver.

This project for use with LoRaWAN_singlechannel_gateway project.

Alternately gateway running on raspberry pi can be used as gateway.

LoRaWAN on single radio channel

Network description is at gateway project page. Synchronous star network.

Hardware Support

This project supports SX1276 and SX1272, sx126x kit, sx126x shield, and sx128x 2.4GHz. The ST board B-L072Z-LRWAN1 is also supported (TypeABZ module). When B-L072Z-LRWAN1 target is selected, TARGET_DISCO_L072CZ_LRWAN1 is defined by tools, allowing correct radio driver configuration for this platform. Alternately, any mbed board that can use LoRa radio shield board should work, but NUCLEO boards are tested.

End-node Unique ID

DevEUI is created from CPU serial number. AppEUI and AppKey are declared as software constants.

End-node Configuration

Data rate definition LORAMAC_DEFAULT_DATARATE configured in LoRaMac-definitions.h. See gateway project page for configuration of gateway.
LoRaWAN addressing is configured in Comissioning.h; only OTA mode is functional.
Header file board/lora_config.h, selects application layer options (i.e. sensors) to be compiled in.

Serial Interface

Serial port operates at 115200bps.
Application layer single_us915_main.cpp User button triggers uplink (i.e. blue button on nucleo board), or jumper enables continuously sends repeated uplink packets. The MAC layer holds each uplink request until the allocated timeslot.

commandargumentsdescription
?-print available commands
. (period)-print status (DevEUI, DevAddr, etc)
ullength integerset payload length of test uplink packets

sensor demo

Selected grove sensors may be plugged into SX1272 shield.
To enable, edit lora_config.h to define SENSORS.

Sensor connections on SX1272MB2xAS:

D8 D9: buttonRX TX: (unused)A3 A4: Rotary Angle Sensor
D6 D7: RGB LEDSCL SDA: digital light sensorA1 A2: Rotary Angle Sensor

Digital input pin, state reported via uplink: PC8
Digital output pin, controlled via downlink: PC6
PWM out: PB_10

Jumper enables auto-repeated transmit: PC10 and PC12 on NUCLEO board, located on end of morpho headers nearby JP4.

Changes

RevisionDateWhoCommit message
35:be452a242876 2020-07-13 Wayne Roberts remove old crypto default tip
34:9c8966cd66a2 2020-07-10 Wayne Roberts update to using mbed-6
33:bc0b6be19e07 2018-12-19 Wayne Roberts for rx window timer, capture txDone using rx window timer
32:ac904adfc842 2018-12-16 dudmuck ceil() requires argument type cast
31:6ed03f61af64 2018-12-16 Wayne Roberts rename header file due to header with same name in mbed-os
30:1c35c4f56e50 2018-12-13 Wayne Roberts add sx1280, add beacon duration to join accept
29:ad409c68c0a6 2018-12-07 Wayne Roberts update to latest radio HAL
28:36be305a5e5e 2017-08-28 dudmuck when RGB enabled, indicate beacon lost
27:c8b432b2a4a8 2017-08-14 dudmuck add sequency number to sensor polling
26:8227a4edb216 2017-08-11 dudmuck sensor sampling asychronous to uplink activity
25:fed9d5b77183 2017-08-10 dudmuck uplink held during beacon, and sent after beacon done
24:94ea42eb6b9e 2017-08-09 dudmuck sx1276 driver: support all arduino form factor. User button on murata-discovery board.
23:a862b5601663 2017-08-08 dudmuck sx1276 driver: support PaSelect on TYPE_ABZ module
22:999a7e7698a8 2017-08-07 dudmuck add remote tx-power-index control
21:500ff43d8424 2017-08-04 dudmuck rejoin in application layer
20:42839629a5dc 2017-08-04 dudmuck add sleep() call, mbedignore rtos
19:c3af34457b6d 2017-08-02 dudmuck button_isr runs with jumper installed
18:9ac71c0eb70d 2017-08-02 dudmuck add pwm commands and 434MHz band
17:3215f12051f9 2017-07-28 dudmuck handle stalled beacon reception in application layer
16:915815632c1f 2017-07-27 dudmuck simplify MAC beacon timer
15:9023bf4cf168 2017-07-13 dudmuck add txpower command to application layer, increase beacon guard to 2.5s
14:7ac0add1123e 2017-07-10 dudmuck application layer: for sensors use uplink_length
13:18de9ee3a461 2017-07-08 dudmuck gateway-tx debug input pin, discard timer error on missed beacon
12:ed33c53afcaf 2017-07-05 dudmuck add sensor demo option
11:4c337f5bbe4c 2017-06-19 dudmuck sensor support in application layer
10:00997daeb0c0 2017-06-17 dudmuck add sensor support for grove connectors
9:08692264148b 2017-06-12 dudmuck remove TYPE_ABZ preprocessor directive, instead use TARGET_DISCO_L072CZ_LRWAN1
8:ab2f9a8d2eaa 2017-06-07 dudmuck prevent rx window from colliding with beacon reception
7:e238827f0e47 2017-06-06 dudmuck Randomize join-retry delay. Use RawSerial for getc() in ISR.
6:240fd4938d51 2017-05-26 dudmuck correct uplink scheduling over beacon reserved time
5:c108560af4c3 2017-05-26 dudmuck add sx1272 debug pin, prevent uplink config from being changed by beacon
4:d9201410c87b 2017-05-26 dudmuck correct baud rate to 38400
3:aead8f8fdc1f 2017-05-26 dudmuck add choice of radio chip
2:f2d9aa163652 2017-05-23 dudmuck rejoin network after several missed beacons
1:53c30224eda8 2017-05-22 dudmuck prevent lockup from printing in ISR
0:8f0d0ae0a077 2017-05-18 dudmuck initial commit