The given repository is a workflow for building and uploading the original firmware of the Andino X1 (https://andino.shop) from the Raspberry Pi section directly to the Arduino part without using the external USB Port.
I've got the Andino for a smart home project to remote control the heating of a vacation home and to monitor it in the winter. Due to the fact that I'm not having the time to develop the software fully in advance I wanted to install the device first and do the development remotly. This means everything has to work from the commandline without plugging cables around.
To compile and upload the firmware in the shell some adaptions had to made. The part of manual of the Andino X1 that covers the Arduino programming is quite weak. It suggests using ino (https://pypi.org/project/ino/) (http://inotool.org/quickstart) and avr dude to upload the already compiled code.
The source code did only compile in the IDE but not in the shell, whether with INO nor with the Arduino-Makefile due to the fact that the IDE does some pre processing on the code. The firmware does not have any function prototypes. These had to be added manualy (I'm sure there is somewhere a nice tool which does it)
The Andino communicates from thr Raspberry to the Arduino and vice versa thru the serial device /dev/ttyAMA0
This UART uses GPIO 14 and 15 of the Pi. It doesnt provide the DTR line to toggle the reset to enter the bootloader like the FTDI chip does which is used for the USB connection.
Fortunately the reset could be done via GPIO 18 and the Arduino-Makefile provides the RESET_CMD
variable that could be loaded with a script to toggle the pin.
- Arduino-Makefile (https://github.com/sudar/Arduino-Makefile)
- Arduino IDE (tested with 1.8.12)
All variables in the Makefile are suited to the needs of the Andino basic firmware with added prototypes. My architecture is the atmega 328. Maybe you have to choose the 168. Ensure that the Arduino-Makefile has been installed properly and all variables are set.
The reset.py
will do the reset for you.
Normaly it should work by hitting make
and make upload