Giter Club home page Giter Club logo

Comments (8)

anthonykirby avatar anthonykirby commented on August 22, 2024

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.

codecandy2015 avatar codecandy2015 commented on August 22, 2024

from lora-packet.

anthonykirby avatar anthonykirby commented on August 22, 2024

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.

codecandy2015 avatar codecandy2015 commented on August 22, 2024

from lora-packet.

anthonykirby avatar anthonykirby commented on August 22, 2024

Hi Dom,
is it possible that your data is binary? In that case, you'd expect garbage from "toString"
Ant

from lora-packet.

codecandy2015 avatar codecandy2015 commented on August 22, 2024

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.

anthonykirby avatar anthonykirby commented on August 22, 2024

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.

avbentem avatar avbentem commented on August 22, 2024

@anthonykirby

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)

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.