Rocking our baby daughter to sleep on the blockchain powered cradle rocker.
Birth of the Steem Blockchain Baby Rocking Cradle
A while ago I was hacking on the Bluetooth enabled Duplo train of my son. As our (now about half a year old daughter) is almost outgrowing her baby cradle I still wanted to give this other Bluetooth hack one more shot!
A couple of months ago we bought this E-Leon automatic rocking device. A nice invention for lazy parents like ourselves. Intended to be used for baby strollers, but we mostly use it for rocking the good old family owned cradle instead on a makeshift, but totally secure setup as you can see :) The E-leon rocking device is a battery powered slider, controlled using Bluetooth Low Energy through an accompanying app in which you can pick several rocking modes, sliding speed and so on.
Now when I see Bluetooth, I think 'let's try to hack this thing!'. So I thought, what would it take to turn this device into a Blockchain Powered Baby Rocking Cradle, to showcase the diversity of use cases of the Steem chain once more :)
I picked the Steem chain, because of it's abundance of developer tools, one can simply use basic REST API's to query the chain, the chain has fast blocktimes of 3 seconds and I am a huge fan of the diverse community.
Scroll down for the video if you want to skip all the technical mumbo jumbo!
Here is how I got it all working:
Step 1. Reverse engineer the accompanying Baby rocking app from the E-leon device. I simply pulled the app's APK package from my phone and unzipped it to explore its contents. It happened to be a cordova hybrid HTML app which had it's source code unencrypted so I could quickly discover the needed Bluetooth UUID's for the rocking slider's so-called services and characteristics and the appropriate values to call.
Step 2. Get the Bluetooth working with my computer instead of the E-leon app. Using a node package for Bluetooth callednobe, I discovered the Bluetooth UUID of the E-leon rocking slide. Then I fumbled around by using the services and characteristic's UUIDs found in the app's source and explored the app's source code some more to learn about the possibilities and appropriate values of the baby rocking slide.
Step 3. Hook up the Steem chain and interpret the data. For this project I could use two data points: Amount of transactions per block and whenever I (the daddy) signed a block (Randomly, but roughly at least every minute). Using the dsteem node package I got this working in a flash and before I knew it the Steem Blockchain Baby Rocking Cradle was born!
Walkthrough of the demo-video:
- Launching the script on the computer.
- Put the baby in the cradle.
- Enabling bluetooth discovery on the rocker
- Computer and rocker pair.
- Steem chain is being connected.
- Blocks start streaming in.
- Speed of the rocker gets adjusted based on the amount of transactions per block versus the average amount of transactions per block.
- Whenevery "Daddy" signs a block the Rocking mode changes.
- Theoretically the Baby falls asleep dreaming of a decentralised world.
Ps. our daughter just slept 2 hours straight on the Steem Blockchain :) - while I was editing the demo-video haha.
Other Steemprojects by me:
- SteemWallet - Open Source Steemwallet app for iOS and Android: https://steemwallet.app
- Steem Account Signup Widget for any Steem project: https://steemwallet.app/widget/index.html
- SteemWhale - Giant 18 meter / 60 ft Whale which sprays when you send steem to @whalefountain - https://steemwhale.io
- SteemFest - The Annual Global Gathering of Steem users and ecosystem. https://steemfest.com
See you on the chain, @roelandp