Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
sticilface
@sticilface
@igrr and others, just wanted to say thanks for all the work! I replaced the flash chips on 3 ESP-01s and now have OTA working for all my projects. It is 2min to deploy new binaries to all of them which is amazing!!!!
d-anders
@d-anders
do you use it when developing? doesnt ota transfers take quite long time?
Ivan Grokhotkov
@igrr
In my experience, OTA takes less time than serial upload (although i am constrained to 230400 baud)
d-anders
@d-anders
oh
i thought max wifi transfer rates were quite low
i should try it on my esp-12 then
Ivan Grokhotkov
@igrr
transfer rates tend to go up as you increase packet size. if you use something like 1460 bytes (which is the MTU with current libraries), it will be fairly quick.
d-anders
@d-anders
hm, then i think i have another question
what is the default packet size and where do i set it?
and does calling wificlient.write(*buf,1460) set it?
fmgomes
@fmgomes
Yesterday I tried the new staging version, and the filesystem test: https://github.com/esp8266/Arduino/tree/esp8266/hardware/esp8266com/esp8266/tests/FSWrapper
It worked well, is this going to be the FS interface in the future?
Ivan Grokhotkov
@igrr
mostly, yes. File and Dir classes will stay mostly the same (maybe will add some functions, but not remove anything)
FS class, i'm not totally sure, i'm still looking how to do it better
there will be free-standing functions like mount, open, openDir, rename, remove, etc
these will work with all mounted filesystems
e.g. you can have one SPIFFS mounted at /spi and an SD card mounted at /sd
and then do something like File f = open("/spi/config.txt", "r");
instead of File f = SPIFFS.open("/config.txt", "r");
this is useful for WebServer integration when WebServer doesn't know which filesystem it has to get files from
So i'm not sure if i need to keep FS.open, FS.openDir, etc. or just leave freestanding functions to do that
I'm preparing all this for the workshop at Boston Fab Fest which will happen next monday, so I will likely finish this stuff this week.
Ivan Grokhotkov
@igrr
Suggestions on the API are totally welcome though.
d-anders
@d-anders
keep it simple
Ivan Grokhotkov
@igrr
@d-anders regarding packet size
each time you call client.write(), packet is sent. so the size of your data determines the size of the packet.
if you use client.println("foo"), for instance, that will cause two packets to be sent: one will be 3 bytes, containing "foo", another one two bytes, containing "\r\n"
because internally println calls write() two times
if you have char buf[1460] and you do wificlient.write(buf, sizeof(buf));, that will send all the data in one packet.
fmgomes
@fmgomes
@igrr, thanks! Good work! How is the flash space reserved for the filesystem? Isn't it necessary to reserve space for it?
fmgomes
@fmgomes
I need to have some space for the filesystem, but also need OTA, is it possible?
Ivan Grokhotkov
@igrr
the space for filesystem is reserved automatically. in fact, it was reserved for a long time, it's just that we didn't have high-level FS api
for "generic" board, there is a menu which allows you to select flash size, and it lists how much will be for sketch and how much for SPIFFS
with 512k flash, the only option is 64k
with 1M flash, you have several options with different sizes allocated for sketch/SPIFFS
for flash over 1M, all the lower 1M is for sketch, above that is SPIFFS
NodeMCUs have 4M flash so the only layout for them is 1M sketch + 3M SPIFFS
So the only case where you might have a tradeoff between OTA and FS is if you have 1M flash. but these are not very common, usually it's either 512k or 4M.
fmgomes
@fmgomes
Good old Murphy striking, i am using the Olimex board, it has 2M Flash and no menu for selecting the SPIFFS size, I've just checked changing for the generic board and saw the difference :-)
Ivan Grokhotkov
@igrr
Yeah, with 2M the only option is 1M + 1M. If you like, you can add something like 512K + 1.5M yourself.
sticilface
@sticilface
@d-anders. crude timing of my upload, 4M binary, from sending invitation to returned OK, 8 seconds.
using OTA
d-anders
@d-anders
oooh
speedy!
Harrison Mclean
@h4rm0n1c
that's... pretty cool.
d-anders
@d-anders
hm, 500 kB/s, i think i get nowhere near that when serving files using the esp as webserver
Ivan Grokhotkov
@igrr
4M? are you sure you are uploading that much?
sketches are normally less than 400k
sticilface
@sticilface
Thats just the selection of the binary in the IDE, the flash size. I thought i noticed it does make the uploads by serial longer when i select 4M vs 512k, so i thought it was relevant. having just checked the size of the binaries, they are the same. <400k
so it is irrelevant