Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Steve Nelson
@zenmanenergy
nope, that idea didn't work. the declarations are out of order like in your example.
thanks martin, i'll try the .h solution.
Michael Miller
@Makuna
Yeah, I just use .h in the tabs, include them in them in the order you want in the INO. No problem ;-)
Martin Ayotte
@martinayotte
As I said, it has nothing with tabs. It is the fact that pre-processor doesn't extract prototypes automagically like in 1.6.5. In plain C/C++, you always have to do that manually in a *.h.
Michael Miller
@Makuna
@gonsays If you look at github/makuna/tasks you will see a library that helps you break up code and avoid using delays(); it includes sleep support abstracted from the details of the platform (well, almost, AVR and Esp8266 are so different here).
gonsays
@gonsays
thanks for the info @Makuna :)
@martinayotte I'm using GET in order to obtain the page info, now I need to find some function to delimitate the string
I'm searching for it
client.readStringUntil('\r') reads me all the lines
Martin Ayotte
@martinayotte
@gonsays , beware that some web sites could also send all lines with \n only without \r.
You could also read one character at a time, and parse it yourself.
gonsays
@gonsays
thnks for the tip @martinayotte
yup, I'm not very familiar with buffers and parsing
:S
I'm trying to learn it. Right now, it gives me all the lines of the GET Request: while(client.available()) => String line = client.readStringUntil('\r');
it prints me all the lines, but I just want to get the last 4 lines or so
Martin Ayotte
@martinayotte
As I said, try with '\n' ...
gonsays
@gonsays
I'll try it
I'm going to test it now
with '\n' it gives me the string in one line, with '\r' it gives me several lines
maybe, I'm going to use a "for" instead of the "while" to try to save each line
instead of String line = client.readStringUntil('\r') I may use something like line[i]=client.readStringUntil('\r')
Martin Ayotte
@martinayotte
if '\n' gave you one line, then it is working. don't change the while(client.available()), it will fail getting the whole page.
Or, simply parse the whole thing after you got all the lines.
gonsays
@gonsays
yes, but the lines are not displayed in any array
while(client.available()){ String line = client.readStringUntil('\n'); Serial.print(line);}
as I understood it will only save the last line
after the GET Request
if I try to Serial.println(line) it will give me the last line of the GET Request
I would like to save them
How could I parse it with the while?
I'm trying to code a for loop for it, but if you say that it will fail, maybe i'll test another option, but I'm without ideas (besides the for loop)
Martin Ayotte
@martinayotte
I don't have to be rude, but maybe you have some C/C++ learning to do. What I suggest is : declare String lines[10]; early (before starting the reads) as well as lineNo = 0; , then read one line at a time with lines[lineNo++], when the reads are finished, process lines using for(int l = lineNo - 4; l <= lineNo, l++)
gonsays
@gonsays
yup, I've just tested that solution (using a for loop), it saves me the first 10 results and than it crashes (maybe because the string is full already)
also I've changed the while loop for the for loop -> i think this is the problem
I'll work on it, thank you very much for your help @martinayotte !
Martin Ayotte
@martinayotte
BTW, where the choice a 4 lines comes from ? if it is the whole body, but you want to discard the header, simply throw away the lines until first empty line.
gonsays
@gonsays
ohhh
yes
nice tip
Martin Ayotte
@martinayotte
Good ! this will be even easier, simple need of a boolean "header_finished"
gonsays
@gonsays
thanks for the tips @martinayotte , it's an honour to have your help :) I recognize your nickname from my esp8266 google search
on some issues
Stavros Korokithakis
@skorokithakis
hey guys, does anyone have a multiwifi+mqtt example?
liangzelang
@liangzelang
hey guys, who can help me to find how the project generate the .pioenvs file , espcially , there is LWIP file .and I really wonder how doer it generate. Hope some kind guys tell me.thank u. the code is there : https://github.com/dogmaphobic/mavesp8266.git
Ivan Grokhotkov
@igrr
Downloading files over HTTP is most easily done with HTTPClient
It even presents itself as a Stream, which can be later written into a file.
Gus Grubba
@dogmaphobic
@liangzelang You posted this question here and as an issue into my repo. I trully do not understant the question. Could you please elaborate?
Tony Rieker
@Ibuprofen
Has anyone had issues using the TX1/GPIO2 to send serial? If I use the same code on a teensy 3.1 i can successfully control the serial device, when using the esp (nodemcu or wemods d1 mini) I cannot. Unfortunately I don't have an oscilloscope
I'm wondering if maybe there is a pinmode or some setting for the ESP that I don't know about?