Search found 105 matches

by Christian Walther
Mon Jun 01, 2020 7:49 am
Forum: General Discussion and Questions
Topic: Can import random, but can't call randint
Replies: 2
Views: 32

Re: Can import random, but can't call randint

This is expected. The urandom module (which is what you’re getting when you import random without having a random.py in the filesystem) only implements a subset of the standard Python random module. See help(random) for what is available. The rest you’ll have to implement yourself based on that, or ...
by Christian Walther
Wed May 27, 2020 7:19 pm
Forum: Programs, Libraries and Tools
Topic: spi won't send last bytearray() value if its 0x00
Replies: 5
Views: 613

Re: spi won't send last bytearray() value if its 0x00

I am almost certain that your conclusion that only 2 bytes are being sent is wrong and you are making a common mistake. Note that all your examples contain 3 bytes. They are (in hexadecimal) F8 00 10 F8 00 60 F8 00 C0 F8 30 00 F8 00 10 0x60 is the ASCII code of '`', 0x30 is the ASCII code of '0', an...
by Christian Walther
Fri May 22, 2020 4:45 pm
Forum: ESP8266 boards
Topic: Who can confirm deep sleep alarm wake on D1 mini boards
Replies: 4
Views: 305

Re: Who can confirm deep sleep alarm wake on D1 mini boards

That was just me trying to figure out / guess why the MCU would (half-)reset even without the connection. The capacitor is not one I am placing, but must be one that’s on the board (or the module) already. I can’t tell the exact connections from looking at the board because the module obscures the t...
by Christian Walther
Fri May 22, 2020 9:17 am
Forum: ESP8266 boards
Topic: Who can confirm deep sleep alarm wake on D1 mini boards
Replies: 4
Views: 305

Re: Who can confirm deep sleep alarm wake on D1 mini boards

I have two Wemos D1 mini v2.1.0 here, to my knowledge original ones from Wemos. They have some ESP-12 module with “WeMos” on the metal shield. They work properly as far as I can tell: When GPIO16 and RST are externally connected, waking from deep sleep using the RTC works as expected (using the code...
by Christian Walther
Sun May 17, 2020 5:16 pm
Forum: ESP8266 boards
Topic: Problem with Newline if i sending textfiles with udp-socket
Replies: 5
Views: 203

Re: Problem with Newline if i sending textfiles with udp-socket

Are you sure you quoted that debug output exactly? The (lack of) quotes and parentheses look suspicious. What I get is something like (Debug): received: b'Hello\r\nWorld' from: ('192.168.0.101', 58309) Note the b , which indicates that this is a bytes , not a string. print() prints those as their re...
by Christian Walther
Sat May 02, 2020 2:07 pm
Forum: General Discussion and Questions
Topic: March/April MicroPython news roundup
Replies: 1
Views: 154

Re: March/April MicroPython news roundup

Very informative, thank you! And I’m happy to see PicoPew mentioned! :D
by Christian Walther
Wed Apr 29, 2020 8:52 pm
Forum: ESP8266 boards
Topic: [SOLVED] General question regarding GPIOs of Wemos D1 mini
Replies: 3
Views: 276

Re: General question regarding GPIOs of Wemos D1 mini

D3 is GPIO 0 which is one of the bootstrapping pins of the ESP8266. It must be pulled high in order to boot from flash rather than from the internal bootloader. On the D1 Mini, according to the schematic , that is achieved by a 12 kΩ resistor to +3V3 (R10, right center). That’s where your LED curren...
by Christian Walther
Tue Apr 28, 2020 1:12 pm
Forum: Programs, Libraries and Tools
Topic: I can’t interact with micropython by Popen
Replies: 10
Views: 506

Re: I can’t interact with micropython by Popen

And I don't know how to tell the redirection is from '<' or from Popen. Why would you need to? My suggestion is once you set -i flag, it will always call do_repl(). That much is common between dhylands’ solution and yours. What’s different is what happens when you don’t set the -i flag. And if you ...
by Christian Walther
Mon Apr 27, 2020 5:33 pm
Forum: Programs, Libraries and Tools
Topic: I can’t interact with micropython by Popen
Replies: 10
Views: 506

Re: I can’t interact with micropython by Popen

And "-i flag was specified" is exactly the variable inspect used one line above, so the changed line is

Code: Select all

if (isatty(0) || inspect) {
You’ll probably also want to adjust the print_help() text. (CPython’s says “forces a prompt even if stdin does not appear to be a terminal”.)
by Christian Walther
Fri Apr 24, 2020 7:17 am
Forum: Programs, Libraries and Tools
Topic: I can’t interact with micropython by Popen
Replies: 10
Views: 506

Re: I can’t interact with micropython by Popen

This is CPython. Apparently micropython does not run the REPL when stdin is not from a terminal, which means that input is only compiled at EOF, not line-wise, you need to use print() to see output. This works for me: >>> proc = subprocess.Popen(['./micropython', '-i'], stdin=subprocess.PIPE, stdout...