Search found 67 matches
- Sun Feb 28, 2021 8:25 am
- Forum: ESP8266 boards
- Topic: timezone support in MicroPython ?
- Replies: 23
- Views: 89440
Re: timezone support in MicroPython ?
What firmware are you guys using? I can't replicate this with firmware built today. npttime.settime() error overflow converting long int to machine word with ESP32, sys.version = 3.4.0 esp32-idf4-20200902-v1.13.bin How to repeat? Execute multiple times ntptime.settime() >>> ntptime.settime() >>> nt...
- Sat Feb 27, 2021 3:51 pm
- Forum: General Discussion and Questions
- Topic: Best method to catch random errors?
- Replies: 3
- Views: 2109
Re: Best method to catch random errors?
Here’s an example of catching an exception and logging to a file: https://github.com/dhylands/upy-examples/blob/master/print_exc.py Thank you. I did not know sys.print_exception. I had: if __name__ == "__main__": f4.write("Execute main\n") try: main() except Exception as e: f4.write("Exception %s" ...
- Sat Feb 27, 2021 12:29 pm
- Forum: General Discussion and Questions
- Topic: Best method to catch random errors?
- Replies: 3
- Views: 2109
Best method to catch random errors?
With Python try - except is method to catch errors https://docs.python.org/3/tutorial/errors.html . Except should not be too broad, but excepts can be nested to cover most known errors. Programmer shall try to figure out all scenarios where error may raise. What about random errors, which programmer...
- Tue Feb 23, 2021 11:25 am
- Forum: General Discussion and Questions
- Topic: Clever way to connect to Mqtt server
- Replies: 15
- Views: 6470
Re: Clever way to connect to Mqtt server
Peter's mqtt_as.py is best approach. The mqtt broker status can be updated as an example from broker's $sys messages. As an example, if you do not see $SYS/broker/uptime increasing, the broker is down, or if you don't receive anything, you have lost connection. As with Peter's mqtt_as.py, you can se...
- Mon Feb 22, 2021 10:10 am
- Forum: ESP8266 boards
- Topic: timezone support in MicroPython ?
- Replies: 23
- Views: 89440
Re: timezone support in MicroPython ?
the timzone had not bothered me with my projects until i made a neopixel clock and we switched to daylight savings recently. So this is what I have come up with for my timezone calculations based on the input from the earlier posts by davef and enzo The different months, March, April, September and...
- Sat Feb 20, 2021 1:11 pm
- Forum: Programs, Libraries and Tools
- Topic: Astral port/alternative
- Replies: 7
- Views: 9141
Re: Astral port/alternative
Perhaps somewhere is better code available for MPY, but I ported Suntime class for Micropython. https://github.com/divergentti/airquality/blob/main/esp32/solarpanelrotator/Suntime.py and this seems to be quite ok. Compared to Google, sun rise drifts a few minutes, sun set is OK. Original: https://gi...
- Mon Feb 01, 2021 11:07 am
- Forum: ESP32 boards
- Topic: microwebsrv2 : not enought memory !
- Replies: 3
- Views: 2053
Re: microwebsrv2 : not enought memory !
I don't have experience of that module, but I have hit to same problem with other classes.
Have you tried gc.collect() prior to code execution?
Have you tried gc.collect() prior to code execution?
- Thu Jan 28, 2021 11:30 am
- Forum: ESP32 boards
- Topic: LVGL with ILI9341 + Touch panel
- Replies: 17
- Views: 10907
Re: LVGL with ILI9341 + Touch panel
Nearly 35K is a large buffer. It is vital to instantiate the ILI9341 as early as possible in your code. It is advisable to issue gc.collect() immediately before instantiating. The message about "Ignoring framebuf_utils.mpy" is normal and harmless. To give you an idea of how I do it, the demos in na...
- Wed Jan 27, 2021 9:55 am
- Forum: ESP32 boards
- Topic: LVGL with ILI9341 + Touch panel
- Replies: 17
- Views: 10907
Re: LVGL with ILI9341 + Touch panel
My view is that RA8875 is the best solution for large, touch sensitive displays. Its one drawback is that it isn't particularly fast: a complete redraw of complex screens with a lot of elements (like my keyboard demos) is not visually instantaneous. If speed is crucial you'll find a solution based ...
- Wed Jan 27, 2021 8:14 am
- Forum: ESP32 boards
- Topic: LVGL with ILI9341 + Touch panel
- Replies: 17
- Views: 10907
Re: LVGL with ILI9341 + Touch panel
About my code: I hit into serious memory issues and I re-structured and refactored it quite a bit. I removed comments, shortened variable names etc. For some reason speeding up CPU to 240MHz seems to keep free memory around 40 000, but if I use standard 160MHz, free memory might dip almost 0 and so...