28 de febrero de 2023

How to Compile and Upload .ino file to Arduino board in Rpi Linux Shell


I have a system composed by RpiB+ and Arduino Uno board working together, monitoring parameters, triggering reles, storing data into MariaDB and presenting with apache2 webserver.

When I have to change arduino program I have to open vnc session, execute arduino-ide, edit sketch, compile and upload to arduino board !!, ... painful due limited resources o my old RpiB+.

Thus, can I compile and upload and .ino file from rpi linux shell ??

Yes, and very ease.

 

Protocol:

Install arduino, if not installed already:

# aptitude install arduino

Compile and upload Shell command:

$ arduino --upload yourfile.ino --port yourArduinoport

 

Example:

$ arduino --upload example.ino --port /dev/ttyACM0

Picked up JAVA_TOOL_OPTIONS:
Cargando configuración...
Inicializando paquetes...
Preparando tarjetas...
Verficando...
...
El Sketch usa 16464 bytes (51%) del espacio de almacenamiento de programa. El máximo es 32256 bytes.
Las variables Globales usan 754 bytes (36%) de la memoria dinámica, dejando 1294 bytes para las variables locales. El máximo es 2048 bytes.
Subiendo...
...

I can also modify the .ino sketches with nano, compile and upload them to arduino from shell, without need any graphical environment.

Ref.:
https://arduino.stackexchange.com/questions/15893/how-to-compile-upload-and-monitor-via-the-linux-command-line

No hay comentarios:

Publicar un comentario