diff --git a/Heltec-CubeCell-Board/longfi-us915/README.md b/Heltec-CubeCell-Board/longfi-us915/README.md index 2a98ffc..494d003 100644 --- a/Heltec-CubeCell-Board/longfi-us915/README.md +++ b/Heltec-CubeCell-Board/longfi-us915/README.md @@ -35,4 +35,7 @@ uint8_t AppKey[] = { FILL_ME_IN }; 6. Select Tools -> Serial Monitor Serial Monitor Window 1. Select 115200 baud from bottom right dropdown. -2. Wait for device to successfully join, may take 1-3 min, and show several failures. Do not be alarmed by the failures, it is expected. \ No newline at end of file +2. Wait for device to successfully join, may take 1-3 min, and show several failures. Do not be alarmed by the failures, it is expected. + +## Sample Decoder +* In the console-decoders directory you will find a simple sample decoder that goes along with this sample code. It is intended to be used as a Helium Console "Function". This will allow one to view the decoded payload within the Helium Console device debug view. diff --git a/RAKWireless-WisBlock/longfi-us915/README.md b/RAKWireless-WisBlock/longfi-us915/README.md index c408d46..2048e43 100644 --- a/RAKWireless-WisBlock/longfi-us915/README.md +++ b/RAKWireless-WisBlock/longfi-us915/README.md @@ -14,3 +14,5 @@ The WisBlock starter kit comes with two antenna types, * the one that resembles an "I" is the LoRa antenna, this one connects to the connector on the core moduke marked LoRa, which is below the large K in the RAK logo. * the one that resembles a "T" is the BLE antenna, this one connects to the connector on the core module marked BLE +### Sample Decoder +* In the console-decoders directory you will find a simple sample decoder that goes along with this sample code. It is intended to be used as a Helium Console "Function". This will allow one to view the decoded payload within the Helium Console device debug view. diff --git a/RAKWireless-WisBlock/longfi-us915/console-decoders/sample_decoder.js b/RAKWireless-WisBlock/longfi-us915/console-decoders/sample_decoder.js new file mode 100644 index 0000000..e022841 --- /dev/null +++ b/RAKWireless-WisBlock/longfi-us915/console-decoders/sample_decoder.js @@ -0,0 +1,14 @@ +// Helium console decoder +// This is a very simple decoder for testing only. modify to suit your +// payload needs + +function Decoder(bytes, port) { + var custom_msg={}; + try{ + var result = String.fromCharCode.apply(null, bytes); + custom_msg.received_payload = result; + return custom_msg; + } catch (err) { + return 'Decoder: ' + err.name + " : " + err.message;; + } +} diff --git a/ST-B-L072Z-LRWAN1/longfi-us915/README.md b/ST-B-L072Z-LRWAN1/longfi-us915/README.md index e39c601..e07c68a 100644 --- a/ST-B-L072Z-LRWAN1/longfi-us915/README.md +++ b/ST-B-L072Z-LRWAN1/longfi-us915/README.md @@ -31,3 +31,7 @@ Arduino IDE: 2. Select Port: Tools > Port > COM# or /dev/ttyACM#(B-L072Z-LRWAN1) 3. Upload Sketch: Select > Upload 4. (Optional) View Serial Debug Output: Tools > Serial Monitor > 9600 baud + + +### Sample Decoder +* In the console-decoders directory you will find a simple sample decoder that goes along with this sample code. It is intended to be used as a Helium Console "Function". This will allow one to view the decoded payload within the Helium Console device debug view. diff --git a/ttgo-tbeam-ttn-tracker/LICENSE b/TTGO-TBeam-Tracker/LICENSE similarity index 100% rename from ttgo-tbeam-ttn-tracker/LICENSE rename to TTGO-TBeam-Tracker/LICENSE diff --git a/ttgo-tbeam-ttn-tracker/README.md b/TTGO-TBeam-Tracker/README.md similarity index 98% rename from ttgo-tbeam-ttn-tracker/README.md rename to TTGO-TBeam-Tracker/README.md index 9cdb598..ab42775 100644 --- a/ttgo-tbeam-ttn-tracker/README.md +++ b/TTGO-TBeam-Tracker/README.md @@ -44,7 +44,7 @@ In summary, within the Arduino IDE open Boards Manager from Tools > Board menu a - step by step details for setting up a Mapper integration can be found [here](https://docs.helium.com/use-the-network/coverage-mapping/mappers-quickstart/#mappers-quickstart). - detail for setting up a Cargo integration can be found [here](https://docs.helium.com/use-the-network/console/integrations/cargo). -The specific details for adding a Mapper or Cargo integration use a different edge node device than the one detailed here. When prompted to add a function decoder, be sure to use the following decoder. +The specific details for adding a Mapper or Cargo integration use a different edge node device than the one detailed here. When prompted to add a function decoder, be sure to use the following decoder. Note: This decoder can also be found within this project in the console-decoders directory. ```C function Decoder(bytes, port) { diff --git a/TTGO-TBeam-Tracker/console-decoders/mapper_decoder.js b/TTGO-TBeam-Tracker/console-decoders/mapper_decoder.js new file mode 100644 index 0000000..247e3db --- /dev/null +++ b/TTGO-TBeam-Tracker/console-decoders/mapper_decoder.js @@ -0,0 +1,21 @@ +// Decoder for TTGO_TBeam mapping +function Decoder(bytes, port) { + var decoded = {}; + + decoded.latitude = ((bytes[0]<<16)>>>0) + ((bytes[1]<<8)>>>0) + bytes[2]; + decoded.latitude = (decoded.latitude / 16777215.0 * 180) - 90; + + decoded.longitude = ((bytes[3]<<16)>>>0) + ((bytes[4]<<8)>>>0) + bytes[5]; + decoded.longitude = (decoded.longitude / 16777215.0 * 360) - 180; + + var altValue = ((bytes[6]<<8)>>>0) + bytes[7]; + var sign = bytes[6] & (1 << 7); + if(sign) decoded.altitude = 0xFFFF0000 | altValue; + else decoded.altitude = altValue; + + decoded.hdop = bytes[8] / 10.0; + decoded.sats = bytes[9]; + + return decoded; +} + diff --git a/ttgo-tbeam-ttn-tracker/img/T-BEAM-Rev1-01.jpg b/TTGO-TBeam-Tracker/img/T-BEAM-Rev1-01.jpg similarity index 100% rename from ttgo-tbeam-ttn-tracker/img/T-BEAM-Rev1-01.jpg rename to TTGO-TBeam-Tracker/img/T-BEAM-Rev1-01.jpg diff --git a/ttgo-tbeam-ttn-tracker/img/T-BEAM-Rev1-02.jpg b/TTGO-TBeam-Tracker/img/T-BEAM-Rev1-02.jpg similarity index 100% rename from ttgo-tbeam-ttn-tracker/img/T-BEAM-Rev1-02.jpg rename to TTGO-TBeam-Tracker/img/T-BEAM-Rev1-02.jpg diff --git a/ttgo-tbeam-ttn-tracker/img/TTGO-TBeam-01.jpg b/TTGO-TBeam-Tracker/img/TTGO-TBeam-01.jpg similarity index 100% rename from ttgo-tbeam-ttn-tracker/img/TTGO-TBeam-01.jpg rename to TTGO-TBeam-Tracker/img/TTGO-TBeam-01.jpg diff --git a/ttgo-tbeam-ttn-tracker/img/TTGO-TBeam-02.jpg b/TTGO-TBeam-Tracker/img/TTGO-TBeam-02.jpg similarity index 100% rename from ttgo-tbeam-ttn-tracker/img/TTGO-TBeam-02.jpg rename to TTGO-TBeam-Tracker/img/TTGO-TBeam-02.jpg diff --git a/ttgo-tbeam-ttn-tracker/img/TTGO-TBeam-03.jpg b/TTGO-TBeam-Tracker/img/TTGO-TBeam-03.jpg similarity index 100% rename from ttgo-tbeam-ttn-tracker/img/TTGO-TBeam-03.jpg rename to TTGO-TBeam-Tracker/img/TTGO-TBeam-03.jpg diff --git a/ttgo-tbeam-ttn-tracker/main/configuration.h b/TTGO-TBeam-Tracker/main/configuration.h similarity index 100% rename from ttgo-tbeam-ttn-tracker/main/configuration.h rename to TTGO-TBeam-Tracker/main/configuration.h diff --git a/ttgo-tbeam-ttn-tracker/main/credentials.h b/TTGO-TBeam-Tracker/main/credentials.h similarity index 100% rename from ttgo-tbeam-ttn-tracker/main/credentials.h rename to TTGO-TBeam-Tracker/main/credentials.h diff --git a/ttgo-tbeam-ttn-tracker/main/fonts.h b/TTGO-TBeam-Tracker/main/fonts.h similarity index 100% rename from ttgo-tbeam-ttn-tracker/main/fonts.h rename to TTGO-TBeam-Tracker/main/fonts.h diff --git a/ttgo-tbeam-ttn-tracker/main/gps.ino b/TTGO-TBeam-Tracker/main/gps.ino similarity index 100% rename from ttgo-tbeam-ttn-tracker/main/gps.ino rename to TTGO-TBeam-Tracker/main/gps.ino diff --git a/ttgo-tbeam-ttn-tracker/main/images.h b/TTGO-TBeam-Tracker/main/images.h similarity index 100% rename from ttgo-tbeam-ttn-tracker/main/images.h rename to TTGO-TBeam-Tracker/main/images.h diff --git a/ttgo-tbeam-ttn-tracker/main/main.ino b/TTGO-TBeam-Tracker/main/main.ino similarity index 100% rename from ttgo-tbeam-ttn-tracker/main/main.ino rename to TTGO-TBeam-Tracker/main/main.ino diff --git a/ttgo-tbeam-ttn-tracker/main/screen.ino b/TTGO-TBeam-Tracker/main/screen.ino similarity index 100% rename from ttgo-tbeam-ttn-tracker/main/screen.ino rename to TTGO-TBeam-Tracker/main/screen.ino diff --git a/ttgo-tbeam-ttn-tracker/main/sleep.ino b/TTGO-TBeam-Tracker/main/sleep.ino similarity index 100% rename from ttgo-tbeam-ttn-tracker/main/sleep.ino rename to TTGO-TBeam-Tracker/main/sleep.ino diff --git a/ttgo-tbeam-ttn-tracker/main/ttn.ino b/TTGO-TBeam-Tracker/main/ttn.ino similarity index 100% rename from ttgo-tbeam-ttn-tracker/main/ttn.ino rename to TTGO-TBeam-Tracker/main/ttn.ino diff --git a/ttgo-tbeam-ttn-tracker/platformio.ini b/TTGO-TBeam-Tracker/platformio.ini similarity index 100% rename from ttgo-tbeam-ttn-tracker/platformio.ini rename to TTGO-TBeam-Tracker/platformio.ini