Tag Archive: LiveBox


My first Jeenode(s)!

My order was delivered today and I found time to solder one of the jeenodes and a room board (yes- another poor camera phone photo):

I then plugged it into my livebox flashed as a home automation hub: https://tickett.wordpress.com/2011/11/27/orange-livebox-flashed-with-home-automation-hub-firmware/

And followed the instructions on the hah site to flash the room node program: http://www.dbzoo.com/livebox/hah_hahnode#flashing_from_the_hah

# /etc/init.d/xap stop serial
# cd /root
# ls
HAHcentral.hex roomnode2.hex
# stty -F /dev/ttyUSB0 hupcl
# avrdude -v -c arduino -p m328p -P /dev/ttyUSB0 -b 57600 -Uflash:w:roomnode2.he
x

avrdude: Version 5.10, compiled on Nov 25 2011 at 11:22:59
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "/etc_ro_fs/avrdude.conf"
User configuration file is "/root/.avrduderc"
User configuration file does not exist or is not a regular file, skipping

Using Port : /dev/ttyUSB0
Using Programmer : arduino
Overriding Baud Rate : 57600
avrdude: stk500_recv(): programmer is not responding

avrdude done. Thank you.

Damn- what does that mean? I googled a little and found some articles suggesting other services may already be using the USB port. One such service is gpsd- let’s try stopping it:

# service gpsd stop
-ash: service: not found

Doh- no service command. Let’s try top to see if gpsd is running:

Mem: 11992K used, 1888K free, 0K shrd, 2224K buff, 4428K cached
CPU:   0% usr   1% sys   0% nice  97% idle   0% io   0% irq   0% softirq
Load average: 0.05 0.23 0.12
  PID  PPID USER     STAT   VSZ %MEM %CPU COMMAND
  193   184 root     R     2248  16%   1% top 
  183   110 root     S     1740  13%   1% dropbear -p 22 
  178     1 root     S     3552  26%   0% lua /etc_ro_fs/plugboard/plugboard.lua 
  145   140 root     S     5012  36%   0% /usr/bin/kloned 
  156   140 root     S     5012  36%   0% /usr/bin/kloned 
  140     1 root     S     5000  36%   0% /usr/bin/kloned 
  142     1 root     S     2584  19%   0% /usr/bin/xap-currentcost -s /dev/ttyUSB0 -i br0
  184   183 root     S     2268  16%   0% -ash 
    1     0 root     S     2256  16%   0% init 
   95     1 root     S     2248  16%   0% udhcpc -T 10 -i br0 
  123     1 root     S     2240  16%   0% inetd 
  110     1 root     S     1668  12%   0% dropbear -p 22 
  132     1 root     S     1068   8%   0% /usr/bin/xap-livebox -s /dev/ttyS0 -i br0 
  129     1 root     S     1028   7%   0% /usr/bin/xap-hub -i br0 
    7     1 root     SW       0   0%   0% [mtdblockd]
    3     0 root     SWN      0   0%   0% [ksoftirqd_CPU0]
    8     1 root     SW       0   0%   0% [khubd]
    2     1 root     SW       0   0%   0% [keventd]
    5     0 root     SW       0   0%   0% [bdflush]
    6     0 root     SW       0   0%   0% [kupdated]

Ah hah! CurrentCost is enabled and configured on the same USB port:

So I disabled it and tried again:

# stty -F /dev/ttyUSB0 hupcl
# avrdude -v -c arduino -p m328p -P /dev/ttyUSB0 -b 57600 -Uflash:w:roomnode2.hex

avrdude: Version 5.10, compiled on Nov 25 2011 at 11:22:59
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/etc_ro_fs/avrdude.conf"
         User configuration file is "/root/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyUSB0
         Using Programmer              : arduino
         Overriding Baud Rate          : 57600
         AVR Part                      : ATMEGA328P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65     5     4    0 no       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : Arduino
         Description     : Arduino
         Hardware Version: 2
         Firmware Version: 1.16
         Vtarget         : 0.0 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f
avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "roomnode2.hex"
avrdude: input file roomnode2.hex auto detected as Intel Hex
avrdude: writing flash (10600 bytes):

Writing | ################################################## | 100% 3.45s

avrdude: 10600 bytes of flash written
avrdude: verifying flash memory against roomnode2.hex:
avrdude: load data flash data from input file roomnode2.hex:
avrdude: input file roomnode2.hex auto detected as Intel Hex
avrdude: input file roomnode2.hex contains 10600 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 2.69s

avrdude: verifying ...
avrdude: 10600 bytes of flash verified

avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
avrdude: safemode: Fuses OK

avrdude done.  Thank you.

Voila!

Now let’s try flashing the hahcentral program onto the jeelink usb v3:

# stty -F /dev/ttyUSB0 hupcl
# avrdude -v -c arduino -p m328p -P /dev/ttyUSB0 -b 57600 -Uflash:w:HAHcentral.hex

avrdude: Version 5.10, compiled on Nov 25 2011 at 11:22:59
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/etc_ro_fs/avrdude.conf"
         User configuration file is "/root/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyUSB0
         Using Programmer              : arduino
         Overriding Baud Rate          : 57600
avrdude: stk500_getsync(): not in sync: resp=0x20

avrdude done.  Thank you.

Doh! Google time again… this time it looks like the settings for the flasher are incorrect (i.e. the chip isn’t m328p?). I double checked the jeenode usb v3 spec and confirmed the chip is ATMEGA 328. But noticed a comment about the OptiBoot loader. With a little more research I confirmed that the baud rate has increased from 57600 to 115200. Let’s try again:

# avrdude -v -c arduino -p m328p -P /dev/ttyUSB0 -b 115200 -Uflash:w:HAHcentral.hex

avrdude: Version 5.10, compiled on Nov 25 2011 at 11:22:59
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/etc_ro_fs/avrdude.conf"
         User configuration file is "/root/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyUSB0
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
         AVR Part                      : ATMEGA328P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65     5     4    0 no       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : Arduino
         Description     : Arduino
         Hardware Version: 3
         Firmware Version: 3.3
         Vtarget         : 0.3 V
         Varef           : 0.3 V
         Oscillator      : 28.800 kHz
         SCK period      : 3.3 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e950f
avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "HAHcentral.hex"
avrdude: input file HAHcentral.hex auto detected as Intel Hex
avrdude: writing flash (6668 bytes):

Writing | ################################################## | 100% 2.57s

avrdude: 6668 bytes of flash written
avrdude: verifying flash memory against HAHcentral.hex:
avrdude: load data flash data from input file HAHcentral.hex:
avrdude: input file HAHcentral.hex auto detected as Intel Hex
avrdude: input file HAHcentral.hex contains 6668 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 2.34s

avrdude: verifying ...
avrdude: 6668 bytes of flash verified

avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
avrdude: safemode: Fuses OK

avrdude done.  Thank you.

Sorted. Hopefully another update later tonight :)

L

Everything went relatively according to plan following instructions from: http://www.dbzoo.com/livebox/livebox

I only hit one snag- trying to take a shortcut and not bother changing the ip address of the router to 10.0.0.1 and the pc running the http/ftp server to 10.0.0.2. The reason appears to be that the livebox name field takes a maximum of maybe 32 characters so ;cd /etc;wget ftp://192.168.0.111/u for example does not work.

Now just waiting of delivery of a couple of Jeenodes: http://www.dbzoo.com/livebox/hah_hahnode

A few Airwick’s: http://www.dbzoo.com/livebox/hah_hahnode#airwick_hahnode have already been delivered :)

And I’m still researching various remote switching options: http://www.domoticaforum.eu/viewforum.php?f=55 looks to be a good source of information. The plugwise http://www.plugwise.com/idplugtype-g/ devices look quite promising as they’re one of the only options that support two way communication. They also come with an added bonus of monitoring power consumption of the device(s) attached to them. The shortfalls being reliability (read some bad reports from the domoticaforum) and cost (but the functionality might justify it). I’m not sure if/how well they would integrate with the HAH.

L

Energy Monitoring Update

So I’ve neglected the whole energy monitoring interest for a few months but spotted the new CurrentCost Individual Appliance Monitors (IAMs) are finally available (http://www.ebay.co.uk/itm/Current-Cost-IAM-Pack-1-UK-Version-Only-/170673700726?pt=UK_AudioElectronicsVideo_Video_TelevisionSetTopBoxes&hash=item27bcf1ff76) so ordered a few and started playing again.

In addition to monitoring overall household consumption I now have the fridge, servers and living room a/v equipment each giving their own power readings BUT these are not currently posted to the internet using my original CurrentCost bridge. After doing a little reading it appears a new bridge has been released now branded as the CurrentCost "NetSmart". You can send off your existing device to be upgraded (presumably a firmware flash): http://currentcost.com/netsmart-upgrade.html or buy new.

Upgrade pricing:

£5.99- NetSmart 12 (12 month subscription with up to 3 additional energy data channels)
£7.99- NetSmart 24 (24 month subscription with up to 3 additional energy data channels)
£11.99- NetSmart Pro 12 (12 month subscription with up to 9 additional energy data channels)
£14.99- NetSmart Pro 24 (24 month subscription with up to 9 additional energy data channels)

New pricing:

£34.49- NetSmart 12
£37.49- NetSmart 24
£39.94- NetSmart Pro 12
£45.94- NetSmart Pro 24

I opted for the NetSmart Pro 24. I’ve yet to receive the device but I’ve seen a sneak peak of what to expect on the forum:

The other addition to my existing system I’ve been wanting to see is the ability to monitor gas and hopefully even water consumption. Neither have officially been delivered BUT a new device is available which may help achieve one or both of the aforementioned: Introducting the CurrentCost OptiSmart- http://currentcost.com/product-optismart.html

The OptiSmart can be used as an alternative to the clamp/transmitter that originally shipped with the energy monitor(s) if (and only if) your electricity meter is compatible. The same device can in theory be used to read gas and water meters should they contain a pulsing LED to indicate consumption. Unfortunately, mine do not! However, whilst examine my gas meter (Slumberger R5) I found an RJ11 socket which after some research appears to provide direct connectivity to the pulses! With a bit of luck the lead on the OptiSmart can be modified to plug in to this RJ11 socket. I’ve sent an e-mail to CurrentCost to see if they can confirm this before I order one. If that fails I may try with the CurrentCost development board.

I mentioned in a post a while back that Google were retiring their Powermeter service so I’m still on the lookout for a replacement service (or building something myself).

After a bit of research I discovered CurrentCost are already feeding the energy consumption and temperature to pachube. There is a nice little pachube app which utilizes google’s charting ability:

You can find your feed_id in the http://my.currentcost.com dashboard (on the right side in the devices section):

Unfortunately only a month’s data is currently retained (this may be a limitation with the free pachube account being used to post the monitor data?) and I really want years of data so I can compare same time last year figures etc. The search continues…

I also stumbled across the Home Automation Hub: http://www.homeautomationhub.com/ which is an open source project which involves ref lashing a Livebox to interact with various devices (including the CurrentCost energy monitor). I really like the idea of this as there’s so much more potential for two-way communication and other applications (linking in nicely with some of my other long term goals) but at the moment I’m going to shy away from it on account of the language being new to me and the apparent lack of current community support.

Expect another update once the NetSmart device comes through and potentially after a start logging gas consumption!

L

%d bloggers like this: