beaglebone

Auf Beaglebone Black Ubuntu installieren

Die genaue Vorgehensweise ist bei elinux.org beschrieben.

Benötigte Pakete

  • git
  • wget
  • dosfstools
  • u-boot-tools
  • parted
$ sudo apt-get install git wget dosfstools u-boot-tools parted

Die SD-Karte für den Beaglebone in den Rechner stecken. Die SD-Karte darf nicht gemounted werden.

kontrollieren, wie die SD-Karte erkannt wird

$ ls -l /dev/sd[TAB][TAB]

Es wird das neue Device sdc angezeigt.

$ cd /tmp

Holen der Installationsda­teien mit Hilfe von git

$ git clone https://github.com/RobertCNelson/netinstall.git

Das System auf die SD-Karte installieren.

$ sudo ./mk_mmc.sh --mmc /dev/sdc --dtb am335x-boneblack --distro trusty --firmware --serial-mode

Die SD-Karte aus dem Rechner entfernen und im Beaglebone einlegen. Den Beaglebone per USB am Rechner anschließen . Die Verbindung über minicom herstellen.

$ sudo minicom -D /dev/ttyUSB0

Die Reset-Taste des Beaglebone drücken (rechts außen neben dem Netzwerkstecker.)

Tags: 

bbb lighttpd und python

Zum nachlesen

Kochbuch

$ sudo apt-get install lighttpd
  • diverse Änderungen in /etc/lighttpd/lig­httpd.conf
$ sudo nano /etc/lighttpd/lighttpd.conf
  • mod_cgi hinzufügen
server.modules = (
        "mod_access",
        "mod_alias",
        "mod_compress",
        "mod_redirect",
#       "mod_rewrite",
        "mod_cgi",
)
  • Python dem cgi-Modul zur Verfügung stellen
cgi.assign = ( ".py" => "/usr/bin/python" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi", ".py" )
  • Das Verzeichnis /var/www/cgi-bin anlegen
$ sudo mkdir /var/www/cgi-bin
$ sudo /etc/init.d/lighttpd restart
  • In diesem Verzeichnis dieses Python Script ablegen (mit freundlicher Unterstützung von planzero.org
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#http://planzero.org/blog/2012/01/26/system_uptime_in_python,_a_better_way

from datetime import timedelta

print "Content-Type: text/html"
print
print "<title>Uptime des Beaglebone Black</title>"
print "<h1>Uptime des Beaglebone Black</h1>"

with open('/proc/uptime', 'r') as f:
    uptime_seconds = float(f.readline().split()[0])
    uptime_string = str(timedelta(seconds = uptime_seconds))

print(uptime_string)

Testaufruf mit http://bone.nfix.de/…wnfuptime.py

beaglebone black bbb und seafile

Nach dieser Anleitung habe ich den seafile-server auf meinem Weihnachtsgeschenk installiert

$ sudo su
# useradd -r seafile
# cd /opt
# mkdir seafile
# cd /opt/seafile
# wget http://seafile.googlecode.com/files/seafile-server_2.0.3_pi.tar.gz
# tar -xvf seafile-server_2.0.3_pi.tar.gz
# rm seafile-server_2.0.3_pi.tar.gz
# mv seafile-server-2.0.3 seafile-server
# cd seafile-server/
# ./setup-seafile.sh
# mkdir /opt/seafile/logs
# chown seafile:seafile -R /opt/seafile/
# chown seafile:seafile -R /var/seafile-data/

Seafile Server

This is your config information:

server name:        bone2013
server ip/domain:   bone.nfix.de
server port:        10001
seafile data dir:   /var/seafile-data
seafile port:       12001
httpserver port:    8082

Seahub

Seahub is the web interface for seafile server.

-----------------------------------------------------------------
Your seafile server configuration has been finished successfully.
-----------------------------------------------------------------

run seafile server:     ./seafile.sh { start | stop | restart }
run seahub  server:     ./seahub.sh  { start <port> | stop | restart <port> }

-----------------------------------------------------------------
If you are behind a firewall, remember to allow input/output of these tcp ports:
-----------------------------------------------------------------

port of ccnet server:         10001
port of seafile server:       12001
port of seafile httpserver:   8082
port of seahub:               8000

When problems occur, Refer to https://github.com/…seafile/wiki for information.

Den server beim Booten starten

# nano /etc/init.d/seafile-server
#!/bin/sh

# Change the value of "user" to your linux user name
user=seafile

# Change the value of "script_path" to your path of seafile installation
seafile_dir=/opt/seafile
script_path=${seafile_dir}/seafile-server-2.0.4
seafile_init_log=${seafile_dir}/logs/seafile.init.log
seahub_init_log=${seafile_dir}/logs/seahub.init.log

# Change the value of fastcgi to true if fastcgi is to be used
fastcgi=false
# Set the port of fastcgi, default is 8000. Change it if you need different.
fastcgi_port=8000

case "$1" in
        start)
                sudo -u ${user} ${script_path}/seafile.sh start > ${seafile_init_log}
                if [  $fastcgi = true ];
                then
                        sudo -u ${user} ${script_path}/seahub.sh start-fastcgi ${fastcgi_port} > ${seahub_init_log}
                else
                        sudo -u ${user} ${script_path}/seahub.sh start > ${seahub_init_log}
                fi
        ;;
        restart)
                sudo -u ${user} ${script_path}/seafile.sh restart > ${seafile_init_log}
                if [  $fastcgi = true ];
                then
                        sudo -u ${user} ${script_path}/seahub.sh restart-fastcgi ${fastcgi_port} > ${seahub_init_log}
                else
                        sudo -u ${user} ${script_path}/seahub.sh restart > ${seahub_init_log}
                fi
        ;;
        stop)
                sudo -u ${user} ${script_path}/seafile.sh $1 > ${seafile_init_log}
                sudo -u ${user} ${script_path}/seahub.sh $1 > ${seahub_init_log}
        ;;
        *)
                echo "Usage: /etc/init.d/seafile {start|stop|restart}"
                exit 1
        ;;
esac
# /etc/init.d/seafile-server start
Tags: 

Seiten