thanks for taking the time to develop this code, kevin. got my 8266 up and running with it. just a tip for those who are having "timeout" issues from the read_until_ESP function, it's likely because the firmware version on your ESP8266 is different than what kevin used and is spitting out different responses (keywords). on the main "BASE" code page where the keywords are defined, i had to change "Ready" to "ready" (as is mentioned by kevin's comment). i also had to change "Unlink" to "0,CLOSED". i haven't played around too much with this yet, but i'll keep updating this comment if i find any of the other keywords are different with my firmware version.
Nice info. BTW, a caret is like a hat. Those things are left and right "angle bracket". Where did you get caret? A course in vector algebra and rotated the symbol 90 deg?
Great video. I am looking some advise. I am planing to connect a number of sensors to get data and then upload it in to the internet. Should I use this as main micro controller or just as a Wifi module?
Hi dear Kevin, thanks for the Good Job you have done... But I am getting this Error while Compiling your Code; I have just Changed the SSID Name and SSID Password ... cant understand what to do ? I am new to ESP8266 and using ESP8266 ESP-12e NodeMCU Module /////////////////////////////////////////////////// Arduino: 1.6.6 (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, 115200, 4M (3M SPIFFS)" :0:9: error: expected unqualified-id before numeric constant C:\Users\MKBUTAN\Desktop\ESP8266_BASE_01_28_15\ESP8266_BASE_01_28_15.ino:18:16: note: in expansion of macro 'ESP8266' SoftwareSerial ESP8266(ESP8266_rxPin, ESP8266_txPin);// rx tx ^ C:\Users\MKBUTAN\Desktop\ESP8266_BASE_01_28_15\ESP8266_BASE_01_28_15.ino: In function 'void setup()': ESP8266_BASE_01_28_15:69: error: request for member 'begin' in '1', which is of non-class type 'int' ESP8266.begin(9600);//default baudrate for ESP ^ ESP8266_BASE_01_28_15:70: error: request for member 'listen' in '1', which is of non-class type 'int' ESP8266.listen();//not needed unless using other software serial instances ^ C:\Users\MKBUTAN\Desktop\ESP8266_BASE_01_28_15\connect_ESP.ino: In function 'boolean connect_ESP()': connect_ESP:4: error: request for member 'print' in '1', which is of non-class type 'int' ESP8266.print("AT+CIPSTART=0,\"TCP\",\"api.thingspeak.com\",80 ");//only connecting to thingspeak ^ connect_ESP:9: error: request for member 'print' in '1', which is of non-class type 'int' ESP8266.print("AT+CIPSEND=0,");//send AT+CIPSEND=0, size of payload ^ connect_ESP:10: error: request for member 'print' in '1', which is of non-class type 'int' ESP8266.print(payload_size);//the payload size ^ connect_ESP:12: error: request for member 'print' in '1', which is of non-class type 'int' ESP8266.print(" ");//cap off that command with a carriage return and new line feed ^ connect_ESP:17: error: request for member 'print' in '1', which is of non-class type 'int' ESP8266.print(payload[i]); ^ C:\Users\MKBUTAN\Desktop\ESP8266_BASE_01_28_15 ead_until_ESP.ino: In function 'boolean read_until_ESP(const char*, int, int, byte)': read_until_ESP:18: error: request for member 'available' in '1', which is of non-class type 'int' while(!ESP8266.available()){//wait until a new byte is sent down from the ESP - good way to keep in lock-step with the serial port ^ read_until_ESP:25: error: request for member 'read' in '1', which is of non-class type 'int' data_in[i]=ESP8266.read();// save the byte to the buffer 'data_in[] ^ read_until_ESP:56: error: request for member 'available' in '1', which is of non-class type 'int' while(!ESP8266.available()){// same thing as done in the buffer ^ read_until_ESP:65: error: request for member 'read' in '1', which is of non-class type 'int' data_in[key_size-1]=ESP8266.read();//save the new data in the last position in the buffer ^ C:\Users\MKBUTAN\Desktop\ESP8266_BASE_01_28_15\serial_dump_ESP.ino: In function 'void serial_dump_ESP()': serial_dump_ESP:5: error: request for member 'available' in '1', which is of non-class type 'int' while(ESP8266.available()){ ^ serial_dump_ESP:6: error: request for member 'read' in '1', which is of non-class type 'int' temp =ESP8266.read(); ^ C:\Users\MKBUTAN\Desktop\ESP8266_BASE_01_28_15\setup_ESP.ino: In function 'boolean setup_ESP()': setup_ESP:3: error: request for member 'print' in '1', which is of non-class type 'int' ESP8266.print("AT ");// Send just 'AT' to make sure the ESP is responding ^ setup_ESP:11: error: request for member 'print' in '1', which is of non-class type 'int' ESP8266.print("AT+RST ");// Give it a reset - who knows what condition it was in, better to start fresh ^ setup_ESP:18: error: request for member 'print' in '1', which is of non-class type 'int' ESP8266.print("AT+CWMODE=");// set the CWMODE ^ setup_ESP:19: error: request for member 'print' in '1', which is of non-class type 'int' ESP8266.print(CWMODE);//just send what is set in the constant ^ setup_ESP:20: error: request for member 'print' in '1', which is of non-class type 'int' ESP8266.print(" "); ^ setup_ESP:28: error: request for member 'print' in '1', which is of non-class type 'int' ESP8266.print("AT+CWJAP=\"");// set the SSID AT+CWJAP="SSID","PW" ^ setup_ESP:29: error: request for member 'print' in '1', which is of non-class type 'int' ESP8266.print(SSID_ESP);//from constant ^ setup_ESP:30: error: request for member 'print' in '1', which is of non-class type 'int' ESP8266.print("\",\""); ^ setup_ESP:31: error: request for member 'print' in '1', which is of non-class type 'int' ESP8266.print(SSID_KEY);//form constant ^ setup_ESP:32: error: request for member 'print' in '1', which is of non-class type 'int' ESP8266.print("\" "); ^ setup_ESP:41: error: request for member 'print' in '1', which is of non-class type 'int' ESP8266.print("AT+CIFSR ");//command to retrieve IP address from ESP ^ setup_ESP:59: error: request for member 'print' in '1', which is of non-class type 'int' ESP8266.print("AT+CIPMUX=");// set the CIPMUX ^ setup_ESP:60: error: request for member 'print' in '1', which is of non-class type 'int' ESP8266.print(CIPMUX);//from constant ^ setup_ESP:61: error: request for member 'print' in '1', which is of non-class type 'int' ESP8266.print(" "); ^ exit status 1 request for member 'begin' in '1', which is of non-class type 'int' This report would have more information with "Show verbose output during compilation" enabled in File > Preferences. \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ Please Help
Does the Arduino IDE support the normal C string library, such as length of a string, position of a substring within a string, string concatenation, etc.? If so, I'm curious why you're doing this manually. Is that faster or more efficient?
Hi Kevin, i took me really i while but now it is working, uploading data and getting data from THINGHTTP. I am really a fan of your videos!! :-) Your explanations are fantastic, also the video explaining the manchester coding was brilliant!
Hey! Great Video. I am having a compiling problem. I just copied and pasted your code and didnt edit anything except SSID and its keywords. The error is" request for member 'begin' in '1', which is of non-class type 'int'". Please help me.
How do i connect this to the arduino mega? i cant seem to get it to work, serial monitor showing everything on fail, and when i run at commands directly to the esp it works, any help?
Hi I am not able to flash my ESP8266 module, when I am tryiny to enter AT commands via serial monitor it is showing me some irrelevant output and also ESP8266 flasher is not able to fetch MAC Address. Thanks
I have DCcduino + ESP8266. Direct "AT" command work fine. But SoftwareSerial not. I have tried program with very basic version with SoftwareSerial, and anything helps. I have original fimw., without any update, external Power Source, and ESP-01 socket, which change voltage to 3,3V DC, 9600 bit rate. 2xBlink blue Light, but any respond with SoftwareSerial. Any Idea? Muss I update fw? Or could Socket have any influence?
hey, i am already a big fan of your videos.... just need a small help... i get these errors... could you please help... :0:9: error: expected unqualified-id before numeric constant c:\ESP8266_BASE_01_28_15.ino:18:16: note: in expression of macro 'ESP8266' SoftwareSerial ESP8266(ESP8266_rxPin, ESP8266_txPin); ^ please help
Hello, can u say when the next video will beuploaded where the data is going the other direction. That i can see a measured temperature under a URL? I´m looking forward to this :)
Realy nice tutorial Kevin but did you consider using the String library to deal with finding and retrieving parts of strings? I think things will became much simpler.
Hi, and thanks for all the tutorials, i have a problem, i want too load some information from a website, but too get access too this website (gamingsite) i need too log on with an API key from a game. Any idea how i can solve this?
Hello. Arduino beginner here, so please bear with me if the question is stupid or obvious: what happens if the parsing in ThingSpeak never works? I tried your example exactly and others with other websites and it always returned an error message to me: "Error parsing document, try a different parse string." Any help would be greatly appreciated. I'm trying to find a way to get weather data from a website so that I can get my Arduino (with an Adafruit CC3000 WiFi shield) to read it. Thanks! EDIT: At the time of this edit, works for the temp in openweathermap.org/ but not others.
Sir i have uploaded a code to my esp-01 through arduino(blinks led)but i lost my older at firmware of board(not able to do AT commands anymore :( ).PLz Help.
Hello there , which library i have to download to compile successfully the code which is done by Sir Kevin Darrah? i face the error while compiling the code..
+Srijal Poojari , Actually my simple code cant be upload to the ESP8266 Module through the arduino uno board and the arduino IDE itself. i have conncted every pinouts perfectly..and the error is like this warning: espcomm_sync failed error: espcomm_open failed
+Digant Goradia In the video series, the code is uploaded to the Arduino and not the ESP itself. According to your error, you want to upload some other code to the esp directly, for which you should use a USB to Serial converter. The Arduino can to this but its a mess to set it up. I have tried it many times but in the end I just bought a USB to Serial converter and things are smooth now.
You don't have to have the CIPMUX set to one for TCP communications. Only if you are going to use more than one socket. I send emails out using a TCP connection to a email server just fine in that mode.
I am trying to write this back for avr-gcc and so far so good..but I am stuck at ESP.8266.print(payload_size) part...i am using uart_puts(payload_size) but i got an error Warning passing argument 1 of 'uart_puts' makes pointer from integer without a cast [-Wint-conversion] the output suppose to be "AT+CIPSEND=0,85" but instead i got "AT+CIPSEND=0, " Nevermind...I have managed to finish it..everything is working perfectly.. Hope you can teach us more on how to get more data from websites...thanks
Hello everyone. I'm new in ESP8266 and wanted to do something more simple as reading just a 4-digit number from the Internet. can you help me, Please? Thanks advance
Walter Spurer haven't gotten there yet, but will make a video on that as well. There's a ton of stuff out there on this part, so just try googling around.
I followed all this steps shown in this tutorial, but, when I sent de GET command to retrieve the data ... it caused an problem that the informations retrieved was greater than the arduino´s buffer size, the default is 64 bytes, even changed the size to 256 it is not enough, cause the answer of the command GET comes with the http header not only the information retrieved as shown when you put the GET command. Used and arduino UNO, and other NANO, but the results was the same, does not get all data. There is an way to read more data than 64 bytes ? Because, when I read the buffer, the rest of the information does not appears any more - eps.available() is equal to zero - no bytes remains in the buffer the be read. You can give me a clue, to solve this problem? How can I receive the answer from the Thingspeak whitout the http header, only the data I am asking using the parse command? Thanks...
+Bob “bobdabiulder” dabiuld Yes, every time you reset power as esp does not store SSID and pass details. It may be possible if you directly program the ESP
Really really great job you're doing right there. I like the way you write the code and the way you explain it. It really make me want to try this stuff. :) Thanks for sharimg, I'm looking forward for your next video.
Hey Kevin, Thanks for the video. I was wondering if you have played around with NodeMCU Firmware for the ESP8266 and programming in lua. It's a solution that means the board only needs power and no arduino as you can upload your lua code directly onto the board. github.com/nodemcu/nodemcu-firmware. Maybe you can have a play around and make a video on it. Also how do you power your board? I now know after much failure that 3.3v pin on the arduino doesn't have enough current. It works a bit better when I use 3.3 from a usb programmer but I get another problem; the usb device doesn't show up unless reset is connected to ground (although it should be pulled high no?). Can you think what I might be doing wrong?
***** ah yes good point, and this has happened to me before - nice thing is that you just have to update the thingspeak app, not your code on the micro.
Kevin Darrah Yes, I agree and it is a good thing, it now acts as a data proxy to the micro-controller anyway good work and hope to see you more of you again.
I received : //*[@id="browse-items-primary"]/li/div/div[1]/div/span[2]/b and i paste, the message is : Error parsing document, try a different parse string. Can you help me ? Thanks! Marc.
+Marc Paradis I got the same Error on a few webpages, but it works well on the others. Try using a different website for the data you want if possible. And let me know if you find a solution for this error.
+Srijal Poojari Hi guys, i talked with thingspeak support a couple of months ago, and they said that you can't use this "thing" on every page. It works on UA-cam (HTML, HTML5) but not with other formats.
For me, this XPath(//*[@id="browse-items-primary"]/li/div/div[1]/div/span[2]/b) doesnt work too.Try this one: //*[@id='browse-items-primary']/li/div/div[3]
Hello Kevin. I've really enjoy your videos and how deep you get into each device/technology, even referencing the datasheets. Thank you. Since you covered both the ESP and the NRF24, I was wondering it you explored using the ESP AS a NRF24 with an onboard MCU. Maybe disabling the wifi/ip stuff and controlling antenna semi-directly. Like an arduino+NRF24 alternative with the ability to switch into wifi mode when needed. Thanks again.
Why aren't you loading the data from the UA-cam API? For me as a software developer, parsing HTML to get specific data is the worst idea ever. And thus, advising to do so is somewhat dangerous, if you ask me ;) Also, HTTP itself does not want the host name to be in the query. The HTTP query normally looks like this: "METHOD /path_of_resource/resource HTTP/version". You connect to a server (IP or host) and then tell the server to GET / POST / PUT / DELETE / ... / a specific resource ON THAT server, so there is no technical need for the hostname to be there. So does the board do some parsing of the serial input itself?
Because the UA-cam API requires api keys/login and maybe it's too much overhead for the Arduino. There's nothing wrong with the way he's doing it for what he's trying to accomplish. It's not "dangerous" it's just not a complete solution. The benefit is, if the path to the data changes, he just needs to update Thinkspeak and the device code still works.
Hi guys! I upload the code on my Arduino Uno R3. So before that I test AT and it returns OK but when start Arduino with downloaded code i get ... timeout ESP CHECK FAILED What can cause this ?
Kevin Darrah 10x for the replay. I'm completely new to Arduino so I tried Tutorial Part 1 video step by step so I was able to get my data form api.thingspeak.com trough Serial Monitor. However can you tell me about this: void setup() { // put your setup code here, to run once: Serial.begin(9600); Serial.print("AT "); } void loop() { // put your main code here, to run repeatedly: } Should I see in SerialMonitor OK after above code, because I don't ? OR I tried this too but it never find "OK": void setup() { Serial.begin(9600); Serial.print("AT "); // or "AT" or "AT
" or "AT
" if (Serial.find("OK")) { Serial.print("OK IT IS READY"); } } p.s. AT+GMR gives me 0018000902-AI03 AT+RST gives me [Vendor:www.ai-thinker.com Version:0.9.2.4] ready
Kevin Darrah OK i figure it out. And is this expected behaviour ? When i first mange to run ESP8266 when I try Serial Monitor commands there was no response. So I switch RX and TX like that RX-RX TX-TX and Serial Monitor commands start working. Now I make it like that RX-TX and TX - RX and this code: void setup() { Serial.begin(9600); Serial.print("AT "); // or "AT" or "AT
" or "AT
" if (Serial.find("OK")) { Serial.print("OK IT IS READY"); } } returns "OK IT IS READY", but now again I can't send command trough Serial Monitor. When I type In Arduino's RX blink bit but terminal is empty.
Hey Kevin' great tutorial. I really love your tutorials and they're simply the best out there. But you should really consider using the actual API for getting data from websites since the current method while it works just fine its a lot of overheard and its not proper since websites change their layouts all the time.
Hoping someone can help with an issue setting the baud rate on the esp8266. I updated to this latest version of the cloud update: AT+GMR AT version:0.21.0.0 SDK version:0.9.5 OK I can connect well via USBTTL at 115200 but cannot change baud to 9600 so it will work with the arduino script in this video. I've tried AT+CIOBAUD=9600 but that's not supported any longer (returns ERROR). I found reference saying the right command is now: AT+IPR=9600 but when I do that I cant communicate with it at any baud rate and need to reflash the esp.
Quick update...I was able to get this to work by downgrading the esp8266 to v0.9.2.2 firmware which apparently defaults the baud rate to 9600. For some reason, when I upgrade to the cloud version (v0.9.5), it sets baud rate to 115200 and the typical AT commands to change it to 9600 so it talks to the arduino don't seem to work.
Great video, I really appreciate you taking the time to write all that code, and share it with the community, however I ran into a bit of a problem with this code. Using a 3.3v Arduino Pro Mini with an 8MHz clock, I am unable to read data out of a web page. Pluging my 3.3v FTDI into the SoftwareSerial RX side of the Arduino, I can see the data being passed to the Arduino, but if I Serial.print the data_in buffer as it is running, I can see large gaps in the page it is reading, explaining why the Arduino never catches the keyword. Any ideas on what I could do to fix this? The page I'm loading is small, so maybe I could ignore the first maybe 200 char(web server header), read the whole thing into a temporary buffer, and then search that at my leisure? Any thoughts?
Kevin Darrah That is what I figured. I added the Serial.print line for debugging, knowing that it would amplify the issue. By switching the ESP8266 to the hardware Serial, and my debug output to the Software, I am able to catch both keywords every time.
fantastic tutorial. A question tho: In this video (ua-cam.com/video/uwrWkiI6Hg8/v-deo.html), AllAboutEE uses a find function to parse the string, but you use step through system in reas_until_ESP. Is there a reason you did not use find?
I think it'd be pretty cool have a micro-controller send data via the ESP8266 module to a PHP script which would log all of it in a .csv file. You could then use the IMPORTDATA function in Google Sheets and use the rest of the spreadsheet functions to do whatever. Or would it be possible to eliminate the PHP step and have the micro to generate the .csv file and allow it to be accessed via HTTP query through the wireless module directly, as if it were a server. Another awesome web service that these could do amazing things with is IFTTT.
Almost....except store it on your local machine. I don't understand the desire to give important data to companies knowing they and the government access it on a whim. I hear the media say privacy is dead, it is to people who are puppets to the corporations that want you to give them your data to make you feel they are so much more secure because you are stupid and privacy is dead unless you use our super secure clouds then you have no privacy -- its the opposite lol
lol chill and let me teach you cause this is important. The government can and does subpeona information from company servers. This is fact not paranoia. The fact also is a local file server is very easy to build and computers are cheap but people use cloud services (me including) because they are easier but if you care about doing more than looking at youtube view counts then you might need to consider that.
you can get current time from "www.timeanddate.com/worldclock/" My example uses "www.timeanddate.com/worldclock/usa/oroville" Xpath="//*[@id="ct"]" when using thingspeak like Kevin outlines in his video it returns a web page with just "1:54:51 pm"
thanks for taking the time to develop this code, kevin. got my 8266 up and running with it. just a tip for those who are having "timeout" issues from the read_until_ESP function, it's likely because the firmware version on your ESP8266 is different than what kevin used and is spitting out different responses (keywords). on the main "BASE" code page where the keywords are defined, i had to change "Ready" to "ready" (as is mentioned by kevin's comment). i also had to change "Unlink" to "0,CLOSED".
i haven't played around too much with this yet, but i'll keep updating this comment if i find any of the other keywords are different with my firmware version.
great! thanks for the tips!
The Chrome technique with X-path was an excellent tutorial on how to skip all the digging and fishing out of the raw html. Great work there!
I saw ur code. "Read until ()function " shows ur smartness. Very brilliant
+gowtham p thanks!! working on part 3 now...
Nice explanation of your code. I like how you comment next to the closing curly braces " }// for byte i " makes the code much more readable.
Also getting The error is" request for member 'begin' in '1', which is of non-class type 'int'". How to fix this?
Definitely interesting using an arduino for retrieving specific data from the internet.I am really enjoying your videos!!
I just watched it again. This video is simply awesome. You are a very generous guy. Congratulations.
Really looking forward to part 3 sending sensor data to the internet!
Nice info. BTW, a caret is like a hat. Those things are left and right "angle bracket". Where did you get caret? A course in vector algebra and rotated the symbol 90 deg?
+Kevin Darrah can you make a video about ESP8266 abou SENDING DATA TO THE INTERNET or FACEBOOK.
for the setup and connection there is a library called "ESP8266Wifi.h" and "ESP8266WebServer.h" which will make it easier and you won't need a arduino
Kevin still waiting for your videos on IOT on this series you have promised to make videos man ! It has been 5 year where r you brother.
Why did you use--> payload[payload_size+i] = URL[i];
even if we have some payload Data , what will starting of payload array will contain?
Hello, I can do the the thingspeak example but I with my personal page I get a bad request response
Great video. I am looking some advise. I am planing to connect a number of sensors to get data and then upload it in to the internet. Should I use this as main micro controller or just as a Wifi module?
Hi dear Kevin,
thanks for the Good Job you have done...
But I am getting this Error while Compiling your Code; I have just Changed the SSID Name and SSID Password ...
cant understand what to do ?
I am new to ESP8266 and using ESP8266 ESP-12e NodeMCU Module
///////////////////////////////////////////////////
Arduino: 1.6.6 (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, 115200, 4M (3M SPIFFS)"
:0:9: error: expected unqualified-id before numeric constant
C:\Users\MKBUTAN\Desktop\ESP8266_BASE_01_28_15\ESP8266_BASE_01_28_15.ino:18:16: note: in expansion of macro 'ESP8266'
SoftwareSerial ESP8266(ESP8266_rxPin, ESP8266_txPin);// rx tx
^
C:\Users\MKBUTAN\Desktop\ESP8266_BASE_01_28_15\ESP8266_BASE_01_28_15.ino: In function 'void setup()':
ESP8266_BASE_01_28_15:69: error: request for member 'begin' in '1', which is of non-class type 'int'
ESP8266.begin(9600);//default baudrate for ESP
^
ESP8266_BASE_01_28_15:70: error: request for member 'listen' in '1', which is of non-class type 'int'
ESP8266.listen();//not needed unless using other software serial instances
^
C:\Users\MKBUTAN\Desktop\ESP8266_BASE_01_28_15\connect_ESP.ino: In function 'boolean connect_ESP()':
connect_ESP:4: error: request for member 'print' in '1', which is of non-class type 'int'
ESP8266.print("AT+CIPSTART=0,\"TCP\",\"api.thingspeak.com\",80
");//only connecting to thingspeak
^
connect_ESP:9: error: request for member 'print' in '1', which is of non-class type 'int'
ESP8266.print("AT+CIPSEND=0,");//send AT+CIPSEND=0, size of payload
^
connect_ESP:10: error: request for member 'print' in '1', which is of non-class type 'int'
ESP8266.print(payload_size);//the payload size
^
connect_ESP:12: error: request for member 'print' in '1', which is of non-class type 'int'
ESP8266.print("
");//cap off that command with a carriage return and new line feed
^
connect_ESP:17: error: request for member 'print' in '1', which is of non-class type 'int'
ESP8266.print(payload[i]);
^
C:\Users\MKBUTAN\Desktop\ESP8266_BASE_01_28_15
ead_until_ESP.ino: In function 'boolean read_until_ESP(const char*, int, int, byte)':
read_until_ESP:18: error: request for member 'available' in '1', which is of non-class type 'int'
while(!ESP8266.available()){//wait until a new byte is sent down from the ESP - good way to keep in lock-step with the serial port
^
read_until_ESP:25: error: request for member 'read' in '1', which is of non-class type 'int'
data_in[i]=ESP8266.read();// save the byte to the buffer 'data_in[]
^
read_until_ESP:56: error: request for member 'available' in '1', which is of non-class type 'int'
while(!ESP8266.available()){// same thing as done in the buffer
^
read_until_ESP:65: error: request for member 'read' in '1', which is of non-class type 'int'
data_in[key_size-1]=ESP8266.read();//save the new data in the last position in the buffer
^
C:\Users\MKBUTAN\Desktop\ESP8266_BASE_01_28_15\serial_dump_ESP.ino: In function 'void serial_dump_ESP()':
serial_dump_ESP:5: error: request for member 'available' in '1', which is of non-class type 'int'
while(ESP8266.available()){
^
serial_dump_ESP:6: error: request for member 'read' in '1', which is of non-class type 'int'
temp =ESP8266.read();
^
C:\Users\MKBUTAN\Desktop\ESP8266_BASE_01_28_15\setup_ESP.ino: In function 'boolean setup_ESP()':
setup_ESP:3: error: request for member 'print' in '1', which is of non-class type 'int'
ESP8266.print("AT
");// Send just 'AT' to make sure the ESP is responding
^
setup_ESP:11: error: request for member 'print' in '1', which is of non-class type 'int'
ESP8266.print("AT+RST
");// Give it a reset - who knows what condition it was in, better to start fresh
^
setup_ESP:18: error: request for member 'print' in '1', which is of non-class type 'int'
ESP8266.print("AT+CWMODE=");// set the CWMODE
^
setup_ESP:19: error: request for member 'print' in '1', which is of non-class type 'int'
ESP8266.print(CWMODE);//just send what is set in the constant
^
setup_ESP:20: error: request for member 'print' in '1', which is of non-class type 'int'
ESP8266.print("
");
^
setup_ESP:28: error: request for member 'print' in '1', which is of non-class type 'int'
ESP8266.print("AT+CWJAP=\"");// set the SSID AT+CWJAP="SSID","PW"
^
setup_ESP:29: error: request for member 'print' in '1', which is of non-class type 'int'
ESP8266.print(SSID_ESP);//from constant
^
setup_ESP:30: error: request for member 'print' in '1', which is of non-class type 'int'
ESP8266.print("\",\"");
^
setup_ESP:31: error: request for member 'print' in '1', which is of non-class type 'int'
ESP8266.print(SSID_KEY);//form constant
^
setup_ESP:32: error: request for member 'print' in '1', which is of non-class type 'int'
ESP8266.print("\"
");
^
setup_ESP:41: error: request for member 'print' in '1', which is of non-class type 'int'
ESP8266.print("AT+CIFSR
");//command to retrieve IP address from ESP
^
setup_ESP:59: error: request for member 'print' in '1', which is of non-class type 'int'
ESP8266.print("AT+CIPMUX=");// set the CIPMUX
^
setup_ESP:60: error: request for member 'print' in '1', which is of non-class type 'int'
ESP8266.print(CIPMUX);//from constant
^
setup_ESP:61: error: request for member 'print' in '1', which is of non-class type 'int'
ESP8266.print("
");
^
exit status 1
request for member 'begin' in '1', which is of non-class type 'int'
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Please Help
Hi! Is there any other link to the code? The one in the description is not working anymore. Thank you!
How did you get the ESP8266 to send a SMS test as show in part one
Does the Arduino IDE support the normal C string library, such as length of a string, position of a substring within a string, string concatenation, etc.? If so, I'm curious why you're doing this manually. Is that faster or more efficient?
Hi Kevin, i took me really i while but now it is working, uploading data and getting data from THINGHTTP.
I am really a fan of your videos!! :-) Your explanations are fantastic, also the video explaining the manchester coding was brilliant!
hi,
what would be the concept in order to control the ESP8266 with a web page from outside the local network, without router port forwarding?
is the data logging video up yet?
Hey! Great Video. I am having a compiling problem. I just copied and pasted your code and didnt edit anything except SSID and its keywords. The error is" request for member 'begin' in '1', which is of non-class type 'int'". Please help me.
I'm getting the same problem.
i have the same problem
I am using an older version of the Arduino IDE (1.0.5) and am not getting that error.
The link of your youtube and current temperature ... the api key is sending the message that is invalid ...
Hi Kevin.
i got that from my XPATH : Error parsing document, try a different parse string
can parse anything from youtube it shows "Error parsing document, try a different parse string."
How do i connect this to the arduino mega? i cant seem to get it to work, serial monitor showing everything on fail, and when i run at commands directly to the esp it works, any help?
Hi
I am not able to flash my ESP8266 module, when I am tryiny to enter AT commands via serial monitor it is showing me some irrelevant output and also ESP8266 flasher is not able to fetch MAC Address.
Thanks
You were suppose to burn arduino n not ESP. Here he is using AT command through arduino to communicate with esp
So this code is for the arduino? how do you then connect the arduino to the ESP?
+Jairo Marquez google is the best option to find connections. let me know here if u can't find it.
Is there a part 3?
Looking forward for a tutorial sending data to e webpage.
I have DCcduino + ESP8266. Direct "AT" command work fine. But SoftwareSerial not. I have tried program with very basic version with SoftwareSerial, and anything helps. I have original fimw., without any update, external Power Source, and ESP-01 socket, which change voltage to 3,3V DC, 9600 bit rate. 2xBlink blue Light, but any respond with SoftwareSerial.
Any Idea? Muss I update fw? Or could Socket have any influence?
Wow! I've learned so much from just a few of your videos. Please keep up the great work! :-D
Can you use these ESP8266 chips to create a mesh network?
hey, i am already a big fan of your videos.... just need a small help... i get these errors... could you please help...
:0:9: error: expected unqualified-id before numeric constant
c:\ESP8266_BASE_01_28_15.ino:18:16: note: in expression of macro 'ESP8266'
SoftwareSerial ESP8266(ESP8266_rxPin, ESP8266_txPin);
^
please help
Please help with the hardware setup. Should you pass the tx pin from the arduino through a level shifter?
+Robin Thomas Yes, he explains that in Part 1
Hello,
can u say when the next video will beuploaded where the data is going the other direction. That i can see a measured temperature under a URL?
I´m looking forward to this :)
Can't you use string.indexOf to check for a character? It worked for me.
how do you resolve the dns names in esp ??
Help! I can't compile the code. It keeps telling me:
"request for member 'begin' in '1', which is of non-class type 'int'"
Hi I want to know that can we use esp8266 - 01 as smd component
web interface and video on new version of esp8266 that is esp12e or esp12q....
having problems with it.
what about Facebook?
i didn't able to get numbers of like on my page in things speak...
any idea?
Hey kevin! Can you make a video using interrupts? I still don't get it haha.
Great video, when are you coming up with part 3 of this tutorial?
hii when i type
AT response is ok but in case of AT
i get error ...can you explain why??
Realy nice tutorial Kevin but did you consider using the String library to deal with finding and retrieving parts of strings? I think things will became much simpler.
Hi, and thanks for all the tutorials, i have a problem, i want too load some information from a website, but too get access too this website (gamingsite) i need too log on with an API key from a game. Any idea how i can solve this?
Hello. Arduino beginner here, so please bear with me if the question is stupid or obvious: what happens if the parsing in ThingSpeak never works? I tried your example exactly and others with other websites and it always returned an error message to me: "Error parsing document, try a different parse string." Any help would be greatly appreciated. I'm trying to find a way to get weather data from a website so that I can get my Arduino (with an Adafruit CC3000 WiFi shield) to read it. Thanks!
EDIT: At the time of this edit, works for the temp in openweathermap.org/ but not others.
Hi. Do you have a schematic for arduino and esp8266 ??
Thank You.
I appreciate a lot!
Marc.
can we make two arduino talk to each other via esp8266_01 ?
thank you
Sir i have uploaded a code to my esp-01 through arduino(blinks led)but i lost my older at firmware of board(not able to do AT commands anymore :( ).PLz Help.
Awesome job!! Still waiting for part 3 :)
Hello there , which library i have to download to compile successfully the code which is done by Sir Kevin Darrah? i face the error while compiling the code..
+Digant Goradia No additional libraries are needed. What is the error?
+Srijal Poojari , Actually my simple code cant be upload to the ESP8266 Module through the arduino uno board and the arduino IDE itself. i have conncted every pinouts perfectly..and the error is like this
warning: espcomm_sync failed error: espcomm_open failed
+Digant Goradia In the video series, the code is uploaded to the Arduino and not the ESP itself.
According to your error, you want to upload some other code to the esp directly, for which you should use a USB to Serial converter. The Arduino can to this but its a mess to set it up. I have tried it many times but in the end I just bought a USB to Serial converter and things are smooth now.
+Srijal Poojari Ok..but i saw some of the videos, into that videos they have used Arduino to build upthe code to ESP module..
nice job, you also increased your subscriber count by 2 during the making of this video
You don't have to have the CIPMUX set to one for TCP communications. Only if you are going to use more than one socket. I send emails out using a TCP connection to a email server just fine in that mode.
Hey Kevin! Do I have to put GPIO0 into GND as I upload this sketch into the MCU? Thanks!
I am trying to write this back for avr-gcc and so far so good..but I am stuck at ESP.8266.print(payload_size) part...i am using uart_puts(payload_size) but i got an error
Warning passing argument 1 of 'uart_puts' makes pointer from integer without a cast [-Wint-conversion]
the output suppose to be "AT+CIPSEND=0,85" but instead i got "AT+CIPSEND=0, "
Nevermind...I have managed to finish it..everything is working perfectly..
Hope you can teach us more on how to get more data from websites...thanks
Hello everyone. I'm new in ESP8266 and wanted to do something more simple as reading just a 4-digit number from the Internet. can you help me, Please?
Thanks advance
how can you print the ping of a webserver to the serial monitor?
Walter Spurer haven't gotten there yet, but will make a video on that as well. There's a ton of stuff out there on this part, so just try googling around.
Is the language he's using C, C++, or a C look-alike? (I guess it's C/C++ - he's including an .h file.)
how you update, data coming from thing-speaks
Is there a part 3?
Kevin part 3?
I like the way you write the code
I followed all this steps shown in this tutorial, but, when I sent de GET command to retrieve the data ... it caused an problem that the informations retrieved was greater than the arduino´s buffer size, the default is 64 bytes, even changed the size to 256 it is not enough, cause the answer of the command GET comes with the http header not only the information retrieved as shown when you put the GET command.
Used and arduino UNO, and other NANO, but the results was the same, does not get all data.
There is an way to read more data than 64 bytes ? Because, when I read the buffer, the rest of the information does not appears any more - eps.available() is equal to zero - no bytes remains in the buffer the be read.
You can give me a clue, to solve this problem?
How can I receive the answer from the Thingspeak whitout the http header, only the data I am asking using the parse command?
Thanks...
Hi Kevin. The link to the source code is not working. Will you please fix it.
just tested, downloaded for me?
Eagerly waiting for part 3.
+gowtham p coming soon...
+Kevin Darrah I cant wait!
part 3 is out - check teh description
If I dont need to parse any info, how do i get it into "(youtube_subs)" For instance my thingspeak GET site looks like this 12345
my website showing error while connecting tcp
Hi Kevin,
Is it posible to get a copy of source code in your video?
+Zulfqar Ali check the description - everything should be there
Do you need to do setup ESP every time before you use it?
+Bob “bobdabiulder” dabiuld Yes, every time you reset power as esp does not store SSID and pass details. It may be possible if you directly program the ESP
Really really great job you're doing right there. I like the way you write the code and the way you explain it. It really make me want to try this stuff. :)
Thanks for sharimg, I'm looking forward for your next video.
How can I dowload zip file
thanks Kevin, I've learned a lot from your videos! :D
Hey Kevin, Thanks for the video. I was wondering if you have played around with NodeMCU Firmware for the ESP8266 and programming in lua. It's a solution that means the board only needs power and no arduino as you can upload your lua code directly onto the board. github.com/nodemcu/nodemcu-firmware. Maybe you can have a play around and make a video on it.
Also how do you power your board? I now know after much failure that 3.3v pin on the arduino doesn't have enough current. It works a bit better when I use 3.3 from a usb programmer but I get another problem; the usb device doesn't show up unless reset is connected to ground (although it should be pulled high no?). Can you think what I might be doing wrong?
***** yea, these modules can be a bit power hungry. I buy cheap 5V to 3.3V switches off eBay. They're less than a buck a piece - search DC-DC LM2596
Using DOM XPATH for accessing is a brute force approach. I like it. but if the HTML is updated it will break the DOM/XPATH lookup.
***** ah yes good point, and this has happened to me before - nice thing is that you just have to update the thingspeak app, not your code on the micro.
Kevin Darrah Yes, I agree and it is a good thing, it now acts as a data proxy to the micro-controller
anyway good work and hope to see you more of you again.
Really cool and detailed explanation..Thanks Kevin.. :) Keep posting..I think I will Learn IoT from you only
Links are not working
I received : //*[@id="browse-items-primary"]/li/div/div[1]/div/span[2]/b
and i paste, the message is : Error parsing document, try a different parse string.
Can you help me ?
Thanks!
Marc.
+Marc Paradis I got the same Error on a few webpages, but it works well on the others. Try using a different website for the data you want if possible. And let me know if you find a solution for this error.
+Srijal Poojari Hi guys, i talked with thingspeak support a couple of months ago, and they said that you can't use this "thing" on every page. It works on UA-cam (HTML, HTML5) but not with other formats.
+Matthew Freeman oh okay, thanks!:)
For me, this XPath(//*[@id="browse-items-primary"]/li/div/div[1]/div/span[2]/b) doesnt work too.Try this one:
//*[@id='browse-items-primary']/li/div/div[3]
Hello Kevin. I've really enjoy your videos and how deep you get into each device/technology, even referencing the datasheets. Thank you. Since you covered both the ESP and the NRF24, I was wondering it you explored using the ESP AS a NRF24 with an onboard MCU. Maybe disabling the wifi/ip stuff and controlling antenna semi-directly. Like an arduino+NRF24 alternative with the ability to switch into wifi mode when needed. Thanks again.
Why aren't you loading the data from the UA-cam API? For me as a software developer, parsing HTML to get specific data is the worst idea ever. And thus, advising to do so is somewhat dangerous, if you ask me ;)
Also, HTTP itself does not want the host name to be in the query.
The HTTP query normally looks like this: "METHOD /path_of_resource/resource HTTP/version". You connect to a server (IP or host) and then tell the server to GET / POST / PUT / DELETE / ... / a specific resource ON THAT server, so there is no technical need for the hostname to be there.
So does the board do some parsing of the serial input itself?
Because the UA-cam API requires api keys/login and maybe it's too much overhead for the Arduino. There's nothing wrong with the way he's doing it for what he's trying to accomplish. It's not "dangerous" it's just not a complete solution. The benefit is, if the path to the data changes, he just needs to update Thinkspeak and the device code still works.
You should upload the code to github :)
Hi guys!
I upload the code on my Arduino Uno R3. So before that I test AT and it returns OK but when start Arduino with downloaded code i get ...
timeout
ESP CHECK FAILED
What can cause this ?
Make sure you have the same firmware loaded in the ESP - it might not be getting the exact keyword back? Otherwise, not sure
Kevin Darrah 10x for the replay. I'm completely new to Arduino so I tried Tutorial Part 1 video step by step so I was able to get my data form api.thingspeak.com trough Serial Monitor. However can you tell me about this:
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Serial.print("AT
");
}
void loop() {
// put your main code here, to run repeatedly:
}
Should I see in SerialMonitor OK after above code, because I don't ?
OR
I tried this too but it never find "OK":
void setup() {
Serial.begin(9600);
Serial.print("AT
"); // or "AT" or "AT
" or "AT
"
if (Serial.find("OK")) {
Serial.print("OK IT IS READY");
}
}
p.s. AT+GMR gives me
0018000902-AI03
AT+RST gives me
[Vendor:www.ai-thinker.com Version:0.9.2.4]
ready
Kevin Darrah
OK i figure it out. And is this expected behaviour ?
When i first mange to run ESP8266 when I try Serial Monitor commands there was no response. So I switch RX and TX like that RX-RX TX-TX and Serial Monitor commands start working. Now I make it like that RX-TX and TX - RX and this code:
void setup() {
Serial.begin(9600);
Serial.print("AT
"); // or "AT" or "AT
" or "AT
"
if (Serial.find("OK")) {
Serial.print("OK IT IS READY");
}
}
returns "OK IT IS READY", but now again I can't send command trough Serial Monitor. When I type In Arduino's RX blink bit but terminal is empty.
Kevin Darrah When i replace ESP8266.print with Serial.print I get some success with your code connecting to my SSID... testing now...
that's definitely a wiring problem if it works with Serial.print
Hey Kevin' great tutorial. I really love your tutorials and they're simply the best out there. But you should really consider using the actual API for getting data from websites since the current method while it works just fine its a lot of overheard and its not proper since websites change their layouts all the time.
Hoping someone can help with an issue setting the baud rate on the esp8266. I updated to this latest version of the cloud update:
AT+GMR
AT version:0.21.0.0
SDK version:0.9.5
OK
I can connect well via USBTTL at 115200 but cannot change baud to 9600 so it will work with the arduino script in this video. I've tried AT+CIOBAUD=9600 but that's not supported any longer (returns ERROR).
I found reference saying the right command is now: AT+IPR=9600 but when I do that I cant communicate with it at any baud rate and need to reflash the esp.
9600 is default with the version I'm using in the video
Quick update...I was able to get this to work by downgrading the esp8266 to v0.9.2.2 firmware which apparently defaults the baud rate to 9600. For some reason, when I upgrade to the cloud version (v0.9.5), it sets baud rate to 115200 and the typical AT commands to change it to 9600 so it talks to the arduino don't seem to work.
Hi ! anybody had Invalid api Key when he use thing http ?
Great video, I really appreciate you taking the time to write all that code, and share it with the community, however I ran into a bit of a problem with this code. Using a 3.3v Arduino Pro Mini with an 8MHz clock, I am unable to read data out of a web page. Pluging my 3.3v FTDI into the SoftwareSerial RX side of the Arduino, I can see the data being passed to the Arduino, but if I Serial.print the data_in buffer as it is running, I can see large gaps in the page it is reading, explaining why the Arduino never catches the keyword. Any ideas on what I could do to fix this? The page I'm loading is small, so maybe I could ignore the first maybe 200 char(web server header), read the whole thing into a temporary buffer, and then search that at my leisure? Any thoughts?
yea, you are probably getting a buffer overflow. The software serial buffer is pretty small. Try it without printing the data - should be okay then.
Kevin Darrah That is what I figured. I added the Serial.print line for debugging, knowing that it would amplify the issue. By switching the ESP8266 to the hardware Serial, and my debug output to the Software, I am able to catch both keywords every time.
Thomas Carlin did the same thing myself :) that's one of the reasons I said that read_until... function could use some optimization
if you watch this video muted you can pretend he's a belgian detective
Hi Kevin,
Your are really great, this is one what i was looking for, Thank you very much :)
I mada similar project with GPRS MODULE works too good. I m so thank ful to u
Great! Wonderful! Wunderbar! Incredibly useful! Thx a lot!
Very well explained sir...thanks a lot :)
fantastic tutorial.
A question tho: In this video (ua-cam.com/video/uwrWkiI6Hg8/v-deo.html), AllAboutEE uses a find function to parse the string, but you use step through system in reas_until_ESP. Is there a reason you did not use find?
Thanks man!
You help a lot.
I think it'd be pretty cool have a micro-controller send data via the ESP8266 module to a PHP script which would log all of it in a .csv file. You could then use the IMPORTDATA function in Google Sheets and use the rest of the spreadsheet functions to do whatever. Or would it be possible to eliminate the PHP step and have the micro to generate the .csv file and allow it to be accessed via HTTP query through the wireless module directly, as if it were a server.
Another awesome web service that these could do amazing things with is IFTTT.
Almost....except store it on your local machine. I don't understand the desire to give important data to companies knowing they and the government access it on a whim. I hear the media say privacy is dead, it is to people who are puppets to the corporations that want you to give them your data to make you feel they are so much more secure because you are stupid and privacy is dead unless you use our super secure clouds then you have no privacy -- its the opposite lol
Seriously? Exactly how is that at all relevant to my comment? Go take your condescending paranoid delusions elsewhere.
lol chill and let me teach you cause this is important. The government can and does subpeona information from company servers. This is fact not paranoia. The fact also is a local file server is very easy to build and computers are cheap but people use cloud services (me including) because they are easier but if you care about doing more than looking at youtube view counts then you might need to consider that.
I am telling you I already do what you are saying plus much more and do it securly then you scoff at me. lol that says a lot about you.
awesome video, and a beautiful code, thanks a lot!!! :)
you can get current time from "www.timeanddate.com/worldclock/"
My example uses "www.timeanddate.com/worldclock/usa/oroville"
Xpath="//*[@id="ct"]"
when using thingspeak like Kevin outlines in his video it returns a web page with just "1:54:51 pm"
i really like your videos thanks
Hi Peter Quinn for nice video!
please help me with that
GreatScott! Sent me here.