Search found 102 matches

by p_j
Mon Jun 20, 2022 2:02 am
Forum: ESP32 boards
Topic: uasyncio streamreader hanging on uart.readline
Replies: 3
Views: 1444

Re: uasyncio streamreader hanging on uart.readline

Hmm. I'm getting no joy at all. According to the docs for my Feather S2 the rx and tx pins are connected to UART 0. However a simple loopback test doesn't work. .any() returns some stupid number. .write(b'hello\n') returns nothing (should return 6). And .read() produces nothing. I tried UART 1: .wr...
by p_j
Fri Jun 17, 2022 2:17 pm
Forum: ESP32 boards
Topic: uasyncio streamreader hanging on uart.readline
Replies: 3
Views: 1444

uasyncio streamreader hanging on uart.readline

I'm seeing some strange behaviour when using streamreader. ESP32-S2, micropython latest from github. When I call readline() on the streamreader it never returns, even though lines of text are being sent to the UART. When I call read() I can read the bytes individually. Example: This code hangs async...
by p_j
Mon Jun 13, 2022 12:29 pm
Forum: General Discussion and Questions
Topic: Sending data from the device to host file system
Replies: 2
Views: 881

Re: Sending data from the device to host file system

I reckon wifi would be the easiest and fastest, just upload to an ftp server.

Otherwise I would use mpremote.py to pull the files down over usb/uart.
by p_j
Mon Jun 13, 2022 9:47 am
Forum: General Discussion and Questions
Topic: uasyncio empty heap
Replies: 4
Views: 1201

Re: uasyncio empty heap

Thanks it appears that I was missing an "await" in a crucial part of my code so it seems like user error. ... It's an easy mistake to make and tends to cause a silent failure making it hard to find. I raised this issue five years ago, and also wrote this script to attempt to locate this error in co...
by p_j
Mon Jun 13, 2022 4:52 am
Forum: General Discussion and Questions
Topic: uasyncio empty heap
Replies: 4
Views: 1201

Re: uasyncio empty heap

Thanks it appears that I was missing an "await" in a crucial part of my code so it seems like user error. The code was reasonably complex, reading UART data byte by byte and processing it with various functions. If I can reproduce it with a trivial code example I will raise a bug but otherwise it's ...
by p_j
Sat Jun 11, 2022 2:39 pm
Forum: General Discussion and Questions
Topic: uasyncio empty heap
Replies: 4
Views: 1201

uasyncio empty heap

Hi,

Anyone know what this error means?

Thanks

Code: Select all

>>> asyncio.run(my_coro._run())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "uasyncio/core.py", line 1, in run
  File "uasyncio/core.py", line 1, in run_until_complete
IndexError: empty heap
>>> 
by p_j
Wed Jun 08, 2022 12:06 pm
Forum: General Discussion and Questions
Topic: Transparent internet access through GSM modem
Replies: 3
Views: 1485

Re: Transparent internet access through GSM modem

I figured this out and it's much simpler than I anticipated, posting the steps below as it might help future users. First you need to do the basic configuration of your modem using AT commands. This involves setting the APN, attaching to the network, it will be slightly different depending on manufa...
by p_j
Wed Jun 08, 2022 7:18 am
Forum: General Discussion and Questions
Topic: Transparent internet access through GSM modem
Replies: 3
Views: 1485

Re: Transparent internet access through GSM modem

KJM wrote:
Wed Jun 08, 2022 7:10 am
You could try urequests but it's not as good as python's requests lib
Thanks, the question is really how do I get urequests to use the GSM modem over UART if that makes sense?
by p_j
Wed Jun 08, 2022 5:53 am
Forum: General Discussion and Questions
Topic: Transparent internet access through GSM modem
Replies: 3
Views: 1485

Transparent internet access through GSM modem

Hi all, Apologies as I'm not sure what the correct terminology is for this setup. I have an ESP32 with a UBLOX modem attached by UART. I can do basic things like http GET/POST using the UBLOX AT commands. Is there a way I can have micropython access the internet natively through this modem so i can ...
by p_j
Mon May 23, 2022 1:20 pm
Forum: General Discussion and Questions
Topic: Background asyncio event loop
Replies: 5
Views: 2891

Re: Background asyncio event loop

Mike Teachman wrote:
Sat May 21, 2022 1:05 am
p_j wrote:
Fri May 20, 2022 11:34 pm
Thanks both, I was more thinking it would be good for a testing/debugging perspective, to check what tasks are running, interact with the tasks etc..
It sounds like this might be what you are looking for:
https://github.com/peterhinch/micropython-monitor
Very interesting thanks for the link.