Newly flashed D1 mini disconnects after a few sec

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
mr_exit
Posts: 8
Joined: Sun Feb 19, 2017 10:07 pm

Newly flashed D1 mini disconnects after a few sec

Post by mr_exit » Sun Feb 19, 2017 10:21 pm

Hi there. I'm reasonably new to Micropython but have made one project using a nodeMCU and some buttons connected to MQTT

I've received a couple of Wemos D1 mini's and I'm having trouble with them. I've flashed them with the same firmware used on the nodeMCU (the latest download for esp8266) and when I connect to them with the 'screen' command on a mac, I get the REPL for a few seconds and then it locks up. I'm able to hit enter about 5 times and it's so quick I haven't been able to copy paste any commands to check if it's ok.

The default wireless AP shows up but I'm not able to connect to it with my laptop.
I've tried flashing it a few times and get the same result. I've got 2 of these boards and it's happening on both. So I don't think it's a flashing problem.

Does anyone have any ideas about what to try next to debug what's wrong?

Thanks
-James

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: Newly flashed D1 mini disconnects after a few sec

Post by deshipu » Mon Feb 20, 2017 7:58 am

Is any part of the board getting hot? In particular, the 3-pin black voltage regulator?

mr_exit
Posts: 8
Joined: Sun Feb 19, 2017 10:07 pm

Re: Newly flashed D1 mini disconnects after a few sec

Post by mr_exit » Mon Feb 20, 2017 8:12 am

Update with more info.

Turns out the board isn't crashing, when I connect with screen, It stops, but I can connect again just fine.

I wrote the firmware to the board again with --verify, That reported it was all fine. I wrote it at baud 9600 which took a while but strangely (as you will see soon) it stayed connected the whole time.

I tried reinstalling the drivers from here http://kig.re/2014/12/31/how-to-use-ard ... emite.html

And then looked in the console to see if there was anything interesting. As you can see from the log below, it's connecting, disconnects after a few sec and connects again.

I'm not sure if this is the driver disconnecting, it does this with both my D1's on my machine running the latest Macos Sierra, and also another machine here running Yosemite. Or if it really is the board constantly rebooting.

Is there a python command I can quickly paste into the REPL for the couple of sec I can use it, to see what it's doing?

default 20:54:03.655113 +1300 kernel USB2.0-Serial: family specific matching fails
default 20:54:03.655130 +1300 kernel USB2.0-Serial: family specific matching fails
default 20:54:03.655183 +1300 kernel USB2.0-Serial: family specific matching fails
default 20:54:03.655194 +1300 kernel USB2.0-Serial: family specific matching fails
default 20:54:03.655218 +1300 kernel USB2.0-Serial: family specific matching fails
default 20:54:03.655526 +1300 kernel probing

default 20:54:03.655528 +1300 kernel wch_usb detach. provider USB2.0-Serial.
default 20:54:03.655534 +1300 kernel wch_usb start.
default 20:54:03.656098 +1300 kernel 1 0 wch_usb: configDMM - find the config interface numbers
default 20:54:03.746520 +1300 kernel AppleUSBInterface: family specific matching fails
default 20:54:03.769945 +1300 icdd #ICDebug - 37:{ICWiredBrowser.m} (USB Interface first match)
default 20:54:03.770557 +1300 icdd #ICDebug - 388:{ICWiredBrowser.m} (10 USB Descriptions Managed)
default 20:54:03.772260 +1300 icdd #ICDebug - 23:{ICWiredBrowser.m} (USB Device first match)
default 20:54:03.772632 +1300 icdd #ICDebug - 460:{ICDDMessageCenter.m} (+Add USB2.0-Serial - 0xff/0x1/0x2 - 0x14600000 - ICDeviceDescriptionSUQuery)
default 20:54:03.772757 +1300 icdd #ICDebug - 388:{ICWiredBrowser.m} (11 USB Descriptions Managed)
default 20:54:03.772798 +1300 icdd #ICDebug - 213:{ICResourceManager.m} (00000000-0000-0000-0000-00001A867523|USB2.0-Serial|(null)|SW=FALSE|)
default 20:54:03.775558 +1300 icdd #ICDebug - 460:{ICDDMessageCenter.m} (+Add USB2.0-Serial - 0xff/0x1/0x2 - 0x14600000 - ICDeviceDescriptionUndefined)
default 20:54:03.776978 +1300 icdd #ICDebug - 460:{ICDDMessageCenter.m} (+Add USB2.0-Serial - 0x0/0x0/0x0 - 0x14600000 - ICDeviceDescriptionSUQuery)
default 20:54:03.776996 +1300 icdd #ICDebug - 213:{ICResourceManager.m} (00000000-0000-0000-0000-00001A867523|USB2.0-Serial|(null)|SW=FALSE|)
default 20:54:03.778170 +1300 icdd #ICDebug - 460:{ICDDMessageCenter.m} (+Add USB2.0-Serial - 0x0/0x0/0x0 - 0x14600000 - ICDeviceDescriptionUndefined)
default 20:54:14.270626 +1300 kernel isInactinve = 0.
default 20:54:14.290034 +1300 icdd #ICDebug - 51:{ICWiredBrowser.m} (USB terminate)
default 20:54:14.270633 +1300 kernel terminate optins = 10000d, result = 1, !
default 20:54:14.290097 +1300 icdd #ICDebug - 344:{ICWiredBrowser.m} (--> USB Terminate)
default 20:54:14.270635 +1300 kernel isInactinve = 1.
default 20:54:14.290317 +1300 icdd #ICDebug - 363:{ICWiredBrowser.m} (Reclaiming Resource: USB2.0-Serial)
default 20:54:14.290369 +1300 icdd #ICDebug - 363:{ICWiredBrowser.m} (Reclaiming Resource: USB2.0-Serial)
default 20:54:14.290412 +1300 icdd #ICDebug - 371:{ICWiredBrowser.m} (9 USB Descriptions Managed)
default 20:54:14.271224 +1300 kernel kIOMessageServiceIsTerminated.

default 20:54:14.290429 +1300 icdd #ICDebug - 509:{ICDDMessageCenter.m} (-Rem USB2.0-Serial - 0xff/0x1/0x2 - 0x14600000 - ICDeviceDescriptionUpdated)
default 20:54:14.271227 +1300 kernel releaseResources.

default 20:54:14.290450 +1300 icdd #ICDebug - 373:{ICWiredBrowser.m} (<-- USB Terminate)
default 20:54:14.290509 +1300 icdd #ICDebug - 509:{ICDDMessageCenter.m} (-Rem USB2.0-Serial - 0x0/0x0/0x0 - 0x14600000 - ICDeviceDescriptionUndefined)
default 20:54:14.372597 +1300 kernel wch_usb stop.
default 20:54:14.372606 +1300 kernel wch_usb detach. provider USB2.0-Serial.
default 20:54:14.434288 +1300 kernel wch_usb free.
default 20:54:14.437657 +1300 kernel USB2.0-Serial: family specific matching fails
default 20:54:14.437726 +1300 kernel USB2.0-Serial: family specific matching fails
default 20:54:14.437736 +1300 kernel USB2.0-Serial: family specific matching fails
default 20:54:14.437772 +1300 kernel USB2.0-Serial: family specific matching fails
default 20:54:14.437778 +1300 kernel USB2.0-Serial: family specific matching fails
default 20:54:14.437795 +1300 kernel USB2.0-Serial: family specific matching fails
default 20:54:14.437800 +1300 kernel USB2.0-Serial: family specific matching fails
default 20:54:14.437806 +1300 kernel USB2.0-Serial: family specific matching fails
default 20:54:14.437822 +1300 kernel USB2.0-Serial: family specific matching fails
default 20:54:14.437866 +1300 kernel USB2.0-Serial: family specific matching fails
default 20:54:14.437907 +1300 kernel USB2.0-Serial: family specific matching fails
default 20:54:14.437924 +1300 kernel USB2.0-Serial: family specific matching fails
default 20:54:14.437981 +1300 kernel USB2.0-Serial: family specific matching fails
default 20:54:14.437998 +1300 kernel USB2.0-Serial: family specific matching fails
default 20:54:14.438023 +1300 kernel USB2.0-Serial: family specific matching fails
default 20:54:14.438332 +1300 kernel probing

default 20:54:14.438334 +1300 kernel wch_usb detach. provider USB2.0-Serial.
default 20:54:14.438341 +1300 kernel wch_usb start.
default 20:54:14.438954 +1300 kernel 1 0 wch_usb: configDMM - find the config interface numbers
default 20:54:14.527107 +1300 kernel AppleUSBInterface: family specific matching fails
default 20:54:14.550797 +1300 icdd #ICDebug - 37:{ICWiredBrowser.m} (USB Interface first match)
default 20:54:14.551598 +1300 icdd #ICDebug - 388:{ICWiredBrowser.m} (10 USB Descriptions Managed)
default 20:54:14.552537 +1300 icdd #ICDebug - 23:{ICWiredBrowser.m} (USB Device first match)
default 20:54:14.553233 +1300 icdd #ICDebug - 388:{ICWiredBrowser.m} (11 USB Descriptions Managed)
default 20:54:14.554387 +1300 icdd #ICDebug - 460:{ICDDMessageCenter.m} (+Add USB2.0-Serial - 0xff/0x1/0x2 - 0x14600000 - ICDeviceDescriptionSUQuery)
default 20:54:14.554402 +1300 icdd #ICDebug - 213:{ICResourceManager.m} (00000000-0000-0000-0000-00001A867523|USB2.0-Serial|(null)|SW=FALSE|)
default 20:54:14.555759 +1300 icdd #ICDebug - 460:{ICDDMessageCenter.m} (+Add USB2.0-Serial - 0x0/0x0/0x0 - 0x14600000 - ICDeviceDescriptionSUQuery)
default 20:54:14.555839 +1300 icdd #ICDebug - 213:{ICResourceManager.m} (00000000-0000-0000-0000-00001A867523|USB2.0-Serial|(null)|SW=FALSE|)
default 20:54:14.557754 +1300 icdd #ICDebug - 460:{ICDDMessageCenter.m} (+Add USB2.0-Serial - 0xff/0x1/0x2 - 0x14600000 - ICDeviceDescriptionUndefined)
default 20:54:14.559335 +1300 icdd #ICDebug - 460:{ICDDMessageCenter.m} (+Add USB2.0-Serial - 0x0/0x0/0x0 - 0x14600000 - ICDeviceDescriptionUndefined)
default 20:54:18.790768 +1300 kernel isInactinve = 0.
default 20:54:18.810259 +1300 icdd #ICDebug - 51:{ICWiredBrowser.m} (USB terminate)
default 20:54:18.790777 +1300 kernel terminate optins = 10000d, result = 1, !
default 20:54:18.810324 +1300 icdd #ICDebug - 344:{ICWiredBrowser.m} (--> USB Terminate)
default 20:54:18.790779 +1300 kernel isInactinve = 1.
default 20:54:18.810528 +1300 icdd #ICDebug - 363:{ICWiredBrowser.m} (Reclaiming Resource: USB2.0-Serial)
default 20:54:18.810599 +1300 icdd #ICDebug - 363:{ICWiredBrowser.m} (Reclaiming Resource: USB2.0-Serial)
default 20:54:18.810616 +1300 icdd #ICDebug - 509:{ICDDMessageCenter.m} (-Rem USB2.0-Serial - 0xff/0x1/0x2 - 0x14600000 - ICDeviceDescriptionUpdated)
default 20:54:18.791363 +1300 kernel kIOMessageServiceIsTerminated.

default 20:54:18.810651 +1300 icdd #ICDebug - 371:{ICWiredBrowser.m} (9 USB Descriptions Managed)
default 20:54:18.791370 +1300 kernel releaseResources.

default 20:54:18.810724 +1300 icdd #ICDebug - 509:{ICDDMessageCenter.m} (-Rem USB2.0-Serial - 0x0/0x0/0x0 - 0x14600000 - ICDeviceDescriptionUpdated)
default 20:54:18.810743 +1300 icdd #ICDebug - 373:{ICWiredBrowser.m} (<-- USB Terminate)
default 20:54:18.892874 +1300 kernel wch_usb stop.
default 20:54:18.892901 +1300 kernel wch_usb detach. provider USB2.0-Serial.
default 20:54:18.954439 +1300 kernel wch_usb free.
default 20:54:18.956830 +1300 kernel USB2.0-Serial: family specific matching fails
default 20:54:18.956891 +1300 kernel USB2.0-Serial: family specific matching fails
default 20:54:18.956900 +1300 kernel USB2.0-Serial: family specific matching fails
default 20:54:18.956931 +1300 kernel USB2.0-Serial: family specific matching fails
default 20:54:18.956936 +1300 kernel USB2.0-Serial: family specific matching fails
default 20:54:18.956951 +1300 kernel USB2.0-Serial: family specific matching fails
default 20:54:18.956956 +1300 kernel USB2.0-Serial: family specific matching fails
default 20:54:18.956961 +1300 kernel USB2.0-Serial: family specific matching fails
default 20:54:18.956975 +1300 kernel USB2.0-Serial: family specific matching fails

mr_exit
Posts: 8
Joined: Sun Feb 19, 2017 10:07 pm

Re: Newly flashed D1 mini disconnects after a few sec

Post by mr_exit » Mon Feb 20, 2017 8:15 am

[quote="deshipu"]Is any part of the board getting hot? In particular, the 3-pin black voltage regulator?[/quote]

Yes the chip beside the USB connection does get hot, I think it's the same one you're mentioning, 3 pins one side, 2 on the other.

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: Newly flashed D1 mini disconnects after a few sec

Post by deshipu » Mon Feb 20, 2017 11:52 am

That suggests you have a short in there, and your USB ports shut down to protect your computer.

Are you placing the board on the exposed aluminium of your laptop, by any chance?

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: Newly flashed D1 mini disconnects after a few sec

Post by deshipu » Mon Feb 20, 2017 12:01 pm

What you can try is deactivating the network:

Code: Select all

import network
network.WLAN(network.STA_AP).active(False)
network.WLAN(network.STA_IF).active(False)

mr_exit
Posts: 8
Joined: Sun Feb 19, 2017 10:07 pm

Re: Newly flashed D1 mini disconnects after a few sec

Post by mr_exit » Mon Feb 20, 2017 7:23 pm

deshipu wrote:What you can try is deactivating the network:

Code: Select all

import network
network.WLAN(network.STA_AP).active(False)
network.WLAN(network.STA_IF).active(False)
It's strange I'd be getting a short on both boards, They're dangling in free air off the cable (I've tried switching cables too)

I get this running the command above

>>> import network
>>> network.WLAN(network.STA_AP).active(False)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'STA_AP'
>>> network.WLAN(network.STA_IF).active(False)

Is it possible to run these off a 3.3v source bypassing that chip? where would I connect that?

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: Newly flashed D1 mini disconnects after a few sec

Post by deshipu » Mon Feb 20, 2017 10:03 pm

Ah, sorry, I mean:

Code: Select all

network.WLAN(network.AP_IF).active(False)
(Wrote that from memory and edited the second line wrong.)

I think you can't connect a 3.3V power source to the 3.3V pin -- just make sure that no 5V source (like USB) is connected, and that your power source can provide at least 300mA current. You can also connect a USB2TTL adaptor to the rx and tx pins to get to the REPL...

mr_exit
Posts: 8
Joined: Sun Feb 19, 2017 10:07 pm

Re: Newly flashed D1 mini disconnects after a few sec

Post by mr_exit » Wed Feb 22, 2017 7:26 am

Thank you so much for your help. I'm going to blame buying the cheapest D1 minis I could find on Ebay.

Connecting it to a solid 3.3v source seems to work fine, I'm able to connect to it's default Wifi and ping it endlessly (I count 3 min as endless based on what I was getting earlier.) Until my USB2TTL adapter arrives I'm going to leave it there, because the webrepl doesn't seem to be on by default and I haven't got any other way to connect to it.

If anyone has a source for decent D1 mini boards (with international shipping, I'm in New Zealand) let me know, The real wemos ones don't seem to be available anymore :(

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: Newly flashed D1 mini disconnects after a few sec

Post by deshipu » Wed Feb 22, 2017 8:55 am

I suspect there is a short circuit, faulty part or other problem in the voltage regulator part of the board. It could help to compare with a working D1 Mini, it may be as simple a a solder blob somewhere that needs to be removed, or a wrong resistor.

Post Reply