Upload Arduino sketch from Raspberrypi to RPICT

From lechacal
Jump to navigation Jump to search

This article will guide you to upload an Arduino sketch form teh raspberrypi directly to the RPICT units.

Prerequisite

This only works with RPICT units having an atmega328p chip and with autoreset support.

Suitable units are any RPICT version 5.

This won't work with any RPICT unit version 3 and RPICT3V1/RPICT3T1.

The atmega328p chip must have bootloader enabled. If not then the bootloader should be burnt with the NanoProg first.


Installation

First of all install avrdude.

sudo apt-get install avrdude

Get the package from our server.

wget lechacal.com/RPICT/tools/lcl-upload-sketch.zip

deflate the file.

unzip lcl-upload-sketch.zip

get inside.

cd lcl-upload-sketch

run the installation script.

./install.sh

Operation

Open your sketch with the Arduino IDE. (This might be on a separate computer, not necessarily on the Raspberrypi).

Run Sketch | Verify/Compile.

This creates a file in the temporary directory.
On a linux system this is inside /tmp/arduino_build_xxxxxx.
On windows this could be somewhere like C:\Users\user\AppData\Local\Temp\build4436557367508469592.tmp

If your sketch is named sketch then take the sketch.ino.hex file and copy it over to the raspberrypi.

Upload the file to the RPICT units using the command below:

lcl-upload-sketch.sh sketch.ino.hex

Credits

Credits go to the SpellFoundry on Github who has well inspired this.