I am slowly plugging along and learning more and more about ChirpStack. I am liking it more and more, but at each new phase, I seem to get myself confused again.
I now have a RAK7246 running as a gateway with the chirpstack OS running on it. It seems to work great and I am catching all sorts of uplink/downlink data flowing. Yahoo!!
Now I want to deal with that data via an app instead. I figured I would start with Python for now. Using the example on here, I am able to (it appears) grab the JWT.
Q1 - Where did the JWT come from? I never set anything up, so is that a default value that is in all the units.
Q2 - I think that I need to poll for that value everytime my app starts to setup an authenticated link, right?
Q3 - Now what? I am having issues finding good examples that show just the super simple stuff. Like, how to pull the data out of the db or something like that. If I got to something like http://192.168.1.252:8080/api#!/DeviceProfileService/List, I can see some commands, but it is more of just a shell command. I try to run that from within my Python script, but I get
{“error”:“authentication failed: get token from context error: no authorization-data in metadata”,“code”:16,“message”:“authentication failed: get token from context error: no authorization-data in metadata”,“details”:[]}0
I think you are thinking too complex You do not pull data from ChirpStack Application Server, it pushes it to one of the available integrations. For example you could setup a HTTP endpoint in your favorite language and let ChirpStack Application Server post to that endpoint. Integrations can be setup through the web-interface and global integrations can be setup in the chirpstack-application-server.toml config file. Examples:
So what do you recommend as the dirt simpliest way to go? I just want the information from the uplinked packets right now. Payload for sure, RSSI, LoRaSNR, eui would be nice. Uni-directional only. Starting out as dirt simple as I can
Some updates. I was able to add http integration and see my data getting pushed to postb.in. Yeah!!!
So then I tried to add an additional link: 127.0.0.1 and then see if I can listen to it over nc or telnet, but I don’t see anything coming out. I am attempting to do this on the pi itself, so nc for sure is a busybox stripped down verstion (maybe telnet as well).
then it is not clear what goal you are trying to achieve?
create a complete integration on the other side that will allow you to fully work with the payload.
I appreciate the help, I am probably just muddling things.
All I want to do is have a way to monitor the uplinked data to the gateway. The Gateway is also running chirpstack. I don’t really care how I do it in the end, but based on advice on the boards here, it seemed like http integration was the way to go. If you have a suggestion of a different way to handle it, I would gladly try that out
Holy Toledo!!! That seems to be what I need. I used mosquito_sub on the command line and I got the data back I wanted. I will research more because I assume there is a way to do it via Python or C.
One more question if I may.
Is there an easy way to get the RSSI and LoRaSNR? I tried using
mosquitto_sub -t “gateway/+/event/up” -v
But what I end up with is mostly gibberish. I am assuming it is due to the encoding, but obviously the application data was decoded properly, so is there a place to get that information cleanly?
By default the payloads are in protobuf format for size and speed. You could switch them to JSON in the gateway and NS configs for human readability, or write code to decode the protobufs and do what you need with them. Either way you need to decode them, really.