Doorbell

From Voidwarranties - Hackerspace Antwerp, Belgium
Revision as of 00:12, 24 July 2014 by Ivom (Talk | contribs)
Jump to: navigation, search


Doorbell
What:
Voidwarranties acces and availability platform V.A.A.P
Doorbel.jpg
Participants:
Jobj
Category:
Electronics
Locations:
Den Bunker

Contents

Scoping the extendable monitoring rig

This platform exists in physical and logical form so it will be created out of sensors, detectors, push buttons but will also contain decision logarithms and best practice policy.

Requirements

This might all sound abstract but in practice it will be a doorbell that decides to work depending on the fact that the space is:

Hardware implementation

Missing

Soekris prepping

There might be better boards available, but the soekris 4526 is what is available locally.

PXE booting the soekris beast

To put a useful OS on the board some hurdles are supposed to be taken. The board allows to boot over the network with PXE, effectively downloading the kernel and a ramdisk over ethernet and starting. To allow for this you need to do several things:

  1. A TFTP server, providing a download location for the kernel and ramdisk for the unit, which will finally end you with a command prompt. This would allow to start installing data on the flash limited amount of RAM available.
  2. A DHCP server instructing the board after requesting info where the tftpd data. Just an essential convenience on the network at early PXE boot
  3. A serial console view to monitor what the board is actually doing
  4. wireshark, to see what is going wrong during the PXE-phase, whilst the serial console is only showing garbled text...

So far the following is in place:

A TFTP daemon

On a Ubuntu install 10.04 LTS

$ sudo apt-get install tftpd-hpa

Have this in your /etc/default/tftpd-hpa:

# /etc/default/tftpd-hpa

TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/var/lib/tftpboot"
TFTP_ADDRESS="0.0.0.0:69"
# disable options. Het soekris bordje vindt "opties" blijkbaar niet goed
#TFTP_OPTIONS="--secure"

And restart the tftp-hpa daemon.

A DHCP daemon

Assumption here is to have the tftpd process running on the same machine as the DHCP server!

$ sudo apt-get install dhcp3-server

Contents of a sample /etc/dhcp3/dhcpd.conf file are as follows:

ping-check = 1;
log-facility local7;

option broadcast-address 192.168.178.255;
option domain-name-servers 192.168.178.1;

subnet 192.168.178.0  netmask 255.255.255.0 {
        range 192.168.178.210 192.168.178.250;
}
# Soekris installations
group {
        #filename="pxelinux.0" ; # Results in: Only absolute filenames allowed
        #filename="/pxelinux.0" ; # Results in: Forbidden directory
        filename="/var/lib/tftpboot/pxelinux.0" ;
        option domain-name-servers 192.168.178.1 ;
        option routers 192.168.178.1 ;
        host soekris4526 {
                hardware ethernet 00:00:24:c2:38:0c ;
        }
}

Please note, you would probably essentially need to change the network (192.168.178.x), use a ethernet cross-cable or both.

Minicom setup

To monitor the board during early-boot you need to set up mincom (if you like cu too...).
The following eternally interesting key strokes are of value:

Have this as the communication settings for Serial port setup to monitor the PXE process:

OPTI+-----------------------------------------------------------------------+      
Comp| A -    Serial Device      : /dev/ttyUSB0                              |      
Port| B - Lockfile Location     : /var/lock                                 |      
    | C -   Callin Program      :                                           |      
Pres| D -  Callout Program      :                                           |      
    | E -    Bps/Par/Bits       : 19200 8N1                                 |      
    | F - Hardware Flow Control : No                                        |      
    | G - Software Flow Control : No                                        |      
    |                                                                       |      
    |    Change which setting?                                              |      
    +-----------------------------------------------------------------------+

Now, you also know the correct Baud-rate :) Save this file (don't forget running minicom as root, or else you waste more time...)

Setting up debian linux 5.0 netboot files

  1. cd /var/lib/tftpd
  2. wget http://ftp.nl.debian.org/debian/dists/squeeze/main/installer-i386/current/images/netboot/netboot.tar.gz
  3. tar zxvf netboot.tar.gz

Follow Ultimate netboot howto. DHCP and TFTP are set up already...

So far so good. Booting as viewed throug minicom looks promising, but the linux kernel hangs or the serial console fails to show what is wrong after the following:

POST: 0123456789bcefghipajklnoq,,,tvwxy comBIOS ver. 1.24 20040312 Copyright (C) 2000-2004 Soekris Engineering. net45xx CPU 80486 133 Mhz 0000 Mbyte Memory0002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640064 Pri Mas 064MB ATA Flash Disk LBA 977-4-32 62 Mbyte PXE-M00: BootManage UNDI, PXE-2.0 (build 082) Slot Vend Dev ClassRev Cmd Stat CL LT HT Base1 Base2 Int ------------------------------------------------------------------- 0:00:0 1022 3000 06000000 0006 2280 00 00 00 00000000 00000000 00 0:18:0 100B 0020 02000000 0107 0290 00 3F 00 0000E001 A0000000 10 Seconds to automatic boot. Press Ctrl-P for entering Monitor. 5 4 comBIOS Monitor. Press ? for help. > show ConSpeed = 9600 ConLock = Enabled ConMute = Disabled BIOSentry = Enabled PCIROMS = Enabled PXEBoot = Enabled FLASH = Primary BootDelay = 5 BootPartition = Disabled ShowPCI = Enabled Reset = Hard > boot BootManage UNDI, PXE-2.0 (build 082) BootManage PXE-2.0 PROM 1.0, NATSEC 1.0, SDK 3.0/082 (OEM52) Copyright (C) 1989,2000 bootix Technology GmbH, D-41466 Neuss. PXE Software Copyright (C) 1997, 1998, 1999, 2000 Intel Corporation. Licensed to National Semiconductor CLIENT MAC ADDR: 00 00 24 C2 38 0C.^H DHCP./^H/^H-^H-^H\^H\^H|^H|^H/^H/^H-^H-^H\^H\^H|^H|^H/^H/^H-^H-^H\^H\^H|^H|^H/^H/^H-^H-^H\^H\^H|^H|^H/^H/^H-^H-^H\^H\^H CLIENT IP: 192.168.178.35 MASK: 255.255.255.0 DHCP IP: 192.168.178.21 GATEWAY IP: 192.168.178.1 TFTP. TFTP.\^H|^H PXELINUX 4.02 debian-20101014 Copyright (C) 1994-2010 H. Peter Anvin et al!PXE entry point found (we hope) at 9E79:0106 via plan AUNDI code segment at 9E79 len 1360UNDI data segment at 9A33 len 4460Getting cached packet 01 02 03My IP address seems to be C0A8B223 192.168.178.35ip=192.168.178.35:192.168.178.21:192.168.178.1:255.255.255.0BOOTIF=01-00-00-24-c2-38-0cTFTP prefix: /var/lib/tftpboot/Trying to load: pxelinux.cfg/01-00-00-24-c2-38-0c ok PXELINUX 4.02 debian-20101014 Copyright (C) 1994-2010 H. Peter Anvin et al boot: PXELINUX 4.02 debian-20101014 Copyright (C) 1994-2010 H. Peter Anvin et al boot: @lqqqqqqqqqqqqqqqqqqqqqqqqqqqkx Installer boot menu^G xtqqqqqqqqqqqqqqqqqqqqqqqqqqqux Install xx Advanced options > xx Help xx xx xx xx xx xx xx xmqqqqqqqqqqqqqqqqqqqqqqqqqqqjPress ENTER to boot or TAB to edit a menu entryAutomatic boot in 0 seconds...lqqqqqqqqqqqqqqqqqqqqqqqqqqqkx Installer boot menu^G xtqqqqqqqqqqqqqqqqqqqqqqqqqqqux Install xx Advanced options > xx Help xx xx xx xx xx xx xx xmqqqqqqqqqqqqqqqqqqqqqqqqqqqjPress ENTER to boot or TAB to edit a menu entryLoading debian-installer/i386/linux..... Loading debian-installer/i386/initrd.gz.........ready. Probing EDD (edd=off to disable)... ok Press <ENTER> to see video modes available, <SPACE> to continue, or wait 30 sec

After this minicom shows not output anymore. It seems that the kernel does however boot and loads it's initrd.gz + accepts the other options it is feed.

At this point the adventure ends for now... Some helping hands are appreciated.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox
Content Creation
Belgian Spaces