Go Down

Topic: Firmata + Arduino Leonardo clone + pyFirmata on Raspberry Pi (Read 1 time) previous topic - next topic

ordep

Hello all,

I've been searching the forums and honestly everywhere on the web hoping to find a solution to my problem.

I've built a custom Arduino Leonardo clone, using the same Atmega32u4.
With this board I'm trying to use the StandardFirmata sketch to access some pins on it, with pyFirmata on a Raspberry Pi through the hardware serial (UART).

Now, I've been able to implement this approach with an Arduino Mini successfully, so I know for a fact it can be done.
I'm aware the Leonardo is a bit different regarding Serials, and that Serial refers to the USB one and Serial1 refers to the Tx/Rx pins. What i think is that the default serial used is the USB one, instead of the UART one and I'm unable to specify the one I want using the StandardFirmata .

So my question is, do I need to specify something on the StandardFirmata sketch to be able to use the UART?

Please ask any questions if my post is still unclear.

Thank you in advance.


ordep

After a few hints from more that a few topics on similar subjects I figured what was the way to go.

First I believe its required to have the latest Firmata installed (I used version 2.3.6) for those with an Arduino IDE version 1.0.X (I used 1.0.5)

After that, there's a change needed in the StandardFirmata sketch to make it use the UART serial instead of the default USB one.

Instead of starting the Firmata object :

Code: [Select]
Firmata.begin(57600);

Rather start the UART serial communication first and pass it to the Firmata begin method after:

Code: [Select]
Serial1.begin(57600);
Firmata.begin(Serial1);


When atempting a sample test code I was finally able to blink an LED using pyFirmata through UART   XD

Hope this ends up helping someone in the future.

Go Up