LoRaMac-node-master_V3.3

所属分类:通讯编程
开发工具:C/C++
文件大小:3352KB
下载次数:21
上传日期:2018-06-29 16:03:23
上 传 者威海角天涯
说明:  lorawan STM32 方案,实现ping-pong功能,节点功能。
(lorawan STM32 long range wire air net)

文件列表:
Doc (0, 2015-08-07)
Doc\Bleeper-72-schematic.pdf (91359, 2015-08-07)
Doc\Bleeper-76-schematic.pdf (638301, 2015-08-07)
Doc\LoRaMote-schematic.pdf (512945, 2015-08-07)
Doc\SensorNode-schematic.pdf (1526329, 2015-08-07)
Doc\iM880A_Datasheet.pdf (718857, 2015-08-07)
Keil (0, 2015-08-07)
Keil\Bleeper-72 (0, 2015-08-07)
Keil\Bleeper-72\LoRaMac (0, 2015-08-07)
Keil\Bleeper-72\LoRaMac\classA (0, 2015-08-07)
Keil\Bleeper-72\LoRaMac\classA\LoRaMac.uvopt (22950, 2015-08-07)
Keil\Bleeper-72\LoRaMac\classA\LoRaMac.uvproj (24269, 2015-08-07)
Keil\Bleeper-72\LoRaMac\classB (0, 2015-08-07)
Keil\Bleeper-72\LoRaMac\classB\LoRaMac.uvopt (22950, 2015-08-07)
Keil\Bleeper-72\LoRaMac\classB\LoRaMac.uvproj (24269, 2015-08-07)
Keil\Bleeper-72\LoRaMac\classC (0, 2015-08-07)
Keil\Bleeper-72\LoRaMac\classC\LoRaMac.uvopt (22950, 2015-08-07)
Keil\Bleeper-72\LoRaMac\classC\LoRaMac.uvproj (24269, 2015-08-07)
Keil\Bleeper-72\LoRaMac\radioCoverageTest (0, 2015-08-07)
Keil\Bleeper-72\LoRaMac\radioCoverageTest\radioCoverageTest.uvopt (22981, 2015-08-07)
Keil\Bleeper-72\LoRaMac\radioCoverageTest\radioCoverageTest.uvproj (24320, 2015-08-07)
Keil\Bleeper-72\ping-pong (0, 2015-08-07)
Keil\Bleeper-72\ping-pong\Ping-Pong.uvopt (25684, 2015-08-07)
Keil\Bleeper-72\ping-pong\Ping-Pong.uvproj (45996, 2015-08-07)
Keil\Bleeper-72\rx-sensi (0, 2015-08-07)
Keil\Bleeper-72\rx-sensi\rx-sensi.uvopt (25679, 2015-08-07)
Keil\Bleeper-72\rx-sensi\rx-sensi.uvproj (45986, 2015-08-07)
Keil\Bleeper-72\tx-cw (0, 2015-08-07)
Keil\Bleeper-72\tx-cw\tx-cw.uvopt (20865, 2015-08-07)
Keil\Bleeper-72\tx-cw\tx-cw.uvproj (23102, 2015-08-07)
Keil\Bleeper-76 (0, 2015-08-07)
Keil\Bleeper-76\LoRaMac (0, 2015-08-07)
Keil\Bleeper-76\LoRaMac\classA (0, 2015-08-07)
Keil\Bleeper-76\LoRaMac\classA\LoRaMac.uvopt (37250, 2015-08-07)
Keil\Bleeper-76\LoRaMac\classA\LoRaMac.uvproj (96212, 2015-08-07)
Keil\Bleeper-76\LoRaMac\classB (0, 2015-08-07)
Keil\Bleeper-76\LoRaMac\classB\LoRaMac.uvopt (37250, 2015-08-07)
Keil\Bleeper-76\LoRaMac\classB\LoRaMac.uvproj (96212, 2015-08-07)
... ...

/ _____) _ | | ( (____ _____ ____ _| |_ _____ ____| |__ \____ \| ___ | (_ _) ___ |/ ___) _ \ _____) ) ____| | | || |_| ____( (___| | | | (______/|_____)_|_|_| \__)_____)\____)_| |_| (C)2013 Semtech SX1272/76 radio drivers plus Ping-Pong firmware and LoRaWAN node firmware implementation. ===================================== 1. Introduction ---------------- The aim of this project is to show examples of the LoRaWAN specification endpoint firmware implementation. **REMARK 1:** *The Semtech implementation is a EU868 band Class A and Class C endpoint implementation fully compatible with LoRaWAN 1.0 specification.* **REMARK 2:** *The Class C normal operation has been tested using the Actility servers.* **REMARK 3:** *The Class C Multicast messages handling is not yet tested.* **Note:** *The IBM 'LoRaWAN in C' implementation supports the Class A profile and partial Class B support (beacon synchronization).* *A port of the IBM 'LoRaWAN in C' can be found on [MBED Semtech Team page](http://developer.mbed.org/teams/Semtech/) project [LoRaWAN-lmic-app](http://developer.mbed.org/teams/Semtech/code/LoRaWAN-lmic-app/)* 2. System schematic and definitions ------------------------------------ The available supported hardware platforms schematics and LoRaMac specification can be found in the Doc directory. 3. Acknowledgements ------------------- The mbed (https://mbed.org/) project was used at the beginning as source of inspiration. This program uses the AES algorithm implementation (http://www.gladman.me.uk/) by Brian Gladman. This program uses the CMAC algorithm implementation (http://www.cse.chalmers.se/research/group/dcs/masters/contikisec/) by Lander Casado, Philippas Tsigas. 4. Dependencies ---------------- This program depends on specific hardware platforms. Currently the supported platforms are: - Bleeper-72 MCU : STM32L151RD - 384K FLASH, 48K RAM, Timers, SPI, I2C, USART, USB 2.0 full-speed device/host/OTG controller, DAC, ADC, DMA RADIO : SX1272 ANTENNA : Connector for external antenna BUTTONS : 1 Reset, 16 position encoder LEDS : 3 SENSORS : Temperature GPS : Possible through pin header GPS module connection SDCARD : Yes EXTENSION HEADER : Yes, 12 pins REMARK : None. - Bleeper-76 MCU : STM32L151RD - 384K FLASH, 48K RAM, Timers, SPI, I2C, USART, USB 2.0 full-speed device/host/OTG controller, DAC, ADC, DMA RADIO : SX1276 ANTENNA : Connector for external antennas (LF+HF) BUTTONS : 1 Reset, 16 position encoder LEDS : 3 SENSORS : Temperature GPS : Possible through pin header GPS module connection SDCARD : No EXTENSION HEADER : Yes, 12 pins REMARK : None. - LoRaMote MCU : STM32L151CB - 128K FLASH, 10K RAM, Timers, SPI, I2C, USART, USB 2.0 full-speed device/host/OTG controller, DAC, ADC, DMA RADIO : SX1272 ANTENNA : Printed circuit antenna BUTTONS : No LEDS : 3 SENSORS : Proximity, Magnetic, 3 axis Accelerometer, Pressure, Temperature GPS : Yes, UP501 module SDCARD : No EXTENSION HEADER : Yes, 20 pins REMARK : The MCU and Radio are on an IMST iM880A module - SensorNode MCU : STM32L151C8 - ***K FLASH, 10K RAM, Timers, SPI, I2C, USART, USB 2.0 full-speed device/host/OTG controller, DAC, ADC, DMA RADIO : SX1276 ANTENNA : Printed circuit antenna BUTTONS : Power ON/OFF, General purpose button LEDS : 3 SENSORS : Proximity, Magnetic, 3 axis Accelerometer, Pressure, Temperature GPS : Yes, SIM39EA module SDCARD : No EXTENSION No REMARK : The MCU and Radio are on an NYMTEK Cherry-LCC module - SK-iM880A ( IMST starter kit ) MCU : STM32L151CB - 128K FLASH, 10K RAM, Timers, SPI, I2C, USART, USB 2.0 full-speed device/host/OTG controller, DAC, ADC, DMA RADIO : SX1272 ANTENNA : Connector for external antenna BUTTONS : 1 Reset, 3 buttons + 2 DIP-Switch LEDS : 3 SENSORS : Potentiometer GPS : Possible through pin header GPS module connection SDCARD : No EXTENSION HEADER : Yes, all IMST iM880A module pins REMARK : None 5. Usage --------- Projects for CooCox-CoIDE (partial), Ride7 and Keil Integrated Development Environments are available. One project is available per application and for each hardware platform in each development environment. Different targets/configurations have been created in the different projects in order to select different options such as the usage or not of a bootloader and the radio frequency band to be used. 6. Changelog ------------- 2015-08-07, v3.3 * General 1. Added the support for LoRaWAN Class C devices. 2. Implemented the radios errata note workarounds. SX1276 errata 2.3 "Receiver Spurious Reception of a LoRa Signal" is not yet implemented. 3. Increased FSK SyncWord timeout value in order to listen for longer time if a down link is available or not. Makes FSK downlink more reliable. 4. Increased the UART USB FIFO buffer size in order to handle bigger chunks of data. * LoRaWAN 1. Renamed data rates as per LoRaWAN specification. 2. Added the support for LoRaWAN Class C devices. 3. Handling of the MAC commands was done incorrectly the condition to verify the length of the buffer has changed from < to <=. 4. Added the possibility to change the channel mask and number of repetitions trough SRV_MAC_LINK_ADR_REQ command when ADR is disabled. 5. Corrected Rx1DrOffset management. In previous version DR1 was missing for all offsets. 6. Changed confirmed messages function to use default datarate when ADR control is off. 7. After a Join accept the node falls back to the default datarate. Enables the user to Join a network using a different datarate from its own default one. 8. Corrected default FSK channel frequency. 9. Solved a firmware freezing when one of the following situations arrived in OnRxDone callback: bad address, bad MIC, bad frame. (Pull request #10) 10. Moved the MAC commands processing to the right places. FOpts field before the Payload and Port 0 just after the decryption. (Pull request #9) 11. Weird conditions to check datarate on cmd mac SRV_MAC_NEW_CHANNEL_REQ (Pull request #7) 12. Ignore join accept message if already joined (Pull request #6) 13. Channel index verification should use OR on SRV_MAC_NEW_CHANNEL_REQ command (Pull request #5) 14. Corrected the CFList management on JoinAccept. The for loop indexes were wrong. (Pull request #4) 15. Correction of AES key size (Pull request #3) 2015-04-30, v3.2 * General 1. Updated LoRaMac implementation according to LoRaWAN R1.0 specification 2. General cosmetics corrections 3. Added the support of packed structures when using IAR tool chain 4. Timers: Added a function to get the time in us. 5. Timers: Added a typedef for time variables (TimerTime_t) 6. Radios: Changed the TimeOnAir radio function to return a uint32_t value instead of a double. The value is in us. 7. Radios: Corrected the 250 kHz bandwidth choice for the FSK modem 8. GPS: Added a function that returns if the GPS has a fix or not. 9. GPS: Changed the GetPosition functions to return a latitude and longitude of 0 and altitude of 65535 when no GPS fix. * LoRaWAN 1. Removed support for previous LoRaMac/LoRaWAN specifications 2. Added missing MAC commands and updated others when necessary * Corrected the Port 0 MAC commands decryption * Changed the way the upper layer is notified. Now it is only notified when all the operations are finished. When a ClassA Tx cycle starts a timer is launched to check every second if everything is finished. * Added a new parameter to LoRaMacEventFlags structure that indicates on which Rx window the data has been received. * Added a new parameter to LoRaMacEventFlags structure that indicates if there is applicative data on the received payload. * Corrected ADR MAC command behaviour * DutyCycle enforcement implementation (EU868 PHY only) **REMARK 1** *The regulatory duty cycle enforcement is enabled by default which means that for lower data rates the node may not transmit a new frame as quickly as requested. The formula used to compute the node idle time is* *Toff = TimeOnAir / DutyCycle - TxTimeOnAir* *Eaxample:* *A device just transmitted a 0.5 s long frame on one default channel. This channel is in a sub-band allowing 1% duty-cycle. Therefore this whole sub-band (868 MHz - 868.6 MHz) will be unavailable for 49.5 s.* **REMARK 2** *The duty cycle enforcement can be disabled for test purposes by calling the LoRaMacSetDutyCycleOn function with false parameter.* * Implemented aggregated duty cycle management * Added a function to create new channels * Implemented the missing features on the JoinAccept MAC command * Updated LoRaMacJoinDecrypt function to handle the CFList field. 3. Due to duty cycle management the applicative API has changed. All applications must be updated accordingly. 4. Added the possibility to chose to use either public or private networks 2015-01-30, v3.1 * General 1. Started to add support for CooCox CoIDE Integrated Development Environment. Currently only LoRaMote and SensorNode platform projects are available. 2. Updated GCC compiler linker scripts. 3. Added the support of different tool chains for the HardFault_Handler function. 4. Corrected Radio drivers I&Q signals inversion to be possible in Rx and in Tx. Added some missing radio state machine initialization. 5. Changed the RSSI values type from int8_t to int16_t. We can have RSSI values below -128 dBm. 6. Corrected SNR computation on RxDone interrupt. 7. Updated radio API to support FHSS and CAD handling. 8. Corrected in SetRxConfig function the FSK modem preamble register name. 9. Added an invalid bandwidth to the Bandwidths table in order to avoid an error when selecting 250 kHz bandwidth when using FSK modem. 10. Corrected RTC alarm setup which could be set to an invalid date. 11. Added another timer in order increment the tick counter without blocking the normal timer count. 12. Added the possibility to switch between low power timers and normal timers on the fly. 13. I2C driver corrected the 2 bytes internal address management. Corrected buffer read function when more that 1 byte was to be read. Added a function to wait for the I2C bus to become IDLE. 14. Added an I2C EEPROM driver. 15. Corrected and improved USB Virtual COM Port management files. Corrected the USB CDC and USB UART drivers. 16. Added the possibility to analyze a hard fault interrupt. * LoRaMac 1. Corrected RxWindow2 Datarate management. 2. SrvAckRequested variable was never reset. 3. Corrected tstIndoor applications for LoRaMac R3.0 support. 4. LoRaMac added the possibility to configure almost all the MAC parameters. 5. Corrected the LoRaMacSetNextChannel function. 6. Corrected the port 0 MAC command decoding. 7. Changed all structures declarations to be packed. 8. Corrected the Acknowledgement retries management when only 1 trial is needed. Before the device was issuing at least 2 trials. 9. Corrected server mac new channel req answer. 10. Added the functions to read the Up and Down Link sequence counters. 11. Corrected SRV_MAC_RX2_SETUP_REQ frequency handling. Added a 100 multiplication. 12. Corrected SRV_MAC_NEW_CHANNEL_REQ. Removed the DutyCycle parameter decoding. 13. Automatically activate the channel once it is created. 14. Corrected NbRepTimeoutTimer initial value. RxWindow2Delay already contains RxWindow1Delay in it. 2014-07-18, v3.0 * General 1. Added to Radio API the possibility to select the modem. 2. Corrected RSSI reading formulas as well as changed the RSSI and SNR values from double to int8_t type. 3. Changed radio callbacks events to timeout when it is a timeout event and error when it is a CRC error. 4. Radio API updated. 5. Updated ping-pong applications. 6. Updated tx-cw applications. 7. Updated LoRaMac applications in order to handle LoRaMac returned functions calls status. 8. Updated LoRaMac applications to toggle LED2 each time there is an application payload down link. 9. Updated tstIndoor application to handle correctly more than 6 channels. 10. Changed the MPL3115 altitude variable from unsigned to signed value. 11. Replaced the usage of pow(2, n) by defining POW2 functions. Saves ~2 KBytes of code. 12. Corrected an issue potentially arriving when LOW_POWER_MODE_ENABLE wasn't defined. A timer interrupt could be generated while the TimerList could already be emptied. * LoRaMac 1. Implemented LoRaMac specification R3.0 changes. 2. MAC commands implemented * LinkCheckReq **YES** * LinkCheckAns **YES** * LinkADRReq **YES** * LinkADRAns **YES** * DutyCycleReq **YES** * DutyCycleAns **YES** * Rx2SetupReq **YES** * Rx2SetupAns **YES** * DevStatusReq **YES** * DevStatusAns **YES** * JoinReq **YES** * JoinAccept **YES** * NewChannelReq **YES** * NewChannelAns **YES** 3. Features implemented * Possibility to shut-down the device **YES** Possible by issuing DutyCycleReq MAC command. * Duty cycle management enforcement **NO** * Acknowledgements retries **YES** * Unconfirmed messages retries **YES** 2014-07-10, v2.3.RC2 * General 1. Corrected all radios antenna switch low power mode handling. 2. SX1276: Corrected antenna switch control. 2014-06-06, v2.3.RC1 * General 1. Added the support for SX1276 radio. 2. Radio continuous reception mode correction. 3. Radio driver RxDone callback function API has changed ( size parameter is no more a pointer). Previous function prototype: void ( *RxDone )( uint8_t *payload, uint16_t *size, double rssi, double snr, uint8_t rawSnr ); New function prototype: void ( *RxDone )( uint8_t *payload, uint16_t size, double rssi, double snr, uint8_t rawSnr ); 4. Added Bleeper-76 and SensorNode platforms support. 5. Added to the radio drivers a function that generates a random value from RSSI readings. 6. Added a project to transmit a continuous wave and a project to measure the the radio sensitivity. 7. Added a bootloader project for the LoRaMote and SensorNode platforms. 8. The LoRaMac application for Bleeper platforms now sends the Selector and LED status plus the sensors values. * The application payload for the Bleeper platforms is as follows: LoRaMac port 1: { 0xX0/0xX1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } ---------- ---------- ---------- ---------- ---- | | | | | SELECTOR/LED PRESSURE TEMPERATURE ALTITUDE BATTERY MSB nibble = SELECTOR (barometric) LSB bit = LED 9. Redefined rand() and srand() standard C functions. These functions are redefined in order to get the same behaviour across different compiler tool chains implementations. 10. GPS driver improvements. Made independent of the board platform. 11. Simplified the RTC management. 12. Added a function to the timer driver that checks if a timer is already in the list or not. 13. Added the UART Overrun bit exception handling to the UART driver. 14. Removed dependency of spi-board files to the "__builtin_ffs" function. This function is only available on GNU compiler tool suite. Removed --gnu compiler option from Keil projects. Added own __ffs function implementation to utilities.h file. 15. Removed obsolete class1 devices support. 16. Known bugs correction. * LoRaMac 1. MAC commands implemented * LinkCheckReq **YES** * LinkCheckAns **YES** * LinkADRReq **YES** * LinkADRAns **YES** * DutyCycleReq **YES** (LoRaMac specification R2.2.1) * DutyCycleAns **YES** (LoRaMac specification R2.2.1) * Rx2SetupReq **YES** (LoRaMac specification R2.2.1) * Rx2SetupAns **YES** (LoRaMac specification R2.2.1) * DevStatusReq **YES** * DevStatusAns **YES** * JoinReq **YES** * JoinAccept **YES** (LoRaMac specification R2.2.1) * NewChannelReq **YES** (LoRaMac specification R2.2.1) * NewChannelAns **YES** (LoRaMac specification R2.2.1) 2. Features implemented * Possibility to shut-down the device **YES** Possible by issuing DutyCycleReq MAC command. * Duty cycle management enforcement **NO** * Acknowledgements retries **WORK IN PROGRESS** Not fully debugged. Disabled by default. * Unconfirmed messages retries **WORK IN PROGRESS** (LoRaMac specification R2.2.1) 3. Implemented LoRaMac specification R2.2.1 changes. 4. Due to new specification the LoRaMacInitNwkIds LoRaMac API function had to be modified. Previous function prototype: void LoRaMacInitNwkIds( uint32_t devAddr, uint8_t *nwkSKey, uint8_t *appSKey ); New function prototype: void LoRaMacInitNwkIds( uint32_t netID, uint32_t devAddr, uint8_t *nwkSKey, uint8_t *appSKey ); 5. Changed the LoRaMac channels management. 6. LoRaMac channels definition has been moved to LoRaMac-board.h file located in each specific board directory. 2014-04-07, v2.2 * General 1. Added IMST SK-iM880A starter kit board support to the project. * The application payload for the SK-iM880A platform is as follows: ... ...

近期下载者

相关文件


收藏者