Original Projects and Builds >> NodeMCU IoT Clock >> NodeMCU IoT Clock Status Update

Message started by Administrator on Nov 29th, 2016, 9:32pm

Title: NodeMCU IoT Clock Status Update
Post by Administrator on Nov 29th, 2016, 9:32pm

My Clock is very near initial release (source code release).

UPDATE: Significant Progress

Now Working:

Both Alarms, Including saving the settings.

Saving basic display settings, and restoring them on next boot.

More aggressive attempts to contact the SNTP server if a timesync fails. It now will attempt a time sync every minute for 10 minutes if there is a sync fail. This is both on the initial sync, and on hourly syncs. If after 10 tries, there is still no successful sync, it displays a different message, and does not try again until the next regular hourly attempt. In no case have I seen more than 8 consecutive tries fail.

New fixes as of 06 Dec:

Web pages for Main Settings and both alarms now correctly show current settings when set/viewed, including across a re-boot.

Minor bugs related to the above have been fixed:

Alarm text was loosing formatting across a re-boot - Fixed.

Crash on Alarm if unit had been re-booted/power cycled - Fixed.

Error in display of alarm days.  - Fixed.

Distribution of the code has been delayed to allow these features to be in the initial release.

Initial Code released.

I have added basic "Factory Reset" functionality.  Upon selecting Factory Reset from the main page, a confirmation page is displayed. Upon confirming, the settings files are deleted, all settings are set to default, and the Web pages are re-written. The AP is then set to defaults.  This deletes WiFi passwords, and causes End User Setup to run on boot.

Other Fixes:

I received the red plexiglass, and it looks awesome.  There are still a few light leaks on the top and sides, but "production" units will not have this.

The bottom is a clear, but dotted, and much thicker piece of plexiglass. There is some light leakage out the bottom, but with the unit up on little rubber feet (LRF), this light leakage looks really cool, and is not significant enough to interfere with sleep (Opinion, not a medical evaluation), so I am planning to leave it this way in the next one(s) I make.

I also came up with a really simple solution to the clicking noise -- Install the back panel.  It attenuates the clicking significantly, but the Alarm tones are still more than loud enough.  This is only a solution for the prototype. I still need to order some audio amplifier modules for the "production" units.

Not yet fixed:

Web pages show default settings, not current/saved settings (except network settings, which works as expected).  Dynamically saving/generating the settings pages will require more code.

Setting the 2 alarms within 10 minutes of each other may still cause unpredictable results. (Code not checked/tested for this condition.)

Punctuation in the Alarm Messages still causes messages to be displayed "funny" (control character codes are displayed).

In addition to the above, more checks for valid inputs (settings) are needed.  Ex: Proper format for Alarm Time.

Weather not yet implemented.  Still anticipating possible memory problems when this code is added.

Title: Re: NodeMCU IoT Clock Status Update
Post by Administrator on Feb 1st, 2017, 10:27am

2 Status updates:

1. My current Source Code (as in the source thread) contains a fairly blatant bug.  When an alarm is playing, the relevant sound file is (obviously) open each time the sound is playing. If the user then requests (or refreshes) the web page, the webserver must open the relevant HTML file. While newer NodeMCU firmwares will allow 2 files to be open at once, the version I used did not.  The result is that there is a very high probability of a crash when attempting to cancel an alarm or hitting snooze. While a crash serves (in a rather un-elegant way) to silence the alarm, and the clock resumes normal function after it reboots, this renders the snooze function unuseable.

2. Newer firmwares allow 2 files to be open at the same time, but have another problem. The End User Setup module is being really written, but currently contains bugs that prevent its use.

This issue can be fixed by having "handshakes" between the web server and the sound player to avoided having 2 files open at the same time, or wait for a multi file firmware that works, and rewriting the source accordingly.

Title: Re: NodeMCU IoT Clock Status Update
Post by Administrator on Mar 15th, 2017, 12:26pm

Update and Serious bug notice:

--- Daylight Savings Time Errors:
11 March 2017 DST change did not work correctly due to glaring errors in the DST related code.
  Spring Forward and Fall Back tied to wrong dates. Spring was in November, and Fall was in March.   :-[
  Other not - as - glaring errors and optimizations in this section of the main code.

-- Another DST related error in the Daytime connection to the time server.
  2 issues caused the initial connection to the Daytime server (port 13) and determination of whether DST was in effect to fail.

There seems to be another error causing cross talk between the settings for DST and 12/24 hour time display.  More research on this bug (if it actually exists) is needed.

I hope to also come up with a work around for Issue 1 mentioned in the previous post.

Title: Re: NodeMCU IoT Clock Status Update
Post by Administrator on Nov 6th, 2017, 8:59pm

Please refer to the

NodeMCU IoT Clock Source Code:

page for future status and issues list.  This separate thread is deprecated. Forums » Powered by YaBB 2.1!
YaBB © 2000-2005. All Rights Reserved.