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.