User Tools

Site Tools


hexabusdemosetup

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

hexabusdemosetup [2011/05/16 16:36]
gonium
hexabusdemosetup [2012/10/30 10:27] (current)
Line 2: Line 2:
  
 The Raven boards contain two microcontroller: A ATMega1284p and an ATMega3290p. Both are accessible using JTAG and ISP ports (the latter ones need to be soldered to the board). While the ATMega1284p can be programmed using the JTAG port, the JTAG functionality on the ATMega3290p is disabled via a fuse setting. I hacked one of the 50mil/100mil-adapters of the Raven Kit to accept a 6-pin ISP connector. This way, I can connect to the ISP port and flash the device using avrdude, here with a bus pirate in ISP mode:  The Raven boards contain two microcontroller: A ATMega1284p and an ATMega3290p. Both are accessible using JTAG and ISP ports (the latter ones need to be soldered to the board). While the ATMega1284p can be programmed using the JTAG port, the JTAG functionality on the ATMega3290p is disabled via a fuse setting. I hacked one of the 50mil/100mil-adapters of the Raven Kit to accept a 6-pin ISP connector. This way, I can connect to the ISP port and flash the device using avrdude, here with a bus pirate in ISP mode: 
 +
 +{{:isp-buspirate.jpg|}}
  
   avrdude  -c buspirate -P /dev/cu.usbserial-A700eEaD -p m3290p -U flash:w:$NAME.hex   avrdude  -c buspirate -P /dev/cu.usbserial-A700eEaD -p m3290p -U flash:w:$NAME.hex
  
 The cable between the bus pirate and the ISP port is described here: http://hintshop.ludvig.co.nz/show/buspirate-avr-programming/ The cable between the bus pirate and the ISP port is described here: http://hintshop.ludvig.co.nz/show/buspirate-avr-programming/
 +
 +I use an external power supply:
 +
 +{{:hexabus-powersupply.jpg|}}
  
  
 ==== Issuing MAC addresses ==== ==== Issuing MAC addresses ====
 These MAC addresses have been assigned to the devices: These MAC addresses have been assigned to the devices:
 +
 Range: CC-B5-5A-0B-01-00 bis CC-B5-5A-0B-01-FF  Range: CC-B5-5A-0B-01-00 bis CC-B5-5A-0B-01-FF 
  
-USB-StickCC-B5-5A-0B-01-00+^ Device      ^ MAC Address       ^ IPv6-Address (aaaa:: subnet) ^ 
 +USB-Stick 1    | CC-B5-5A-0B-01-00 
 +| USB-Stick 1    | CC-B5-5A-0B-01-01 | 
 +| Raven1 | CC-B5-5A-0B-01-10 | aaaa::b5:5aff:fe0b:110 | 
 +| Raven2 | CC-B5-5A-0B-01-11 | aaaa::b5:5aff:fe0b:111 | 
 +| Raven3 | CC-B5-5A-0B-01-12 | aaaa::b5:5aff:fe0b:112 | 
 +| Raven4 | CC-B5-5A-0B-01-13 | aaaa::b5:5aff:fe0b:113 | 
 +| Raven5 | CC-B5-5A-0B-01-14 | aaaa::b5:5aff:fe0b:114 |
  
 The MAC addresses are stored in the EEPROM storage, see also http://www.sics.se/contiki/tutorials/tutorial-running-contiki-with-uipv6-and-sicslowpan-support-on-the-atmel-raven.html . They can be modified by re-writing the EEPROM. First, extract the EEP file from the ELF: The MAC addresses are stored in the EEPROM storage, see also http://www.sics.se/contiki/tutorials/tutorial-running-contiki-with-uipv6-and-sicslowpan-support-on-the-atmel-raven.html . They can be modified by re-writing the EEPROM. First, extract the EEP file from the ELF:
Line 34: Line 48:
 NOTE: My initial plan of just modifying the EEPROM file failed. I was not able to change the adress, even using the methods described here: http://www.sics.se/contiki/tutorials/tutorial-running-contiki-with-uipv6-and-sicslowpan-support-on-the-atmel-raven.html Strange things are going on here. NOTE: My initial plan of just modifying the EEPROM file failed. I was not able to change the adress, even using the methods described here: http://www.sics.se/contiki/tutorials/tutorial-running-contiki-with-uipv6-and-sicslowpan-support-on-the-atmel-raven.html Strange things are going on here.
  
 +
 +For the Raven boards, the MAC address can be changed in the apps folder: In 
 +
 +  oktobus/contiki-2.4/platform/avr-raven/apps/raven-webserver/httpd-fs/makefsdata.h
 +  
 +the variables can be adjusted. These values end up in the EEPROM section. Currently, the file looks like this:
 +
 +  #include <avr/eeprom.h>
 +  
 +  /* Link layer ipv6 address will become fe80::11:22ff:fe33:4455 */
 +  //uint8_t mac_address[8]  EEMEM = {0x02, 0x11, 0x22, 0xff, 0xfe, 0x33, 0x44, 0x55};
 +  // Raven1
 +  uint8_t mac_address[8] EEMEM = {0x02, 0xb5, 0x5a, 0xff, 0xfe, 0x0b, 0x01, 0x10};
 +  uint8_t server_name[16] EEMEM = "Raven1";
 +  uint8_t domain_name[30] EEMEM = "localhost";
 +  /*// Raven2
 +  uint8_t mac_address[8] EEMEM = {0x02, 0xb5, 0x5a, 0xff, 0xfe, 0x0b, 0x01, 0x11};
 +  uint8_t server_name[16] EEMEM = "Raven2;
 +  uint8_t domain_name[30] EEMEM = "localhost";
 +  // Raven3
 +  uint8_t mac_address[8] EEMEM = {0x02, 0xb5, 0x5a, 0xff, 0xfe, 0x0b, 0x01, 0x12};
 +  uint8_t server_name[16] EEMEM = "Raven3;
 +  uint8_t domain_name[30] EEMEM = "localhost";
 +  // Raven4
 +  uint8_t mac_address[8] EEMEM = {0x02, 0xb5, 0x5a, 0xff, 0xfe, 0x0b, 0x01, 0x13};
 +  uint8_t server_name[16] EEMEM = "Raven4;
 +  uint8_t domain_name[30] EEMEM = "localhost";
 +  */
  
 ==== Flashing the devices ==== ==== Flashing the devices ====
Line 73: Line 115:
          
  
-Now, connect to the 3290 JTAG connector.+Now, connect to the 3290 ISP connector.
  
   cd oktobus/contiki-2.4/platform/avr-ravenlcd   cd oktobus/contiki-2.4/platform/avr-ravenlcd
   make   make
-  avrdude -c jtag2 -P usb -p m3290 -U lfuse:w:0xE2:m -U hfuse:w:0x99:m -U efuse:w:0xFF:m+  avrdude -c buspirate -P /dev/usbserial-XYZ -p m3290p -U lfuse:w:0xE2:m -U hfuse:w:0x99:m -U efuse:w:0xFF:m
      
  
 +=== Battery-operated mobile box ===
 +The mobile button runs on 9V, delivered by 2 9V block batteries. They are connected in parallel. The capacity of a 9V alkaline cell is approx. 500 mAh. The circuit draws 33mA. Therefore, the setup will run for (2*500mAh)/(33mA) = 30h.
 +
 +
 +=== OpenWRT Router ===
 +The DNSmasq daemon needs to be convinced to use another gateway. This can be done by adding
 +
 +  config dhcp lan
 +    .....
 +   option dhcp_option "6,192.168.1.2" #dns server
 +   option dhcp_option "3,192.168.1.2" #default route
 +   
 +or similar to /etc/config/dhcp.
 +
 +Add to /etc/sysctl.conf
 +  
 +  net.ipv6.conf.all.forwarding=1
 +  
 +The /etc directory of demo router 2 is here: {{:etc-router-demo2.tar.gz|}}
hexabusdemosetup.1305556604.txt.gz · Last modified: 2012/10/30 10:36 (external edit)