MAGTAG - esptool.py NOT detecting chip

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
wavesailor
 
Posts: 26
Joined: Thu Aug 25, 2016 12:42 pm

MAGTAG - esptool.py NOT detecting chip

Post by wavesailor »

Hi all,

I am finally trying to use my MagTag for the first time but I'm unable to connect to it
I plug it into my laptop running windows 10 and it shows up as below:
Devicemanager.png
Devicemanager.png (46.54 KiB) Viewed 158 times
I then run esptool.py and get the following error:

Code: Select all

esptool.py --port COM5 chip_id
esptool.py v3.2
Serial port COM5
Connecting.....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting...
Traceback (most recent call last):
  File "c:\users\JJ\appdata\local\programs\python\python39\lib\site-packages\esptool.py", line 377, in detect_chip
    res = struct.unpack("<IBBBBBBBBI", res[:16])  # 4b flags, 1b flash_crypt_cnt, 7*1b key_purposes, 4b chip_id
struct.error: unpack requires a buffer of 16 bytes
I did try on another laptop but got exactly the same results.
Not sure how to resolve this??

Thanks

User avatar
danhalbert
 
Posts: 4654
Joined: Tue Aug 08, 2017 12:37 pm

Re: MAGTAG - esptool.py NOT detecting chip

Post by danhalbert »

You need to get it into boot mode. Hold down the boot button and press the reset button, and then release the boot button.

User avatar
wavesailor
 
Posts: 26
Joined: Thu Aug 25, 2016 12:42 pm

Re: MAGTAG - esptool.py NOT detecting chip

Post by wavesailor »

danhalbert wrote:You need to get it into boot mode. Hold down the boot button and press the reset button, and then release the boot button.
Thanks but it was in Boot mode.


It would not get to this if it was not in Boot Mode

Code: Select all

Connecting.....
Detecting chip type...

User avatar
danhalbert
 
Posts: 4654
Joined: Tue Aug 08, 2017 12:37 pm

Re: MAGTAG - esptool.py NOT detecting chip

Post by danhalbert »

I am seeing the same problem with esptool.py V3.2. Try reverting to V3.1. If you installed with pip, you can do
`pip [or pip3] install esptool==3.1`.

`chip_id` does not fail immediately after `flash_erase`, but if I load a .bin, then it fails again. I have filed an issue on esptool.py about this:

https://github.com/espressif/esptool/issues/685

Thanks for reporting this.

User avatar
wavesailor
 
Posts: 26
Joined: Thu Aug 25, 2016 12:42 pm

Re: MAGTAG - esptool.py NOT detecting chip

Post by wavesailor »

Thanks for feedback.

I did as you mentioned:

Code: Select all

C:\Users\JJ>pip check esptool
No broken requirements found.

C:\Users\JJ>pip show esptool
Name: esptool
Version: 3.1
Summary: A serial utility to communicate & flash code to Espressif ESP8266 & ESP32 chips.
Home-page: https://github.com/espressif/esptool
Author: Fredrik Ahlberg (themadinventor) & Angus Gratton (projectgus)
Author-email: [email protected]
License: GPLv2+
Location: c:\users\JJ\appdata\local\programs\python\python310\lib\site-packages
Requires: bitstring, BANNED, ecdsa, pyserial, reedsolo
Required-by:
But esptool.py does not seem to work now - it just gives a blank screen:

Code: Select all

C:\Users\JJ>esptool.py --version

C:\Users\JJ>
I'm on windows 10 with Python 3.10.0

User avatar
danhalbert
 
Posts: 4654
Joined: Tue Aug 08, 2017 12:37 pm

Re: MAGTAG - esptool.py NOT detecting chip

Post by danhalbert »

I would say to try rolling back Python to 3.9. I was not able to reproduce that specific problem with Python 3.10 on Ubuntu 20.04.
To check the version, use `esptool.py version` (without the "--"). But you should have gotten an error otherwise.

DId you install esptool with pip the first time around?

User avatar
danhalbert
 
Posts: 4654
Joined: Tue Aug 08, 2017 12:37 pm

Re: MAGTAG - esptool.py NOT detecting chip

Post by danhalbert »

The esptool folks suggest specifying the chip explicitly. That may help you work around all this for now:
https://github.com/espressif/esptool/is ... -954015265

User avatar
wavesailor
 
Posts: 26
Joined: Thu Aug 25, 2016 12:42 pm

Re: MAGTAG - esptool.py NOT detecting chip

Post by wavesailor »

Hey Dan,

I found my problem: I think in did this

Code: Select all

pip install esptool.py esptool==3.1
This created an empty file(esptool.py) in my current directory.
Once I deleted it, then version 3.1 of esptool.py worked perfectly.

Thanks.

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”