UART device only responds when running in REPL, but not when running standalone on Raspberry Pi Pico W #15617
Unanswered
1-rafael-1
asked this question in
RP2040 / Pico
Replies: 2 comments 1 reply
-
Experiencing this with an RYLR988 LoRa module as well (interfaced over UART). Works well within REPL via Thonny, does not work when plugged in standalone. |
Beta Was this translation helpful? Give feedback.
0 replies
-
@TimHanewich That looks like a Thonny problem. Please be sure that the code you want to run was actually copied permanently to the device. Thonny may hide the fact that it was not. Use another terminal emulator like mpremote, PuTTY, screen, picocom, ... Any of these are less intrusive than Thonny. The recommended tools is mpremote. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Port, board and/or hardware
rp2 port, Raspberry Pi Pico W
MicroPython version
MicroPython v1.23.0 on 2024-06-02; Raspberry Pi Pico W with RP2040
Reproduction
I am fairly new to this, so assuming i am doing something wrong.
Full code is here: https://github.com/1-rafael-1/pi-pico-alarmclock
I have tried to strip down a smaller repro, but to my surprise the stripped-down code works as expected, while the full code does not. I am at a loss as to why and hopefully somebody can give me a hint.
Here is a stripped-down version:
file
main.py
in base folder:file
dfplayer_mini.py
in folderdrivers
:file
sound_mgr
in folderclasses
:file
app_mgr
in folderclasses
:Expected behaviour
I have connected a DFPlayer Mini (https://wiki.dfrobot.com/DFPlayer_Mini_SKU_DFR0299) and have found numerous drivers on GitHub. The device runs fine, when I run the code from VS Code through REPL. I can send commands, query status, ... pretty much what one would expect to happen does happen.
The mp3-player is part of a project and supposed to come online when an alarm time is reached and play one song. The entire systems works as expected under REPL, started from VS Code in my case.
(Code is here: https://github.com/1-rafael-1/pi-pico-alarmclock -> alarm_mgr holds the code calling the device and sound_mgr manages the device/loads the driver)
Observed behaviour
Run the system via VS Code/REPL: everything works.
Run the system after loading everything on the Pico by powering the pico: Everything works, except the sound.
I have tried to capture logs, basically in this mode all UART commands to read state from the mp3-player time out.
Change nothing, just attach the Pico back to VS Code, run main.py again: Everything works including the mp3-player.
Additional Information
I have tried to isolate things as much as I had ideas how to:
Code of Conduct
Yes, I agree
Beta Was this translation helpful? Give feedback.
All reactions