Blinking the BeagleBone's heartbeat LED using the iPhone
I've been having a great back-and-forth on Twitter with David House while hacking away with this project, who is working away as I type to get this working on the Raspberry Pi. It's been a lot of fun.
If you want to replicate this on the BeagleBone you should first download and build the PeerTalk library, and then build and deploy the iOS and OSX example applications and get that up and running.
Then connect up and boot your BeagleBone. You'll need to power the board using a mains adapter as when you're compiling things it's possible you'll be drawing enough amperage that you're computer will turn off the USB port to protect itself, and as a result power down your BeagleBone. I had this happen to me a couple of times before I finally dug a mains adapter out of my office drawer. However since you're powering the board from the mains you'll also have to connect an Ethernet cable so that you can ssh root@beaglebone.local and log into the board over the network.
1. Go ahead and login to your BeagleBone as root.
2. Download, build and install libusb. Version 1.0.9 builds, links and installs okay.
3. Download, build and install cmake, which you'll need to build usbmuxd later. You'll need to grab the latest Git nightly checkout as older release versions don't build, having problems with the stock libbz2 compression on the BeagleBone.
4. We also need libplist, however this is available as part of the package management system on Ångström Linux, so all you need to do to install this is type opkg install libplist-dev at the prompt.
5. Download, build and install usbmuxd. Version 1.0.8 builds, links and installs okay, although you may beed to use ccmake and configure by hand, rather than using cmake, as it can't seem to find the libusb include files that got installed into /usr/local.
6. Create a usbmux user
groupadd -r usbmux -g 114
useradd -r -g usbmux -d / -s /sbin/nologin -c "usbmux user" -u 114 usbmux
7. As the BeagleBoard doesn't have syslog turned on by default, and you'll need it for debugging, turn on syslogd from the relevant script in /etc/init.d.
8. Run up the usbmux deamon, by typing usbmuxd -v -v at the prompt.
9. Plug your iPhone into the (host side) USB on your BeagleBoard, you should see some debug scrolling by in /var/log/messages.
10. Download David House's peertalk-python and its dependances.
11. On your iPhone start the PeerTalk client for iOS.
12. Start the python client on the BeagleBone by typing python ./peertalk.py at the prompt.
Type in a message at the prompt, and you should see something like this...
From there it's pretty trivial to replicate my "Hello World" example, just by hacking around with David's code and toggling the heartbeat LED when the BeagleBone receives any messages.
Which gets you to this point...
Which is pretty much where I've reached right now. Next steps is a proper application on the iOS end of things with more generic control of the BeagleBone's header pins, and a more flexible Python backend on the BeagleBone itself...
Update: David House has managed to get everything up and working on the Raspberry Pi. The only changes from the above is that you should grab libplist using apt-get rather than opkg, and since you won't be logged in as root you should remember to sudo usbmuxd -v -v when you start the USB daemon. Apart from that, you should be good to go...
David House (@davidahouse)
25/08/2012 20:22
Video of iPhone controlling LED on Raspberry Pi.
Then connect up and boot your BeagleBone. You'll need to power the board using a mains adapter as when you're compiling things it's possible you'll be drawing enough amperage that you're computer will turn off the USB port to protect itself, and as a result power down your BeagleBone. I had this happen to me a couple of times before I finally dug a mains adapter out of my office drawer. However since you're powering the board from the mains you'll also have to connect an Ethernet cable so that you can ssh root@beaglebone.local and log into the board over the network.
1. Go ahead and login to your BeagleBone as root.
2. Download, build and install libusb. Version 1.0.9 builds, links and installs okay.
3. Download, build and install cmake, which you'll need to build usbmuxd later. You'll need to grab the latest Git nightly checkout as older release versions don't build, having problems with the stock libbz2 compression on the BeagleBone.
4. We also need libplist, however this is available as part of the package management system on Ångström Linux, so all you need to do to install this is type opkg install libplist-dev at the prompt.
5. Download, build and install usbmuxd. Version 1.0.8 builds, links and installs okay, although you may beed to use ccmake and configure by hand, rather than using cmake, as it can't seem to find the libusb include files that got installed into /usr/local.
6. Create a usbmux user
groupadd -r usbmux -g 114
useradd -r -g usbmux -d / -s /sbin/nologin -c "usbmux user" -u 114 usbmux
7. As the BeagleBoard doesn't have syslog turned on by default, and you'll need it for debugging, turn on syslogd from the relevant script in /etc/init.d.
8. Run up the usbmux deamon, by typing usbmuxd -v -v at the prompt.
9. Plug your iPhone into the (host side) USB on your BeagleBoard, you should see some debug scrolling by in /var/log/messages.
10. Download David House's peertalk-python and its dependances.
11. On your iPhone start the PeerTalk client for iOS.
12. Start the python client on the BeagleBone by typing python ./peertalk.py at the prompt.
Type in a message at the prompt, and you should see something like this...
Bi-directional communication between the iPhone and the BeagleBone via USB |
def run(self):
framestructure = struct.Struct("! I I I I")
ledOn ='echo 1 > /sys/class/leds/beaglebone::usr0/brightness'
ledOff ='echo 0 > /sys/class/leds/beaglebone::usr0/brightness'
i = 0
while self._running:
try:
msg = self._psock.recv(16)
if len(msg) > 0:
frame = framestructure.unpack(msg)
size = frame[3]
msgdata = self._psock.recv(size)
print "Received: %s" % msgdata
if i == 0:
os.system(ledOn)
i = 1
else:
os.system(ledOff)
i = 0
except:
pass
Which gets you to this point...
Toggling the BeagleBone heartbeat LED with my iPhone over USB. |
Update: David House has managed to get everything up and working on the Raspberry Pi. The only changes from the above is that you should grab libplist using apt-get rather than opkg, and since you won't be logged in as root you should remember to sudo usbmuxd -v -v when you start the USB daemon. Apart from that, you should be good to go...
David House (@davidahouse)
25/08/2012 20:22
Video of iPhone controlling LED on Raspberry Pi.
Controlling a LED connected to a GPIO pin on the Raspberry Pi with an iPhone |
Monday 8th October 2012
Hoxton Hotel, London
Early Bird Price: £499 (until 1st Sept.)
Normal Price: £699
Save 10% with code BEAGLE10
Update: David House has just updated his Github repository with a better description of what he did to get the iPhone to control the Raspberry Pi's GPIO pins.
Update: David House has just updated his Github repository with a better description of what he did to get the iPhone to control the Raspberry Pi's GPIO pins.
David House (@davidahouse) 26/08/2012 13:40 @aallan I just updated my github repo with a better description with attributions. Had a blast working with you...
|
There is a syslog running, the systemd journal. Just do 'journalctl -f' to see the entries scroll by.
ReplyDeleteLooks like I have a very different version of Ångström running that you, because that certainly isn't the case for me...
DeleteThe one that comes in the box: http://www.circuitco.com/support/index.php?title=BeagleBone#Image_Files
DeleteThanks!!!!
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteApple may publicly disavow the rumor Web sites that scramble for scraps about the companies plans, but secretly their marketing department must be delighted. It would cost a lot to buy that kind of Web advertising."rastreador de iphone
ReplyDeleteI have been searching to find a comfort or effective procedure to complete this process and I think this is the most suitable way to do it effectively. iPhone Repair Dubai
ReplyDeleteThis is a interesting line of content, very nice article. Thanks for sharing this post, good way of bring this subject to discussion. Keep up the great work ! lensesforsnap
ReplyDeletencandescent bulbs are very affordable but they are a real burden to the environment.Dimmable LED Bulb They cost too much to use because they consume too much electricity.
ReplyDeleteI would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired me to start my own BlogEngine blog now. Really the blogging is spreading its wings rapidly. Your write up is a fine example of it. KRM Light+
ReplyDeleteThanks you for the blog. You really make it more informative. It make the day more informative. LED Sign Boards in Chennai Name Board Makers in Chennai
ReplyDeleteIt was really a nice experience to be on your blog and get the lots of information. Shop offer quality cell phone repair parts & screen repair services from cell phone repair las vegas
ReplyDeleteThankyou for sharing useful information . I would like to know more about Iphone repair prices.
ReplyDeleteIphone repair prices
Admiring the time and effort you put into your blog and detailed information you offer. irepair.in provide replacement of broken IPad screen and other apple devices at teh best prices. For the more details you have to do just one click ipad screen replacement
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteI admire this article for the well-researched content and excellent wording. I got so involved in this material that I couldn’t stop reading. I am impressed with your work and skill. Thank you so much. Cell Phone Repair Brick Nj
ReplyDeleteFound this article is full of informative and helpful content, really love to read it. Get the phone repairs services at the best prices from mobilerepairfactory.com.au.
ReplyDeletePrakash cellular service
ReplyDeletehi nice concept good work
ReplyDeletehttps://www.cellphoneworld.in/default.aspx
I recently came across your blog and have been reading along. I thought I would leave my first comment. I don't know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often. ipad mockup
ReplyDeletevery nice article thanks for sharing ......iPhone Service Center
ReplyDeleteGreat job for publishing such a nice article. Your article isn’t only useful but it is additionally really informative. Thank you because you have been willing to share information with us. Iphone 7 Screen Replacement Near Me
ReplyDeleteVery informative article, which you have shared here about iphone. After reading your article I got very much information and it is very useful for us. I am thankful to you for sharing this article here. iPhone screen replacement
ReplyDeleteNice information i would also tell you if you have apple macbook in india and want to repair in Delhi-NCR you please contact for best price MacBook repair service we offer good price even we make assure your not let you down in terms of repairing.
ReplyDeletecall-us +91-9971909844
Nice post, impressive. It’s quite different from other posts. we provide high quality led signs at affordable prices. to know more visit our website.
ReplyDeleteBy using this PCB prototype in the electronic device, the inventor can see if the prototype serves its purpose in the invention. https://fastpcbunion.com/aluminum-pcb/ 99% pure gold), immersion silver, flash gold, immersion tin (white tin), carbon ink, and SN 100CL, an alloy of tin, copper, and nickel.
ReplyDeleteI am grateful to the owner of this site which really shares this wonderful work of this site.That is actually great and useful information.I'm satisfied with just sharing this useful information with us. Please keep it up to date like this.Thank you for sharing.https://www.macbookrepairsdubai.ae
ReplyDeleteThis is very interesting, You are a very skilled blogger. tipandroid.com
ReplyDeleteI admit, I have not been on this web page in a long time... however it was another joy to see It is such an important topic and ignored by so many, even professionals. I thank you to help making people more aware of possible issues. iPhone black friday sale
ReplyDeletelooking for infinix hot 10 price
ReplyDeleteIt looks very complicated process to me.
ReplyDeleteTecno Mobile Price in Pakistan
A data sim card for travel is a small, removable card that allows you to connect to the internet while you are away from home. It is a great way to stay connected while you are traveling, and it can also be a great way to save money on your phone bill. Data Sim Card for Travel
ReplyDeleteRead this article and found it useful content and totally informative. I enjoyed reading the content of this article post very much as it contains information about IPHONE repair in Melbourne. At Cityphones.com.au we offer all IPHONE repairs at a reasonable price.
ReplyDeleteGreat post. If you're ever in Las Vegas make sure to stop by gadgetmates
ReplyDeleteBreaking an iphone is a bad dream for me because I am a lover of that particular phone. it's features are awesome and I am also a photographer and serving wedding photographer and videographer with cheapest pricing.
ReplyDeleteWhen it comes to iPad Repair in Dubai, Egghead Fixers emerges as the trusted and reliable choice. Their team of skilled technicians, commitment to quality, efficient service, transparent pricing, and customer-centric approach make them a standout option for anyone seeking to revive their malfunctioning iPad. Don't let a damaged iPad disrupt your routine – head to Egghead Fixers for swift and reliable repairs that you can trust.
ReplyDeleteThanks for your article, your information is very useful to me. If you need any related mobile service course in Madurai contact our Office eCareerpluz Info india pvt ltd
ReplyDeletemobile repairing advanced course mobile phone repair training center mobile repairing advanced course mobile phone repair training center
Thanks for your article, your information is very useful to me. If you need any related mobile service course in Madurai contact our Office eCareerpluz Info india pvt ltd
ReplyDeletehttps://careerpluz.in/diploma-in-mobile-phone-technician
This comment has been removed by the author.
ReplyDeleteThanks for your article, your information is very useful to me. If you need any related Laptop service course in Madurai contact our Office eCareerpluz Info india pvt ltd
ReplyDeletemotherboard repair training course, mobile and laptop repairing institute, mobile and laptop repairing course
https://careerpluz.in/laptop-chip-level-repair-course
Your article is a treasure trove of useful information. Thanks a lot for sharing your knowledge. Looking forward to more content from you. LED Signs for Business
ReplyDelete