cancel
Showing results for 
Search instead for 
Did you mean: 

HTTP over USB...?

Ricko
Senior II

Hi,
part of the project I am working on, I have been asked to add an external device to a vending machine. It is an age-recognition system that would interface with the main controller via USB. But apparently uses HTTP protocol over USB if I understand correctly...?

Attached is a (very short) PDF of the API and the product brochure. In the brochure there are 4 devices there but the one I've been asked to use is the one on page 4 and 5. It is like a USB pen drive that you can plug directly into a PC. At the back of it there is another USB port where you plug in the web cam. There are no other connectors. That is the whole system for age recognition. On page 5 it also says "no internet required"...

 

You just send a command to that USB tiny device and receive back an answer... either ACK or NACK depending on the age.

I am very familiar with C/C++ but never worked with networks. I barely know what HTTP is... 

 

So I am wondering (if you could look at the attached screenshot):
- is that HTTP over USB (if such thing exists)?
- what do I need to implement on the host micro software-wise to communicate with the external device...? maybe some "server" software? (again no idea how HTTP even works or what it needs). Or do I simply send a packet via USB with the text (perhaps) in the attached screenshot?

As always, any help and suggestions is much appreciated!

 

Thank you

 



Thank you

8 REPLIES 8
Pavel A.
Evangelist III

age-recognition system 

Really? How are you going to implement it?

@Pavel A.

I don't, I just use a ready made solution. I updated the original post with the product datasheet, API manual and additional comments in the post itself.

I hope that helps in case you are interested in using it. I just found out about it yesterday.

Andrew Neil
Evangelist III

@Ricko wrote:

I barely know what HTTP is... 


Start here: https://www.jmarshall.com/easy/http/

Although it's customarily transported over TCP/IP,  it is actually all just plain text - so it's just a matter of sending,  receiving, and parsing plain text.

 

EDIT:

 


@Ricko wrote:

On page 5 it also says "no internet required"...


Looking at it, I think that just means that you don't actually need to be connected to the Internet - but the transport is still using TCP/IP

There's a support contact email address in the document - have you tried asking them?

 

EDIT 2:

IP-over-USB is a thing: 

https://www.electronicspecifier.com/products/communications/ip-over-usb-technology-enables-easy-browser-access

https://www.segger.com/products/connectivity/emusb-device/add-ons/ip-over-usb/ 

also Ethernet-over-USB:

https://en.wikipedia.org/wiki/Ethernet_over_USB 

Pavel A.
Evangelist III

Well if this thing has *that* IP-over-USB - then it can be indeed Segger's or similar implementation of embedded http server behind USB RNDIS or CDC-ECM device. From the host point of view, it is a standard LAN adapter, similar to USB to ethernet dongles.  The host must have matching host side USB driver, RNDIS or CDC-ECM.  and TCP/IP & http client software. Windows or Linux has all this, but if the host is a STM32 ...good luck.

 

BarryWhit
Lead II

[Rewritten to remove my mistakes]

 

You can use an STM32 to implement an CDC-ECM *device*, but for an STM32 to be the host *talking* to such a device, I don't think there's anything ready-made for doing that.

 

Assuming the device implements CDC-ECM, to talk to it you would have to dive into the appropriate USB Class device spec and do some real work.

 

See STM32 USB Host Middleware and UM1720: STM32Cube USB Host Library User Manual for a starting point .(Spoiler: CDC-ACM (Virtual Com Port) is supported, CDC-ECM is not).

 

It would be much easier to use some kind of SBC instead, like a Raspberry-Pi running linux.

- If someone's post helped resolve your issue, please thank them by clicking "Accept as Solution".
- Please post an update with details once you've solved your issue. Your experience may help others.

@Pavel A. wrote:

Windows or Linux has all this, .


and, looking at the brochure posted by @Ricko, this thing is intended for use in PoS (Point-of-Sale) terminal applications - which are likely to be Windows or Linux based ...

Thank you all. :)

After speaking with them, it is designed to work with Windows and Linux but they can offer another system that provides a much simpler output interface.

Thank you all.:)

After speaking with them, it is designed to work with Windows and Linux but they can offer another system that provides a much simpler output interface.