Skip to content

Commit

Permalink
Add Dockerfile definition of the build environment
Browse files Browse the repository at this point in the history
- This should let everyone build the ESP firmware.
- Update readme
  • Loading branch information
vladamatena committed Feb 23, 2022
1 parent 5a43620 commit 766107a
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 20 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM ubuntu:21.10

ENV TZ=Etc/UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN apt-get update
RUN apt-get -y install bash git cmake python3 python3-pip python3-virtualenv python3-cryptography python3-future python3-click python3-serial python3-wheel python3-pyparsing python3-pyelftools
RUN ln -s /usr/bin/python3 /usr/bin/python

RUN git clone --recursive https://github.com/espressif/ESP8266_RTOS_SDK.git --branch v3.4
RUN cd /ESP8266_RTOS_SDK && PYTHONPATH=/usr/lib/python3.9/site-packages ./install.sh
RUN echo "source /ESP8266_RTOS_SDK/export.sh" >> ~/.bashrc

49 changes: 29 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,47 @@

## How to run this

This implements Linux Wifi NIC on top of UART and ESP8266
This implements Wifi NIC on top of UART and ESP8266. The NIC can be used either on Linux using provided script or attached to another MCU and integrated with LwIP as network interface.

- Make sure your Linux supports tap devices
- Compile this
- Flash the binary into ESP
- Tune constants in tap/tap.py
- Run tap/tap.py
- Check tap device was created
- (Run dhcp client on tap device)
- Check this works as (terribly slow) network interface
## Build environment

Either build docker image as described by provided Dockerfile or proceed according to the [ESP8266 RTOS SDK user manual](https://docs.espressif.com/projects/esp8266-rtos-sdk/en/latest/get-started/index.html)

## Build

## Configure the project
This assumes SDK environemnt was sources and current directory is checked out root of the project.

Build the project and flash it to the board, then run monitor tool to view serial output:

```
idf.py menuconfig
idf.py all
```

* Set serial port under Serial Flasher Options.
## Flash from printer

* Set WiFi SSID and WiFi Password and Maximum retry under Example Configuration Options.
Create ESP directory in the root of the USB flash drive. Copy following files to it:

## Build and Flash
- `build/partition_table/partition-table.bin`
- `build/bootloader/bootloader.bin`
- `build/uart_wifi.bin`

Build the project and flash it to the board, then run monitor tool to view serial output:
Insert it into printer and start ESP flash from the menu.

## Flash using USB "programmer"

Reset ESP with IO0 down and issue the following command.

```
idf.py -p PORT flash monitor
idf.py -p /dev/ttyXXX flash
```

(To exit the serial monitor, type ``Ctrl-]``.)

See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.
## Test on Linux

```
- Make sure your Linux supports tap devices
- Compile this
- Flash the binary into ESP
- Tune constants in tap/tap.py
- Run tap/tap.py
- Check tap device was created
- (Run dhcp client on tap device)
- Check this works as (terribly slow) network interface

0 comments on commit 766107a

Please sign in to comment.