Stable version of the mDot library for mbed 5. This version of the library is suitable for deployment scenarios. See lastest commit message for version of mbed-os library that has been tested against.

Dependents:   mdot_two_way unh-hackathon-example unh-hackathon-example-raw TelitSensorToCloud ... more

Fork of libmDot-dev-mbed5-deprecated by MultiTech

The Dot library provides a LoRaWan certified stack for LoRa communication using MultiTech mDot and xDot devices. The stack is compatible with mbed 5.

The name of the repository can be used to determine which device the stack was compiled for and if it's a development or production-ready build:

A changelog for the Dot library can be found here.

The Dot library version and the version of mbed-os it was compiled against can both be found in the commit message for that revision of the Dot library. Building your application with the same version of mbed-os as what was used to build the Dot library is highly recommended!

The Dot-Examples repository demonstrates how to use the Dot library in a custom application.

The mDot and xDot platform pages have lots of platform specific information and document potential issues, gotchas, etc, and provide instructions for getting started with development. Please take a look at the platform page before starting development as they should answer many questions you will have.

FOTA

Full FOTA support is only available with mDot, xDot does not have the required external flash. xDot can use the FOTA example to dynamically join a multicast session only. After joining the multicast session the received Fragmentation packets could be handed to a host MCU for processing and at completion the firmware can be loaded into the xDot using the bootloader and y-modem. See xDot Developer Guide.

  • Add the following code to allow Fota to use the Dot instance

main.cpp

    // Initialize FOTA singleton
    Fota::getInstance(dot);
  • Add fragmentation handling the the PacketRx event

RadioEvent.h

    virtual void PacketRx(uint8_t port, uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr, lora::DownlinkControl ctrl, uint8_t slot, uint8_t retries, uint32_t address, bool dupRx) {
        mDotEvent::PacketRx(port, payload, size, rssi, snr, ctrl, slot, retries, address, dupRx);

#if ACTIVE_EXAMPLE == FOTA_EXAMPLE
        if(port == 200 || port == 201 || port == 202) {
            Fota::getInstance()->processCmd(payload, port, size);
        }
#endif
    }

A definition is needed to enable Fragmentation support on mDot and save fragments to flash. This should not be defined for xDot and will result in a compiler error.

mbed_app.json

{
    "macros": [
        "FOTA=1"
    ]
}

The FOTA implementation has a few differences from the LoRaWAN Protocol

  • Fragmentation Indexing starts at 0
  • McKEKey is 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
  • Start Time is a count-down in seconds to start of session
Committer:
jreiss
Date:
Wed Mar 25 17:06:41 2020 +0000
Revision:
74:8b02b1a9a1b6
Parent:
72:b1e07ec1c30d
Remove old ARMCC archive, only ARMC6 is available.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 1 /*
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 2 / _____) _ | |
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 3 ( (____ _____ ____ _| |_ _____ ____| |__
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 4 \____ \| ___ | (_ _) ___ |/ ___) _ \
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 5 _____) ) ____| | | || |_| ____( (___| | | |
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 6 (______/|_____)_|_|_| \__)_____)\____)_| |_|
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 7 (C)2013 Semtech
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 8
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 9 Description: Generic radio driver definition
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 10
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 11 License: Revised BSD License, see LICENSE.TXT file include in the project
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 12
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 13 Maintainer: Miguel Luis and Gregory Cristian
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 14 */
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 15 #ifndef __SXRADIOEVENTS_H__
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 16 #define __SXRADIOEVENTS_H__
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 17
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 18 /*!
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 19 * \brief Radio driver callback functions
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 20 */
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 21 class SxRadioEvents
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 22 {
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 23 public:
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 24 /*!
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 25 * \brief Tx Start callback prototype.
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 26 */
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 27 virtual void TxStart( void ) {}
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 28 /*!
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 29 * \brief Tx Done callback prototype.
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 30 */
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 31 virtual void TxDone( void ) {}
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 32 /*!
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 33 * \brief Tx Timeout callback prototype.
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 34 */
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 35 virtual void TxTimeout( void ) {}
Jenkins@KEILDM1.dc.multitech.prv 72:b1e07ec1c30d 36
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 37 /*!
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 38 * \brief Rx Done callback prototype.
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 39 *
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 40 * \param [IN] payload Received buffer pointer
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 41 * \param [IN] size Received buffer size
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 42 * \param [IN] rssi RSSI value computed while receiving the frame [dBm]
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 43 * \param [IN] snr Raw SNR value given by the radio hardware
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 44 * FSK : N/A ( set to 0 )
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 45 * LoRa: SNR value is two's complement in 1/4 dB
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 46 */
Jenkins@KEILDM1.dc.multitech.prv 70:0c5b5b02d17b 47 virtual void RxDone( uint8_t *payload, uint16_t size, int16_t rssi, int16_t snr ) {}
Jenkins@KEILDM1.dc.multitech.prv 72:b1e07ec1c30d 48
Jenkins@KEILDM1.dc.multitech.prv 72:b1e07ec1c30d 49 /*!
Jenkins@KEILDM1.dc.multitech.prv 72:b1e07ec1c30d 50 * \brief Called if Beacon Window cannot be opened or is missed
Jenkins@KEILDM1.dc.multitech.prv 72:b1e07ec1c30d 51 *
Jenkins@KEILDM1.dc.multitech.prv 72:b1e07ec1c30d 52 * \param [IN] beaconTime Updated time of beacon for the period
Jenkins@KEILDM1.dc.multitech.prv 72:b1e07ec1c30d 53 * \param [IN] no_rx True if called from rx done
Jenkins@KEILDM1.dc.multitech.prv 72:b1e07ec1c30d 54 */
Jenkins@KEILDM1.dc.multitech.prv 72:b1e07ec1c30d 55 virtual void OnBeaconless( uint32_t beaconTime, bool no_rx = false ) {}
Jenkins@KEILDM1.dc.multitech.prv 72:b1e07ec1c30d 56
Jenkins@KEILDM1.dc.multitech.prv 72:b1e07ec1c30d 57
Jenkins@KEILDM1.dc.multitech.prv 72:b1e07ec1c30d 58
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 59 /*!
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 60 * \brief Rx Timeout callback prototype.
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 61 */
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 62 virtual void RxTimeout( void ) {}
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 63 /*!
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 64 * \brief Rx Error callback prototype.
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 65 */
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 66 virtual void RxError( void ) {}
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 67 /*!
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 68 * \brief FHSS Change Channel callback prototype.
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 69 *
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 70 * \param [IN] currentChannel Index number of the current channel
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 71 */
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 72 virtual void FhssChangeChannel( uint8_t currentChannel ) {}
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 73 /*!
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 74 * \brief CAD Done callback prototype.
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 75 *
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 76 * \param [IN] channelActivityDetected Channel Activity detected during the CAD
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 77 */
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 78 virtual void CadDone( bool channelActivityDetected ) {}
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 79 /*!
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 80 * \brief Mac Event callback prototype.
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 81 */
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 82 virtual void MacEvent( void ) {}
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 83
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 84 virtual void LinkIdle(void) {}
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 85 };
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 86
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 87 #endif // __SXRADIOEVENTS_H__
Jenkins@KEILDM1.dc.multitech.prv 61:58ed1e136af5 88