Author Topic: REQUEST: Creating a method to send a UDP packet... (NTP based RTC)  (Read 7005 times)

meldrath

  • Newbie
  • *
  • Posts: 21
Code: [Select]
void DigiFi::NTP(char *aHost){
setNetParams("UDP", "CLIENT", 123, aHost);

}

This will allow me to setup the digix to use UDP, but how to send a packet?

Code: [Select]
void DigiFi::sendData(int len, char *data)//SEND
{
    Serial1.print("AT+SEND=");
    Serial1.print(len);
    Serial1.print(",");
    Serial1.print(data);
    Serial1.print("\r");
    readResponse(0);
}

Does not look like it's equipped to handle this....

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: REQUEST: Creating a method to send a UDP packet... (NTP based RTC)
« Reply #1 on: December 23, 2013, 11:47:55 pm »
NTP example coming in the next release - hopefully coming tomorrow, but maybe later this week due to the holiday

meldrath

  • Newbie
  • *
  • Posts: 21
Re: REQUEST: Creating a method to send a UDP packet... (NTP based RTC)
« Reply #2 on: December 24, 2013, 07:00:25 am »
Awesome. I look forward to this!

Building an aquarium controller, and having a good measure of the time is crucial for certain operations :)

meldrath

  • Newbie
  • *
  • Posts: 21
Re: REQUEST: Creating a method to send a UDP packet... (NTP based RTC)
« Reply #3 on: December 28, 2013, 07:26:08 am »
NTP example coming in the next release - hopefully coming tomorrow, but maybe later this week due to the holiday

Any update on this sir? Thank you :)

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: REQUEST: Creating a method to send a UDP packet... (NTP based RTC)
« Reply #4 on: December 28, 2013, 10:39:40 pm »
Getting very close but still in progress - in additon to the holiday I have family in town and a contract design to finish - but more than either of those I ran into a few bugs that seemed worth fixing before releasing it. I'll work on it some more tonight and if all goes well should have a release before Monday. Thanks for your patience

meldrath

  • Newbie
  • *
  • Posts: 21
Re: REQUEST: Creating a method to send a UDP packet... (NTP based RTC)
« Reply #5 on: December 28, 2013, 10:44:49 pm »
Thanks for the update! Good luck, and enjoy your family :)

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: REQUEST: Creating a method to send a UDP packet... (NTP based RTC)
« Reply #6 on: January 05, 2014, 02:55:49 am »
new release with NTP and RTC examples: http://digistump.com/wiki/digix/tutorials/software

meldrath

  • Newbie
  • *
  • Posts: 21
Re: REQUEST: Creating a method to send a UDP packet... (NTP based RTC)
« Reply #7 on: January 05, 2014, 07:53:17 pm »
Awesome.... going to try this out :D

meldrath

  • Newbie
  • *
  • Posts: 21
Re: REQUEST: Creating a method to send a UDP packet... (NTP based RTC)
« Reply #8 on: January 05, 2014, 08:23:28 pm »
There's nothing in the digifi library, and no digifi.h as seen in some of your examples.... or at least what I can find.

meldrath

  • Newbie
  • *
  • Posts: 21
Re: REQUEST: Creating a method to send a UDP packet... (NTP based RTC)
« Reply #9 on: January 05, 2014, 08:24:34 pm »
DatastreamDownload.ino:1: fatal error: DigiFi.h: No such file or directory when trying to upload, so it confirms my suspicion.

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: REQUEST: Creating a method to send a UDP packet... (NTP based RTC)
« Reply #10 on: January 07, 2014, 12:42:26 am »
My mistake - if you re-download the addons it is now fixed.

NetlinkEngineer

  • Newbie
  • *
  • Posts: 2
Re: REQUEST: Creating a method to send a UDP packet... (NTP based RTC)
« Reply #11 on: January 25, 2014, 09:18:01 am »
The wifi module powers up by default in transparent mode -- that is to say that it looks like a cable.  Whatever you send to it gets sent "transparently".  And you access the Wifi module on the DigiX via Serial1.  So if you setup up the remote address and port, mode to UDP, etc via the module web interface (see the DigiX startup wiki page) all you have to do is open Serial1 in your sketch (matching the speed you setup in the web UI) and send your data to Serial1 using Serial.write.  The data will end up at the UDP address/port you specified in the configs. 

... from there you can get fancy and update the remote address/port, etc. using the DigiFi lib if you need to.

Kevin