-
Thanks !
Tried this ..
Serial2.setup(9600, { rx: A3, tx : A2 });
wlan.at.cmd("AT+GMR\r\n",1000,console.log);Got
echo(0);
=undefined
Uncaught Error: Field or method "at" does not already exist, and can't create it on undefined
at line 1 col 5
wlan.at.cmd("AT+GMR\r\n",1000,console.log);Have I got the right firmware ? Is there a special build to support the 8266 ?
-
I'm not getting out of the starting blocks with this.
With this simple code
Serial2.setup(9600, { rx: A3, tx : A2 }); var wifi = require("ESP8266WiFi").connect(Serial2, function(err) {if (err) throw err;wifi.getAPs(print);});
I get ..
>reset(); =undefined _____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v79 Copyright 2015 G.Williams >echo(0); =undefined >Uncaught No 'ready' after AT+RST at line 1 col 17 {if (err) throw err;wifi.getAPs(print);} ^ in function "a" called from line 1 col 100 ...a("No 'ready' after AT+RST");else return c} ^ in function "b" called from line 1 col 16 {c=void 0;b&&b()} ^ in function called from system
So it looks like I am not even talking to the 8266. Cabling is Ok. I have a 47uF cap across the power lines. Cabling possibly a bit hacky, have the 8266 board attached via header cable to breadboard where the Pico is plugged in. Have checked usual shorts and that all the pins are happy. They are. And that
URXD -> Pico A2
UTXD _> Pico A3
VCC -> +3.3
GND -> GND
CH_RD -> +3.3 (is this right? permanently tied to +3.3?)My iPhone is actually seeing a WiFi Network called ESP8266 appear when I boot, though. So I guess the module is alive. When it boots, I see a steady red led on the board, and a couple of flashes from the blue led.
Have tried 115,200 as baud rate too. Same problem.
Any ideas please ?
Thanks!
Pat
-
-
-
-
-
-
-
-
Evidence of what is going on is tricky. I am not convinced it is (only) a timing problem. I put a 5 second delay after each link click and ran the macro .. it managed 31 complete iterations before returning the 10061 error. Next time, only 8 iterations.
On the other hand, it could still be a timing issue. I don't think this test can properly point us in one direction or the other to be honest.
-
-
-
The Espruino console stays alive and responsive. Pings work all the time, even when the connection is refused.
My macro runs continuously until I get the error (I cannot see any pattern as to which iteration it fails on - The macro is just hitting each of the 8 links on the page in sequence, over and over). When it eventually fails, issuing a eth.setIP() fixed it on the first 15 or so occasions (I did not count, but I can if helpful). After the 15th (or whatever it was) eth.setIP() does not revive it, but loading the whole script again does.
The good news it that none of this is causing the Espruino to crash or drop the COM port.
-
Much better I think. My -7 error and out of sockets seem better/fixed, but I am still seeing
[Fiddler] The socket connection to 192.168.254.248 failed. ErrorCode: 10061. No connection could be made because the target machine actively refused it 192.168.254.248:8080
when I repeatedly click on the various buttons created by this code
E.enableWatchdog(10); var eth = require("WIZnet").connect(); /* eth.setIP({ ip : "192.168.254.248" }); eth.setIP({ dns : "208.67.222.222" }); eth.setIP({ gateway: "192.168.254.100" }); */ eth.setIP(); eth.getIP(); function onPageRequest(req, res) { res.writeHead(200, {'Content-Type': 'text/html'}); res.write('<html><body>'); res.write('<p>Button is '+(BTN.read()?'on':'off')+'</p>'); res.write('<p>Turn LED1 <a href="/on1">on</a> or <a href="/off1">off</a></p>'); res.write('<p>Turn LED2 <a href="/on2">on</a> or <a href="/off2">off</a></p>'); res.write('<p>Turn LED3 <a href="/on3">on</a> or <a href="/off3">off</a></p>'); res.write('<p>Turn all LEDs <a href="/onall">on</a> or <a href="/offall">off</a></p>'); res.end('</body></html>'); if (req.url=="/on1") digitalWrite(LED1, 1); if (req.url=="/off1") digitalWrite(LED1, 0); if (req.url=="/on2") digitalWrite(LED2, 1); if (req.url=="/off2") digitalWrite(LED2, 0); if (req.url=="/on3") digitalWrite(LED3, 1); if (req.url=="/off3") digitalWrite(LED3, 0); if (req.url =="/onall") { digitalWrite(LED1,1); digitalWrite(LED2,1); digitalWrite(LED3,1); } if (req.url =="/offall") { digitalWrite(LED1,0); digitalWrite(LED2,0); digitalWrite(LED3,0); } } require("http").createServer(onPageRequest).listen(8080);
I am using a little chrome extension called iMacros to record a set of clicks on the page and then run in a loop.
-
-
-
A bit more, if I just execute the http.get it works fine. Eventually I get an ERROR: No sockets found (or somesuch) [There is another thread on this - the sockets do close after a time and there is a limit of 8 (?) open at any one time ... so leaving a time gap between the gets would solve this] .. but once I get the error I then get a nasty bunch of this ..
INTERNAL ERROR: Timeout on SPI TX INTERNAL ERROR: Timeout on SPI TX INTERNAL ERROR: Timeout on SPI RX INTERNAL ERROR: Timeout on SPI TX INTERNAL ERROR: Timeout on SPI TX
followed by the ESPRUINO disconnecting itself from the COM port.
BUT for me, the extenal DNS resolution is working just fine :)
-
This seems to work ok for me .. with this code for example ..
E.enableWatchdog(10); var eth = require("WIZnet").connect(); eth.setIP(); var http = require("http"); http.get("http://www.bbc.co.uk", function(res) { res.on('data', function(data) { console.log(data); }); });
So I get back the contents of whatever page I specify .. http://www.bbc.co.uk here
Though it only works once unless I reboot in between .. executing the same code twice gives me a "ERROR: Socket error -7 while sending"
-
Yeah .. well, we're definitely heading in the right direction. Wrinkles remain. The goal of rock solid Ethernet support remains. Would love to think that the CC3000 would behave at some point, but WIZnet seems a more achievable goal in the short term.
I'll have a play today with various things that I could not get to work before. For example, I could never get DHCP to work at all previously. And I would get totally random MAC addresses !
-
Attempting to re-load all of the code gave ...
INTERNAL ERROR: Timeout on SPI TX INTERNAL ERROR: Timeout on SPI TX INTERNAL ERROR: Timeout on SPI RX INTERNAL ERROR: Timeout on SPI TX INTERNAL ERROR: Timeout on SPI TX INTERNAL ERROR: Timeout on SPI RX INTERNAL ERROR: Timeout on SPI TX INTERNAL ERROR: Timeout on SPI TX INTERNAL ERROR: Timeout on SPI RX INTERNAL ERROR: Timeout on SPI TX INTERNAL ERROR: Timeout on SPI TX INTERNAL ERROR: Timeout on SPI RX >reset(); =undefined _____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v63 Copyright 2014 G.Williams >echo(0);
-
-
-
-
I'm sorry. Lost. Too newbie, I suspect ! This ?
Serial2.setup(9600, { rx: A3, tx : A2 });
var wifi = require("ESP8266WiFi");
wifi.at.cmd("AT+GMR\r\n",1000,console.log);
Don't understand how (without the connect) I talk down Serial2.
Anyway, this code errors with ...
Uncaught Error: Field or method "cmd" does not already exist, and can't create it on undefined
at line 1 col 8
wifi.at.cmd("AT+GMR\r\n",1000,console.log);