Scan for new buttons and connect to HUB over SDK
sasha.milic last edited by sasha.milic
I have hub with enabled SDK. Successfully login to https://hubsdk.flic.io/
Also I have fresh new button that is not connected to anything (aether HUB or the phone).
When I use COMMAND PROMPT (scan) to scan for single button, it's not showing the anything. It's just scanning until I issue command (stopScan). No buttons are found.
- What is procedure (and/or code example) for adding fresh new buttons to HUB..?
- In the MDM solution (https://dm.flic.io/) in field "Buttons - Button pairings JSON" what structure I should add. (some example is will be very much helpful)?
Thank you very much in advance..!!!
sasha.milic last edited by
@Emil Thanks for explanation.
I also managed to figure out what JSON structure is going for MDM under point 3.
Basically I export pairings from dev hub and if we use those buttons on managed hub I just paste "buttons pairings" json in to the field.
- Just use the scan wizard as you do (call startScanWizard() on the buttons module). What I think you forget is that you must hold down the button for at least 1.5 or 6 seconds depending on if it's brand new or has been paired before. Otherwise it won't be discovered.
- No you don't need to pair with phone first.
- See https://hubsdk.flic.io/static/documentation/ under importFlic2Pairings. The "pairings" structure is what you should write. Oskar should have given you the info you need for this.