The use of the ESP8266 in the world of IoT

User avatar
By delchrys2
#66984 Hi all.
I'm busy on a project that reads out a mma8451 accelerometer every 50ms. What I would like to accomplish is a esp8266 that reads out the mma8451 buffers it's data and sends it somewhere when a wifi connection is available. I would be logging for about 5 minutes and then I have a wifi connection available for about 1 or 2 minutes. Then again some data collection and so on....
Is it possible and how much available memory I have for storing the data assuming a nodemcu v3 or a esp8266 esp12 module.

It's not possible in my setup to have the Wi-Fi available full time because it's a moving/mobile application. Think of a bus that collects data and only have wifi at the bus stops..
Last edited by delchrys2 on Sun Jun 11, 2017 6:15 pm, edited 1 time in total.
User avatar
By lethe
#66995 Let's just do the math: assuming 10bytes per sample (e.g. 6bytes data + 4bytes timestamp) sampling at 20Hz for 5min would require less than 60kB.
That amount should fit in RAM (unless the rest of your firmware requires a large amount of memory as well).

Even if it doesn't fit in RAM: ESP-12's usually have 4MB flash, at least half of that is free for you to use however you see fit. That's enough for logging almost 3 hours @ 20Hz.
User avatar
By delchrys2
#67007 So how exactly do I write to ram. And how can I get it out of the ram memory?
I want to put a laptop at the so called busstop with a wifi hotspot. So when the esp comes to the bus stop it has to push it's data to it.

I read the above example at github but it does not seem to be buffering any data.