-->
Page 1 of 1

Esp8266 mma8451 logger

PostPosted: Sat Jun 10, 2017 12:49 pm
by delchrys2
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..

Re: Esp8266 catalogued.

PostPosted: Sat Jun 10, 2017 4:11 pm
by rudy
Maybe you can make use of some of this.

https://github.com/jchuahtacc/AccelerometerLogger

Re: Esp8266 catalogued.

PostPosted: Sat Jun 10, 2017 6:03 pm
by lethe
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.

Re: Esp8266 catalogued.

PostPosted: Sun Jun 11, 2017 2:48 am
by delchrys2
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.