bluetoothscanner
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
index.ts
https://dcm31--edb10f4e417f11f0ac1876b3cceeab13.web.val.run
A web-based Bluetooth device scanner that uses the Web Bluetooth API to discover and display information about nearby Bluetooth devices.
- 🔍 Device Discovery: Scan for nearby Bluetooth devices
- 📱 Device Information: Display device names, IDs, and connection status
- 🕒 Real-time Updates: Shows when devices were discovered
- 🧹 Clear Function: Easy way to clear the device list
- 📊 Device Counter: Keep track of how many devices have been found
- 🎨 Responsive Design: Works on desktop and mobile devices
This app uses the Web Bluetooth API, which is supported in:
- ✅ Chrome (desktop and Android)
- ✅ Edge (desktop and Android)
- ✅ Opera (desktop and Android)
- ❌ Firefox (not supported)
- ❌ Safari (not supported)
Due to privacy and security restrictions in the Web Bluetooth API:
- MAC addresses are not directly accessible through the Web Bluetooth API
- Device information is limited to what the device chooses to advertise
- Users must explicitly grant permission to access each device
- The API requires user interaction (button click) to initiate scanning
- User Interaction Required: Click "Start Scan" to begin device discovery
- Permission Dialog: Browser will show a device selection dialog
- Device Selection: Choose a device from the list to add it to your scanner
- Device Information: Basic information about the selected device is displayed
- Connection Attempts: The app tries to connect to get additional device details
- Built with vanilla JavaScript and the Web Bluetooth API
- Uses TailwindCSS for styling
- Responsive design with mobile-first approach
- Error handling for unsupported browsers and connection issues
- Open the app in a supported browser
- Click "Start Scan" to begin scanning
- Select devices from the browser's permission dialog
- View discovered devices in the list
- Use "Clear" to remove all devices from the list
- Cannot perform passive scanning (requires user interaction for each device)
- Limited device information available due to privacy restrictions
- MAC addresses are not accessible through the Web Bluetooth API
- Some devices may not be discoverable or may require specific pairing procedures
For more advanced Bluetooth scanning capabilities, consider using native mobile apps or desktop applications with appropriate system permissions.