Members | Sign In
Legacy MOVI User Community Forum (readonly) > Non-Arduino MOVI
avatar

Huzzah ESP8266

posted Jan 15, 2016 19:31:59 by prdatur
Hello,

I use the shield with a Huzzah ESP8266 microcontroller. In order to get this to work I needed to change the library for correct usage of Serial interface.

I forked the original library and made the changes. Also all required wiring instructions I added to the readme.
Here is the fork with working library for Huzzah ESP8266.
https://github.com/prdatur/MOVIArduinoAPI
page   1
7 replies
avatar
GeraldFriedland said Jan 17, 2016 03:31:10
Congratulations! Nice work!

Quick question: Does the Huzzah board set a #define to identify itself while compiling? If so we could unify the branches and just add your changes in between #ifdefs.

Also: Since Huzzah uses a hardware UART, would it make sense to up the bitrate for the communication between MOVI and the board in this case? 9600bps is quite slow but we were forced to do this for Arduino UNO. Upping the bitrate requires a firmware patch but I was thinking about that for a long time, so if it makes sense we may be able to put it into the next update.
avatar
prdatur said Jan 17, 2016 11:22:27
Possible I think,
The core library does not explicit define a special string but we could use:
#ifdef ESP_H
Serial.println("ESP DEFINIED");
#endif

THe ESP header file should only be loaded when we really have a ESP8266 board or when we need to be more specific checking for "ESP8266_PERI_H_INCLUDED".

Yes bitrate can be made higher. To programm the board it requires a bitrate of 115200 so anything less or equal should be not a problem.
avatar
GeraldFriedland said Jan 19, 2016 16:55:01
Cool, I added the bitrate change command to my list. I basically just needed a reason ;-)

I'll take a look at possibly merging the branches. I want to find a way to not obfuscate the code with too many #ifdefs as it'll become unreadable/unmaintainable in the future. Btw.: If you add your name, email, or handle to your code then people will know who to credit for the additions.
[Last edited Jan 19, 2016 16:55:42]
avatar
Alex C said Apr 05, 2016 04:52:04
I have a bare ESP8266 (ESP-12E) module and can confirm that it works fine at 115200bps which is its default rate.
For that matter, with my USB to serial converter it also works reliably at 500000bps which is the rate I normally use to upload large sketches, and could handle even faster rates if the UARTs on both the Huzzah and Movi can handle it too.
avatar
Alex C said Apr 07, 2016 04:47:28
I've been playing with the esp-12e and got it working with Movi by setting the baud rate to 9600, if I understand correctly, the updated library with ESP support at 115200 needs to be compiled before that rate can be used?

I was able to assign arbitrary pins for the communication between the esp and Movi, I picked GPIO4 and GPIO14, wired to Movi's pins D10 and D11 respectively. This allows me to keep the ESP's default TX/RX pins free to communicate with the PC and upload new sketches.
Any GPIO pin should work, although the "dual purpose" pins #0, 2, 15 and 16 should be avoided as they could inadvertently end up being driven high/low while the ESP is being reset, causing unexpected results.

As using the dwfault library I couldn't get the serial communication with Movi to work above 9600, in the LowLevelInterface.ino sketch I split the
int baudrate=9600;

into two variables with 9600 for the mySerial.begin() of the Movi <> ESP side, and 115200 for the Serial.begin() of the PC <> ESP side, which works, but ultimately didn't do me any good as the HELP commands didn't print any faster since it gets the output from Movi... D'oh!

avatar
fractor@audeme.com said Apr 08, 2016 04:13:07
Unfortunately, MOVI doesn't have an option to change the baud rate yet. This would be a firmware update. So at this point it's 9600 bps. I will take a look on how to implement this so that people can't mess this up...


avatar
GeraldFriedland said Apr 17, 2016 14:32:58
Update on this: I just implemented this functionality in the MOVI 1.1 firmware update. We'll push that out in a couple of weeks.
Login below to reply: