tag:blogger.com,1999:blog-35352432.post8443655380379597991..comments2023-02-17T09:05:28.935+00:00Comments on Michael Saunby: Raspberry Pi and TI CC2541 SensorTagAnonymoushttp://www.blogger.com/profile/00899702935992577808noreply@blogger.comBlogger56125tag:blogger.com,1999:blog-35352432.post-57504674123078326072016-06-10T07:34:18.352+01:002016-06-10T07:34:18.352+01:00Hello all,
I am trying to connect the raspberry p...Hello all,<br /><br />I am trying to connect the raspberry pi to BLE device for getting data and write data.<br /><br />I am facing problem while connecting device in non-interactive mode via shell script on ubuntu. When I send "sudo gatttool -b DB:8B:9B:DA:E8:CB -I" then its entered in interactive shell. And now I want to send connect command inside the script but nothing is happening. I am sending the connect command like this - <br />sudo gatttool -i hci0 -b EA:74:48:D5:52:6B --interactive <<< connect<br /><br />but after that it is leaving the interactive shell and return back to the state where I place command to run the script. <br /><br />I make sh file like connect.sh and place script inside this. and then execute the sh file via bash connect.sh<br /><br />Can anyone help me out with this.<br /><br />Thanks,Anonymoushttps://www.blogger.com/profile/03381187078899457019noreply@blogger.comtag:blogger.com,1999:blog-35352432.post-75547073631386799532015-09-14T10:41:19.702+01:002015-09-14T10:41:19.702+01:00Hello all,
I am trying to connect a sensortag cc2...Hello all,<br /><br />I am trying to connect a sensortag cc2541 to a raspberry pi 2. I installed bluez5.7 and am trying to start a connection using the gatttool, but I keep getting the same error message:<br />Error: connect: connection refused (111)<br />It's been like this for three days. Please help!<br /><br />Any idea or advice is much appreciatedAnonymoushttps://www.blogger.com/profile/06960425780667871448noreply@blogger.comtag:blogger.com,1999:blog-35352432.post-1676316236488619722015-09-14T10:37:54.576+01:002015-09-14T10:37:54.576+01:00Hello all,
I am trying to connect my sensor tag c...Hello all,<br /><br />I am trying to connect my sensor tag cc2541 to raspberry pi2. I have installed Bluez5.7 and have trying to start a connection for three days but all in vain<br />I keep getting the same error message:<br />Error: connect: connection refused (111)<br /><br />Could you please help? any Idea or advice is much appreciatedAnonymoushttps://www.blogger.com/profile/06960425780667871448noreply@blogger.comtag:blogger.com,1999:blog-35352432.post-10652450018288913202015-08-31T19:42:28.685+01:002015-08-31T19:42:28.685+01:00Other Linux systems should work fine. I've us...Other Linux systems should work fine. I've used a laptop running Ubuntu with SensorTag. Just ensure your Bluetooth adaptor handles BLE.Anonymoushttps://www.blogger.com/profile/00899702935992577808noreply@blogger.comtag:blogger.com,1999:blog-35352432.post-55613422463858216352015-08-31T14:11:46.767+01:002015-08-31T14:11:46.767+01:00Is it possible to make Sensortag directly work wit...Is it possible to make Sensortag directly work with a Linux terminal rather trough a raspberry pi ?Anonymoushttps://www.blogger.com/profile/13046501221252763874noreply@blogger.comtag:blogger.com,1999:blog-35352432.post-89597275347537923312015-08-30T00:37:10.037+01:002015-08-30T00:37:10.037+01:00Hi all,
Thanks for the informative post. I was g...Hi all,<br /><br />Thanks for the informative post. I was going through but I kept getting "Connection refused (111)" after the connect command in gatttool.<br /><br />Any advice is much appreciated.Anonymoushttps://www.blogger.com/profile/01467703400524558531noreply@blogger.comtag:blogger.com,1999:blog-35352432.post-31185750929596692092015-04-16T07:14:48.600+01:002015-04-16T07:14:48.600+01:00If you want to talk to the devices with Python, yo...If you want to talk to the devices with Python, you can just use dbus to ask bluetoothd to perform all those operations on your behalf. Some guys from Google just contributed a bunch of new code to BlueZ, including some Python code in BlueZ 5.30 in test/example-gatt-client that shouw you how to talk directly to bluetoothd.<br /><br />You don't have to spawn gatttool in a subprocess, which is sort of iffy with the way it uses readline() to do terminal updates.Vagranthttps://www.blogger.com/profile/04226540044105059655noreply@blogger.comtag:blogger.com,1999:blog-35352432.post-40902922990287294912015-03-04T16:25:20.074+00:002015-03-04T16:25:20.074+00:00Hi,
thanks for this tutorial.
I followed all the s...Hi,<br />thanks for this tutorial.<br />I followed all the steps but when i start:" python sensortag.py " i get Preparing to connect.....<br />I pushed the side-button but nothing happens. I was able to read values from the sensortag with the gatttool. What could be the reason, why it does not work?<br />Thanks.Ghoddanhttps://www.blogger.com/profile/18431052731752804411noreply@blogger.comtag:blogger.com,1999:blog-35352432.post-82334002975978492272015-01-31T17:18:26.244+00:002015-01-31T17:18:26.244+00:00Hi,
did anyone has find a definitive solution for ...Hi,<br />did anyone has find a definitive solution for 180 sec standby? i wann use this device to put it in a remote location, and sometimes natural event-based check some data but presso side button is not simple.<br />I tried some test but i have not the raspberry BT so tested with my android S4 but when open the firmware page device sensor-kit reset.<br />Also, can someone what is A and B firmware? are alternative each other? how i can boot with A or B firmware?<br /><br />sorry for multiple question :-) <br /><br />MarcoAnonymoushttps://www.blogger.com/profile/06440208130010721142noreply@blogger.comtag:blogger.com,1999:blog-35352432.post-10176636690575419562015-01-05T19:52:43.514+00:002015-01-05T19:52:43.514+00:00I found your sample code for reading ambient and o...I found your sample code for reading ambient and object temperature in python. However, i don't completely understand this:<br /><br />tosigned = lambda n: float(n-0x10000) if n>0x7fff else float(n)<br /><br />How i read the above piece of code:<br />if n>0x7fff: n = float(n-0x10000)<br />else n = float(n)<br /><br />Basically what is happening is that the two's complement value is converted to float. Why should this only happen when the value of n is greater than 0x7fff? If the value is 0x7fff or smaller, then we just convert i to float. Why? I don't understand this.Anonymoushttps://www.blogger.com/profile/17556501760506049866noreply@blogger.comtag:blogger.com,1999:blog-35352432.post-60409894892041620972014-12-26T21:44:59.569+00:002014-12-26T21:44:59.569+00:00I see only part of the connection process is done ...I see only part of the connection process is done with pexpect...can the entire process be done with pexpect (such as lescan and lecc)...I tried it myself without much luck yet (don't know much about pexpect).<br /><br />address do the following -<br />sudo hciconfig hci0 up<br />sudo hcitool lescan <br /><br /><br />Press the side button and you should get a couple of lines showing the device is working. Hit Ctrl-C to exit. Now you're ready to gAnonymoushttps://www.blogger.com/profile/00707139992593361274noreply@blogger.comtag:blogger.com,1999:blog-35352432.post-338336998289577562014-12-16T08:56:11.618+00:002014-12-16T08:56:11.618+00:00I see you are using pexpect to "shell out&qu...I see you are using pexpect to "shell out" & use the command line...is there a reason the following commands are not included in this shell process (to make the connecting process fully under program control)?<br /><br />To enable the bluetooth adaptor and find your SensorTag device address do the following -<br /><br />sudo hciconfig hci0 up<br />sudo hcitool lescan <br /><br />python sensortag.py [ADDRESS]Anonymoushttps://www.blogger.com/profile/00707139992593361274noreply@blogger.comtag:blogger.com,1999:blog-35352432.post-5345045810443338972014-11-13T03:42:23.324+00:002014-11-13T03:42:23.324+00:00if i want to make multiple connections simultaneou...if i want to make multiple connections simultaneously then how would the procedure be altered? for now i am doing something like this:<br /><br />gatttool -b 90:45:ER:34:56 - I<br /><br />connect<br />char-read-hnd 0x25<br />char-write-cmd 0x29 01<br />char-read-hnd 0x25<br /><br />It shows some values like ae 23 er uk <br />I am a newbie playing with BLE. I would really appreciate some guidance<br />Anonymoushttps://www.blogger.com/profile/05894669753335078952noreply@blogger.comtag:blogger.com,1999:blog-35352432.post-41151313778687422512014-05-15T21:43:44.187+01:002014-05-15T21:43:44.187+01:00See SensorTag and Raspberry Pi revisited for an up...See <a href="http://mike.saunby.net/2014/04/sensortag-and-raspberry-pi-revisted.html" rel="nofollow">SensorTag and Raspberry Pi revisited</a> for an update on this post and <a href="https://github.com/msaunby/ble-sensor-pi/tree/master/sensortag" rel="nofollow"> https://github.com/msaunby/ble-sensor-pi/tree/master/sensortag</a> for the code.Anonymoushttps://www.blogger.com/profile/00899702935992577808noreply@blogger.comtag:blogger.com,1999:blog-35352432.post-32202277647723349032014-05-15T21:13:25.611+01:002014-05-15T21:13:25.611+01:00II was never able to get this to work. It always s...II was never able to get this to work. It always said the same thing as above.yozhhttps://www.blogger.com/profile/00594416926669555675noreply@blogger.comtag:blogger.com,1999:blog-35352432.post-16840188939250698122014-04-21T23:00:06.183+01:002014-04-21T23:00:06.183+01:00This info has got me from zero to a long ways, pai...This info has got me from zero to a long ways, pairing and reading data from the command line etc. Thank you! But I have been stuck for awhile now trying to get sensortag.py working for me. (Apr 2013version) It hangs at from sensor_calcs Import*<br />Can't find that module. Is that module something you wrote or should it have been part of gatttool or bluez install?Davehttps://www.blogger.com/profile/12201813845747644002noreply@blogger.comtag:blogger.com,1999:blog-35352432.post-13836083111759147902014-04-19T15:13:53.507+01:002014-04-19T15:13:53.507+01:00thank you very much for this tutorial.
i am trying...thank you very much for this tutorial.<br />i am trying to run this on an ubuntu machine. how do i compile bluez-5.4 for linux and amd processor?<br />the gatttool doesn't work when i just make at the directory.<br />i would appreciate any helpAnonymoushttps://www.blogger.com/profile/03165688277718696840noreply@blogger.comtag:blogger.com,1999:blog-35352432.post-79839256821493432802014-04-10T09:37:57.117+01:002014-04-10T09:37:57.117+01:00yozh, you're getting an exception which the s...yozh, you're getting an exception which the script thinks is a timeout, but could be something else - a missing library, a typo. If you've some Python coding skills you'll get there pretty quickly once you dive into the code.<br /><br />To simplify things have a look at the script https://github.com/msaunby/ble-sensor-pi/blob/master/sensortag/sensortag_xively.py<br /><br />Maybe comment out the xively_init() and xively_write() lines.<br /><br />If it's not working for you the "restart" stuff isn't helping you, and this script doesn't do that.<br /> Anonymoushttps://www.blogger.com/profile/00899702935992577808noreply@blogger.comtag:blogger.com,1999:blog-35352432.post-27838517112452200222014-04-10T02:44:04.304+01:002014-04-10T02:44:04.304+01:00This comment has been removed by a blog administrator.yozhhttps://www.blogger.com/profile/00594416926669555675noreply@blogger.comtag:blogger.com,1999:blog-35352432.post-77030083581381818692014-04-10T02:44:03.765+01:002014-04-10T02:44:03.765+01:00Michael,
Is there anyway you can help with this ...Michael, <br /><br />Is there anyway you can help with this ? I need to use this for a project Im building and I have been stuck forever on this. Seems that somehow your script is not returning results, and I do see gatttool running in ps aux when I execute the script. I also able to run gattool manually and get results. yozhhttps://www.blogger.com/profile/00594416926669555675noreply@blogger.comtag:blogger.com,1999:blog-35352432.post-52176043470936953492014-04-09T02:11:24.744+01:002014-04-09T02:11:24.744+01:00not sure what else to do anything I try I keep jus...not sure what else to do anything I try I keep just getting:<br />re]starting..<br />Preparing to connect. You might need to press the side button...<br />char-write-cmd 0x29 01<br />char-write-cmd 0x26 0100<br />char-write-cmd 0x31 01<br />char-write-cmd 0x2e 0100<br />char-write-cmd 0x3c 01<br />char-write-cmd 0x39 0100<br />char-write-cmd 0x44 01<br />char-write-cmd 0x41 0100<br />char-write-cmd 0x5b 07<br />char-write-cmd 0x58 0100<br />char-write-cmd 0x4f 02<br />[re]starting..<br />Preparing to connect. You might need to press the side button...<br /><br />While using the tool directly it works just fine.yozhhttps://www.blogger.com/profile/00594416926669555675noreply@blogger.comtag:blogger.com,1999:blog-35352432.post-31495425303001902652014-04-07T15:13:22.203+01:002014-04-07T15:13:22.203+01:00Not Sure why my other post didnt go thru. But I pa...Not Sure why my other post didnt go thru. But I pasted that manually this works just fine from the tool. yozhhttps://www.blogger.com/profile/00594416926669555675noreply@blogger.comtag:blogger.com,1999:blog-35352432.post-60291766269709766772014-04-07T02:18:54.173+01:002014-04-07T02:18:54.173+01:00If I do it with the gatttool it works fine see bel...If I do it with the gatttool it works fine see below.<br /><br />root@raspberrypi:~# hcitool lescan<br />LE Scan ...<br />BC:6A:29:AE:D9:76 (unknown)<br />BC:6A:29:AE:D9:76 SensorTag<br />^Croot@raspberrypi:~# gatttool -b BC:6A:29:AE:D9:76 --interactive<br />[BC:6A:29:AE:D9:76][LE]> connect<br />Attempting to connect to BC:6A:29:AE:D9:76<br />Connection successful<br />[BC:6A:29:AE:D9:76][LE]> char-write-cmd 0x29 01<br />[BC:6A:29:AE:D9:76][LE]> char-read-hnd 0x25<br />Characteristic value/descriptor: 2d ff 58 0b <br />[BC:6A:29:AE:D9:76][LE]> <br />yozhhttps://www.blogger.com/profile/00594416926669555675noreply@blogger.comtag:blogger.com,1999:blog-35352432.post-31484012030619150042014-04-06T16:55:10.403+01:002014-04-06T16:55:10.403+01:00yozh, have you checked that gatttool is working c...yozh, have you checked that gatttool is working correctly for you? The script just automates the calling of gatttool. <br />Anonymoushttps://www.blogger.com/profile/00899702935992577808noreply@blogger.comtag:blogger.com,1999:blog-35352432.post-4590146317490736922014-04-06T14:17:15.817+01:002014-04-06T14:17:15.817+01:00tried the new script and this is all I`m getting.
...tried the new script and this is all I`m getting.<br /><br />root@raspberrypi:~/ble/sensortag# hcitool lecc BC:6A:29:AE:D9:76<br />Connection handle 69<br />root@raspberrypi:~/ble/sensortag# python sensortag.py BC:6A:29:AE:D9:76<br />[re]starting..<br />Preparing to connect. You might need to press the side button...<br />char-write-cmd 0x29 01<br />char-write-cmd 0x26 0100<br />char-write-cmd 0x31 01<br />char-write-cmd 0x2e 0100<br />char-write-cmd 0x3c 01<br />char-write-cmd 0x39 0100<br />char-write-cmd 0x44 01<br />char-write-cmd 0x41 0100<br />char-write-cmd 0x5b 07<br />char-write-cmd 0x58 0100<br />char-write-cmd 0x4f 02<br />[re]starting..<br />Preparing to connect. You might need to press the side button...<br />[yozhhttps://www.blogger.com/profile/00594416926669555675noreply@blogger.com