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 7:a31236c2e75c 1 /* Copyright (c) <2016> <MultiTech Systems>, MIT License
Mike Fiore 7:a31236c2e75c 2 *
Mike Fiore 7:a31236c2e75c 3 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
Mike Fiore 7:a31236c2e75c 4 * and associated documentation files (the "Software"), to deal in the Software without restriction,
Mike Fiore 7:a31236c2e75c 5 * including without limitation the rights to use, copy, modify, merge, publish, distribute,
Mike Fiore 7:a31236c2e75c 6 * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
Mike Fiore 7:a31236c2e75c 7 * furnished to do so, subject to the following conditions:
Mike Fiore 7:a31236c2e75c 8 *
Mike Fiore 7:a31236c2e75c 9 * The above copyright notice and this permission notice shall be included in all copies or
Mike Fiore 7:a31236c2e75c 10 * substantial portions of the Software.
Mike Fiore 7:a31236c2e75c 11 *
Mike Fiore 7:a31236c2e75c 12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
Mike Fiore 7:a31236c2e75c 13 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
Mike Fiore 7:a31236c2e75c 14 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
Mike Fiore 7:a31236c2e75c 15 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
Mike Fiore 7:a31236c2e75c 16 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Mike Fiore 7:a31236c2e75c 17 */
Mike Fiore 7:a31236c2e75c 18
Mike Fiore 7:a31236c2e75c 19 #include "LayoutSurveyGps.h"
Mike Fiore 7:a31236c2e75c 20 LayoutSurveyGps::LayoutSurveyGps(DOGS102* lcd, uint8_t band)
Mike Fiore 7:a31236c2e75c 21 : Layout(lcd),
Mike Fiore 7:a31236c2e75c 22 _band(band),
Mike Fiore 7:a31236c2e75c 23 _lDR(8,0,"DR"),
Mike Fiore 7:a31236c2e75c 24 _lFSB(0,0,"FSB"),
Mike Fiore 7:a31236c2e75c 25 _lTemp(8,6,"Temp "),
Mike Fiore 7:a31236c2e75c 26 _lPower(13,0,"P"),
Mike Fiore 7:a31236c2e75c 27 _lPadding(0,6,"Pad"),
Mike Fiore 7:a31236c2e75c 28 _fDr(10,0,2),
Mike Fiore 7:a31236c2e75c 29 _fSw1(13,7,4),
Mike Fiore 7:a31236c2e75c 30 _fSw2(0,7,9),
Mike Fiore 7:a31236c2e75c 31 _fFSB(3,0,1),
Mike Fiore 7:a31236c2e75c 32 _fTemp(13,6,4),
Mike Fiore 7:a31236c2e75c 33 _fPower(14,0,2),
Mike Fiore 7:a31236c2e75c 34 _fNoLink(0,1,17),
Mike Fiore 7:a31236c2e75c 35 _fGpsLat(0,3,17),
Mike Fiore 7:a31236c2e75c 36 _fGpsLon(0,4,17),
Mike Fiore 7:a31236c2e75c 37 _fGpsTime(0,5,17),
Mike Fiore 7:a31236c2e75c 38 _fDownSnr(12,2,5),
Mike Fiore 7:a31236c2e75c 39 _fPadding(4,6,3),
Mike Fiore 7:a31236c2e75c 40 _fDownRssi(0,2,12)
Mike Fiore 7:a31236c2e75c 41 {}
Mike Fiore 7:a31236c2e75c 42
Mike Fiore 7:a31236c2e75c 43 LayoutSurveyGps::~LayoutSurveyGps() {}
Mike Fiore 7:a31236c2e75c 44
Mike Fiore 7:a31236c2e75c 45 void LayoutSurveyGps::display() {}
Mike Fiore 7:a31236c2e75c 46
Mike Fiore 7:a31236c2e75c 47 void LayoutSurveyGps::initial(){
Mike Fiore 7:a31236c2e75c 48 writeField(_fNoLink, string(" "), true);
Mike Fiore 7:a31236c2e75c 49 }
Mike Fiore 7:a31236c2e75c 50
Mike Fiore 7:a31236c2e75c 51 void LayoutSurveyGps::display(bool success, mDot::snr_stats snr, mDot::rssi_stats rssi, int power, int fsb, int padding, int dr){
Mike Fiore 7:a31236c2e75c 52 char buf[17];
Mike Fiore 7:a31236c2e75c 53 size_t size;
Mike Fiore 7:a31236c2e75c 54 clear();
Mike Fiore 7:a31236c2e75c 55 startUpdate();
Mike Fiore 7:a31236c2e75c 56 writeLabel(_lDR);
Mike Fiore 7:a31236c2e75c 57 writeLabel(_lTemp);
Mike Fiore 7:a31236c2e75c 58 writeLabel(_lPower);
Mike Fiore 7:a31236c2e75c 59 writeLabel(_lPadding);
Mike Fiore 7:a31236c2e75c 60
jenkins@jenkinsdm1 12:05435282f899 61 if (lora::ChannelPlan::IsPlanFixed(_band)) {
Mike Fiore 7:a31236c2e75c 62 writeLabel(_lFSB);
Mike Fiore 7:a31236c2e75c 63 }
Mike Fiore 7:a31236c2e75c 64 if(success) {
Mike Fiore 7:a31236c2e75c 65 size = snprintf(buf, sizeof(buf), "DWN %3d dbm", rssi.last);
Mike Fiore 7:a31236c2e75c 66 writeField(_fDownRssi, buf, size);
Mike Fiore 7:a31236c2e75c 67
Mike Fiore 7:a31236c2e75c 68 memset(buf, 0, sizeof(buf));
Mike Fiore 7:a31236c2e75c 69 size = snprintf(buf, sizeof(buf), " %2.1f", snr.last / 10.0);
Mike Fiore 7:a31236c2e75c 70 writeField(_fDownSnr, buf, size);
Mike Fiore 7:a31236c2e75c 71 } else {
Mike Fiore 7:a31236c2e75c 72 writeField(_fNoLink,string("Send Failed"),true);
Mike Fiore 7:a31236c2e75c 73 }
Mike Fiore 7:a31236c2e75c 74
Mike Fiore 7:a31236c2e75c 75 memset(buf, 0, sizeof(buf));
Mike Fiore 7:a31236c2e75c 76 size = snprintf(buf, sizeof(buf), "%d", dr);
Mike Fiore 7:a31236c2e75c 77 writeField(_fDr, buf, size, true);
Mike Fiore 7:a31236c2e75c 78
Mike Fiore 7:a31236c2e75c 79 memset(buf, 0, sizeof(buf));
Mike Fiore 7:a31236c2e75c 80 size = snprintf(buf, sizeof(buf), "%d", power);
Mike Fiore 7:a31236c2e75c 81 writeField(_fPower, buf, size, true);
Mike Fiore 7:a31236c2e75c 82
jenkins@jenkinsdm1 12:05435282f899 83 if (lora::ChannelPlan::IsPlanFixed(_band)) {
Mike Fiore 7:a31236c2e75c 84 memset(buf, 0, sizeof(buf));
Mike Fiore 7:a31236c2e75c 85 size = snprintf(buf, sizeof(buf), "%d", fsb);
Mike Fiore 7:a31236c2e75c 86 writeField(_fFSB, buf, size, true);
Mike Fiore 7:a31236c2e75c 87 }
Mike Fiore 7:a31236c2e75c 88
Mike Fiore 7:a31236c2e75c 89 memset(buf, 0, sizeof(buf));
Mike Fiore 7:a31236c2e75c 90 size = snprintf(buf, sizeof(buf), "%d", padding);
Mike Fiore 7:a31236c2e75c 91 writeField(_fPadding, buf, size, true);
Mike Fiore 7:a31236c2e75c 92 endUpdate();
Mike Fiore 7:a31236c2e75c 93 }
Mike Fiore 7:a31236c2e75c 94
Mike Fiore 7:a31236c2e75c 95 void LayoutSurveyGps::updateSw1(string Sw1, string Sw2){
Mike Fiore 7:a31236c2e75c 96 string temp;
Mike Fiore 7:a31236c2e75c 97 for(int i = Sw1.size(); i<4; i++){
Mike Fiore 7:a31236c2e75c 98 temp+=" ";
Mike Fiore 7:a31236c2e75c 99 }
Mike Fiore 7:a31236c2e75c 100 temp+=Sw1;
Mike Fiore 7:a31236c2e75c 101 writeField(_fSw1, temp, true);
Mike Fiore 7:a31236c2e75c 102 }
Mike Fiore 7:a31236c2e75c 103
Mike Fiore 7:a31236c2e75c 104 void LayoutSurveyGps::updateSw2(string Sw2){
Mike Fiore 7:a31236c2e75c 105 writeField(_fSw2, Sw2, true);
Mike Fiore 7:a31236c2e75c 106 }
Mike Fiore 7:a31236c2e75c 107
Mike Fiore 7:a31236c2e75c 108 void LayoutSurveyGps::sending(){
Mike Fiore 7:a31236c2e75c 109 clear();
Mike Fiore 7:a31236c2e75c 110 writeField(_fGpsLat,string(" Sending..."),true);
Mike Fiore 7:a31236c2e75c 111 }
Mike Fiore 7:a31236c2e75c 112
Mike Fiore 7:a31236c2e75c 113 void LayoutSurveyGps::sendResult(string str){
Mike Fiore 7:a31236c2e75c 114 clear();
Mike Fiore 7:a31236c2e75c 115 writeField(_fGpsLat,str,true);
Mike Fiore 7:a31236c2e75c 116 }
Mike Fiore 7:a31236c2e75c 117
Mike Fiore 7:a31236c2e75c 118 void LayoutSurveyGps::updateNextCh(int count_down){
Mike Fiore 7:a31236c2e75c 119 clear();
Mike Fiore 7:a31236c2e75c 120 size_t size;
Mike Fiore 7:a31236c2e75c 121 char buf[17];
Mike Fiore 7:a31236c2e75c 122 size = snprintf(buf, sizeof(buf), "Countdown:%d", count_down);
Mike Fiore 7:a31236c2e75c 123 writeField(_fGpsTime, buf, size, true);
Mike Fiore 7:a31236c2e75c 124 writeField(_fGpsLon, string("No Free Channel"), true);
Mike Fiore 7:a31236c2e75c 125 }
Mike Fiore 7:a31236c2e75c 126
Mike Fiore 7:a31236c2e75c 127 void LayoutSurveyGps::updateStats(bool GPS, GPSPARSER::longitude lon, GPSPARSER::latitude lat, struct tm time, float temp){
Mike Fiore 7:a31236c2e75c 128 char buf[17];
Mike Fiore 7:a31236c2e75c 129 size_t size;
Mike Fiore 7:a31236c2e75c 130 startUpdate();
Mike Fiore 7:a31236c2e75c 131
Mike Fiore 7:a31236c2e75c 132 if(GPS) {
Mike Fiore 7:a31236c2e75c 133 size = snprintf(buf, sizeof(buf), "%d %d %d.%03d %c",
jenkins@jenkinsdm1 12:05435282f899 134 (int) abs(lon.degrees),
jenkins@jenkinsdm1 12:05435282f899 135 (int)lon.minutes,
jenkins@jenkinsdm1 12:05435282f899 136 (int)(lon.seconds * 6) / 1000,
jenkins@jenkinsdm1 12:05435282f899 137 (int)(lon.seconds * 6) % 1000,
Mike Fiore 7:a31236c2e75c 138 (lon.degrees > 0) ? 'E' : 'W');
Mike Fiore 7:a31236c2e75c 139 writeField(_fGpsLon, buf, size, true);
Mike Fiore 7:a31236c2e75c 140
Mike Fiore 7:a31236c2e75c 141 memset(buf, 0, sizeof(buf));
Mike Fiore 7:a31236c2e75c 142 size = snprintf(buf, sizeof(buf), "%d %d %d.%03d %c",
jenkins@jenkinsdm1 12:05435282f899 143 (int)abs(lat.degrees),
jenkins@jenkinsdm1 12:05435282f899 144 (int)lat.minutes,
jenkins@jenkinsdm1 12:05435282f899 145 (int)(lat.seconds * 6) / 1000,
jenkins@jenkinsdm1 12:05435282f899 146 (int)(lat.seconds * 6) % 1000,
Mike Fiore 7:a31236c2e75c 147 (lat.degrees > 0) ? 'N' : 'S');
Mike Fiore 7:a31236c2e75c 148 writeField(_fGpsLat, buf, size, true);
Mike Fiore 7:a31236c2e75c 149
Mike Fiore 7:a31236c2e75c 150 memset(buf, 0, sizeof(buf));
Mike Fiore 7:a31236c2e75c 151 size = snprintf(buf, sizeof(buf), "%02d:%02d %02d/%02d/%04d",
Mike Fiore 7:a31236c2e75c 152 time.tm_hour,
Mike Fiore 7:a31236c2e75c 153 time.tm_min,
Mike Fiore 7:a31236c2e75c 154 time.tm_mon + 1,
Mike Fiore 7:a31236c2e75c 155 time.tm_mday,
Mike Fiore 7:a31236c2e75c 156 time.tm_year + 1900);
Mike Fiore 7:a31236c2e75c 157 writeField(_fGpsTime, buf, size, true);
Mike Fiore 7:a31236c2e75c 158
Mike Fiore 7:a31236c2e75c 159 } else {
Mike Fiore 7:a31236c2e75c 160 writeField(_fGpsLon, string("No Gps Lock"), true);
Mike Fiore 7:a31236c2e75c 161 }
Mike Fiore 7:a31236c2e75c 162 memset(buf, 0, sizeof(buf));
Mike Fiore 7:a31236c2e75c 163 size = snprintf(buf, sizeof(buf), "%.1f", temp);
Mike Fiore 7:a31236c2e75c 164 writeField(_fTemp, buf, size, true);
Mike Fiore 7:a31236c2e75c 165 endUpdate();
Mike Fiore 7:a31236c2e75c 166 }