Go Down

Topic: using CLI (Read 619 times) previous topic - next topic

darknain

Hello, I have installed arduino IDE and curie core to use my arduino 101. Everything works correctly, however I would like to use only CLI. I would like to be able to upload sketches easily with CLI.
I have found this : https://github.com/arduino/Arduino/blob/master/build/shared/manpage.adoc

I don't know how to use the command :
arduino --board arduino:avr:nano:cpu=atmega168 --port /dev/ttyACM0 --upload /path/to/sketch/sketch.ino

What should I use instead of nano and instead of atmega168 ?
/path/to/sketch/sketch.ino needs to be replace by home/user/arduino/myprogram.ino ?

When I use this command it opens arduino IDE but this arduino IDE doesn't contain the curie core and the board manager.

Thanks

pert

What should I use instead of nano and instead of atmega168 ?
Intel:arc32:arduino_101

The easiest way to determine the fqbn of a board is:
  • Start the Arduino IDE GUI (Yes, I know you are dead set on using the CLI only but it really won't hurt too badly to use the GUI every once in a while)
  • File > New
  • File > Preferences > Show verbose output during: > compilation (check) > OK
  • Select the board from the Tools > Board menu
  • If there are additional configurations of the board necessary, select those from the appropriate Tools menus
  • Sketch > Verify/compile

After the compilation finishes scroll up to the top of the black console window at the bottom of the Arduino IDE window. You will see a command that looks something like this:
Code: [Select]
C:\Program Files (x86)\ArduinoIDE\arduino-1.8.5\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\ArduinoIDE\arduino-1.8.5\hardware -hardware C:\Users\per\AppData\Local\Arduino15\packages -hardware E:\electronics\arduino\hardware -tools C:\Program Files (x86)\ArduinoIDE\arduino-1.8.5\tools-builder -tools C:\Program Files (x86)\ArduinoIDE\arduino-1.8.5\hardware\tools\avr -tools C:\Users\per\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\ArduinoIDE\arduino-1.8.5\libraries -libraries E:\electronics\arduino\libraries -fqbn=Intel:arc32:arduino_101 -vid-pid=0X2341_0X0042 -ide-version=10805 -build-path C:\Users\per\AppData\Local\Temp\arduino_build_111246 -warnings=all -build-cache C:\Users\per\AppData\Local\Temp\arduino_cache_567017 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arc-elf32.path=C:\Users\per\AppData\Local\Arduino15\packages\Intel\tools\arc-elf32\1.6.9+1.0.1 -prefs=runtime.tools.arduino101load.path=C:\Users\per\AppData\Local\Arduino15\packages\Intel\tools\arduino101load\2.0.1 -prefs=runtime.tools.dfu-util.path=C:\Users\per\AppData\Local\Arduino15\packages\arduino\tools\dfu-util\0.9.0-arduino1 -prefs=runtime.tools.openocd.path=C:\Users\per\AppData\Local\Arduino15\packages\Intel\tools\openocd\0.9.0+0.1 -prefs=runtime.tools.flashpack.path=C:\Users\per\AppData\Local\Arduino15\packages\Intel\tools\flashpack\2.0.0 -verbose C:\Users\per\AppData\Local\Temp\untitled169196134.tmp\sketch_mar26b\sketch_mar26b.ino

You will find the fqbn of the board you had selected somewhere in that command.

/path/to/sketch/sketch.ino needs to be replace by home/user/arduino/myprogram.ino ?
If that's where your sketch is.

When I use this command it opens arduino IDE but this arduino IDE doesn't contain the curie core
That's because the Arduino IDE only comes with Arduino AVR Boards hardware package installed. You need to install any additional packages you want to use. You can install Intel Curie Boards from the CLI like this:
Code: [Select]
arduino --install-boards Intel:arc32

and the board manager.
What do you mean by that? Are you using the latest version of the Arduino IDE (1.8.5) downloaded from http://www.arduino.cc/en/Main/Software?

darknain

#2
Mar 26, 2018, 04:14 pm Last Edit: Mar 26, 2018, 05:13 pm by darknain
Thanks for all your answers
I am on Ubuntu.

I think I know where my problem comes from when I installed the intel curie board it was on a portable arduino version.
If I install arduino using "sudo ./arduino.sh" when I use : "arduino --install-boards Intel:arc32", it tells me that the arduino software isn't installed and to use "sudo apt install arduino".

But if I use "sudo apt install arduino" it will install an old arduino version 1.0.5
How can I have a clean arduino installation to use CLI ?

pert

Definitely don't ever install Arduino IDE via sudo apt install arduino. I'm guessing there is something like sudo apt uninstall arduino? Run that to get rid of that super outdated 1.0.5 and then download the real Arduino IDE from http://www.arduino.cc/en/Main/Software and use that version instead.

darknain

#4
Mar 27, 2018, 10:31 am Last Edit: Mar 28, 2018, 02:32 pm by darknain
Yeah I uninstalled the outdated version and I downloaded the last one.

I have solved the first issue, by doing the installation with ./install.sh and rebooting with installation manager, now the computer thinks arduino is installed and i can use the CLI

For the second issue, the library were downloaded using a "sudo ./arduino" which means i can only access them with sudo, so I deleted the folder where is package_index.json and I could redownload it


Now I can run arduino without using sudo, i have access the intel curie core library.

Do you know if there is a way of using makefile with the arduino 101 ?
I found this : https://mithatkonar.com/blog/2015/02/22/battle-of-the-arduino-makefiles/
But it's only for others boards than 101

Go Up