-
-
OK, so I tried 60 seconds in the interval and got 19 connections but then got the following error after the final response printout:
Response: { "headers": { "Date": "Fri, 29 May 2015 07:58:17 GMT", "Server": "Apache/2.2.14 (Ubuntu)", "Last-Modified": "Fri, 15 Nov 2013 15:42:26 GMT", "ETag": "\"c01036-d-4eb390b8a8d18\"", "Accept-Ranges": "bytes", "Content-Length": "13", "Vary": "Accept-Encoding", "Connection": "close", "Content-Type": "text/plain" }, "httpVersion": "1.1", "statusCode": "200", "statusMessage": "OK" } >Uncaught Error: Unlink already registered at line 2 col 22 " already registered");g[a]=b} ^ in function "registerLine" called from line 1 col 159 ...Line("Unlink");e[b]=void 0});else throw e[b]=void 0,Error("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 ERROR: Socket error -1 while sending Uncaught Error: CIPSTART failed at line 1 col 207 ...d 0,Error("CIPSTART failed");} ^ in function "d" called from line 1 col 16 {e=void 0;d&&d()} ^ in function called from system ......
-
-
Thanks Gordon,
It was actually the fact that you suggested in your guide that you are not able to have a server and client running at the same time that prompted the question.
So, the php remote address is neat, I should of known that. But to stamp it to a unique ID (like the board SN) a client call would be needed first anyway.
To make this work, I would call the function above first to establish the connection to the Pi / register with the Pi that the Pico exists and is available for communicating, then start the server and listen for commands. Sounds OK to me.
Thanks for the tips, I will experiment...
-
Hello Gordon,
I can't believe how helpful you have all been. DrAzzy and yourself have been great in responding so fast. Thank you for the trimmed down version it makes it perfectly clear now.
One small question more I have is "Is it possible to take the wifi.getIP() function and make a request to a server passing the IP address as a part of the query string?"
For example http://192.168.0.2/get_pico_ip.php?picoid=pico001&ip=192.168.0.171
So in other words, I have have my Pi listening out for requests from Pico's making connections to network. The request is an announcement what the IP address is of the Pico after connection. This get's logged as a dynamic IP and can then be used by the Pi server to remotely connect and make calls, set values etc just like in your interactive web page.
If not, I would need to set up my router to issue the same IP address for the MAC ID following initial connection, which is OK, but a dynamic approach is better I think.
-
OK Thanks for the reply.
I see what you are doing here and it does give me some good pointers.I have just found Gordon's example of an interactive webpage
http://www.espruino.com/Interactive+Web+UI
which is exactly the sort of thing I was trying to do. On loading it just worked!
This is so cool.
Thanks again.
-
Got mine up and running after updating firmware. Works perfectly. Great video, thanks.
What would be nice is some example http server code to compliment the client connect code.
Is there any on the site for the ESP8266? All the original examples are not for this new module and I am having a tough time trying to translate.I am attempting to create a network of sensors controlled by a Raspberry Pi server. The Pi connects to the remote Pico's and issues commands to the listening pico's. These commands could be to retrieve values directly from the pins or to set pins to a state or call functions stored on the pico. Got a simple version working via the USB interface, but now I would like to wirelessly connect.
Any help will be useful.
-
Thanks Gordon,
I do have the latest 1.79 firmware installed. Perhaps this is my service provider in Spain taking ages to complete the connection to your test URL?
I can set up a local server and test again to rule out ISP delays etc. I will check back later.