These are chat archives for esp8266/Arduino

12th
Mar 2016
Fatah N
@fatahn
Mar 12 2016 03:48

ESP8266 simulation now available on 123d ciruits. [BETA]
https://123d.circuits.io/circuits/1385637

Anyone tried this out?

tzapu
@tzapu
Mar 12 2016 08:38
i m saving one file to SPIFFS every 1 minute, and after a few files, all the same size, the write interval seems to increase considerably
2 seconds, then 4 then 10 then 14 then 18 now 20 seconds to write a small file
is that a bug? wear levelling trying to write around? flash on the way out to the trash bin?
34 seconds now… soon the save time will be longer than interval time
tzapu
@tzapu
Mar 12 2016 08:45
and now it reverted to it s usual 1 -1.5 seconds
would wear levelling cause such a thing? if it s even active in spiffs
Me No Dev
@me-no-dev
Mar 12 2016 08:51
i can tell ya
every write you do recreates the fiel
and the way spiffs works is it's filling the rest of the free space
while marking the deleted space as "deleted"
when you fill all of the space, for the next write to happen firs deleted space needs to be consolidated into blocks then those blocks to be cleared
and time goes crazy :)
I wrote a "defragment" method but requires caution and some additional SPIFFS stuff exposed than what we have in the core
so @tzapu there ya go :)
tzapu
@tzapu
Mar 12 2016 08:55
ah, sorry
away on FB
:))
lemme read
ok, so it would make sense it got to the end of piffs
and for a few writes
remarked everything i guess
and now until it ends up there again, it should be stable
Me No Dev
@me-no-dev
Mar 12 2016 08:56
not everything
just enough
it will grow again
it nerver cleaned all deleted blocks
what is the size of the file?
oh and beware... flash has around 100K write/erase cycles
tzapu
@tzapu
Mar 12 2016 08:59
yeah, i remmeber that
don t acutally know how big the file is
16k i think
well, thanks for eltting me know, i now know why it happens :D
tzapu
@tzapu
Mar 12 2016 09:16
thanks @me-no-dev
Me No Dev
@me-no-dev
Mar 12 2016 09:17
:)
tzapu
@tzapu
Mar 12 2016 09:19
probably best to do one of those micro sd adapters and use a sd card in the end
any idea if it will work in parallel with an arducam over spi? queue mozgy … arducam was mentioned
Me No Dev
@me-no-dev
Mar 12 2016 09:19
probably :) at least SDs are cheap
make sure first partition is less than 3GB and you'll be fine
tzapu
@tzapu
Mar 12 2016 09:21
ok, will have to try next week then
tzapu
@tzapu
Mar 12 2016 10:15
meh, i must make it work with SD, ~50K per iamge, 50 images per 3MB, that s good for what 2s of timelapse … :(
Ivan Grokhotkov
@igrr
Mar 12 2016 10:44
I wonder why no one did a nodemcu-style board with a microsd card slot
Martin Ayotte
@martinayotte
Mar 12 2016 13:16
I've received some MicroSD shield for Wemos-D1-Mini recently, but didn't get chance to try them out yet ...
Mario Mikočević
@mozgy
Mar 12 2016 13:20
received wemos mini yesterday, that thing is incredibly light
tzapu
@tzapu
Mar 12 2016 13:56
@mozgy works in parallel with arducam ? taht micro sd thingy?
tzapu
@tzapu
Mar 12 2016 14:01
i think i ll try a getto style microsd adapter as reader later on ..
xbary
@xbary
Mar 12 2016 14:02
Hello
I have a plan:
  1. Wifi router SSID: aaa PWS: 12345678
  2. Wifi other router SSID: bbb PWS: 12345678
    A ESP arduino would like to connect to the router aaa, but after a minute bbb connect to the router, and so on aaa, bbb every minute for example ..
    What do I need, and in what order to run the ESP was the AP and connect once to aaa, once bbb etc ....?
    Regards
    XBary
Victor Tseng
@Palatis
Mar 12 2016 17:08
does spiffs do some sorta wear leveling?
feels like i gonna kill it if i actually implement what i just thought...
Me No Dev
@me-no-dev
Mar 12 2016 17:09
what do you mean by wear leveling?
tzapu
@tzapu
Mar 12 2016 17:09
yes. see above explanations from me no dev
well, the minimum of that is what you said it does, a more advanced wear levellign would include deciding which sectors have been unused the longest and use those at next write
like ssd s do
Me No Dev
@me-no-dev
Mar 12 2016 17:11
but unline SSDs we have verry little space to hold such information
@tzapu I'm not sure in the case where the flash is full of deleted pages which ones are cleaned first
also there is a "system" block that is used for temp storage while reorganizing the defragmented blocks
if that is a constant position it will be the first block to go
tzapu
@tzapu
Mar 12 2016 17:13
well, i d assume it s fairly random as long as the files are diffent blocks in size..
Me No Dev
@me-no-dev
Mar 12 2016 17:14
it stores the files in pages not blocks
tzapu
@tzapu
Mar 12 2016 17:14
well, i assume a ssd is using some mcu a lot more powerfull than the entire esp8266 that holds the firmware to these kinds of things
Me No Dev
@me-no-dev
Mar 12 2016 17:14
but the hardware can delete only a block
tzapu
@tzapu
Mar 12 2016 17:45
guys
is there any way in which i can include both FS and SD libs?
currently i get
error: redefinition of 'class fs::File'
 class File : public Stream {
       ^
which sounds reasonable, but wondered if there was soe way to have both
Michael Miller
@Makuna
Mar 12 2016 17:49
Are these same named classes in a namespace? Are you using something like "using ..."
tzapu
@tzapu
Mar 12 2016 17:49
well it seems both define File
i m just regular #include ing
Ivan Grokhotkov
@igrr
Mar 12 2016 17:50
FS.h has 'using fs::File' at the bottom
So File is exported into global namespace
Michael Miller
@Makuna
Mar 12 2016 17:50
That should be left upto the sketch and not in the header.
Me No Dev
@me-no-dev
Mar 12 2016 17:50
i did post a diff that fixes it somewhere in the issues
basically needs to put sd into it's own namespace
as a quick fix
so you have fs::File and sd::File
tzapu
@tzapu
Mar 12 2016 17:51
can i do that from the sketch, or do i need to mod the library?
Ivan Grokhotkov
@igrr
Mar 12 2016 17:53
Yep
esp8266/Arduino#1524
I'm :+1: for we should rework this to use the same API
Would be awesome
Me No Dev
@me-no-dev
Mar 12 2016 17:54
me too :)
tzapu
@tzapu
Mar 12 2016 17:55
sounds great :))
i assume rework the SD lib to behave like the spiffs lib
Me No Dev
@me-no-dev
Mar 12 2016 17:56
yes
tzapu
@tzapu
Mar 12 2016 17:56
nice
Me No Dev
@me-no-dev
Mar 12 2016 17:56
and you can serve SD files and SPIFFS files from the same emthods
tzapu
@tzapu
Mar 12 2016 17:57
so abstract away the storage engine behind a common interface/class/lib?
that sounds even better ...
Me No Dev
@me-no-dev
Mar 12 2016 17:57
like it is currently with SPIFFS
so it's made ready, just needs to be implemented
tzapu
@tzapu
Mar 12 2016 17:58
yeah, along with oh so many other things i guess, you guys are doing so much already :D
Oleg
@5LICK
Mar 12 2016 21:31
Hi, i connected arduino and esp8266, which library I can use to control the ESP from Arduino?
Ivan Grokhotkov
@igrr
Mar 12 2016 21:47
@5LICK with AT commands? i guess this one should work: https://github.com/sparkfun/SparkFun_ESP8266_AT_Arduino_Library
Oleg
@5LICK
Mar 12 2016 22:05
at commands, ok, thanks
Martin Ayotte
@martinayotte
Mar 12 2016 22:21
@5LICK , but do you really need Arduino attached to ESP ? Because ESP alone can do several things. It could reduce your coding efforts ...