-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathESP_WIFI_RADIO.ino
45 lines (36 loc) · 1.28 KB
/
ESP_WIFI_RADIO.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <ESP8266WiFi.h>
#include <FS.h>
#include <ESPAsyncTCP.h>
#include <ESPAsyncWebServer.h> // https://github.com/me-no-dev/ESPAsyncWebServer
#include <SPIFFSEditor.h>
#include <ESP8266SSDP.h> //Содержится в пакете. Видео с уроком http://esp8266-arduinoide.ru/step3-ssdp
#include <ArduinoJson.h> //Ставим через менеджер библиотек
#include "AudioFileSourceHTTPStream.h"
#include "AudioGeneratorMP3.h"
#include "AudioOutputI2SNoDAC.h" //https://github.com/earlephilhower/ESP8266Audio
AudioGeneratorMP3 *mp3;
AudioFileSourceHTTPStream *file;
AudioOutputI2SNoDAC *out;
// SKETCH BEGIN
AsyncWebServer server(80);
String configSetup = "{}";
String configOptions = "{}";
String configLive = "{}";
uint8_t RELE1_PIN = 13; // Реле
uint8_t LED_PIN = 13; // Светодиод
boolean state0;
void setup() {
Serial.begin(115200);
SPIFFS.begin();
configSetup = readFile("config.save.json", 4096);
configSetup = jsonWrite(configSetup, "time", "00:00:00");
configOptions = jsonWrite(configOptions, "lang", jsonRead(configSetup, "lang"));
configOptions = jsonWrite(configOptions, "SSDP", jsonRead(configSetup, "SSDP"));
WIFIinit();
SSDP_init();
WEB_init();
AUDIO_init();
}
void loop() {
//handleAudio();
}