The Ben NanoNote is now able to switch radio controlled power sockets, too!
The rfm12 433MHz module, produced by HopeRF, is attached to the microSD port of the Ben NanoNote, which pins are exposed via an microSD card dummy adapter.
The System-on-a-chip used inside the Ben NanoNote (ingenic JZ47XX) allows us to put the microSD pins into GPIO mode, so we can (as already done for the first device, the Netgear WGT634u router, I connected an rfm12-module to) create and export an SPI bus on top of them to be able communicating with the module.
That way there’s no need of opening the device and/or soldering anything anywhere – the module is attached directly to the microSD dummy which gets simply inserted into microSD slot of the NanoNote.
I wrote a basic but fully working ncurses frontend using the rfm12 library listing configured devices waiting for getting switched.
There’s also a ready-to-use XMLRPC daemon available which exposes all configured devices and provides functions for controlling them, so UIs for controlling devices are not limited to run on the same system the rfm12 module is installed on.
I’ve also written a little GUI in python using the qt4 toolkit, connecting to the master via XML-RPC:
Several other frontends are work-in-progress as e.g. a GUI for the Android platform, as well as one based on qt4/QML being able to run e.g. on phones running Meego/Maemo as operating system – both using the XML-RPC interface.
So all major parts of the project are mostly finished now and the API is more or less fix.
The the whole project now consists of (a rough overview):
- the kernel module which communicates with the actual hardware (so the rfm12 module) and exposes a character device to userspace
- the rfm12 library which
- connects to the kernel module
- contains the device type specific data and code to modulate signals which control the actual power sockets
- provides functions for reading / writing configuration files and controlling / switching devices
- applications using the library and its functions for actual controlling of devices, which could be / already are:
- UI applications linked directly against librfm12 (an ncurses frontend (shown above) is available yet)
- daemons providing network interfaces (a daemon exporting functionality via XMLRPC is available yet , one doing the same but using JSON-RPC as underlying rpc method is going to be implemented soon)
- UIs running on different machines, using these RPC services (e.g. above pyqt4 frontend; android- and qml-frontends are work-in-progress)
Devices are getting configured via configuration files, describing the product type of the device, a name and the actual code which is used to identify devices of a certain product type group.
The config used by the applications shown on the photos / screenshots above just looks this:
[socket_A]label = “one”product = “P801B”code = “1111110000”[socket_B]label = “two”product = “2272”code = “1111110000”[socket_C]label = “three”product = “2272”code = “1111101000”
One of the tasks I’m working on right now, is state sharing. While the list of configured devices and it’s states (on/off) is already shared among all XML-RPC clients (so having switched a unit in one client, others will fetch the changed state next time they poll/refresh), the state is not yet shared between several processes invoking the librfm12.
Issue is: Every process linked against librfm12 creates its own list of devices, including states – so every process has its own copy. Changes done in one process are not shared among others. This could be solved using IPC (System V shared memory, sockets every instance connects to, etc.).
That’s it – feedback and/or participation is highly appreciated!
Source Code is still available on github: https://github.com/mirko/rfm12-ASK-for-linux 🙂
3 replies on “Ben NanoNote able to control radio power sockets”
Hello,
Trying to find info on your the Switchunit, I found this (hopefully an irrelevant url):
http://ec.europa.eu/consumers/dyna/rapex/create_rapex.cfm?rx_id=136
Best regards,
Gilles
[…] forward. Less obvious and much more impressive is the hack seen in the image above. [Miro] built an SD card adapter cable and uses the contacts in the card reader to bit bang four-wire SPI to communicate with that RF […]
Where did you get such a microSD card dummy adapter from?