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
d-diot images below v.1.4
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
d-diot image v.1.4 and above
Set the jumper 4 fo the DIP switch to ON and the jumpers 3 and 5 to OFF.
Upload
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.
d-diot images below v.1.4
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