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

--- ignore this --- #167

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.pio
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch
*aljaz*
10 changes: 10 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
]
}
23 changes: 0 additions & 23 deletions ESP32-Radio.code-workspace

This file was deleted.

3 changes: 2 additions & 1 deletion data/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<ul>
<li><a class="pull-left" href="/index.html">Control</a></li>
<li><a class="pull-left" href="/search.html">Search</a></li>
<li><a class="pull-left" href="/mp3play.html">MP3-player</a></li>
<li><a class="pull-left" href="/config.html">Config</a></li>
<li><a class="pull-left" href="/mp3play.html">MP3-player</a></li>
<li><a class="pull-left active" href="/about.html">About</a></li>
Expand All @@ -19,7 +20,7 @@
<h1>** ESP32 Radio V2 **</h1>
</center>
<p>ESP32 Radio V2 -- Web radio receiver for ESP32, Color display and VS1053 MP3 module.<br>
I2S and SPDIF output instead of VS1053 is also supported.<br>
I2S 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>
App (Android): <a target="blank" href="https://play.google.com/store/apps/details?id=com.thunkable.android.sander542jochems.ESP_Radio">Sander Jochems</a><br>
Expand Down
5 changes: 3 additions & 2 deletions data/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<ul>
<li><a class="pull-left" href="/index.html">Control</a></li>
<li><a class="pull-left" href="/search.html">Search</a></li>
<li><a class="pull-left" href="/mp3play.html">MP3-player</a></li>
<li><a class="pull-left active" href="/config.html">Config</a></li>
<li><a class="pull-left" href="/mp3play.html">MP3-player</a></li>
<li><a class="pull-left" href="/about.html">About</a></li>
Expand All @@ -26,13 +27,13 @@ <h1>** ESP32 Radio **</h1>
<button class="button buttonr" onclick="httpGet('reset')">Restart</button>
&nbsp;&nbsp;
<button class="button" onclick="ldef('getdefs')">Default</button>
<br><input type="text" size="80" id="resultstr" placeholder="Waiting for input....">
<br><input type="text" size="50" 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
85 changes: 29 additions & 56 deletions data/defaultprefs.txt
Original file line number Diff line number Diff line change
@@ -1,67 +1,40 @@
# Example configuration
# Programmable input pins:
clk_dst = 1
clk_offset = 0
clk_server = pool.ntp.org
#
gpio_00 = uppreset = 1
gpio_25 = upvolume = 2
gpio_33 = downvolume = 2
gpio_16 = stop
gpio_17 = resume
gpio_21 = station = icecast.omroep.nl:80/radio1-bb-mp3
#
# Battery monitor
batt100 = 2950
batt0 = 2600
# MQTT settings
lstmods = Fri, 12 Nov 2021 10:46:40 GMT
#
mqttbroker = none
mqttpasswd = *******
mqttport = 1883
mqttuser = none
mqttpasswd = none
mqttprefix = none
# Enter your WiFi network specs here:
wifi_00 = SSID1/PASSWD1
wifi_01 = SSID2/PASSWD2
#
volume = 72
toneha = 0
tonehf = 0
tonela = 0
tonelf = 0
mqttuser = none
#
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 = 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, 192k
preset_07 = 205.164.62.15:10032 # 7 - 1.FM - GAIA, 64k
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
pin_enc_clk = -1 # GPIO Pin number for rotary encoder CLK
pin_enc_dt = -1 # GPIO Pin number for rotary encoder DT
pin_enc_sw = -1 # GPIO Pin number for rotary encoder SW
pin_ir = -1 # GPIO Pin number for IR receiver VS1838B
pin_tft_scl = 15 # GPIO Pin number for OLED SCL
pin_tft_sda = 4 # GPIO Pin number for OLED SDA
#
# 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 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 = 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"
preset = 3
preset_00 = stream02.exit.si:8000/radiohit # 0 Radio HIT slo
preset_01 = 22613.live.streamtheworld.com:80/SRGSTR08.mp3 # 14 Sky Radio Christmas
preset_02 = www.radio-xmas.at:443/xmas?1512905036085 # 15 Radio Xmas AT
preset_03 = live1.jupinfo.fr:8000/radiodenoel # 16 La radio de Noel FR
#
pin_tft_cs = 2 # GPIO Pin number for TFT "CS"
pin_tft_dc = 4 # GPIO Pin number for TFT "DC"
toneha = 0
tonehf = 2
tonela = 4
tonelf = 5
#
# 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 = 15 # GPIO Pin number for VS1053 "DREQ"
volume = 90
#
#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"
wifi_00 = USER/PASS
wifi_01 = USER/PASS
#
#pin_i2s_spdif = 15 # GPIO Pin number for I2S/SPDIF (Toslink)
# Screensaving Options
disp_time = 45 # Turn off backlight / blank display (seconds)
disp_blank = true # Enables blanking the display
137 changes: 82 additions & 55 deletions data/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,41 @@
<body>
<ul>
<li><a class="pull-left active" href="/index.html">Control</a></li>
<li><a class="pull-left" href="/config.html">Config</a></li>
<li><a class="pull-left" href="/search.html">Search</a></li>
<li><a class="pull-left" href="/mp3play.html">MP3-player</a></li>
<li><a class="pull-left" href="/config.html">Config</a></li>
<li><a class="pull-left" href="/about.html">About</a></li>
</ul>
<br><br><br>
<center>
<h1>** ESP32 Radio **</h1>
<button class="button" onclick="httpGet('downpreset=1')">PREV</button>
<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="bigbutton" onclick="httpGet('downpreset=1')">PREV</button>
<button class="bigbutton" onclick="httpGet('uppreset=1')">NEXT</button>
<button class="bigbutton" id="volmin" onclick="httpGet('downvolume=2')">VOL-</button>
<button class="bigbutton" id="volplus" onclick="httpGet('upvolume=2')">VOL+</button>
<br>
<br>
<button class="volumebutton" id="vol" onclick="httpGet('volume=30')">30</button>
<button class="volumebutton" id="vol" onclick="httpGet('volume=50')">50</button>
<button class="volumebutton" id="vol" onclick="httpGet('volume=60')">60</button>
<button class="volumebutton" id="vol" onclick="httpGet('volume=70')">70</button>
<button class="volumebutton" id="vol" onclick="httpGet('volume=80')">80</button>
<button class="volumebutton" id="vol" onclick="httpGet('volume=90')">90</button>
<button class="volumebutton" id="vol" onclick="httpGet('volume=100')">100</button>
<br>
<br>
<button class="button" onclick="httpGet('stop')">STOP</button>
<button class="button" onclick="httpGet('start')">START</button>
<button class="button" onclick="httpGet('mute')">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>
<br>
<br>
<input type="bigtext" size="35" id="resultstr" placeholder="Waiting for a command....">
<br>

<table id="t1" style="width:500px">
<tr>
<td colspan="2"><center>
Expand Down Expand Up @@ -66,21 +83,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 @@ -130,30 +147,38 @@ <h1>** ESP32 Radio **</h1>
<option value="15">140 Hz</option>
</select>
</center></td>
<br><br>
</tr>
</table>
<br>
<input type="text" size="60" id="station" placeholder="Enter a station/file here....">
<br>
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.
<br>
<input type="text" size="40" id="station" placeholder="Enter a station/file here....">
<button class="button" onclick="setstat()">PLAY</button>
<br>

<br>
<input type="text" width="600px" size="72" id="resultstr" placeholder="Waiting for a command...."><br>
<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>
<br><br>
<input type="text" size="50" id="statustext" placeholder="Status...">

</center>
<script>
function httpGet ( theReq )
function httpGet ( theReq )
{
var theUrl = "/?" + theReq + "&version=" + Math.random() ;
var xhr = new XMLHttpRequest() ;
xhr.onreadystatechange = function() {
if ( xhr.readyState == XMLHttpRequest.DONE )
{
resultstr.value = xhr.responseText ;
preset.selectedIndex = 0 ;
if ( theReq == "test" )
{
statustext.value = xhr.responseText ;
}
else
{
resultstr.value = xhr.responseText ;
preset.selectedIndex = 0 ;
}
}
}
xhr.open ( "GET", theUrl ) ;
Expand Down Expand Up @@ -211,10 +236,12 @@ <h1>** ESP32 Radio **</h1>
function myRefresh()
{
httpGet ('status') ;
httpGet ('test') ;
setTimeout(myRefresh,5000) ;
}

// Fill preset list initially
//
function onloadfunc()
{
var i, sel, opt, lines, parts ;
Expand All @@ -226,30 +253,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 )
{
if ( parts[1].indexOf ( "helix" ) == 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 )
{
var toneobj = document.getElementById("t1") ;
toneobj.deleteRow(2);
toneobj.deleteRow(1);
if ( parts[1].indexOf ( "helix" ) == 0 )
{
var toneobj = document.getElementById("t1") ;
toneobj.deleteRow(2);
toneobj.deleteRow(1);
}
}
}
}
setTimeout(myRefresh,5000) ;
}
Expand Down
Loading