Logging data from a AQE2 on a Raspberry Pi through USB connection



Does anyone know of a way of using a Raspberry PI to data log / process data from an air quality egg 2 (AQE2)? Any help would be much appreciated!




Hi @robbiegregg, if you are daring enough to open up your Egg (not really that big a deal), by unplugging the USB cable you can make room to insert a microSD card into the slot. With that in place, you can put the Egg into an offline mode (opmode offline) in which case it will write data to the SD card and you can download it from the device later. We have an offline data logging package that adds RTC hardware as well.

I’m working on adding NTP capability to the software for a future release (Version 2.0.6), so that time stamps are more meaningful (i.e. without an RTC installed, and assuming you have Wi-Fi available).

Not sure this is what you’re getting at or not, but maybe it will be helpful to you.



Thanks very much for very quick response and the suggestion. ‘opmode offline’ works a treat. Two simple questions if I may:

1/. is it possible for the egg to both dump data to the micro-SD card and to the cloud?
2/. Cheeky question: I forgot to buy the battery when I purchased my egg. Since I am a very impatient person, do I simply need a battery? If so is this a generic coin cell battery and connector and if so where on the board is it attached? For example http://www.hardkernel.com/main/products/prdt_info.php?g_code=G137508214939

I look forward to an NTP capability in a future release.




Sorry for the lag in response!

  1. As implemented currently, the Egg doesn’t do both at once. I don’t think there’s a reason why it couldn’t but it would take some effort to refactor the software and I’m slightly afraid of it making online mode more fragile than it already is.

  2. An off-the-shelf Power Bank USB battery (like you’d use for charging a phone) actually works a treat for the Egg. If you get the Offline Data Logging package installed, it comes with a coin cell already installed for the RTC :smile:



Oh, also NTP is implemented in the latest code on Git-Hub, which will eventually become v2.0.6. There’s some new commands to configure it and enable it. Take a look at this issue for some details, excerpt:

This introduces a few new commands:

use ntp                   enables the functionality
ntpsrv disable            disables the functionality
ntpsrv pool.ntp.org       sets the ntp server name to pool.ntp.org
tz_off                    sets the timezone offset from GMT as a decimal value e.g. -5 for Eastern Time
backup tz                 backs up the user tz_off setting so it doesn't get blown away by restore defaults
Note, if the functionality is enabled, and the device can't connect to the network, it will keep resetting and trying to reconnect until it succeeds (as per usual behavior of things requiring a network connection).

If you’re going to try it by loading the latest using Arduino, I suggest running this sequence of commands to enable NTP:

restore defaults
use ntp
backup tz
[other customizations that differ from defaults and do not survive 'restore defaults']


Hi Vicatcu,

Apologies for not replying earlier. I have now got ‘some’ spare time to play with the AQE2. If I set the egg to be in offline mode, install a MicroSD card and connect to a Raspberry Pi, do you know of some terminal command I can use to download the files?




There commands that allow you to interact with an installed SD card over USB. I’d encourage you to take a look at this blog post for a pretty complete treatment of the offline operating mode.