mirror of
https://github.com/HendrikRauh/dmx-interface.git
synced 2025-07-05 05:38:54 +00:00
Merge pull request #2 from HendrikRauh/DMX-17-basic-webserver
DMX-17 added basic webserver
This commit is contained in:
commit
b251588c74
3 changed files with 28 additions and 5 deletions
11
data/index.html
Normal file
11
data/index.html
Normal file
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Test</title>
|
||||
</head>
|
||||
<body>
|
||||
Your advert could be placed here
|
||||
</body>
|
||||
</html>
|
|
@ -14,4 +14,4 @@ board = lolin_s2_mini
|
|||
framework = arduino
|
||||
lib_deps =
|
||||
hideakitai/ArtNet @ ^0.8.0
|
||||
someweisguy/esp_dmx @ ^4.1.0
|
||||
me-no-dev/ESP Async WebServer@^1.2.4
|
20
src/main.cpp
20
src/main.cpp
|
@ -1,10 +1,9 @@
|
|||
// Art-Net DMX Interface Demo
|
||||
// 2024-10-17 Patrick Schwarz
|
||||
|
||||
#include <ArtnetWiFi.h>
|
||||
// #include <ArtnetEther.h>
|
||||
|
||||
#include "ESPDMX.h"
|
||||
#include <ESPAsyncWebServer.h>
|
||||
#include <SPIFFS.h>
|
||||
|
||||
// WiFi stuff
|
||||
const char *ssid = "artnet";
|
||||
|
@ -13,6 +12,8 @@ const IPAddress ip(192, 168, 1, 201);
|
|||
const IPAddress gateway(192, 168, 1, 1);
|
||||
const IPAddress subnet(255, 255, 255, 0);
|
||||
|
||||
AsyncWebServer server(80);
|
||||
|
||||
// Art-Net stuff
|
||||
ArtnetWiFi artnet;
|
||||
// const String target_ip = "192.168.1.200";
|
||||
|
@ -28,7 +29,7 @@ void setup()
|
|||
{
|
||||
|
||||
// Serial console
|
||||
// Serial.begin(115200);
|
||||
Serial.begin(9600);
|
||||
|
||||
// WiFi stuff
|
||||
// WiFi.begin(ssid, pwd);
|
||||
|
@ -89,6 +90,17 @@ void setup()
|
|||
Serial.print(", size = ");
|
||||
Serial.print(size);
|
||||
Serial.println(")");*/ });
|
||||
|
||||
if (!SPIFFS.begin(true))
|
||||
{
|
||||
Serial.println("An Error has occurred while mounting SPIFFS");
|
||||
return;
|
||||
}
|
||||
|
||||
server.serveStatic("/", SPIFFS, "/").setDefaultFile("index.html");
|
||||
|
||||
server.begin();
|
||||
Serial.println("Server started!");
|
||||
}
|
||||
|
||||
void loop()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue