Can I use Arduino with Platformio on Chromebook?

Hello,
I installed Platformio for Atom as an alternative to Arduino IDE. But I am using it on Chrome OS. Does Platformio support Arduino on this platform?
I am asking because I could no see any PORT menu, like the controller was not recognized…
More specifically, with arduino plugged and a LED I placed flashing,

  1. the serial monitor does not show any port option
  2. On upload I get the error: No configuration to build this project exists. Hide Stack Trace No eligible build target.: No configuration to build this project exists. at /home/marongiuluigi/.atom/packages/build/lib/build.js:113:15

Thank you

You configure ports via the platformio.ini - upload_port. There is provision for configuration of ports via the PIO Home ‘Projects’ section, but I don’t know how you get there on Atom.

I’m also no sure that particular error message actually means - looks more like an Atom error. As long as you have a chromebook that is either x86, armhf or arm64, you should be right, depending on what platform you actually want to build for (AVR, espressif8266, espressif32, etc) and the level of multi-architecture support for that platforms build system.

Thank you.
I added the line upload_port = /dev/ttyUSB* on platformio.ini inside the project but when I uploaded, I got:

Mode details: https://docs.platformio.org/en/latest/faq.html#platformio-udev-rules
 
Error: Please specify `upload_port` for environment or use global `--upload-port` option.
For some development platforms it can be a USB flash drive (i.e. /media/<user>/<device name>)
*** [upload] Explicit exit, status 1
========================== [FAILED] Took 1.65 seconds ==========================

I installed 99-platformio-udev.rules

/etc/udev/rules.d$ ls
99-platformio-udev.rules
$ sudo service udev restart
$

but it did not solve anything.

How can I set this option once and for all?

Hm… where in the file did you put it? It needs to go under an “[env:]” block which describes the board settings - framework, serial upload and monitor speeds, etc. And you didn’t create a new platformio.ini, did you? As one should already exist.

i.e.

I placed it on project’s directory created by PlatformIO; I did not created platofrmio.ini, and I placed the line inside the block:

    $ cat platformio.ini 
    ; PlatformIO Project Configuration File
    ;
    ;   Build options: build flags, source filter
    ;   Upload options: custom upload port, speed and extra flags
    ;   Library options: dependencies, extra library storages
    ;   Advanced options: extra scripting
    ;
    ; Please visit documentation for the other options and examples
    ; https://docs.platformio.org/page/projectconf.html

    [env:micro]
    board = micro
    framework = arduino
    platform = atmelavr
    upload_port = /dev/ttyUSB*

Yet, the port is not recognized…

PS: I am using a Chromebook with this processor:

$ lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                4
On-line CPU(s) list:   0-3
Thread(s) per core:    1
Core(s) per socket:    4
Socket(s):             1
Vendor ID:             GenuineIntel
1 Like

Thanks for that - have to do the sanity check every once in a while! :wink:

Ok… this should be fun. Does ChromeOS actually enumerate the device at /dev/ttyUSB* (probably ttyUSB0, unless something else is plugged in) … i.e. does ls /dev/ttyUSB* give you anything when the Micro is plugged in? does dmesg -w and plugging in the Micro give any clues as to the enumeration path?

I got these:

# before plugging
$ dmesg -w | grep usb
[    1.132727] usbcore: registered new interface driver usbfs
[    1.133738] usbcore: registered new interface driver hub
[    1.135771] usbcore: registered new device driver usb
[    1.344067] pci 0000:00:0b.0: quirk_usb_early_handoff+0x0/0x690 took 12582 usecs
[    2.330307] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[    2.348634] usbcore: registered new interface driver cdc_acm
[    2.361567] usbcore: registered new interface driver usb-storage
[    2.367551] usbcore: registered new interface driver usbserial_generic
[    2.374264] usbserial: USB Serial support registered for generic
[    2.380134] usbcore: registered new interface driver ch341
[    2.386482] usbserial: USB Serial support registered for ch341-uart
[    2.392356] usbcore: registered new interface driver cp210x
[    2.397561] usbserial: USB Serial support registered for cp210x
[    2.403821] usbcore: registered new interface driver ftdi_sio
[    2.409232] usbserial: USB Serial support registered for FTDI USB Serial Device
[    2.416876] usbcore: registered new interface driver keyspan
[    2.422407] usbserial: USB Serial support registered for Keyspan - (without firmware)
[    2.429400] usbserial: USB Serial support registered for Keyspan 1 port adapter
[    2.436353] usbserial: USB Serial support registered for Keyspan 2 port adapter
[    2.443634] usbserial: USB Serial support registered for Keyspan 4 port adapter
[    2.450913] usbcore: registered new interface driver pl2303
[    2.456396] usbserial: USB Serial support registered for pl2303
[    2.462068] usbcore: registered new interface driver usb_serial_simple
[    2.469028] usbserial: USB Serial support registered for carelink
[    2.474836] usbserial: USB Serial support registered for zio
[    2.480489] usbserial: USB Serial support registered for funsoft
[    2.486713] usbserial: USB Serial support registered for flashloader
[    2.493101] usbserial: USB Serial support registered for google
[    2.498959] usbserial: USB Serial support registered for libtransistor
[    2.505142] usbserial: USB Serial support registered for vivopay
[    2.510803] usbserial: USB Serial support registered for moto_modem
[    2.517242] usbserial: USB Serial support registered for motorola_tetra
[    2.523487] usbserial: USB Serial support registered for novatel_gps
[    2.529513] usbserial: USB Serial support registered for hp4x
[    2.535408] usbserial: USB Serial support registered for suunto
[    2.541008] usbserial: USB Serial support registered for siemens_mpi
$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vdb         41G   11G   29G  27% /
none            492K     0  492K   0% /dev
devtmpfs        1.4G     0  1.4G   0% /dev/tty
/dev/vdb         41G   11G   29G  27% /dev/kvm
tmpfs           100K     0  100K   0% /dev/lxd
tmpfs           100K     0  100K   0% /dev/.lxd-mounts
run             1.4G   28K  1.4G   1% /dev/.host_ip
/dev/root       174M  173M     0 100% /dev/.ssh/sshd_config
9p              1.9G  892K  1.9G   1% /mnt/chromeos
/dev/vda         52M   52M     0 100% /opt/google/cros-containers
tmpfs           1.4G  128K  1.4G   1% /dev/shm
tmpfs           1.4G   33M  1.4G   3% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           1.4G     0  1.4G   0% /sys/fs/cgroup
tmpfs           278M  1.2M  277M   1% /run/user/1000

# after
$ dmesg -w | grep usb
[    1.132727] usbcore: registered new interface driver usbfs
[    1.133738] usbcore: registered new interface driver hub
[    1.135771] usbcore: registered new device driver usb
[    1.344067] pci 0000:00:0b.0: quirk_usb_early_handoff+0x0/0x690 took 12582 usecs
[    2.330307] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[    2.348634] usbcore: registered new interface driver cdc_acm
[    2.361567] usbcore: registered new interface driver usb-storage
[    2.367551] usbcore: registered new interface driver usbserial_generic
[    2.374264] usbserial: USB Serial support registered for generic
[    2.380134] usbcore: registered new interface driver ch341
[    2.386482] usbserial: USB Serial support registered for ch341-uart
[    2.392356] usbcore: registered new interface driver cp210x
[    2.397561] usbserial: USB Serial support registered for cp210x
[    2.403821] usbcore: registered new interface driver ftdi_sio
[    2.409232] usbserial: USB Serial support registered for FTDI USB Serial Device
[    2.416876] usbcore: registered new interface driver keyspan
[    2.422407] usbserial: USB Serial support registered for Keyspan - (without firmware)
[    2.429400] usbserial: USB Serial support registered for Keyspan 1 port adapter
[    2.436353] usbserial: USB Serial support registered for Keyspan 2 port adapter
[    2.443634] usbserial: USB Serial support registered for Keyspan 4 port adapter
[    2.450913] usbcore: registered new interface driver pl2303
[    2.456396] usbserial: USB Serial support registered for pl2303
[    2.462068] usbcore: registered new interface driver usb_serial_simple
[    2.469028] usbserial: USB Serial support registered for carelink
[    2.474836] usbserial: USB Serial support registered for zio
[    2.480489] usbserial: USB Serial support registered for funsoft
[    2.486713] usbserial: USB Serial support registered for flashloader
[    2.493101] usbserial: USB Serial support registered for google
[    2.498959] usbserial: USB Serial support registered for libtransistor
[    2.505142] usbserial: USB Serial support registered for vivopay
[    2.510803] usbserial: USB Serial support registered for moto_modem
[    2.517242] usbserial: USB Serial support registered for motorola_tetra
[    2.523487] usbserial: USB Serial support registered for novatel_gps
[    2.529513] usbserial: USB Serial support registered for hp4x
[    2.535408] usbserial: USB Serial support registered for suunto
[    2.541008] usbserial: USB Serial support registered for siemens_mpi
$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vdb         41G   11G   29G  27% /
none            492K     0  492K   0% /dev
devtmpfs        1.4G     0  1.4G   0% /dev/tty
/dev/vdb         41G   11G   29G  27% /dev/kvm
tmpfs           100K     0  100K   0% /dev/lxd
tmpfs           100K     0  100K   0% /dev/.lxd-mounts
run             1.4G   28K  1.4G   1% /dev/.host_ip
/dev/root       174M  173M     0 100% /dev/.ssh/sshd_config
9p              1.9G  908K  1.9G   1% /mnt/chromeos
/dev/vda         52M   52M     0 100% /opt/google/cros-containers
tmpfs           1.4G     0  1.4G   0% /dev/shm
tmpfs           1.4G   33M  1.4G   3% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           1.4G     0  1.4G   0% /sys/fs/cgroup
tmpfs           278M  1.2M  277M   1% /run/user/1000
1 Like

Since this is an Arduino Micro you’re talking about, I don’t think it will show up in a df -h listing, since it’s not a disk drive.

I should probably have been clearer about dmesg -w … the-w means wait… so run dmesg -w, connect the Micro, and see what output you get. Unfortunately that greped output doesn’t show anything useful, and doesn’t indicate if the Arduino Micro was detected at all. If you don’t get any messages/output, then I’d usually suspect the cable or USB port. But given that this is ChromeOS, I wouldn’t be so sure.

From Chrome OS community, it looks like that the name of the USB port is /dev/ttyUSB* but there is a #crostini-usb-allow-unsupported flag that might be involved. I’ll try dmesg… Thanks

1 Like

Hello, I tried, but dmesg -w goes straight to the end, does not wait. I saved the output to files but when I checked the differences with grep -Fxvf before[plugging].txt after.txt I get no output, suggesting nothing had happened.

1 Like

Is the USB device recognized in other computers / OSes (like a live Linux distro)? You don’t want to debug a dead USB chip.

1 Like

The USB port on chromebook works fine. The arduino micro is not recognized by Linux for some avrdude butterfly problem that I am trying to sort. I don’t have a Windows to try the board…

1 Like

systemctl status ModemManager.service solved the issue on Linux. Arduino IDE loaded a sketch on Arduino micro on this platform, so the board is fine

1 Like

So what is the status of this now? I take it you have verified the Arduino Micro is working, and that the USB on the Chromebook is working.

Looking at that #crostini-usb-allow flag thingy, you might be interested in this blog post, which mentions Arduinos are working on v86.0.4208.0 of ChromeOS… after adding your user to the dialout group and restarting/re-login.