Skip to content
This repository was archived by the owner on Sep 6, 2023. It is now read-only.

Updated ESP32 README.md installation instructions #155

Closed
wants to merge 3 commits into from

Conversation

AnthonyBriggs
Copy link
Contributor

Some gotchas that I discovered while installing and flashing.

Some gotchas that I discovered while installing and flashing.
esp32/README.md Outdated
```bash
$ pip install pyserial
```

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the dependency on pyserial comes from the ESP IDF, since esptool.py uses it. So at the very least this paragraph should be in the section above about setting up the toolchain, but ideally it would already be part of the ESP IDF documentation (is it?).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've put this in based on where I've seen the error. I could get up to this point without having pyserial installed, but then make for ESP32 threw an error. I can move it up to the ESP IDF if you prefer.

The ESP IDF docs do mention pyserial (http://esp-idf.readthedocs.io/en/latest/get-started/linux-setup.html?highlight=pyserial) but apt-get will just install for the system python (2.7 on my debian machine). If you're installing with a non-default python it doesn't help.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you do a pip install esptool, which is what I'd recommend, it'll automatically pull pyserial in from pypi. Ditto if you do clone the repo and pip install -e esptool ...

However, the micropython-esp32/esp32/Makefile calls esptool.py by path straight from the esptool package, without installing it, so the usual python installation stuff doesn't get called and the deps don't get resolved.

Possible resolutions:

  • Add instruction to run pip install pyserial so that dep will be installed from pypi.
  • Add instruction to run pip install esptool to install the whole thing from pypi
  • Add instruction to run python $ESPIDF/components/esptool_py/esptool/setup.py install to install from local tree.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can double check this, but I'm pretty sure that I didn't have esptool installed when I built and flashed my board at the sprints - just pyserial. Not sure what's going on there, maybe the build is using the one in the ESP IDF? If esptool is useful later on then it might still make sense to install it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, exactly, 'esptool' is a submodule so it's there in the file $ESPIDF/components/esptool_py/esptool/esptool.py, and can just get run from there. Normally, though, you'd "install" it by running the setup.py, which would go get the dependencies as well. Because we're skipping that step though ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I worked it out, sorry for the confusion. I've updated the PR to remove pyserial and install esptool instead.

@@ -126,7 +138,7 @@ You can get a prompt via the serial port, via UART0, which is the same UART
that is used for programming the firmware. The baudrate for the REPL is
115200 and you can use a command such as:
```bash
$ picocom /dev/ttyUSB0
$ picocom -b 115200 /dev/ttyUSB0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it definitely needs the baudrate parameter here, thanks!

Changed pyserial to install esptool, moved it into the ESPIDF section.
@dpgeorge
Copy link
Member

dpgeorge commented Aug 9, 2017

Regarding the bit about pyserial: if you look at the ESP IDF instrutions for Linux at http://esp-idf.readthedocs.io/en/latest/get-started/linux-setup.html it does actually say that you need to install pyserial for the IDF to work. So, instead of adding this extra paragraph, I think it would be more appropriate to make it more explicit that one must follow all the ESP IDF instructions.

@AnthonyBriggs
Copy link
Contributor Author

Yes, they install it with this line: sudo apt-get install git wget make libncurses-dev flex bison gperf python python-serial.

But if you're running a non-system/apt Python (eg. python 3.6 on debian like I am), then those instructions don't work: the default (2.7) Python will get pyserial instead, and the build will break. Maybe I could include an explicit "If you're running a non-system python then you might see this error ('can't import pyserial') and need to pip install esptools"?

@dpgeorge
Copy link
Member

dpgeorge commented Aug 9, 2017

But if you're running a non-system/apt Python (eg. python 3.6 on debian like I am), then those instructions don't work: the default (2.7) Python will get pyserial instead, and the build will break.

Yes, that's true, but in that case you already have a non-standard set up and would then hopefully know how to fix issues like missing Python libraries. Right?

@AnthonyBriggs
Copy link
Contributor Author

Hopefully. but it also looks possible if you're using apt python 3 (there's also a python3-serial). I just thought it better for the first build and install to be super clear with zero potential blockers if possible.

Clarified the issues with Espressif's pyserial/esptool install instructions.
@dpgeorge
Copy link
Member

Thanks for updating the PR. Merged with very minor changes in 7a8be51

@dpgeorge dpgeorge closed this Aug 15, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy