-
• #2
Thanks! Did you have any luck with the code/instructions here? http://www.espruino.com/ESP8266#use-espruino
The ESP_xxx_BLOCK size changes should only be needed if you're going to flash directly through the Espruino WiFi's STM32 - you should be able to flash the ESP8266 without having to wire up an FTDI cable - it's why I never included any pins for flashing it :)
It'll be slower, but should still be possible - and obviously a bit less messy :)
Have you actually had WiFi working properly after updating? The code you post for testing needs to wait until
ready
is received fromAT+RST
(in factAT+RST
itself may not be needed since you're just powering the module on).Something like this should work I imagine:
// wait for READY message at.cmd('', 10000, function cb(data) { if (data && data!="ready") return cb; // ask for version at.cmd('AT+GMR\r\n', 10000, function(data) { console.log(data); }); }); // power up digitalWrite(A13, 1); digitalWrite(A14, 1);
-
• #3
I never got those instructions to work when I originally tried so this was with a method I knew worked already :)
It looks like either the AT or the Espruino_WiFi module don't like the newer firmware which is a problem for me :(
Here's what happens when I run your code sample with
at.debug();
["AT+GMR\r\n"
] "AT+GMR\r\r\nAT version" <--- "AT+GMR\r\r\nAT version"
AT+GMR
] "AT version:1.3.0.0(Jul 14 2016 18:54:01)\r\nSDK version:2.0.0(656edbf)\r\ncompile time:Ju" <--- ":1.3.0.0(Jul 14 2016 18:54:01)\r\nSDK version:2.0.0(656edbf)\r\ncompile time:Ju"
] "compile time:Jul 19 2016 18:43:55\r\nOK\r\n" <--- "l 19 2016 18:43:55\r\nOK\r\n"So it just prints 'AT+GMR' as the
console.log
, it seems like something returns too early. I'm guessing its because of the\r\r\n
separator? Not sure why its double\r
. -
• #4
Hmm, no wait, same thing on the old firmware:
["AT+GMR\r\n"
] "AT+GMR\r\r\nAT versio" <--- "AT+GMR\r\r\nAT versio"
AT+GMR
] "AT version:0.40.0.0(Aug 8 2015 14:45:58)\r\nSDK version:1.3.0\r\nAi-Thinker Technology C" <--- "n:0.40.0.0(Aug 8 2015 14:45:58)\r\nSDK version:1.3.0\r\nAi-Thinker Technology C"
] "Ai-Thinker Technology Co.,Ltd.\r\nBuild:1.3.0.2 Sep 11 2015 11:48:04\r\nOK\r\n" <--- "o.,Ltd.\r\nBuild:1.3.0.2 Sep 11 2015 11:48:04\r\nOK\r\n" -
• #5
Something odd is definitely happening.
at.cmd('', 10000, function cb(data) { if (data && data!="ready") return cb; at.cmd('ATE0\r\n', 10000, function (data) { console.log(data); // ask for version at.cmd('AT+GMR\r\n', 10000, function(data) { console.log(data); }); }); }); // power up
] "\nAi-Thinker Technology Co.,Ltd.\r\n\r\nready\r\n" <--- "\nAi-Thinker Technology Co.,Ltd.\r\n\r\nready\r\n"
["ATE0\r\n"
] "ATE0\r\r\n\r\nOK\r\n" <--- "ATE0\r\r\n\r\nOK\r\n"
ATE0
["AT+GMR\r\n"
OK
] "AT version:0.40.0.0(Aug 8 2015 14:45:58)\r\nSDK version:1.3.0\r\nAi-Thinker Technology Co.,L" <--- "AT version:0.40.0.0(Aug 8 2015 14:45:58)\r\nSDK version:1.3.0\r\nAi-Thinker Technology Co.,L"
] "Ai-Thinker Technology Co.,Ltd.\r\nBuild:1.3.0.2 Sep 11 2015 11:48:04\r\nOK\r\n" <--- "td.\r\nBuild:1.3.0.2 Sep 11 2015 11:48:04\r\nOK\r\n"Logging
data
always seems to be "behind" by one response. -
• #6
Ahh, so I have to throw away the 'ATE0' response because echo is not off at the time of issuing the command to turn echo off.
at.cmd('', 10000, function cb(data) { if (data && data!="ready") return cb; at.cmd('ATE0\r\n', 10000, function cb(data) { if (data=="ATE0") return cb; console.log(data); // ask for version at.cmd('AT+GMR\r\n', 10000, function(data) { console.log(data); }); }); }); // power up
] "\nAi-Thinker Technology Co.,Ltd.\r\n\r\nready\r\n" <--- "\nAi-Thinker Technology Co.,Ltd.\r\n\r\nready\r\n"
["ATE0\r\n"
] "ATE0\r\r\n\r\nOK\r\n" <--- "ATE0\r\r\n\r\nOK\r\n"
OK
["AT+GMR\r\n"
] "AT version:0.40.0." <--- "AT version:0.40.0."
] "AT version:0.40.0.0(Aug 8 2015 14:45:58)\r\nSDK " <--- "0(Aug 8 2015 14:45:58)\r\nSDK "
AT version:0.40.0.0(Aug 8 2015 14:45:58)
] "SDK version:1.3.0\r\nAi-Thinker Technology Co.,Ltd.\r\nBuild:1.3.0.2 Sep" <--- "version:1.3.0\r\nAi-Thinker Technology Co.,Ltd.\r\nBuild:1.3.0.2 Sep"
] "Build:1.3.0.2 Sep 11 2015 11:48:04\r\nOK\r\n" <--- " 11 2015 11:48:04\r\nOK\r\n" -
• #7
Ahh, thanks - yes, the EspruinoWiFi firmware does it automatically and I forgot :)
Here is a set of instructions for anyone who wishes to flash the ESP8266 on their Espruino WiFi to a newer firmware.
Undertake at your own risk, this involves some fiddly soldering, weird commands, strange cables, and other dark magic. Here be dragons.
First, solder two cables to the ESP8266 chip underneath your Espruino WiFi. See the attached image.
Next, take your 3v3 FTDI cable and connect the ESP8266 TX to FTDI RXD, and ESP8266 RX to FTDI TXD. Then connect GND on FTDI to the Espruino WiFi GND (-) pin.
Download the ESP8266 NONOS SDK V2.0.0 20160810 firmware from https://espressif.com/en/support/download/sdks-demos. I know the V2.1.0 firmware is released, but it does not support the version of ESP8266 that you have.
Unzip the firmware to your local machine. The files you want are inside
ESP8266_NONOS_SDK/bin
.Install esptool.py version 1.3 to your machine, this is dependant on your OS, so its up to you to get this done.
Once installed, you need to edit the python file with your text editor. Find it, and then look for the following lines:
ESP_RAM_BLOCK
ESP_FLASH_BLOCK
Make sure they look like this:
If you can't find these blocks, you probably don't have version 1.3, go back and try again.
Open a new terminal window and navigate to the directory with the new firmware. Remember to be in the directory
ESP8266_NONOS_SDK/bin
so you can seeesp_init_data_default.bin
,blank.bin
, and a directory calledat
. Ignoreat_sdio
directory.Plug in your FTDI cable to your computer and work out what device it is. For me on OS X it was:
/dev/cu.usbserial-FT97O28F
but this is very likely to be different for you.Next, connect your Espruino WiFi USB, then open your Espruino IDE. On the left side, paste and run:
Now for the magic command:
replace
/dev/cu.usbserial-FT97O28F
with the relevant FTDI device path for you, but everything else should stay the same.The output should look like this:
Unplug your FTDI cable, restart your Espruino WiFi.
Currently I'm not sure how to verify it is working in an easy way (you can connect directly to the ESP8266 using FTDI and issue
AT+GMR
). This code on Espruino should work, but I just see 'ready' as the output. Maybe @Gordon could shed some light.It would be great if someone else could test these steps, especially @Gordon, and it would be really-really great if the next version of Espruino WiFi has ESP8266 pins broken out somewhere :D
1 Attachment