Teensy 4.0 USB Communication w/ Browser

nazeern

Member
What is the recommended method for the browser (e.g. website on Chrome) to communicate w/ the Teensy 4.0? Very generally, I have a website developed in JavaScript and I'd like to (1) detect the connected device, (2) send commands through user input in the browser, and (3) receive data from the Teensy in return. Does anyone have an example I could learn from?

This might not matter, but the end goal is to read a voltage wave at a user inputted frequency that I'll send to an API I wrote.
 
Been some time since this came up and gave it a glance - not seen much as it was 'in development' then and not seen as robust/safe?
Seems as though it has evolved and may have be a feature with future support?

Chrome/EDGE browsers have HID_USB support: WebHID API Draft Community Group Report 04 August 2023
> Connecting to uncommon HID devices
> Human interface devices on the web: a few quick examples

In edge using this as URL "about://device-log" I see TeensyDuino devices. Not sure if this is with the service enabled on this machine or not.
)
USB User [00:59:08] USB device added: path=\\?\usb#vid_16c0&pid_0483#7819600#{a5dcbf10-6530-11d2-901f-00c04fb951ed} vendor=5824 "Teensyduino", product=1155 "USB Serial", serial="7819600", driver="usbccgp", guid=d4e19d05-95a1-4e34-8a65-f4081248214d
 
I appreciate all the thoughtful comments -- I'll likely keep looking into WebHID as a solution. Is there any understanding of the speed of Teensy 4.0's Raw HID? I found this resource that suggests a rate of 64 bytes/packet at 1000 packets/second = 64k bytes/second, which is quite high already.

I'm using Teensy for scientific applications, so data speed is quite important for me. I've also heard that WebUSB and bulk transfers can be quite fast. I found this resource for making a device WebUSB compatible, but I'm not sure how to modify the binary object store (BOS) descriptor on Teensy 4.0.

In the end, I plan to run a Fourier Transform on a voltage wave I collect. I currently do this with Python + Numpy, but I've heard that Teensy has special hardware/packages for Fourier analysis (?) I'd appreciate any advice on making Teensy WebUSB compatible, solutions for Fourier transforms, and sending data to the browser.
 
Back
Top