Doorbell

From Voidwarranties - Hackerspace Antwerp, Belgium
Revision as of 16:49, 29 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...)

Boot process

For unknown reasons the PXE boot sequence does not reflect in a visually appealing display in the serial console output. Through a wireshark capture it was noticable that the linux kernal and the ramdisk file are downloaded by the soekris board. During that processes the serial console post some gibberish output in the upper left 10x4 character output, showing it is doing something (as confirmed by the concurrent wireshark capture). Then the console screen turns blank. Some help would be very helpful to get this issue resolved! Currently stuck...

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox
Content Creation
Belgian Spaces