Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deep sleep and wake up on touch #109

Open
wants to merge 70 commits into
base: test1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
7e13e3d
Update Esp32_radio_init.ino
Edzelf Mar 24, 2023
f8fd7c2
Update platformio.ini
Edzelf Mar 24, 2023
ba3de2e
Update platformio.ini
Edzelf Mar 24, 2023
56c4818
Add files via upload
Edzelf Apr 26, 2023
ed40085
Add files via upload
Edzelf Jun 5, 2023
d658702
Add files via upload
Edzelf Jun 5, 2023
bfd3879
Add files via upload
Edzelf Jun 5, 2023
9ba562e
Add files via upload
Edzelf Jun 5, 2023
0f4defa
Add files via upload
Edzelf Jun 5, 2023
efe8fe2
Update README.md
Edzelf Jun 5, 2023
4a30ae8
Add files via upload
Edzelf Jun 5, 2023
bd4b14b
Add files via upload
Edzelf Jun 16, 2023
955bc68
Add files via upload
Edzelf Jun 16, 2023
6f73d3f
Update README.md
Edzelf Jun 16, 2023
6b415ac
Add files via upload
Edzelf Oct 9, 2023
c8f5b69
Add files via upload
Edzelf Oct 9, 2023
9fa60b7
Update README.md
Edzelf Oct 9, 2023
2dc412a
Add files via upload
Edzelf Oct 11, 2023
155438b
Add files via upload
Edzelf Oct 11, 2023
24fc201
Add files via upload
Edzelf Oct 11, 2023
40c977c
Add files via upload
Edzelf Oct 18, 2023
af9af5b
Add files via upload
Edzelf Dec 14, 2023
dad2b2f
Update README.md
Edzelf Dec 14, 2023
89422a7
Add files via upload
Edzelf Dec 14, 2023
26b8fc3
Add files via upload
Edzelf Dec 26, 2023
e7a7001
Update README.md
Edzelf Dec 26, 2023
6c4c492
Add files via upload
Edzelf Dec 26, 2023
e7c45ba
Update platformio.ini
Edzelf Feb 8, 2024
970f641
Delete include/config_ed.h
Edzelf Feb 12, 2024
83afb2c
Add files via upload
Edzelf Feb 19, 2024
861fe11
Add files via upload
Edzelf Feb 19, 2024
7e7ea6b
Add files via upload
Edzelf Feb 19, 2024
10aa665
Add files via upload
Edzelf Feb 19, 2024
0365cbe
Delete doc/example config.ed.txt
Edzelf Feb 19, 2024
80ed870
Add files via upload
Edzelf Feb 19, 2024
f0b9915
Update README.md
Edzelf Feb 19, 2024
d7e8740
Add files via upload
Edzelf Feb 19, 2024
7b20e25
Add files via upload
Edzelf Feb 19, 2024
8f65c94
Add files via upload
Edzelf Feb 20, 2024
21324dc
Add files via upload
Edzelf Mar 11, 2024
549b710
Delete doc/Gerber_ESP32-Radio_PCB_ESP32-Radio_2_2024-02-23.zip
Edzelf Mar 11, 2024
97f14da
Add files via upload
Edzelf Mar 11, 2024
d1ac1cc
Create readme.md
Edzelf Mar 11, 2024
7cadac0
Add files via upload
Edzelf Mar 11, 2024
16367c1
Update readme.md
Edzelf Mar 11, 2024
24a5817
Add files via upload
Edzelf Mar 11, 2024
a57898e
Add files via upload
Edzelf Mar 11, 2024
8374b1b
Add files via upload
Edzelf Mar 12, 2024
6c51f80
Delete doc/ESP32-Radio.dip
Edzelf Mar 12, 2024
ac25c69
Add files via upload
Edzelf Mar 12, 2024
cf92390
Add files via upload
Edzelf Mar 12, 2024
25e8e10
Add files via upload
Edzelf Mar 12, 2024
a82acc9
Add files via upload
Edzelf Mar 12, 2024
bb3e5ad
Update README.md
Edzelf Mar 12, 2024
904691b
Update README.md
Edzelf Mar 12, 2024
a236462
Update README.md
Edzelf Apr 2, 2024
f464b2e
Delete lib/SD directory
Edzelf Apr 24, 2024
c92374d
Add files via upload
Edzelf Apr 25, 2024
f27327d
Add files via upload
Edzelf Jul 5, 2024
3253b73
Add files via upload
Edzelf Jul 5, 2024
fb20625
Update README.md
Edzelf Jul 5, 2024
d5cfbaf
Add files via upload
Edzelf Jul 5, 2024
2399c65
Add files via upload
Edzelf Jul 9, 2024
e4ec4db
Update README.md
Edzelf Oct 17, 2024
aa22fdb
Add files via upload
Edzelf Oct 17, 2024
bfad394
Add files via upload
Edzelf Oct 17, 2024
22b4b63
Add files via upload
Edzelf Oct 17, 2024
02fa927
Add files via upload
Edzelf Dec 7, 2024
7088664
Add files via upload
Edzelf Dec 9, 2024
a05e19f
Add files via upload
Edzelf Dec 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
# ESP32Radio-V2
New version of the well known ESP32 Radio. Now optional I2S output!
New version of the well known ESP32 Radio. Now optional I2S output and SP/DIF output!
- Compile time configuration in config.h.
- Do not forget to upload the data directory to the ESP32.
- SD cards supported, but still experimental.

![SAM_2922](https://github.com/Edzelf/ESP32Radio-V2/assets/18257026/a58f7b7e-cdd4-4d7f-96b8-62fa487de906)

Updates:
- 17-oct-2024: Experimental support for ESP32-S3. SP/DIF tested.
- 05-jul-2024: Correction SPDIF output.
- 12-mar-2024: Add document with building instructions. New PCB available! See [here at PCBWay](https://www.pcbway.com/project/shareproject/W652317AS2P1_Gerber_ESP32_Radio_PCB_ESP32_Radio_fab8a6d9.html).
- 19-feb-2024: SP/DIF (Toslink) output, fixed mono bug.
- 26-dec-2023: Correct crash with VS1053 and empty preferences.
- 14-dec-2023: Add "mqttrefresh" command to refresh all mqtt items.
- 09-oct-2023: Reduced error messages caused by uninitialized GPIO numbers.
- 16-may-2023: Added sleep command.
- 05-may-2023: SD card file stored on SD card, mute/unmute, better mutex.
- 24-mar-2023: Code clean-up
- 03-nov-2022: Added AI Thinker Audio kit V2.1 suport.
- 05-oct-2021: Fixed internal DAC output, fixed OTA upload.
Expand Down
Binary file added archive/ESP32Radio.zip
Binary file not shown.
7 changes: 7 additions & 0 deletions archive/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ESP32Radio.zip Contains the project as an Arduino sketch.
Edit config.h for your configuration....
Enable core debug level "Info" in the tools menu.

There is no simple way to upload the SPIFFS files in version 2 of the Arduino IDE, so use version 1.


7 changes: 3 additions & 4 deletions data/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@
</ul>
<br><br><br>
<center>
<h1>** ESP32 Radio **</h1>
<h1>** ESP32 Radio V2 **</h1>
</center>
<p>ESP32 Radio V2 -- Web radio receiver for ESP32, Color display and VS1053 MP3 module.<br>
I2S output instead of VS1053 is also supported.<br>
I2S and SPDIF output instead of VS1053 is also supported.<br>
This project is documented at <a target="blank" href="https://github.com/Edzelf/ESP32Radio-V2">Github</a>.</p>
<p>Author: Ed Smallenburg (ed@smallenburg.nl)<br>
Webinterface design: <a target="blank" href="http://www.sanderjochems.nl/">Sander Jochems</a><br>
App (Android): <a target="blank" href="https://play.google.com/store/apps/details?id=com.thunkable.android.sander542jochems.ESP_Radio">Sander Jochems</a><br>
Date: January 2022</p>
Date: January 2022 - May 2023</p>
</body>
</html>
31 changes: 3 additions & 28 deletions data/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
<h1>** ESP32 Radio **</h1>
<p>You can edit the configuration here. <i>Note that this will be effective on the next restart of the radio.</i>
</p>
<h3>Available WiFi networks
<select class="select" onChange="handletone(this)" id="ssid"></select>
</h3>
<textarea rows="20" cols="100" id="prefs">Loading preferences</textarea>
<br>
<button class="button" onclick="fsav()">Save</button>
Expand All @@ -31,11 +28,11 @@ <h3>Available WiFi networks
<button class="button" onclick="ldef('getdefs')">Default</button>
<br><input type="text" size="80" id="resultstr" placeholder="Waiting for input....">
<br>

</center>
<script>
function httpGet ( theReq )
{
var theUrl = "/?" + theReq + "&version=" + Math.random() ;
var theUrl = "/" + theReq + "?version=" + Math.random() ;
var xhr = new XMLHttpRequest() ;
xhr.onreadystatechange = function() {
if ( xhr.readyState == XMLHttpRequest.DONE )
Expand Down Expand Up @@ -100,30 +97,8 @@ <h3>Available WiFi networks
xhr.setRequestHeader ( "Content-type", "application/x-www-form-urlencoded" ) ;
xhr.send() ;
}

// Fill configuration initially
// First the available WiFi networks
var i, select, opt, networks, params ;

select = document.getElementById("selnet") ;
var theUrl = "/?getnetworks" + "&version=" + Math.random() ;
var xhr = new XMLHttpRequest() ;
xhr.onreadystatechange = function() {
if ( xhr.readyState == XMLHttpRequest.DONE )
{
networks = xhr.responseText.split ( "|" ) ;
for ( i = 0 ; i < ( networks.length - 1 ) ; i++ )
{
opt = document.createElement( "OPTION" ) ;
opt.value = i ;
opt.text = networks[i] ;
ssid.add( opt ) ;
}
}
}
xhr.open ( "GET", theUrl, false ) ;
xhr.send() ;
// Now get the configuration parameters from preferences
// Get the configuration parameters from preferences
ldef ( "getprefs" ) ;
</script>
</body>
Expand Down
44 changes: 24 additions & 20 deletions data/defaultprefs.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# Example configuration
# Programmable input pins:
gpio_00 = uppreset = 1
gpio_12 = upvolume = 2
gpio_13 = downvolume = 2
gpio_14 = stop
gpio_25 = upvolume = 2
gpio_33 = downvolume = 2
gpio_16 = stop
gpio_17 = resume
gpio_34 = station = icecast.omroep.nl:80/radio1-bb-mp3
gpio_21 = station = icecast.omroep.nl:80/radio1-bb-mp3
#
# Battery monitor
batt100 = 2950
batt0 = 2600
# MQTT settings
mqttbroker = none
mqttport = 1883
Expand All @@ -27,37 +30,38 @@ preset = 6
# Some preset examples
preset_00 = 109.206.96.34:8100 # 0 - NAXI LOVE RADIO, Belgrade, Serbia
preset_01 = airspectrum.cdnstream1.com:8114/1648_128 # 1 - Easy Hits Florida 128k
preset_02 = us2.internet-radio.com:8050 # 2 - CLASSIC ROCK MIAMI 256k
preset_02 = stream.hitfm.de:9050/live # 2 - 89 HIT FM - Munichs Power Station, 128k
preset_03 = airspectrum.cdnstream1.com:8000/1261_192 # 3 - Magic Oldies Florida
preset_04 = airspectrum.cdnstream1.com:8008/1604_128 # 4 - Magic 60s Florida 60s Classic Rock
preset_05 = us1.internet-radio.com:8105 # 5 - Classic Rock Florida - SHE Radio
preset_06 = icecast.omroep.nl:80/radio1-bb-mp3 # 6 - Radio 1, NL
preset_06 = icecast.omroep.nl:80/radio1-bb-mp3 # 6 - Radio 1, NL, 192k
preset_07 = 205.164.62.15:10032 # 7 - 1.FM - GAIA, 64k
preset_08 = skonto.ls.lv:8002/mp3 # 8 - Skonto 128k
preset_09 = 94.23.66.155:8106 # 9 - *ILR CHILL and GROOVE
preset_10 = ihr/IHR_IEDM # 10 - iHeartRadio IHR_IEDM
preset_11 = ihr/IHR_TRAN # 11 - iHeartRadio IHR_TRAN
preset_08 = www.doowopradio.com:8000 # 8 - Doo-Wop Radio, 96k
preset_09 = server-27.stream-server.nl:8192/stream # 9 - 192 Radio Nederland, 320k
#
# Clock offset and daylight saving time
clk_server = pool.ntp.org # Time server to be used
clk_offset = 1 # Offset with respect to UTC in hours
clk_dst = 1 # Offset during daylight saving time (hours)
# Some IR codes
# Some example IR codes
ir_40BF = upvolume = 2
ir_C03F = downvolume = 2
# GPIO pinnings
pin_ir = 35 # GPIO Pin number for IR receiver VS1838B
pin_enc_clk = 25 # GPIO Pin number for rotary encoder "CLK"
pin_enc_dt = 26 # GPIO Pin number for rotary encoder "DT"
pin_enc_sw = 27 # GPIO Pin number for rotary encoder "SW"
pin_enc_clk = 12 # GPIO Pin number for rotary encoder "CLK"
pin_enc_dt = 14 # GPIO Pin number for rotary encoder "DT"
pin_enc_sw = 13 # GPIO Pin number for rotary encoder "SW"
#
pin_tft_cs = 15 # GPIO Pin number for TFT "CS"
pin_tft_dc = 2 # GPIO Pin number for TFT "DC"
pin_tft_cs = 2 # GPIO Pin number for TFT "CS"
pin_tft_dc = 4 # GPIO Pin number for TFT "DC"
#
# define pins for decoder. Examples for VS1053, I2S and Toslink
pin_vs_cs = 5 # GPIO Pin number for VS1053 "CS"
pin_vs_dcs = 32 # GPIO Pin number for VS1053 "DCS"
pin_vs_dreq = 4 # GPIO Pin number for VS1053 "DREQ"
pin_vs_dreq = 15 # GPIO Pin number for VS1053 "DREQ"
#
pin_i2s_bck = 5 # GPIO Pin number for I2S "BCK"
pin_i2s_lck = 32 # GPIO Pin number for I2S "L(R)CK"
pin_i2s_din = 4 # GPIO Pin number for I2S "DIN"
#pin_i2s_bck = 15 # GPIO Pin number for I2S "BCK"
#pin_i2s_lck = 27 # GPIO Pin number for I2S "L(R)CK"
#pin_i2s_din = 26 # GPIO Pin number for I2S "DIN"
#
#pin_i2s_spdif = 15 # GPIO Pin number for I2S/SPDIF (Toslink)
84 changes: 43 additions & 41 deletions data/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ <h1>** ESP32 Radio **</h1>
<button class="button" onclick="httpGet('uppreset=1')">NEXT</button>
<button class="button" id="volmin" onclick="httpGet('downvolume=2')">VOL-</button>
<button class="button" id="volplus" onclick="httpGet('upvolume=2')">VOL+</button>
<button class="button" onclick="httpGet('mute')">(un)MUTE</button>
<button class="button" onclick="httpGet('status')">STATUS</button>
<button class="button" onclick="httpGet('test')">TEST</button>
<br>
<button class="button" onclick="httpGet('mute')">MUTE</button>
<button class="button" onclick="httpGet('unmute')">UNMUTE</button>
<button class="button" onclick="httpGet('sleep')">SLEEP</button>
<table id="t1" style="width:500px">
<tr>
<td colspan="2"><center>
Expand Down Expand Up @@ -63,21 +66,21 @@ <h1>** ESP32 Radio **</h1>
<label for="HF"><big>Treble Freq:</big></label>
<br>
<select class="select" onChange="handletone(this)" id="tonehf">
<option value="1">1 kHz</option>
<option value="2">2 kHz</option>
<option value="3">3 kHz</option>
<option value="4">4 kHz</option>
<option value="5">5 kHz</option>
<option value="6">6 kHz</option>
<option value="7">7 kHz</option>
<option value="8">8 kHz</option>
<option value="9">9 kHz</option>
<option value="10">10 kHz</option>
<option value="11">11 kHz</option>
<option value="12">12 kHz</option>
<option value="13">13 kHz</option>
<option value="14">14 kHz</option>
<option value="15">15 kHz</option>
<option value="1">1 kHz</option>
<option value="2">2 kHz</option>
<option value="3">3 kHz</option>
<option value="4">4 kHz</option>
<option value="5">5 kHz</option>
<option value="6">6 kHz</option>
<option value="7">7 kHz</option>
<option value="8">8 kHz</option>
<option value="9">9 kHz</option>
<option value="10">10 kHz</option>
<option value="11">11 kHz</option>
<option value="12">12 kHz</option>
<option value="13">13 kHz</option>
<option value="14">14 kHz</option>
<option value="15">15 kHz</option>
</select>
<br><br>
</center></td>
Expand Down Expand Up @@ -139,10 +142,10 @@ <h1>** ESP32 Radio **</h1>
<br><br>
<p>Find new radio stations at <a target="blank" href="http://www.internet-radio.com">http://www.internet-radio.com</a><br>
or use the Search function from the menu.</p>
<p>Examples: us5.internet-radio.com:8121, 1a-60er.radionetz.de/1a-60er.mp3, 85.17.121.103:8800</p><br>
<br><br>
</center>
<script>
function httpGet ( theReq )
function httpGet ( theReq )
{
var theUrl = "/?" + theReq + "&version=" + Math.random() ;
var xhr = new XMLHttpRequest() ;
Expand Down Expand Up @@ -212,7 +215,6 @@ <h1>** ESP32 Radio **</h1>
}

// Fill preset list initially
//
function onloadfunc()
{
var i, sel, opt, lines, parts ;
Expand All @@ -224,30 +226,30 @@ <h1>** ESP32 Radio **</h1>
lines = xhr.responseText.split ( "\n" ) ;
for ( i = 0 ; i < ( lines.length-1 ) ; i++ )
{
sel = document.getElementById ( "preset" ) ;
parts = lines[i].split ( "=" ) ;
if ( parts[0].indexOf ( "preset_" ) == 0 )
{
opt = document.createElement ( "OPTION" ) ;
opt.value = parts[0].substring ( 7 ) ;
opt.text = parts[1] ;
sel.add( opt ) ;
}
if ( ( parts[0].indexOf ( "tone" ) == 0 ) ||
( parts[0] == "preset" ) )
{
selectItemByValue ( parts[0], parts[1] ) ;
}
// No tone settings if no VS1053 decoder
if ( parts[0].indexOf ( "decoder" ) == 0 )
sel = document.getElementById ( "preset" ) ;
parts = lines[i].split ( "=" ) ;
if ( parts[0].indexOf ( "preset_" ) == 0 )
{
opt = document.createElement ( "OPTION" ) ;
opt.value = parts[0].substring ( 7 ) ;
opt.text = parts[1] ;
sel.add( opt ) ;
}
if ( ( parts[0].indexOf ( "tone" ) == 0 ) ||
( parts[0] == "preset" ) )
{
selectItemByValue ( parts[0], parts[1] ) ;
}
// No tone settings if no VS1053 decoder
if ( parts[0].indexOf ( "decoder" ) == 0 )
{
if ( parts[1].indexOf ( "helix" ) == 0 )
{
if ( parts[1].indexOf ( "helix" ) == 0 )
{
var toneobj = document.getElementById("t1") ;
toneobj.deleteRow(2);
toneobj.deleteRow(1);
}
var toneobj = document.getElementById("t1") ;
toneobj.deleteRow(2);
toneobj.deleteRow(1);
}
}
}
setTimeout(myRefresh,5000) ;
}
Expand Down
3 changes: 2 additions & 1 deletion data/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ <h1>** ESP32 Radio search stations **</h1>
<td><button class="button" onclick="listStats('reggae')">Reggae</button></td>
<td><button class="button" onclick="listStats('funk')">Funk</button></td>
<td><button class="button" onclick="listStats('top')">Top</button></td>
<td><button class="button" onclick="listStats('synth')">Synth</button></td><tr>
<td><button class="button" onclick="listStats('synth')">Synth</button></td>
<td><button class="button" onclick="listStats('country')">Country</button></td><tr>
<td><button class="button" onclick="listStats('fantasy')">Fantasy</button></td>
<td><button class="button" onclick="listStats('rain')">Rain</button></td>
<td><button class="button" onclick="listStats('ambient')">Ambient</button></td>
Expand Down
Binary file removed doc/ESP32-Radio.dip
Binary file not shown.
Binary file added doc/ESP32-radio buiding instructions.odt
Binary file not shown.
Binary file added doc/ESP32-radio buiding instructions.pdf
Binary file not shown.
Binary file modified doc/ESP32-radio.odt
Binary file not shown.
Binary file modified doc/ESP32-radio.pdf
Binary file not shown.
Binary file added doc/Gerber_ESP32-Radio_PCB_ESP32-Radio.zip
Binary file not shown.
Binary file added doc/Schematic_ESP32-Radio_2024-12-17.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions doc/example config.ed.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ mqttpasswd = none
mqttport = 1883
mqttuser = carol
#
ota = 1
#
pin_enc_clk = 12 # GPIO rotary encoder CLK
pin_enc_dt = 27 # GPIO rotary encoder DT
pin_enc_dt = 14 # GPIO rotary encoder DT
pin_enc_sw = 13 # GPIO rotary encoder SW
pin_ir = 35 # GPIO IR receiver VS1838B
pin_sd_cs = 14 # SD card select
Expand Down
Loading