Member Since: September 8, 2011

Country: United States



Electrical Engineer and programmer

Programming Languages

C, Java, Perl, and others….


MSEE Syracuse; BSEE Univ of Missouri, Rolla

  • I hit the reply button too soon. I forgot to mention that you comment out the imp.onidle function and replace it with the imp.wakeup() function. The wakeup function is a light sleep function that stays connected to the wifi and processes messages from the agent.

    server.log("Wait 60 seconds then sleep.");
    imp.wakeup(60.0, naptime);
    //Power down the imp to low power mode, then wake up after 60 seconds
    //Wunderground has a minimum of 2.5 seconds between Rapidfire reports
    // imp.onidle(function() {
    //  server.log("Nothing to do, going to sleep for 5 minutes");
    //  server.sleepfor(300);
  • I found another issue with the midnight reset. There’s a race condition in the device code. If the device goes idle before the agent.on request is made, then the midnight reset is ignored. Because messages are ignored when the device goes into a deep sleep.

    The function imp.wake() will process messages during it’s sleep time, so I changed the logic, to add a 60 second wait using imp.wakeup(), then it calls a method to put the device into a deep sleep for 5 minutes using imp.sleepfor(300). (I wanted to sleep more to save the battery life.) 60 seconds is probably a bit long, but it works fine for me now.

     function naptime() {
         server.log("Nothing to do, going to sleep for 5 minutes");
    // Start this party going!

    server.log(“Wait 60 seconds then sleep.”); imp.wakeup(60.0, naptime);

  • Over time, my solar panel has developed several white spots in the plastic covering. The look like air bubbles. It seems to still recharge the battery, more or less the same. But lately, after an unprecedented 10 days of rain in the Carolinas, the plastic has blistered and split and looks like there is moisture underneath the plastic coating.

    I just mounted the solar panel facing south off my deck, exposed directly to the sun and the elements. Was this wrong? I had thought solar panels were made to use outdoors, but was there something I should have done to weatherproof it?

    Or did I just get a lemon, and should I order a new one from Sparkfun? It’s only been three months outdoors.

  • midnight


    I had the same problem. I noticed the midnight reset was occurring at the wrong hour.

    I traced through the code and noticed that the logic in the agent local time, was not setting the string properly for the noon hour. Noon should be 12:00 PM instead it was setting it to 12:00 AM. 12:00AM is midnight.

    To fix this, I modified calcLocalTime function to set the string to PM whenever the hour is greater than or equal 12.

    local AMPM = "AM";
    if(hour >= 12) //grw - fix noon hour to be PM
        hour -= 12; //Get rid of military time
        AMPM = "PM";
    if(hour == 0) hour = 12; //Midnight/Noon case

    Later on in the checkMidnight routine I updated the code to only send a request at 12:00 AM. Originally it would send the midnight reset at 4 AM and 4PM. (I don’t know why.) Here’s the update I made. The original code check is in the comment.

    function checkMidnight(ignore) { //Check to see if it’s midnight. If it is, send @ to Arduino to reset time based variables

    //Get the local time that this measurement was taken
    local localTime = calcLocalTime(); 
    // server.log("Local time = " + localTime);
    server.log("Local hour = " + format("%c", localTime[0]) + format("%c", localTime[1])  + format("%c", localTime[15]));
    //grw - check for 12%3A00%3A00%20AM string is URL escaped
    // if(localTime[0].tochar() == "0" && localTime[1].tochar() == "4")
    if(localTime[0].tochar() == "1" && localTime[1].tochar() == "2" && localTime[15].tochar() == "A")
      if(midnightReset == false)
            server.log("Sending midnight reset");
            midnightReset = true; //We should only reset once
            device.send("sendMidnightReset", 1);

    This seems to fix the issue for me. I hope this helps!

  • I got the same error with my station. It turned out that data.sparkfun lower cases all the fields, so I changed the agent imp code so that the field name was all lower case, measurementtime, rather than measurementTime, and that worked correctly. Here’s a link to the data feed for my weather station data stream:

  • No problem, things like that happen to everyone.. :-)

    I got it now, thank you!

  • Hi, The Git Hub links for the Arduino Sketch are returning 404 (Not Found). Could you post the code to Git Hub please?


  • Well that was fast. After about 30 minutes of use, the frequency generator is now unresponsive to any button I press. Even when I switch it off and on, it still remains unresponsive and ignores all input. All I was doing was feeding the input into an oscilloscope and watching the waveforms change. Now its stuck on the last the settings I selected before it broke.

  • I just put mine together and I’m not happy with this kit.

    The switches are ‘sticky’ and tend not to spring back up after being pressed. This makes the user interface very frustrating to use. It tends to get hung up and unresponsive, so I have to power it on and off to reset it. I took the face plate off so the buttons could be pulled back up manually after depressing. Oh and one of the stand-offs was defective, anyway. Just as well as the only way I can use this function generator is without the cover.

    This was my first dud from Sparkfun. I would recommend passing on this one.

No public wish lists :(