asyncio streamwriter not sending to uart #11391
Replies: 4 comments 2 replies
-
Your class has no attribute how did you call your methods? for example based on example auart_hd.py I have done as loopback on esp32 as example and it is work:
|
Beta Was this translation helpful? Give feedback.
-
Agreed. It is not clear from the example how the |
Beta Was this translation helpful? Give feedback.
-
Apologies for the lack of detail, send_command() is called from other modules like: modem = Modem(UART(1, baudrate=115200, tx=37, rx=38)
await modem.send_command("my_command") self._update(res) is used for processing the incoming stream, this part is working ok. |
Beta Was this translation helpful? Give feedback.
-
Thanks @2dof and @peterhinch I solved this problem and it had nothing to do with asyncio, totally unrelated, code posted above is working as expected. My device wakes periodically to send data using a modem, the modem requires a logic high on the RX input when the mcu (ESP32) is sleeping). In my deepsleep routine I was holding the UART TX pin high with the following. # To prevent swarm modem triggering a wake event set tx pin high
tx_pin = Pin(pins.MODEM_TX, Pin.OUT, value=1, hold=True) The Pin hold persists during deepsleep so UART doesn't work on wake-up unless the pin is first released. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm having trouble getting an async streamwriter to work, streamreader works ok but streamwriter doesn't seem to send anything out on the uart. Can anyone see anything wrong with this?
I have also tried
Thanks
Beta Was this translation helpful? Give feedback.
All reactions