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

Advertisements