Updated version, working Core2 web radio player, M5Stack



  • @homeuser33

    Just a suggestion... Instead of posting your code and updates here, can you please upload them to Github so change management and commits are easier to track? I apologize if you already have it on Github... maybe I missed it.



  • @world101
    No, It's a good point. Generally I have not shared much code since I'm still fairly new to the M5Stack hardware. I was thinking this would be a one off since I found the answer for the media player. But its a good point. I'll check into that.
    Thank you.



  • @world101

    Okay, that seemed easier than I thought.
    Link: https://github.com/bwbguard/M5Stack-Core2-MediaPlayer



  • @homeuser33

    👍🏻👍🏻👍🏻 Thanks!



  • @homeuser33

    Two things based on my testing.

    1. The program works with latest ESP8266Audio v1.8.1 library as well.
    2. I had to disable PSRAM in the Arduino board settings to get the program to work. When enabled, Arduino would flash the program and reset, but nothing would happen after that. Here is my board setup for Arduino on my Mac.

    0_1616950951750_Screen Shot 2021-03-28 at 1.01.24 PM.png

    Thanks!



  • @world101
    I'm not sure what to say about that, PSRAM is enabled on my Linux setup and so far seems to be working.



  • I think it's the matter of the board selection. When I first tried homeuser33's code I used the M5Stack OEM board: M5Stack Arduino>M5Stack-Core2(The PSRAM is enabled). It kept rebooting itself. I then switched to ESP32 Arduino>M5Stack-Core2(The PSRAM is enabled as well), it then worked.
    Today, I tried different combinations. It ended up with that the only scenario that it's not working if you use M5Stack Arduino>M5Stack-Core2 with PSRAM enabled. M5Stack Arduino>M5Stack-Core2 with PSRAM disabled works perfectly like world101 said. But if you use ESP32 Arduino>M5Stack-Core2, both enabled and disabled work. So I guess this is the matter of selecting different boards.

    Thanks!



  • @raychmond
    Thanks for the update, It's been awhile sine I added the Core2 board manager so I don't remember which source I used. If I find it I'll update here. Thank you.



  • @homeuser33 I tried downloading your code and running. It compiles and load on Core2 but then the touch does not work and cannot hear any Audio, it feels like the program has halted. It does try to play something as i can hear a sound but after that it stops.



  • @homeuser33 said in Updated version, working Core2 web radio player, M5Stack:

    Hello, the code runs but it is stuck on the "Connecting" screen from the initwifi() function. I put the correct SSID and password it is still not working. Please try to help me out.



  • @bhupiister
    I had a similar problem. You could try to remove the line 'Serial.begin(115200);' in setup(). It has already been called by M5Core2.cpp from the library. Calling it a second time makes a couple of my sketches hang.



  • @clairlune
    See my reply @bhupiister (after it has been approved). Hope it solves your problem.



  • Attempting to compile the web radio player on a Core2. I am getting the following errors. Any help would be appreciated.
    Joe

    Arduino: 1.8.19 (Windows 10), Board: "M5Stack-Core2, Enabled, Default (2 x 6.5 MB app, 3.6 MB SPIFFS), 240MHz (WiFi/BT), 1500000, None"

    C:\Users\jld\Documents\Arduino\MediaPlayer\MediaPlayer.ino:61:1: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

    };

    ^

    In file included from C:\Users\jld\Documents\Arduino\libraries\ESP8266Audio\src\AudioGeneratorMIDI.cpp:65:

    C:\Users\jld\Documents\Arduino\libraries\ESP8266Audio\src\libtinysoundfont/tsf.h: In function 'void tsf_channel_midi_control(tsf*, int, int, int)':

    C:\Users\jld\Documents\Arduino\libraries\ESP8266Audio\src\libtinysoundfont/tsf.h:2100:1: error: insn does not satisfy its constraints:

    }

    ^

    (insn 858 343 344 51 (set (reg:SF 19 f0 [407])

    (mem/u/c:SF (symbol_ref/u:SI ("*.LC248") [flags 0x2]) [0 S4 A32])) "C:\Users\jld\Documents\Arduino\libraries\ESP8266Audio\src\libtinysoundfont/tsf.h":2053 47 {movsf_internal}

    (nil))

    during RTL pass: postreload

    C:\Users\jld\Documents\Arduino\libraries\ESP8266Audio\src\libtinysoundfont/tsf.h:2100:1: internal compiler error: in extract_constrain_insn, at recog.c:2210

    Please submit a full bug report,

    with preprocessed source if appropriate.

    See https://gcc.gnu.org/bugs/ for instructions.

    exit status 1

    Error compiling for board M5Stack-Core2.



  • @jdonth Had the exact same problem.........after 3 hours of googling, finally found the issue. Take a look at this diff file:

    https://git.koehlerweb.org/frodovdr/Sonoff-Tasmota/commit/8a764f86ee9f1129507f4654d07c7a7cb24cc87e

    It's totally unrelated to this project. Just a bug that freaks out the IDE. Anyhow......a couple of lines need to be changed in :

    \libraries\ESP8266Audio\src\libtinysoundfont\tsf.h

    Hopefully it makes sense......Hope it helps....