Querying USB port

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
Pithon
Posts: 5
Joined: Sat Aug 27, 2016 3:59 pm

Querying USB port

Post by Pithon » Sat Aug 27, 2016 4:11 pm

Hi,

I have an Ai thinker ESP-12 module which is attached to a breakout board with a USB interface daughter board.

I am new to Python and was wondering how I can query the USB port identifier to upload MicroPython? I have installed Pyhon 3.5.2 for Windows but cannot seem to install PyUSB?

I keep getting a File "<stdin>", line 1 whatever command I type into the Python console? :(

fdufnews
Posts: 76
Joined: Mon Jul 25, 2016 11:31 am

Re: Querying USB port

Post by fdufnews » Sat Aug 27, 2016 8:29 pm

To install MicroPython you just need to install esptool.py and know what COM port is associated with your USB interface daughter board. When you know this you follow the Getting started with MicroPython on the ESP8266

Pithon
Posts: 5
Joined: Sat Aug 27, 2016 3:59 pm

Re: Querying USB port

Post by Pithon » Sat Aug 27, 2016 10:18 pm

I have downloaded esptool.py but don't know how to install it? When I try the pip and install commands, I just receive error messages?

How do I work out the COM port identifier as indicated in the Getting started guide:

--port /dev/ttyUSB0

Beta_Ravener
Posts: 35
Joined: Tue Aug 09, 2016 6:56 pm

Re: Querying USB port

Post by Beta_Ravener » Mon Aug 29, 2016 3:42 pm

Normally on windows you would open device manager and look for your daughter board. Next to the name of the board should be the COM port it was assigned (something like this: http://www.sharpcam.co.uk/Images/Control-Panel13.jpg). Also, if you have esptool already installed, you could try using uPyLoader (I'm the author), which lists the available COM ports for you and also has graphical user interface to esptool. It might be easier for you to flash firmware that way. You can find it at https://github.com/BetaRavener/uPyLoader and scroll down on that page (or open README.md) for all instructions on how to use it.

Edit: Also, if you are having troubles installing esptool, you just need to use Python2 environment and type in `pip install esptool`. If successful, you can try typing in `esptool.py` in the same console and it should show help for the tool. If it does, it's working fine.

Pithon
Posts: 5
Joined: Sat Aug 27, 2016 3:59 pm

Re: Querying USB port

Post by Pithon » Mon Aug 29, 2016 5:01 pm

Thanks for your reply Beta_Ravener, I didn't realise that the COM port identifier in Windows Device Manager is the same one that is requried in Python.

I tried to run uPyLoader by double clicking main.py, but a window just pops up briefly and disappears.

I am using Python 3.5.2. I haven't managed to install esptool yet!

Beta_Ravener
Posts: 35
Joined: Tue Aug 09, 2016 6:56 pm

Re: Querying USB port

Post by Beta_Ravener » Mon Aug 29, 2016 5:56 pm

For esptool, you need to have also Python2 installed (version 2.7 is the most recent I think). Personaly, I use Anaconda (https://www.continuum.io/downloads) where you can basically create any environment and choose version of Python, but basic installation of Python 2.7 for windows will do. Then, you need to run `pip` that's inside the Python 2.7 folder (usually C:\Python27\scripts\pip or something like that, but it must be the Python2, otherwise the pip will fail with error that esptool is available only for the mentioned version of python).

As for uPyLoader, it probably crashes for some reason. If you run it from console with `python main.py` you will also see the error message. My bet is that you are missing pyserial or PyQt5, but the error message is best way to find out.

Post Reply