Posts

ZWay: getting the device list.

Back after a while... and a son! Here is a piece of code that can be used with the latest version of the ZWay library. It makes it possible to retrieve the Z-Wave device list and display the device names and associated XML file (each recognized device can be associated to an XML that contains a bunch of meta-data: name, description etc.). int main(int argc, char ** argv) { ZWay theZWay; ZWError result; memset(&theZWay, 0, sizeof(theZWay)); result = zway_init(&theZWay, "/dev/ttyAMA0", "/home/pi/src/razberry-proxy/config", "/home/pi/src/razberry-proxy/translations", "/home/pi/src/razberry-proxy/ZDDX", stdout, Warning); if (result == NoError) { result = zway_start(theZWay, &terminationCb); if (result == NoError) { printf("Discovering...\n"); result = zway_discover(theZW...

First steps with the ZWay library

The Z-Wave "RaZberry" installation comes with everything needed to be able to do some custom development in C; everything is installed in the /opt/z-way-server  directory. There, one can find: A set of (documented, nice!) C header files found in /opt/z-way-server/libzway-dev : CommandClassesPublic.h FunctionClassesPublic.h ZDataPublic.h ZDefsPublic.h ZErrors.h ZPlatform.h ZWayLib.h A set of libraries found in /opt/z-way-server/libs : libmicrohttpd.so libv8.so libzwayhttp.so libzwayjs.so libzway.so For the ZWay stack to run properly, it is needed to provide the necessary configuration files. Instead of using these directly from the installation folder, I made a copy in order not to mess up too much with my working/configured setup. The following directories from the ZWay installation folder are needed: config translations ZDDX For experimenting I made a small Makefile in order to build and run. main.out: main.c gcc -I/opt/z-way-server/li...

More toys: Razberry & sensors!

Image
Having a "Raspberry Pi" as a DHCP server is of course not my end goal. There are plenty of ideas I have about what it could do... Home automation is one of them. So finally, after a long time hesitating between various extensions, devices and technologies, I finally ordered some new fancy toys: First of all, a Z-Wave extension board for the Pi: the "Razberry" from Z-Wave.me . Unfortunately expensive (but well, a USB dongle is also too), but quite a nice little extension board. A set of Z-Wave sensors; as security was my wife first concern and my budget limited, I bought three door/window contact detectors ( SM103 from Everpring ). Z-Wave  seems to be definitively an expensive choice compared to ZigBee , but well, at least I found easily some devices, and guess what, so far it works out-of the box!  So now, time to look at APIs and see how to get further... As a start, I would like to be able to control things from my phone and be able to get notified w...

Small note on DHCP daemon and boot

Today after turning my laptop I had the bad surprise to get no Internet connection; worse than that, no network connection at all: no DHCP address assigned to me :-( Looking at the logs on Raspberry Pi ( /var/log/syslog ), the issue is clear: Feb 7 22:53:42 raspberrypi dhcpd: No subnet declaration for eth0 (no IPv4 addresses). Feb 7 22:53:42 raspberrypi dhcpd: ** Ignoring requests on eth0. If this is not what Feb 7 22:53:42 raspberrypi dhcpd: you want, please write a subnet declaration Feb 7 22:53:42 raspberrypi dhcpd: in your dhcpd.conf file for the network segment Feb 7 22:53:42 raspberrypi dhcpd: to which interface eth0 is attached. ** Feb 7 22:53:42 raspberrypi dhcpd: Feb 7 22:53:42 raspberrypi dhcpd: Feb 7 22:53:42 raspberrypi dhcpd: Not configured to listen on any interfaces! [...] Feb 7 22:54:11 raspberrypi kernel: [ 51.380450] smsc95xx 1-1.1:1.0: eth0: link up, 100Mbps, full-duplex, lpa 0x41E1 Feb 7 22:54:12 raspberrypi ifplugd(eth0)[1343]: Link beat de...

More configuration on the Pi

Since my last post, although my [fun][geek] evening time was limited, I managed to fix a few issues on my home network, thanks to my Raspberry Pi. First, I made it reachable from the Internet. Nothing difficult there: I already had this setup for my "old" Dell Linux machine. Just a matter of: Assigning a fixed local IP address to the RPI. Configuring a NAT rule on the Internet gateway that maps an external port (e.g. 12345) to the SSH daemon port on the RPI (port 22). Having a small client that registers the Internet gateway external IP address to a free dynamic  DNS service. For that I installed and configured " ddclient " with an account from DynDNS . Cool... How geek, now I can remotely connect to my home network from the Internet. Well, this is needed for later: I want it to be the center and the entry to my home network. Home-automation, security here we go! Since my [fabulous] Internet gateway still refuses to persist DHCP static lease bindings, ...

First, getting headless.

I will not be using the "Raspberry Pi" as "a common PC"; there are already too many of these at home. And well, for the use-case I am thinking of, it is not needed. So the first step is to make it "headless". For my initial experiment, I took the default Linux distribution " Raspbian wheezy " (16/12/2012); I preferred to start with the "official" distribution (I assume, the most stable and the easiest to begin with).  I made sure I would have at least: A connection to the screen: that meant for me a cable HDMI to DVI. A network connection to my home modem. A USB keyboard. Everything went well, except that the keyboard I used (a Logitech Wireless keyboard K340) did not work out of the box. For some obscure reason, if the USB dongle is connected at boot-time, I don't get the keyboard to work; but, if I unplug and plug again the dongle after the RPI booted, it worked just fine... After that I could finally start. Good ...

From Pi to 8086

Image
Yesterday I finally got my " Raspberry Pi "... and after unpacking it, I couldn't stop being nostalgic: "Wow, what a step my first computer... my good old 8086 ". A long time ago, in a galaxy far, far away... I used to live in France, and I used to have an old 8086 (my first own computer - thanks Dad !). It was a piece of hardware: a huge box, a huge screen... Internally it was a beauty: nothing compared to today's PCs where the cabling is always a big mess, the cases have always issues with dust etc. But, what an evolution when I try to compare it to my new toy. Memory, my precious:  640k of RAM was cool. But sometimes, after booting or running a few programs, there was not enough to run stuff. Optimization was not about "add more memory" or "run garbage collector". I remember, it was about writing the perfect " autoexec.bat " with its " config.sys " and avoid loading unnecessary drivers etc. 10M of hard-disk...