+ Reply to Thread
Results 1 to 20 of 41

Thread: DEMO: Using SNTP to sync the Spinneret's on-board RTC

Hybrid View

  1. #1

    Default DEMO: Using SNTP to sync the Spinneret's on-board RTC

    Here is a Demo that uses SNTP (Simple Network Time Protocol) to Sync and Set the time of the on-board Spinneret RTC (Real Time Clock). The W5100 is accessed in Indirect mode to open a socket in UDP mode to retrieve the SNTP data. The RTC is then set to the SNTP time and displayed using the PST (Parallax Serial Terminal)

    Note1: Other SNTP time servers here to choose from: http://tf.nist.gov/tf-cgi/servers.cgi

    Note2: A previous version used the W5100 in SPI mode, this version uses Indirect/Parallel mode. Not that it matters much for setting the RTC, I just thought it would be easier to transition into an HTML Web application already using the Indirect driver without loading another object.

    Enjoy!

    EDIT: Please see the latest BUG fix ... http://forums.parallax.com/showthrea...BUG-fix-Update


    LATEST program UPDATE.... v1.0.1
    Attached Files Attached Files
    Last edited by Beau Schwabe (Parallax); 02-07-2013 at 03:28 PM.

    email - Beau Schwabe || BS Circuit Designs

    web - www.BScircuitdesigns.com
    IC's * Inductive proximity sensors * Misc * and more!!

    Do YOU need custom programming? PIC micro? Basic Stamp? Propeller? A custom PCB design? or even a 3D-print design? ... Then send me an e-mail lets talk, I have +20 years experience.

  2. #2

    Unhappy Re: DEMO: Using SNTP to sync the Spinneret's on-board RTC

    Fault at : 50 and 53

    'USA Standard Time Zone Abbreviations
    #-10, HST,AtST,PST,MST,CST,EST,AlST

    'USA Daylight Time Zone Abbreviations
    #-9, HDT,AtDT,PDT,MDT,CDT,EDT,AlDT

    Is the "-" a bug?

    How can I get GMT +1 ?

    Thanks

  3. #3

    Default Re: DEMO: Using SNTP to sync the Spinneret's on-board RTC

    Ltech,

    No, the "-" is not a bug. I'm not sure I understand your 'Fault at : 50 and 53'

    The line... '#-10, HST,AtST,PST,MST,CST,EST,AlST' ... In the Propeller IDE evaluates to ...

    HST = -10
    AtST = -9
    PST = -8
    MST = -7
    CST = -6 <-- I am in Central USA time zone which is GMT - 6
    EST = -5
    AlST = -4

    ...likewise for the Daylight time zones

    If you want GMT + 1, then in the CON section, just make...

    BST = 1 or CET = 1 or wherever you may be.


    The line of code that this constant gets applied to reads ...

    Code:
    SNTP.GetTransmitTimestamp(CST,@Buffer,@LongHIGH,@LongLOW)
    ... Change 'CST' to your abbreviation or just hard code the number in its place like this...

    Code:
    SNTP.GetTransmitTimestamp(+1,@Buffer,@LongHIGH,@LongLOW)

    LongHIGH contains the upper 32 Bits of the 64 Bit time stamp <--- Seconds
    LongLOW contains the lower 32 Bits of the 64 Bit time stamp <--- Fractional seconds

    email - Beau Schwabe || BS Circuit Designs

    web - www.BScircuitdesigns.com
    IC's * Inductive proximity sensors * Misc * and more!!

    Do YOU need custom programming? PIC micro? Basic Stamp? Propeller? A custom PCB design? or even a 3D-print design? ... Then send me an e-mail lets talk, I have +20 years experience.

  4. #4

    Default Re: DEMO: Using SNTP to sync the Spinneret's on-board RTC

    I use bst 19,3 on a ppc mac osx 10.5 .....

    At line Nr 50 and 53 i get "Error at 50,7 Expected Unique Name, Constant or "(" "

    If I remove the minus the program compiled

    I get to find the use of " #-10, HST,AtST,PST,MST,CST,EST,AlST "

    The CET part work when I use " SNTP.GetTransmitTimestamp(1,@Buffer,@LongHIGH,@Lon gLOW) "
    Not working when I use " SNTP.GetTransmitTimestamp(CET,@Buffer,@LongHIGH,@L ongLOW) "
    and before riped the minus or change in line 50 & 53 " #(-10), HST,AtST,PST,MST,CST,EST,AlST "

    I hope to have more time to play with the Supper Spinneret

    Thanks Beau !

  5. #5

    Lightbulb Re: DEMO: Using SNTP to sync the Spinneret's on-board RTC

    Ok at work with pc win7 the file compile fine !
    So it is a bst bug on osx, for me the first one.

  6. #6

    Default Re: DEMO: Using SNTP to sync the Spinneret's on-board RTC

    I need some debugging help. I have tried the sample code in this thread and it works wonderfully. I integrated it into my larger code body and it worked fine. Then I did something. Unfortunately I wasn't paying attention to the time while I was coding another area and I screwed up the SNTP lookup. I have tried commenting out the code I changed, I have debug messages after almost every line it seems. I am getting to the txUDP line in gettime. The data in the buffer looks ok at least based on where the module put it, it's there. I have tried every combination of byte[], @, @byte[], @byte[][0] that I could think of in the off chance that it was something about the buffer address being passed to txudp. Unfortunately with txudp being run in a separate cog, my debugging knowledge hits a brick wall. Any pointers for how to move forward debugging this. Or are there common mistakes calling txudp that you can think of that might help without posting all of my code. ( it's kind of messy right now with debug statements everywhere, it would be kind of embarrassing to post it <grin>) So in short, I'm not looking for someone to tell me what I did wrong, but for suggestions on how to better troubleshoot it so I can find and fix my own problems in the future. Thanks

+ Reply to Thread

Similar Threads

  1. AJAX Spinneret LED Demo and IP Camera
    By Mike G in forum Spinneret Web Server
    Replies: 11
    Last Post: 08-21-2011, 10:10 PM
  2. LOVING Spinneret Web Server DEMO v1.2
    By xanadu in forum Spinneret Web Server
    Replies: 9
    Last Post: 04-29-2011, 01:10 PM
  3. DEMO - RFC 2030 (SNTP) Simple Network Time Protocol with UDP packets over port 123
    By Beau Schwabe (Parallax) in forum Spinneret Web Server
    Replies: 13
    Last Post: 02-08-2011, 05:41 AM
  4. DEMO: Easy HTML with the Spinneret
    By Beau Schwabe (Parallax) in forum Spinneret Web Server
    Replies: 4
    Last Post: 01-29-2011, 10:13 PM
  5. Composite graphics demo now works on the Spinneret
    By zoopydogsit in forum Spinneret Web Server
    Replies: 0
    Last Post: 12-22-2010, 01:01 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts