Current News

Moderator: Mmiscool

User avatar
By Mmiscool
#35736 For some things like this that will be very common for people to use the trade off in program size can be beneficial. C/C++ can handle this with very little impact on binary size and will vastly increase execution speed compared to that of basic. I actually just used your basic code with some modifications to implement the current configuration in the interpreter.

As to the time not working to update are you connected to your WiFi network at the time of the update call?
User avatar
By forlotto
#35738 On the other hand there may be doubt this will bloat the OS much. You could create a branch that does not include anything. But, time is a common thing to handle when dealing with automation or code of any sort really. Bloat is normally referred to as features having very little or no use to the end user. Can you honestly say that the want for automation does not demand these types of functions? Not every "simple" application is going to need the current time or have programming that would require it but the esp8266 has a wide variety of needs not all will be covered but would be nice to keep time .

Interesting things like digital rain gauges, sprinkler systems, thermometers, home automation, home security, thermostats, life alert type systems... Many things could use time stamps or weekly/daily timers this is just to name a few it really does open up a lot of doors to be honest thus putting it in a different category than "Bloat."

This is a useful module and so much in our lives is based off of time. Often data needs time and date stamps to be of any relevance. Heck something as simple as this post uses a time stamp.

@Heckler it would be nice to understand what you are doing with your module that would cause it to be bloat in your eyes there should still be plenty of overhead left for a few more additions I would think as my esp runs very smoothly with all current builds but if yours does not I'm curious as to why or how you plan to use the resources not used?
User avatar
By heckler
#35747 Sorry, this "NTP Time" thread was not the best place to bring up the question of code "bloat". And bloat really has a bad connotation to it.

I agree with you both in that if a feature is likely to be used by most then it belongs in the base OS.

My apologies. :|
+++++++++++++++++++++++++

Now to the issue,

my esp-01 module is connected to the internet and does get good NTP time WITHOUT the timesetup() function.
This code below...
Code: Select allmemclear
'
[GetTime]
cls
button "GetTime" [GetTime]
button "Exit " [Exit]
timesetup(-3,0)
print time()
wait
[Exit]
end

Returns this...
Thu Jan 01 00:00:00 1970


This code...
Code: Select allmemclear
'
[GetTime]
cls
button "GetTime" [GetTime]
button "Exit " [Exit]
print time()
wait
[Exit]
end

Returns this...
Sat Dec 05 17:28:40 2015


The only difference is the elimination of the timesetup(-3,0) line.

thanks for your help
dwight
User avatar
By forlotto
#35752 Shortest way I can think of to do it would be...

Code: Select all[GETTIME}

print time()


If you wanted to use your string functions to pick out from there you could say:
Code: Select allLet bla = time()

Then add string functions to pick out stuff you want and store it in bla2 and print bla2.