Search found 41 matches

by bitrat
Sun Oct 03, 2021 7:35 pm
Forum: General Discussion and Questions
Topic: file backed settings class with dot access
Replies: 5
Views: 1636

Re: file backed settings class with dot access

I like this code, it's quite ingenious! Thanks! :-) Your firmware is truly ancient, you should definitely upgrade, either to release build 1.17 Lol, I just remembered, it's the same firmware I was hacking on in 2019. Why are you concerned about recursion? I've been prone to recursivity since using ...
by bitrat
Sat Oct 02, 2021 6:34 am
Forum: General Discussion and Questions
Topic: file backed settings class with dot access
Replies: 5
Views: 1636

Re: file backed settings class with dot access

Hi Peter, thanks for having a look at my code! :) On MicroPython v1.11-361-g4ba0aff47-dirty on 2019-11-05; ESP32 module with ESP32 I get ... >>> from settings import SettingDict, pp >>> >>> >>> sd0 = SettingDict({"aaa": {"BBB": {"sss": {"w": 11232334}, "x": 11232334, "z": 888888888}}}) Traceback (mo...
by bitrat
Thu Sep 30, 2021 9:32 pm
Forum: General Discussion and Questions
Topic: file backed settings class with dot access
Replies: 5
Views: 1636

Re: file backed settings class with dot access

Update: following the KICS (keep it complicated) principle, I was playing around with attributes that work like dictionary entries. This reminds me of a prototyped language like JavaScript. My motivation is that I wanted a quicker syntax to create, access and save arbitrary config options during dev...
by bitrat
Wed Sep 29, 2021 7:35 pm
Forum: General Discussion and Questions
Topic: test if object is module
Replies: 2
Views: 1068

Re: test if object is module

Doh! yes thanks! :-)
by bitrat
Wed Sep 29, 2021 7:20 pm
Forum: General Discussion and Questions
Topic: test if object is module
Replies: 2
Views: 1068

test if object is module

Hi all, I'm writing my settings class and I've been diverted down some introspection, serialising and unit testing paths. It would be nice if I could test to see if an object provided as an argument is a module... The following approaches aren't available in MP: >>> import inspect >>> import os >>> ...
by bitrat
Tue Sep 28, 2021 11:21 pm
Forum: General Discussion and Questions
Topic: file backed settings class with dot access
Replies: 5
Views: 1636

file backed settings class with dot access

file backed settings class with dot access Hi all, I was about to write a class for this, then wondered if there's one in common use for MP? I'm looking for an object that can be initialised from a config file by reading into a dictionary, accessed using dot notation using __getattr__ and finally ba...
by bitrat
Tue Sep 28, 2021 8:13 am
Forum: General Discussion and Questions
Topic: static IP on esp32 in AP mode?
Replies: 2
Views: 1085

Re: static IP on esp32 in AP mode?

Thanks, yep, I did that. Think I need to do more research...
by bitrat
Mon Sep 27, 2021 6:14 am
Forum: General Discussion and Questions
Topic: static IP on esp32 in AP mode?
Replies: 2
Views: 1085

static IP on esp32 in AP mode?

I'm a bit dense when it comes to networking, so I'm not even sure if this make sense. Does the AP dynamically allocate it's own ip? I've tried just using the ifconfig that's returned from ifconfig if I start wlan in AP mode with no config... wlan.ifconfig( ('192.168.4.1', '255.255.255.0', '192.168.4...
by bitrat
Fri Sep 24, 2021 6:44 am
Forum: General Discussion and Questions
Topic: MicroPython usage in medical devices?
Replies: 5
Views: 7664

Re: MicroPython usage in medical devices?

all of those were C-based. Because C is so fault tolerant... :D Actually, I think the biggest advantage of C is that it's verifiable. An interpreter is just too many levels of abstraction away from the metal to provide guarantees. This is a moot point on a desktop, but on uC's it's more or less pos...
by bitrat
Thu Sep 23, 2021 9:34 pm
Forum: General Discussion and Questions
Topic: deinit all timers?
Replies: 1
Views: 861

deinit all timers?

Hi, I was wondering if there is a way to deinit all timer callbacks in running code, without references to them. Specifically, if I use ctrl-C to exit a program and drop into the REPL, timer callbacks are still executing. Should this happen, or is there a problem somewhere else in my code? Cheers! P...