Is there a way to access the raw, unencrypted frame log that is typically visible in the LoRaWAN frame tab within the Chirpstack.API? I’m working on testing MAC commands and need access to frames with all the Phypayload information exactly as it appears in Chirpstack under LoRaWAN frames.
Up to this point, I’ve tried a couple of approaches:
Setting up a stream to Redis: This method didn’t work for my needs because the payload is encrypted, and I’d like to avoid the need for decrypting each frame.
Listening on events from PostgreSQL: This approach also didn’t meet my requirements since events don’t provide detailed information like fhdr and f_opts.
Using InternalServiceClient.StreamGatewayFrames() from the Chirpstack api. This returns the raw frame unencrypted, but is very very slow. Retrieving 3 frames with the MoveNext() operator, takes about 1.3 min. On top of that it starts with the oldest frame, where I would prefer the newest frame.
Is there a way to access this information directly through Chirpstack.API without the need to handle decryption or unnecessary parsing? Or maybe a fix to the MoveNext() time? Any advice is appreciated
Yeah this is what i feared. This solution is annoying though, since I have to get the NwkSKey to decrypt the payload. And as I see it, the only way to get this through chirpstack, is to look in the joinAccept frame and get the JoinNonce, and then calculate the NwkSKey.
This is a problem since during tests a device might already be joined. The only way to combat this is to join the relay every time I start the testing.
Unless theres a cleaner way to get the NwkSKey?
yeh, you can use the rpc or http api to collect that information if you know the device eui.
you will need to generate a api-token for the request though easiest way it by using the webui - it might need to be an admin token to access that (I haven’t tried with a regular tenant to call that).