Will USB (serial communications) function with GP in a web browser?

Questions about GP commands and how to do things

Moderator: MSandro

Post Reply
iApple
Posts: 1
Joined: Oct 16th, '17, 19:33

Will USB (serial communications) function with GP in a web browser?

Post by iApple » Oct 16th, '17, 19:42

Hello all,

I am currently working on my Senior Project, a combined IDE/compiler/upload system for the LEGO NTX/EV3 robotics system. My team would like for this program to live and function in a web page, so that educators do not have to download software to their computers to get started using the program. The ability of GP to run in a browser and it's feature set make it very appealing.

As we are programming the hardware, the serial port/USB connectivity portion of GP is very important to us. I saw a mention that some features of GP are not available when running in browser mode, but only file operations were explicitly mentioned. Are the serial port functions still operational when running in the browser?

Thanks

JohnM
Posts: 379
Joined: Sep 11th, '15, 14:42

Re: Will USB (serial communications) function with GP in a web browser?

Post by JohnM » Oct 17th, '17, 18:52

Browsers don't allow access to serial ports so, unfortunately you won't be able to GP's serial port features.

This is problem for any programming system that runs in the browser and needs to access hardware connected via serial ports. A common work-around (used in, for example, Snap4Arduino) is to employ a helper app that runs outside of the browser. The browser opens a web socket to the helper app and uses that to send and receive serial port data. Unfortunately, that undermines one of the key benefits of running the browser -- avoiding the need to install any extra software.

Sadly, I don't know how you can avoid using some sort of helper app if you need to access the serial port. I believe there used to be a Chrome Plugin that could access the serial port, but (a) I think support for that may have been removed and (b) the user would still need to install the Chrome Plugin, although that might be easier and safer than installing an app.

Your project sounds really cool. Good luck with it!

Post Reply