commit
01e3f68ae4
34
README.md
34
README.md
@ -1,6 +1,8 @@
|
|||||||
# ESP32-Paxcounter
|
# ESP32-Paxcounter
|
||||||
**Wifi & Bluetooth driven, LoRaWAN enabled, battery powered mini Paxcounter built on cheap ESP32 LoRa IoT boards**
|
**Wifi & Bluetooth driven, LoRaWAN enabled, battery powered mini Paxcounter built on cheap ESP32 LoRa IoT boards**
|
||||||
|
|
||||||
|
--> see development branch of this repository for latest alpha version <--
|
||||||
|
|
||||||
<img src="img/Paxcounter-title.jpg">
|
<img src="img/Paxcounter-title.jpg">
|
||||||
|
|
||||||
# Use case
|
# Use case
|
||||||
@ -114,24 +116,28 @@ If you're using [TheThingsNetwork](https://www.thethingsnetwork.org/) you may wa
|
|||||||
|
|
||||||
Decoder:
|
Decoder:
|
||||||
|
|
||||||
function Decoder(bytes, port) {
|
```javascript
|
||||||
var decoded = {};
|
function Decoder(bytes, port) {
|
||||||
if (port === 1) {
|
var decoded = {};
|
||||||
decoded.wifi = (bytes[0] << 8) | bytes[1];
|
if (port === 1) {
|
||||||
decoded.ble = (bytes[2] << 8) | bytes[3];
|
decoded.wifi = (bytes[0] << 8) | bytes[1];
|
||||||
}
|
decoded.ble = (bytes[2] << 8) | bytes[3];
|
||||||
return decoded;
|
|
||||||
}
|
}
|
||||||
|
return decoded;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
Converter:
|
Converter:
|
||||||
|
|
||||||
function Converter(decoded, port) {
|
```javascript
|
||||||
var converted = decoded;
|
function Converter(decoded, port) {
|
||||||
if (port === 1) {
|
var converted = decoded;
|
||||||
converted.pax = converted.ble + converted.wifi;
|
if (port === 1) {
|
||||||
}
|
converted.pax = converted.ble + converted.wifi;
|
||||||
return converted;
|
}
|
||||||
}
|
return converted;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
# Remote command set
|
# Remote command set
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user