The nearable samples yield no results I’ve tried with Stickers, Location and Proximity beacons and there are no scan results. I’m also interested in the debug path, as i see console.log() functions in your samples and a msg_logging flag on your mirror object but I don’t see a path for attaining the logging data.
Do you have any details on how to debug code running on the mirror as well as why the beacon trigger samples are not detecting the beacons?
Mhm, can you double-check if your Proximity/Location beacons have Estimote Telemetry enabled? And for Stickers, they should be set to Nearable packet/broadcasting.
As for debugging, right now it is in fact quite inconvenient, something that we’re well aware of that needs fixing. We have some ideas and even partial implementations … but for now, I’ll have to suggest just showing any debug messages on the TV’s screen. Here’s a little helper function I made for myself when I was working on some Mirror templates:
There is a built-in test template called estimote/scanner. Switch Mirror to it (using SDK or call mirror.selectTemplate('estimote/scanner') from template code) and you should see a list of devices. If there are no devices on the list (and you are sure that there are beacons near by) this might mean that your unit is damaged. If that template shows results this might mean that you have an error in JavaScript that prevents scanner to start.
Thanks @heypiotr and @pober The debug view is really nice to have.
I had a look at the HTML and your sample doesn’t include a height which seems to prevent the text from being displayed.
Everything looks good now, thanks for your suggestions.
I have noticed on my video testing that I get diagonal screen tearing on 480p video, is there anything that can be done to improve the video rendering?
Hi there, I’m having trouble getting my own template for scanning nearby devices working
When I run mirror.selectTemplate('estimote/scanner'); the mirror seems to pick up quite a few devices, but when I use the Scanner API in my own template it’s returning nothing.
As you can see, I’m using the suggested debugPopup from above. It seems to be working fine, but nothing is being logged from inside the onscan listener.
You are calling debugLog instead of debugPopup. debugLog is an internal variable (declared using let) of debugPopup function and won’t be accessible from onscan callback.
Try this code, it should work:
Hi,
I encountered a similar problem with my beacons.
I verified and my beacon have telemetry enabled.
My debug method is debugPopup but my mirror does not enter in “onscan”
However, when I launch “estimote/scanner” template my beacons are found.
here is my code:
debugPopup("Mirror Init");
mirror.init();
mirror.selectTemplate(null);
mirror.setScanFilter({
types: ["telemetry", "nearable"],
ids: [BEACON_ID_1, BEACON_ID_2]
});
mirror.listen(Mirror.Events.SCAN, {
onscan: function (event) {
debugPopup("Scanning");
for (const device of event.devices) {
debugPopup(device.id);
if (device.motion == false) {
continue;
}
}
debugPopup("Motion");
if (device.id == BEACON_ID_1) {
debugPopup("Pink");
}
if (device.id == BEACON_ID_2) {
debugPopup("Yellow");
}
}
});
I would remove the line mirror.selectTemplate(null);. It will make Mirror switch to default template immediately when template is loaded. If this template is the default template then nothing will happen (no need to switch default to default). But in any other case selecting this template will end up with landing on default.
I assume that scanning code from my previous post does not work too and debugPopup displays at least one message?
Described behavior is strange because even if scan filters were bad (did not match anything) you still should get onscan callback (with empty devices). On the other hand if scanned packets are not delivered (for example Bluetooth stack is not working) then estimote/scanner template should show empty list.
Other thing I noticed is that in lines:
if (device.id == BEACON_ID_1) {
debugPopup("Pink");
}
if (device.id == BEACON_ID_2) {
debugPopup("Yellow");
}
You are calling object device that was not declared there. device exists only in for loop. It looks like closing brace } of for loop should be moved before closing brace of onscan function:
mirror.listen(Mirror.Events.SCAN, {
onscan: function(event) {
debugPopup("Scanning");
for (const device of event.devices) {
debugPopup(device.id);
if (device.motion == false) {
continue;
}
debugPopup("Motion");
if (device.id == BEACON_ID_1) {
debugPopup("Pink");
}
if (device.id == BEACON_ID_2) {
debugPopup("Yellow");
}
}
}
});
Anyway I tested code on several Mirrors (after removing mirror.selectTemplate(null);)
and it worked without problems. There might me something wrong in the template code that was not posted here and it might be affecting scanning.
BTW. Identifiers are case sensitive. Make sure they are lowercase and without trailing/leading white spaces.
What firmware version your Mirror is running (you can check that in cloud console)?
When WiFi is configured and working Mirror will update itself automatically. You will see a message that a new firmware is available and you need to reboot the device to install it.
Unfortunately, seems that the code cannot start onscan function (got only Mirror Init message on the screen). Any clues what I’m doing wrong? Estimote Mirror software version 1.09. Template estimote/scanner works and show beacons and bluetooth devices in the neighbourhood.
I copy-pasted your code into Mirror with firmware 1.0.9 and it shows Scanning message all over the screen. Of course it does not return any devices because IDs in filters are not set properly.
Here are some steps that might help you:
Update your firmware to latest version (should be 1.0.15 right now)
Use built-in debugPopup and redirectConsoleToPopup. See API documentation
Check your code for typos or copy paste code from forum. Try to comment out filters setup.