Search found 4036 matches

by pythoncoder
Wed Apr 08, 2020 5:27 am
Forum: MicroPython pyboard
Topic: rsync timeout
Replies: 4
Views: 62

Re: rsync timeout

That is odd: I use rshell/rsync daily. On Pyboard 1.x I generally use an SD card, but on Pyboard D and ESPx I use flash. The only time I've had problems have been with large numbers of files on an SD card when operations like ls can fail. I assume you've checked the contents of /flash to be sure tha...
by pythoncoder
Tue Apr 07, 2020 5:02 pm
Forum: ESP32 boards
Topic: ESP32 port + uasyncio + mqtt_as issue
Replies: 5
Views: 100

Re: ESP32 port + uasyncio + mqtt_as issue

Event.set() no longer accepts an optional data argument The official Event class is CPython compatible. The version in my asyn.py library had three differences from the current official one: It is an awaitable class. The .set() method can be called from an ISR. It has an optional data arg. I have r...
by pythoncoder
Tue Apr 07, 2020 11:53 am
Forum: ESP32 boards
Topic: ESP32 port + uasyncio + mqtt_as issue
Replies: 5
Views: 100

Re: ESP32 port + uasyncio + mqtt_as issue

You might like to try this. I have tested it under new uasyncio. It isn't particularly efficient, but it does work. I should point out that it is based on the work of Paul Sokolovsky namely his implementation in uasyncio V2. from ucollections import deque import uasyncio as asyncio # Exception raise...
by pythoncoder
Tue Apr 07, 2020 11:49 am
Forum: Hardware Projects
Topic: MicroPython on DIN rail
Replies: 5
Views: 103

Re: MicroPython on DIN rail

That website has
Last updated July 29, 2015
and has no reference to MicroPython (although I haven't watched the videos).

Please could you explain the relevance?
by pythoncoder
Tue Apr 07, 2020 11:42 am
Forum: General Discussion and Questions
Topic: How to save file in flash memory ?
Replies: 2
Views: 57

Re: How to save file in flash memory ?

See the ujson library http://docs.micropython.org/en/latest/l ... ujson.html

Code: Select all

import ujson
d = {1:'one', 2:'two'}
with open('my_file', 'w') as f:
    ujson.dump(d, f)
Loading is similar.
by pythoncoder
Tue Apr 07, 2020 3:25 am
Forum: General Discussion and Questions
Topic: Need help with uasyncio
Replies: 5
Views: 89

Re: Need help with uasyncio

This is rarely necessary on a Pyboard. If your filesystem looks OK just go ahead.
by pythoncoder
Sun Apr 05, 2020 6:42 am
Forum: Programs, Libraries and Tools
Topic: uasyncio --- Cleaning up after a task
Replies: 3
Views: 220

Re: uasyncio --- Cleaning up after a task

You can test for the new version with

Code: Select all

import uasyncio as asyncio
asyncio.__version__
The old version will throw an exception, the new one will issue (3, 0, 0).

@doceave As Kevin says you are using uasyncio in a strange way. I suggest you look at the tutorial in this repo.
by pythoncoder
Sun Apr 05, 2020 6:24 am
Forum: ESP8266 boards
Topic: The client doesn't receive all bytes sent to socket
Replies: 4
Views: 82

Re: The client doesn't receive all bytes sent to socket

The same problem arises with sending. A nonblocking send prioritises immediate return over complete transmission. You can achieve reliable communication with nonblocking sockets, using uasyncio to take advantage of the nonblocking characteristics. Examples are resilient MQTT and MicroPython IOT . In...
by pythoncoder
Sat Apr 04, 2020 5:42 pm
Forum: ESP32 boards
Topic: Script only works when input to the REPL
Replies: 7
Views: 161

Re: Script only works when input to the REPL

It's well worth setting your editor to convert tabs to spaces.
by pythoncoder
Sat Apr 04, 2020 5:40 pm
Forum: ESP8266 boards
Topic: maximum recursion depth exceeded
Replies: 8
Views: 2750

Re: maximum recursion depth exceeded

I never use threading - maybe the limit is less. You could run my above script on the threaded build to check this value.