8000 Setting Local Time Manually · Issue #152 · rjwats/esp8266-react · GitHub
[go: up one dir, main page]

Skip to content

Setting Local Time Manually #152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
tichaonax opened this issue Jun 13, 2020 · 8 comments · Fixed by #153
Open

Setting Local Time Manually #152

tichaonax opened this issue Jun 13, 2020 · 8 comments · Fixed by #153
Assignees

Comments

@tichaonax
Copy link

This is something really important especially for my application. Where internet is intermittent or non existent the device Access Point is good enough to operate the device. Ability to set local time becomes critically important. At the moment I hot-spot to my cell phone then once the schedules are set the device is good to go as long as the device is not reset.

@rjwats
Copy link
Owner
rjwats commented Jun 15, 2020

Thx. Yes, this is a missing feature - will get this implement this week.

@rjwats rjwats self-assigned this Jun 15, 2020
@rjwats rjwats linked a pull request Jun 15, 2020 that will close this issue
@rjwats
Copy link
Owner
rjwats commented Jun 15, 2020

PR needs a review and a tidyup tomorrow. Looks decent though:

image

image

@rjwats
Copy link
Owner
rjwats commented Jun 15, 2020

NB - using browser "datetime-local" editor support rather than the MUI pickers to save space on the device. This is also up for review but i think the MUI date pickers are probably a little too large (18k minzipped) to include for this feature.

@tichaonax
Copy link
Author

I wanted to say we got hit by bad cold front Sunday night and went without electricity or wifi for more than 72 hours. Since NTP was inactive, I was not able to setup as the setup button did not get enabled. I tried to disable NTP service but it did not show. My esp8266 were connected to a router that did not have an uplink. Local network worked. What are the exact conditions under which the set-time button is enabled.

@rjwats
Copy link
Owner
rjwats commented Feb 18, 2021

It uses the underlying sntp_enabled flag to determine whether or not to allow the user to set the time manually - which seems to make sense is suppose because otherwise the manually set time would be overridden by the next NTP sync event.

Whenever the device is disconnected from WiFi, or if NTP is explicitly disabled it should become automatically available. But of course if ntp is not being correctly disabled by the SettingsService code this could fail... Here are some of the important bits:

image
image
image

(And basically the whole of NTPSettingsService)

Can you re-produce the problem with a series of steps I can re-create here?

@rjwats rjwats reopened this Feb 18, 2021
@tichaonax
Copy link
Author

Sorry in delaying my response. You are right it did show the set time button but l needed to disable ntp first. I guess my situation was a bit different l was expecting the button to be enabled for a situation like what happened to me.. Having the ntp override my time is actually preferred in my case but l may just want to set the time if ntp is not available for whatever reason but might be available later. My systems will not enter their routines until a valid date time. I think having the button enabled all the time is fine it will still work for those who have ntp disabled and if l do not want override then l can disable ntp altogether but to only allow set time when ntp is disabled would be a loss of functionality l think. Otherwise it is wolike you said.

@tichaonax
Copy link
Author

The steps to reproduce would be. Have the esp device connected to wifi router. Disable the router uplink and reset the esp device. Ensure esp device still connected to wifi, If the ntp is enabled the set time won't show. I expected the button to show l think in my case l want it enabled all the time.

@rjwats
Copy link
Owner
rjwats commented Mar 18, 2022

Yeah, I follow what you're suggesting and it's a bit of an edge-case but I suppose still valid.

I guess there's no harm in enabling the set time feature at all times (could remove the check in the UI yourself). If making this change for everyone I'd put a warning in the dialog if NTP is enabled to say somthing like: "NTP is enabled, the set time you are setting will be overwritten when NTP next synchronises"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0