|
1 | 1 | #include "Arduino.h"
|
2 |
| -#include "WiFi.h" |
| 2 | +#include "WiFiMulti.h" |
3 | 3 | #include "Audio.h"
|
| 4 | +#include "SPI.h" |
4 | 5 | #include "SD.h"
|
5 | 6 | #include "FS.h"
|
6 | 7 |
|
|
14 | 15 | #define I2S_LRC 26
|
15 | 16 |
|
16 | 17 | Audio audio;
|
| 18 | +WiFiMulti wifiMulti; |
17 | 19 |
|
18 |
| -String ssid = "Wolles-FRITZBOX"; |
19 |
| -String password = "*******"; |
| 20 | +String ssid = "xxxxxx"; |
| 21 | +String password = "xxxxxx"; |
20 | 22 |
|
21 | 23 | void setup() {
|
| 24 | + pinMode(SD_CS, OUTPUT); digitalWrite(SD_CS, HIGH); |
22 | 25 | SPI.begin(SPI_SCK, SPI_MISO, SPI_MOSI);
|
| 26 | + SPI.setFrequency(1000000); |
23 | 27 | Serial.begin(115200);
|
24 | 28 | SD.begin(SD_CS);
|
25 |
| - WiFi.disconnect(); |
26 | 29 | WiFi.mode(WIFI_STA);
|
27 |
| - WiFi.begin(ssid.c_str(), password.c_str()); |
28 |
| - while (WiFi.status() != WL_CONNECTED) delay(1500); |
| 30 | + wifiMulti.addAP(ssid.c_str(), password.c_str()); |
| 31 | + wifiMulti.run(); |
| 32 | + if(WiFi.status() != WL_CONNECTED){ |
| 33 | + WiFi.disconnect(true); |
| 34 | + wifiMulti.run(); |
| 35 | + } |
29 | 36 | audio.setPinout(I2S_BCLK, I2S_LRC, I2S_DOUT);
|
30 |
| - audio.setVolume(21); // 0...21 |
| 37 | + audio.setVolume(12); // 0...21 |
31 | 38 |
|
32 | 39 | //audio.connecttoSD("/320k_test.mp3");
|
33 | 40 | //audio.connecttohost("www.wdr.de/wdrlive/media/einslive.m3u");
|
34 |
| - audio.connecttohost("dg-ais-eco-http-fra-eco-cdn.cast.addradio.de/hellwegradio/west/mp3/high"); |
35 |
| - //audio.connecttohost("fischkopp.stream.laut.fm/fischkopp"); |
| 41 | + //audio.connecttohost("dg-ais-eco-http-fra-eco-cdn.cast.addradio.de/hellwegradio/west/mp3/high"); |
| 42 | + //audio.connecttohost("http://macslons-irish-pub-radio.com/media.asx"); |
36 | 43 | //audio.connecttospeech("Wenn die Hunde schlafen, kann der Wolf gut Schafe stehlen.", "de");
|
37 | 44 | }
|
38 | 45 |
|
@@ -80,4 +87,3 @@ void audio_eof_speech(const char *info){
|
80 | 87 |
|
81 | 88 |
|
82 | 89 |
|
83 |
| - |
|
0 commit comments