brocaar/chirpstack-api

Gateway frames stream

Closed this issue · 4 comments

  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

What happened?

When trying to stream frames from /api/gateways/{gateway_id}/frames we don't get any data.

What did you expect?

Getting join request via the stream. I'm faily confident things are setup correctly as I get an error if I use the wrong api key.

Steps to reproduce this issue

Steps:

  1. Add device to chirpstack
  2. Start streaming from /api/gateways/{gateway_id}/frames
  3. Send join request from device
  4. Wait from data on the stream.
Component Version
ChirpStack API v1.0.0

Hi @KrestenHelstrup

Stream API not work from any browser see attached screenshot for your reference
You need to create a web-socket connection for stream APIs.

image

Hi @sagar-patel-sls

Thanks for the fast reply.

I already saw that note in the docs. I'm interfacing the API from C# with a RestClient. It works fine for all other things and I hoped it would work for the streams also - but maybe not ?

@KrestenHelstrup the same applies when using a REST client. My advice would be to use the gRPC interface. The REST interface works as a proxy to the gRPC interface, thus when making a REST call there is an internal translation to a gRPC call:

REST client -> REST API -> gRCP

In order to support the streaming gRPC methods, these endpoints are wrapped in WebSockets. These layers were added to support the web-interface, as by then gRPC was not supported in the browser. This is now supported (through gRPC-web) and probably this translation layer is going to be removed in the next version (probably it could still be provided as external component).

It should be fairly easy to generate C# gRPC stubs from the proto files (https://grpc.io/docs/languages/csharp/quickstart/) and then the streaming of data should work out-of-the box :-)

Hi @brocaar

Thank you very much for the input.