Owning one of the newer MacBooks that were designed for bad typing experience, noisy fans and port(un)availability I was facing unusual challenges. Also due to the fact I fried one of my ports once before I became rather cautious about this device and using off-brand-adapters.
Having that challenge combined with the assumption, we would work on that project in a group setting and would need to collaborate, I followed a different approach from the beginning.
"The future is wireless"
Knowing there are indeed wireless-capable Arduino's and other microchips out there which would work straight out of the box with the IDE, it was even more tempting to achieve the same with a tethered Arduino. Of course calling solutions like this (or even wireless charging) "wireless" is doubtful as we are just creating another intermediary and moving the cable away from the laptop - but hey, it is not in my way anymore and I can start the hardware prototyping in a dedicated place without restraint.
- Everyone in the group work needs access and can participate to the code, without getting out of sync, without much plugging around across different computers or being dependant on internet connection in a physical place (e.g. when using GitHub).
- It had to be wireless - I am using VS Code for pretty much everything and didn't want the dependancy on Arduino IDE and sticking the device straight to my computer, generate too much clutter on my table and eventually might damage something
- Make sure, SSH is enabled (Raspbian not default, ARMbian by default)
- SSH into your Pi by using Visual Studio Code
- VS Code server will be installed on your current user
- Compiling is done on the Pi, so no Arduino IDE needed on your computer
- There are useful Arduino and Arduino-snippet addons for VS code though
Quick start - Ino 0.3 documentation
Learn how to work with ino in few minutes. Let's create a simple project: $ mkdir beep $ cd beep $ ino init -t blink Here we've created a new directory for our project and initialized project skeleton with command. We chose to use blink as a project template.
Warning! Inotool is deprecated and no longer maintained. But you can still install it - I personally still use it for the "serial" command I gotta explain later in this post.
sudo ino build && sudo ino upload && sudo ino serial
I started with this setup before the actual course. During the course I was realizing that the setup was not working flawlessly.
When starting to find the reason for that, I soon found that the used Arduino IDE version used for compiling was 1.0.5 and thus showed incompatibilities with different libraries, compiler errors that were related to the code in the first place, but then turned out to be compiler-related.
Although I knew, Inotool was deprecated I somehow still expected it to be using the version of Arduino I installed.
For the sake of replacing the Arduino IDE (and now the Inotool CLI), I tried yet another approach a friend told me about.
After a certain amount if tinkering around however it turned out to be out of scope for now.
PlatformIO itself, although (or maybe that's why) it is advertised as the tool for everything, whatever I was trying to achieve seemed very complicated. But with more NodeMCUs and other stuff arriving in the next weeks I might get back to it very soon.
PlatformIO is a new generation ecosystem for embedded development
Open source, cross-platform IDE and Unified Debugger. Static Code Analyzer and Remote Unit Testing. Multi-platform and Multi-architecture Build System. Firmware File Explorer and Memory Inspection.
arduino-cli compile --fqbn arduino:avr:uno
arduino-cli compile --fqbn arduino:avr:uno
This will solve the problem for now, without the need to use "sudo" for uploading (which would not even work, as the cli is installed in your user's directory.
sudo chmod a+rw /dev/ttyUSB0
I did not figure out a way to get the serial communication to run with the arduino-cli, so I will stick to Ino for now
sudo ino serial
Escape hatch from the serial display: Ctrl + A X (Keep holding Ctrl and press the buttons in a row to end the pipicom serial viewer
Good coders are lazy coders, we learned in the programming bootcamp back in year one.
When you are working in production mode and just want it to compile, run and output, this is the command to go for 🎉
arduino-cli compile --fqbn arduino:avr:uno && arduino-cli upload --fqbn arduino:avr:uno --port /dev/ttyUSB0 && sudo ino serial
Despite the lack of feature parity at the moment, Arduino CLI provides many of the features you can find in the Arduino IDE. Let's see some examples. arduino-cli is a container of commands and each command has its own dedicated help text that can be shown with the help command like this: Arduino CLI doesn't strictly require a configuration file to work because the command line interface provides any possible functionality.
Using the Arduino Command Line Interface
For users who prefer to use their own text editor, there is a command line interface version of the Arduino. "arduino-cli is an all-in-one solution that provides builder, boards/library manager, uploader, discovery and many other tools needed to use any Arduino compatible board and platforms." It allows you to work with your favorite text editor, and to program in a text-only mode.
When I started using a variety of
Just wanted to share that - maybe interesting for some students but also less straight-forward to set it up initially than just plugging it into the local machine. In any case for me it worked better for embedded testing without the need to directly plug the computer to where the Arduino environment might be.