USB as a transport channel for gRPC

531 views
Skip to first unread message

Frédéric Martinsons

unread,
Feb 25, 2021, 11:35:06 AM2/25/21
to grpc.io
Hello guys, like I said in a previous message (https://groups.google.com/g/grpc-io/c/rCOTPM65A7U) , back in the day, in my company there was a use cases to having gRPC work through usb. We made patches for that and we would like to submit it to the project.

Two questions though:
  - Is is wanted and will it be acceptable for the project (does it worth the shot to rebase and clean ourpatches) ?
  - If yes, then our patches introduced a libusb dependency (https://libusb.info/) and I'm wondering what is the best way to introduce that ? In a new third party submodule ? Is there documentation about integrating a new submodule because I read https://github.com/grpc/grpc/blob/master/third_party/README.md and there is not much details except that it trigs a lot of work and maintenance.

Thanks in advance for all the insights.

Nicolas Noble

unread,
Feb 25, 2021, 10:12:32 PM2/25/21
to Frédéric Martinsons, grpc.io
Hi,

  While the idea is interesting and has merit, adding a libusb dependency into a network-oriented library seems counter productive and would likely complexify our build, test, distribution, and maintenance burden. This seems like an endeavor that'd be much more appropriate as a specific fork; call it grpc-usb if you want, and it'd ONLY have USB as a transport mechanism. We wouldn't mind hosting it in our grpc-ecosystem organization for instance.

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/a0f856e9-dc0d-4f5f-82f1-ee2efef6ecd3n%40googlegroups.com.

Frédéric Martinsons

unread,
Feb 26, 2021, 1:13:01 AM2/26/21
to grpc.io
Ok I understand the point but I missed some details:
   - I can fork grpc to my github account but how to give it to the grpc-ecosystem ?
   - For adding libusb dependency, am I obliged to go through third_party git submodule and compile libusb from sources ? Or can I only relies on system package (if so , where do I put it, directly in CMakeLists.txt) ?
   - I have only a test setup running on unix , will it be acceptable for this fork to be only unix compatible ? Or do I need to support windows, apple ... ?

Thanks again for your quick answer by the way. Have a nice day !

Nicolas Noble

unread,
Feb 26, 2021, 12:24:20 PM2/26/21
to Frédéric Martinsons, grpc.io
I would direct you to https://github.com/grpc/grpc-community/blob/master/grpc_ecosystem.md for details on how to proceed, but, in short:

- transfer of ownership is a very straightforward process using github: https://docs.github.com/en/github/administering-a-repository/transferring-a-repository
- being in the ecosystem organization means way less stringent rules; you get to decide what's best for building and distributing your version. If you wish to restrict it to Linux, and remove all of the wrapped languages but C/C++, go for it.

Frédéric Martinsons

unread,
Feb 26, 2021, 1:00:34 PM2/26/21
to Nicolas Noble, grpc.io
Thanks Nicolas, I will read the doc you pointed and make the fork in the coming days (weeks maybe :p). 

One last question that come to my mind. Like I said in the above mentioned thread, the person who develop the patch is gone and I'm taking responsability for the code. 
I can make it compile on Linux, test it for our use cases (Android device in accessory mode) but I don't know if the patches will be correct towards coding rules or grpc philosophy.
And, if I understood correctly, doing the fork means that no peer review will be done to comment and accept the patches but I'm willing to have advices about how to do better integration inside gRPC world. 
Si here is my question (finally) : do you think it is possible to have review from gRPC devs people? 




Thong Nguyen

unread,
Apr 19, 2021, 10:15:03 PM4/19/21
to grpc.io
Hi  Frédéric Martinsons,

I have need to use grpc over usb and it is very interesting that you had done it. Could you please share it with us? 
Many thanks!

Thong.

Frédéric Martinsons

unread,
Apr 20, 2021, 1:50:43 AM4/20/21
to Thong Nguyen, grpc.io
Hello Thong,

Sure, you can find a work in progress on my personnal fork (branch grpc-usb-1.35.0: https://github.com/fmartinsons/grpc/tree/grpc-usb-1.35.0) .

The code compils and run on my target machine (an embedded linux box with a core i3) but for the moment I'm not able to make my android client talk with the server (I have spurious USB disconnection at server side).  I had not the time to go further on my investigations but I'm willing to pursue as soon as possible.

Anyway feel free to use this code but be warned it may not work out of the box. I you find bug or improvements on that, I will be very happy to  get them in a merge request (or by other means).

Thong Nguyen

unread,
Apr 20, 2021, 2:17:27 AM4/20/21
to grpc.io

Thank you very much!

David Micksch

unread,
Nov 19, 2021, 8:41:53 AM11/19/21
to grpc.io
Hi Thong,

Did you ever pursue this or do you know of any status updates to a gRPC USB transport?  I have a project that would benefit from this where TCP is not a viable option.

David

Reply all
Reply to author
Forward
0 new messages