Search found 2754 matches

by jimmo
Mon Jan 06, 2020 8:24 pm
Forum: Programs, Libraries and Tools
Topic: Simple MicroPython to C interface
Replies: 2
Views: 1462

Re: Simple MicroPython to C interface

In general, given an mp_obj_t you need to check its type and then convert it to the type you're expecting (e.g. MP_OBJ_TO_PTR). But in this case, to extract the bytes out of any type supporting the buffer protocol, you want to use mp_get_buffer_raise() or similar: mp_buffer_info_t bufinfo = {0}; mp_...
by jimmo
Mon Jan 06, 2020 8:20 pm
Forum: ESP8266 boards
Topic: Board isn't responding without utime.sleep()
Replies: 4
Views: 2552

Re: Board isn't responding without utime.sleep()

If slack is rejecting request, shouldn't this explode? Even if this would parse empty JSON none of the fields that I try to read would exist. Wouldn't this output some error? I would imagine it would fail the request, not sure if it would still return valid JSON. I would recommend adding a try/exce...
by jimmo
Mon Jan 06, 2020 12:28 pm
Forum: ESP8266 boards
Topic: RAM Hex viewer
Replies: 10
Views: 6222

Re: RAM Hex viewer

You'll have to look up the ESP8266 memory map. e.g. https://github.com/esp8266/esp8266-wiki/wiki/Memory-Map

Sorry the address I gave earlier was for ESP32. On ESP8266, the flash is at 0x40200000
by jimmo
Mon Jan 06, 2020 11:33 am
Forum: ESP8266 boards
Topic: RAM Hex viewer
Replies: 10
Views: 6222

Re: RAM Hex viewer

Seems i can't replace esp.flash_read() with uctypes.bytearray_at() because it crashed, e.g.: Because RAM and flash are not the same thing. Flash is mapped into some region of RAM (starting at 0x3F400000 I think). But you probably can't just go accessing any random address of RAM (for example, zero).
by jimmo
Mon Jan 06, 2020 3:23 am
Forum: ESP8266 boards
Topic: Board isn't responding without utime.sleep()
Replies: 4
Views: 2552

Re: Board isn't responding without utime.sleep()

Perhaps without the sleep the slack service is rejecting your request (due to rate limiting). You should definitely be limiting yourself to only sending the query every minute or something. I think your code will raise an exception if it tries to convert an unsuccessful HTTP response into JSON. Rega...
by jimmo
Mon Jan 06, 2020 12:01 am
Forum: ESP32 boards
Topic: Connecting to PC via USB, while power supply is ON
Replies: 3
Views: 2061

Re: Connecting to PC via USB, while power supply is ON

In addition to the power supply you're using, it also depends on your ESP32 board. (i.e. how the USB 5V->3.3V regulation works and protection diodes on the board). In general though, it is common for boards to be able to support this, but there are many that don't. Is there any other way to replace ...
by jimmo
Sun Jan 05, 2020 11:56 pm
Forum: General Discussion and Questions
Topic: mpy-cross questions
Replies: 10
Views: 5657

Re: mpy-cross questions

>>> sys.path=['/', '/lib', ''] You can't override members of a built-in module. The definition of these modules is in ROM. But as you've discovered, the member itself is a list, and therefore supports the insert method. Seems that's hardcoded in ports/esp8266/qstrdefsport.h: This is just the defini...
by jimmo
Sun Jan 05, 2020 5:16 am
Forum: General Discussion and Questions
Topic: dict.keys() does not behave as set
Replies: 4
Views: 2803

Re: dict.keys() does not behave as set

Is this a known limitation of the dict_view class? Yes, there's a comment in the code "// only supported for the 'keys' kind until sets and dicts are refactored" however to really be classed as a "known limitation" it should have a corresponding test in tests/cpydiff which is what's used to generat...