Lixie-Labs / Emotiscope

Let your eyes enjoy the music too ✨ Extremely low-latency audio processing lets LEDs perfectly synchronize to your music's notation and tempo.
GNU General Public License v3.0
27 stars 5 forks source link

HELP WANTED - The web app cannot yet use SSL #86

Open connornishijima opened 2 months ago

connornishijima commented 2 months ago

Emotiscope uses the PsychicHTTP Arduino library. It's a swiss army knife that handles a whole HTTP server, websockets server, and more.

However, I haven't figured out its coolest feature: HTTPS/SSL.

Like, I know how I'm supposed to implement it, and have a server cert and key, but it just doesn't work.

A potential reason it doesn't work is the madness going on with my platformio.ini. For the sake of the I2S microphone and the new RMT LED driver, I needed an Arduino framework in PlatformIO that used ESP-IDF 5.x. The Arduino for ESP32 3.0.0-beta uses IDF 5.x, so Emotiscope was built on that. But because that IDF port is in beta, maybe the SSL/encryption side of the PsychicHTTP library isn't happy about that.

So currently, the SSL-enabled "app.emotiscope.rocks" page redirects you to a plain HTTP webserver running on your Emotiscope, since you can't send websockets commands from an HTTPS page to an unsecured one.

Honestly though, PsychicHTTP is now the only thing left in the system that explicitly requires an Arduino framework. Here's an idea:

Some time down the road, I want to port Emotiscope to ESP-IDF (No PlatformIO) and use only the IDF to enable an encrypted wss:// connection between the HTML page @ app.emotiscope.rocks and Emotiscope. That way, Emotiscope doesn't spend CPU cycles hosting an entire webserver off of itself while it runs, the code for the Emotiscope web-app is already open-source right now, it would just be hosted online instead, or by yourself remotely.

OR...

If I can get SSL working on PsychicHTTP I can skip all of that entirely and still host the web app from Emotiscope itself.

Questions For You: