The iOS app is built using C4, a great framework for getting started with iOS programming.
The original idea was to be able to power cycle my router when it went choked or to turn it off when I left the house.
The app searches for a Bean named 'PowerBean' and once it connects then the user interface becomes accessible. The lightblue logo dims and brightens upon connect and disconnect.
$ pod install
Open the PowerBean.xcworkspace not the PowerBean.xcodeproj.
- Connect GND of Bean to IN- on Powerswitch Tail
- Connect D0 of Bean to IN+ on Powerswitch Tail
- Upload PowerBeanFirmware to the Bean
Like many Bean projects, say goodbye to your battery. While the sketch has a long naptime, which should minimize the battery drain, the PowerSwitch actually draws 3ma from the Bean. When I first got it working the light would go on, but not the relay. Although your Bean can operate with a battery in the low 2v range, it isn't enough to trigger the relay.
- Found this awesome project after I finished...
- Upon connect poll bean for its state and update the UI accordingly
- Disconnect Bean when app loses focus
- Reconnect Bean when app comes back into focus
- Dim the switch or make invisible when the Bean disconnected
- Fix the visual layout a bit more to make it easier to deal with connection issues
- Hack Bean to use USB cable like this