logo elektroda
logo elektroda
X
logo elektroda

Retrieving values from a page using the ESP8266 01 module - Arduino code

swiderEK1 528 5
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 19626035
    swiderEK1
    Level 6  
    Help because I'm stuck, I want to retrieve a certain value from a page with the ESP8266 01 module with the following code:
    Code: C / C++
    Log in, to see the code
    .

    this code gives "none"
  • ADVERTISEMENT
  • #2 19627456
    khoam
    Level 42  
    Why don't you use the hardware Serial1 from Leonardo, which also happens to be available on pins 0 and 1? SoftwareSerial seems to be redundant.
  • ADVERTISEMENT
  • #3 19641133
    kaczakat
    Level 34  
    See the Arduino SerialEvent example, it takes a while to send a character, with 9600 it's even a very long time, during this time the Arduino does thousands of checks if there is a character in the buffer and tries to print this text, it probably gets clogged up after a while. You have to collect the letters one by one into your buffer, make a line of text out of them (and it's good to send it in such a way that the message ends with a NL/CR character, which gives you information to do something with it now). And of course as khoam mentioned use hardware, then you can also set it to 115200 and it will be much faster.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #4 19646266
    gbksiazczak
    Level 29  
    Why is the same sequence of if statements repeated 2 times in the loop?
  • ADVERTISEMENT
  • #5 19646275
    khoam
    Level 42  
    gbksiazczak wrote:
    Why is the same sequence of if statements repeated 2 times in the loop?
    .
    The first relates to the "availability" of packages in ESPSerial (i.e. SoftwareSerial), the second in Serial.
  • #6 19646281
    gbksiazczak
    Level 29  
    Can availability (available?) be in only one case? Do you have to check both?
ADVERTISEMENT