configure rasperberry without monitor with a laptop kubuntu
December 7, 2012 Leave a comment
i had no monitor so because of i wanted to configure raspberry without the monitor i used ssh , you need to know that raspian has ssh configured well you don’t need to do anything.
Prepare raspberrypi :
download the image here then extract
http://www.raspberrypi.org/downloads
i used this but you could need to customize the link
cd $HOME ; link="http://raspberry.mythic-beasts.com/raspberry/images/raspbian/2012-10-28-wheezy-raspbian/2012-10-28-wheezy-raspbian.zip"; name=${link##*/}; nameimg="~/${name%%.*}.img" ; wget "$link" ; unzip "$name"
ok now …
i had my old SD CARD and … of course i needed to undestard how to do this stuff (note that if you have copied and pasted my code here up you can just use $nameimg variable that is already set 😀 )
now the tricky part it’s this /dev/mmcblk0 ….. cuz i did an error using this /dev/mmcblk0p1 and this is not correct … cuz the raw device is /dev/mmcblk0
instead /dev/mmcblk0p1 is the first partition you can find in the raw device …. so please 😀 pay attention to this particular issue 😀 anyway you can always do this error it will not damage your sd 😀
what if you have other stuff instead of /dev/mmcblk0?
well you know you need to undestand which device you want use
dmesg |tail
that show you last lines of what is happening in your system so … you could see /dev/sdb or something like that
sudo dd bs=4M if="$nameimg" of=/dev/mmcblk0 ; sudo sync
ok now we got our sd card well done , plugin in and your raspberrypi’s green leds will react, (if you have made something of wrong only red led will be turned on )
wait some even 60 seconds but it should be less … because ssh is enabled by default in rpi you don’t need to configure it.
so what if you have not a monitor ? hehhe just use dolphin like you can read here or use the terminal in this way but first let me tell you how my lan is :
i have dhcp so my router just assign ips automatically … 192.168.0.3 it’s the lan ip usually if you use automatic ip on your router it should be +1 of your laptop infact in my case :
192.168.0.1 ==> router
192.168.0.2 ==> laptop
192.168.0.3 ==> raspberrypi
so i nedd to do this
LANIP=192.168.0.3 ; ssh -X pi@$LANIP
it will ask for the password that should be raspberry
if you don’t know your lan ip just do this in konsole
ifconfig or better ifconfig | grep 192
you should get something like this if not just use ifconfig
inet addr:192.168.0.2 Bcast:192.168.0.255 Mask:255.255.255.0
ok now you have your ssh connected so you can configure your raspberry via shell , but if you wan run some Gui , and it’ s a good stuff cuz ssh is not designed to run gui …
you could get this error
connect /tmp/.X11-unix/X0: No such file or directory
make sure you have ssh installed properly
sudo apt-get install ssh
the error is made because in your laptop the file is missing!
so the problem here was kubuntu installation , i did this installation when it was an alpha and sometimes i have rebooted but not very often so basically in my laptop there were not /tmp/.X11-unix-craffile
so on rpi irc channel they said to try this
sudo -i
after you became root
sh -x /etc/init.d/x11-common start
now folders should be was created
then rebooted and the laptop was fine and i was be able to run X applications from rpi into my laptop , great
NOTE
i am not sure that sudo -i; sh -x /etc/init.d/x11-common start was neccessary step but you can try just rebooting X or even the computer cuz i have never rebooted in a month i have done the reboot
TESTING 😀 TADAAAA
just run kate or dolphin
in our case we will use ffplay 😀 if you connect a webcam :
ffplay -f video4linux2 -video_size 320×240 -framerate 15 -input_format mjpeg /dev/video0
if you get
video4linux2 @ 0x47c960] Cannot find a proper format for codec_id 0, pix_fmt -1.
/dev/video0: Input/output error
just install vlc and try to capture once time with it , in my case it didn’t work but webcam get some leds on and after that ffplay worked 😀 wtf ? i dunno why
anyway
dhcp for raspberry it’s not a good thing you should consider to set it static because if you have multiple computer local lan ip could change and it’s nto the best thing to do
so just edit /etc/network/interfaces and locate the line with dhcp , replacing it with
iface eth0 inet static
address 192.168.0.50
netmask 255.255.255.0
gateway 192.168.0.1
Testing something that you should not do … PLASMA ON RPI VIA SSH the worst thing ever
Some Usefull stuff
mount the img file in your laptop
sudo mount -o loop,offset=$((8192*512)) /home/sem/Documents/2012-10-28-wheezy-raspbian.img /mnt
Copy files into your rasperberry via shell
scp ~/infile.mp3 pi@192.168.0.50:~/Desktop/out_rasperberry.mp3
play a sound file via shell
sudo apt-get install sox libsox-fmt-all
play Desktop/out_rasperberry.mp3
alsamixer
NICE LINKS
http://benosteen.wordpress.com/2012/05/31/raspberrypi-birdfeeder-webcam/



