-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Thank you for your work!
I tried your lib today, but sadly, my nuimo was not found.
I can find my device (name: "Nuimo") with noble on my windows machine, using the advertising example of noble from
https://github.com/noble/noble/blob/master/examples/advertisement-discovery.js
But in your script, noble found no devices at all:
file: dist/discovery/discovery.js
startDiscoverySession(options) {
// Initial discovery requires events to be registered
if (this.managerDiscoveryState === device_discovery_state_1.DeviceDiscoveryState.Initial) {
// TODO: Should we account for BT initialization for timeouts?
this.initializeBluetooth();
noble.on('discover', (peripheral) => {
console.log("THIS MESSAGE NEVER LOGGED") // <-----------------------------------------------------------
const isNuimoDevice = (peripheral.advertisement.localName === 'Nuimo');
if (isNuimoDevice) {
[... ]
I do not know exactly the meaning of "DEVICE_ID" in your example. So I leave it undefined:
// Uncomment to search for only your device
// ENTER DEVICE_ID to discover only a particular device
const DEVICE_ID: string | undefined = undefined
/**
* Main application entry point
*/
async function main() {
const device = await connectToDevice(DEVICE_ID)
// Create a custom Glyph
// Nuimo Control has a 9x9 LED display, but you only need to create what you need
// and use `GlyphAlignment` to align the glyph on display
const glyph = Glyph.fromString([
' * ',
' *** ',
' *** ',
' *** ',
'*****',
'** **',
'* * *',
])
// Display the glyph for 5 seconds
device.displayGlyph(glyph, {
alignment: GlyphAlignment.Center, // Center align (default)
brightness: 1, // Display brightness
transition: DisplayTransition.CrossFade, // Fade in/out
timeoutMs: 5000, // Timeout after 5 seconds
})
}
// Boot strap async function
bootstrap(main)
the console logs "Waiting for device..." at least.
I read a bit of your code. Maybe you forgot to run the method noble.startScanning() when no devide_id was specified?
Thank you.
Oliver
Metadata
Metadata
Assignees
Labels
No labels