This isn't an issue, but more of a feature request I suppose. This has been asked in the forum, but the thread hasn't had a reply since February...
So it looks like the ESP Voice Assistant SDK uses Google Dialogflow through the gRPC hooks. Is there any way we could get a generic example of using gRPC in the IDF? Or maybe someone out there has some code they'd like to share where they've implemented gRPC on the ESP32?
Hi @eagi223 We will add this to the to-do list. Although, for now, I do not have concrete timelines for that.
That would be great! In the meantime I'll keep trying to figure it out.
I'm interested in the gRPC example on ESP32 too.
I checked the esp-va-sdk repo but was not able to find anything. The code appears to be inside of the libdialogflow.a library.
By the way, there are people interested in this topic since 2016:
Could you inform if you are using Juniper/grpc-c or just sending the raw protocol buffer packets via HTTP2 ?
Are you using sh2lib for that?
hi, @eagi223 @dhrishi @kroggen someone have news about grpc in ESP device . ?
i am interested too .. any news or solutions ?
I did it manually encoding and decoding the protocol-buffers packets using nanopb and sending them using sh2lib.
I cannot share the code now but you can check these tutorials:
https://techtutorialsx.com/2018/10/19/esp32-esp8266-arduino-protocol-buffers/
https://techtutorialsx.com/2019/01/04/esp32-http-2-post-request-with-headers/
@kroggen , Thanks very much for your quick reply, i have run encoding code in esp32 using first tutorial , but i dont know more about deconding data from my server (visual studio c#).
and what u thing about PJON-GRPC : https://github.com/Halytskyi/PJON-gRPC ??
This PJON is new to me. I never used it.
But if you have control over the server, why not just use a simple JSON or Binn and simple HTTP?
I had to use GRPC simply because the server already exists and the only option was to comply with it.
Protocol-buffers in C sucks!
@kroggen i dont know if i can use it and i want to HTTPS i hope that not a problem ?
@kroggen
Is there any updates about gRPC ??!
Hi,
I don't know any easy solution to use GRPC on ESP32, but I can share what I did.
I separated the process in 2 parts:
Just the protobuf encoded message is not sufficient as payload, we need to add 5 bytes before to comply with the HTTP2 spec. The first byte must be zero (meaning no compression) and the remaining 4 bytes are the size of the message in big endian.
I just released the project that uses this method. You can check the sources here
You can start by the send_grpc_request function
Hm. Any Updates on this ? - We wan't to start a bigger Project with Ethernet, gRPC and CAN on ESP32, but gRPC is neccesary for this :-/
Most helpful comment
That would be great! In the meantime I'll keep trying to figure it out.