
In the world of Arduino, there is its own, written in java, IDE, quite a Spartan look, without text highlighting and auto-completion! Its main functions are the assembly of the program and the download. Compilation is carried out through avr-gcc, and loading in MK through avrdude. After several months of use, I decided to look for an alternative, since I periodically managed to load the Arduino IDE 100% of the processor or just fly out! Having checked the results of the search engine, I was a little disappointed, there are no particular alternatives for linux, except for the console
ino . Well, perhaps the console client is enough for us, let's get started ...
Let's take the development environment:
Geany is an easy and convenient cross-platform editor, with the ability to fasten your scripts, having a built-in console and easily extendable through plug-ins. Further, all actions will be performed on the debian / ubuntu x86-64 system.
1. Install ino, geany and its plugins:
$ sudo apt-get install geany geany-plugins pip picocom
$ sudo pip install ino
2. Proceed to setting up ino. For her work, you need a folder with the original arduino ide, preferably a stable version 1.0.5. With the beta versions, it did not work for me, since they changed the logic of the location of the libraries and manual adjustment did not lead to success, so I stopped at version 1.0.5. It is necessary to download and unpack it in any convenient directory. I will have the root directory of the user / home / user /. Ino mainly uses 4 commands:
')
- ino init - creates a folder structure for the project, you need to perform in an empty directory
- ino build -d / path_to_directory_arduino_ide - compiles the project
- ino upload - uploads the project to the MC
- ino clean - cleaning the results of the previous build
I advise you to create a minimum configuration file for ino with a description of your arduino board and a serial port to work with it:
$ cat ~/.inorc
[build]
board-model = uno
[upload]
board-model = uno
serial-port = / dev / ttyACM0
[serial]
serial-port = / dev / ttyACM0
3. We proceed to the easy configuration of Geany and its combination with arduino.
Everyone can connect the necessary plug-ins at their discretion. This is done in two mouse clicks through tools → module manager.
Let's change the standard theme to the dark + code highlighting patterns:
$ wget http://geany-dark-scheme.googlecode.com/files/geany_dark_filedefs_20100304_190847.zip /tmp/
$ mkdir ~/.config/geany/geany_dark_filedefs && unzip /tmp/geany_dark_filedefs_20100304_190847.zip -d ~/.config/geany/geany_dark_filedefs/
$ rm -r ~/.config/geany/filedefs && ln -s ~/.config/geany/geany_dark_filedefs/ ~/.config/geany/filedefs
Then you can run Geany, it will be with a new dark theme. Go to Tools → settings files → filetype_extensions.conf and add * .ino to the end of the line with C ++ so that the files of the arduino projects open with C ++ style code highlighting. If you wish, you can customize the highlighting of the code for yourself ~ / .config / geany / geany_dark_filedefs / filetypes.cpp. Unfortunately, I did not find a ready-made snippets (autocomplete) file under arduino. Specific functions, again, anyone can make and publish.
An example of adding snippetsTools → configuration files → snippets.conf add the following line to the C ++ section
Serial=Serial.print(%cursor%);
4. Configure the build of the Arduino project in Geany:
Build → Install Build Commands- Compile -
cd .. && ino build -d /home/user/arduino-1.0.5 && find . -name 'firmware.hex' ! -path './.build/uno/*' -print -exec cp -f {} .build/uno \;
cd .. && ino build -d /home/user/arduino-1.0.5 && find . -name 'firmware.hex' ! -path './.build/uno/*' -print -exec cp -f {} .build/uno \;
- Download in MK -
cd .. && ino upload
- Full build -
cd .. && ino clean && ino build -d /home/user/arduino-1.0.5 && mkdir .build/uno && find . -name 'firmware.hex' ! -path './.build/uno/*' -print -exec cp -f {} .build/uno \;
cd .. && ino clean && ino build -d /home/user/arduino-1.0.5 && mkdir .build/uno && find . -name 'firmware.hex' ! -path './.build/uno/*' -print -exec cp -f {} .build/uno \;
- Run -
ino serial
These commands have a bit of magic associated with the ino feature. Namely, after ino builds, it creates the folder ./build/name_MK_random_number, and when loading it into the MC, it searches for it in the folder//build/name_MK. Perhaps, these moments can be corrected with flags for ino or settings in the config, I did not particularly look for it, I did it through bash.
To create a new project, you must first create a folder through the console, go into it and execute ino init. Further, already through geany, you can create a project file (or open the default created sketch.ino). At the first build you need to execute the “Complete build” command, then you can already use “Compile”. In principle, that's all. Everything works perfectly, and if there is a desire, geany can be fully customized. Recorded a small video of work for clarity.
Note: ino has a bug with parsing the wifi library, which is included in the standard delivery of arduino ide. Before running ino -d / path, remove it from the / libraries directory.
Materials used for the article: