Search found 38 matches

by Christian Walther
Tue Mar 19, 2019 12:24 pm
Forum: ESP8266 boards
Topic: thingSpeak/ESP8266_convert Str=> Int
Replies: 2
Views: 206

Re: thingSpeak/ESP8266_convert Str=> Int

"field1={:.1f}\n" + int(k) You are trying to add a string and an integer here, which does not work (it can’t tell whether you mean string concatenation or number addition). Judging from the format placeholder in the string, what you probably meant is "field1={:.1f}\n".format(int(k)) To find such pr...
by Christian Walther
Sun Mar 10, 2019 12:54 pm
Forum: General Discussion and Questions
Topic: esp8266 not booting
Replies: 18
Views: 439

Re: esp8266 not booting

Glad you got it solved! :)
by Christian Walther
Sun Mar 10, 2019 11:32 am
Forum: General Discussion and Questions
Topic: esp8266 not booting
Replies: 18
Views: 439

Re: esp8266 not booting

nagylzs wrote:
Sun Mar 10, 2019 11:17 am
It is never executed by the interpreter

this main.py file
You are contradicting yourself here. If the file is named main.py, then it is executed by the interpreter. Which of the two is it?
by Christian Walther
Thu Mar 07, 2019 6:16 pm
Forum: General Discussion and Questions
Topic: fastest way to fill large bytearrays? (Neopixel, APA102 et al)
Replies: 15
Views: 846

Re: fastest way to fill large bytearrays? (Neopixel, APA102 et al)

Doh! Thanks, Dave. That’s what I get for trying to solve technical questions with the mushy brain that comes from a cold. With the correct loop bounds, it takes 5.8 ms.
by Christian Walther
Wed Mar 06, 2019 6:59 pm
Forum: General Discussion and Questions
Topic: fastest way to fill large bytearrays? (Neopixel, APA102 et al)
Replies: 15
Views: 846

Re: fastest way to fill large bytearrays? (Neopixel, APA102 et al)

First, if this code wasn’t in a function, put it in one: local variables are faster than global ones. This takes 9 ms on my ESP8266: def run(): ba = bytearray(120*4) start = utime.ticks_us() for i in range(120): ba[i*4+0] = 255 ba[i*4+1] = 255 ba[i*4+2] = 255 ba[i*4+3] = 255 end = utime.ticks_us() p...
by Christian Walther
Tue Feb 12, 2019 6:09 pm
Forum: General Discussion and Questions
Topic: [SOLVED] PBM file showing /r
Replies: 4
Views: 186

Re: PBM file showing /r

How are you transferring the file to the board? Could it be an FTP connection in text mode or something else that mangles line endings when it thinks a file is text?
by Christian Walther
Tue Feb 12, 2019 11:58 am
Forum: General Discussion and Questions
Topic: [SOLVED] PBM file showing /r
Replies: 4
Views: 186

Re: PBM file showing /r

https://docs.python.org/3/library/io.html#io.IOBase.readline specifies that The line terminator is always b'\n' for binary files so I would say the MicroPython behavior is correct, and your CPython probably isn’t Python 3. The easiest way to resolve this is to replace the CRs in your PBM file by LF...
by Christian Walther
Wed Feb 06, 2019 11:52 am
Forum: ESP32 boards
Topic: How to copy files (e.g. .py, .txt, .dat) to and from the esp32 flash?
Replies: 7
Views: 537

Re: How to copy files (e.g. .py, .txt, .dat) to and from the esp32 flash?

You are confused about how the flash is organized. The MicroPython firmware is not a file, it lives outside of the FAT filesystem in raw flash. The FAT filesystem is located in a different part of flash. Python files that you want to run need to live inside the filesystem, and you don't install them...
by Christian Walther
Fri Feb 01, 2019 7:55 am
Forum: General Discussion and Questions
Topic: How do I terminate a background program/thread/function/method in uPy?
Replies: 5
Views: 251

Re: How do I terminate a background program/thread/function/method in uPy?

Try just ignoring the error messages and typing over them, I expect that even though you can’t see what you type, the REPL should still be functional and you should be able to turn off the WiFi that way.
by Christian Walther
Mon Dec 24, 2018 8:41 am
Forum: ESP8266 boards
Topic: accessing uart0 on nodemcu board
Replies: 23
Views: 1410

Re: accessing uart0 on nodemcu board

This feature is not part of that release yet, you need to use a newer daily build or build your own. I believe the relevant commit is afd0701, which should make any of the daily builds available from the download page suitable.