Factory firmware for the MultiTech Dotbox (MTDOT-BOX) and EVB (MTDOT-EVB) products.

Dependencies:   NCP5623B GpsParser ISL29011 libmDot-mbed5 MTS-Serial MMA845x DOGS102 MPL3115A2

MTDOT-BOX/EVB Firmware Description

This Firmware is what ships on DotBox and EVB devices. It is intended to be used as a proof of concept and site survey tool for planning LoRa deployments. The firmware provides a number of different modes of operation:

  • Configuration - Use AT commands to configure network credentials, TX power, TX data rate, view the survey data file, etc.
  • Survey Single - Test network connectivity at current location at a specific TX power and TX data rate. Uplink information, downlink information, and GPS information are saved to the survey data file and can also be sent to the gateway.
  • Survey Sweep - Test network connectivity at current location across a range of TX powers and TX data rates. Uplink information, downlink information, and GPS information for each survey in the sweep are saved to the survey data file and can also be sent to the gateway.
  • LoRa Demo - Gather data from onboard sensors and display it on the screen in real time. Send packets containing sensor data to the gateway either on an interval or when triggered by the user. GPS data is not transmitted.
  • Survey GPS - Gather sensor and GPS data and transmit it to the gateway either on an interval or when triggered by the user. Add padding to packets, switch frequency sub bands, TX power, TX data rate, and more all without exiting Survey GPS Mode.
  • View Data - View the survey data file on the screen one survey at a time.

Additional documentation and information for the MTDOT-BOX/EVB Factory Firmware can be found here.


Dot Libraries

Dot Library Limitations

The commit messages in libmDot-mbed5 and libmDot-dev-mbed5 specify the version of the Dot library the commit contains and the version of mbed-os it was compiled against. We recommend building your application with the version of mbed-os specified in the commit message of the version of the Dot library you're using. This will ensure that you don't run into any runtime issues caused by differences in the mbed-os versions.

Development library for mDot.

[Repository '/teams/MultiTech/code/libmDot-dev-mbed5/' not found]

Stable library for mDot.

Import librarylibmDot-mbed5

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.

Committer:
jenkins@jenkinsdm1
Date:
Thu Mar 14 08:23:20 2019 -0500
Revision:
16:e76cec0eec43
Parent:
12:05435282f899
dotbox-firmware revision 3.1.2

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Mike Fiore 1:71125aa00e33 1 #include "CmdFrequencyBand.h"
jenkins@jenkinsdm1 12:05435282f899 2 #include "ChannelPlans.h"
jenkins@jenkinsdm1 12:05435282f899 3 CmdFrequencyBand::CmdFrequencyBand(mDot* dot, mts::MTSSerial& serial)
jenkins@jenkinsdm1 12:05435282f899 4 : Command(dot,"Current Frequency Band", "AT+FREQ", "Select Frequency Band 'US915', 'AU915', 'EU868', 'AS923', 'AS923-JAPAN','KR920', or 'IN865'")
jenkins@jenkinsdm1 12:05435282f899 5 , _serial(serial)
Mike Fiore 1:71125aa00e33 6 {
jenkins@jenkinsdm1 12:05435282f899 7 _help = std::string(text()) + ": " + std::string(desc());
jenkins@jenkinsdm1 12:05435282f899 8 _usage = "";
jenkins@jenkinsdm1 12:05435282f899 9 _queryable = true;
Mike Fiore 1:71125aa00e33 10 }
Mike Fiore 1:71125aa00e33 11
Mike Fiore 1:71125aa00e33 12 uint32_t CmdFrequencyBand::action(std::vector<std::string> args)
jenkins@jenkinsdm1 12:05435282f899 13 {
Mike Fiore 1:71125aa00e33 14 if (args.size() == 1)
Mike Fiore 1:71125aa00e33 15 {
jenkins@jenkinsdm1 12:05435282f899 16 // using getChannelPlanName here instead of mDot::FrequencyBandStr allows AT firmware to properly display custom channel plan names
jenkins@jenkinsdm1 12:05435282f899 17 if(_dot->getVerbose())
Mike Fiore 1:71125aa00e33 18 _serial.writef("Frequency Band: ");
Mike Fiore 1:71125aa00e33 19
jenkins@jenkinsdm1 12:05435282f899 20 _serial.writef("%s\r\n", _dot->getChannelPlanName().c_str());
Mike Fiore 1:71125aa00e33 21 }
jenkins@jenkinsdm1 12:05435282f899 22
jenkins@jenkinsdm1 12:05435282f899 23 else if (args.size() == 2)
Mike Fiore 1:71125aa00e33 24 {
jenkins@jenkinsdm1 12:05435282f899 25 std::string band_str = mts::Text::toUpper(args[1]);
jenkins@jenkinsdm1 12:05435282f899 26 lora::ChannelPlan* plan = _dot->getChannelPlan();
jenkins@jenkinsdm1 12:05435282f899 27 mDot::mdot_file file = _dot->openUserFile("ChannelPlan", mDot::FM_RDWR);
jenkins@jenkinsdm1 12:05435282f899 28 _dot->seekUserFile(file, 0, SEEK_SET);
jenkins@jenkinsdm1 12:05435282f899 29 uint8_t cp[] = {0};
Mike Fiore 7:a31236c2e75c 30
jenkins@jenkinsdm1 12:05435282f899 31 if (mDot::FrequencyBandStr(lora::ChannelPlan::US915) == band_str) {
jenkins@jenkinsdm1 12:05435282f899 32 if(plan != NULL) delete plan;
jenkins@jenkinsdm1 12:05435282f899 33 plan = new lora::ChannelPlan_US915();
jenkins@jenkinsdm1 12:05435282f899 34 cp[0] = CP_US915;
jenkins@jenkinsdm1 12:05435282f899 35 }
jenkins@jenkinsdm1 12:05435282f899 36 else if (mDot::FrequencyBandStr(lora::ChannelPlan::AU915) == band_str) {
jenkins@jenkinsdm1 12:05435282f899 37 if(plan != NULL) delete plan;
jenkins@jenkinsdm1 12:05435282f899 38 plan = new lora::ChannelPlan_AU915();
jenkins@jenkinsdm1 12:05435282f899 39 cp[0] = CP_AU915;
jenkins@jenkinsdm1 12:05435282f899 40 }
jenkins@jenkinsdm1 12:05435282f899 41 else if (mDot::FrequencyBandStr(lora::ChannelPlan::EU868) == band_str) {
jenkins@jenkinsdm1 12:05435282f899 42 if(plan != NULL) delete plan;
jenkins@jenkinsdm1 12:05435282f899 43 plan = new lora::ChannelPlan_EU868();
jenkins@jenkinsdm1 12:05435282f899 44 cp[0] = CP_EU868;
jenkins@jenkinsdm1 12:05435282f899 45 }
jenkins@jenkinsdm1 12:05435282f899 46 else if (mDot::FrequencyBandStr(lora::ChannelPlan::AS923) == band_str) {
jenkins@jenkinsdm1 12:05435282f899 47 if(plan != NULL) delete plan;
jenkins@jenkinsdm1 12:05435282f899 48 plan = new lora::ChannelPlan_AS923();
jenkins@jenkinsdm1 12:05435282f899 49 cp[0] = CP_AS923;
jenkins@jenkinsdm1 12:05435282f899 50 }
jenkins@jenkinsdm1 12:05435282f899 51 else if (mDot::FrequencyBandStr(lora::ChannelPlan::KR920) == band_str) {
jenkins@jenkinsdm1 12:05435282f899 52 if(plan != NULL) delete plan;
jenkins@jenkinsdm1 12:05435282f899 53 plan = new lora::ChannelPlan_KR920();
jenkins@jenkinsdm1 12:05435282f899 54 cp[0] = CP_KR920;
jenkins@jenkinsdm1 12:05435282f899 55 }
jenkins@jenkinsdm1 12:05435282f899 56 else if (mDot::FrequencyBandStr(lora::ChannelPlan::IN865) == band_str) {
jenkins@jenkinsdm1 12:05435282f899 57 if(plan != NULL) delete plan;
jenkins@jenkinsdm1 12:05435282f899 58 plan = new lora::ChannelPlan_IN865();
jenkins@jenkinsdm1 12:05435282f899 59 cp[0] = CP_IN865;
jenkins@jenkinsdm1 12:05435282f899 60 }
jenkins@jenkinsdm1 12:05435282f899 61 else if (mDot::FrequencyBandStr(lora::ChannelPlan::AS923_JAPAN) == band_str) {
jenkins@jenkinsdm1 12:05435282f899 62 if(plan != NULL) delete plan;
jenkins@jenkinsdm1 12:05435282f899 63 plan = new lora::ChannelPlan_AS923_Japan();
jenkins@jenkinsdm1 12:05435282f899 64 cp[0] = CP_AS923_JAPAN;
Mike Fiore 7:a31236c2e75c 65 }
Mike Fiore 7:a31236c2e75c 66
jenkins@jenkinsdm1 12:05435282f899 67 if(cp[0] > 0) {
jenkins@jenkinsdm1 12:05435282f899 68 _dot->writeUserFile(file, cp, 1);
Mike Fiore 7:a31236c2e75c 69 }
jenkins@jenkinsdm1 12:05435282f899 70 _dot->closeUserFile(file);
Mike Fiore 7:a31236c2e75c 71
jenkins@jenkinsdm1 12:05435282f899 72 _serial.writef("Setting Plan \r\n");
Mike Fiore 1:71125aa00e33 73
jenkins@jenkinsdm1 12:05435282f899 74 if (_dot->setChannelPlan(plan) != mDot::MDOT_OK) {
jenkins@jenkinsdm1 12:05435282f899 75 setErrorMessage(_dot->getLastError());
Mike Fiore 1:71125aa00e33 76 return 1;
Mike Fiore 1:71125aa00e33 77 }
Mike Fiore 1:71125aa00e33 78 }
Mike Fiore 1:71125aa00e33 79 return 0;
Mike Fiore 1:71125aa00e33 80 }
Mike Fiore 1:71125aa00e33 81
Mike Fiore 1:71125aa00e33 82 bool CmdFrequencyBand::verify(std::vector<std::string> args)
jenkins@jenkinsdm1 12:05435282f899 83 {
Mike Fiore 1:71125aa00e33 84 if (args.size() == 1)
Mike Fiore 1:71125aa00e33 85 return true;
Mike Fiore 1:71125aa00e33 86
Mike Fiore 1:71125aa00e33 87 if (args.size() == 2)
Mike Fiore 1:71125aa00e33 88 {
Mike Fiore 7:a31236c2e75c 89 std::string band = mts::Text::toUpper(args[1]);
Mike Fiore 7:a31236c2e75c 90
jenkins@jenkinsdm1 12:05435282f899 91 if (mDot::FrequencyBandStr(lora::ChannelPlan::US915) != band &&
jenkins@jenkinsdm1 12:05435282f899 92 mDot::FrequencyBandStr(lora::ChannelPlan::AU915) != band &&
jenkins@jenkinsdm1 12:05435282f899 93 mDot::FrequencyBandStr(lora::ChannelPlan::EU868) != band &&
jenkins@jenkinsdm1 12:05435282f899 94 mDot::FrequencyBandStr(lora::ChannelPlan::AS923) != band &&
jenkins@jenkinsdm1 12:05435282f899 95 mDot::FrequencyBandStr(lora::ChannelPlan::KR920) != band &&
jenkins@jenkinsdm1 12:05435282f899 96 mDot::FrequencyBandStr(lora::ChannelPlan::IN865) != band &&
jenkins@jenkinsdm1 12:05435282f899 97 mDot::FrequencyBandStr(lora::ChannelPlan::AS923_JAPAN) != band)
Mike Fiore 1:71125aa00e33 98 {
jenkins@jenkinsdm1 12:05435282f899 99 setErrorMessage("Invalid parameter, expects (US915,AU915,EU868,AS923,AS923-JAPAN,KR920,IN865)");
Mike Fiore 1:71125aa00e33 100 return false;
Mike Fiore 1:71125aa00e33 101 }
jenkins@jenkinsdm1 12:05435282f899 102 return true;
Mike Fiore 1:71125aa00e33 103 }
Mike Fiore 1:71125aa00e33 104 }