Welcome to EnviroDIY, a community for do-it-yourself environmental science and monitoring. EnviroDIY is part of WikiWatershed, a web toolkit designed to help citizens, conservation practitioners, municipal decision-makers, researchers, educators, and students advance knowledge and stewardship of fresh water. New to EnviroDIY? Start here

Calculated variable pointers preventing logging to SD

Home Forums Mayfly Data Logger Calculated variable pointers preventing logging to SD

This topic contains 8 replies, has 2 voices, and was last updated by  James B 2 months, 3 weeks ago.

  • Author
    Posts
  • #12818

    James B
    Participant

    Hello,

    I am testing a nearly identical setup to the showcased build “Construction of Water Level Monitoring Sensor Station” with the addition of a Maxbotix MB7389 and a Xbee LTE CatM1 instead of the 2G bee. I used code from baro_rho_correction.ino and menu_a_la_carte.ino.

    When switched on the MayFly powered up and set up all the sensors, but just after the LTE CatM1 connected to the network it seemed to hang and lose power. Then the MayFly skipped dataLogger.logData and put all the sensors to sleep and then the system attempted to sleep infinitely but never made it. This resulted in a CSV file on the SD with headers for each variable but no sensor data. I have abandoned the Xbee LTE M and have ordered the LTE CatM1 breakout from SparkFun which I hope will work as a UBLOX modem.
    https://www.sparkfun.com/products/14997

    In the meantime, I am testing a new sketch without any cellular connection and have run into a code issue which has similar symptoms to what I saw above.

    I’m running the simple_logging.ino sketch and have pasted in the “calculated variables” section from baro_rho_correction.ino. My own calculated variable for the Maxbotix sensor is included in this section but is commented out as I do not have it connected to the MayFly at this time.

    Without any calculated variable pointers included in the variable array the data logger runs flawlessly. Everything is set up, the sensors turn on and take readings, the data is logged to a CSV file and the system sleeps until the next time to log.

    As soon as a calculated variable pointer is added to the variable array, I get similar activity to the setup above with the Xbee. The system powers up, the sensors are setup and turned off, but then the system immediately sleeps until the next time to log. It skips over the datalogger.logData in the loop function. I get empty CSV files again with headers. It wakes up on time but repeats the setup with no logging.

    How does adding a calculated variable pointer to the variable array cause the interrupt and prevent the logger from reaching the main loop function?

    Thank you

    Attachments:
    1. SerialMonitor.rtf
  • #12820

    James B
    Participant
  • #12821

    Sara Damiano
    Moderator

    Oh dear. I’ll get on this ASAP and let you know how it’s going.

    A warning on the ublox shield:the native baud rate is 112500, which is to fast for the Mayfly. Look at the gitgub issue on the sodaq uBee for how we worked around it. There’s code in the soon-to-be released as master atlas branch for it.

  • #12822

    Sara Damiano
    Moderator

    I’m starting to look at the calculated variables.

    Have you read the threads on the LTE-M XBee? I’ve gotten it to work; hopefully you can too! https://github.com/EnviroDIY/ModularSensors/issues/162#issuecomment-459879699

  • #12823

    James B
    Participant

    Thanks Sara! Yes I have been over both the GPRS bee thread and the LTEM thread here on the forums and the Github thread a bunch. I added a crude “capacitor chain” with the recommended values between bee pin stubs power and ground, a jumper wire between reset and pin A5 and a capacitor on that reset jumper wire as well. It doesn’t fire up at all without the capacitors or the jumper. The last thing I wanted to try before I gave up with it was a smaller battery as I have a 3.7V 6600 mah lipo hooked up that is reading 4.88V fully charged. Somewhere in the Bee manual it said the highest voltage the thing likes is 4.2(I think) so I thought it might be cutting itself off when it saw that the voltage was too high. I was getting activity on the hologram dash though so it was connecting fine, and XCTU said it had full signal since I’m right next to a tower.

  • #12826

    Sara Damiano
    Moderator

    Ugh. I’m sorry. I can definitely reproduce this, but I haven’t solved it yet. I’m fairly certain it’s because I’m linking object together in the constructors, but they’re not being created in the right order. This is causing important things (like the whole variable array) to be recreated.

    I’m working to solve it.

    Sorry!

  • #12828

    James B
    Participant

    No problem! Thank you for taking the time to look into it.

  • #12830

    Sara Damiano
    Moderator

    If you’re curious, I’m working on the objectInitialization branch for this.

  • #12831

    James B
    Participant

    Awesome I’ll head over there. I made huge progress with the XBee LTEM. Have it working with just the reset jumper wire. I added a line to one of the .H files where the APN is set to hologram and also setupXbee() that sets the carrier profile to Verizon (not sure which one helped) and commented out some of the conditions from the example sketch that deal with battery voltage. That seemed to jumpstart everything and it stopped hanging after the network registration. The next issue I’m seeing is failed MQTT status -4 for thingspeak publishing. I’m not sure what that stands for so I have some more troubleshooting to do tonight. I hope I see a dot on a graph soon!

You must be logged in to reply to this topic.