lancaster-university / microbit-dal

http://lancaster-university.github.io/microbit-docs
Other
255 stars 130 forks source link

advertiseEddystoneUrl connectable as true may not work #248

Closed OwenBrotherwood closed 7 years ago

OwenBrotherwood commented 7 years ago

The examples that I have seen for advertiseEddystoneUrl have had connectable as false. (Edit: default is true)

Currently, no success with having it set to true and seeing a beacon

https://github.com/lancaster-university/microbit-dal/blob/12bf127ae28c93498a5d3cf50894866496d9d335/source/bluetooth/MicroBitBLEManager.cpp#L515

jamesadevine commented 7 years ago

What does your config look like?

OwenBrotherwood commented 7 years ago

Hi James, I wish I could give a quick answer: the actual config is under the pxt-microbit layers so it is could be hard to find :( :: "I will try".

Before opening this issue, I wanted to produce something via https://developer.mbed.org/compiler/#nav:/; but have failed in finding a library that supports eddystone so far. Any advice on a successful usage of mbed would be great to create a simple case to check the connectable parameter would be great, otherwise "I will try again"

pelikhan commented 7 years ago

Working on dump module.json into the built/ folder in PXT to diagnose this kind of issues.

OwenBrotherwood commented 7 years ago

And I am still failing with my efforts on mbed. Found a team site, but so far nothing to import for a basic example of eddystone that just works https://developer.mbed.org/teams/microbit/code/

jamesadevine commented 7 years ago

Hey Owen,

I'm on mobile at the moment. Eddystone was only released on Tuesday, so it will take a couple of cycles to be picked up.

Have you tried yotta?

Best,

James.

On 5 Dec 2016, at 20:00, Owen Brotherwood notifications@github.com<mailto:notifications@github.com> wrote:

And I am still failing with my efforts on mbed. Found a team site, but so far nothing to import for a basic example of eddystone that just works https://developer.mbed.org/teams/microbit/code/

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/lancaster-university/microbit-dal/issues/248#issuecomment-264960401, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AEheKSBUd_vK0n053ha4DitpzEFZMiUIks5rFG1jgaJpZM4LEmPm.

OwenBrotherwood commented 7 years ago

I will try and get yotta to work: currently on Windows 10 but I have a virtual machine I can power up. I get back after a yotta experience using the on-line material for Windows and/or Linux https://lancaster-university.github.io/microbit-docs/offline-toolchains/

OwenBrotherwood commented 7 years ago

yotta Windows 10 "Hello world" went well. However https://github.com/lancaster-university/microbit-samples/tree/master/source/examples/bluetooth-eddystone-url failed. I copyed the example into the source folder and clean then build as per README.md'en

I will try some other examples while I am at it :)

C:/Users/owen/microbit-samples/source/main.cpp: In function 'void startAdvertising()':
C:/Users/owen/microbit-samples/source/main.cpp:12:21: error: 'class MicroBitBLEManager' has no member named 'advertiseEddystoneUrl'
     uBit.bleManager.advertiseEddystoneUrl(URL, CALIBRATED_POWERS[tx_power_level-1], false);
                     ^
ninja: build stopped: subcommand failed.
error: command ['ninja'] failed
jamesadevine commented 7 years ago

Hey Owen,

I'll look in a bit!

Best,

James.

On 5 Dec 2016, at 20:52, Owen Brotherwood notifications@github.com<mailto:notifications@github.com> wrote:

yotta Windows 10 "Hello world" went well. However https://github.com/lancaster-university/microbit-samples/tree/master/source/examples/bluetooth-eddystone-url failed. I copyed the example into the source folder and clean then build as per README.md'en

I will try some other examples while I am at it :)

C:/Users/owen/microbit-samples/source/main.cpp: In function 'void startAdvertising()': C:/Users/owen/microbit-samples/source/main.cpp:12:21: error: 'class MicroBitBLEManager' has no member named 'advertiseEddystoneUrl' uBit.bleManager.advertiseEddystoneUrl(URL, CALIBRATED_POWERS[tx_power_level-1], false); ^ ninja: build stopped: subcommand failed. error: command ['ninja'] failed

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/lancaster-university/microbit-dal/issues/248#issuecomment-264973597, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AEheKUYZAyWEIeb69bUR4DxSSf5InBWvks5rFHmKgaJpZM4LEmPm.

jamesadevine commented 7 years ago

Off the top of my head, have you copied config.json into the root of microbit-samples?

Best,

James.

On 5 Dec 2016, at 20:52, Owen Brotherwood notifications@github.com<mailto:notifications@github.com> wrote:

yotta Windows 10 "Hello world" went well. However https://github.com/lancaster-university/microbit-samples/tree/master/source/examples/bluetooth-eddystone-url failed. I copyed the example into the source folder and clean then build as per README.md'en

I will try some other examples while I am at it :)

C:/Users/owen/microbit-samples/source/main.cpp: In function 'void startAdvertising()': C:/Users/owen/microbit-samples/source/main.cpp:12:21: error: 'class MicroBitBLEManager' has no member named 'advertiseEddystoneUrl' uBit.bleManager.advertiseEddystoneUrl(URL, CALIBRATED_POWERS[tx_power_level-1], false); ^ ninja: build stopped: subcommand failed. error: command ['ninja'] failed

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/lancaster-university/microbit-dal/issues/248#issuecomment-264973597, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AEheKUYZAyWEIeb69bUR4DxSSf5InBWvks5rFHmKgaJpZM4LEmPm.

OwenBrotherwood commented 7 years ago

I want to repeat the procedure, but having the config.json in the root and not the source dir (together with main.cpp) gave no errors ... but I cannot find the hex either :)

"I will try again" both with the eddystone url and one of the examples that has worked to make sure I have enough practise.

OwenBrotherwood commented 7 years ago

https://github.com/lancaster-university/microbit-samples README.md does state the config.json should be in the root: I hadn't gotten that far in reading. It probably triggers the inclusion of the correct libraries needed.

OwenBrotherwood commented 7 years ago

true or false? both work and the config used (from the example) is the same as the example. Thanks James: I think it is back to the pxt-microbit board again ( I can see that pelikhan has merged some debugging help into the pxt repro


config.json that works with true or false


{
    "microbit-dal": {
        "bluetooth": {
            "enabled": 1,
            "pairing_mode": 0,
            "private_addressing": 0,
            "open": 0,
            "whitelist": 0,
            "advertising_timeout": 0,
            "tx_power": 0,
            "dfu_service": 0,
            "event_service": 0,
            "device_info_service": 0,
            "eddystone_url": 1,
            "eddystone_uid": 0
        },
        "gatt_table_size": "0x600"
    }
}
pelikhan commented 7 years ago

Ø "open": 0,

Does it work with open: 1?

From: Owen Brotherwood [mailto:notifications@github.com] Sent: Monday, December 5, 2016 1:29 PM To: lancaster-university/microbit-dal microbit-dal@noreply.github.com Cc: Peli de Halleux jhalleux@microsoft.com; Comment comment@noreply.github.com Subject: Re: [lancaster-university/microbit-dal] advertiseEddystoneUrl connectable as true may not work (#248)

true or false? both work and the config used (from the example) is the same as the example. Thanks James: I think it is back to the pxt-microbit board again ( I can see that pelikhan has merged some debugging help into the repro


config.json that works with true or false

{

"microbit-dal": {

    "bluetooth": {

        "enabled": 1,

        "pairing_mode": 0,

        "private_addressing": 0,

        "open": 0,

        "whitelist": 0,

        "advertising_timeout": 0,

        "tx_power": 0,

        "dfu_service": 0,

        "event_service": 0,

        "device_info_service": 0,

        "eddystone_url": 1,

        "eddystone_uid": 0

    },

    "gatt_table_size": "0x600"

}

}

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Flancaster-university%2Fmicrobit-dal%2Fissues%2F248%23issuecomment-264982820&data=02%7C01%7Cjhalleux%40microsoft.com%7C43fa6f5833c442087c8a08d41d55b348%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636165701292086228&sdata=u%2FVn%2FmI%2FRWE07NdrIvJCTRy6a8ezrVpkID67WYK35nM%3D&reserved=0, or mute the threadhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAD-4KSgvvPC4b87Dli8SskjZp-UgCFDyks5rFIIPgaJpZM4LEmPm&data=02%7C01%7Cjhalleux%40microsoft.com%7C43fa6f5833c442087c8a08d41d55b348%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636165701292086228&sdata=FpoUZ62RVzBd8hFbGrwnHHxY3gqkomOhDOFzKJpmH6A%3D&reserved=0.

OwenBrotherwood commented 7 years ago

@pelikhan I will try with open:1

OwenBrotherwood commented 7 years ago

@pelikhan I found a yotta.json in the bluetooth build of pxt-microbit which is probably now the answer to Jame's original question about what the config looks like, so I put it here for completeness:


{
  "config": {
    "microbit-dal": {
      "bluetooth": {
        "enabled": 1,
        "private_addressing": 0,
        "whitelist": 1,
        "advertising_timeout": 0,
        "tx_power": 6,
        "dfu_service": 1,
        "event_service": 1,
        "device_info_service": 1,
        "eddystone_url": 1,
        "eddystone_uid": 0,
        "pairing_mode": 1,
        "open": 0,
        "security_level": "SECURITY_MODE_ENCRYPTION_NO_MITM"
      }
    },
    "gatt_table_size": "0x700"
  },
  "dependencies": {
    "microbit": "lancaster-university/microbit#v2.0.0-rc7"
  }
}
OwenBrotherwood commented 7 years ago

0 and 1 both work (also with true ar false)

jamesadevine commented 7 years ago

@OwenBrotherwood @pelikhan For this to work, based on the PXT config provided above, whitelisting needs to be disabled. Otherwise, you will only be able to see the micro:bit's advertisements if you are bonded.

jamesadevine commented 7 years ago

@OwenBrotherwood Could you summarise your findings? Does true/false work for Eddystone in the microbit-samples repo?

OwenBrotherwood commented 7 years ago

Summary:

A big thanks for your help: it helped to quickly find where the problem lies. Peli has enabled some debugging in the pxt-microbit project that allows quicker findings of problems. I have now gotten a yotta installation local: which is good for ensuring where possible problems are to be found. I will be testing interval and power from yotta to check it is good and also how pxt-microbit gets "fixed" for beacons with tests that can hopefully help Peli.

Note: I am a community contributor to pxt/pxt-microbit: my projects are on http://microbit-drill.org/ with The Great Treasure Hunt being a request from someone in Denmark for beacons in Blocky/pxt as the driving force for getting beacons to work. https://github.com/microbit-drill/epxt encapsulates pxt-microbit to allow offline and pre-release use of features direct from MS github for pxt/pxt-microbit.

farooqhasny commented 7 years ago

thanks @OwenBrotherwood placing config.json worked for me which yotta but now i am getting the same error for plateformio src\main.cpp:16:21: error: 'class MicroBitBLEManager' has no member named 'advertiseEddystoneUrl' any ideas ??? much appreciated

thanks

jamesadevine commented 7 years ago

@farooqhasny We don't maintain the platformio fork, but I would imagine it is out of date. 😞