Downloading, Building and Deploying the Firmware

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Llwy
Posts: 34
Joined: Thu Mar 10, 2016 7:43 am

Re: Downloading, Building and Deploying the Firmware

Post by Llwy » Thu Mar 10, 2016 7:52 am

Hello,
Sorry for then newbie question.
I succesfully followed the instructions and compiled both the sdk and the esp8266 micropython firmware last weekend.
Today, I performed a "git pull" on the micropython folder and the "make" command failed with the following error:

Code: Select all

In file included from main.c:39:0:
/home/vagrant/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/include/user_interface.h:11:26: fatal error: lwip/ip_addr.h: No such file or directory
 #include "lwip/ip_addr.h"
Did I forget to update something else? Did I do something wrong?

Best regards, and thanks a lot to everyone, especially Paul and David!

Llwy

SpotlightKid
Posts: 377
Joined: Wed Apr 08, 2015 5:19 am

Re: Downloading, Building and Deploying the Firmware

Post by SpotlightKid » Thu Mar 10, 2016 8:15 am

As mentioned before, you need to do "git submodule update --init" after the git pull.

I've also described this in the documentation update PR I mentioned above.

Llwy
Posts: 34
Joined: Thu Mar 10, 2016 7:43 am

Re: Downloading, Building and Deploying the Firmware

Post by Llwy » Thu Mar 10, 2016 6:22 pm

Sorry, I forgot to write that I did perform the "git submodule update --init" before the "make" command and still obtained the same error.

Llwy

mad474
Posts: 60
Joined: Sun Dec 29, 2013 7:48 pm

Re: Downloading, Building and Deploying the Firmware

Post by mad474 » Thu Mar 10, 2016 8:55 pm

Llwy wrote:Sorry, I forgot
You'll also have to rebuild the toolchain (esp-open-sdk) again. There were recent changes. I'd keep a constant eye on that.

Llwy
Posts: 34
Joined: Thu Mar 10, 2016 7:43 am

Re: Downloading, Building and Deploying the Firmware

Post by Llwy » Thu Mar 10, 2016 10:09 pm

You'll also have to rebuild the toolchain (esp-open-sdk) again. There were recent changes. I'd keep a constant eye on that.
Thank you very much.
That fixed it! I did not realize that the SDK too needed updating on a regular basis.

Llwy

gojimmypi
Posts: 36
Joined: Wed Mar 02, 2016 8:01 pm
Contact:

Re: Downloading, Building and Deploying the Firmware

Post by gojimmypi » Wed Mar 23, 2016 5:29 pm

Once the firmware is uploaded following command will connect to micropython on the ESP board and give you the REPL prompt :

Code: Select all

sudo screen /dev/ttyUSB0 115200
To exit:

Code: Select all

CTRL-A CTRL-D
this was really helpful, thanks! (I was leaving off the 115200 param, and wondering why it would not connect, D'oh).

also - note that Ctrl-A, Ctrl-D is not really "exit". It is "Detach". This allows you to later re-attach via

Code: Select all

screen -r
I only noticed that when I was unable to later attempt to connect with minicom as it said

Code: Select all

minicom: cannot open /dev/ttyUSB0: Device or resource busy
although sometimes I'll get the "resource" busy message for minicom and "screen -r" says "There is no screen to be resumed." and when connecting with a new screen command, the device is unresponsive... so it is time to remove the USB and power cycle the ESP8266 to reconnect.

In my case, I'm uploading a file, then attempting to play with it interactively from my Rpi:

Code: Select all

python pyboard.py --device /dev/ttyUSB0 myI2C.py
screen /dev/ttyUSB0 115200
thus if the screen is left "detached" with Ctrl-A Ctrl D, I am unable to later then re-run the pyboard.py to upload something fresh.

As for minicom, note that the fresh install for me had "hardware control" set to "Y" which left my ESP8266 in a state of appearing to be unresponsive. See http://www.tldp.org/HOWTO/Remote-Serial ... nicom.html for me this was Ctrl-A Z (not Ctrl-A Ctrl-Z) then press "O", and select "Serial port setup", then turn off hardware flow control. Minicom config should look like this:

Code: Select all

Welcome to minicom 2.6.1

OPTIONS: I18n
Compiled on Apr 28 2012, 19:24:31.
Port /dev/ttyUSB0

Press CTRL-A Z for help on special keys

    +-----------------------------------------------------------------------+
    | A -    Serial Device      : /dev/ttyUSB0                              |
    | B - Lockfile Location     : /var/lock                                 |
    | C -   Callin Program      :                                           |
    | D -  Callout Program      :                                           |
    | E -    Bps/Par/Bits       : 115200 8N1                                |
    | F - Hardware Flow Control : No                                        |
>>> | G - Software Flow Control : No                                        |
>>> |                                                                       |
>>> |    Change which setting?                                              |
    +-----------------------------------------------------------------------+
Software flow control *does* seem to work - only hardware control seems to be problematic. So if experiencing problems when pasting large chucks of text (e.g. via putty, as in my case) try experimenting with that setting.

User avatar
deshipu
Posts: 1346
Joined: Thu May 28, 2015 5:54 pm

Re: Downloading, Building and Deploying the Firmware

Post by deshipu » Wed Mar 23, 2016 11:48 pm

To exit screen, use "ctrl+a ctrl+k" or "ctrl+a ctrl+K" (the latter if you don't want a confirmation question).

gojimmypi
Posts: 36
Joined: Wed Mar 02, 2016 8:01 pm
Contact:

Re: Downloading, Building and Deploying the Firmware

Post by gojimmypi » Wed Mar 30, 2016 8:01 pm

bill wrote:Could someone please outline the process of downloading, building then deploying the firmware for a beginner?

There are probably a lot of people like me that have used the Arduino IDE to program the Huzzah/ESP8266 but would like to begin to learn how to install the MicroPython firmware in preparation for future releases.
I put together some instructions on building MicroPython on a Raspberry Pi (likely also works on similar debian distros)

http://forum.micropython.org/viewtopic. ... 9769#p9769

Post Reply