I revisited the firmware demo code and echoed out all of setTimeout code except for:
setTimeout(function() { test(9600); }, 2000);
and I received the firmware printout on the console. So the baudrate the ESP8226 chip on the sparkfun's ESP8226 shield must be 9600.
I am now trying to execute:
Serial2.setup(9600, { rx: A3, tx : A2 });
var wifi = require("ESP8266WiFi_0v25").connect(Serial2, function(err) {
// ^^^^^^^^^^^^^^^^
// Use ESP8266WiFi here (and 9600 baud) if you have an ESP8266 with firmware older than 0.25
if (err) throw err;
wifi.reset(function(err) {
if (err) throw err;
console.log("Connecting to WiFi");
wifi.connect("WiFi_Name","WPA2_Key", function(err) {
if (err) throw err;
console.log("Connected");
// Now you can do something, like an HTTP request
require("http").get("http://www.pur3.co.uk/hello.txt", function(res) {
console.log("Response: ",res);
res.on('data', function(d) {
console.log("--->"+d);
});
});
});
});
});
and received:
Uncaught No 'ready' after AT+RST at line 1 col 16 if (err) throw err;
^ in function "a" called from line 2 col 100 ...a("No 'ready' after AT+RST");else return b
^ in function "b" called from line 1 col 15 d=void 0;b&&b()
^ in function called from system
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I revisited the firmware demo code and echoed out all of setTimeout code except for:
and I received the firmware printout on the console. So the baudrate the ESP8226 chip on the sparkfun's ESP8226 shield must be 9600.
I am now trying to execute:
and received: