Giter Club home page Giter Club logo

Comments (7)

avbentem avatar avbentem commented on August 22, 2024 1

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.

makniZ avatar makniZ commented on August 22, 2024

hi
Thanks for the answer ! I did not understand why do we have to convert 03 to binary ?

thx

from lora-packet.

avbentem avatar avbentem commented on August 22, 2024

First things first: please answer my question instead:

Why do you think this should indicate an unconfirmed uplink?

from lora-packet.

makniZ avatar makniZ commented on August 22, 2024

No i did a mistake !

from lora-packet.

avbentem avatar avbentem commented on August 22, 2024

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.

makniZ avatar makniZ commented on August 22, 2024

thanks ! is there a way to decode only the mac payload ?

from lora-packet.

avbentem avatar avbentem commented on August 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.