Git Product home page Git Product logo

esp32-radio's Introduction

Please use the V2 version of the ESP32-Radio.

alt text Internet radio based on ESP32, VS1053 and a TFT screen. Will compile in Arduino IDE. See the review by Andreas Spiess at https://www.youtube.com/watch?v=hz65vfvbXMs.

Look for documentation and printdesign in the doc directory.

Features:

  • Can connect to thousands of Internet radio stations that broadcast MP3 or Ogg audio streams.
  • Can connect to a standalone mp3 file on a server.
  • Support for .m3u playlists.
  • Can play mp3 tracks from SD card or USB stick (CH376).
  • Uses a minimal number of components; no Arduino required.
  • Handles bitrates up to 320 kbps.
  • Has a preset list of maximal 100 favorite radio stations in configuration file.
  • Configuration (preferences) can be edited through web interface.
  • Can be controlled by a tablet or other device through a build-in webserver.
  • Can be controlled over MQTT.
  • Can be controlled over Serial Input.
  • Can be controlled by IR.
  • Can be controlled by rotary switch encoder.
  • Can be controlled by touch pins.
  • Up to 14 free input pins can be configured to control the radio.
  • The strongest available WiFi network is automatically selected.
  • Heavily commented source code, easy to add extra functionality.
  • Debug information through serial output.
  • Uses a 12 kB queue to provide smooth playback.
  • Software update over WiFi possible (OTA) through Arduino IDE or remote host.
  • Bass and treble control.
  • Saves volume, bass, treble and preset station over restart.
  • Configuration also possible if no WiFi connection can be established.
  • Can play iHeartRadio stations.
  • Displays time of day on TFT.
  • Optional display remaining battery capacity on screen.
  • PCB available (see doc).
  • 3D case available (see doc).

See documentation in doc/pdf-file.

Last changes:

  • 28-jun-2021, Allow special characters in station name.
  • 21-jun-2021, Display station name from preference if not in metadata.
  • 29-apr-2021, Fixed SSD1309 bug.
  • 25-apr-2021, Fixed SSD1309 bug, thanks to Juraj Liso.
  • 19-feb-2021, More Oled models.
  • 16-feb-2021, Give BBC stations some time to react. See issue 437.
  • 15-feb-2021, Added earch page.
  • 21-jan-2021, Added PlatformIO version.
  • 14-oct-2020, Clear artist and song on display at new station connect.
  • 18-oct-2020, Fixed LCD2004 error.
  • 30-sep-2020, Ready for ch376msc library version 1.4.4.
  • 14-jul-2020, Dynamic status display in web interface.
  • 10-jul-2020, Support for USB drive (CH376).
  • 23-mar-2020, Allow playlists on SD card.
  • 21-dec-2019, Check for right (VS1053) CHIP.
  • 16-dec-2019, Better logging claimSPI for debug.
  • 24-apr-2019, Better handling of gettim().
  • 09-oct-2018, Bug fix xSemaphoreTake.
  • 04-oct-2018, Fixed compile error OLED 64x128 display.
  • 28-sep-2018, Support for NEXTION display.
  • 06-aug-2018, Added playlistposition for MQTT. Correction negative time offset. OTA update through remote host.
  • 02-aug-2018, Added support for ILI9341 display.
  • 01-aug-2018, Added debug info for timing of IR remote.
  • 30-jul-2018, Added GPIO39 and inversed shutdown pin. Thanks to fletche.
  • 25-jul-2018, Correction touch pins.
  • 15-jul-2018, Correction tftset().
  • 25-may-2018, Limit read from stream to free queue space.
  • 04-may-2018, Made handling of playlistdata more tolerant.
  • 31-may-2018, Bugfix. Crashed if I2C was used, but no pins assigned.
  • 30-may-2018, Bugfix. Assigned DRAM to global variables used in ISRs.
  • 11-may-2018, Bugfix for incidental crash in rotary encoder function.
  • 08-may-2018, Support for 1602 display (I2C).
  • 30-apr-2018, Bugfix: crashed when no IR was configured.
  • 25-apr-2018, Support for different display (OLED 128x64 for now).
  • 20-apr-2018, Added (unfinished) diptrace printdesign.
  • 16-apr-2018, Handle ID3 tags while playing from SD.
  • 13-apr-2018, Guard against empty strings on TFT.
  • 05-mar-2018, Improved interface for Rotary Encoder.
  • 03-mar-2018, Correction bug IR pin number.
  • 15-feb-2018, Correction writing wifi credentials to NVS.
  • 13-feb-2018, Disable clock during write-back of preferences.
  • 22-jan-2018, Added remaining battery capacity, default I/O pins.
  • 02-jan-2018, Stop/resume is one command now.
  • 15-dec-2017, Correction defaultprefs.h.
  • 13-dec-2017, Correction LCD display.
  • 08-dec-2017, Faster handling of config page, more items published by MQTT, added pin_shutdown.
  • 01-dec-2017, Better handling of playlists.
  • 30-nov-2017, Hide passwords in config screen.
  • 27-nov-2017, Replaced ringbuffer by FreeRTOS queue, play function on second CPU, Included improved rotary switch routines supplied by fenyvesi, Better IR sensitivity.
  • 11-nov-2017: Increases ringbuffer size. Print measured bitrate at "test"-command.
  • 30-aug-2017: Limit number of retries foor MQTT connection. Added MDNS transponder.
  • 28-aug-2017: Preferences for SPI bus, touch pins. Corrected bug in handling programmable pins. Handling of http redirections.
  • 28-jul-2017: Added rotary swich encoder, flexible GPIO assignment.
  • 19-jul-2017: Minor corrections.
  • 18-jul-2017: Show time of day on TFT.
  • 04-jul-2017: Correction MQTT subscription, keep playing during long oprerations.
  • 03-jul-2017: Webinterface control page shows current settings.
  • 30-jun-2017: Improved MP3 player.
  • 28-jun-2017: Added IR interface.
  • 31-may-2017: Experimental: play MP3 tracks from SD card.
  • 26-may-2017: Correction Upper/Lower Case compare.
  • 26-may-2017: Allow connection from single hidden AP.
  • 23-may-2017: First release, derived from ESP8266 version.

esp32-radio's People

Contributors

edzelf avatar per1234 avatar uksa007 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esp32-radio's Issues

Lossless Audio format playing

With the SD files playing function added, I add more audio format to play with.
ogg, AAC, wma even flac. every single one works except flac
I had flac plugin upload to VS1053, and it did play but dragging.
is it the SPI ,SD accessing speed or buffering issue?
we are now using 32bit dual core MCU ruining at 240MHz.
should be more then enough to play lossless audio.
where do I start to try improve it?

Can not pass compile

Hi, when I compile using Arduino IDE, there is an error: "fatal error: nvs.h: No such file or directory"
How to pass compile?Thanks.

Controls ALL together?

Hi Ed,

Still impressed by the ESP32 radio.
I have progres to get the 28-07 version working. Indeed placing he correct preferences. SD is working now.
As I liked the ideer to have the IR, Encoder and free programmable buttons all available for control the radio.
So I had the gpio 13,14,26,27 and 25 working for volume station control working as a charm.
On the new radio I installed also the rotary switch.
My question is is it posible to have these working all or is control only possible or buttons or ir, or rotary switch?
The ir-remote control is on order in China this will take some time.

Like to hear.
Kind regards,
Theo

ps. Is it correct you removed the TinyXML lib.? If so remove also from page two of the pdf.

5 Volts in my Laptop

Hi @Edzelf

More than a problem in your project, it is a general doubt for the ESP32 modules
I have a question about the voltage supported in my esp32.
When I connect the module to my pc laptop, it receives 5V input sent by the usb port, but recommends using maximum 3.9V.
Should I use some type of connection that reduces the voltage of my laptop to connect my esp32 module to my pc laptop?
I use my mobile phone connector which has a 5V output, to power my esp32. Can i damage my esp32 module?
The heat generated by the ESP32 module to be connected to my laptop is high and therefore I am worried to generate any damage to this

Another question, Is there any option to increase the number of stations that ESP32-Radio can support?

thanks

Encoder ISR routines

My rotary encoder didn't work perfectly, becuse when I turned it in one direction, than the volume went low and high. I tried to modify the debouncing time delays, in vain.

I separeted the encoder switch and encoder turning interrupt routines. The switch is the original, the turning uses the background that the encoder is Manchester-coded, so it doesn't need debouncing.

The routines with some comments:

void IRAM_ATTR isr_enc_switch()
{
  static uint32_t oldtime = 0 ;                        // Time in millis previous interrupt
  static bool     sw_state ;                               // True is pushed (LOW)
  static bool     clk_state ;                               // True is activated (LOW)
  bool            newstate ;                                // Current state of input signal
  uint32_t        newtime ;                               // Current timestamp

  // Read current state of SW pin
  newstate = ( digitalRead ( ini_block.enc_sw_pin ) == LOW ) ;
  newtime = millis() ;
  if ( newtime == oldtime )                                // Debounce
  {
    return ;
  }
  if ( newstate != sw_state )                              // State changed?
  {
    sw_state = newstate ;                                  // Yes, set current (new) state
    if ( !sw_state )                                       // SW released?
    {
      if ( ( newtime - oldtime ) > 1000 )                  // More than 1 second?
      {
        longclick = true ;                                 // Yes, register longclick
      }
      else
      {
        clickcount++ ;                                     // Yes, click detected
      }
      enc_inactivity = 0 ;                                 // Not inactive anymore 
    }
  }
  oldtime = newtime ;                                      // For next compare
 
}
void IRAM_ATTR isr_enc_turn()
{
// The encoder is a Manchester coded device, the outcomes (-1,0,1) of all the previous state and actual state are stored in the enc_states[].
// full_status is a 4 bit variable, the upper 2 bits are the previous encoder values, the lower ones are the actual ones
// 4 bits covers all the possible previous and actual states of the 2 PINs, so this variable is the index enc_states[].
// No debouncing is neded, because only the valid states produce values different from 0.


  static uint8_t full_status = 0x0001;                         //lookup table index 
  uint8_t act_status;                                          // the actual value of the two encoder PINs
  static const int8_t enc_states [] = 
		{0,-1,1,0,1,0,0,-1,-1,0,0,1,0,1,-1,0};         //encoder lookup table
  
  static int8_t num;
 
  full_status <<= 2;                                          // remember previous state ( shift to the 2 upper bits )
  act_status = 2 * digitalRead ( ini_block.enc_clk_pin ) + digitalRead ( ini_block.enc_dt_pin );  // Read current state of CLK, DT pin
  full_status |= act_status ;	                              // add the actual 2 read bits to the 2 lower bits
  num += enc_states[( full_status & 0x0F )];
  if ( ( num == 1 )|| ( num == 3 ))                           // four steps forward
    { 
      num = 0; 
      rotationcount++ ;                                       // Right rotation
   }
  else if (( num == -1 ) ||( num == -3 ) )                    // four steps backwards
    {  
      num = 0; 
      rotationcount-- ;                                      // Left rotation
    }
  enc_inactivity = 0 ;    
}


Custom colours

So the TFT library uses 16-bit colours (which I personally have never even run into before, other than the few times I've said UGHHH when using safe mode on an old Win95 or 98 machine). I certainly didn't know how to work with the raw hex values, and so I went about finding tables of colours and their associated 16-bit hex values.

Then I found something better, and so much simpler.

Thought maybe you might want to add it for the benefit of people wanting to define their own colors for the tft display. In fact, anyone reading can add this super easily to their sketch and start to customize their radio displays to taste.
This simple function allows you to use the much more familiar 24-bit colour defines that are common in HTML and pretty much anywhere I've ever seen colours defined on computers. (and because it doesn't require hexadecimal number format, its even easier: just 0-255 for each color. more is more, less is less.)

uint16_t getColor(uint8_t red, uint8_t green, uint8_t blue)
{
red >>= 3;
green >>= 2;
blue >>= 3;
return (red << 11) | (green << 5) | blue;
}
DONE.

Here's the link for more info: link

Keep rebooting every few minutes!

No matter play from SD or Internet, it keep rebooting, please help.
Error messages as following:

abort()

was called at PC 0x400dde86 on core 1

Backtrace: 0x400874e4:0x3ffd1360 0x400875e3:0x3ffd1380 0x400dde86:0x3ffd13a0 0x400dde65:0x3ffd13c0 0x400d8080:0x3ffd13e0 0x400dabd6:0x3ffd1420 0x400d6837:0x3ffd1440 0x4012a464:0x3ffd1480

Rebooting...
ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0010,len:4
load:0x3fff0014,len:708
load:0x40078000,len:0
load:0x40078000,len:11460
entry 0x400789f4

ESP-32 radio

PROMT
Hello! I very much like the project of radio on esp32. I have such question. Why only ili9163? With other lcd, for example St7735 will be options? Thanks.

Sound Distortion

Hello,

I am facing distortion on some radio stations. I am not sure if this is because of cabeling (other stations work fine), the station itself or the bitrate. An example stream which causes trouble is: swr-swr3-live.cast.addradio.de/swr/swr3/live/mp3/128/stream.mp3

Here a excerpt of the log:

D: New preset/file requested (12/0) from swr-swr3-live.cast.addradio.de/swr/swr3/live/mp3/128/stream.mp3
D: Connect to new host swr-swr3-live.cast.addradio.de/swr/swr3/live/mp3/128/stream.mp3
D: Connect to swr-swr3-live.cast.addradio.de on port 80, extension /swr/swr3/live/mp3/128/stream.mp3
D: Connected to server
D: Switch to HEADER
D: Headerline: Content-Type: audio/mpeg
D: audio/mpeg seen.
D: Headerline: icy-description:Mehr Hits. Mehr Kicks. Einfach SWR3
D: Headerline: icy-genre:Pop Music
D: Headerline: icy-name:SWR3
D: Headerline: icy-pub:1
D: Headerline: icy-url:http://www.swr3.de
D: Headerline: Server: dg-swr-http_dus-dtag_edge_1c578a1c46f2c8ca01cf246adf834ac5
D: Headerline: Cache-Control: no-cache, no-store
D: Headerline: Access-Control-Allow-Origin: *
D: Headerline: Access-Control-Allow-Headers: Origin, Accept, X-Requested-With, Content-Type
D: l-Allow-Headers: Origin, Accept, X-Requested-With, Content-Type seen.
D: Headerline: Access-Control-Allow-Methods: GET, OPTIONS, HEAD
D: Headerline: Connection: Close
D: Headerline: Expires: Mon, 26 Jul 1997 05:00:00 GMT
D: Headerline: icy-metaint:16000
D: Switch to DATA, bitrate is 0, metaint is 16000
D: First chunk:
D: FF FB 94 60 C2 80 03 0E
D: 40 5B CB 0B 1A EA 43 61
D: AB 8D 2D 2B 37 0E 71 33
D: 69 2C 3D 0D A9 22 19 AE
D: Metadata block 48 bytes
D: Streamtitle found, 35 bytes

I can see that there is no icy-br:XXX at all. Can that cause the distortion?

Thanks in advance
Mike

esp_pthread: pthread_getspecific: not supported! => reboot.

Getting these reboots seems to be after an MQTT publish while using ihr streams.

D: New preset/file requested (10/0) from ihr/IHR_IEDM
D: Connect to new iHeartRadio host: IHR_IEDM
D: GET /api/livestream?version=1.5&mount=IHR_IEDMAAC&lang=en
D: Connected to playerservices.streamtheworld.com
D: XML parser processing...
D: Found: 14833.live.streamtheworld.com:3690/IHR_IEDMAAC_SC
D: Connect to new host 14833.live.streamtheworld.com:3690/IHR_IEDMAAC_SC
D: Connect to 14833.live.streamtheworld.com on port 3690, extension /IHR_IEDMAAC_SC
D: Connected to server
D: Publish to topic P83C40A24/ip : 10.13.37.177
D: Switch to HEADER
D: Headerline: Expires: Thu, 01 Dec 2003 16:00:00 GMT
D: Headerline: Cache-Control: no-cache, must-revalidate
D: Headerline: Pragma: no-cache
D: Headerline: Access-Control-Allow-Methods: GET, HEAD
D: Headerline: Access-Control-Allow-Origin: *
D: Headerline: Access-Control-Allow-Credentials: true
D: Headerline: Set-Cookie: uuid=e6eaf42e-d62c-4ebf-be8a-088b2d116c65; expires=Sat, 22-Dec-2029 21:30:41 GMT; path=/; domain=.live.st
D: Headerline: Content-Type: audio/aacp
D: audio/aacp seen.
D: Headerline: Connection: close
D: Headerline: icy-br: 48
D: Headerline: icy-description: All Things Dance
D: Headerline: icy-genre:
D: Headerline: icy-name: Evolution
D: Headerline: icy-url:
D: Headerline: icy-metaint: 16000
D: Headerline: Server: MediaGateway 4.4.2-002
D: Switch to DATA, bitrate is 48, metaint is 16000
D: First chunk:
D: FF F1 5E 40 20 BF FC 01
D: 3A 36 2C AB E8 0A 91 86
D: A1 01 24 06 AC 0A 00 50
D: 92 92 83 C2 D7 38 12 08
D: Publish to topic P83C40A24/icy/name : Evolution
D: Metadata block 64 bytes
D: Streamtitle found, 52 bytes
D: StreamTitle='Cash Cash / Sofia Reyes - How To Love';
D: Publish to topic P83C40A24/icy/streamtitle : Cash Cash / Sofia Reyes - How To Love
E (27945) esp_pthread: pthread_getspecific: not supported!
E (27946) esp_pthread: pthread_setspecific: not supported!
abort() was called at PC 0x400de7ef on core 1

Backtrace: 0x400879c8:0x3ffd9100 0x40087ac7:0x3ffd9120 0x400de7ef:0x3ffd9140 0x400de836:0x3ffd9160 0x400def3a:0x3ffd9180 0x400defc3:0x3ffd91a0 0x400de446:0x3ffd91c0 0x400de3fd:0x3ffd91e0 0x400d8324:0x3ffd9200 0x400daeda:0x3ffd9240 0x400d6987:0x3ffd9260 0x4012e8ac:0x3ffd92a0

Rebooting...
ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)

Add support for Adafruit Feather ESP32 board

@Edzelf Many thanks for the new ESP32 version. I had no problems getting it work on the Feather ESP32 board. The only other change is to undefine USETFT since I do not have the display. It works great using the Web interface. The Web interface is very fast even when playing 256K streams.

The patch follows. I can submit a PR if desired.

--- a/Esp32_radio.ino
+++ b/Esp32_radio.ino
@@ -106,9 +106,17 @@
 #define WHITE   BLUE | RED | GREEN
 // Digital I/O used
 // Pins for VS1053 module
+#if defined(ARDUINO_FEATHER_ESP32)
+// Adafruit ESP32 Feather with Adafruit VS1053 Wing
+#define VS1053_CS     32
+#define VS1053_DCS    33
+#define VS1053_DREQ   15
+#define SDCARDCS      14
+#else
 #define VS1053_CS     5
 #define VS1053_DCS    16
 #define VS1053_DREQ   4
+#endif
 // Pins CS and DC for TFT module (if used, see definition of "USETFT")
 #define TFT_CS 15
 #define TFT_DC 2
@@ -1786,6 +1794,11 @@ void setup()
     
   Serial.begin ( 115200 ) ;                              // For debug
   Serial.println() ;
+#if defined(SDCARDCS) && (SDCARDCS >= 0)
+  // Deselect SDCARD
+  pinMode(SDCARDCS, OUTPUT);
+  digitalWrite(SDCARDCS, HIGH);
+#endif
   // Print some memory and sketch info
   dbgprint ( "Starting ESP32-radio Version %s...  Free memory %d",
              VERSION,

Compilation?

Please, give some tips how to compile this project. Your tips for 8266 ware great. Started to install libraries, but there's a lot mistakes like this:

C:\Users\Eugene\Desktop\ESP32_Radio\Esp32_radio.ino:90:26: fatal error: Adafruit_GFX.h: No such file or directory

compilation terminated.

Multiple libraries were found for "WiFi.h"
Used: C:\Users\Eugene\Documents\Arduino\hardware\espressif\esp32\libraries\WiFi
Not used: C:\Program Files (x86)\Arduino\libraries\WiFi
exit status 1
Error compiling for board ESP32 Dev Module.

I used this way
https://github.com/espressif/arduino-esp32/blob/master/doc/windows.md

MQTT - Ping

Just a question: if my MQTT server because of network problems is unreachable then the program tries to connect all the time and playing doesn't work.

I tried to ping the server but I couldn't find a ping library.

Any idea?

Amplifier Power Circuit

Hi,
great work but I am wondering if there is a chance to power the ESP and the amp with the same battery.
I am not very experienced in hardware-layout.
what measures can be taken to reduce noise in the amp power supply?
Thanks and regards
Andreas

On via vol+ after reset

Hi Ed,

Finnaly the TFT received and connected.
Meanwhile the 8266 replaced by the ESP32 changed the software for the latest version.
Indeed the 32 looks like more stable. The 8266 I actualy didn,t get it working after all in combunation with the geeetech shield.( lots of so called "glitching" ) there is a signal and data but not understandeble.
In the same time I placed the capacitors across the 5 Vcc -gnd and betweeh XRST-gnd hopefully will this prevent problems with the power supply spikes.
During my playing/testing I noticed that after a reset from the config page I had to give vol+ a push to get sound again. Is this a known bug?
Also after I received my TFT I didn,t get it working. Connect as discribed and tested again. I changed the TFT_ILI963C.cpp file on line 1096/7
No result. Than the blue 1.8 SPI 128x160 board type I realy do not understand this Most problaby this is the key to get my display working. Do you have a clue?
Further more I realy enjoy this project and like to learn a lot not only from the esp32 also from networking etc. A realy nice step further than just arduino.
Greeting
Theo

SD Card Mount Failed!

Get the error message SD Card Mount Failed!
And the mp3 will not play. What am I doing wrong?

Pinout

Sorry for my question, but, where can i find pinout of this board? Have the same board, but, my google have no results for it
gpio***-d*** and any others

Crash in readhostfrompref ( enc_preset ) routine

If I turn the encoder in PRESET mode back and forth 15-20 times, than the progrem crashes.
( I must say that the encoder interrupt handler is changed, it is much quicker. I will publish it here. Can it happen that ithe isr routine tries to write something at "the same time"?)

It seems to me, that it happens in the mentioned routine. It happens more often in the 1st call, this example is in the 2nd one.

The last existing preset station is 7 . Shouldn't we check it for max before calling readhostfrompref ( enc_preset )?

The program excerpt in chk_enc() routine is :

   dbgprint ( "chk_enc 1 preset:%d, ",enc_preset);
   delay(100);                                                             // crashes in readhostfrompref ( enc_preset ) !!
   tmp = readhostfrompref ( enc_preset ) ;                 // Get host spec and possible comment
   dbgprint ( "chk_enc 11");
   if ( tmp == "" )                                                     // End of presets?
    {
      dbgprint ( "chk_enc 12");
      delay(100);                                                       // crashes in readhostfrompref ( enc_preset ) !!
      enc_preset = 0 ;                                               // Yes, wrap
      tmp = readhostfrompref ( enc_preset ) ;           // Get host spec and possible comment
      dbgprint ( "chk_enc 13");
  }

and the debug messages (it calls the routine with non-existing sation 9):

D: chk_enc 1 preset:9,
D: chk_enc 11
D: chk_enc 12
Guru Meditation Error: Core 1 panic'ed (Cache disabled but cached memory region accessed)
Register dump:
PC : 0x40080df2 PS : 0x00060034 A0 : 0x80081104 A1 : 0x3ffc0bc0
A2 : 0x0000000b A3 : 0x00000000 A4 : 0x3ffc3c2c A5 : 0x3ffcf9e0
A6 : 0x00000020 A7 : 0x3ffc8c50 A8 : 0x00000000 A9 : 0x3ffc0ba0
A10 : 0x3f4022d9 A11 : 0x3ffc36aa A12 : 0x80082daf A13 : 0x3ffcf9c0
A14 : 0x3ffc487c A15 : 0xffffffff SAR : 0x00000004 EXCCAUSE: 0x00000007
EXCVADDR: 0x00000000 LBEG : 0x4000164d LEND : 0x40001667 LCOUNT : 0xfffffffd

Backtrace: 0x40080df2:0x3ffc0bc0 0x40081104:0x3ffc0be0 0x40082205:0x3ffc0c00

CPU halted.

Feature Request: Offline Support

Hey Ed, I just followed a link someone else posted and found this product. It seems that the current state of your hardware and even software are likely pretty much already set up to support this feature, and I think it would be really awesome to have available if a stream becomes temporarily offline/unusable due to lag. There has been a few times when I couldn't get a decent enough stream to provide smooth playback (due to my shitty internet, when there's too many people on it). I think that having the option to record data while the unit is turned off to fill in some of those service gaps would be a nice touch.

I'm fairly certain it would be fairly straightforward to implement, (likely just a few lines of code really...) I think you'd just have to find a way to store the incoming data into files that could be picked up and read later on. Would likely be as simple as generating a mpeg compatible file headers/padding/etc. I personally haven't looked into the specifics of the mpeg layer 3 specification before, so I'm not sure what would be necessary exactly, but it seems that all of the necessary hardware is already in place.

https://www.compuphase.com/dm440/dm440_en.htm

Help with IHR?

I have been trying to get the IHR stations working and have continued to fail both on this project as well as the esp8266 version. I feel like I must be doing something wrong?

The specific station I require access to has a call sign: CHBD
IHeartRadio: http://www.iheartradio.ca/big-dog-92-7/
My preset is something like : preset_00 = ihr/CHBDFM # 00 - BigDog 92.7

I'm wondering:
do I have the formatting correct?
Do I need to log in or something like that?
Is that a valid call sign?
Any other pointers?

It seems lately that all of the examples will load and play, with the exception of anything that has to do with IHR. I can't get anything from ihr to play (although it does seem to pull the metadata properly, at least)

I'm going to attempt to figure iout how to cross reference this post and the ihr post from the other platform, since it looks like this one doesn't have nearly as much traffic as the other. #Edzelf/Esp-radio#82

(PS. please don't judge me based on this shitty channel, it's not for me, it's for the guys at work to help ease them into the idea of listening to something else for a change - this is a local station for me).

Does not enter AP mode after erasing Flash

Erase flash (IDF make erase_flash) then upload ESP32-radio firmware. ESP32-radio does not enter local AP mode. The following fixes the issue.

@@ -1547,10 +1547,14 @@ bool connectwifi()
     if (  WiFi.waitForConnectResult() != WL_CONNECTED ) // Try to connect
     {
       localAP = true ;                                  // Error, setup own AP
     }
   }
+  else
+  {
+      localAP = true ;                              // no ssid/pw so setup local AP
+  }
   if ( localAP )                                        // Must setup local AP?
   {
     dbgprint ( "WiFi Failed!  Trying to setup AP with name %s and password %s.", NAME, NAME ) ;
     WiFi.softAP ( NAME, NAME ) ;                        // This ESP will be an AP
     delay ( 5000 ) ;
@@ -3572,6 +3576,6 @@ String httpheader ( String contentstype )

SD random playing

Why take out SD random playing function?
I enjoy it very mach, except it is slow when seeking for next song.
But I would like fixing it instead of taking it out!

correct wifi acces without wifi connection

Thank you for the big job, Ed.

How can I easily correct the wifi access data without loading new init file and without wifi connection.
Background is: I want to prepare a web radio for a friend of mine. How can he connect the radio to his wifi environmet without reprogramming by Arduino SDK?
BR

Pinout of devboard

I meant pinout of this DEVboard))) which gpio of esp32 goes to some pin of this devboard

flash read err, 1000 and SD errors

Hi all,

The latest version downloaded and flashes into my esp32 devkit (DOIT). So far so good.
Also installed the pushbuttons for the volume and preset.
Some where some how I run into problems which gives the follow malfunctions, it is not possible to run thru my station list up/down. not even preset is possible also the sd card is not readable no files on sd ( there are ).
Looking on the internet I found some issues related to the flash error "flash read err, 1000" looks like this is most probably the problem. So I would like to know if this is the case?
Howe to reset the flash read error to (0) zero it must somehow related to flash encryption or something else.
I double checked the hardware etc.
Like to hear.
Kind regards
Theo

ps I have the pyton esptools installed in arduino hardware folder and I am using the arduino ide for flashing my esp32
ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
Falling back to built-in command interpreter.
OK

ets Jun 8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0x00
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0008,len:8
load:0x3fff0010,len:160
load:0x40078000,len:10632
load:0x40080000,len:252
entry 0x40080034

D: Starting ESP32-radio Version Wed, 31 May 2017 12:05:00 GMT... Free memory 194828
D: GPIO0 is HIGH

How to power without powerbank?

Display refresh ? Text remains and text over text seen

Hello,

After using the radio for a couple of day,s without problems I noticed a " as it looks like a refresh " problem.
On the display a line of text remains and it looks like text is displayed over a old text. See picture.
Stop and resume cleared the display and cont. with a correct text.
This phenonemom happened more frequent now.
display-tft-esp32

As the display is also controled by the SPI and this looks a problem which came up after some time my idee is. Is there a relation with ths SD problem?
@ed, I just wants to let you know this phenonemom.
If I can do something please let me know hopefully I can help.
Regards,
Theo

Using D-duino32, Wemos 32 with built-in LCD

I tried the ESP8266 version also, it is excellent.
I'd use the ESP32 verison now and I have some modules with built-in I2C OLED.
I have this one:
https://www.aliexpress.com/snapshot/0.html?spm=a2g0s.9042647.6.2.v07Jjm&orderId=85346295631073&productId=32807483723

Unfortunately the number of exposed pins is minimal and stupid a bit. The PINs you used for SPI are not exposed.

The question: Can I use another set of SPI PINs (not the standard VSPI) in Arduino?
I tried:
SPI.begin(12,13,14); without success.

I checked the connections, seems to be OK.
Do you have any idea/advice?

Thank you.

George
kep

mp3play_html.h

Having trouble compiling.. It appears you added an include to a file called mp3play_html.h (presumably a new page for the web interface) 2 days ago, and loosely implemented it into the sketch, but I can't find it anywhere. Did you forget to upload it maybe? Or am I just blind? lol

CPU halted

sometimes after pressing "save" and then after a couples of seconds "restart" im getting:

D: Command client available
D: handlehttp started
D: Get command is: reset
D: Start reply for reset
D: Command: reset with parameter 0
ets Jun 8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0x00
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0008,len:8
load:0x3fff0010,len:160
load:0x40078000,len:10632
load:0x40080000,len:252
entry 0x40080034
assertion "false && "item should have been present in cache"" failed: file "/Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/nvs_flash/src/nvs_item_hash_list.cpp", line 85, function: void nvs::HashList::erase(size_t)
abort() was called at PC 0x400da8db on core 0
Guru Meditation Error: Core 0 panic'ed (abort)

Backtrace: 0x40008155:0x3ffccdf0 0x40007d16:0x3ffcce10 0x4010a99f:0x3ffcce40 0x4010aff5:0x3ffcce60 0x4010b2cc:0x3ffccea0 0x4010a4a7:0x3ffccef0 0x4010a03e:0x3ffccf40 0x4010a08e:0x3ffccf60 0x400d7aeb:0x3ffccf80 0x4011f7ee:0x3ffccfa0 0x400e474d:0x3ffccfd0

CPU halted.

Screen saver

I use an OLED display that has limited lifetime, so I implemented a screen saver function in the loop(). Within 1 minutes switches off. I use encoder, it switches back.

Clock?

Hi, ED!!! is there any opportunity to add clock on display? there's a lot of empty space on display, i think it would seem great

Send to Bluetooth speaker

Hi
Is it possible instead of 1053 to use Bluetooth BLE module of ESP32 to send the mp3 to a BT enabled device (speaker) which can play it?
thanks

Hick-up revision 19th July

Hi Ed,

Already long time not contacted. The radio play,s very well.( we only suffer from a really slow internet) as soon as we surf on the internet the radio looses some bits. Not the problem of the radio KPN lack,s "buitengebied"interest.
This evening I checked the site and sow a new revision dated 19th July.
So I installed and tested it. I must say I have the impression it became less stable. And starts up quit a bit slower.
Now my experience,
The operational error direct noticed was the channel operation.
On my system I have gpio13 vol+ gpio14 vol- , gpio26 channel+, gpio27 channel-, and gpio25 preset6
It is not possible to operate the channel via the pushbuttons once you have channel for instance 5 it is not possible to lower the channel. It looks like the only way is up and remains there.
After some tests I noticed that only after you pressed the "control" on the html page banner it will lower the channel.
An other thing. OTA seems not working on my system.
I tested it with the arduino basic OTA script and this is working.
So with the radio script it is not?
Not a big deal but I would like to feel the luxure to program the radio over the air while the radio and the esp32 is build in in a nice case.( no external possibility for the usb connector.)
The time indicater is a nice feature. Howe ever it looks like it is not always shown on the display.
The lower indicater banner showed preset 8 but I have only 0 till 7 programmed?? This is 8 but still.

The serial monitor gives the following: after I pressed the gpio27 for request lower channel
( it has worked perfectly )

push gpio27 I did.
Serial monitor showed,
GPIO27 is now low , executed down preset =-1
command downpreset with parameter -1
preset is now 3
Stop request
Stopping client

( is it necessary to note -1 for downpreset? Volume is not like that it is just 2 for both up or down?
Like to hear.
ps. The radio is in our living-room operational. If the wife likes it it is ok. But if it has some unlogical hick-ups she will complain and I have to go to the shop I,am afraid.
We will see.
Kind regards,
Theo

hidden SSID

radio does not connects to hidden SSID and then starts too run its own AP

ESP32 reboots periodically

D: Start server for commands
D: Rotary encoder is disabled (-1/-1/-1)
Guru Meditation Error of type InstrFetchProhibited occurred on core 1. Exception was unhandled.
Register dump:
PC : 0x00000000 PS : 0x00060630 A0 : 0x800de7f2 A1 : 0x3ffd8070
A2 : 0x3ffc4e54 A3 : 0x3f4016f3 A4 : 0x00000000 A5 : 0x0000ff00
A6 : 0x00ff0000 A7 : 0xff000000 A8 : 0x800de6f2 A9 : 0x3ffd8050
A10 : 0x3ffc4e54 A11 : 0x00000001 A12 : 0x3ffd5890 A13 : 0x0000ff00
A14 : 0x00ff0000 A15 : 0xff000000 SAR : 0x0000001b EXCCAUSE: 0x00000014
EXCVADDR: 0x00000000 LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0xffffffff

Backtrace: 0x00000000:0x3ffd8070 0x400de7ef:0x3ffd8090 0x400d52a2:0x3ffd80c0 0x400d6973:0x3ffd80e0 0x4012d424:0x3ffd8120

Rebooting...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.