cancel
Showing results for 
Search instead for 
Did you mean: 

WICED Smart Bluetooth

Anonymous
Not applicable

I'm having issues with a simple python script that will tell me if a bluetooth device is present or not. It'll work with my iphone and also a bluetooth dongle inside my computer but I can't connect to the Sense Kit. Any help would be appreciated. I can see the bluetooth MAC address when using a bluetooth scanner like "BluetoothView" but when I put the MAC address inside the code it won't recognize it.

Here is an example of the python scipt I'm using:

result = bluetooth.lookup_name (1C:66:AA:CF:DD:35', timeout=5)

if (result != None):

     print "HERE"

else:

     print "MISSING"

I'm putting in the MAC address for the WICED SENSE that I see using a bluetooth scanning tool but for some reason it won't allow it to see it's MAC Address in the python scipt and always retuns the value for "Missing" but sees my Iphone and Dongle.

0 Likes
Reply
1 Solution
Anonymous
Not applicable

Thanks, I figured it out. I had no problem seeing the wiced sense advertised with bluetooth scanner and my iphone but I'm trying to see it with raspberry pi. The pi will see other bluetooth devices like my phone and pc (bluetooth dongle) but would not discover the MAC address of the Wiced Sense when using hcitool.

Here is the working updated the script that allows to me see the MAC address of the Wiced Sense and verify it is nearby:

#!/usr/bin/python

import bluetooth

target_name = "My Bluetooth Device"

target_address =('MAC Address')

nearby_devices = bluetooth.discover_devices()

for bdaddr in nearby_devices:

        if target_name == bluetooth.lookup_name( bdaddr 😞

                target_address = bdaddr

                break

if target_address is not None:

        print "found bluetooth device with address ", target_address

else:

        print "could not find target bluetooth device nearby"

Thanks,

David

View solution in original post

0 Likes
Reply
2 Replies
Anonymous
Not applicable

Hello David,

Try to use the WICED Sense Kit App on the iPhone to see if you can connect to the WICED Sense Kit App.

Then you will know that the WICED Sense Kit is advertising.

THanks

JT

0 Likes
Reply
Anonymous
Not applicable

Thanks, I figured it out. I had no problem seeing the wiced sense advertised with bluetooth scanner and my iphone but I'm trying to see it with raspberry pi. The pi will see other bluetooth devices like my phone and pc (bluetooth dongle) but would not discover the MAC address of the Wiced Sense when using hcitool.

Here is the working updated the script that allows to me see the MAC address of the Wiced Sense and verify it is nearby:

#!/usr/bin/python

import bluetooth

target_name = "My Bluetooth Device"

target_address =('MAC Address')

nearby_devices = bluetooth.discover_devices()

for bdaddr in nearby_devices:

        if target_name == bluetooth.lookup_name( bdaddr 😞

                target_address = bdaddr

                break

if target_address is not None:

        print "found bluetooth device with address ", target_address

else:

        print "could not find target bluetooth device nearby"

Thanks,

David

View solution in original post

0 Likes
Reply