2024-06-25 01:10 PM - edited 2024-06-25 03:05 PM
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
2024-06-25 01:45 PM - edited 2024-06-25 01:59 PM
> age-recognition system
Really? How are you going to implement it?
2024-06-25 03:08 PM
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.
2024-06-25 04:14 PM - edited 2024-06-26 02:58 AM
@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.segger.com/products/connectivity/emusb-device/add-ons/ip-over-usb/
also Ethernet-over-USB:
2024-06-26 08:01 AM
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.
2024-06-26 08:14 AM - edited 2024-06-26 11:28 AM
[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.
2024-06-26 09:02 AM - edited 2024-06-26 09:02 AM
2024-06-26 11:59 AM
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.
2024-06-26 12:00 PM
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.