Chromebook Linux IDE Installation

No arduino board yet. Just trying to get the IDE installed on my Chrome Pixelbook.
I turned on Linux.
I downloaded the latest linux64.tar.xz but not into my Linux file structure.
Unzipped using Wicked Good Unarchiver
Moved the subsequent arduino top folder and everything under it to home/my user name (took 4 hours ???)
ran install.sh
Ran Linux update/upgrade (maybe should have done this earlier but didn't know about it)
I now have an Arduino IDE icon in Chrome but when I click on it nothing happens. First time after a reboot it spins for a bit but then goes away.
I loaded a picture editing app in Linux and it works fine when I click on the icon.
I am not sure where I should have unzipped the xz file in the first place or where the IDE should be installed.
I thought maybe I should uninstall and try again but I cant find any instructions for that. I don't want to just delete the ardrino folder and leave all the support files scattered around.

I am a retired engineer who worked with unix and programming decades ago -a bit rusty to say the least.

Thanks in advance for any help.

The officially supported way to use Arduino on ChromeOS is the Arduino Create Chrome App for the cloud-based Arduino Web Editor:

I don’t have any experience with using the Arduino IDE on a Chrome OS machine, but I do have a link that might provide some useful information to you:

As an alternative to that approach, there is also an arduino_ide package in chromebrew.

johnfarmer:
I now have an Arduino IDE icon in Chrome but when I click on it nothing happens.

Please do this:

  • Start a terminal in the Arduino IDE installation folder
  • Type
./arduino
  • Press Enter.
  • Wait for the Arduino IDE to finish starting, or failing to start.
  • Switch back to the terminal window if the Arduino IDE window took the focus.
  • Click and drag the mouse to select all the output in the terminal window.
  • Press Ctrl + c. This will copy the selected text to the clipboard.
  • In this Arduino forum thread, click on the reply field.
  • Click the </> button on the forum toolbar. This will add the forum’s code tags markup to your reply, making it easier for us to read.
  • Press Ctrl + V. This will paste the output between the code tags.
  • Move the cursor outside of the code tags before you add any additional text to your reply.
  • Click the “Post” button.

The terminal output will often provide some information that’s useful for troubleshooting a crash on startup.

johnfarmer:
Moved the subsequent arduino top folder and everything under it to home/my user name (took 4 hours ???)

What is the full path of the installation folder? You mention the “/home/” part, but I’m guessing it’s in a folder under that path, so what is that folder name?

No experience with ChromeBook.

In Linux, I would navigate to the directory where the application is installed in a terminal window and run the executable from there and check the output.

I haven't worked with Linux for a while, so can't tell you what the executable is or what to expect.

pert:
What is the full path of the installation folder? You mention the “/home/” part, but I’m guessing it’s in a folder under that path, so what is that folder name?

farmerjd28@penguin:~$ pwd
/home/farmerjd28
farmerjd28@penguin:~$ ls
arduino-1.8.13 Desktop Documents Downloads
farmerjd28@penguin:~$ ls arduino-1.8.13
arduino arduino-linux-setup.sh hardware java libraries revisions.txt tools-builder
arduino-builder examples install.sh lib reference tools uninstall.sh
farmerjd28@penguin:~$

OK, that should be fine. If you had installed the IDE at $HOME/Arduino then that would cause a crash because $HOME/Arduino is the default sketchbook location and you're not permitted to have the IDE installed in the sketchbook, but you have it installed at $HOME/arduino-1.8.13 so that's not the cause of the crash.

So go ahead and run /home/farmerjd28/arduino-1.8.13/arduino from the command line and then post the output.

sterretje:
I haven't worked with Linux for a while, so can't tell you what the executable is or what to expect.

It's a Bash script named "arduino":

pert:
Please do this:

  • Start a terminal in the Arduino IDE installation folder
  • Type
./arduino
  • Press Enter.
  • Wait for the Arduino IDE to finish starting, or failing to start.
  • Switch back to the terminal window if the Arduino IDE window took the focus.
  • Click and drag the mouse to select all the output in the terminal window.
  • Press Ctrl + c. This will copy the selected text to the clipboard.
  • In this Arduino forum thread, click on the reply field.
  • Click the </> button on the forum toolbar. This will add the forum’s code tags markup to your reply, making it easier for us to read.
  • Press Ctrl + V. This will paste the output between the code tags.
  • Move the cursor outside of the code tags before you add any additional text to your reply.
  • Click the “Post” button.

The terminal output will often provide some information that’s useful for troubleshooting a crash on startup.

Thanks, I didn’t get too far in your suggested list of actions. Too much I still am trying to figure out.

farmerjd28@penguin:~/arduino-1.8.13$ pwd
/home/farmerjd28/arduino-1.8.13
farmerjd28@penguin:~/arduino-1.8.13$ ls
arduino          arduino-linux-setup.sh  hardware    java  libraries  revisions.txt  tools-builder
arduino-builder  examples                install.sh  lib   reference  tools          uninstall.sh
farmerjd28@penguin:~/arduino-1.8.13$ sudo ./arduino
sudo: ./arduino: command not found

pert:
So go ahead and run /home/farmerjd28/arduino-1.8.13/arduino from the command line and then post the output.

Here are various attempts -Thanks!

farmerjd28@penguin:~/arduino-1.8.13$ /home/farmerjd28/arduino-1.8.13/arduino
-bash: /home/farmerjd28/arduino-1.8.13/arduino: Permission denied
farmerjd28@penguin:~/arduino-1.8.13$ sudo /home/farmerjd28/arduino-1.8.13/arduino
sudo: /home/farmerjd28/arduino-1.8.13/arduino: command not found
farmerjd28@penguin:~/arduino-1.8.13$ sudo bash /home/farmerjd28/arduino-1.8.13/arduino
/home/farmerjd28/arduino-1.8.13/arduino: line 35: /home/farmerjd28/arduino-1.8.13/java/bin/java: Permission denied

I did a chmod to add execute privileges to the Java file it was complaining about. reran with the following results.
Something fundamentally messed up with my permissions or ?. How would I clean it all up?

Thanks again!

farmerjd28@penguin:~/arduino-1.8.13$ sudo bash /home/farmerjd28/arduino-1.8.13/arduino
No protocol specified
Picked up JAVA_TOOL_OPTIONS: 
Set log4j store directory /root/.arduino15
No protocol specified
java.awt.AWTError: Can't connect to X11 window server using ':0' as the value of the DISPLAY variable.
        at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
        at sun.awt.X11GraphicsEnvironment.access$200(X11GraphicsEnvironment.java:65)
        at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:115)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:74)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:264)
        at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:103)
        at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:82)
        at sun.awt.X11.XToolkit.<clinit>(XToolkit.java:126)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:264)
        at java.awt.Toolkit$2.run(Toolkit.java:860)
        at java.awt.Toolkit$2.run(Toolkit.java:855)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:854)
        at java.awt.SystemColor.updateSystemColors(SystemColor.java:473)
        at java.awt.SystemColor.<clinit>(SystemColor.java:465)
        at processing.app.Theme.init(Theme.java:343)
        at processing.app.Base.<init>(Base.java:250)
        at processing.app.Base.main(Base.java:150)

pert:
The officially supported way to use Arduino on ChromeOS is the Arduino Create Chrome App for the cloud-based Arduino Web Editor:

I have an Arduino MKR1310 which the web editor says is not fully supported. Cant do Linux IDE and cant do Web IDE.

So somehow I got another install to work. Only problem left is that the "port" is grayed out in the IDE. I believe my MKR 1310 and USB cable are good since when I plug it in I get a chrome OS popup that says the MKR1310 is connected to linux. I have hunted all over the arduino site and beyond, but cant seem to fix it. I did add my user name to groups tty and dialout.

Any help is very much appreciated.

I confirmed that my phone was recognized by linux using lsusb

farmerjd28@penguin:~$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 009: ID 04e8:6860 Samsung Electronics Co., Ltd Galaxy series, misc. (MTP mode)
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Then I realized that the MKR 1310 is also recognized but only for a few seconds which I could see by quickly doing multiple lsusb as I plugged it in.

armerjd28@penguin:~/arduino-1.8.13$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
farmerjd28@penguin:~/arduino-1.8.13$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 017: ID 2341:8059 Arduino SA 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
farmerjd28@penguin:~/arduino-1.8.13$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 017: ID 2341:8059 Arduino SA 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
farmerjd28@penguin:~/arduino-1.8.13$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 017: ID 2341:8059 Arduino SA 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
farmerjd28@penguin:~/arduino-1.8.13$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 017: ID 2341:8059 Arduino SA 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
farmerjd28@penguin:~/arduino-1.8.13$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 017: ID 2341:8059 Arduino SA 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
farmerjd28@penguin:~/arduino-1.8.13$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

and here in the usb log file you can see that it automatically disconnects after about 5 seconds. It connects as soon as I click on the chrome OS pop up telling it to connect. Does the same thing after I press the Mkr reset button.

farmerjd28@penguin:~/arduino-1.8.13$ sudo dmesg | grep -iFe usb | tee /tmp/dmesg-usb.log
....
[15911.476118] usb 1-1: new full-speed USB device number 20 using xhci_hcd
[15911.657413] cdc_acm 1-1:1.0: ttyACM0: USB ACM device
[15916.765025] usb 1-1: USB disconnect, device number 20
[15972.339481] usb 1-1: new full-speed USB device number 21 using xhci_hcd
[15972.511431] cdc_acm 1-1:1.0: ttyACM0: USB ACM device
[15977.685417] usb 1-1: USB disconnect, device number 21
farmerjd28@penguin:~/arduino-1.8.13$

Any ideas?

I guess I will just keep updating my progress. Maybe someone will see something they can help with and maybe this will be of help to someone else down the road.
Here is an lsusb -t for the 5 seconds it is connected. Looks like I am missing some expected files.

farmerjd28@penguin:~/arduino-1.8.13$ lsusb -t
/sys/bus/usb/devices/1-1:1.0/bAlternateSetting: No such file or directory
/sys/bus/usb/devices/1-1:1.0/bInterfaceClass: No such file or directory
/sys/bus/usb/devices/1-1:1.0/bInterfaceNumber: No such file or directory
/sys/bus/usb/devices/1-1:1.0/bInterfaceProtocol: No such file or directory
/sys/bus/usb/devices/1-1:1.0/bInterfaceSubClass: No such file or directory
/sys/bus/usb/devices/1-1:1.0/bNumEndpoints: No such file or directory
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/8p, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/8p, 480M
    |__ Port 1: Dev 29, If 0, Class=, Driver=, 12M
farmerjd28@penguin:~/arduino-1.8.13$ lsusb -t
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/8p, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/8p, 480M
farmerjd28@penguin:~/arduino-1.8.13$

...but it looks like the files exist but in a different Devices directory. 1-0:1.0 instead of the expected 1-1:1.0. The expected directory doesn't exist.

farmerjd28@penguin:/sys/bus/usb/devices/1-0:1.0$ ls -l
total 0
-rw-r--r-- 1 nobody nogroup 4096 Dec  8 10:00 authorized
-r--r--r-- 1 nobody nogroup 4096 Dec  7 17:55 bAlternateSetting
-r--r--r-- 1 nobody nogroup 4096 Dec  7 17:55 bInterfaceClass
-r--r--r-- 1 nobody nogroup 4096 Dec  7 17:55 bInterfaceNumber
-r--r--r-- 1 nobody nogroup 4096 Dec  7 17:55 bInterfaceProtocol
-r--r--r-- 1 nobody nogroup 4096 Dec  7 17:55 bInterfaceSubClass
-r--r--r-- 1 nobody nogroup 4096 Dec  7 17:55 bNumEndpoints
lrwxrwxrwx 1 nobody nogroup    0 Dec  7 17:55 driver -> ../../../../../bus/usb/drivers/hub
drwxr-xr-x 3 nobody nogroup    0 Dec  7 17:55 ep_81
-r--r--r-- 1 nobody nogroup 4096 Dec  8 10:00 modalias
drwxr-xr-x 2 nobody nogroup    0 Dec  7 21:24 power
lrwxrwxrwx 1 nobody nogroup    0 Dec  7 16:42 subsystem -> ../../../../../bus/usb
-r--r--r-- 1 nobody nogroup 4096 Dec  8 10:00 supports_autosuspend
-rw-r--r-- 1 nobody nogroup 4096 Dec  7 16:42 uevent
drwxr-xr-x 3 nobody nogroup    0 Dec  8 10:00 usb1-port1
drwxr-xr-x 3 nobody nogroup    0 Dec  8 10:00 usb1-port2
drwxr-xr-x 3 nobody nogroup    0 Dec  8 10:00 usb1-port3
drwxr-xr-x 3 nobody nogroup    0 Dec  8 10:00 usb1-port4
drwxr-xr-x 3 nobody nogroup    0 Dec  8 10:00 usb1-port5
drwxr-xr-x 3 nobody nogroup    0 Dec  8 10:00 usb1-port6
drwxr-xr-x 3 nobody nogroup    0 Dec  8 10:00 usb1-port7
drwxr-xr-x 3 nobody nogroup    0 Dec  8 10:00 usb1-port8
farmerjd28@penguin:/sys/bus/usb/devices/1-0:1.0$

Can I create the missing directory and copy the files over or is that going to mess things up?

Now I see that my previous update was misleading. >:(
The directory and files are created for the 5 seconds the USB is recognized then the files go away when it disconnects so that is why I get the "no such file or directory".

One step forward, two steps back

The tricky thing about the boards with native USB functionality like your board is that the USB code that creates the CDC serial port is running on the same microcontroller as your sketch. This means your sketch code can break the USB code, or stop it from running.

So it may be that this issue you're having with the board only being recognized for 5 seconds is because after startup the bootloader runs for a short time, during which your sketch can't interfere with the USB code, then the bootloader exits and your sketch code breaks the USB and causes it to stop being recognized. If so, this is not specific to the Chrome OS system.

Fortunately, there is an easy way to recover from this situation:

  • Press and release the reset button on your board quickly twice. You should now see the LED on the board pulsing, which means the bootloader is running. The double press causes the bootloader to run indefinitely (until the board is reset, powered off, or an upload is done), which means you don't need to get the timing of the reset just right.
  • Select the port of your board from the Tools > Port menu. The port number may be different when the bootloader is running so don't assume you already have the correct port selected.
  • Start an upload in the Arduino IDE.

The upload should now finish successfully. After this, you should be able to go back to doing normal uploads without needing to press the reset button. If you still need to do the reset trick to do uploads after this, the problem may be caused by your code. You can verify this by uploading a simple sketch like File > Examples > 01.Basics > BareMinimum.

Thanks for the double reset tip. My yellow LED normally blinks on/off but after the double reset it fades on/off.
In both cases my USB disconnects after 5 seconds. I don’t think I was ever close to uploading a script.
I think I have deeper problems as I had to change permissions on a java folder to even get the IDE to come up. Now if I just try to verify bareminimum I get these errors.

processing.app.debug.RunnerException
        at cc.arduino.Compiler.callArduinoBuilder(Compiler.java:317)
        at cc.arduino.Compiler.loadPreferences(Compiler.java:216)
        at cc.arduino.Compiler.build(Compiler.java:175)
        at processing.app.SketchController.build(SketchController.java:664)
        at processing.app.SketchController.exportApplet(SketchController.java:689)
        at processing.app.Editor$UploadHandler.run(Editor.java:2055)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: Cannot run program "/home/farmerjd28/arduino-1.8.13/arduino-builder": error=13, Permission denied
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
        at java.lang.Runtime.exec(Runtime.java:620)
        at java.lang.Runtime.exec(Runtime.java:485)
        at processing.app.helpers.ProcessUtils.exec(ProcessUtils.java:11)
        at cc.arduino.Compiler.callArduinoBuilder(Compiler.java:297)
        ... 6 more
Caused by: java.io.IOException: error=13, Permission denied
        at java.lang.UNIXProcess.forkAndExec(Native Method)
        at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
        at java.lang.ProcessImpl.start(ProcessImpl.java:134)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
        ... 10 more

I think I will reload linux and start over again. Hopefully I wont have the permission issues like last time.

Thanks again.

Is the IDE required for the USB to be connected?
I have reloaded a clean linux but have not installed the IDE yet and I get the same 5 second timeout disconnect even with the bootloader running on the MKR 1310.

Update/Summary of problem.
I now have a clean chrome OS Linux IDE installation that appears to work except as noted.

  • I think it installed with all the correct permissions because I used tar to extract the files instead of the chrome Wicked Good Unarchiver.
  • I ran both the install.sh and the arduino-linux-setup.sh
  • The port in my IDE is ALWAYS and has ALWAYS been grayed out
  • I have added the drivers for the MKR 1310 and can pick it in the tools/board
  • I don’t think my IDE install is the problem anymore

My USB connection still times out after 5 seconds.

  • This is independent on whether the IDE is running or not.
  • I have added my user name to the dialout, tty, uucb, and plugdev groups
  • When MKR 1310 is plugged in or reset (double press) I get the OS pop up to connect to linux after selecting I see the arduino SA device in lsusb for 5 seconds then it disconnects.
  • If I toggle the linux USB switch in settings the arduino is again recognized for 5 seconds.
  • The MKR 1310 green led is on, the orange led binks or fades on/off’
  • I have confirmed that a tablet connected to the same cable is recognized and stays connected.

Is there any other data that would be helpful?

  • Have I missed anything in my linux setup?
  • The MKR1310 looks to be working but could it be damaged?
  • Could the MKR 1310 be initiating the disconnect? Why?
  • Has anyone else actually had success with the MKR 1310 and Chrome OS Linux?
  • The on-line IDE does not support MKR 1310. Could this be a similar issue?

johnfarmer:
The on-line IDE does not support MKR 1310. Could this be a similar issue?

Would you mind providing details about that? I’m not aware of any lack of support for that board in Arduino Web Editor.

pert:
Would you mind providing details about that? I'm not aware of any lack of support for that board in Arduino Web Editor.

I paid for and ran the arduino web editor and could not find the MKR 1310 on the list. I saw somewhere that it was not currently supported. I sent an email and got this response:

Hello John,
Thank you for contacting Arduino Technical Support.
We are looking into this issue. At the moment MKR 1310 is not compatible with the Chromebook App. We suggest you use a different OS device or use a compatible Arduino board.
If you have any further issues or queries, please do not hesitate to contact us again.
Kind Regards
Ignacio Herrera
Arduino Support Team