ropg / ezTime

ezTime — pronounced "Easy Time" — is a very easy to use Arduino time and date library that provides NTP network time lookups, extensive timezone support, formatted time and date strings, user events, millisecond precision and more.
MIT License
327 stars 92 forks source link

strip part of lib with define(s) #6

Closed ramarro123 closed 5 years ago

ramarro123 commented 5 years ago

Hi,

i see that it's possible to remove some part of code with undef caching things.

i was wondering, if it's possible in the future to do the same with timezone part. code size it's quite an issue for me, i am trying to make a reef aquarium controller, and pwm+i2c+5 adc+ 2x multiplexer + lcd+ 3*pump with timing + sunset/sunrise/cloud (for lights) and other things eat up a lot of memory. include the fact that i store everything via MQTT, have a websocket for debug, you can imagine that every bYte matter :)

taking out some pieces will greatly help.

tnx!

ropg commented 5 years ago

Timezones are quite central to the functionality of ezTime, and also do not take as much space as you might think. What does take up space is UDP networking (for NTP and my own timezoned), but that's already better than when NTP needed UDP and timezones needed TCP. What Arduino platform are you using? I know it's a cop-out, but wouldn't it be easier to take a slightly beefier platform? You do want to do quite a lot... Maybe use an ESP32? If you use the M5Stack you get a display and a couple of buttons to boot. Could even use M5ez... Just saying... :)

I was thinking of having a #define NO_FRILLS that takes out ISO weeks, Military timezones and a few other things that are a bit luxurious. It will shave off a bit, just don't expect major savings from that.

I'm closing this because it's not really an open issue as such, but I will keep thinking about it...

ramarro123 commented 5 years ago

ok tnx :)

at the moment i am using an esp8266 :)

btw that's a very good lib, you did a great work with millis implementation, it's really useful, and tnx for your super fast reply