Simple HTML interface to run scripts on your Raspberry Pi via SSH.
npm installnpm startThe server will run on http://localhost:3000
Simply open index.html in your browser, or host it on GitHub Pages.
- Frontend: Simple HTML page with JavaScript that sends requests to the backend
- Backend: Node.js server that handles SSH connections to your Pi
- The backend runs the command in the background on your Pi so the response is instant
- Run
npm starton your computer - Open
index.htmlin your browser - Click the button to control your Pi
- Push
index.htmlto a GitHub repository - Enable GitHub Pages for that repo
- Run
npm starton your computer - Access the GitHub Pages URL
- Note: You'll need to update the
API_URLinindex.htmltohttp://localhost:3000/run-script
Deploy the backend to services like:
- Railway.app (free tier available)
- Render.com (free tier available)
- Heroku
- Your own server
Then update the API_URL in index.html to your deployed backend URL.
Edit the default values in index.html or change them in the interface:
- Pi IP Address: Your Raspberry Pi's IP (e.g.,
100.94.110.127) - Username: Your Pi username (e.g.,
casperadamus) - Password: Your Pi password
- Command: The command to run (e.g.,
python3 lighton.py)
For better security:
- Use SSH keys instead of passwords
- Deploy the backend with HTTPS
- Don't hardcode credentials in the HTML
"Error connecting to server"
- Make sure the Node.js server is running (
npm start) - Check that the
API_URLinindex.htmlmatches your server address
"Failed to connect to Pi"
- Verify the Pi's IP address is correct
- Check that SSH is enabled on your Pi
- Ensure your Pi is on the same network (or use Tailscale if you're using that)
"Connection timeout"
- Your Pi might be offline or unreachable
- Check firewall settings