Comments (8)
You're correct that this looks like hex - did you try a hex decoder? :-)
The lora-packet library is aimed at users who have the raw "wire-level" data, like you'd see going through a gateway. Your example is the decoded data from TTN, so all the LoRa decoding has happened already.
from lora-packet.
from lora-packet.
Hi Dom,
I'm slightly puzzled by your words "your web interface": I only wrote an npm library.
Looking at your data, the "QKGfmAGAkQAClKBkJAt8EcGHPldTfy+u8mM8cDk=" is Base64, and is probably a raw packet suitable for decoding using this library. The first byte of your data (in hex) is 0x40, which is a valid LoRa "Message Type" byte meaning "Unconfirmed Data Up".
If you haven't tried this already, I suggest copying my "demo1.js" and substituting your data (converted appropriately). If you get a MIC failure & badly decrypted data, you could retry with the endian-ness of your keys reversed - I've written a bit about endianness in the README.
thanks
Anthony
from lora-packet.
from lora-packet.
Hi Dom,
is it possible that your data is binary? In that case, you'd expect garbage from "toString"
Ant
from lora-packet.
Hi Anthony,
I tried to do
lora_packet.decrypt(packet, AppSKey, NwkSKey).toString('hex')
I do get a HEX string like this
00000000000000fe2eca8bacaa40a670
But I tried to convert this to base64 also to Ascii but none of these convertions get me anywhere.
I am not sure if it was sent as Binary.. as I just get the payload as a JSON file.
if it is a Binary data.. how coud I get it back as ASCII text ? do you have any recommendations perhaps ?
regards
Dom
from lora-packet.
Hi Dom,
that's great, so the decryption worked! (Failed decryption will look like random, not containing strings of zeros).
However, you'll need to investigate the binary format of your data yourself: I can't do this for you.
Anthony
from lora-packet.
I'm slightly puzzled by your words "your web interface": I only wrote an npm library.
As an aside, that might be my https://runkit.com/avbentem/lorawan-packet-decoder which has a frontend available at https://runkit.io/avbentem/lorawan-packet-decoder/branches/master
from lora-packet.
Related Issues (20)
- Browser support HOT 1
- How to use the library with TypeScript ESM? HOT 1
- .toString() function giving "Attempt to access memory outside buffer bounds" on Join Accept messages HOT 2
- incorrect decoding of Rejoin Request (type 1)
- bogus test for Rejoin Request fromWire
- missing toString output for ReJoinRequest
- Command Line frame decoding ... HOT 2
- Decoding 1.1 LoRaWAN payload HOT 2
- unable to decode payload: FRMPayload is empty HOT 1
- Online decoder using wrong Session Key HOT 3
- Where to find Nwskey and Appskey HOT 1
- Lora Join accept giving error in Crypt JS
- Typescript and support for modern Node.js API HOT 4
- Could you explain this error, please. HOT 6
- New parsed field HOT 2
- After FCNT crosses 65535, MIC Matched, but decryption of data is wrong HOT 3
- LoRa packets from YoLink sensors
- Buffer Deprecation Warning HOT 1
- npm issue HOT 1
- command not found HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lora-packet.