Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
gonsays
@gonsays
nervmind guys, I should have been using "Flash Size: 1M (64K SPIIFS)"
liangzelang
@liangzelang
i am a new starter, and when i compile the esp8266 project ,it will generate one new file named "Lwip" ,and i wonder how does it generate
Stavros Korokithakis
@skorokithakis
@igrr, what confuses me is that WiFiMulti can also do the connection itself
jasperachtbaan
@jasperachtbaan
After installing the websocket_client, the websocket httpserver gives these errors when I try to compile
c:/tools/sming/Sming/SmingCore/Boards.h:17: undefined reference to `WebSocket::sendString(String const&)'
Anybody got any idea?
Martin Ayotte
@martinayotte
@jasperachtbaan , unfortunately, this gitter chat is for Arduino ESP framework, not for Sming. There is another one called SmingHub/Sming for that.
gonsays
@gonsays
hey guys, I want to do a LAN ip scanner with esp8266. The local ip can be aloccated as 192.168.1.1 to 192.168.1.255. Some routers start allocating from 192.168.1.1 and other routers start allocating from 192.168.1.100.
Can Arduino IDE read and write on .txt files?
FS function maybe
I'm a bit confused about the way to tell the ESP that the allocation interval is beginning in 1 or 100
being 255 ips I need to declare 255 ip strings
heavy
Martin Ayotte
@martinayotte
Yes, you can read/write files using SPIFS functions.
gonsays
@gonsays
I'll search it, thanks martin :)
martin, to declare the ip's to ping i'm using this: const char* ping_ip[] = {"192.168.1.1", "192.168.1.2", "192.168.1.3", "192.168.1.4", "192.168.1.5", "192.168.1.6", "192.168.1.7", "192.168.1.8", "192.168.1.9", "192.168.1.10"};
if I want to ping 255 ips, I have to declare the 255 values on a char array
can you recommend me another way to do it?
I think this way is too heavy
Michael Miller
@Makuna
@gonsays You can store the strings in PROGMEM; but this is not how I would do it.
You should just have a constant for the prefix "192.168.1.", and then concatenate this with a itoa(octet); incrementing the last octet as a variable and passing it to itoa(). Further, you will find you made an assumption, as many routers use something other than 1 for the second to last octet so you will want to the same with it.
gonsays
@gonsays
Thanks @Makuna !
gonsays
@gonsays
what do you advise me to use instead of delay()? I've made some research and people tend NOT to use the delay function
instead of delay I would like to make the ESP sleep during 15 seconds, for example
gonsays
@gonsays
@martinayotte I'm sorry to bother you again, but is it possible to DOWNLOAD a .txt from www.site.com/file.txt and then use SPIFFS function to read it? Or is it only to read/write locally?
Steve Nelson
@zenmanenergy
I haven't worked on my esp code in a couple months. I just upgraded to the latest stable version and now I'm getting a lot of "exit status 1" compile errors. My .ino codebase has a bunch of tabs and that seems to be causing the errors. It's like the functions are out of order or something. any ideas?
it says:
exit status 1
'someFunctionInAnotherTab' was not declared in this scope
This error started when I upgraded to arduino 1.6.8 and v2.2.0 of the esp codebase.
Martin Ayotte
@martinayotte
@gonsays , do you mean download a file from the internet and save it into SPIFFS and later read it locally ? Of course, it is doable.
@zenmanenergy , Yes, the IDE 1.6.8 has some problems with "forward declarations". Either you revert to 1.6.5, otherwise, you will have to place a copy of the function prototypes into a *.h and include it. (hoping this issue will be fixed in 1.6.9)
Steve Nelson
@zenmanenergy
so I can just breakup my code using tabs anymore? *sigh
so I *can't rather
Martin Ayotte
@martinayotte
I don't think it has any thing with tabs, simply that prototype need to be seen before calling the function.
Steve Nelson
@zenmanenergy
as I understand the tabs in the ide, it copies the code onto the bottom of the file which is similar to putting functions declaration after the code that calls the function, so it's out of order. oh well, I'll just change things around.
Martin Ayotte
@martinayotte
example, you have function void myfunc(int arg1) { Serial.println(arg1); }, then you need to add the prototype "void myfunc(int arg1);" at the top of the sketch
Steve Nelson
@zenmanenergy
and you can't reorder the tabs afaik. I wonder if I put the setup() and loop() functions in a right most tab, if that would do it?
The tabs are a rather silly IDE interface, but they do allow for breaking up very long .ino files.
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' ...