Skip to content

aravindasgithub/voting-machine-using-fpga

Repository files navigation

Voting Results Dashboard (Web Serial + Mobile)

A professional voting results system with desktop serial monitoring and mobile access. The desktop dashboard connects to your serial device and broadcasts results to mobile devices via WebSocket.

Features

  • Desktop Dashboard: Web Serial connection to your voting device
  • Mobile Interface: Real-time results accessible from any mobile device
  • Live Updates: WebSocket broadcasting for instant mobile updates
  • Manual Testing: Demo mode and manual input for testing

Quick Start

1. Install Server Dependencies

npm install

2. Start the Server

npm start

The server will show your local IP address for mobile access.

3. Open Desktop Dashboard

  • Open index.html in Chrome/Edge
  • Connect to your serial device (e.g., COM3 at 115200 baud)
  • Send lines like: P1=085,p2=086

4. Access from Mobile

  • Connect your mobile device to the same WiFi network
  • Open browser and go to: http://[YOUR_IP]:3000
  • Results update automatically via WebSocket

Requirements

  • Desktop: Chrome/Edge with Web Serial API support
  • Mobile: Any modern mobile browser (iOS Safari, Chrome Mobile, etc.)
  • Network: Both devices on same WiFi network
  • Serial Device: Sending ASCII lines ending with \n

Data Format

Expected serial output (case-insensitive):

P1=085,p2=086
p1=85,P2=86

Files

  • index.html - Desktop dashboard with serial connection
  • mobile.html - Mobile-optimized interface
  • server.js - HTTP/WebSocket server for broadcasting
  • styles.css - Professional styling
  • script.js - Serial parsing and UI logic
  • package.json - Server dependencies

Troubleshooting

Desktop Issues

  • No COM port: Close Arduino IDE and other serial apps
  • Permission denied: Grant serial access when prompted
  • Web Serial not supported: Use Firefox/Safari fallback (manual input only)

Mobile Issues

  • Can't connect: Check both devices are on same WiFi
  • No updates: Verify server is running (npm start)
  • Wrong IP: Check server console output for correct IP address

Network Issues

  • Firewall: Allow Node.js through Windows Firewall
  • Port 3000: Ensure port 3000 is not blocked
  • Router: Some routers block device-to-device communication

Manual Testing

If you don't have a serial device:

  1. Open desktop dashboard
  2. Expand "Manual/Test Input"
  3. Use "Start Demo" for automatic updates
  4. Or manually enter: P1=010,p2=008

Security Note

This setup is for local network use only. The server accepts connections from any device on your network.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors