A real-time ESP32 audio streaming and GPS tracking web application, ready for Netlify deployment.
website/
βββ index.html # Main HTML file
βββ styles.css # Styling (green terminal theme)
βββ script.js # WebSocket and audio handling
βββ netlify.toml # Netlify deployment config
βββ README.md # This file
-
Create a GitHub Repository
- Go to github.com/new
- Create a new repo named
musick-website - Don't initialize with README
-
Push Your Website
cd e:\musick\website git init git add . git commit -m "Initial commit" git branch -M main git remote add origin https://github.com/YOUR-USERNAME/musick-website.git git push -u origin main
-
Deploy on Netlify
- Go to netlify.com
- Click "New site from Git"
- Connect to GitHub and select your repo
- Default settings work fine
- Click "Deploy site"
- Your site will be live at
https://your-site-name.netlify.app
-
Python Server (if you have Python)
cd e:\musick\website python -m http.server 8000 # Open http://localhost:8000
-
Node.js Server
cd e:\musick\website npx http-server
-
VS Code Live Server
- Install "Live Server" extension
- Right-click
index.htmlβ "Open with Live Server"
Your ESP32 needs to be accessible from the website. Modify your code:
Remove or modify the embedded HTML since you're using an external website now.
void broadcastGPSData() {
if (gpsFix) {
String gpsJson = "{\"type\":\"gps\",\"lat\":" + String(gpsLat, 6) +
",\"lng\":" + String(gpsLng, 6) +
",\"sats\":" + String(gpsSats) +
",\"fix\":true}";
ws.broadcastTXT(gpsJson);
}
}void loop() {
server.handleClient();
ws.loop();
updateGPS();
streamMic();
static unsigned long t = 0;
if (millis() - t > 3000) {
t = millis();
broadcastGPSData(); // Add this line
if (gpsFix) {
Serial.printf("π GPS: %.6f , %.6f | Sats: %d\n", gpsLat, gpsLng, gpsSats);
} else {
Serial.println("π‘ Waiting GPS lock...");
}
}
}void wsEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t len) {
if (type == WStype_TEXT) {
String cmd = (char*)payload;
if (cmd == "start") {
streamAudio = true;
Serial.println("π LIVE AUDIO STARTED");
}
if (cmd == "stop") {
streamAudio = false;
Serial.println("βΉ AUDIO STOPPED");
}
if (cmd == "get-gps") {
broadcastGPSData();
}
}
}- Enter ESP32 IP address
- Customize WebSocket port (default: 81)
- Connect/Disconnect controls
- Real-time status indicator
- Start/Stop streaming
- Live audio visualizer (frequency display)
- Volume control (0-100%)
- Real-time waveform animation
- Latitude/Longitude (6 decimal places)
- Number of satellites
- GPS fix status
- Direct link to Google Maps
- Timestamped event logging
- Color-coded messages (info, success, error, warning)
- Clear logs button
- Auto-scrolling
- ESP32 and your computer/phone on same WiFi
- Find ESP32 IP:
Serial.println(WiFi.localIP());in code - Enter IP in website (e.g.,
192.168.1.100)
- Use a VPN or port forwarding
- Or use a reverse proxy service (ngrok, cloudflare tunnel)
Using ngrok for remote access:
# On your ESP32 computer:
ngrok tcp 81
# Copy the public address and use on website- β Chrome/Edge (latest)
- β Firefox (latest)
- β Safari (iOS 14+)
β οΈ HTTP only works on localhost (no HTTPS limitation on same network)
- Deploy to Netlify (HTTPS)
- Make sure ESP32 and phone are on same WiFi
- Enter ESP32 local IP
- Works on all modern smartphones
- Add authentication to WebSocket
- Use HTTPS with proper SSL certificates
- Implement CORS restrictions
- Add rate limiting to ESP32
- Encrypt sensitive data
Development version is for local/private use.
- Check ESP32 is powered and connected to WiFi
- Verify IP address is correct
- Ensure port 81 is not blocked by firewall
- Check Serial output on ESP32 for errors
- Verify microphone is connected
- Check I2S pins match your setup
- Increase gain if audio is too quiet
- Look for "π€ MIC READY" in ESP32 serial
- Wait 30-60 seconds for GPS lock
- Check GPS module connection
- Verify GPS serial port (default GPIO 16/17)
- Check "π‘ GPS STARTED" in serial output
- Check browser console for errors (F12)
- Verify WebSocket port (default: 81)
- Check firewall settings
- Try disabling VPN/proxy
- Close unnecessary browser tabs
- Use Chrome for best performance
- Reduce audio quality if bandwidth limited
- Disable visualizer if CPU-bound
-
Auto Deploy on Push
- Push to GitHub, Netlify auto-deploys
- No additional configuration needed
-
Custom Domain
- Add domain in Netlify settings
- Free SSL certificate included
-
Analytics
- Netlify provides free analytics
- Check "Analytics" tab in dashboard
-
Environment Variables
- Add in "Site settings" β "Build & deploy" β "Environment"
index.html: ~8KBstyles.css: ~10KBscript.js: ~12KB- Total: ~30KB (very fast load)
Edit styles.css, search for #00ff00 and replace with your color:
- Green terminal:
#00ff00 - Blue:
#0066ff - Purple:
#cc00ff
Edit index.html to add/remove panels in .main-content
Edit script.js to send different commands to ESP32
Improvements welcome! Fork and submit pull requests.
MIT License - Use freely, modify, and distribute.
For issues with:
- Website: Check browser console (F12)
- ESP32: Check Serial Monitor output
- Netlify: Check deployment logs in dashboard
- Files created in
website/folder - ESP32 code updated with GPS broadcasting
- GitHub repo created and files pushed
- Netlify connected to GitHub
- Site deployed successfully
- ESP32 IP entered in website
- Audio connects and plays
- GPS data displays
Built for ESP32 | Ready for Netlify | Made with β€οΈ