Hacklet #7 - iPyPiDrum

After the success of getting the Raspberry Pi to mediate between the Taiko no Tatsujin controller and sound playback, this hacklet is trying to push that one step further by forwarding all drum hits on to an iPad.

So where to start? First up, I needed socket server, after messing about for good few hours with “Twisted”, I hit upon this tutorial / script - Asynchronous socket server in python.

With a little hacking (gist at end of the post), I was able to get button data sent over sockets to initially telnet clients.

telnet 192.168.0.22 12345

Next issue, sockets on iOS; as is often the case, Ray Wenderlich provided the answer How To Create A Socket Based iPhone App and Server.

Once I had data flowing from the socket server to iOS I found that the data was getting corrupted somehow. Adding …

.encode("utf-8")

… to what was being sent fixed that issue.

A bit of iOS hacking and we have our iPyPiDrum!

The python code:-

Copyright © 2013 - Brothers Bennett - Powered by Hexo
- Ported theme GreyShade -