how_to:atmega2560:upload_a_sketch

Upload a sketch using arduino-mk

Follow this steps to test the compile and upload process with the test.ino sketch. If you wont to upload a custom sketch, simply delete the test.ino sketch and copy your own sketch (.ino) in the /home/pi/atmega2560/arduino-mk directory using samba or any other suitable method.

Compile the sketch

pi@d-diot:~ $ cd /home/pi/atmega2560/arduino-mk
pi@d-diot:/home/pi/atmega2560/arduino-mk $ make

Stop Home Assistant if the RFLink is configured.

pi@d-diot:/home/pi/atmega2560/arduino-mk $ sudo systemctl stop home-assistant@homeassistant

Stop mysensors nrf24 process and then set the jumper JP2 to RST position, bridging the P33 and RST pin.

pi@d-diot:/home/pi/atmega2560/arduino-mk $ sudo killall mysgw-nrf24

Set the jumper 4 fo the DIP switch to ON and the jumpers 3 and 5 to OFF.

Upload the sketch

pi@d-diot:/home/pi/atmega2560/arduino-mk $ make upload

If nothing goes wrong your sketch should be uploaded to the ATmega2560. If the autoreset is correctly configured, you should see “done with autoreset - ignore Broken pipe errors if Done uploading” in the output.

Set the jumper JP2 to IRQ bridging the P33 and IRQ pin, restart MySensors nrf24 gateway and Home Assistant.

pi@d-diot:/home/pi/atmega2560/arduino-mk $ sudo /home/pi/MySensors/nrf24/bin/./mysgw-nrf24 >/dev/null 2>&1 &
pi@d-diot:/home/pi/atmega2560/arduino-mk $ sudo systemctl start home-assistant@homeassistant

Set the jumper 4 fo the DIP switch to OFF and restart home assistant

pi@d-diot:/home/pi/atmega2560/arduino-mk $ sudo systemctl start home-assistant@homeassistant

  • how_to/atmega2560/upload_a_sketch.txt
  • Last modified: 2020/07/26 15:10
  • by franzunix