n-wach / camino

A library for controlling an Arduino from Python over Serial
MIT License
16 stars 3 forks source link

Camino on Arduino MICRO #16

Open Michal259 opened 3 months ago

Michal259 commented 3 months ago

Hey, Nathan,

Thank you for your Camino software. I used it on an Arduino UNO R3 and it worked great. I then tried Camino on the Arduino MICRO but encountered problems:

  1. The test program Test.ino could not be compiled. Changing the PORT = 1 value in Camino.h helped. The program compiled and could be loaded into the Arduino.
  2. In Python but in the line: arduino = Arduino(serial), it prints an error: "Got error on communication attempt 1/3: Nothing sent when a response was expected." I have not yet been able to figure out the error. My machine is running Linux Mint. I am using Arduino IDE 2.3.2 and for Python IDLE Shell 3.10.12. Do you know any way to fix this problem?

Thank you for your time and willingness.

n-wach commented 3 months ago

Hey! Glad you've found Camino useful :)

I don't have a Micro, so I won't be able to test... But glancing at the Arduino Micro website, I see the following:

Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data using the ATmega32U4 hardware serial capability. Note that on the Micro, the Serial class refers to USB (CDC) communication; for TTL serial on pins 0 and 1, use the Serial1 class.

Camino uses TTL serial, so it won't be able to work through the USB port on an Arduino Micro. Instead, it sounds like TTL is offered through the Serial1 interface. This explains why setting PORT = 1 let it compile.

Now, most people connect to an Arduino using the USB port. For the Micro, you'll need to connect to the TTL interface on ports 0 and 1. Searching online, I see quite a few cheap USB to TTL UART converter modules online (here's one from adafruit)--those might be what you need? Make sure you change the Python port from the port you uploaded to in the Arduino IDE, to the port of the TTL converter

Let me know if you have any luck!

Michal259 commented 3 months ago

Hey, Nathan, Thank you for your helpfulness, prompt reply and good advice. It works! :) I used a USB to TTL converter that I had at home. I connected it to the RX and TX pins on the Arduino MICRO and it works great.

Have a nice day.

Michal Slovak Republic

n-wach commented 3 months ago

Awesome! I'll keep this issue open in case it helps anyone else using Camino with Arduino Micro, as the default setup does not work