Comments (7)
Why do you think this should indicate an unconfirmed uplink?
The message type is not in the MAC Payload, but in the 1 byte Message Header, MHDR.
This library works on full LoRaWAN packets. If 0x0307
is your full LoRaWAN packet then its MHDR is 0x03
, being binary %0000 0011
. Here the first 3 bits, %000
, indeed indicate a Join Request:
4.2.1 Message type (MType bit field)
The LoRaWAN distinguishes between six different MAC message types: join request, join accept, unconfirmed data up/down, and confirmed data up/down.
MType Description 000 Join Request 001 Join Accept 010 Unconfirmed Data Up 011 Unconfirmed Data Down 100 Confirmed Data Up 101 Confirmed Data Down 110 RFU 111 Proprietary
However, note that 0x0307
is far too short to be a valid LoRaWAN packet. If you'd specify the secrets then you'd see that the validation of the MIC would fail. (Even more: the packet is too short to even include a MIC.)
from lora-packet.
hi
Thanks for the answer ! I did not understand why do we have to convert 03 to binary ?
thx
from lora-packet.
First things first: please answer my question instead:
Why do you think this should indicate an unconfirmed uplink?
from lora-packet.
No i did a mistake !
from lora-packet.
I did not understand why do we have to convert 03 to binary ?
It's not a conversion.
Hexadecimal 0x0307 is just one of the many ways to display the bits 0000 0011 0000 0111
. One could also write it as decimal 775, as octal 01407†, and many more...
As the MType in the table above only looks at 3 bits, it's easier to use %0000 0011
rather than 0x03
. That's all.
† octal 01407 itself could also be written as 0o1407, o1407, 1407o, q1407, 14078, 1407(8) and many other ways
from lora-packet.
thanks ! is there a way to decode only the mac payload ?
from lora-packet.
Please get your terminology right; a 2 byte message cannot be a MAC Payload of an uplink.
Like I wrote before:
This library works on full LoRaWAN packets.
It cannot decode your application payload, if that's what you're referring to with "MAC payload", which is really much more than just the application payload:
4.3 MAC Payload of Data Messages (MACPayload)
The MAC payload of the data messages, a so-called “data frame”, contains a frame header (FHDR) followed by an optional port field (FPort) and an optional frame payload field (FRMPayload).
If you're indeed asking about the application payload (FRMPayload) then, if you're using The Things Network, see https://www.thethingsnetwork.org/forum/t/is-there-any-documentation-on-payload-functions/3441 and the many links there.
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.