Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chromeduino 3.0 #12

Open
mrfrase3 opened this issue Jun 8, 2019 · 13 comments
Open

Chromeduino 3.0 #12

mrfrase3 opened this issue Jun 8, 2019 · 13 comments

Comments

@mrfrase3
Copy link
Collaborator

mrfrase3 commented Jun 8, 2019

So a lot has happened in the last year, of note:

  • Google dropped support for chrome apps on non-ChromeOS devices, instead preferring developers made Progressive Web Apps (PWA)
  • ChromeOS support for Linux apps appears to be going no-where/not very compatible on devices with low storage
  • WebUSB is now a thing on chromium browsers (chrome, opra and new edge)
  • Arduino-cli is now a thing
  • Chromeduino 2.0 has ~20k active users a week 🎆 :pikachu_face:

I've had a play around with the arduino-cli and managed to upload a program on an Arduino using the following flow:
arduino-cli <-> net socket <-> nodejs <-> socket.io <-> nodejs <-> serial <-> arduino

What does that mean?
We can upload a hex without a custom avr programmer written in js on the front end, instead just pipe the communication to the server. This also means support for the board manager, i.e. esp8266's without any hackery. (also the library manager)

Unfortunately, changing to this flow would mean that the app would basically need to be recoded. On the bright side, the app would need to be recoded.

What I'm proposing for Chromeduino 3.0:

  • Split the client and server into different repositories (maybe make a Chromeduino GitHub organisation)
    • Set up proper git branches/workflow
    • CI with TravisCI or CodeBuild
  • Potentially rename Chromeduino to something less trademarky
  • For the client:
    • Use Vue as an app frame work, with Vuetify
    • Abstract the serial communication layer, so any can be used (chrome.serial, WebUSB, electron...)
    • Compile as a PWA, publishing on as a website as well as a chrome app. (more than just ChromeOS)
    • Add more settings support, including board and library manager
    • Add internationalisation support, lang files or something (a large number of users are from Spain/Europe)
    • In-app bug reporting?
    • Make a "betaduino" webstore listing for the beta version of 3.0, meaning 2.0 can be switched to something not so buggy
  • For the server:
    • Use Socket.io as the communication protocol
    • Basically, shunt the arduino-cli
    • Publish as a container on DockerHub
      • Allows people to easily download and run their own servers
      • Can use AWS Elastic Container Store for scalable "official" compile servers around the world Migrate Backend to AWS Lambda #7 (lambda will not work for the high-speed back and forth of the programming)
        • Arduino-cli can cache the library/board downloads, can set up an S3 bucket and mount it on the containers to reduce load times.
      • Can be isolated from compiler security problems Security Issue: Can read parts of files from server #10

I've already started coding this, but input/feedback is always welcome

@lordfriky
Copy link

Hey buddy! Any update on this?

@mrfrase3
Copy link
Collaborator Author

mrfrase3 commented Nov 7, 2019

Yeh Sure,

  • I've made two separate repos, at some point I'll un-private them and move them to an organization
  • I looked at renaming (what domains were available) and surprising duino.app and duino.codes were free, so I grabbed them.
  • I'm currently working on the client
    • It uses vue/vuetify
    • Made a serial layer abstraction, supports WebUSB/chrome.serial
    • Finished the board and server managers, yet to start a library manager
    • Yet to look at internationalisation support, but it is a supported feature in vue, so I'm not too worried
      • If people are willing to translate, please let me know, I only speak coding languages. :P
    • Currently working on the in-app project and file management, next will be the code editor.
    • Once the code editor and board programming are wired up, I'll release the first alpha.
  • The server part, for the most part, is now done.
    • It's everything described above, except published on DockerHub
    • I've decided to go down the route that the docker container comes with every board and library pre-installed, this will make the operation of the servers simple, but means that they are 4GB large

Here's some pictures of the new server and board managers:
image

image

@spaceneedle
Copy link
Owner

spaceneedle commented Nov 7, 2019 via email

@mrfrase3
Copy link
Collaborator Author

mrfrase3 commented Nov 7, 2019

Hey @spaceneedle,

I couldn't agree with you more, the decision for Arduino to charge for their chrome app baffles me to this day. I just now realised that it has been 2 years already...

Hosting hasn't been too much of an issue, at least I don't think. The v2 compile servers are running on my dev VPS's that I already need to keep up, although I have no way of knowing how much they are being used.

I am yet to look into AWS deployment, it even looks like getting free credits might be possible but for a short-term. Although having a sponsor does sound like a nice full-circle answer.

Maybe you and I should have a call or something to discuss the future of this project.

@spaceneedle
Copy link
Owner

spaceneedle commented Nov 7, 2019 via email

@RUGMJ
Copy link

RUGMJ commented Jan 18, 2020

Is there any release date for chromeduino 3 if not don't worry if so please mention me! 💬

@mrfrase3
Copy link
Collaborator Author

Sorry, the silly season was extra silly for me. Every time I work on this project it seems that something goes wrong with my PC and I need to wipe and reinstall Linux. I should burn some sage...

No date so far, but here's an update:

Client:

  • Basic project and file support added
  • Code editor added, I decided to use Monaco which is the text editor behind VS Code
  • Updated to version 2 of Vuetify
  • I hit a bad snag, it turns out WebUSB is trash as it'll only communicate with pre-configured devices.
    • There is hope with the new Serial API library, but that is yet to be released in the next version of chrome
    • I'll need to write an adaptor for good old chrome.serial, but that will require the application to be a chrome app, which will take further configuration

Server:

  • Same as before, although I want to add backward support so that Chromeduino 2.0 clients can connect and compile with library support.

Basically it's waiting for me to have a weekend free to tackle it again. In the meantime, here are some screenshots of the project manager and code editor:
project manager
code editor

@RUGMJ
Copy link

RUGMJ commented Jan 18, 2020

Thanks for the update good luck on everything

@RUGMJ
Copy link

RUGMJ commented Mar 21, 2020

with the serial problem, I think I've found a solution for you. you could create a chrome app which then communicates to the website and the serial port kinda like a translator also how are you going to add library support to the compiler have you found anything??

@mrfrase3
Copy link
Collaborator Author

Thanks @RUGMJ7443, unfortunately when I last looked at this, shortly after my last update, I could not get either the new Serial API library or a custom extension as you described working.

Seeming that I keep hitting technical hurdles that are making this slower than I originally anticipated, I've decided to release the source code and deploy the new server with legacy support.

Because the new version requires a domain and I'm scared about the trademark implications of the word "chrome", I'm changing the name from Chromeduino 3.0 to Duino.App.

I've thrown up a quick website at https://duino.app.

The code now lives in a dedicated GitHub org.

The new compile server should be available in the list of servers in Chromeduino 2. This adds all library support.

The server is deployed via docker, you can find it here. (note that the image size is 7.65 GB with all the libraries)

I'm tossing around the idea of putting up a Discord or Slack server to potentially build a bit more of a community around the project...

@mrfrase3
Copy link
Collaborator Author

An annoying update, further investigation of the inability to upload has gone no-where. Additionally, it seems the network socket technique I was using won't work for ESP boards, which was the entire point of doing it! 😤

Looks like it's time to go back to the drawing board...

@mrfrase3
Copy link
Collaborator Author

So I recently had a lot of luck implementing this, after a lot of time debugging, I could upload to an Arduino Uno, nano, and an ESP8266.

Annoying, I managed to get this working with the extension, which exposes the chrome serial API, which apparently is only supported in Chrome apps. Even worse, Google are sunsetting chrome apps for ChromeOS, so setting up the extension method won't work.

I'm gonna try the navigation.serial library again, although I'm a bit skeptical if it'll work. If it doesn't, we may need to look at stopping the chromeduino project, as it'll no longer be viable when Google shuts down chrome app support in June 2022.

@mrfrase3
Copy link
Collaborator Author

mrfrase3 commented Nov 1, 2020

Good news!

I've had a large amount of success with navigation.serial API over the last few weeks, and after more than a year after starting the recode, we've finally got a release! 🥳🎉🎊

You can check it out over at https://duino.app

I've currently set up new compile servers in Australia and the US, I plan to launch some in Europe as well.

I've also setup a discord server to hopefully build a bit more of a community behind this so I can get better motivation. 😅

Discord: https://discord.gg/FKQp7N4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants