Search found 216 matches

by tve
Fri May 22, 2020 4:41 pm
Forum: MicroPython pyboard
Topic: bytecode not possible for boot.py & main.py?
Replies: 4
Views: 3408

Re: bytecode not possible for boot.py & main.py?

Both boot.py and main.py (regardless of it's name) must be python source files. There is nothing in the code that looks at the filename extension as these files are not imported, simply executed. You'd have to test the filename and switch to EXEC_FLAG_SOURCE_IS_RAW_CODE in https://github.com/micropy...
by tve
Fri May 22, 2020 7:20 am
Forum: General Discussion and Questions
Topic: The dreaded forgotten await
Replies: 3
Views: 2093

Re: The dreaded forgotten await

I'm aware of the valid uses of coros without await... But at this point I'd be willing to have a checker that barfs unless there's an annotation of some form. In the end, having to add such annotations would be worth it if it saves the aggravations. At least to me.
by tve
Fri May 22, 2020 1:44 am
Forum: General Discussion and Questions
Topic: The dreaded forgotten await
Replies: 3
Views: 2093

The dreaded forgotten await

I don't know how many times over the past month I spend a good 10 minutes troubleshooting some mysterious failure to find that I had forgotten the "await" when calling a coro. Usually I'll look at that line of code multiple times and see nothing wrong with it before the lightbulb finally goes on. Is...
by tve
Fri May 22, 2020 12:52 am
Forum: MicroPython pyboard
Topic: bytecode not possible for boot.py & main.py?
Replies: 4
Views: 3408

Re: bytecode not possible for boot.py & main.py?

I'm afraid you're correct. From main.c:

Code: Select all

        const char *boot_py = "boot.py";
        int ret = pyexec_file_if_exists(boot_py);
by tve
Thu May 21, 2020 8:13 pm
Forum: Programs, Libraries and Tools
Topic: Terminal S - a super simple serial terminal
Replies: 10
Views: 9463

Re: Terminal S - a super simple serial terminal

miniterm.py raw mode doesn't support arrow keys
have you tried

Code: Select all

--filter direct
instead of raw
by tve
Thu May 21, 2020 3:56 am
Forum: General Discussion and Questions
Topic: ADC performance of MicroPython boards
Replies: 12
Views: 21274

Re: ADC performance of MicroPython boards

To be fair: MP doesn't use the esp32's IDF calibration routines...
by tve
Wed May 20, 2020 4:54 pm
Forum: Programs, Libraries and Tools
Topic: uasyncio --- implementation of interrupts
Replies: 7
Views: 5579

Re: uasyncio --- implementation of interrupts

To answer the OP's original question, the pattern I like the most is to use a persistent task (`while True` loop) for your long running function and have it block on a asyncio.Event at the top of each iteration. The "interrupt" function can then set the Event to "launch the function". In the current...
by tve
Wed May 20, 2020 4:41 pm
Forum: ESP32 boards
Topic: ESP32 using OTA updates
Replies: 7
Views: 16260

Re: ESP32 using OTA updates

The current state is that I'm a couple of days away from a beta release of my MQTT "micro-framework". I have now spent a couple of weeks quite happy updating code on remote boards that are only connected via one MQTTS connection. I have also done my first MP firmware OTA update over MQTTS of a remot...
by tve
Wed May 20, 2020 4:24 pm
Forum: Pyboard D-series
Topic: How do I use Threading / Uasyncio Pyboard D
Replies: 3
Views: 3189

Re: How do I use Threading / Uasyncio Pyboard D

I can't tell you about threads, but for asyncio you need to use firmware _post_ 1.12, i.e. a daily build.
by tve
Wed May 20, 2020 12:51 am
Forum: General Discussion and Questions
Topic: Webrepl & ESP32 during running main.py not working
Replies: 4
Views: 4050

Re: Webrepl & ESP32 during running main.py not working

The obscure reason is that on the esp32 MP uses a clock tick of 100Hz (10ms) and in the sleep code it checks whether less than one tick is left and if so it busy-waits the remaining time. If you call sleep_ms(10) by the time it makes the check a little less than 10ms are left, hence the situation yo...