UnJavaScripter/web-serial-example

Cannot connect, CORS error

jack-ii opened this issue · 3 comments

Unfortunately it does not work.
The connect button does nothing and i get these error messages before i click anything.
-Arduino Nano v3.0 ATmega168 CH340G
-Chrome portable 99.0.4844.82
0
Or am I doing something wrong?
Does "Run the demo app locally" mean to open the index.html in the browser? Or do I have to do something with the ts files?

Hi @jack-ii . You should serve the index.html file from a server. Any testing server will do the job, such as http-server, Python http server. You can use more complex stuff like IIS or WAMP, but the result will be the same.

The typescript files already transpiled to javascript inside the dist folder, so it should work without messing with them.

Thanks! :) I just found out a minute ago that it works from a server. Because your demo site and others work. The Run locally confused me.
Firefox is not supported right?
And I noticed that the button to led delay is a little slow.
When I press the button, a blue LED on the Arduino lights up immediately, but the actual action is only executed ~1 second later.
This is slower than when I press a button on the Smarthone via WiFi to router to an ESP. Is it possible to make it faster or does it take time to connect etc.?

Glad you made it work! It seems like I need to improve the readme :)

Indeed, Firefox has decided not to implement it (yet?) you can check this GitHub issue for more details if you have some time to spare.