openshwprojects / OpenBK7231T_App

Open source firmware (Tasmota/Esphome replacement) for BK7231T, BK7231N, BL2028N, T34, XR809, W800/W801, W600/W601 and BL602
https://openbekeniot.github.io/webapp/devicesList.html
1.39k stars 241 forks source link

[Question] How do I change the NTP Server? #851

Closed viny182 closed 1 year ago

viny182 commented 1 year ago

Hello Guys,

In a BK7231N chip flashed with version 1.17.54, how do I setup a manual NTP Server?

I try to run the command NtpServer on the console, but I'm getting the command unknown error, as below... image

Also, on the homepage, I See the NTP server enabled is the 217.147.223.78 from pool.ntp.org. This what I need to change.

image

ataa commented 1 year ago

Try: ntp_setServer command.

viny182 commented 1 year ago

Try:

ntp_setServer command.

Unfortunately I've got the same output: 'Unknow command'

ataa commented 1 year ago

I am on version 1.17.104 (BL602) and it works on mine, make sure ntp driver is loaded.

ntp_setServer 192.168.20.1

Info:NTP:NTP server set to 192.168.20.1
Info:CMD:[WebApp Cmd 'ntp_setServer 192.168.20.1' Result] OK

ntp_info

Info:NTP:Server=192.168.20.1, Time offset=0
Info:CMD:[WebApp Cmd 'ntp_info' Result] OK
Info:NTP:Seconds since Jan 1 1900 = 3895663524
Info:NTP:Unix time  : 1686674724
Info:NTP:Local Time : 2023/06/13 16:45:24
viny182 commented 1 year ago

I am on version 1.17.104 (BL602) and it works on mine, make sure ntp driver is loaded.

ntp_setServer 192.168.20.1


Info:NTP:NTP server set to 192.168.20.1

Info:CMD:[WebApp Cmd 'ntp_setServer 192.168.20.1' Result] OK

ntp_info


Info:NTP:Server=192.168.20.1, Time offset=0

Info:CMD:[WebApp Cmd 'ntp_info' Result] OK

Info:NTP:Seconds since Jan 1 1900 = 3895663524

Info:NTP:Unix time  : 1686674724

Info:NTP:Local Time : 2023/06/13 16:45:24

Errmmm, my bad.

I tried in other device where NTP driver was stopped.

I confirm Starting NTP and runing ntp_setServer x.x.x.x works.

Thank you @ataa !