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

Reply To: Cannot connect to internet for clock sync with NIST

Home Forums Mayfly Data Logger Cannot connect to internet for clock sync with NIST Reply To: Cannot connect to internet for clock sync with NIST

#13786
Sara Damiano
Moderator

You shouldn’t really need the development board.  If you’re going to use a bunch of the XBee’s I’d say it’s a $70 well spent, but you shouldn’t *need* it.

Nothing looks wrong in your program.  I’m guessing you’re just not connecting to the internet.  What build flags are you running with?  Can you set all of these and post the log from the serial port monitor:

The output might be very long; you’ll probably see a _lot_ of lines that are AT+CEREG? and responses to that.  That’s the Mayfly asking the cellular chip on the XBee3 if it’s registered on the network yet.  If you eventually get a +CEREG=5 (or 1), you’re registered.  If the response is still a 2 or 4 you’re not registered with the network.  If you get as far as being registered and then you’re still not able to post data, that’s a problem with your code or my library.  If you’re never registered, it’s the bee or the sim.

Some things to try if you’re not getting registered:

  • Increase the time modem.connectInternet(120000L) up to 10 or 15 minutes (it’s in ms, 120000L = 2 minutes; 600000L = 10 minutes, the “L” tells the compiler it’s a “long” number).  Making the initial connection with a new sim/board/tower may take a really long time.
  • Flip back and forth between using “bypass” and “transparent” mode.  See if one works.
  • Run a basic program on your Mayfly that just wakes up the bee and leaves it awake.  Let it sit a long while and see if you ever connect.  Something like this should work:
  • If you eventually get a “0” (zero) response, you’re finally connected.  A “22” or “FF” means it’s searching or the status is unknown.  A “25” means registration has been denied – if you get that, your APN that you set in your other code must have been wrong – I doubt you’ll get this.