Uploading from debian terminal with AVRdude wont work

Hello Everyone,

My latest project is a project where i need the project to update itself because i have a hard time accessing it later.
The project consists of a raspberry PI, Controllino (industrial arduino mega2560) and a 4G router.
This combination makes a webcontrolled project where the Controllino does all the heavy switching.
The Raspberry Pi hosts a webserver, and a backend.

Now what i already have is that the webserver automatically deploys from github over ssh.
what i want is that my controllino also gets updated when a new commit in the github master branch is done.
For this i use a shell script in my Raspberry PI.
The Raspberry Pi downloads the latest arduino code from my github, and should upload the .hex file from this project into the Controllino.

After a lot of research it seems AVRdude is the way to go because the Raspberry Pi runs a Debian server without graphical interface, so running arduino isn't possible.
I already made sure that i have access to my ttyACM0 port by reading the serial data from the Controllino (by that i don't know if i have write permission, but i set the permission for ttyACM0 to 777 at this moment until i got it working).
The Controllino (or arduino mega2560) is connected to the Raspberry Pi over USB.

The commands i tried to run to upload to the Controllino or a arduino mega2560:
avrdude -v -p atmega2560 -c arduino -P /dev/ttyACM0 -U flash:w:/myarduinoproject.ino.hex
which results in:
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00

and:
avrdude -v -p m2560 -c stk500 -P /dev/ttyACM0 -D -U flash:w:/myarduinoproject.ino.hex
which results in:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout

i tried alot more versions of this command, but with no luck.
For some reason it wont communicate to my arduino mega2560 or Controllino mega unfortunaly.
Is anybody experienced with this problem?
Or any suggestions that might help me, im struggling with this problem already some evenings.

Thank you in advance,

Jelle

On Debian there is a group dialout which allows users to access serial devices.

Make sure that your user is in this group with the $ groups command.

If this is not the case use $ sudo usermod -a -G dialout <user> to add the user to the dialout group.

Please note that all active sessions are not able to see this change of groups for your user so you can either relogin or use $ su - <user> to establish a new login session.

A note on using stk500, I once also used stk500 and it only worked with either setting the baudrate with -b or the bitclock with -B. Please consult the man page ($ man avrdude) for a more thorough explanation.

Thank you #blafoo, i added myself to the dialout, and now the upload is working fine :smiley:
Cheers!!!

Great, glad I could help :wink:

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.