amperka / ino

Command line toolkit for working with Arduino hardware
http://inotool.org
MIT License
1.08k stars 232 forks source link

Arduino Leonardo clone (Pro Micro) fails to reset and upload from Raspberry Pi #271

Closed paulr4 closed 8 years ago

paulr4 commented 8 years ago

I'm trying to program an Arduino Pro Micro (Leonardo based) from a Raspberry Pi. I've taken the following steps but haven't yet succeeded in uploading anything using ino, or anything else.

I've read about similar problems but no solution I've found has worked for me. Writing my own Python script to connect and disconnect at 1200 baud does not reset my Arduino. I've tried this patch, as suggested on another thread with a similar problem. No change. The same Arduino resets as expected when programming from Windows, using the Leonardo settings, so I'm confident the hardware is not at fault.

paulr4 commented 8 years ago

I discovered two problems:

A process running on my machine which was blocking access to the port and causing the crash, this is fixed now, so upload.py runs to completion.

The patch linked above uses the deprecated setBaudrate(1200) command, so I've changed it to ser.baudrate = 1200 instead.

It's still not working though. The code runs, waits for the reset, then attempts to run AVRDude, but the Arduino has not been reset into bootloader mode, so it can't connect, and returns:

Connecting to programmer: .avrdude: butterfly_recv(): programmer is not responding

paulr4 commented 8 years ago

I think I've located the problem to another service running on my Pi with access to the serial port. Ino didn't warn of any conflicts, but closing the service allowed it to upload correctly. I'll close this case.