Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Request: Bluetooth LE support
-
Guys... Check out py-ble-hci on http://processors.wiki.ti.com/index.php/Category:BluetoothLE
That appears to be 100% pure Python library e.g. should run in Pythonista if you can install it. It does require pyserial and construct to work. Construct also seems to be 100% pure Python. The only question is whether pyserial is too. Roll up you sleeves and see if you can get this all working on Pythonista.
-
Thanks for the link, but alas at some point it'd need a way to talk to the hardware, and Pythonista has no such provision AFAIK :(
Like I mentioned, techBASIC on iOS already does this so it should be possible -- if omz decides to add it :)
-
I did install pyserial but, it in turn relies on "termios" which is unfortunately not part of the Pythonista install. (http://docs.python.org/2/library/termios.html)
-
You guys saw the guy post about using Pythonista to communicate to Raspberry Pi? It may have some ideas for communicating wirelessly to Bluetooth devices. I'm not sure. http://omz-software.com/pythonista/forums/discussion/188/simple-alarm-device-home-automation-using-a-raspberry-pi-and-pythonista-on-the-ipad
I plan on getting a Raspberry Pi in the future, it's cheap enough and seems like a fun learning device. BUT the point I'm making is can this work on bluetooth devices?
-
My advise is: buy the Pi... It will not break your bank account and they are a hoot to hack on! Buy the see thru plastic case at the same time to protect the board... Also a compatible combination WiFi/Bluetooth USB dongle is a useful addition.
The other post you reference tells you how to pass messages between Pythonista and the Raspberry Pi. You could then use the Bluetooth dongle in the Pi to relay messages to/from the TI SensorTag. Once I get my tag in the mail, I will post some Pythonista <--> Raspberry Pi <-> TI SensorTag code.
-
I'd like to bump this up. BLE support in Pythonista would be a great educational tool, and judging from WWDC 2012 sessions 703 and 705 the framework is rather simple, so a custom Python module that talked directly to it seems quite doable.
Judging from sample code like https://developer.apple.com/library/IOS/samplecode/TemperatureSensor/Introduction/Intro.html, we'd need something like a Manager wrapper that exposed status and device enumeration methods, a Peripheral class that exposed the actual device characteristics and sent little messages to and fro.
-
+1 for a library to access Bluetooth LE.
Another iOS app, techBASIC, provides this - it is sweet.
But, of course, I would far prefer to work in python. ;-)
I have no experience developing hw protocol libraries, so probably not the right guy to start such a project, but I would be happy to help however I can - use cases, testing, doc.
-
Oops, just noticing that this thread was in fact started with a reference to the techBASIC BLE feature - haha.
Anyway, love to see Pythonista get similar capability.
I am brand new to Pythonista, just discovered it, very psyched about what it seems capable of already.
-
+1 for a library to access Bluetooth LE.
-
I too would love this since I picked up a few TI SensorTags at a meetup.
It isn't clear though that there are any real python Bluetooth LE libraries out there. py-ble-hci, near as I can tell, is for doing some limited testing by way of a bluetooth dongle.
-
With the upcoming NumPy/Matplotlib support, it'd be great to be able to collect and analyze data from BLE sensors.
-
It would be really fantastic to see Pythonista support for Bluetooth LE!
-
+1 for the Bluetooth LE absolutely, I agree with you guys.
-
Is BT support included in v1.5?
-
+1 for a library to access Bluetooth LE.
-
<!DOCTYPE html>
<strong>Yeah, did omz add BLE support in 1.5?</strong> -
Unfortunately not. I guess we have to buy Ole some BLE devices so that he sees what you guys are so excited about.
-
Has anyone heard if they are considering putting some kind of Bluetooth LE support into Pythonista, perhaps like there is in techBASIC? I would really love to do some of the kinds of things described in Building iPhone and iPad Electronic Projects: Real-World Arduino, Sensor, and Bluetooth Low Energy Apps in techBASIC by Mike Westerfield, but I would much rather be able to work in Pythonista rather than in techBASIC!
-
The IOS Core Bluetooth framework (supports BLE) is pretty straightforward if you understand bluetooth. BLE is MUCH simpler than Bluetooth 1.0. I do a moderate amount of hobby bluetooth work with iOS and am willing to support such an effort in Python, including things like helping specify an easy to implement Python API (the core of the core.) I have about 10 cheap bluetooth devices some of which I would be willing to donate. Most of them come with open source xcode app code to talk to them. That's where I learned and is a good place to start. The Core framework is supported on OSX so I could prototype something up there if a Python expert could help me on how to do C based Python extensions on the Mac. Heck if I googled it I'd probably discover someone has already done an OSX BLE wrapper.
(Just did. https://gist.github.com/jeamland/11284662 might do it. I'll try it in my copious free time. ;-) Cool. Apple apparently supports MIDI via BLE. I'll keep searching.)Several chip companies are going in big time hoping to cash in on Internet Of Things growth with BLE. You can now buy a variety of very low cost boards which have a microprocessor, BLE support and a couple of i/o pins and I2c ports to connect sensors. By low cost I mean around $5. TI has a chip family with embedded 8051 that seems lowest cost. Nordic semi sells a BLE chip for slightly more which has an embedded ARM M0. That one will run Arduino ARM code (google RFDuino for one development board.) Even though TI chips are cheaper they require $2000 compiler to do anything more than the simplest app. The Nordic is gcc based. Python wouldn't care. Interface is the same. In the air BLE is BLE. Many development boards available in $10-$100 range. Coding in Arduino on the BLE device and Python on the iOS would be perfect for me. Raspberry PI mentioned above is too big and uses too much power. These things are tiny and run a year on little watch batteries.
OMZ was right. numpy/ui etc support was much more important but BLE is much simpler and percolates to top priority about now.
-
Probably the best cheap Bluetooth thingie to use for API development is the TI CC2541 SensorTag. It is a $25 reference design provided by TI and sold by all the standard hardware sources (DigiKey, Mouser etc.) Looks like a keychain fob. I take the board out and carry it in my wallet. TI built in a bunch of cheap I2C sensors so it does something useful out of the box. It doesn't exercise all of BLE but probably enough to test what most Pythonista users want to play with. Can't beat the price and I'm willing to donate mine so it is even cheaper. I'm moving to the Nordic ARM devices so I can put my own code on the device.
Built in sensors:
IR temperature Sensor
Humidity Sensor
Pressure Sensor
Accelerometer
Gyroscope
MagnetometerSince it comes with open source (but free app store downloadable) apps that gives a reference to test against and example software methodology to copy.
(Did I mention that BLE junks the stupid defective Bluetooth Pairing process? One of the many needed simplifications that came in BLE.)
-steve