cnlohr / esp82xx

Useful ESP8266 C Environment
Other
288 stars 107 forks source link

improve release/zip targets, cleanup #100

Open binary1230 opened 2 years ago

binary1230 commented 2 years ago

main: improve zipfile output steps

other/cleanup:


I'm not super-familiar with how projects are using BIN_TARGET or any of the other stuff, so if anything here breaks other existing projects, let me know, I can modify. I would think it's all pretty compatible though. I'm also a little weak on my Makefile-fu, so if I'm doing anything silly, let me know.


Unrelated stuff

Figured I'd just throw this over here, in case useful for anyone.

I made the above Makefile changes as part of a docker-based CI buildsystem for esp8266 projects. It seems to be working well so far. If interested, I could try to get this setup better / documented for general use.

  1. I have a Docker build that implements the instructions from @cnlohr involving this toolchain: https://github.com/cnlohr/esp82xx_bin_toolchain/raw/master/esp-open-sdk-x86_64-20200810.tar.xz

It's available here in this branch: https://github.com/Unit-e/esp-open-sdk-docker/blob/cnlohr-use-esp82xx-prebuilt/Dockerfile

I'll be updating the instructions soon on that, the docker image is available pre-built on github packages here for use with 'docker pull' https://github.com/Unit-e/esp-open-sdk-docker/pkgs/container/esp-open-sdk-docker

So you can do something like this (I have some helper scripts that make this more of a one-liner)

# run the following from any host with docker installed (tested on WSL2, native windows, native linux)

# pull the image (run once)
docker pull ghcr.io/unit-e/esp-open-sdk-docker:cnlohr-use-esp82xx-prebuilt

# build an esp82xx project in the docker container.
cd SomeEsp82xxProject/

# run "make all" with Docker:
# mount the working directory from the host OS (i.e. windows) into the docker container, and run the makefile there. 
# (note: this $PWD assumes no spaces in the path). here PWD might be something like C:\projects\SomeEsp82xxProject\
docker run --rm -it -v ${PWD}:/home/build/src ghcr.io/unit-e/esp-open-sdk-docker:cnlohr-use-esp82xx-prebuilt /bin/bash -c "make all"

The big limitation to be aware of is, on WSL2 (which is what Docker Desktop on windows uses behind the scenes), serial port forwarding is broken so you can't just flash using the normal methods from inside the docker container. BUT, it's pretty simple to use pyserial's rfc2177 serial-over-ip server to deal with that:

In the makefile (or override on commandline or user.cfg), you set this:

# set serial port name to forwarding to the windows host over the internal network: (using special address host.docker.internal)
PORT  = rfc2217://host.docker.internal:4000?ign_set_control

And on the windows host you do something like this:

# listen on port 4000 and control COM7
./esp_rfc2217_server.exe -v -p 4000 COM7

Then all the "make burn" etc works from inside the docker container. pyserial's "miniterm" supports connect for serial monitor like this:

miniterm rfc2217://your-hostname-here
  1. Separately, there is a different [but totally untested and probably problematic] docker build up here that builds the latest esp-open-sdk and puts it in a docker container. That's at: https://github.com/Unit-e/esp-open-sdk-docker/tree/master

I made a few forks of the various submodules that fix some build issues with the latest build based on pfalcon/esp-open-sdk. It appears to compile correctly and produce working firmware, but, I think esp82xx would be needed to be upgraded and tested to see if everything works there.

Anyway, if anyone here was ever looking to upgrade esp82xx to the latest pfalcon-based esp-open-sdk, that might be a good starting point.


Just wanted to shoutout to @cnlohr who has been a good sport about walking my n00b self through a lot of this for the first time.