Go Down

Topic: WebUSB (Read 2476 times) previous topic - next topic

dataino

Hello

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

https://github.com/webusb/arduino

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.

CrossRoads

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.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

dataino

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

Robin2

#3
Mar 23, 2017, 10:24 am Last Edit: Mar 23, 2017, 10:24 am by Robin2
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
Two or three hours spent thinking and reading documentation solves most programming problems.

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

Unfortunately google is closing apps (https://blog.chromium.org/2016/08/from-chrome-apps-to-web.html) 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.

Robin2

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
Two or three hours spent thinking and reading documentation solves most programming problems.

pblauer

Hi there !

@Robin2 I'm in a similar situation, trying to test the https://github.com/webusb/arduino

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!

Robin2

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.

Quote
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
Two or three hours spent thinking and reading documentation solves most programming problems.

Go Up