ESP8266 based Wireless module with CH340

Anything not related to STM32
User avatar
WereCatf
Posts: 166
Joined: Sat Apr 16, 2016 5:30 pm

Re: ESP8266 based Wireless module with CH340

Post by WereCatf » Sun Apr 17, 2016 5:06 am

Correcting myself here: actually, uploading using the IDE at higher speeds doesn't seem to work; either the tool or the bootloader seems to set the baudrate to 115200 or something if you use a higher setting than 921600. I would hazard a guess that the bootloader is at the issue. 2Mbps does seem to work fine in my sketches themselves, though, what little I've tested.

User avatar
mrburnette
Posts: 1892
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: ESP8266 based Wireless module with CH340

Post by mrburnette » Sun Apr 17, 2016 4:09 pm

RogerClark wrote:Hi Ray

No worries

I only wanted to run it as a "Generic" ESP8266, it just saves having an external USB to Serial converter and a small board with the Reset and Program buttons (which I'm using at the moment)
That should work ... and is how I am doing it. When your board comes in, it will be interesting to see if you can do this on the first test. In my case, I actually tried the NodeMCU 1.0 first and selected the 4M (3M SPIFFS) and that did not work. After that, I started messing around with different settings and got some very strange behavior (some documented in the previous .txt file) Now, it consistently works with access to the full 4M with the generic setting.

Werecatf indicates her unit from LoLin works the way the documentation suggests, but I was not able to replicate. It could be just that I trashed the flash with garbage when playing. When this happened with the old -01, the instructions were to use the ESP flash tool and write "blank.bin" into the flash.

My intent here is not to deep sleep and awaken (requires connecting external pins) but to simply disable the RF as long as the unit is powered. On reset, the RF restarts but in milliseconds is shut down.

Also, my intent is to ferret into the WiFi library and cull the system calls and use those directly with interface.h to avoid even having to include the WiFi library. But I am in no hurry to do this as the current methodology will suffice for a while.


Ray

User avatar
mrburnette
Posts: 1892
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: ESP8266 based Wireless module with CH340

Post by mrburnette » Wed Apr 20, 2016 1:37 pm

2 new boards received ... summary post here

User avatar
mrburnette
Posts: 1892
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

The first board bad, kaput, defectuoso, 不良品, défectueux

Post by mrburnette » Wed Apr 20, 2016 8:51 pm

So, the two new boards arrived yesterday. this afternoon was my 1st opportunity to work with one of the new units ... the 2nd unit will stay in the sealed antistatic bag.

The 1st and 2nd units look the same out of the antistatic, but the bags are different (TOP image works, BOTTOM image is defective):
Top-Works_Bottom-NoWorkie.jpg
Top-Works_Bottom-NoWorkie.jpg (248.47 KiB) Viewed 675 times
I loaded the sketch from yesterday by Nick for Prime Nos.
I took a new USB-micro connector and connected the new module.
My current reading was 80mA and a check of the WiFi signal shows the AP is active by default (AI-THINKER_802408)
AP_Active.jpg
AP_Active.jpg (228.47 KiB) Viewed 675 times
Using settings: NodeMCU 1.0 (ESP-12E Module), 80MHz, Serial 115200, 4M (3M SPIFFS) the unit programmed 1st time over USB port. Opening the serial monitor, pressing reset, and the sketched fired and the output was normal. Current dropped after programming to 20mA on the new board.

Unplugging this new board and plugging in the 1st board received, all settings remaining the same as the 1st board. The board programmed successfully with no obvious error, the current remained at 20mA. Opening the IDE monitor, pressing Reset, but this time the displayed a stack dump. Changing the settings to "Generic, 1M flash" as documented previously causes the sketch to function correctly with normal monitor output.

Ah, ha.
My suspicion is the first board is a reworked item: failed QA, sold by the pound, repaired and repackaged and sold for $0.11 USD less. The repair may have shorted an EPROM high address line or the repair may have used a 1MB EEPROM... just a guess.

The 2nd unit appears to be a fully working 4MB EEPROM.

Ray

User avatar
martinayotte
Posts: 1229
Joined: Mon Apr 27, 2015 1:45 pm

Re: ESP8266 based Wireless module with CH340

Post by martinayotte » Wed Apr 20, 2016 8:59 pm

Ray, if you suspect the Flash not being a 4M but 1M instead, you can verify by querying its ID :

Code: Select all

Serial.println(String(ESP.getFlashChipId(), HEX));
it will give your the Truth ! ;)

User avatar
mrburnette
Posts: 1892
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: ESP8266 based Wireless module with CH340

Post by mrburnette » Wed Apr 20, 2016 10:15 pm

martinayotte wrote:Ray, if you suspect the Flash not being a 4M but 1M instead, you can verify by querying its ID :

Code: Select all

Serial.println(String(ESP.getFlashChipId(), HEX));
it will give your the Truth ! ;)
The 1st unit purchased gives:

Code: Select all

Flash size: 1640e0
The 2nd unit purchased gives:

Code: Select all

Flash size: 1640e0
So, there goes the eeprom size theory. I can still use the 1st unit if I do a generic board selection as documented previously. Weird. Both units work fine at 160MHz. Only the new unit works as board type NodeMCU 1.0. Go figure :cry:

Ray

My ESP8266 Sans RF observation is here: viewtopic.php?f=45&t=1037&p=12374#p12374

User avatar
RogerClark
Posts: 7494
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: ESP8266 based Wireless module with CH340

Post by RogerClark » Tue Apr 26, 2016 3:36 am

Hi Ray

My modules finally came today

I've only tried 2 of the 3 but I can only get them to upload if I select NodeMCU as the board type.

I'll need to take a look at boards.txt in the esp8266 core to see what this board type actually does.

Because unless its a quirk of using the CH340G, I can't see why I should not be able to upload as a generic board.

Once I upload as NodeMCU the code seems to run OK. (but I've only had time to take a cursory look)

User avatar
WereCatf
Posts: 166
Joined: Sat Apr 16, 2016 5:30 pm

Re: ESP8266 based Wireless module with CH340

Post by WereCatf » Tue Apr 26, 2016 4:21 am

RogerClark wrote:My modules finally came today

I've only tried 2 of the 3 but I can only get them to upload if I select NodeMCU as the board type.

I'll need to take a look at boards.txt in the esp8266 core to see what this board type actually does.

Because unless its a quirk of using the CH340G, I can't see why I should not be able to upload as a generic board.

Once I upload as NodeMCU the code seems to run OK. (but I've only had time to take a cursory look)
Are you using the Arduino IDE or something else? If you are using the Arduino IDE you probably didn't set the reset-method to Nodemcu. These are the settings I use and they work fine:
Image

User avatar
RogerClark
Posts: 7494
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: ESP8266 based Wireless module with CH340

Post by RogerClark » Tue Apr 26, 2016 4:55 am

Thanks

I didn't realize there was a menu to select the Reset method.

I'll change it and see if the upload works.

Edit

Thanks

Changing the reset method seems to fix it!

User avatar
zoomx
Posts: 541
Joined: Mon Apr 27, 2015 2:28 pm
Location: Mt.Etna, Italy

Re: ESP8266 based Wireless module with CH340

Post by zoomx » Tue Apr 26, 2016 7:53 am

I didn't find this reset method in IDE 1.6.8 and core 2.2.0. Windows IDE.

Post Reply