Downloading, Building and Deploying the Firmware
Downloading, Building and Deploying the Firmware
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.
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.
-
- Posts: 463
- Joined: Wed Apr 08, 2015 5:19 am
Re: Downloading, Building and Deploying the Firmware
Look at the README in the esp2866 directory of the sources on Github.
Re: Downloading, Building and Deploying the Firmware
You can also try this tutorial: https://learn.adafruit.com/building-and ... e-esp8266/
Except the wifi example at the end doesn't work anymore, because things got moved around and renamed.
Except the wifi example at the end doesn't work anymore, because things got moved around and renamed.
Re: Downloading, Building and Deploying the Firmware
@Bill, yes was same for me. What is important to realize is that there are crucial steps involved before trying to compile the MicroPython code. AdaFruit has a tutorial on how to set up MicroPython on their Huzzah boards: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.
Since I'm working from Linux machines didn't find that very helpful.
For setting up the ESP SDK I've used this tutorial (steps 1-3).
This could take a while to compile (over 2 hours on my RPi3, around half an hour I think on my Ubuntu 15.04 Nuc).
Then I did a 'git clone' from Github MicroPython repo:
Code: Select all
git clone git@github.com:micropython/micropython.git
cd micropython/
git submodule update --init
On my Ubuntu box I had a collision between Python2 and Python3 (that was specific to my own setup), which I solved by simply changing the 'shebang' from the /opt/esp-open-sdk/esptool/esptool.py script to point explicitly to Python2.
After that everything ran smooth:
Code: Select all
cd esp8266/
make
make PORT=/dev/ttyUSB0 deploy
Connecting to the REPL can be done with 'screen' on Linux machines:
Code: Select all
screen /dev/ttyUSB0 115200
Re: Downloading, Building and Deploying the Firmware
hjm,
I am using a Debian Jessie 8.3 system. So I skipped the Rpi instructions in the Instuctables and started at sudo apt-get update.
That part seemed to go well.
I've got this point in your instructions:
and this is the error I got:
I have entered that line both as a user and root with no success. I do have access rights to all the files in the esp-open-sdk folder.
I'm not sure what to do next.
Thanks for your help,
Bill
I am using a Debian Jessie 8.3 system. So I skipped the Rpi instructions in the Instuctables and started at sudo apt-get update.
That part seemed to go well.
I've got this point in your instructions:
Code: Select all
git clone git@github.com:micropython/micropython.git
Code: Select all
bill@debian:/opt/esp-open-sdk$ git clone git@github.com:micropython/micropython.git
Cloning into 'micropython'...
Warning: Permanently added the RSA host key for IP address '192.30.252.130' to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I'm not sure what to do next.
Thanks for your help,
Bill
Re: Downloading, Building and Deploying the Firmware
That's the SSH URL which is only usable if you have write permissions to the micropython repo (you don't). You need to use the HTTPS URL instead, which is: https://github.com/micropython/micropython.git.bill wrote:hjm,
I've got this point in your instructions:Code: Select all
git clone git@github.com:micropython/micropython.git
So use:
Code: Select all
git clone https://github.com/micropython/micropython.git
Re: Downloading, Building and Deploying the Firmware
You'll need to build the ESP SDK first. Although written for RPi, these instructions should work for your Debian system as well.bill wrote: I am using a Debian Jessie 8.3 system. So I skipped the Rpi instructions in the Instuctables
As dhylands remarks, indeed doing it through ssh might be vulnerable for configuration issues. using the https option is more robust. Sorry, I overlooked this aspect.bill wrote: I've got this point in your instructions:Code: Select all
git clone git@github.com:micropython/micropython.git
hjm
Re: Downloading, Building and Deploying the Firmware
Please note that official documentation on how to build both esp-open-sdk and MicroPython are in their respective README files (for MicroPython, both the main README and port-specific README). If some important information is missing, feel free to suggest additions via bug tracker of the respective projects. Please mind that while it may seem that the more information is written, the better, the reality is the opposite - the more written, the less likely people will read it - either in full, or at all. Both projects have pretty long README's already, so any additions should come with strong argumentation .
All other information you find on the Internet is unofficial, oftentimes duplicate information, getting out of date quickly. Feel free to use it at your own risk (please report any issues you find while following it to their original authors, not to us). If you decide to write your own guide, as a courtesy to other users, please explicitly say that it's not official instructions, link to the official ones, and state which date/version/git revision it applies to. Thanks.
All other information you find on the Internet is unofficial, oftentimes duplicate information, getting out of date quickly. Feel free to use it at your own risk (please report any issues you find while following it to their original authors, not to us). If you decide to write your own guide, as a courtesy to other users, please explicitly say that it's not official instructions, link to the official ones, and state which date/version/git revision it applies to. Thanks.
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
-
- Posts: 463
- Joined: Wed Apr 08, 2015 5:19 am
Re: Downloading, Building and Deploying the Firmware
Just added PR #1879 to clarify the build instructions in esp8266/README.md.
Re: Downloading, Building and Deploying the Firmware
In addition, because those instructions install esptool into the host os, if you want to flash the binary from within the VM, then you need to:deshipu wrote:You can also try this tutorial: https://learn.adafruit.com/building-and ... e-esp8266/
Except the wifi example at the end doesn't work anymore, because things got moved around and renamed.
1. install the VirtualBox Extension Pack and add the USB device in the VirtualBox GUI for the VM (the VM must be off and the ESP board must be plugged in)
2. Follow Adafruits guide on installing esptool.py, but do it in the guest Ubuntu OS and not your host OS
3. Install the (optional) usbserial and cp210x drivers by running:
Code: Select all
sudo apt-get install linux-image-extra-virtual
5. Determine the /dev/tty* name of the serial port run:
Code: Select all
ls /sys/bus/usb-serial/devices/
Then after every
Code: Select all
cd /home/vagrant/micropython/esp8266
git pull
make
Code: Select all
sudo esptool.py -p /dev/ttyUSB0 write_flash 0x00 build/firmware-combined.bin
Code: Select all
sudo make PORT=/dev/ttyUSB0 deploy
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
Code: Select all
CTRL-A CTRL-D
Last edited by wayne on Thu Mar 10, 2016 3:00 pm, edited 1 time in total.