I am working on connecting the blend micro to a python script running on a raspberry pi.
As of now I am able to 'connect' them, but I am not able to send and receive data.
The Code for the micro is the HelloWorld Example. I just added this line
For the raspberry i use the bluepy modul: http://ianharvey.github.io/bluepy-doc/index.html#
Code for raspberry is:
data = dict([(desc, value) for (adtype, desc, value) in dev.getScanData()])
return data.get("Complete Local Name")
def handleDiscovery(self, dev, isNewDev, isNewData):
if isNewDev and getCompleteLocalName(dev) == "My BLE":
print "DISCOVERED MY BLE"
if isNewData and getCompleteLocalName(dev) == "My BLE":
print "Received new data from", dev.addr
print "init peri"
def handleNotification(self, cHandle, data):
scanner = Scanner().withDelegate(ScanDelegate())
devices = scanner.scan(5.0)
if __name__ == "__main__":
for dev in devices:
if getCompleteLocalName(dev) == "My BLE":
print "Creating Peripheral"
peri = Peripheral(dev)
print "There is something"
# handleNotification() was called
Output from the python program is:
Received new data from db:b6:4d:4e:d6:0b
And the output from my arduino serial monitor:
Evt Pipe Status
So it looks like that there is a connection, but no communication.
How can i see the data in my script?
Thanks in advance.