Search found 13 matches

by DavidRKnowles
Thu Oct 15, 2020 12:16 pm
Forum: Programs, Libraries and Tools
Topic: Asyncio - function type
Replies: 4
Views: 192

Re: Asyncio - function type

Thanks Peter, I sailed right over that when I was looking through your docs, nice. I have it loaded in because I was going to use your scheduling module, started writing my own then came across yours and its far superior. I just need to write a small driver to interact with my main system, enabling ...
by DavidRKnowles
Thu Oct 15, 2020 12:30 am
Forum: Programs, Libraries and Tools
Topic: Asyncio - function type
Replies: 4
Views: 192

Re: Asyncio - function type

The only thing I can think of seems a bit of a hack:

Code: Select all

def iscoroutine(func):
    async def gen():
        print('generator')
    return type(gen) == type(func)
This works but it would be cool if the was a native uasyncio function like asyncio.iscoroutine() that was implemented.
by DavidRKnowles
Wed Oct 14, 2020 11:17 pm
Forum: Programs, Libraries and Tools
Topic: Asyncio - function type
Replies: 4
Views: 192

Re: Asyncio - function type

I see

Code: Select all

asyncio.iscoroutine()
and

Code: Select all

asyncio.iscoroutinefunction()
are not used in uasyncio, is there another way to query a generator object?
by DavidRKnowles
Wed Oct 14, 2020 12:24 pm
Forum: Programs, Libraries and Tools
Topic: Asyncio - function type
Replies: 4
Views: 192

Asyncio - function type

Hi everyone, I am stumped on this project that uses a task to call driver functions based on commands sent via mqtt. The part that is a pain is the drivers contain some asynchronous functions and some standard functions. I need the task that calls these functions to be able to identify the Async fun...
by DavidRKnowles
Sun Feb 09, 2020 1:08 am
Forum: ESP32 boards
Topic: Trouble getting a Serial Repl
Replies: 5
Views: 651

Re: Trouble getting a Serial Repl

Well, it was the usb-uart bridge, desoldered it and I am able to get a REPL fine in all applications using my own bridge on UART0.

Bit of pain and detective work, sucks when its the hardware :(
by DavidRKnowles
Sun Feb 09, 2020 12:30 am
Forum: ESP32 boards
Topic: Trouble getting a Serial Repl
Replies: 5
Views: 651

Re: Trouble getting a Serial Repl

Ok some more detecting over the weekend, I have noticed I can't get a serial connection through the Arduino serial monitor if I use directly onboard power to either 3.3v or using the onboard regulator with 5v to the vcc pin. It only works with Arduino serial monitor if the board is powered via the U...
by DavidRKnowles
Wed Feb 05, 2020 7:06 am
Forum: ESP32 boards
Topic: Trouble getting a Serial Repl
Replies: 5
Views: 651

Re: Trouble getting a Serial Repl

Also just tried to serial in via Python with the serial module,

This connected to the port but nothing was received back when I sent a couple of bytes, this worked fine with my other flashed micropython nodemcu.
by DavidRKnowles
Wed Feb 05, 2020 5:29 am
Forum: ESP32 boards
Topic: Trouble getting a Serial Repl
Replies: 5
Views: 651

Re: Trouble getting a Serial Repl

Just to clarify -- what you're saying is that the Arduino serial monitor works (both with the onboard uart/usb adaptor, and with an external one wired directly to the TX/RX pins on the ESP32), and PuTTY / uPyCraft don't work in either configuration? Yes, that is exactly correct. My guess is that it...
by DavidRKnowles
Wed Feb 05, 2020 4:10 am
Forum: ESP32 boards
Topic: Trouble getting a Serial Repl
Replies: 5
Views: 651

Trouble getting a Serial Repl

Hi guys, I have a nodemcu esp32 (well two of them), this one seems to have some form of issue with the connection Behaviour It flashes fine as long as you hold the boot button while resetting then run the esptool.py flasher and as that is connecting release the boot/gpio0. It will not connect in uPy...
by DavidRKnowles
Sun Jan 19, 2020 11:36 am
Forum: General Discussion and Questions
Topic: ctypes into uctypes for crc communication
Replies: 2
Views: 794

Re: ctypes into uctypes for crc communication

I’m not sure why they’re using ctypes here, ctypes is for calling C functions and there are no C functions being called here. It seems all they want is to slice 8 bits out of an integer, which is easily done using the & operator, no ctypes needed. The following seems to work for me in CPython, givi...