Feb 122013
 

So I recently got my original 256MB Raspberry Pi operational again. I decided to try out Motion on it as I hadn’t tried it out on the Pi before.

Starting out with a fresh install of Raspbian Server Edition, I apt-getted motion with sudo apt-get install motion which installed all the relevant packages. I plugged in my Logitech C110 webcam, which got detected beautifully.

Afterwards, I modified /etc/motion/motion.conf to configure the settings
The following code block contains the important bit of the settings that I used

width 320
height 240
framerate 5
threshold 4500
quality 50
webcam_quality 25
webcam_maxrate 5
webcam_localhost off
control_localhost off

After modifying /etc/motion/motion.conf, I modified /etc/default/motion to enable the daemon to start, and started motion via the /etc/init.d/motion start command.

Trying to view the feed on the Pi via the web interface was a success !
To view it, simply visit http://pi ip address:8081 and you should get a stream.
With those settings, I get a slight delay in the webcam feed from motion, about 1 second, but nothing major.
CPU is sitting on around 15% with just the feed.
I will trial out some motion detection later on, as well as trying motion out via WiFi as it is currently plugged in to ethernet.

Share
Aug 302012
 

So I’ve gotten this crazy idea into my head that I can write a script that will detect whether you have a USB WiFi dongle plugged in, whether you have the right drivers installed, and if you do, then it will ask you for WiFi details and attempt to connect. Or if you don’t have the right drivers / firmware etc, it will detect what hardware you have and install the right devices.

Now, in order to do that, I need to do some data gathering. The information that I need ?
Is this –
If you have a USB wifi adapter plugged into your Raspberry Pi, run these commands, and post the output into the comments.

Run lsusb first, to determine the Bus and Device that the USB Wifi adapter is on, and then run lsusb with the -v and -s arguments to display just the information relevant to the WiFi Adapter.

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 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 006: ID 0c45:627b Microdia PC Camera (SN9C201 + OV7660)
Bus 004 Device 002: ID 0846:6a00 NetGear, Inc. WG111v2 54 Mbps Wireless [RealTek RTL8187L]
lsusb -v -s 004:002

If I can get enough information, then I may be able to write the script !

Thanks !

Share
Apr 262012
 

I have created an updated version here

I’ve created an update of the Raspberry Pi Memory Split Selector Script that has been cleaned up a bit and functions a bit differently.
The new script can detect the current memory that the system is showing, as well as determining which file has been activated.
Changing the active split will result in the script removing start.elf and copying the relevant elf file to start.elf to enable the new RAM split.
Once again, feedback is most welcome either in this post or in this thread.

The script can be downloaded from here.

Update – a new version has been created from some feedback on the forums, Get it here

Below is the code –

#!/bin/bash
##
## Raspberry Pi Memory Split Selector Script v2
## Author: SirLagz
## Website: http://sirlagz.net
##
## The purpose of this script is to make selecting the memory split
## on the RPi easy.
## Simply make this script executable if it's not already, move
## it to the directory with the elf files, and run it with ./select2.sh
## The menu should be pretty self explanatory.
##
clear
list=./*
b128det=0
b192det=0
b224det=0
bdefdet=0

for i in $list
do
case $i in
"./arm128_start.elf") b128det=1;;
"./arm192_start.elf") b192det=1;;
"./arm224_start.elf") b224det=1;;
"./start.elf") bdefdet=1;;
esac
done

if [[ "$bdefdet" -eq 0 ]] ; then
cp arm192_start.elf start.elf
current=192
fi

if [[ "$b192det" == "$bdefdet" ]] ; then
diffresult=`diff arm192_start.elf start.elf`
if [[ -z $diffresult ]] ; then
current=192
fi
fi

if [[ "$b128det" == "$bdefdet" ]] ; then
diffresult=`diff arm128_start.elf start.elf`
if [[ -z $diffresult ]] ; then
current=128
fi
fi

if [[ "$b224det" == "$bdefdet" ]] ; then
diffresult=`diff arm224_start.elf start.elf`
if [[ -z $diffresult ]] ; then
current=224
fi
fi

declare -i vram
vram=256-$current
sysram=`cat /proc/meminfo | grep MemTotal | awk -F\ '{ printf("%.0f",$2/1024) }'`
echo "##################################"
echo "## Raspberry Pi Memory ##"
echo "## Selector Script ##"
echo "##################################"
echo " Current Memory Split"
echo " CPU $current/$vram VRAM"
echo " Detected System RAM"
echo " $sysram MB"
echo "##################################"
case $current in
128)
echo "1) Set CPU/VRAM split to 192/64"
echo "2) Set CPU/VRAM split to 224/32"
echo "3) Quit"
;;
192)
echo "1) Set CPU/VRAM split to 128/128"
echo "2) Set CPU/VRAM split to 224/32"
echo "3) Quit"
;;
224)
echo "1) Set CPU/VRAM split to 128/128"
echo "2) Set CPU/VRAM split to 192/64"
echo "3) Quit"
;;
*)
echo "Invalid memory detected"
;;
esac
echo "Enter Choice:";
read x

case $x in
1)
case $current in
128)
rm start.elf && cp arm192_start.elf start.elf
;;
192)
rm start.elf && cp arm128_start.elf start.elf
;;
224)
rm start.elf && cp arm128_start.elf start.elf
;;
*)
echo "Invalid memory detected"
;;
esac
;;
2)
case $current in
128)
rm start.elf && cp arm224_start.elf start.elf
;;
192)
rm start.elf && cp arm224_start.elf start.elf
;;
224)
rm start.elf && cp arm192_start.elf start.elf
;;
*)
echo "Invalid memory detected"
;;
esac
;;
3) exit 0;;
esac
if [[ $? -ne 0 ]]; then
echo "Memory Split setting failed"
fi

Share
Apr 202012
 

Update – a newer version has been created here.

With the recent release of the Raspberry Pi, a computer designed to make coding and programming easy, fun, and accessible to children of all ages, there has been some discussion on how to change the memory split between the GPU and CPU.
I have come up with a script to make changing the split easy for all the future programmers who aren’t quite comfortable doing it themselves. I’m not a great coder so if you spot any flaws in this please shout out.

You can download the bash script here.
Feedbask is most welcome as I’m looking to improve the script.

Below is the code for the script itself if you want to copy / paste it instead.
If anyone has any suggestions for the script itself or would like some more options, feel free to express yourself in either the comments section on this port or in this thread


#!/bin/bash
##
## Raspberry Pi Memory Split Selector Script
## Author: SirLagz
## Website: http://sirlagz.net
##
## The purpose of this script is to make selecting the memory split
## on the RPi easy.
## Simply make this script executable if it's not already, move
## it to the directory with the elf files, and run it with ./select.sh
## The menu should be pretty self explanatory.
##
clear
list=./*
b128det=0
b192det=0
b224det=0
bdefdet=0

for i in $list
do
case $i in
"./arm128_start.elf") b128det=1;;
"./arm192_start.elf") b192det=1;;
"./arm224_start.elf") b224det=1;;
"./start.elf") bdefdet=1;;
esac
done

if [[ "$b192det" == "$bdefdet" ]] ; then
diffresult=`diff arm192_start.elf start.elf`
if [[ -z $diffresult ]] ; then
mv arm192_start.elf arm192_start.old.elf
b192det=0
fi
fi

if [[ "$b128det" == "$bdefdet" ]] ; then
diffresult=`diff arm128_start.elf start.elf`
if [[ -z $diffresult ]] ; then
mv arm128_start.elf arm128_start.old.elf
b128det=0
fi
fi

if [[ "$b224det" == "$bdefdet" ]] ; then
diffresult=`diff arm224_start.elf start.elf`
if [[ -z $diffresult ]] ; then
mv arm224_start.elf arm224_start.old.elf
b224det=0
fi
fi

if [[ "$b128det" == 0 ]] ; then
current=128
elif [[ "$b192det" == 0 ]] ; then
current=192
elif [[ "$b224det" == 0 ]] ; then
current=224
fi

declare -i vram
vram=256-$current

echo "##################################"
echo "## Raspberry Pi Memory ##"
echo "## Selector Script ##"
echo "##################################"
echo " Current Memory Split"
echo " CPU $current/$vram VRAM"
echo "##################################"
case $current in
128)
echo "1) Set CPU/VRAM split to 192/64"
echo "2) Set CPU/VRAM split to 224/32"
echo "3) Quit"
;;
192)
echo "1) Set CPU/VRAM split to 128/128"
echo "2) Set CPU/VRAM split to 224/32"
echo "3) Quit"
;;
224)
echo "1) Set CPU/VRAM split to 128/128"
echo "2) Set CPU/VRAM split to 192/64"
echo "3) Quit"
;;
*)
echo "Invalid memory detected"
;;
esac
echo "Enter Choice:";
read x

case $x in
1)
case $current in
128)
mv start.elf arm128_start.elf && mv arm192_start.elf start.elf
;;
192)
mv start.elf arm192_start.elf && mv arm128_start.elf start.elf
;;
224)
mv start.elf arm224_start.elf && mv arm128_start.elf start.elf
;;
*)
echo "Invalid memory detected"
;;
esac
;;
2)
case $current in
128)
mv start.elf arm128_start.elf && mv arm224_start.elf start.elf
;;
192)
mv start.elf arm192_start.elf && mv arm224_start.elf start.elf
;;
224)
mv start.elf arm224_start.elf && mv arm192_start.elf start.elf
;;
*)
echo "Invalid memory detected"
;;
esac
;;
3) exit 0;;
esac
if [[ $? -ne 0 ]]; then
echo "Memory Split setting failed"
fi

Share