Search found 116 matches

by Christian Walther
Mon Jul 20, 2020 8:47 pm
Forum: Programs, Libraries and Tools
Topic: ujson utf8 content
Replies: 1
Views: 118

Re: ujson utf8 content

This looks correct to me. Can you explain what your problem/question is? If you were expecting something different, what is it? (In case it helps, \xc1 = \u00c1 in a string literal is the character with Unicode code point 0xc1, LATIN CAPITAL LETTER A WITH ACUTE, and \xc3\x81 in a bytes literal is th...
by Christian Walther
Wed Jul 08, 2020 5:43 pm
Forum: ESP8266 boards
Topic: main.py does not run automatically
Replies: 6
Views: 295

Re: main.py does not run automatically

No (unless you use some kind of external UART-to-WiFi bridge). So that leaves the second option (adding a delay). Or use something other than console output to check if your script runs, e.g. blink an LED or write to the filesystem.
by Christian Walther
Tue Jul 07, 2020 9:09 pm
Forum: ESP8266 boards
Topic: main.py does not run automatically
Replies: 6
Views: 295

Re: main.py does not run automatically

My guess is that it does run, but by the time you connect again, you have missed the output already. Try working with a serial connection (which, unlike WebREPL, isn’t disconnected at reset) or adding some delay into the script so you can catch it before it’s done.
by Christian Walther
Mon Jul 06, 2020 9:08 pm
Forum: General Discussion and Questions
Topic: Problem trying to write variable as bytes
Replies: 1
Views: 134

Re: Problem trying to write variable as bytes

\x34 , or as a Python literal '\\x34' , is a string of four characters. Converting it to bytes using UTF-8 gives you a bytes of four bytes, 0x5C 0x78 0x33 0x34, or as a Python literal b'\\x34' . print() outputs bytes in the literal form. The extra \ there comes from the representation as a literal,...
by Christian Walther
Sun Jul 05, 2020 10:20 pm
Forum: Development of MicroPython
Topic: PIN latch functionality for ESP32
Replies: 12
Views: 473

Re: PIN latch functionality for ESP32

Is this related to the Pin.PULL_HOLD flag (of which I’m not entirely sure what it does)?
by Christian Walther
Sun Jul 05, 2020 8:32 am
Forum: Development of MicroPython
Topic: Pull request failed - code formatting
Replies: 2
Views: 199

Re: Pull request failed - code formatting

You introduced a trailing space on the line indicated by the diff at the end of the build log . || defined(MICROPY_HW_LED6_PWM) Apparently this is checked by running a code formatter over the code and seeing if it causes any differences. If it does, the diff shows you where, and the build fails. (Ne...
by Christian Walther
Sat Jul 04, 2020 8:10 pm
Forum: General Discussion and Questions
Topic: import issue
Replies: 1
Views: 119

Re: import issue

The explanation is that that’s how imports work. They import into the context of the current module, which is not shared with other modules. Every module has its own context, it doesn’t inherit the one from which it is imported. Your solution of putting the import into every module that needs it is ...
by Christian Walther
Tue Jun 30, 2020 8:24 pm
Forum: Programs, Libraries and Tools
Topic: umqttsimple hangs when waking from deepsleep
Replies: 2
Views: 214

Re: umqttsimple hangs when waking from deepsleep

No idea whether that will help, but have you tried connecting with an empty client_id ? You don’t need one when you’re using clean sessions, maybe the server doesn’t like yours. disconnecting when you’re done with publishing? Maybe the server doesn’t like it when you just disappear without saying by...
by Christian Walther
Fri Jun 26, 2020 7:56 pm
Forum: General Discussion and Questions
Topic: Read the board name
Replies: 2
Views: 174

Re: Read the board name

by Christian Walther
Mon Jun 22, 2020 8:32 pm
Forum: ESP32 boards
Topic: ESP32 Doesn't Save WiFi settings
Replies: 2
Views: 207

Re: ESP32 Doesn't Save WiFi settings

This is normal on the ESP32. Unlike the ESP8266, it does not store the WiFi settings in flash. I believe this is not specific to MicroPython. You’ll just have to re-do the setup in boot.py or main.py.