eclipse-kuksa / kuksa-databroker

A modern in-vehicle VSS (Vehicle Signal Specification) server written in RUST
https://eclipse-kuksa.github.io/kuksa-website/
Apache License 2.0
12 stars 11 forks source link

How to get data from kuksa-databroker using dart gRpc #23

Open Athvaith2828 opened 2 months ago

Athvaith2828 commented 2 months ago

I can able to publish and subscribe to kuksa VSS ( example, Vehicle.speed), using python sdk (kuksa-client), I needs to do the same using gRpc in flutter-dart, I am looking for any basic example for the same . but wouldn't able to find and also would like to know, is it under development as i saw the similar open ticket: Databroker Api: Use cases + Errors #17

SebastianSchildt commented 2 months ago

Hi,

While it should be "technically possible", currently, as far as I know, in KUKSA core team we have nobody working on dart and/or flutter.

I know that Automotive Grade Linux guys are into flutter a bit, AND they use some Kuksa, but I am not sure they have some GRPC example in Dart lying around, maybe @g-scott-murray knows and has some pointers to code

g-scott-murray commented 2 months ago

We have a some examples of using dart-grpc in AGL, the primary ones are:

https://git.automotivelinux.org/apps/flutter-instrument-cluster/tree/lib/vehicle-signals (see vss_client.dart and associated provider .dart files)

and:

https://git.automotivelinux.org/apps/flutter-ics-homescreen/tree/lib/data/data_providers (see val_client.dart and associated provider .dart files, notable vehicle_notifier.dart)

I can't say I would consider any of that code particularly great, and we do have some known issues, e.g. we see an issue in the homescreen with subscription failing after running for a while, and I've so far not had a lot of success handling it and getting back into a working state. That's on my TODO list to look into further in the next couple of months. I may also start looking at using non-Dart code (e.g. tonic in Rust) via FFI, as Toyota tells us that they're doing similar for quite a few things in their homescreen implementation.

Athvaith2828 commented 2 months ago

Thanks for the reply and reference @g-scott-murray, And one more doubt @SebastianSchildt , I can see the above example uses protos from kuksa/val/v1 Is protos from sdv/databrokerl/v1 is also active in while running ? if yes, then what is the difference and when to use which ?

SebastianSchildt commented 2 months ago

"sdv/databrokerl/v1" is an older API. In current main builds it needs to be explicitely enabled with --enable-databroker-v1, when using the Python SDK only the newer kuksa/val/v1 API (and protos) are used.

If API changes again, usually the strategy is to have a suitably long grace period where the old API is still available. Currently the recommendation is to use only the kuksa/val/v1 , unless you have an urgent need for very high performance/high frequency setting of values. That is being worked on in a newer API (version) or - unfortunately limited to current values only - in the sdv1 API.