-
I actually took Gordon's solution first because I didn't want to solder wires to the pins. And although it took some tweaking and slowing down comms to a strolling pace, it works. I now have AT25 on both "shimmed" ESP01's without having to desolder them. Which was the goal. But I am sure that your solution wouldn't have required the "tweaking".
-
I actually had two types of problems:
one was where the ESPTool would report an "Invalid header". The solution of adjusting the ESP_XXX_Blocks I found on the net, although I can't seem to be able to find the link anymore
The second one was where the ESPTool would just stop, probably waiting for eternity for the serial to come back.
-
OK, used the 1.79.210. Had to change some values in the ESPtool.py (if not, it led to an Invalid header somewhere in the flash process.) I also adjusted the baudrate.
These are the values that worked:
Baud set to 19200
In ESPTool.py, make the following changes:# Maximum block size for RAM and Flash writes, respectively. ESP_RAM_BLOCK = 0xc0 ESP_FLASH_BLOCK = 0x20
Higher values on any of the two variables, led to errors in the flashing.
-
-
OK, at first I was a bit lost. I thought you meant flashing through the USB port of the pico, but in fact you are using 3 serial ports: One to the ESP-01 (on the first UART on pico), one to the PC with an extra USB to serial on the second UART, and one to the pc through the pico USB to serial. I'll try this tomorrow.
-
-
-
I only submitted a portion of the code. It does contain the reset. It's totally repeatable.
But due to this "discovery" I think I (finally) understand what is happening. As you/DrAzzy/I mentioned, I have to nest the calls within one another if I call commands sequentially.
As a non-JS programmer I am not used to the asynchronous execution of code. The problem probably lies in there.
-
-
Found something:
wifi.getVersion(print); console.log("Connecting to WiFi"); wifi.connect(WIFI_NAME, WIFI_PASS, function(err) { if (err) throw err; console.log("Connected"); // print IP address wifi.getIP(console.log); // Create a server require("http").createServer(pageHandler).listen(80); });
gives me
echo(0);
=undefined
Waiting for ESP8266 to flush its serial buffer
Connecting to WiFi
null 0018000902-AI03
Uncaught WiFi connect failed: no change
at line 2 col 42
if (err) throw err;
.....................^
in function "b" called from line 1 col 37
{"OK"!=a?b("WiFi connect failed: "+a):b(null)}
.......................................................^
in function "b" called from line 1 col 26
{c=void 0;var d;b&&(d=b(a))?(c=p,b=d):clearTimeout(e);void 0...
.......................................^
in function "c" called from line 1 col 325
...f&&(ef,n=!0);n||c&&c(k)}a=a.substr(d+1);"\n"==a[0]&&(a=...
.............................................^
in function called from systemNow,
//wifi.getVersion(print); console.log("Connecting to WiFi"); wifi.connect(WIFI_NAME, WIFI_PASS, function(err) { if (err) throw err; console.log("Connected"); // print IP address wifi.getIP(console.log); // Create a server require("http").createServer(pageHandler).listen(80); });
results in:
echo(0);
=undefined
Waiting for ESP8266 to flush its serial buffer
Connecting to WiFi
Connected
null 192.168.0.214Commenting out the version command makes the script run as it should. The version command on itself however, does run as in the following:
wifi.getVersion(print); //console.log("Connecting to WiFi"); //wifi.connect(WIFI_NAME, WIFI_PASS, function(err) //{ // if (err) throw err; // console.log("Connected"); // print IP address // wifi.getIP(console.log); // Create a server // require("http").createServer(pageHandler).listen(80); //});
which results in:
echo(0);
=undefined
Waiting for ESP8266 to flush its serial buffer
null 0018000902-AI03So, combining the version command with the connect command results in an error.
Anyone have a clue? -
-
-
-
I'm going to try to find some larger capacitors. I currently have 3 uF on them, but in both cases it doesn't seem to be enough. On the ESP12 board I have, there's a 100uF. All in all it's weird, because the getAPs command runs without problem (even without the caps), but anything else gives me troubles.
-
-
-
I meant that the garbled output at the start is a firmware issue.
Just tried with another AP. Same error.
The wifi.at command also does not seem to work (see below).Tomorrow I'll put on a scope and logic analyzer and try to see what's happening.
=======================================
wifi.at("AT+GMR\r\n",1000,print);
gives me the same error (on both modules)
=undefined
Uncaught Error: Expecting a function to call, got Object
at line 1 col 6
wifi.at("AT+GMR\r\n",1000,print);
----^ -
-
-
I'm kinda lost here. Let me give some examples with output:
Serial2.setup(9600, { rx: A3, tx : A2 }); var wifi = require("ESP8266WiFi").connect(Serial2, function(err) {if (err) throw err;wifi.getVersion(print);});
produces
echo(0); =undefined null 0018000902-AI03
Now,
Serial2.setup(9600, { rx: A3, tx : A2 }); var wifi = require("ESP8266WiFi").connect(Serial2, function(err) {if (err) throw err;wifi.getAPs(print);});
produces
echo(0); =undefined null [ { "ssid": "Andromeda", "enc": "wpa_wpa2_psk", "signal": -67, "mac": "dc:53:7c:14:a0:21" }, { "ssid": "bbox2-8108", "enc": "wpa_wpa2_psk", "signal": -94, "mac": "5c:33:8e:64:e2:2c" }, { "ssid": "TELENETHOMESPOT", "enc": "open", "signal": -66, "mac": "02:53:7c:14:a0:22" }, { "ssid": "TelenetWiFree", "enc": "open", "signal": -66, "mac": "06:53:7c:14:a0:24" }, { "ssid": "solarsystem", "enc": "wpa_wpa2_psk", "signal": -20, "mac": "00:18:84:88:ec:00" }, { "ssid": "DIRECT-nBPrinter ", "enc": "wpa2_psk", "signal": -44, "mac": "02:15:99:d7:9b:49" }, { "ssid": "FON_galaxy", "enc": "open", "signal": -26, "mac": "00:18:84:88:ec:01" } ]
OK, so that works. Now, inserting connect
Serial2.setup(9600, { rx: A3, tx : A2 }); var wifi = require("ESP8266WiFi").connect(Serial2, function(err) {if (err) throw err;wifi.connect("solarsystem","tmpjoimc",print);});
That gives me BS (due to the serial garbage on initialisation)
as follows:echo(0); =undefined WiFi connect failed: "áÙÓHòé!Í!ÿåÑ+ùÂë
So, I re-introduce the SetTimeout
Serial2.setup(9600, { rx: A3, tx : A2 }); var wifi = require("ESP8266WiFi").connect(Serial2, function(err) {if (err) throw err;}); setTimeout(function(){wifi.connect("solarsystem","tmpjoimc", function(err) {if (err) throw err;});}, 10000);
and then I get
echo(0); =undefined >Uncaught CWMODE failed: AT+CWMODE=1 at line 1 col 17 {if (err) throw err;} ^ in function "b" called from line 2 col 2 e):d.cmd("AT+CWJAP="+JSON.stringify(a)+","+JSON.stringify(c)... ^ in function "d" called from line 1 col 26 {e=void 0;var b;d&&(b=d(a))?(e=g,d=b):clearTimeout(c);void 0... ^ in function "e" called from line 1 col 291 ...f&&(g[f](d),n=!0);n||e&&e(d)}b=b.substr(a+1);"\n"==b[0]&&(b=... ^ in function called from system Uncaught CWMODE failed: undefined at line 1 col 17 {if (err) throw err;} ^ in function "b" called from line 2 col 2 e):d.cmd("AT+CWJAP="+JSON.stringify(a)+","+JSON.stringify(c)... ^ in function "d" called from line 1 col 16 {e=void 0;d&&d()} ^ in function called from system
In effect, as I said, connecting (or trying to in any way) produces the error, both on this and on the other module. With or without caps on Vcc-GND.
-
-
-
-
@profra, what do you mean "Too big"? To attach you mean? Just give the link, instead of the download as attachment. No?