I’m trying to replicate the Openlog Geophone Logger firmware but using the available Sparkfun ADS1015 instead of the now retired ADS122C04 on the Qwiic PT100.
As an addition, I would like to be able the record the data from multiple geophone (at least 3) using some ADS1015 at the fastest rate possible (3kHz).
Since the Geophone Logger was already made to record the data using two buffers to store the data quickly and then convert and store it on the SD card in the loop, I took it as my template.
I’m encountering a MBedOS crash as soon as I try to read a value from a ADS1015 connected via I2C. In the current updated version of the Openlog firmware, the sensors values are called, converted to string and added to a “list” one by one. In the Geophone logger, the data is collected in an Timer Interrupt which might explain the crashing.
As I don’t know much about using DMA or if it is even possible to make it get data with I2C from the ADC1015, I’m hesitating going with a [Sparkfun IOT RedBoard and a [MAX11131BOB . With an ESP32, I could have a thread buffering the data in multiple buffers and another thread saving the data to the SD card. The MAX11131 would allow to use SPI to transmit the data faster and many differential ADC inputs for the geophones.
To see if it is even possible I’m trying to read the data from the ADS1015 without a Mux to begin with (I do have one though for later). The MbedOS crash only happens when there is a call to get values from the ADC through I2C, like getDifferential(ADS1015_CONFIG_MUX_DIFF_P0_N1) . Since there has been some changes/updates made to the current Openlog firmware and I had to make changes for the Geophone logger code to work, there is a possibility there is a mistake in the initialization which causes this crash but the output it gives is not really helpful. I tested defining TEST_PERIOD_1 and TEST_AMPLITUDE_1 to see if the code works with “fake data” and it did.
Humm. Tricky. I don’t have time to go through your modified code in detail. But I’ll try and offer some suggestions that may help. (It is quite a while since I wrote that code!)
IIRC, I was using Apollo3 Core version 1.2.3 at the time. Some BIG changes took place when we moved to v2 of the core and started using Mbed. I had to make a bunch of changes to the standard OpenLog Artemis firmware when that moved to v2. But I never made the same changes to the geophone code. Right now, it may help to revert back to 1.2.3.
The code was written for the original Black SparkX version of the OLA. If you’re running on a Red OLA, make sure you change the hardware version definitions to match:
Be thorough. If you are completely replacing the ADS122C04 with the ADS1015, make sure you’ve searched right through the code and replaced all mentions of ADS122C04 (SFE_ADS122C04) with ADS1015.
You may be OK without a mux, provided you configure your three ADS1015’s with different addresses. It supports 0x48, 0x49, 0x4A and 0x4B. In autoDetect.ino testDevice, add those four addresses - replacing the ADS122C04 0x40, 0x41, 0x44 and 0x45.
Actually, you’ve got me intrigued now. New code would be a nice-to-have. Can I suggest you fork the geophone logger repo on GitHub and push your changes to your fork. Post a link here and I’ll take a quick look at your changes if I can spare the time.
I am trying to pickup on this thread on GitHub as I am having a similar issue with setting up the geophone with the ADS1015. Grateful for a link to any resolution.
I’ve upgraded the OpenLog Artemis Geophone Logger firmware so it will run on the SparkFun (Red) versions of the OLA. It can now also use the ADS1015 or ADS1219. The release notes are here:
Much appreciated - started using it today. Any chance of getting the BLE firmware update? I have now spent many hours cobbling together work arounds but the ideal solution would be to use the BLE functionality.
Adding BLE to OpenLog Artemis was something we always wanted and intended to do, but we never had the time or resources to do it. These links may help: