Hello to all. I am making the transition from the Arduino IDE to CLI and would appreciate help.
I have successfully built sketches including downloaded and my own libraries.
to compile, I use a script file containing:
arduino-cli compile -b arduino:avr:mini /home/walt/Arduino/robot
to upload, I use a second script file containing:
arduino-cli upload -p /dev/ttyUSB0 -b arduino:avr:mini /home/walt/Arduino/robot
for debugging with Serial.print(), I open a second monitor window and initiate a terminal session with:
sudo putty /dev/ttyUSB0 -serial -sercfg 9600,8,n,1,N
The script files are very convenient for the repetitive and error prone command entry. However, I am having a couple of issues with this process:
- Although I have both Serial.begin(9600) and Serial.end() in my setup() routine, I am unable to upload any revisions after a test run until I completely close the terminal window. I would like to have the terminal window continually available like the serial monitor in the IDE.
When the uploads fail, I see this message:
avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x00
avrdude: stk500_initialize(): (a) protocol error, expect=0x14, resp=0x00
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
After closing the terminal window, the uploads are successful.
- When executing both the compile and upload steps from the two script files, I get the short confirmation message after compiling but nothing after uploading unless the upload fails when I get the error message above. When I execute the upload directly in a command line, I do get a short confirmation message. I'm curious about what the difference is.
Any suggestions with respect to these two problems or suggestions on how to better manage the workflow would be appreciated.