USB transport

396 views
Skip to first unread message

Robert Bielik

unread,
Feb 2, 2018, 11:51:23 PM2/2/18
to grpc.io
Hi all,

Has there been any work on using USB HID as a gRPC transport ? 

Regards
/Robert

Mark D. Roth

unread,
Feb 7, 2018, 1:54:10 PM2/7/18
to Robert Bielik, grpc.io
As far as I know, no one has requested this before, so it's not on our roadmap.

What is your use-case for this?  I'm not familiar with USB HID, but a quick web search indicates that it's for connecting things like keyboards and mice via USB, and it's not clear to me why you'd want to use gRPC for that.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/bfe31c0a-ba0a-4610-8e02-80987a4a7607%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Mark D. Roth <ro...@google.com>
Software Engineer
Google, Inc.

Abhishek Parmar

unread,
Feb 7, 2018, 1:57:46 PM2/7/18
to Mark D. Roth, Robert Bielik, grpc.io
It is actually very useful for communicating with microcontrollers. We do something similar with just sending protobuf request responses using nanopb. Our microcontroller is resource limited so running the full grpc stack is not feasible on that side, but might be useful in other situations.


For more options, visit https://groups.google.com/d/optout.



--
-Abhishek

Vijay Pai

unread,
Feb 7, 2018, 4:31:46 PM2/7/18
to grpc.io
As Mark mentioned, it's not on our roadmap, but if you wanted to put one together, I can suggest https://github.com/grpc/grpc/blob/master/doc/core/transport_explainer.md for an idea of what transports need to do. If the goal is a simple message-oriented transport without reference to complex flow control, I can suggest using the in-process transport as a model for how to build a transport, as it's only a few hundred lines of code and implements the transport ops required to actually have working RPCs for its context; this might make a lot of sense if your controller is memory-mapped. Alternatively, if your controller is mapped as a file, a path forward might be to make a new endpoint akin to the UDS endpoint. This would mean that you'd be speaking HTTP/2 over your HID, but again it may be a fairly simple integration.

Good luck!

- Vijay

Robert Bielik

unread,
Feb 8, 2018, 11:18:21 AM2/8/18
to Vijay Pai, grpc.io
Mark, as Abhishek mentioned, it is quite useful in cases where a target device (usually embedded) has no networking. Thanks Vijay, I'll have a look at your suggestions.

Regards
/Robert

--
You received this message because you are subscribed to a topic in the Google Groups "grpc.io" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/grpc-io/rCOTPM65A7U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to grpc-io+unsubscribe@googlegroups.com.

To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.

Frédéric Martinsons

unread,
Feb 13, 2021, 3:55:42 AM2/13/21
to grpc.io
Hello all,

Some years ago we had the exact same use case where we have an android application which drive an embedded devices (in USB Accessory Mode). The only way to communicate with this device is through USB channel and we wanted to use gRPC.
So we develop the USB transport channel in gRPC bask in 2018 (based on gRPC v1.13.0).
The guy from our teams that made these patches had now leaved but I'll be glad to submit a patch series if the USB support is still foreseen to be support but I may not be able to answer all the questions about tricks that came in this code.

Do you want to receive a merge request ?

Thanks for the good works gRPC guru.

On Thursday, 8 February 2018 at 17:18:21 UTC+1 robert...@gmail.com wrote:
Mark, as Abhishek mentioned, it is quite useful in cases where a target device (usually embedded) has no networking. Thanks Vijay, I'll have a look at your suggestions.

Regards
/Robert

2018-02-07 22:31 GMT+01:00 'Vijay Pai' via grpc.io <grp...@googlegroups.com>:
As Mark mentioned, it's not on our roadmap, but if you wanted to put one together, I can suggest https://github.com/grpc/grpc/blob/master/doc/core/transport_explainer.md for an idea of what transports need to do. If the goal is a simple message-oriented transport without reference to complex flow control, I can suggest using the in-process transport as a model for how to build a transport, as it's only a few hundred lines of code and implements the transport ops required to actually have working RPCs for its context; this might make a lot of sense if your controller is memory-mapped. Alternatively, if your controller is mapped as a file, a path forward might be to make a new endpoint akin to the UDS endpoint. This would mean that you'd be speaking HTTP/2 over your HID, but again it may be a fairly simple integration.

Good luck!

- Vijay

On Friday, February 2, 2018 at 8:51:23 PM UTC-8, Robert Bielik wrote:
Hi all,

Has there been any work on using USB HID as a gRPC transport ? 

Regards
/Robert

--
You received this message because you are subscribed to a topic in the Google Groups "grpc.io" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/grpc-io/rCOTPM65A7U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to grpc-io+u...@googlegroups.com.

Frédéric Martinsons

unread,
Feb 13, 2021, 5:49:05 AM2/13/21
to grpc.io

There is another thread talking about USB support: https://groups.google.com/g/grpc-io/c/MZCVUShRMkM/m/y3T_fs8iAQAJ but I cannot answer there since my messages are automatically deleted (don't know why)

Frédéric Martinsons

unread,
Feb 24, 2021, 6:07:01 AM2/24/21
to grpc.io

Anybody there ? 

I think I'll made the above mentionned merge request and we will see if it is accepted or not.

Tom Stoffer

unread,
May 9, 2023, 11:26:12 PM5/9/23
to grpc.io
Hi Frédéric

I would be interested in seeing this MR, we are looking at implementing something like this. Did your code get used in production?

Tom

Frédéric Martinsons

unread,
May 17, 2023, 3:12:44 PM5/17/23
to Tom Stoffer, grpc.io
Hello Tom,

Two years ago, I managed to get an USB channel based on grpc 1.35 , you can see this work on my personal grpc fork: https://github.com/fmartinsons/grpc/tree/grpc-usb-1.35.0

Sadly, from what I remember, I didn't manage to make it work on my target machine (I got spurious USB disconnections).
I didn't have the time to continue and I don't plan to work on it again but feel free to get the code and try it by yourself.

I'd appreciate it greatly if you manage to have a working code and publish it.

Have a nice day.

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/6b468554-c174-4b81-9238-5a8f6cd02f86n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages