Montag, 5. November 2012

Raspberry Pi as TOR Middle Relay

The onion Router - Tor is a service that helps you to protect your anonymity while using the Internet. 

The goal of the Tor project is to provide a censorship-resistant & safer access to the Internet. It is the most widely used free & open source anonymization technique in existence. It also makes it possible to host services like websites in a secure and anonymous fashion ("hidden services")

Obviously, TOR needs a large amount of servers. As the TOR network is not a commercial organisation, it requires voluntary supporters. But this support can be easy achieved with your Raspberry Pi.

How it Works

Tor helps to reduce the risks of both simple and sophisticated traffic analysis by distributing your transactions over several places on the Internet, so no single point can link you to your destination. The idea is similar to using a twisty, hard-to-follow route in order to throw off somebody who is tailing you — and then periodically erasing your footprints. Instead of taking a direct route from source to destination, data packets on the Tor network take a random pathway through several relays that cover your tracks so no observer at any single point can tell where the data came from or where it's going.
 Art by Molly Crabapple & Words by John Leavitt
"Octopus Not So Great!"

WHAT IS A TOR RELAY? description from

Tor relays are also referred to as "routers" or "nodes." They receive traffic on the Tor network and pass it along. Check out the Tor website for a more detailed explanation of how Tor works.
There are three kinds of relays that you can run in order to help the Tor network: middle relays, exit relays, and bridges.

For greater security, all Tor traffic passes through at least three relays before it reaches its destination. The first two relays are middle relays which receive traffic and pass it along to another relay. Middle relays add to the speed and robustness of the Tor network without making the owner of the relay look like the source of the traffic. Middle relays advertise their presence to the rest of the Tor network, so that any Tor user can connect to them. Even if a malicious user employs the Tor network to do something illegal, the IP address of a middle relay will not show up as the source of the traffic. That means a middle relay is generally safe to run in your home, in conjunction with other services, or on a computer with your personal files. See our legal FAQ on Tor for more info.

An exit relay is the final relay that Tor traffic passes through before it reaches its destination. Exit relays advertise their presence to the entire Tor network, so they can be used by any Tor users. Because Tor traffic exits through these relays, the IP address of the exit relay is interpreted as the source of the traffic. If a malicious user employs the Tor network to do something that might be objectionable or illegal, the exit relay may take the blame. People who run exit relays should be prepared to deal with complaints, copyright takedown notices, and the possibility that their servers may attract the attention of law enforcement agencies. If you aren't prepared to deal with potential issues like this, you might want to run a middle relay instead. We recommend that an exit relay should be operated on a dedicated machine in a hosting facility that is aware that the server is running an exit node. The Tor Project blog has these excellent tips for running an exit relay. See our legal FAQ on Tor for more info.

Bridges are Tor relays which are not publicly listed as part of the Tor network. Bridges are essential censorship-circumvention tools in countries that regularly block the IP addresses of all publicly listed Tor relays, such as China. A bridge is generally safe to run in your home, in conjunction with other services, or on a computer with your personal files.

Setting up a TOR Middle Relay on a Raspberry Pi

It is really easy to set up a Raspberry Pi Tor Relay to help the TOR Project by gifting some of your Bandwidth from your internet connection and CPU-Power of your Raspberry Pi and a little bit of your electricity.

We need:

  • 1x 2-4 GB SD-Card  from your old digicam (a 8GB class10 is available for 7€ at amazon)
  • 1x a small Power Cable (pigtail or 3ft. 0.99$ on china-ebay)
  • 1x a short ethernet cable (8" - 3ft. 0.99$ on china-ebay)
  • 1x Raspberry Pi (from Farnell 43€ including shipping to europe in ~5days)
  • a Punnet case out Paper for 0$, selfbuilt with Lego ?$, cheapest plastic case on eBay for 8.9$, my case is the Pibow from Pimoroni for 17.95£
SUM:  45-50€ to run a Tor middle relay to boost and strenghten the TOR Project.

I am powering my Pi from my Router USB-Port, which saves me another micro-USB Power Supply Unit. Booting to the GUI (LXDE in Raspbian) is disabled. And the RAM for the GPU is set to a minimum. Maximum RAM for the ARM CPU.

First you need to install Raspbian. HowTo#1& HowTo#2 is on my Blog available. Then set a static IP Address on your Pi.

Install TOR on your Raspberry Pi. Tor is available as a Debian Package which makes this step very easy.

$ sudo apt-get update
$ sudo apt-get install tor

When the installations is done, you have to edit the TOR configuration file.

Configuration FILE torrc

The file is available at location /etc/tor/ .

First make a backup of your torrc configuration file!

$ sudo cp /etc/tor/torrc /etc/tor/torrc.backup

Edit the configuration file.

$ sudo vi /etc/tor/torrc

You need to edit/change up to ~10 variables.

SocksPort 0
## Tor opens a socks proxy on port 9050 by default -- even if you don't
## configure one below. Set "SocksPort 0" if you plan to run Tor only
## as a relay, and not make any local application connections yourself.

Log notice file /var/log/tor/notices.log

## Logs go to stdout at level "notice" unless redirected by something
## else, like one of the below lines. You can have as many Log lines as
## you want.
## We advise using "notice" in most cases, since anything more verbose
## may provide sensitive information to an attacker who obtains the logs.
## Send all messages of level 'notice' or higher to /var/log/tor/notices.log

RunAsDaemon 1
## Uncomment this to start the process in the background... or use
## --runasdaemon 1 on the command line. This is ignored on Windows;
## see the FAQ entry if you want Tor to run as an NT service.

ORPort 9001
## Required: what port to advertise for incoming Tor connections.

DirPort 9030 # what port to advertise for directory connections
## Uncomment this to mirror directory information for others. Please do
## if you have enough bandwidth.

ExitPolicy reject *:* # no exits allowed
This is necessary to run the TOR Node as a Relay only without the Exit-node functionality. 

Nickname rasptorxxx  # (you can chose whatever you like)
## A handle for your relay, so people don't have to refer to it by key.

RelayBandwidthRate 100 KB  # Throttle traffic to 100KB/s (800Kbps)
RelayBandwidthBurst 200 KB # But allow bursts up to 200KB/s (1600Kbps)
## Define these to limit how much relayed traffic you will allow. Your
## own traffic is still unthrottled. Note that RelayBandwidthRate must
## be at least 20 KB.
## Note that units for these config options are bytes per second, not bits
## per second, and that prefixes are binary prefixes, i.e. 2^10, 2^20, etc.

ControlPort 9051
## The port on which Tor will listen for local connections from Tor
## controller applications, as documented in control-spec.txt.
This is necessary for the Command Line Gui Tool TOR-ARM

After Changing of the settings you have to restart your Tor Server.

$ sudo /etc/init.d/tor restart

Now check if your Server is up and running. Check your logfile for a Success notice.

$ cat /var/log/tor/log

If your installation and configuration was successful there should be a entry with "[notice] Tor has successfully opened a circuit. Looks like client functionality is working." .

$ cat /var/log/tor/notices.log
Look out for "[notice] Self-testing indicates your DirPort is reachable from the outside. Excellent."

Thanks, you are now volunteering to the TOR-Project. Karma Points are raising!

You should be able to find now your Tor-Relay on a Torstatus List after a few hours.

Installing the ARM - TOR Status Monitor

The anonymizing relay monitor (arm) is a terminal status monitor for Tor, intended for command-line aficionados, ssh connections, and anyone with a tty terminal. This works much like top does for system usage, providing real time statistics for: 

It shows several useful informations.
  • the running tor-version
  • tor-flags
  • used ports
  • nickname if set
  • fingerprint of your node
  • uptime of your server
  • process id of tor
  • CPU usage of TOR and ARM process
  • memory usage of TOR process
  • bandwith and limits
  • in and outgoing bandwith monitor
  • events in logfiles
  • editing configuration
  • many many more
Installing TOR-ARM

You ned to set the Control Port in your Tor configuration file as described above! The Monitor Program needs this Port to control the tor-process and receive data.

$ sudo apt-get install tor-arm


$ sudo arm
This starts arm as root, better is to start the Status Monitor with the user the TOR Server is using.
[ARM_NOTICE] Arm is currently running with root permissions. This is not a good idea, and  will still work perfectly well if it's run with the same user as Tor (ie, starting with "sudo -u debian-tor arm").
Start arm with the TOR user.
$ sudo -u debian-tor arm

Some Useful Links:

Samstag, 27. Oktober 2012

Installing Bodhi Linux on Raspberry Pi

Bodhi Linux is a Linux Distribution leveraging the fast, customizable, and beautiful Enlightenment Desktop. Enlightenment coupled with a minimal set of utilities such as a browser, text editor, and package management tools form the solid foundation of Bodhi Linux.

This should also work for other distributions like Raspbian, Occidentalis, etc ... which are available as SD-Card image.

First download the Bodhi Linux ARMHF Image from Bodhi Linux

The files are hosted on Sourceforge and are available there:

There are also the md5sums and SHA1 checksums available to check your downloaded files, if the download worked correctly.
On any Linux machine there should be the md5sum command available.
For windows user are also programs like winmd5sum available to do this check. If this check was successful, can extract the *.tar.gz file.

Writing the image to Sd-Card 

For windows user there is the tool win32-image-writer available. You can download it from Do not try to drag and drop or otherwise copy over the image without using dd or Win32DiskImager – it won’t work. If this explanation doesn' t helped you, there is a beginners guide on .

For the Linux/*nix Users:
Check your devices directory with
$ ls /dev/sd*
Insert your SD-Card to your sd-card slot on your computer.
Then check again your devices directory, the new device (your SD-card) should now be listed as a new entry in this directory. Your first Harddisk is normally /dev/sda, and /dev/sda1, /dev/sda2 for your partitions.
Your SD-Card should be something like /dev/sdb.

We can easily use the old unix tool dd.

The command needs the parameters InputFile and OutputFile and BlockSize.

dd if=image.img of=/path/to/drive bs=1M

Take care to don't mismatch if and of, or take the wrong device-path.

Then unmount the sd-card and insert it to your Raspberry Pi.

Your Raspberry Pi should boot now with Bodhi.

Check my other Tutoria for First Steps after Install

Montag, 22. Oktober 2012

overclocking Raspberry Pi & config.txt

There are a few settings in the config.txt file available to overclock the Raspberry Pi.

The Standard Settings should be 700MHz ARM CPU, 250MHz Core, 400Mhz SDRAM without overvolting.

 The easiest and fastest way is too use the raspi-config tool to overclock your Board. There is an overclock section, where you can set the maximum frequency for the CPU.

If your board is supporting the highest Turbo Mode, there is a performance improvement up to 50% compared to the 700Mhz. This is not only the
300Mhz+ CPU Speed, but also the faster RAM+25% and Core+100%.

A good and reliable power supply is suggested when you try overclocking. 

The raspi-config tool has 5 overclock presets. It is not guaranteed to work flawless. But it is improving. Try the modest or medium one for some weeks. If there are no problems you can take the next step. I have tested mine, with different Distributions and now it is running in Turbo (=highest) Mode without problems. Temperature in 24/7 mode stays at ~55°C in a Pibow case.
If you choose too high an overclock, your Pi may fail to boot, in which case holding down the shift key during boot up will disable the overclock for that boot, allowing you to select a lower level.

The Raspberry Pi enables dynamically overclocking and overvolting when the CPU is busy. !!!without affecting your warranty!!! If the BCM2835 is getting too hot (85°C) it limits the Turbo mode and the Raspberry Pi is running only in the normal mode. This should only happen, in really hot environments. 


config.txt or overclocking by hand

The config.txt file is stored on the first partition on the SD-Card. Your Raspi Linux System mounts the first partition to /boot , then config.txt is stored on /boot/config.txt. It is read by the GPU before the ARM Core is started. It is used to set system configuration parameters like, overscan, overclocking, display_modes, additional licenses for MPG-2/VC-1 codecs, ... 

Common Used parameters:

  • arm_freq Frequency of ARM in MHz. Default 700
  • core_freq Frequency of GPU processor core in MHz. It have an impact on ARM performance since it drives L2 cache. Default 250     
  • sdram_freq Frequency of SDRAM in MHz. Default 400       
  • over_voltage ARM/GPU core voltage adjust. [-16,8] equates to [0.8V,1.4V] with 0.025V steps. force_turbo will allow values higher than 6. Default 0 (1.2V)
  • force_turbo Disables dynamic cpufreq driver and minimum settings below. Enables h264/v3d/isp overclock options. Default 0
  • initial_turbo Enables turbo mode from boot for the given value in seconds (up to 60) or until cpufreq sets a frequency. Can help with sdcard corruption if overclocked. Default 0 
Detailed List is Here for more different Settings like arm_freq_min, core_freq_min or other settings to underclock, higher values or other tweaks.
Be carefull with overriding limits (current and temperature)!!!

Voiding Warranty

You will loose your warranty for your device if you use following settings combined.
(force_turbo || current_limit_override || temp_limit>85) && over_voltage>0

Forcing the Turbo Mode together with OverVoltag will set the Sticky Bit.
Disabling the current limit together with overvoltage will set the Sticky Bit.
Increasing the Templimit over 85°C together with overvoltage will set the Sticky Bit.

Sticky Bit

The Sticky Bit is a bit which is only readable in the CPU and gets set when some dangerous settings are combined. If you send your Raspberry Pi back to your seller because it is broken, they can find out if you have used too dangerous overclock settings. Then there will be no refund. 
You can check your sticky bit with
$ cat /proc/cpuinfo

In the line with revision there should be something like this, which shows which manufacturing revision you are holding in your hand.
Revision    : 0002

If the sticky bit is set it looks like this:
Revision    : 1000002

Checking Temperature and CPU Speed
If you want to know your CPU speed which is at the moment used, you can find out with following commands:
$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq

pi@raspberrypi ~ $ cat /sys/class/thermal/thermal_zone0/temp

The speed is measured in KHz, and has to be divided by 1000 to get the MHz. The temperature has also to be divided by 1000, to get the temperature in °C, which is in this example 55°C.

To test if the Raspberry Pi is using the CPU_driver when needed open a second SSH shell and type in the first something which needs really much CPU power, like:
$ sudo apt-get update

In the other window check your speed a ten times.
pi@raspberrypi ~ $ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq

It should sometimes show the overclocked speed when needed. Only if there is Load on the CPU.
Post from DOM in the Raspberry Pi Forum

Sonntag, 21. Oktober 2012

static IP address on a Raspberry Pi and Debian GNU/Linux

Connect to your Raspberry Pi with SSH

If you don't know your IP address, you can either use the hostname. The ipscanner from my former post should help you finding out the IP address from your Raspberry Pi.

# ssh pi@yourIPaddress
pi@raspberrypi.lan's password: 

pi@raspberrypi ~ $ cd /etc/network
pi@raspberrypi /etc/network $ sudo vi interfaces

The output should look similar like this.

auto lo

iface lo inet loopback
iface eth0 inet dhcp

auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
        wpa-ssid "my-network-ssid"
        wpa-psk "my-wifi-password"

now change the line"iface lo inet loopback" to your demands:

iface eth0 inet static
# your IP Address 
your netmask
 # your router/modem used as your gateway

Lines starting with `#' are ignored. Note that end-of-line comments are NOT supported, comments must be on a line of their own.

Then make a reboot:

pi@raspberrypi ~ $ sudo reboot

Your Pi should reboot now with the new ip address.

There is a good manual available for the interface.

pi@raspberrypi ~ $ man interfaces

The static Method
       This method may be used to define Ethernet interfaces with statically allocated IPv4 addresses.

  • address address Address (dotted quad/netmask) required
  • netmask mask Netmask (dotted quad or CIDR)  
  • broadcast broadcast_address Broadcast address (dotted quad, + or -). Default value: "+"
  • gateway address - Default gateway (dotted quad)

To-Do after install on Raspberry Pi

First check your IP which your Raspberry Pi has got in your network from your DHCP Server or Router.

Angry IP Scanner (or simply ipscan) is an open-source and cross-platform network scanner designed to be fast and simple to use. It scans IP addresses and ports as well as has many other features.

If you found out your IP address connect with SSH to your Raspberry Pi.

with hostname

# ssh pi@raspberry.lan 
or with ip

# ssh pi@yourIPaddress

Standard Login: 
User:pi Password: raspberry

cave@cave:~> ssh pi@raspberrypi.lan
pi@raspberrypi.lan's password:

Linux raspberrypi 3.2.27+ #160 PREEMPT Mon Sep 17 23:18:42 BST 2012 armv6l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.

Type 'startx' to launch a graphical session

Last login: Sun Oct 21 15:03:41 2012 from cave.lan
pi@raspberrypi ~ $ 

make an update for your Operating System.
# sudo apt-get update
# sudo apt-get upgrade

then you can run
# sudo raspi-config

Start the update at first. Then change your settings for following points.
  • change_pass - sets the password for your User "pi"
  • expand_rootfs - to grow the second partition and fill the SD-Card
  • keyboard
  • locales
  • timezone
  • memory split - define the amount of RAM CPU and GPU
  • update - update the raspi-config tool. 
  • overclock - sets 5 different overclock settings. With this tool it should not void your warranty. After your system is running without problems, try out some
After that, make a reboot, and connect again with SSH.

Now your system is updated and ready for use. You have also learned how to use the raspi-config tool.

Samstag, 20. Oktober 2012

Install Raspberry Pi images on SD-Card

The Raspberry Pi is supported from several different Linux distributions.
Here is a list of the most available distributions.


  • Bodhi Linux  - derived from Raspbian featuring the Enlightenment Desktop. Enlightenment is a lightweight Desktop Environment but also nice looking

  • Occidentalis - derived from Raspbian, Hardware-Hacking friendly. Comes with support for SPI, I2C, PWM, kernel Modules...


Arch Linux ARM is based on Arch Linux, which aims for simplicity and full control to the end user. Note that this distribution may not be suitable for beginners. The latest version of this image uses the hard-float ABI, and boots to a command prompt in around ten seconds.


The Raspberry Pi can also be used as a Home Theater PC. The XBMC developers were provided with early Alpha Boards to port XBMC to the Raspberry Pi Board and support the Videocore IV GPU.
  • OpenELEC - Open Embedded Linux Entertainment Center, Image Download, distribution only developed for XBMC. Fast running 
  •  RaspBMC - Raspbmc is a minimal Linux distribution based on Debian that brings XBMC to your Raspberry Pi.

Installation with a Linux/Unix PC

  • Download and check the MD5SUM/SHA256SUM from the image after downloading.
  • put the SD-Card into your computer
  • check your actually mounted partitions with "ls /dev/sd*"
  • run the command "dmesg | tail" to see on witch path your sd-card is available. 
  • now there should be the new device available. check it with "ls /dev/sd*" 
  • One thing worth noting though is that /path/to/drive should not include any partition number. An example path would be something like: /dev/sdb 
  • sudo dd if=image.img of=/path/to/drive bs=1M  DD is a tool which reads data from if(Input File) and writes it to of(Output File). Please take care to not mix up the if & of parameters!!!


After writing the image file onto the SD-Card there are two partitions on it. The first partiton /dev/sdb1 is a ~65MB FAT32 partition with the bootloader and ELF and config.txt files, etc ... . The second partition is mostly a ext partition with the root filesystem. But this partition is not as big as the SD-Card size. In Raspbian there is the Raspi-config tool, which offers a possibility to resize and grow the partition to use the whole SD-Card.

There are several partitioning tools available. But i mostly use the Program Gparted.
For this tool are 2 specialised LIVE Distros available.
With these tools it is easy to repartition the SD-Card, and grow and resize the second partition.

Freitag, 28. September 2012

unbrick WR703n

This is copied directly from Here All due honor goes directly to the creators. 

Unbrick wr703n wifi router

It worked form me perfectly with a CP210x USB TTL serial bridge, little soldering problems, and some initial tinkerings with the TFTP server.

It is copied because i don't want to loose this important information if the blog goes maybe offline.

----------------- QUOTE BEGIN -----------------

if like myself you push the thing a little too far, you should find this usefull ;)

If nothing is responding anymore on your router :

locate the GND, TX and RX on the board :
Posted Image

solder some wire on it, this is very difficult, because it is really small and the solder doesn't stick well on it. Once it is done, glue everything and let some easy access wire, that could be usefull after.

Plug a 3.3V ttl serial adapter (pl2303, ftdi, ...) on the wire and open a serial terminal (minicom, realterm, docklight, ...) @ 115200/8/N/1/XON-XOFF.

power on the wr703n and quiclky send "tpl" followed by enter to the terminal, this will make the wr703n enter in rescue U-boot hornet.

install a small tftp server on your computer (ex: and plug an ethernet cable between your computer and the wr703n.
Configure the IP adress of your computer to and put the file
on the tftp server.

On the serial terminal enter the following lines :

hornet> tftpboot 0x81000000 openwrt-ar71xx-generic-tl-wr703n-v1-squashfs-factory.bin
hornet> erase 0x9f020000 +0x3c0000
hornet> cp.b 0x81000000 0x9f020000 0x3c0000
hornet> bootm 9f020000

wait until it has uploaded and another extra couple of second before reset.

unplug the power, wait a bit, replug, the system should be freshly working...


----------------- QUOTE END -----------------

Montag, 24. September 2012

Cron Tutorials

Freitag, 10. August 2012

openWRT Bridge with Relayd (Pseudobridge)

Recipe for Bridging with Atheros Chipsets

Works for TP-Link TL-WR703n as an example.

based on this two links

Connect your Router with your WAN-Router Device (modem, switch, ... )
root@OpenWrt:~# opkg update
root@OpenWrt:~# opkg install relayd

root@OpenWrt:~# opkg install luci-proto-relay
root@OpenWrt:~# opkg install wpad

root@OpenWrt:~# /etc/init.d/relayd enable

set ip Address of the LAN to something different
root@OpenWrt:/etc/config vi network
config interface lan
        option ifname   eth0
        option type     bridge
        option proto    static
        option ipaddr 
        option netmask

reboot or restart network.
root@OpenWrt:~# /etc/init.d/network restart

Set your IP Address of your PC to
Connect your Router with your PC.
disable any DHCP.

Connect to Luci with your browser to

Go to network, wifi make a scan
join your wifi,

make all your settings for the Wifi device, at this part a new interface is created

Go to Network->Interfaces
Edit the new created interface (WWAN) for example

Make a static or dhcp adress here.
disable any DHCP.

Create a new Interface "stabridge" in the Interface section.
use the "relay bridge" protocol

Relay between networks WWAN and LAN.

lan/wwan is set to IP address in a different net
interface stabridge is set to relay between lan/eth0 and wwan/wlan0
wlan0/wwan is interface is assigned

change Firewall rules

Zone Forwarding, set to Accept


Tightvncserver keyboard mismapped/scram

Montag, 6. August 2012

mumuDVB on openWRT and FSG-3

Work in process

Howto for NSLU2

WL500gp with DVB-T stick <-- need google translator

 root@fsg3:~# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 004: ID 048d:9135 Integrated Technology Express, Inc. Zolid Mini DVB-T Stick

[  820.358795] usb 1-5: new high-speed USB device number 4 using ehci_hcd

Bus 002 Device 005: ID ffc0:0040
Bus 001 Device 004: ID 1bcf:2881 Sunplus Innovation Technology Inc.
Bus 002 Device 004: ID 8086:0189 Intel Corp.
Bus 003 Device 004: ID 048d:9135 Integrated Technology Express, Inc. Zolid Mini DVB-T Stick

[13532.230198] usb 3-1: new high-speed USB device number 5 using xhci_hcd
[13532.250902] usb 3-1: ep 0x81 - rounding interval to 32768 microframes, ep desc says 0 microframes
[13532.250913] usb 3-1: ep 0x2 - rounding interval to 32768 microframes, ep desc says 0 microframes
[13532.250921] usb 3-1: ep 0x84 - rounding interval to 32768 microframes, ep desc says 0 microframes
[13532.250928] usb 3-1: ep 0x85 - rounding interval to 32768 microframes, ep desc says 0 microframes
[13532.252395] it913x: Chip Version=02 Chip Type=9135
[13532.253837] it913x: Dual mode=0 Remote=5 Tuner Type=6b
[13532.254874] dvb-usb: found a 'ITE 9135 Generic' in cold state, will try to load a firmware
[13532.258261] dvb-usb: did not find the firmware file. (dvb-usb-it9137-01.fw) Please see linux/Documentation/dvb/
for more details on firmware-problems. (-2)
[13532.258271] it913x: DEV it913x Error

T:  Bus=01 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  2 Spd=480  MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=048d ProdID=9135 Rev= 2.00
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 4 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0m

Dienstag, 31. Juli 2012

openWRT Performance

anything -> encode -> MPEG4 and h.264

encoding Videos for Raspberry Pi


SWAP wih openWRT

:!: The package block-mount is required:
  1. Install
    opkg update
    opkg install block-mount
  2. enable (make it start automatically on every boot up)
    /etc/init.d/fstab enable
  3. and start (right now)
    /etc/init.d/fstab start
Whenever you change your configuration, restart this to make it take effect:
/etc/init.d/fstab restart
usefull commands

package swap-utils
 mkswap, swapon and swapoff.
cat /proc/meminfo


Howto Swapfile

Montag, 30. Juli 2012

openWRT Samba share

How to Share a Directory to Win/Linux Environment.

Force user = root
force directory mode = 0777
force create mode = 0777
force group = root
# deny  user = root

Montag, 6. Februar 2012

FSG-3 as a Server running OpenWRT

Functions that should work for my FSG-3
  • USB-Sound Stick
    • Speedlink SL-8850 . . . OK 
    • Chipset: 6911

Samstag, 28. Januar 2012

reset openWRT firmware with fsg-3

Howto restore FSG-3 with OpenWRT default image

installed openwrt kernel on flash-partition kern1 and rootfilesystem on /dev/sda1
backuped freecom firmware on flash-partition kern2 and rootfilesystem on /dev/sda2

connect serial console to your fsg-3,

hit ^C when booting to start the RedBoot console prompt and stop processing boot script.

to start the old freecom kernel from the second flash kernel image and the second hdd partition

RedBoot> fis load kern2
RedBoot> exec -c "console=ttyS0,115200 root=/dev/hda2 mem=64M@0x00000000"

make a directory in /tmp

mkdir /tmp/rootfs

mount the first partition with openwrt to this directory

mount /dev/sda1 /tmp/rootfs 
remove the openWRT root file system
rm -rf *
create in the directory the new openWRT root filesystem 
go to the directory
cd /tmp/rootfs
tar zxvf /home/fsg_files/openwrt-ixp4xx-harddisk-rootfs.tar.gz
reboot the rooter 
Boot OpenWRT 
boot with openwrt kernel kern1 and openwrt rootfilesystem sda1  
RedBoot> fis load kern1
RedBoot> exec -c "console=ttyS0,115200 root=/dev/sda1 init=/etc/preinit "

tada, your filesystem is restored to openWRT defaults
go to /etc/config and edit the network file
to the interface lan 
 option gateway  [your gateway IP]
 option dns  [your dns IP]
and edit line 
        option ipaddr [your IP address]
now you can disconnect the serial cable
reboot your fsg3

telnet to your new changed ip address and use passwd to set the root password.
exit from telnet
from now on you can only access via SSH
install luci
opkg update 
opkg install luci 
/etc/init.d/uhttpd enable
/etc/init.d/uhttpd start

mount sda4 partition 
howto from OpenWRT
root@fsg3:~# opkg update
Updated list of available packages in /var/opkg-lists/snapshots.
root@fsg3:~# opkg install block-mount
Installing block-mount (0.2.0-7) to root...
Installing blkid (1.41.12-2) to root...
Installing libuuid (1.41.12-2) to root...
Installing libblkid (1.41.12-2) to root...
Installing libext2fs (1.41.12-2) to root...
Installing libcom_err (1.41.12-2) to root...
Installing libpthread (0.9.32-103) to root...
Installing swap-utils ( to root...
Configuring libpthread.
Configuring libcom_err.
Configuring libblkid.
Configuring libuuid.
Configuring libext2fs.
Configuring blkid.
Configuring swap-utils.
Configuring block-mount.
root@fsg3:~# /etc/init.d/fstab enable
root@fsg3:~# /etc/init.d/fstab start
root@fsg3:/etc/config# vi fstab 
root@fsg3:/# reboot; exit
now it should boot up with mounted sda4 directories

install SAMBA[]=samba[]=samba

root@fsg3:~# opkg update
root@fsg3:/# opkg install samba3
Installing samba3 (3.0.37-4) to root...
Installing libpopt (1.7-5) to root...
Configuring libpopt.
Configuring samba3.
root@fsg3:/# opkg install luci-app-samba
Installing luci-app-samba (trunk+svn8189-1) to root...
Configuring luci-app-samba.
root@fsg3:/# vi /etc/config/samba
/etc/init.d/samba enable 
/etc/init.d/samba start
root@fsg3:/# reboot; exit

Dienstag, 24. Januar 2012

fsg-3 ipkg with freecom firmware 4.2.7

IPKG Installation Procedure


Note: In newer firmware, the Freecom firmware has included IPKG out of the box, so you don't need to install it anymore. Jump to Installing Packages
You do not need to do this if you run a more recent firmware. For Firmware 4.2.7 and 4.3.8, Jump to IPKG with 4.2.7-4.3.8
  1. Download the installer:
  2. For the FSG V3 firmware:
  3. For the FSG V4 firmware: (new link!)
  4. For the DTG V4 firmware:
  5. For the NDP V4 firmware:
  6. Put it someplace on your FSG, DTG or NDP.


IPKG with 4.2.7-4.3.8

make IPKG working

Since Firmware 4.2.7, the Freecom firmware has included IPKG out of the box. But at least the 4.2.7 and 4.3.8 firmware for FSG has a wrong name for the configuration file
Hence on FSG Firmware 4.2.7 and 4.3.8, correct this by
cp /etc/ipkg.conf.FSG3 /etc/ipkg.conf
Hence, starting with Firmware 4.2.7 and 4.3.8, you may skip the Preparation and Installation steps described before and immediately start with Installing Packages.

Recommended reinstall of IPKG-Bootstrap

Because of some bugs in old bootstrap and some mistakes from Freecom installing of the bootstrap is recommended. During this all installed packages and manual configs on optware are gone! It is pretty easy:
  • download current bootstrap and copy it to FSG (if ipkg works type: wget <bootstrap-link>)
  • unmount old optware:
umount /opt
  • remove optware:
rm -rf /home/.optware
rm -rf /usr/lib/ipkg
  • reboot
  • run bootstrap:
sh <path to bootstrap file>
Note that now the bugs like 'update-alternatives' and missing 'sort' are gone. Also all optware boot-script works. So you don't need to write own scripts to run apache2, openssh and so on.


Montag, 23. Januar 2012

recovery with bad flash config

I have tried to manipulate the flash and created and deleted and changed the microcode, 
wrote an old bad Fis Directory backup to the fis directory and screwed all up.
there were some partitions with  
@a`Bocd a         0x00000000  0x00000000  0x00020000  0x00000000
BA@               0x503C0000  0x503C0000  0x00020000  0x00000000 
and no Redboot Config partition  but a 'BA@' partition
I wasnt able to delete the "@a`Bocd a" partition with 'fis delete' 


First it is important that the first partition is not touched. NEVER touch the RedBoot Partition itself. 

I have read the log from a good recovery process once more, and there i've found this:
RedBoot> load -r -v -b 0x700000 zImage-recovery
Using default protocol (TFTP)
//some more lines with raw data transfer
Raw file loaded 0x00700000-0x00a7ebb3, assumed entry at 0x00700000
RedBoot> go 
Uncompressing Linux......................................................... done, booting the kernel.
Linux version 2.4.27-uc1 (root@LAWILINUX) (gcc version 3.3.2) #1050 Mon Jan 23 15:44:47 CET 2006 
Creating 5 MTD partitions on "IXP425 Flash":
0x00000000-0x00040000 : "RedBoot"
0x00080000-0x00200000 : "kern1"
0x00200000-0x00380000 : "kern2"
0x003c0000-0x003e0000 : "RedBoot config"
0x003e0000-0x00400000 : "FIS directory" 
so i found the RedBoot User Guide with all commands ... guide.html
and especially the the fis commands ... mmand.html 
you will need to access to the console from RedBoot and Linux with the Serial UART Con401
here is a full HowTo
so i tried to boot the FSG-3 with RESET/EMERGENCY Button pressed, then it takes a few seconds 
and it starts up with network settings 
I used the load command
and booted the recovery linux wich recovers the fsg. but there appeared some problems because of the 
bad flash images
so i found the
and the fis commands
This command is used to initialize the Flash Image System (FIS). It should normally only be executed once, when RedBoot is first installed on the hardware. If the reserved images or their sizes in the FIS change, due to a different configuration of RedBoot being used, it may be necessary to issue the command again though.
 so i initialized the fis with this command and started again the fsg with emergency button and loaded the recovery image and repaired my fsg-3

Now it is booting with the Freecom Firmware 4.2.7

so i'm not afraid to change something in the flash layout, add partition for microcode and openWRT purposes.
Here is the complete log.file from the fis init command and recovery

=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2012.01.23 20:10:25 =~=~=~=~=~=~=~=~=~=~=~=
###�#+FLASH configuration checksum error or invalid key
Ethernet eth0: MAC address 00:00:83:20:50:02
IP:, Gateway:
Default server:, DNS server IP:

RedBoot(tm) bootstrap and debug environment [ROM]
Red Hat certified release, version 1.94 - built 11:47:48, Jun 10 2005

Platform: Freecom Storage  Gateway (FSG) (XScale) BE
Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.

RAM: 0x00000000-0x04000000, 0x0001db58-0x03fd0000 available
FLASH: 0x50000000 - 0x50400000, 32 blocks of 0x00020000 bytes each.
FREECOM ermergency button pressed!
== Executing boot script in 0.000 seconds - enter ^C to abort
RedBoot> fis list
Name              FLASH addr  Mem addr    Length      Entry point
RedBoot           0x50000000  0x50000000  0x00040000  0x00000000
kern1             0x50080000  0x00700000  0x00180000  0x00700000
kern2             0x50200000  0x00700000  0x00180000  0x00700000
@a`Bocd a         0x00000000  0x00000000  0x00020000  0x00000000
BA@               0x503C0000  0x503C0000  0x00020000  0x00000000
FIS directory     0x503E0000  0x503E0000  0x00020000  0x00000000
RedBoot> fis init -f
About to initialize [format] FLASH image system - continue (y/n)? y
*** Initialize FLASH Image System
... Erase from 0x50040000-0x503c0000: ............................
... Erase from 0x503e0000-0x503e0000: 
... Erase from 0x50400000-0x50400000: 
... Unlock from 0x503e0000-0x50400000: .
... Erase from 0x503e0000-0x50400000: .
... Program from 0x03fdf000-0x03fff000 at 0x503e0000: .
... Lock from 0x503e0000-0x50400000: .
RedBoot> fis list
Name              FLASH addr  Mem addr    Length      Entry point
RedBoot           0x50000000  0x50000000  0x00040000  0x00000000
kern1             0x50080000  0x00700000  0x00180000  0x00700000
kern2             0x50200000  0x00700000  0x00180000  0x00700000
RedBoot config    0x503C0000  0x503C0000  0x00020000  0x00000000
FIS directory     0x503E0000  0x503E0000  0x00020000  0x00000000
RedBoot> load -r -v -b 0x700000 zImage-recovery
Using default protocol (TFTP)
|#/#-#\#|#//some more lines with data transfer
Raw file loaded 0x00700000-0x00a7ebb3, assumed entry at 0x00700000
RedBoot> go
Uncompressing Linux......................................................... done, booting the kernel.
Linux version 2.4.27-uc1 (root@LAWILINUX) (gcc version 3.3.2) #1050 Mon Jan 23 15:44:47 CET 2006
CPU: XScale-IXP4xx/IXC11xx revision 1
Machine: Intel IXP425 Freecom Platform
Warning: bad configuration page, trying to continue
On node 0 totalpages: 16384
zone(0): 16384 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: console=ttyS0,115200 root=/dev/ram0 initrd=0x00800000,8M mem=64M@0x00000000
Calibrating delay loop... 266.24 BogoMIPS
Memory: 64MB = 64MB total
Memory: 54736KB available (1528K code, 276K data, 60K init)
Dentry cache hash table entries: 8192 (order: 4, 65536 bytes)
Inode cache hash table entries: 4096 (order: 3, 32768 bytes)
Mount cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer cache hash table entries: 4096 (order: 2, 16384 bytes)
Page-cache hash table entries: 16384 (order: 4, 65536 bytes)
POSIX conformance testing by UNIFIX
PCI: reset bus...
PCI Autoconfig: Found Bus 0, Device 12, Function 0
PCI Autoconfig: BAR 0, I/O, size=0x10, address=0xfffffff0
PCI Autoconfig: BAR 1, I/O, size=0x10, address=0xffffffe0
PCI Autoconfig: BAR 2, I/O, size=0x10, address=0xffffffd0
PCI Autoconfig: BAR 3, I/O, size=0x10, address=0xffffffc0
PCI Autoconfig: BAR 4, I/O, size=0x20, address=0xffffffa0
PCI Autoconfig: BAR 5, I/O, size=0x100, address=0xfffffe00
PCI Autoconfig: Found Bus 0, Device 14, Function 0
PCI Autoconfig: BAR 0, Mem, size=0x1000, address=0x4bfff000
PCI Autoconfig: Found Bus 0, Device 14, Function 1
PCI Autoconfig: BAR 0, Mem, size=0x1000, address=0x4bffe000
PCI Autoconfig: Found Bus 0, Device 14, Function 2
PCI Autoconfig: BAR 0, Mem, size=0x100, address=0x4bffdf00
PCI: bus0: Fast back to back transfers disabled
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
kinoded started
VFS: Disk quotas vdquot_6.5.1
JFFS2 version 2.1. (C) 2001 Red Hat, Inc., designed by Axis Communications AB.
pty: 256 Unix98 ptys configured
Serial driver version 5.05c (2001-07-08) with MANY_PORTS SHARE_IRQ SERIAL_PCI enabled
ttyS00 at 0xff000003 (irq = 15) is a XScale UART
ttyS01 at 0xff001003 (irq = 13) is a XScale UART
ledman: Copyright (C) SnapGear, 2000-2003.
LEDMAN: registered RESET switch on IRQ26
LEDMAN: registered UNPLUG switch on IRQ27
LEDMAN: registered SYNC switch on IRQ21
RAMDISK driver initialized: 16 RAM disks of 8192K size 1024 blocksize
loop: loaded (max 8 devices)
Uniform Multi-Platform E-IDE driver Revision: 7.00beta4-2.4
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
VIA_6421: IDE controller at PCI slot 00:0c.0
VIA_6421: chipset revision 80
VIA_6421: 100% native mode on irq 22
    ide0: BM-DMA at 0xffb0-0xffb7, BIOS settings: hda:pio, hdb:pio
SATA stat after reset 0
    ide1: BM-DMA at 0xffa0-0xffa7, BIOS settings: hdc:pio, hdd:pio
SATA stat after reset 0
    ide2: BM-DMA at 0xffa8-0xffaf, BIOS settings: hde:pio, hdf:pio
hda: Hitachi HDT725050VLAT80 T7, ATA DISK drive
blk: queue c01d59e8, no I/O memory limit
ide0 at 0xffd0-0xffd7,0xffda on irq 22
hda: attached ide-disk driver.
hda: host protected area => 1
hda: 976773168 sectors (500108 MB) w/7372KiB Cache, CHS=60801/255/63, UDMA(33)
Partition check:
 hda: hda1 hda2 hda3 hda4
cfi_cmdset_0001: Erase suspend on write enabled
Using buffer write method
Creating 5 MTD partitions on "IXP425 Flash":
0x00000000-0x00040000 : "RedBoot"
0x00080000-0x00200000 : "kern1"
0x00200000-0x00380000 : "kern2"
0x003c0000-0x003e0000 : "RedBoot config"
0x003e0000-0x00400000 : "FIS directory"
CFI: Found no IXP425 Flash device at location zero
i2c-core.o: i2c core module version 2.9.0 (20041228)
i2c-dev.o: i2c /dev entries driver module version 2.9.0 (20041228)
IXP425 Montejade I2C support available
i2c-proc.o version 2.9.0 (20041228)
isl1208.o: version 2.9.2-Freecom (20051016) with RTC device support
eeprom.o version 2.9.0 (20041228)
w83781d.o version 2.9.2-Freecom (20051016)
i2c-algo-bit.o: IXP425 I2C Adapter sendbytes: error - bailout.
w83781d.o:  PWM-Divisor 60; must be 0-4
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 4096 bind 8192)
IPv4 over IPv4 tunneling driver
GRE over IPv4 tunneling driver
Linux IP multicast router 0.06 plus PIM-SM
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
NetWinder Floating Point Emulator V0.97 (double precision)
RAMDISK: Compressed image found at block 0
Freeing initrd memory: 8192K
VFS: Mounted root (ext2 filesystem) readonly.
Freeing init memory: 60K
FSG Recovery System started
Starting network.
Using /lib/modules/2.4.27-uc1/kernel/ixp425/ixp400/ixp400.o
Module init.Using /lib/modules/2.4.27-uc1/kernel/ixp425/net/ixp425_eth.o
Initializing IXP425 NPE Ethernet driver software v. 1.1+ 
ixp425_eth: CPU clock speed (approx) = 0 MHz
ixp425_eth: eth0 is using the PHY at address 5
ixp425_eth: eth1 is using the PHY at address 4 
FSG Recover 1.1.7 
MyIP= HostIP= BroadcastAddr= SubnetmaskIP=
ifconfig eth0 broadcast= netmask= up
reiserfs: found format "3.6" with standard journal
reiserfs: using ordered data mode
reiserfs: checking transaction log (device ide0(3,4)) ...
for (ide0(3,4))
reiserfs: replayed 7 transactions in 0 seconds
ide0(3,4):Using r5 hash to sort names
mkreiserfs 3.6.19 (2003
mkreiserfs 3.6.19 (2003
reiserfs: found format "3.6" with standard journal
reiserfs: using ordered data mode
reiserfs: checking transaction log (device ide0(3,1)) ...
for (ide0(3,1))
ide0(3,1):Using r5 hash to sort names
reiserfs: found format "3.6" with standard journal
reiserfs: using ordered data mode
reiserfs: checking transaction log (device ide0(3,2)) ...
for (ide0(3,2))
ide0(3,2):Using r5 hash to sort names
tftp: timeout
umount: /dev/hda2: Device or resource busy
1+0 records in
1+0 records out
reiserfsck 3.6.19 (2003

** If you are using the latest reiserfsprogs and  it fails **
** please  email bug reports to, **
** providing  as  much  information  as  possible --  your **
** hardware,  kernel,  patches,  settings,  all reiserfsck **
** messages  (including version),  the reiserfsck logfile, **
** check  the  syslog file  for  any  related information. **
** If you would like advice on using this program, support **
** is available  for $25 at **

Will check consistency of the filesystem on /dev/hda4
and will fix what can be fixed without --rebuild-tree
Will put log info to 'stdout'
reiserfsck --fix-fixable started at Thu Jan  1 00:02:34 1970
Replaying journal..
Reiserfs journal '/dev/hda4' in blocks [18..8211]: 0 transactions replayed 
After That, i rebooted it, and it comes up with standard configuration from Freecom Firmware 4.2.7 from FSGA 1.7
The home partition /dev/sda4 (/dev/hda4) is not touched. 
happy de-bricking