rename ttgo-tb.. to TTGO-TB, add decoder to RAK WisBlock sample, update READMEs to make note of decoders

pull/31/head
Leroy 2021-04-22 11:41:03 -05:00
rodzic 7dd8a95c82
commit 81341315af
22 zmienionych plików z 46 dodań i 2 usunięć

Wyświetl plik

@ -35,4 +35,7 @@ uint8_t AppKey[] = { FILL_ME_IN };
6. Select Tools -> Serial Monitor 6. Select Tools -> Serial Monitor
Serial Monitor Window Serial Monitor Window
1. Select 115200 baud from bottom right dropdown. 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. 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.

Wyświetl plik

@ -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 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 * 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.

Wyświetl plik

@ -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;;
}
}

Wyświetl plik

@ -31,3 +31,7 @@ Arduino IDE:
2. Select Port: Tools > Port > COM# or /dev/ttyACM#(B-L072Z-LRWAN1) 2. Select Port: Tools > Port > COM# or /dev/ttyACM#(B-L072Z-LRWAN1)
3. Upload Sketch: Select > Upload 3. Upload Sketch: Select > Upload
4. (Optional) View Serial Debug Output: Tools > Serial Monitor > 9600 baud 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.

Wyświetl plik

@ -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). - 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). - 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 ```C
function Decoder(bytes, port) { function Decoder(bytes, port) {

Wyświetl plik

@ -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;
}

Wyświetl plik

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 190 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 190 KiB

Wyświetl plik

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 460 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 460 KiB

Wyświetl plik

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 1.5 MiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 1.5 MiB

Wyświetl plik

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 129 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 129 KiB

Wyświetl plik

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 320 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 320 KiB