Search found 22 matches

by larsks
Sat Feb 05, 2022 3:57 am
Forum: General Discussion and Questions
Topic: How to run Microdot webframework
Replies: 2
Views: 7131

Re: How to run Microdot webframework

It seems to work for me without a problem. I start by copying "microdot.py" to the board. I'm using an ESP8266, but the process should be similar on other systems. You can test that things are working by trying to import the module from the REPL: >>> import microdot If that works, the example code s...
by larsks
Sat Feb 05, 2022 2:53 am
Forum: General Discussion and Questions
Topic: Get task result from an asyncio Task object?
Replies: 2
Views: 2903

Get task result from an asyncio Task object?

In regular Python, I can retrieve the result of a task using the .result() method: t = asyncio.create_task(sometask()) await t print('result:', t.result()) uasyncio.Task objects don't have a .result() method, but they do have a .data attribute, and when .done is true, .data.value appears to have the...
by larsks
Sun Dec 20, 2020 3:50 am
Forum: General Discussion and Questions
Topic: Losing data sent before deep sleep?
Replies: 1
Views: 1076

Losing data sent before deep sleep?

Originally posted to the esp8266 board, but all the traffic appears to be here... It appears (with MicroPython on esp8266) that 'socket.write' and/or other socket operations have an asynchronous component, the impact of which is that even though both 'socket.write' and 'socket.close' have been calle...
by larsks
Sun Dec 20, 2020 3:46 am
Forum: General Discussion and Questions
Topic: poll.poll return list decode
Replies: 8
Views: 3636

Re: poll.poll return list decode

but I can't find these constants anywhere.. The constants are defined in the `select` module, and are described briefly in that same document (https://docs.micropython.org/en/latest/library/uselect.html#uselect.poll.register). They mean the same thing as the corresponding values in regular Python; ...
by larsks
Fri Dec 18, 2020 6:25 pm
Forum: General Discussion and Questions
Topic: Json-line transfer problem over MQTT
Replies: 3
Views: 2077

Re: Json-line transfer problem over MQTT

Can you show us the MicroPython code that is producing this behavior?
by larsks
Fri Dec 18, 2020 6:23 pm
Forum: General Discussion and Questions
Topic: poll.poll return list decode
Replies: 8
Views: 3636

Re: poll.poll return list decode

I can't find anywhere details of the string returning from poll.poll(). The `poll` method doesn't return a string. The documentation (https://docs.micropython.org/en/latest/library/uselect.html#uselect.poll.poll) says that it returns: [a] list of (obj, event, …) tuples. There may be other elements ...
by larsks
Fri Mar 01, 2019 1:06 pm
Forum: ESP8266 boards
Topic: Timer
Replies: 2
Views: 2597

Re: Timer

You can create multiple virtual timers as described in the docs at https://docs.micropython.org/en/latest/esp8266/quickref.html#timers . For a 5-second timer that would look something like: from machine import Timer def t1_callback_function(t): print('this is timer1') t1 = Timer(-1) t1.init(period=5...
by larsks
Fri Oct 12, 2018 2:35 am
Forum: ESP8266 boards
Topic: DHT22 driver has stopped working in master
Replies: 0
Views: 1455

DHT22 driver has stopped working in master

I noticed that with recent esp8266 micropython builds I was no longer able to interact with my DHT22 temperature sensors. I spent some quality time with git bisect this evening and logged https://github.com/micropython/micropython/issues/4233 . I have a workaround (revert the commit that introduced ...
by larsks
Mon Oct 08, 2018 7:26 pm
Forum: ESP8266 boards
Topic: Tweepy/TwitterAPI
Replies: 9
Views: 29698

Re: Tweepy/TwitterAPI

I was going to suggest that you could just read through the Twitter API docs at https://developer.twitter.com/en/docs.html and then use something like the urequests module, but it looks as if micropython implementation issues make this largely impossible. Specifically, calling urequests.get against ...
by larsks
Mon Oct 08, 2018 1:51 am
Forum: ESP8266 boards
Topic: Tweepy/TwitterAPI
Replies: 9
Views: 29698

Re: Tweepy/TwitterAPI

It is possible to include libraries like TwitterAPI (https://github.com/geduldig/TwitterAPI), Tweepy (https://github.com/tweepy/tweepy) and Twython (https://github.com/ryanmcgrath/twython) on MicroPython? Generally, no, it's not. Those libraries were written for Python, but you're running MicroPyth...