Home › Forums › Mayfly Data Logger › Double_logger example modification
Tagged: double logger, tipping bucket
- This topic has 11 replies, 3 voices, and was last updated 2020-04-16 at 12:33 AM by Sara Damiano.
-
AuthorPosts
-
-
2020-04-08 at 12:05 AM #14036
Hello – I’m attempting to take the double_logger.ino file and modify it for my needs – and would appreciate a little help. I’ve been logging pretty well to MMW with the basic logging_to_MMW.ino using a XB3-C-A2-Ut-001 with Hologram Sim card, primarily with a tipping bucket. What I’m hoping to do with the double logger is to log every 5 minutes onto SD card, but only send out every hour to not burn through data as quickly. The code I’ve been working in is below.
A few things:
As the code is right now, the “low” interval reading returns all-9999 instead of actual values. The “high” interval reading returns correctly. Any idea why the Low is not reading values correctly?
I’ve tried, without success, to add a command under the High interval to send out and publish – using either logDataAndPublish command or publishDataToRemotes that’s used in the data_saving.ino example – without success. How can I best log and publish the High interval data?
Finally, I believe that I’ll need to add a calculated variable for the tipping bucket data to sum the tips in the low interval readings between a high interval reading. I plan to set low=5 min and high = 60 min, so the high needs to report the rainfall in the last hour, not just the last 5 minutes. Does that make sense?
Any help would be really appreciated. I’m no coder, so modifying a program get’s tricky for me quickly when it goes beyond aggregating what I need via copy-paste. Thanks!
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440/*****************************************************************************double_logger.inoWritten By: Sara Damiano (sdamiano@stroudcenter.org)Development Environment: PlatformIOHardware Platform: EnviroDIY Mayfly Arduino DataloggerSoftware License: BSD-3.Copyright (c) 2017, Stroud Water Research Center (SWRC)and the EnviroDIY Development TeamThis sketch is an example of logging data from different variables at twodifferent logging intervals. This example uses more of the manual functionsin the logging loop rather than the simple "log" function.DISCLAIMER:THIS CODE IS PROVIDED "AS IS" - NO WARRANTY IS GIVEN.*****************************************************************************/// ==========================================================================// Include the base required libraries// ==========================================================================#include <Arduino.h> // The base Arduino library#include <EnableInterrupt.h> // for external and pin change interrupts#include <LoggerBase.h> // The modular sensors library// ==========================================================================// Data Logger Settings// ==========================================================================// The name of this fileconst char *sketchName = "double_logger.ino";// Logger ID - we're only using one logger ID for both "loggers"const char *LoggerID = "FA";// The TWO filenames for the different logging intervalsconst char *FileName5min = "FA_low.csv";const char *FileName1min = "FA_high.csv";// How frequently (in minutes) to log dataconst uint8_t loggingInterval_low = 1;const uint8_t loggingInterval_high = 2;// Your logger's timezone.const int8_t timeZone = -5; // Eastern Standard Time// NOTE: Daylight savings time will not be applied! Please use standard time!// ==========================================================================// Primary Arduino-Based Board and Processor// ==========================================================================#include <sensors/ProcessorStats.h>const long serialBaud = 115200; // Baud rate for the primary serial port for debuggingconst int8_t greenLED = 8; // MCU pin for the green LED (-1 if not applicable)const int8_t redLED = 9; // MCU pin for the red LED (-1 if not applicable)const int8_t buttonPin = 21; // MCU pin for a button to use to enter debugging mode (-1 if not applicable)const int8_t wakePin = A7; // MCU interrupt/alarm pin to wake from sleep// Set the wake pin to -1 if you do not want the main processor to sleep.// In a SAMD system where you are using the built-in rtc, set wakePin to 1const int8_t sdCardPwrPin = -1; // MCU SD card power pin (-1 if not applicable)const int8_t sdCardSSPin = 12; // MCU SD card chip select/slave select pin (must be given!)const int8_t sensorPowerPin = 22; // MCU pin controlling main sensor power (-1 if not applicable)// Create the main processor chip "sensor" - for general metadataconst char *mcuBoardVersion = "v0.5b";ProcessorStats mcuBoard(mcuBoardVersion);// ==========================================================================// Wifi/Cellular Modem Settings// ==========================================================================// Create a reference to the serial port for the modem// Extra hardware and software serial ports are created in the "Settings for Additional Serial Ports" sectionHardwareSerial &modemSerial = Serial1; // Use hardware serial if possible// AltSoftSerial &modemSerial = altSoftSerial; // For software serial if needed// NeoSWSerial &modemSerial = neoSSerial1; // For software serial if needed// Modem Pins - Describe the physical pin connection of your modem to your boardconst int8_t modemVccPin = -2; // MCU pin controlling modem power (-1 if not applicable)const int8_t modemStatusPin = 19; // MCU pin used to read modem status (-1 if not applicable)const int8_t modemResetPin = 20; // MCU pin connected to modem reset pin (-1 if unconnected)const int8_t modemSleepRqPin = 23; // MCU pin used for modem sleep/wake request (-1 if not applicable)const int8_t modemLEDPin = redLED; // MCU pin connected an LED to show modem status (-1 if unconnected)// Network connection information// const char *wifiId = "xxxxx"; // The WiFi access point, unnecessary for gprs// const char *wifiPwd = "xxxxx"; // The password for connecting to WiFi, unnecessary for gprsconst char *apn = "hologram"; // The APN for the gprs connection// For the Digi Wifi XBee (S6B)// #include <modems/DigiXBeeWifi.h>// const long modemBaud = 9600; // All XBee's use 9600 by default// const bool useCTSforStatus = true; // Flag to use the modem CTS pin for status// DigiXBeeWifi modemXBWF(&modemSerial,// modemVccPin, modemStatusPin, useCTSforStatus,// modemResetPin, modemSleepRqPin,// wifiId, wifiPwd);// // Create an extra reference to the modem by a generic name (not necessary)// DigiXBeeWifi modem = modemXBWF;//===============================================================================================// // For any Digi Cellular XBee's// // NOTE: The u-blox based Digi XBee's (3G global and LTE-M global)// // are more stable used in bypass mode (below)// // The Telit based Digi XBees (LTE Cat1) can only use this mode.#include <modems/DigiXBeeCellularTransparent.h>const long modemBaud = 9600; // All XBee's use 9600 by defaultconst bool useCTSforStatus = false; // Flag to use the modem CTS pin for statusDigiXBeeCellularTransparent modemXBCT(&modemSerial,modemVccPin, modemStatusPin, useCTSforStatus,modemResetPin, modemSleepRqPin,apn);// // Create an extra reference to the modem by a generic name (not necessary)DigiXBeeCellularTransparent modem = modemXBCT;Variable *modemRSSI = new Modem_RSSI(&modem, "870ac86f-8b4d-4ee8-88c9-6c4145213379");Variable *modemSignalPct = new Modem_SignalPercent(&modem, "87b28d6f-010f-43e7-aecf-e6758283d50d");// ==========================================================================// Maxim DS3231 RTC (Real Time Clock)// ==========================================================================#include <sensors/MaximDS3231.h>// Create a DS3231 sensor objectMaximDS3231 ds3231(1);Variable *ds3231Temp = new MaximDS3231_Temp(&ds3231, "87954558-e75c-48b2-b28e-761930201845");// ==========================================================================// External I2C Rain Tipping Bucket Counter// ==========================================================================#include <sensors/RainCounterI2C.h>const uint8_t RainCounterI2CAddress = 0x08; // I2C Address for external tip counterconst float depthPerTipEvent = 0.01; // rain depth in mm per tip event// Create a Rain Counter sensor objectRainCounterI2C tbi2c(RainCounterI2CAddress, depthPerTipEvent);// Create number of tips and rain depth variable pointers for the tipping bucket//Variable *tbi2cTips = new RainCounterI2C_Tips(&tbi2c, "12345678-abcd-1234-ef00-1234567890ab");Variable *tbi2cDepth = new RainCounterI2C_Depth(&tbi2c, "388131c1-216f-4aac-952b-61d5d25b7c30");// ==========================================================================// External Voltage via TI ADS1115// ==========================================================================#include <sensors/ExternalVoltage.h>const int8_t ADSPower = sensorPowerPin; // Pin to switch power on and off (-1 if unconnected)const int8_t ADSChannel = 2; // The ADS channel of interestconst float dividerGain = 10; // Default 1/gain for grove voltage divider is 10xconst uint8_t ADSi2c_addr = 0x48; // The I2C address of the ADS1115 ADCconst uint8_t VoltReadsToAvg = 1; // Only read one sample// Create an External Voltage sensor objectExternalVoltage extvolt(ADSPower, ADSChannel, dividerGain, ADSi2c_addr, VoltReadsToAvg);// Create a voltage variable pointerVariable *extvoltV = new ExternalVoltage_Volt(&extvolt, "227ac5ba-10b8-4643-ac2e-840bc4dadf0a");// ==========================================================================// Creating the Variable Array[s] and Filling with Variable Objects// ==========================================================================// The variables to record at 1 minute intervalsVariable *variableList_low[] = {new MaximDS3231_Temp(&ds3231, "xxxxx"),// new ProcessorStats_FreeRam(&mcuBoard, "xxxxx"),new RainCounterI2C_Depth(&tbi2c, "xxxxx"),new Modem_RSSI(&modem, "xxxxx"),new Modem_SignalPercent(&modem, "xxxxx"),// new MaximDS18_Temp(&ds18, "xxxxx"),new ExternalVoltage_Volt(&extvolt, "xxxxx"),};// Count up the number of pointers in the 1-minute arrayint variableCountLow = sizeof(variableList_low) / sizeof(variableList_low[0]);// Create the 1-minute VariableArray objectVariableArray arrayLow;// The variables to record at 5 minute intervalsVariable *variableList_high[] = {new ProcessorStats_Battery(&mcuBoard),new MaximDS3231_Temp(&ds3231, "xxxxx"),new RainCounterI2C_Depth(&tbi2c, "xxxxx"),new Modem_RSSI(&modem, "xxxxx"),new Modem_SignalPercent(&modem, "xxxxx"),// new MaximDS18_Temp(&ds18, "xxxxx"),new ExternalVoltage_Volt(&extvolt, "xxxxx"),};// Count up the number of pointers in the 5-minute arrayint variableCountHigh = sizeof(variableList_high) / sizeof(variableList_high[0]);// Create the 5-minute VariableArray objectVariableArray arrayHigh;// ==========================================================================// The Logger Object[s]// ==========================================================================// Create the 1-minute logger instanceLogger loggerLow;// Create the 5-minute logger instanceLogger loggerHigh;// ==========================================================================// A Publisher to Monitor My Watershed / EnviroDIY Data Sharing Portal// ==========================================================================// Device registration and sampling feature information can be obtained after// registration at https://monitormywatershed.org or https://data.envirodiy.orgconst char *registrationToken = "xxxxx"; // Device registration tokenconst char *samplingFeature = "xxxxx"; // Sampling feature UUID// Create a data publisher for the EnviroDIY/WikiWatershed POST endpoint#include <publishers/EnviroDIYPublisher.h>EnviroDIYPublisher EnviroDIYPOST(loggerHigh, &modem.gsmClient, registrationToken, samplingFeature);// ==========================================================================// Working Functions// ==========================================================================// Flashes the LED's on the primary boardvoid greenredflash(uint8_t numFlash = 4, uint8_t rate = 75){for (uint8_t i = 0; i < numFlash; i++) {digitalWrite(greenLED, HIGH);digitalWrite(redLED, LOW);delay(rate);digitalWrite(greenLED, LOW);digitalWrite(redLED, HIGH);delay(rate);}digitalWrite(redLED, LOW);}// ==========================================================================// Main setup function// ==========================================================================void setup(){// Start the primary serial connectionSerial.begin(serialBaud);// Print a start-up note to the first serial portSerial.print(F("Now running "));Serial.print(sketchName);Serial.print(F(" on Logger "));Serial.println(LoggerID);Serial.println();Serial.print(F("Using ModularSensors Library version "));Serial.println(MODULAR_SENSORS_VERSION);Serial.print(F("TinyGSM Library version "));Serial.println(TINYGSM_VERSION);Serial.println();// Start the serial connection with the modemmodemSerial.begin(modemBaud);// Set up pins for the LED'spinMode(greenLED, OUTPUT);digitalWrite(greenLED, LOW);pinMode(redLED, OUTPUT);digitalWrite(redLED, LOW);// Blink the LEDs to show the board is on and starting upgreenredflash();// Set the timezones for the logger/data and the RTC// Logging in the given time zoneLogger::setLoggerTimeZone(timeZone);// It is STRONGLY RECOMMENDED that you set the RTC to be in UTC (UTC+0)Logger::setRTCTimeZone(0);// Begin the variable array[s], logger[s], and publisher[s]arrayLow.begin(variableCountLow, variableList_low);arrayHigh.begin(variableCountHigh, variableList_high);loggerLow.begin(LoggerID, loggingInterval_low, &arrayLow);loggerHigh.begin(LoggerID, loggingInterval_high, &arrayHigh);loggerLow.setLoggerPins(wakePin, sdCardSSPin, sdCardPwrPin, buttonPin, greenLED);loggerHigh.setLoggerPins(wakePin, sdCardSSPin, sdCardPwrPin, buttonPin, greenLED);// Turn on the modemmodem.setModemLED(modemLEDPin);// Set up the sensors (do this directly on the VariableArray)arrayLow.setupSensors();arrayHigh.setupSensors();// Print out the current timeSerial.print(F("Current RTC time is: "));Serial.println(Logger::formatDateTime_ISO8601(Logger::getNowEpoch()));// Connect to the networkif (modem.connectInternet()){// Synchronize the RTCloggerLow.setRTClock(modem.getNISTTime());//modem.updateModemMetadata();// Disconnect from the networkmodem.disconnectInternet();}// Turn off the modemmodem.modemSleepPowerDown();// Give the loggers different file names// If we wanted to auto-generate the file name, that could also be done by// not calling this function, but in that case if both "loggers" have the// same logger id, they will end up with the same filenameloggerLow.setFileName(FileName1min);loggerHigh.setFileName(FileName5min);// Setup the logger files. Specifying true will put a default header at// on to the file when it's created.// Because we've already called setFileName, we do not need to specify the// file name for this function.loggerLow.turnOnSDcard(true); // true = wait for card to settle after power uploggerLow.createLogFile(true); // true = write a new headerloggerHigh.createLogFile(true); // true = write a new headerloggerLow.turnOffSDcard(true); // true = wait for internal housekeeping after writeSerial.println(F("Logger setup finished!\n"));Serial.println(F("------------------------------------------"));Serial.println();// Call the processor sleep// Only need to do this for one of the loggersloggerLow.systemSleep();}// ==========================================================================// Main loop function// ==========================================================================// Because of the way alarms work on the RTC, it will wake the processor and// start the loop every minute exactly on the minute.// The processor may also be woken up by another interrupt or level change on a// pin - from a button or some other input.// The "if" statements in the loop determine what will happen - whether the// sensors update, testing mode starts, or it goes back to sleep.void loop(){// Check if the current time is an even interval of the logging interval// For whichever logger we call first, use the checkInterval() function.if (loggerLow.checkInterval()){// Print a line to show new readingSerial.println(F("--------------------->low<---------------------"));// Turn on the LED to show we're taking a readingdigitalWrite(greenLED, HIGH);// Send power to all of the sensors (do this directly on the VariableArray)Serial.print(F("Powering sensors...\n"));arrayLow.sensorsPowerUp();loggerLow.watchDogTimer.resetWatchDog();// Wake up all of the sensors (do this directly on the VariableArray)Serial.print(F("Waking sensors...\n"));arrayLow.sensorsWake();loggerLow.watchDogTimer.resetWatchDog();// Update the values from all attached sensors (do this directly on the VariableArray)Serial.print(F("Updating sensor values...\n"));arrayLow.updateAllSensors();loggerLow.watchDogTimer.resetWatchDog();// Put sensors to sleep (do this directly on the VariableArray)Serial.print(F("Putting sensors back to sleep...\n"));arrayLow.sensorsSleep();loggerLow.watchDogTimer.resetWatchDog();// Cut sensor power (do this directly on the VariableArray)Serial.print(F("Cutting sensor power...\n"));arrayLow.sensorsPowerDown();loggerLow.watchDogTimer.resetWatchDog();// Stream the csv data to the SD cardloggerLow.turnOnSDcard(true);loggerLow.logToSD();loggerLow.turnOffSDcard(true);loggerLow.watchDogTimer.resetWatchDog();// Turn off the LEDdigitalWrite(greenLED, LOW);// Print a line to show reading endedSerial.println(F("---------------------<low>---------------------\n"));}// Check if the already marked time is an even interval of the logging interval// For logger[s] other than the first one, use the checkMarkedInterval() function.if (loggerHigh.checkMarkedInterval()){// Print a line to show new readingSerial.println(F("--------------------->high<---------------------"));// Turn on the LED to show we're taking a readingdigitalWrite(redLED, HIGH);// Send power to all of the sensors (do this directly on the VariableArray)Serial.print(F("Powering sensors...\n"));arrayHigh.sensorsPowerUp();loggerLow.watchDogTimer.resetWatchDog();// Wake up all of the sensors (do this directly on the VariableArray)Serial.print(F("Waking sensors...\n"));arrayHigh.sensorsWake();loggerLow.watchDogTimer.resetWatchDog();// Update the values from all attached sensors (do this directly on the VariableArray)Serial.print(F("Updating sensor values...\n"));arrayHigh.updateAllSensors();loggerLow.watchDogTimer.resetWatchDog();// Put sensors to sleep (do this directly on the VariableArray)Serial.print(F("Putting sensors back to sleep...\n"));arrayHigh.sensorsSleep();loggerLow.watchDogTimer.resetWatchDog();// Cut sensor power (do this directly on the VariableArray)Serial.print(F("Cutting sensor power...\n"));arrayHigh.sensorsPowerDown();loggerLow.watchDogTimer.resetWatchDog();// Stream the csv data to the SD cardloggerHigh.turnOnSDcard(true);loggerHigh.logToSD();loggerHigh.turnOffSDcard(true);loggerLow.watchDogTimer.resetWatchDog();// Turn off the LEDdigitalWrite(redLED, LOW);// Print a line to show reading endedSerial.println(F("--------------------<high>---------------------\n"));}// // Once a day, at midnight, sync the clock// if (Logger::markedEpochTime % 86400 == 0)// {// // Turn on the modem// modem.modemWake();// // Connect to the network// if (modem.connectInternet())// {// // Synchronize the RTC// loggerLow.setRTClock(modem.getNISTTime());// // Disconnect from the network// modem.disconnectInternet();// }// // Turn off the modem// modem.modemSleepPowerDown();// }// Call the processor sleep// Only need to do this for one of the loggersloggerLow.systemSleep();} -
2020-04-08 at 11:06 AM #14037
@stoltzfus-12osu-edu/ I am in a similar situation with my low cost EC sensor station project. I need to tweek the AtlasScientific sensor library to fit my hardware. I am using an AtlasSci EZO circuit set for UART mode and a sensorex conductivity probe with internal RTD which I use to report temperature as well as correct the EC reading to 25ºC.
I am a retired EE (Cornell BEE ’62) and not a comp Sci major and my preferred programing language is solder! It would be great to be able to provide functional specs for a particular instance of sensor hardware and someone with a CompSci background (Sara?) write the code for the Modular Sensors library that could be pasted into the DRWI_citSci.ino code. I plan to post details in this forum under a new topic.
-
2020-04-08 at 3:25 PM #14041
@w3asa – I don’t have formal training in computer science or even in electrical engineering. I have one bachelor’s level degree – in chemistry.
@stoltzfus-12osu-edu – two things with your code – and I completely understand why you did it the way you did – because the example did. Blame the chemist.1 – you’re creating each variable 3 times instead of creating it once and then referring it to that same one later. Each time you use that “new” keyword it creates a new variable, but you can only assign one variable of each type to a sensor so the other two weren’t getting updated. In the double logging example it worked fine to create the variables with “new” right in the variable array because there was no overlap between the two arrays. But that definitely wansn’t made clear and is confusing. Anyway, to fix that change your variable arrays so that instead of creating a new variable they use the same variable that you already created up in the sensor sections like so:
C++123456789101112131415161718192021222324252627282930313233// ==========================================================================// Creating the Variable Array[s] and Filling with Variable Objects// ==========================================================================// The variables to record at 1 minute intervalsVariable *variableList_low[] = {ds3231Temp,new ProcessorStats_FreeRam(&mcuBoard, "xxxxx"),tbi2cDepth,modemRSSI,modemSignalPct,// ds18TempVar // if you're using this, you should create aboveextvoltV,};// Count up the number of pointers in the 1-minute arrayint variableCountLow = sizeof(variableList_low) / sizeof(variableList_low[0]);// Create the 1-minute VariableArray objectVariableArray arrayLow;// The variables to record at 5 minute intervalsVariable *variableList_high[] = {new ProcessorStats_Battery(&mcuBoard),ds3231Temp,tbi2cDepth,modemRSSI,modemSignalPct,// ds18TempVar // if you're using this, you should create aboveextvoltV,};// Count up the number of pointers in the 5-minute arrayint variableCountHigh = sizeof(variableList_high) / sizeof(variableList_high[0]);// Create the 5-minute VariableArray objectVariableArray arrayHigh;Since you only use the free RAM in one of the two arrays and battery in the other and you didn’t create either at the top, it’s fine to create them “new” in the array. If you decide you do want them in both or the look of the code bothers you, you can create the free ram and battery variables with statements like
Variable *yourVarName = new ProcessorStats_FreeRam(&mcuBoard, ...)
up in the processor section or elsewhere above.
2 – Modems in ModularSensors are special; they don’t get updated like regular variables tied to a sensor. The signal quality isn’t update until *after* you send out some data. With each cycle, the signal strength saved to the csv and posted is actually the data from one cycle prior. And if you never post data (you don’t) and explicitly update the modem metadata, the values don’t update. You’d want to add publishing code like this in the “high” section right after turning off the SD card.
C++1234567891011121314151617181920212223242526272829// Connect to the networkif (modem.modemWake()){loggerLow.watchDogTimer.resetWatchDog();if (modem.connectInternet()){loggerLow.watchDogTimer.resetWatchDog();// Publish data to remotesloggerHigh.publishDataToRemotes();modem.updateModemMetadata();loggerLow.watchDogTimer.resetWatchDog();// Sync the clock at midnight// NOTE: All loggers have the same clock, pick oneif (Logger::markedEpochTime != 0 &&Logger::markedEpochTime % 86400 == 0){Serial.println(F("Running a daily clock sync..."));loggerLow.setRTClock(modem.getNISTTime());}// Disconnect from the networkloggerLow.watchDogTimer.resetWatchDog();modem.disconnectInternet();}}// Turn the modem offloggerLow.watchDogTimer.resetWatchDog();modem.modemSleepPowerDown(); -
2020-04-08 at 3:39 PM #14042
Also, just so you understand, ModularSensors isn’t powerful enough to “stash” recent data and save it for later. So when you’re in production and only connecting once an hour, the data being sent on the hour will only be for that one point. If for some reason there’s something wrong with the cellular connection in that moment it is supposed to send (thunderstorm, planetary alignment, the XBee being moody, etc), the data will not be sent. The logger will not try to send out the back-log. You’ll have to go fill in the gaps later from the SD card data. It’s definitely on my list to get that working so we could send more data per connection and reduce the connection overhead to data ratio, but I haven’t figured it out yet.
-
2020-04-09 at 1:18 AM #14049
Sara and Jim, thanks for the replies! Sara, knowing where you are now without formal coding training give me to hope to continue persevering!
Thanks for the code suggestions! The first – not creating new variables each time – worked great.
The second, for uploading to MMW at first did not work, saying modemWake and updateModemMetadata was not defined. Since I hadn’t updated the libraries in long time, I updated all libraries. Doing that fixed the errors. However, when running the program I have been receiving only 504 responses. I checked the standard logging_to_MMW.ino program with the new library of modular sensors (0.24.5), and receive some 504s, but mostly it seems successful 201s (earlier this week before updating libraries it worked every time over ~12hrs). Sara, any suggestion why I can’t successfully log in this double_logger program?
Thanks!
-
2020-04-09 at 9:55 AM #14052
I noticed a similar issue regarding response codes when I first got my project uploading to MonMW.
Copy of my response on another forum thread:
Couple of questions:
I noticed several different response codes from the server – 20x(good) 40x(eror). Yet the data uploaded successfully in both cases. Are these related to signal strength or slow response of the server?Data seems to be uploaded with a 2G signal of -95 dBm so what is the noise floor of the GPRSbee modems?
In attempting to solve the missing data issue I deleted GMI_EC2 and reconfigured it and when I uploaded data with the DRWI_CitSci code it showed all four variables. I tried several months ago and that didn’t work. Can anyone explain what’s going on? Perhaps the DRWI_CitSci code has some magic incantation that I missed in my earlier attempts!
Thanks -
2020-04-09 at 12:16 PM #14055
@stoltzfus-12osu-edu – that is very interesting to know. Do you happen to know exactly what version of the library you’d had prior to updating? If not, how long (at least roughly) would the long time since you updated be? A month or two? A year? The specification for the post format hasn’t changed at all since it was first developed, but if there could be something in my code that changed about the way I create the post request that I’ve somehow overlooked and decreased the success rate, I want to track it down.
-
2020-04-09 at 2:28 PM #14056
<p class=”user-nicename”>@srgdamiano – I wish I had looked prior to updating. It was at least July/August of 19, if not late February/early March of 19. I played around with using a back-dated version of the modular sensors library (by specifying the version in the .ini file) to see if I could figure it out.</p>
-
2020-04-09 at 4:04 PM #14057
Sara – Do you have any insight/help on why I (mostly) have success why using the logging_to_MMW program, which uses the logDataAndPublish command, but not with the double_logger program using the code you provided? It seems to print out the same information in serial monitor of what it’s trying to do in both cases, but only returns on 201 on the logging_to_MMW program (otherwise 504).
Thanks!
-
2020-04-09 at 4:07 PM #14058
I waded back through my “git blame” and I don’t see any changes I’ve made to the request more recent than 8 months ago, where I removed one single space – from a double space in one of the headers. The next most recent change was 15 months ago. Is it possible your libraries were that old?
-
2020-04-09 at 4:15 PM #14059
No, I don’t think it could have been that long ago. I apologize if I led you down an un-necessary rabbit hole – it very well could have been that the update to the library had no bearing on how the logging_to_MMW worked at all. It seemed to correlate, but I definitely have nothing definitive to point to.
-
2020-04-16 at 12:33 AM #14078
No problem! The wonder of git is that I actually could track back pretty quickly how long it had been since any changes were made and what those were.
-
-
AuthorPosts
- You must be logged in to reply to this topic.