Skip to content

Commit

Permalink
Merge pull request cyberman54#815 from dasdigidings/master
Browse files Browse the repository at this point in the history
lorawan-device repo initial files
  • Loading branch information
cyberman54 authored Jul 1, 2021
2 parents 8a81f34 + a43c2eb commit 46f3827
Show file tree
Hide file tree
Showing 8 changed files with 686 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/lorawan-devices-repo/index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
vendors:
- id: example
name: Example
vendorID: 0
draft: true

#SNIP - a lot of other vendors, just attach the lower lines to the index.yaml
#SNIP - could add a logo with "logo: filename"

- id: opensource
name: Open Source Community Projects
website: https://en.wikipedia.org/wiki/Open_source
21 changes: 21 additions & 0 deletions src/lorawan-devices-repo/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# lorawan-devices repo for The Things Network & The Things Stack V3

To add bigger payload decoders than 4k (via web ui) we provide the metadata to the lorawan-devices repo on github. For this we create a vendor "opensource" and specify a device "esp32-paxcounter" via this files:

> /
> - index.yaml (include the marked lines at the bottom of the original file)
>
> /vendor (existing folder in the repo)
>
> - /opensource (new folder with all the good stuff inside)
>
> /vendor/opensource
>
> - index.yaml (name of the device inside)
> - esp32-paxcounter.yaml (metadata for the software)
> - esp32-paxcounter-profile-eu868.yaml (profile for europe)
> - esp32-paxcounter-profile-us915.yaml (profile for north america)
> - esp32-paxcounter-codec.yaml (examples for the payload decoder)
> - esp32-paxcounter-packed_decodeUplink.js (payload decoder as provided before for the web ui, now for the lorawan devices repo)
With these files, we can make a pull request at the lorawan-devices repo: https://github.com/TheThingsNetwork/lorawan-devices and hope to be included in the future. Cool thing about it would be that then the users need only to choose "Open Source Community Projects" from the vendor list and "EXP32-Paxcounter" as device and most of the compex things is taking care of (like choosing the right LoRaWAN version and installing the payload decoder).
127 changes: 127 additions & 0 deletions src/lorawan-devices-repo/vendor/opensource/esp32-paxcounter-codec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# Uplink decoder decodes binary data uplink into a JSON object (optional)
# For documentation on writing encoders and decoders, see: https://thethingsstack.io/integrations/payload-formatters/javascript/
uplinkDecoder:
fileName: esp32-paxcounter-packed_decodeUplink.js
examples:
- description: Paxcount data
input:
fPort: 1
bytes: [0x00, 0x07, 0x00, 0x03]
output:
data:
bytes: [0x00, 0x07, 0x00, 0x03]
port: 1
wifi: 7
ble: 3
errors: []
warnings: []
- description: Device status query result
input:
fPort: 2
bytes: [0x01, 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x4B, 0xC0, 0x2D, 0x00, 0x03, 0x4B, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00]
output:
data:
bytes: [0x01, 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x4B, 0xC0, 0x2D, 0x00, 0x03, 0x4B, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00]
port: 2
voltage: 303
uptime: 216000
cputemp: 45
memory: 216000
reset0: 0
restarts: 0
errors: []
warnings: []
- description: Device config data
input:
fPort: 3
bytes: [0x09, 0x0F, 0x00, 0x00, 0x78, 0x32, 0x0A, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]
output:
data:
bytes: [0x09, 0x0F, 0x00, 0x00, 0x78, 0x32, 0x0A, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]
port: 3
loradr: 9
txpower: 15
rssilimit: 0
sendcycle: 120
wifichancycle: 50
blescantime: 10
rgblum: 30
flags: 0
payloadmask: 0
version: 0
errors: []
warnings: []
- description: GPS data
input:
fPort: 4
bytes: [0x6E, 0x1C, 0x07, 0x03, 0x0A, 0x63, 0x6F, 0x0B, 0x51, 0x00, 0xCD, 0x00]
output:
data:
bytes: [0x6E, 0x1C, 0x07, 0x03, 0x0A, 0x63, 0x6F, 0x0B, 0x51, 0x00, 0xCD, 0x00]
port: 4
latitude: 50.797678
longitude: 7.29985
sats: 11
hdop: 0.81
altitude: 205
errors: []
warnings: []
- description: Button data
input:
fPort: 5
bytes: [0x01]
output:
data:
bytes: [0x00]
port: 5
button: 1
errors: []
warnings: []
- description: Environmental sensor data
input:
fPort: 7
bytes: [0x08, 0x34, 0x27, 0x10, 0x1F, 0x40, 0x27, 0x10]
output:
data:
bytes: [0x08, 0x34, 0x27, 0x10, 0x1F, 0x40, 0x27, 0x10]
port: 7
temperature: 21.00
pressure: 1000.0
humidity: 80.00
air: 100.00
errors: []
warnings: []
- description: Battery voltage data
input:
fPort: 8
bytes: [0x01, 0x2F]
output:
data:
bytes: [0x01, 0x2F]
port: 8
voltage: 303
errors: []
warnings: []
- description: Time/Date
input:
fPort: 9
bytes: [0x60, 0xC8, 0x86, 0x90, 0x00]
output:
data:
bytes: [0x60, 0xC8, 0x86, 0x90, 0x00]
port: 9
time: 1623754384
timestatus: 0
errors: []
warnings: []
- description: User sensor data
input:
fPort: 10
bytes: [0x00]
output:
data:
bytes: [0x00]
port: 10
ens: 0
errors: []
warnings: []
Loading

0 comments on commit 46f3827

Please sign in to comment.