WebUSB

Hello

I'm testing this solution to be talked Arduino via USB with WEB

specifications tell me that

"WebUSB requires an Arduino model that gives the sketch complete control over the USB hardware. This library has been tested with the following models:"

Arduino Leonardo
Arduino/Genuino Micro

I need to understand why Arduino UNO can not use this library

#error "WebUSB requires a board that supports USB client device mode."
^
exit status 1
Error compiling for board Arduino/Genuino Uno.

With Uno, sketch uses 16U2 as preprogrammed USB/Serial adapter and Cannot change the USB settings, the 16Us is just a pass thru device.

With Leonardo/Micro, the 32U4 has the USB built in and the sketch Can change settings.

Thank you for the explanation

So I have to conclude that this library has severe limitations.

I'll have to look for some other solution

dataino:
So I have to conclude that this library has severe limitations.

I'll have to look for some other solution

What do you want to use your Arduino for?

Maybe there is a simple solution.

...R

The problem is not what I do with Arduino, but connected through the USB port any Arduino from my computer to a Web page on a server and send and receive data.

I solved the problem by using the chrome browser, and developing an app that basically used this API

Unfortunately google is closing apps (Chromium Blog: From Chrome Apps to the Web) and I have to find an alternative solution in order to continue to connect Arduino with my site

obviously must be cross-platform (windows, linux, osx and obviously chrome os)

br
Carmelo G.

dataino:
The problem is not what I do with Arduino, but connected through the USB port any Arduino from my computer to a Web page on a server and send and receive data.

I solved the problem by using the chrome browser, and developing an app that basically used this API

https://developer.chrome.com/apps/serial

It's very hard to make sense of any of this if you refuse to say what you are trying to do.

Communicating between a PC and an Arduino using a serial connection is one of the most common activities. I can't help feeling you have an over-complicated concept in your head.

...R

Hi there !

@Robin2 I'm in a similar situation, trying to test the GitHub - webusb/arduino: WebUSB demos running on Arduino (and compatible) hardware.

And also faced the 16u2 problem because I have a UNO.

I want to buid a Progressive Web App which means I'd want a front end (javascript) usb api to read from a phone's usb serial port. I'd connect the arduino to the serial port in order to send sensor information.

Why? because I want to attach many sensors managed by an arduino with a mobile app built in a PWA way.. am I over complicating things?

So: can I use WebUSB API with arduino uno?

thanks in advanced!

1 Like

I don't know anything about WebUSB or what anyone would use it for. But the Github page clearly states the Arduino models that it works on and it does not list the Uno or Mega.

I want to buid a Progressive Web App which means I'd want a front end (javascript) usb api to read from a phone's usb serial port. I'd connect the arduino to the serial port in order to send sensor information.

Why? because I want to attach many sensors managed by an arduino with a mobile app built in a PWA way.. am I over complicating things?

I can't pretend to understand this.

What will the Javascript be running on? Presumably a PC. Presumably the phone is connected to the PC and also the Arduino is connected to the PC via USB. And the sensors are connected to the Arduino.

if that is all correct then I don't understand why there would be problem sending sensor data from the Arduino to the PC.

If my assumptions are not correct maybe you can provide a diagram that shows how everything is connected.

...R