ESP32-CAM unable to use machine.UART with wifi and camera (micropython) #14320
-
I am having troubles with ESP32-CAM module running camera and wifi with machine.UART on any GPIO (tested with GPIO1 rx, GPIO3 tx and GPIO14 rx, GPIO16 tx). I would need to communicate via UART with mini MP3 module MH2024K-24SS. I am getting ERROR: Guru Meditation Error: Core 1 panic'ed (StoreProhibited). Exception was unhandled. Core 1 register dump: Backtrace: 0x4009346d:0x3ffcba60 0x40091051:0x3ffcbaa0 0x4012327c:0x3ffcbae0 0x400d6df9:0x3ffcbb10 0x400d6f30:0x3ffcbb30 0x400ed59e:0x3ffcbb50 0x400ed6ea:0x3ffcbbe0 0x400d6caa:0x3ffcbc30 This error appear imediately when executing following part of code: I am getting a bit crazy from that :o) I tried to turn off the debug messages also - esp.osdebug(None) to turn off the the REPL messages, also without success. The module communicate on baud rate 9600. I was also trying to disable the camera and wifi befor calling the UART init, also with no luck. Just to explain a bit my goal. I am building project where I need to use camera, wifi and audio. Because I am not able to run MP3 or wav files directly on ESP32-CAM I wanted to use mini MP3 module with SD card and all needed audio stored there. Then I just need to call the MP3 to play specific MP3 file which is possible to do via the UART. But as mentioned I always get the ERROR above when initiating the UART. When I run the code separately (only the code which do not use camera and wifi, it only send needed commands via UART) then it work without problems. But when I want to use it together I am getting problems. In case there is no real ability to do what I want with this approach, would be there a possibility to somehow run it without UART? Like directly on some GPIO? I was trying that like simulate the UART but I think it is impossible and this is probably stupid idea. Any help or your experiences will be appreciated. I am thinking one more approach now as the module MH2024K-24SS have also pins for next and previous mp3 file to play. So will give it a try to connect with GPIO pin and send required number of nexts :o) . Probably also a bit crazy but I will give it a try. Thanks if anybody would have better idea or any experiences which could solve the problem with UART. Thanks... |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 7 replies
-
I have tested the idea mentioned in previous post to use the pin on MH2024K-24SS to play next song (ADKEY1 with 15Kohm resistor) but there is needed quite long push to let the module triger the push. So I am not able to use it for more then 100 mp3 files to directly play specific song by correct number of push via GPIO PIN on ESP32-CAM. Next possibility would be probably to add something like ATTINY to drive the communication with the MH2024K-24SS based on inputs from GPIO PIN on ESP32-CAM. But it is getting stranger and more nonsense I would say. Some time ago I testet project from this web site: link . Maybe it could be the right approach to try something similar but with use of micropython as I have the rest of the code already writen in micropython. I could use GPIO 16 on ESP32-CAM which is the RX pin and is not used by any device (wifi, camera, SD card) and the mp3 files could be stored and red from the SD card placed in ESP32-CAM. Would anybody have some idea about the micropython code which could work? Any comments or ideas are appreciated. Thanks. |
Beta Was this translation helpful? Give feedback.
-
Please try PIN12 and PIN13. Below is the REPL log to show that the setup is working for UART1, SDcard and camera, all active together:
Give it a try and hope it works for your project. |
Beta Was this translation helpful? Give feedback.
-
Are those pins that you are referring to on the downloader board?
Enough to cause the problem? On the ESP32 Generic board GPIO12 is a strapping pin and might require special treatment. |
Beta Was this translation helpful? Give feedback.
Please try PIN12 and PIN13. Below is the REPL log to show that the setup is working for UART1, SDcard and camera, all active together: