-
-
-
Where I have written ESP8226 I meant to write ESP8266, oops. The baud rate is 9600 :). I'm still getting the Uncaught No 'ready' error. I then tried to communicate directly to the shield via an FTDI and termite(serial terminal). I have the auto line termination set to carriage return and new line. The only command I can get an OK back is AP any other command I send to it results in an ERROR.
I sent off a bunch of ESP v2 shims to oshpark and ordered a bunch ESP boards from sparkfun. Hopefully my luck will change once I receive those in the mail.
-
-
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
-
This is strange. I am not longer receiving the NetworkJS and http not found error; however, I am only receiving this in the Console:
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
The Gotchas section of the ESP8226 tutorial page says:
Uncaught No 'ready' after AT+RST? Check you've got the correct
firmware and baud rate, and that your wiring is correct.After executing the ESP8226 firmware demo code I receive:
"AT+GMR\r\r\nAT version:0.30.0.0(Jul 3 2015 19:35:49)\r\nSDK version:1.2.0\r\ncompile time:Jul 7 2015 18:34:26\r\nOK\r\n" "\x00" "àà\x00\x00" Done!
Am I correct by saying that my wiring is correct since I received the version response? I am not sure what else I can do to troubleshoot....
-
-
I'm trying to use an ESP8226 and I managed to screw up a couple of picos while trying to solder on the ESP8226 shim. I no longer have shims for the ESP8226 and I am now using: https://www.sparkfun.com/products/13287 There is a switch located on the sparkfun's ESP8266 shield for Software Serial and Hardware Serial. I'm using the Software Serial pins on the ESP8266 shield and used jumper wires from the Hardware Serial RX and TX to pin A2 and A3 for successful communication.
I ran the firmware js code:
//var serial = Serial2; var pins = { rx: A3, tx : A2 }; function test(baud) { Serial2.removeAllListeners(); var l=""; Serial2.on('data', function(d) {l+=d;}); Serial2.setup(baud, pins); Serial2.write("AT+GMR\r\n"); setTimeout(function(){console.log(JSON.stringify(l));},800); } //digitalWrite(B9,1); // enable on Pico Shim V2 setTimeout(function() { test(9600); }, 2000); setTimeout(function() { test(115200); }, 3000); setTimeout(function() { test(57600); }, 4000); setTimeout(function() { console.log("Done!"); }, 5000);
Which resulted:
"AT+GMR\r\r\nAT version:0.30.0.0(Jul 3 2015 19:35:49)\r\nSDK
version:1.2.0\r\ncompile time:Jul 7 2015 18:34:26\r\nOK\r\n" "\x00"
"àà\x00\x00" Done!I'm assuming that I should use the serial baud rate of 115200 because the ESP8226 firmware is 0.30.0.0?
I am now attempting to get basic communication from the ESP8226 and using the code below. However, I am receiving
Module NetworkJS not found
and
Module http not found
Code:
Serial2.setup(115200, { 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); }); }); }); }); });
-
-
@Gordon another adapter board that might be worth making/modifying is an Arduino adapter board with a spot to solder on an esp8266. I've been using the Arduino adapter board with success, but I'm not sure if it's possible to solder down a pico with the esp8266 adapter already soldered onto the pico.
-
-
@Gordon This is really good news! I'm assuming TLS 1.2?
-
Working code:
TempSensor.prototype.getTempValue = function () { var w = new Waveform(128/* your buffer size */,{doubleBuffer:false, bits:16}); var p = this.aPort; w.on("finish", function(buf) { var first = true; var myarr = w.buffer; myarr.sort(); // cut off first and last 2 elements var view = new Uint16Array(myarr.buffer, 2/*sizeof(uint16)*/*2, myarr.length-4); var vOut = E.getAnalogVRef() * E.sum(view)/(view.length*65536); // if you attached VOUT to Ao var vZero = 0.4; var tCoeff = 19.5 / 1000; var tempinc = (vOut - vZero) / tCoeff; var tempinf = tempinc * (9 / 5) + 32; console.log("Temp in C: " + tempinc); console.log("Temp in F: " + tempinf); console.log("myarr: " + myarr.buffer); console.log("view: " + view); //console.log(E.sum(view)/(view.length*65536)); }); w.startInput(p,2000 /* Samples per second */); };
-
Outside of the prototype function I did, after adding an ifstatement, with success:
var w = new Waveform(128/* your buffer size */,{doubleBuffer:false, bits:16}); var first = true; setInterval(function() { if (!first) { var myarr = w.buffer; myarr.sort(); // cut off first and last 2 elements var view = new Uint16Array(myarr.buffer, 2/*sizeof(uint16)*/*2, myarr.length-4); var vOut = E.getAnalogVRef() * E.sum(view)/(view.length*65536); // if you attached VOUT to Ao var vZero = 0.4; var tCoeff = 19.5 / 1000; var tempinc = (vOut - vZero) / tCoeff; var tempinf = tempinc * (9 / 5) + 32; console.log("Temp in C: " + tempinc); console.log("Temp in F: " + tempinf); //console.log(E.sum(view)/(view.length*65536)); } else first = false; // start it again w.startInput(A0,2000 /* Samples per second */); }, 200);
-
I added:
console.log("Temp in C: " + tempinc); console.log("Temp in F: " + tempinf); console.log("myarr: " + myarr.buffer); console.log("view: " + view);
output:
Temp in C: -20.51282051282 Temp in F: -4.92307692307 myarr:
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
view:
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -
I'm receiving negative values when attempting to use this code:
TempSensor.prototype.getTempValue = function () { var p = this.aPort; //<-- equals A0 var w = new Waveform(128/* your buffer size */,{doubleBuffer:false, bits:16}); var first = true; var myarr = w.buffer; myarr.sort(); // cut off first and last 2 elements var view = new Uint16Array(myarr.buffer, 2/*sizeof(uint16)*/*2, myarr.length-4); var vOut = E.getAnalogVRef() * E.sum(view)/(view.length*65536); // if you attached VOUT to Ao var vZero = 0.4; var tCoeff = 19.5 / 1000; var tempinc = (vOut - vZero) / tCoeff; var tempinf = tempinc * (9 / 5) + 32; console.log("Temp in C: " + tempinc); console.log("Temp in F: " + tempinf); //console.log(E.sum(view)/(view.length*65536)); w.startInput(p,2000 /* Samples per second */); };
-
-
@allObjects I used the Raspberry in the past but I ran into SD card issues where they would get corrupted if the PI was shutdown down incorrectly. The Edison doesnt have any display ports so I opted to use a Nextion 4.3" touch screen from itead studios.
@Gordon I just cut the pins, but come to think of it, I should of bent the pins for the reusability factor. I don't believe the Edisons GPIOs are open circuit to begin with. I think I had to edit the pin table file in order to use the serial pins and I believe that goes for the i2C also. I configured the Edison a while ago and set it to the side for a couple of months until I had a reason to use it, so I don't quite remember .
Hrmm, I wonder if I can edit the pin table and swap the Edisons pin 1 and 0. That would remove the hassle of having to cut traces or running wires. I'll research that and see what I can do, but for now, I connected the leads from the Edisons 1 and 0 port to the picos A3 and A4 pins for the Serial2 communication. -
Are these SMT ceramic caps polarized?
Links to the ceramic caps that I have:
Multilayer Ceramic Capacitors MLCC - SMD/SMT0805 0.1uF 50volts X8R 10%Multilayer Ceramic Capacitors MLCC - SMD/SMT0805 1uF 50volts X7R +/-10%
Multilayer Ceramic Capacitors MLCC - SMD/SMT0805 2.2uF 35volts X7R +/-10%
-
@allObjects what I'm doing may sound silly and still confuses me at times lol. The reason for what I am trying to accomplish is more of an "instantaneous " feel during the boot up time that the Edison takes. The Pico controls my sensors(i2c), touch screen, and 7 segment displays(i2c). The Edison takes care of the webserver, network and encryption. The Pico and the Edison will communicate back and forth between the picos serial2 and the Edisons pins 1 and 0. The Pico will send over the data once it's calculated via serial2 to the edison. The Edison will then take care of plotting the sensors data to a graph.
-
@Gordon Yep, TX and RX need to be swapped :-) I attached two pictures to show what I did to get this to work :) Seems like the TX1 and RX0 are connected to the pico console . I'll need to check the pico's ref page to figure out which pins are serial2 rx and tx also check the cad file to figure out the pin mappings to serial2(if there is such a thing on the shield).
-
@Gordon I am using this board: https://github.com/espruino/EspruinoBoard/blob/master/Pico/Adaptors/eagle/arduino.png
And doh, I feel stupid now. I assumed the board was a shield :/ I will do what you suggested and cut the traces after I test out the connections with connecting jumper wires. Any tips on how to cut the traces?
-
My goal is to get the Espruino Arduino shield adapter to communicate via Serial with the Intel Edison Arduino breakout board correctly. Currently, it seems like there is interference as if there wasn't a common ground between the arduino shield adapter and the Intel Edison Arduino breakout. I have the Espruino Arduino shield connected into the Intel Eidson Arduino breakout sockets. I'm getting garbage data:
I then disconnect the Arduino shield adapter from the Intel Edison Arduino breakout and connect the grounds using breadboard jumper wires and the garbage characters stop.
I'm not understanding why when I connect the adapter directly to the intel edison breakout sockets I get the garbage characters and when I use jumper wires I don't receive the garbage characters.
Are both the ground pins of the Espruino Arduino adapter socket not connected to the Espruino pico GND pin?
-
@Gordon would something like https://libwebsockets.org/index.html work?
@Kolban sounds like a plan :-)