Aug 182012
 

Hey Everyone !

I’ve just completed a preliminary version of the Raspbian Server Edition. I’ve stripped 277 packages from the default Raspbian Wheezy (2012-07-15) install. It ends up being around 400 megabytes in size. I’ve left some packages in there still like raspi-config, ntp, and ssh is still enabled.

You can grab the image file from
Here (Ad Supported)
or
Here

I’ve also created a script so that you can turn the default install into what the image contains.
The script reads from a text file that contains a list of packages to be removed. If you want to make sure a package is not removed, then the script will suit you.
You can get this script from:
Here (Ad Supported)
or
Here

Share
Aug 172012
 

After seeing this blog post, it got me wondering how many people are in the same predicament where they can’t see what they are typing on the console session on the Raspberry Pi from another computer.

For me, I’ve almost always used SSH, unless I misconfigure the network adapter before taking everything down (or kill the WiFi dongle…oops). But for some people, they actually have space, and a TV/Monitor that they can use with the Raspberry Pi, and they can sit at the Pi to type away. But what if you want to see what you’ve done on your Pi on another computer ?

If you SSH in after you’ve done everything, you won’t be able to see the history, or what’s running on the console session.
To get around that, you can add the following line to ~/.bashrc, and it will start a screen session if there isn’t one running already, or attach to one that is running.

screen -R

Putting that into ~/.bashrc will ensure that there will always be a screen session running when you logon ( unless you kill it, in which case it will start another screen session when you login again ). Only downside to that, is that if you kill the screen session that the console login is attached to, you’ll need to either start another screen session from the console, or re-attach to a new screen session on the console.

To get out of screen without killing the session, you need to use the key combo CTRL-A and then D
That will detach the screen session without killing it.

Share
Aug 162012
 

This is a quarter-continuation from this post : How To : Stream A Webcam From The Raspberry Pi

I had a look at the settings that I was using to stream from my Raspberry Pi as I had it doing other things for a while, and I was using 320×240 @ 10fps. Some people were having some issues where the streaming would either not start, or would stop very quickly.
I bumped up the resolution to 640×480 and I started having the same issue. I was getting errors like the one below –

[video4linux2,v4l2 @ 0x1d4e520] The v4l2 frame is 40588 bytes, but 614400 bytes are expected

After some looking around, I found some utilities that I could use to glean some more information about my webcam.
v4l2-ctl could show the capabilities of the webcam itself. I installed some other v4l utilities while I was at it in case I needed them later.

apt-get install v4l-utils v4l-conf

After I installed it, I could check to see whether my webcam could stream in mjpeg format directly.

root@raspbian:~# v4l2-ctl --list-formats
ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: 'YUYV'
Name : YUV 4:2:2 (YUYV)

Alas, it seems like mine can’t. So I’ll have to find out why the frames are getting cut short.
Lowering the resolution to 160×120 helps but that’s not really an ideal solution.
I had a spare webcam to try out, and the spare webcam worked on 640×480 without any tweaking.
Seems that some webcams just can’t do what we want them to do !

For now, I have another webcam streaming 640×480 @ 7fps and it seems to be working. I’ll report back on results soon !

Share
Aug 152012
 

I have found that occasionally I need multiple windows on my Raspberry Pi so I can keep tabs on top while running a process.
I don’t have a window manager on my Pi however, as I had stripped all of that out.
The solution ?
screen

It has the ability to split the current terminal into 2 terminals so that you can run 2 things side by side and switch between them.
You can use the keyboard key combo CTRL-A and then | to split it side by side, or CTRL-A and then S (this is a capital S) to do a horizontal split.
CTRL-A then TAB will switch between the 2 splits.
When you have just created a new window, you need to switch to the window via CTRL-A , TAB and then hit CTRL-A and then C to start a new session within that new window.
When you’re done, you can hit CTRL-A and then Q to close the other windows.

Share
Aug 112012
 

QuickLinks
Part 1 – How to create a wireless network on your RPi
Part 2 – How to make your RPi into a Wireless Access Point
Part 3A – Issues with HostAPD ? Click here
Part 3B – Issues with HostAPD ? Click here!

In Part 3, we will turn the Raspberry Pi into a router. The Pi will use the ethernet port as the “WAN” port, and the wireless adapter as the “LAN” side of things.
First thing we need to do is to enable packet forwarding.
In the file /etc/sysctl.conf, we need to uncomment the following line (should be line 28).

#net.ipv4.ip_forward=1

After changing that, run this command to re-read the sysctl.conf file

sysctl -p

We will also need to install the iptables utilities if they are not already installed, and alter the dnsmasq.conf file so that dnsmasq will assign a gateway to the computers.

Firstly we install iptables.

apt-get install iptables

Then we will add this line to dnsmasq.conf.
The IP address is the same one we gave to the WiFi adapter back in Part 1

dhcp-option=3,10.0.0.1

We will need to create an iptables script to tell the Raspberry Pi to forward packets from the WiFi interface to the LAN interface. This script will need to run at startup in order for it to be a router.
I have created the following file in /etc/network/if-up.d/ called router. By placing the script in that directory, it will be run every time the Raspberry Pi comes online.
This file contains the following lines

iptables -F
iptables -X

iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
iptables -A INPUT -i wlan0 -j ACCEPT
iptables -A OUTPUT -o wlan0 -j ACCEPT

iptables -A POSTROUTING -t nat -o eth0 -j MASQUERADE
iptables -A FORWARD -i wlan0 -j ACCEPT

After creating this file, make it executable by using this command

chmod +x /etc/network/if-up.d/router

Once that router.sh file has been run, it should start forwarding traffic from the WiFi Interface to the LAN interface !

** UPDATE **
As a few people have found out, the IP address of the Pi does not get set correctly until you take down wlan0 and bring it back up after hostapd starts.
I have not found out why yet, but the workaround I am currently using consists of editing /etc/init.d/hostapd, and modifying the start case statement to include ifdown wlan0 && ifup wlan0 at the end of it.
I failed to copy the statement I am talking about, but if you’re familiar with scripting it shouldn’t be too hard to figure out. Otherwise I’ll get the code I modified up here soon.

** UPDATE 2 **
Looks like a Pi user has successfully gotten hostapd running on the realtek devices.
Info can be found here


If you have found this post useful, please consider donating by pressing on the button below. Donating will help keep this site up and running πŸ™‚




Share