logo elektroda
logo elektroda
X
logo elektroda

[Solved] Resolving cmd ntp_setLatLong NOT found Error in NTP Configuration

agarg 501 5
ADVERTISEMENT
  • #1 21294627
    agarg
    Level 2  
    My
    Quote:
    ntp_setLatLong
    is not working

    Log:
    
    Info:NTP:NTP driver initialized with server=192.168.111.1, offset=0
    Info:MAIN:Started NTP.
    Info:NTP:NTP server set to 192.168.111.1
    Info:NTP:NTP offset set, wait for next ntp packet to apply changes
    Error:CMD:cmd ntp_setLatLong NOT found (args 38.428258 -122.587919)
    Info:HTTP:DRV_SSDP_Init - no wifi, so await connection
    Info:MAIN:Started SSDP.
    Info:CMD:CMD_PowerSave: will set to 1
    


    my autoexec.bat:
    
    // start NTP driver, so we have time from Network Time Protocol (NTP) to synchronize the clocks 
    power off
    startDriver NTP
    // Configure a local NTP server on your LAN so that devices do not need to connect to the internet
    ntp_setServer 192.168.111.1
    // Set the local timezone as NTP server only provide UTC time
    ntp_timeZoneOfs -8
    // Setting the devices location will allow for calculating sunrise and sunset times
    ntp_setLatLong 38.428258 -122.587919
    //Show up in Windows Network
    startDriver SSDP
    // Reduce power usage and heating
    PowerSave 1
    // Wait for NTP to connect
    waitFor NTPState 1
    echo "NTP is ready"
    //
    //  Turn on at 03:00:00 every day (0xff)  {To be changed later to Sunday (0x01)}
    //addClockEvent 14:43:00 0x16 1 backlog power1 on; delay_s 100; power1 off;
    //addClockEvent 08:15:00 0x7f   568 POWER ON
    //addClockEvent 08:16:00 0x7f   569 POWER OFF
    //
    // This aliased command will turn off relay on CH1 after 30 seconds
    // addRepeatingEvent	[IntervalSeconds][RepeatsOr-1][CommandToRun]
    alias turn_off_after_time addRepeatingEvent 30 1 power off
    alias do_cycle backlog power on; turn_off_after_time 
    addClockEvent 10:28:00 0x7f -1 do_cycle 
    //
    
  • ADVERTISEMENT
  • Helpful post
    #2 21294795
    p.kaczmarek2
    Moderator Smart Home
    Hey, which platform? It may not be enabled in your build. Then you'd need to check:
    https://www.elektroda.com/rtvforum/topic4033833.html
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 21294803
    agarg
    Level 2  
    >>21294795
    I am on BK7231N:

    Build on Aug 29 2023 06:16:18 version 1.17.230
    Online for 25 minutes and 44 seconds
    Device MAC: XX:XX:XX:XX:XX:XX
    Short name: obk12A97C20, Chipset BK7231N
  • ADVERTISEMENT
  • Helpful post
    #4 21294810
    p.kaczmarek2
    Moderator Smart Home
    Screenshot of source code in C language, featuring a conditional command for ENABLE_NTP_SUNRISE_SUNSET.
    ENABLE_NTP_SUNRISE_SUNSET seems to be enabled on Beken, are you really sure?

    Does the ntp_setLatLong command work if you use it at runtime from console?

    Added after 1 [minutes]:

    EDIT: I have this command on my build..

    Screenshot showing the Command Tool interface for the BK7231T device.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #5 21294934
    agarg
    Level 2  
    No, it fails on command line on my build.
    I am using :
    OTA
    Chipset: BK7231N
    Build: Build on Aug 29 2023 06:16:18 version 1.17.230
    Screenshot of an interface displaying system logs with various network status and configuration information.

    Added after 56 [minutes]:

    >>21294810
    I upgraded to a newer build and now it is working. I suspect, the build on my switch did not have it.
    Sorry for the confusion.
  • #6 21294954
    agarg
    Level 2  
    Replaced an old firmware with a newer build. I was using a very old build.
ADVERTISEMENT