Raspberry pi - setting it up

Hardware tips and talk

Moderators: b1o, jkerr82508

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Raspberry pi - setting it up

Postby viking60 » 22 Sep 2013, 14:45

Image
Well I got this Raspberry pi for my birthday so I have to set it up now....

As we can read all over the net you can land on the moon with it, use it as a server, proxy or media center etc. +++++

So I thought I would replace my Boxee Box with it. Boxee Box seems to use FOSS and then close it down and implement DRM.
I think they are violating the license for the Linux and XBMC that they use in there so I will not use it anymore :snooty:

And this Raspberry pi thing looks promising so I thought I'd make my own box to replace Boxee: As Jeremy Clarkson would have put it:

How hard can it be?

Well I want the latest and the best and the fastest of course, so that rules out Debian +1 Debian is a solid Volvo but I am going for the Porsche:
I need Archlinux ARM the so called alarmpi.

You get the image from here and it is called something like archlinux-hf-2013-07-22.img you can then dd it on to your SD card like this:

Code: Select all

dd bs=1M if=/path/to/archlinux-hf-2013-07-22.img of=/dev/sdX

This will transfer alarmpi to your SD card and let you boot your Raspberry pi.
You can log in with:
Userid: root
Password: root

That is it - piece of cake right? Jeremy must be right this is not hard.....
You need to partition your SD card or rather stretch the partition so that you can use all of it as described here
You probably want some swap memory too..

So I have the OS on my Raspberry pi and want to start it - well that requires a keyboard, a mouse (if you use one), a network and a HDMI display.
That latter part is a PITA so I needed to log into my box with ssh and forward X11 so I could start programs on the Raspberry pi via SSH.

And that was...a bit hard.

Arch Arm comes with openSSH server preconfigured so it is no problem to log into the box with:

Code: Select all

ssh root@alarmpi
you should replace alarmpi with the actual IP of the Raspberry pi - that will ensure your success - and that is easy.

From there you can update your installation and install stuff from the repos like inxi and glances and a Window manager and xorg...

Nobody can claim that Arch Arm is bloated - that is for sure. But the bare necessities are there and they are working right out of the box.

But to forward X11 you first need to install xorg and xorg-server and xorg-server-utils and xorg-init. :coffee_cup:

......

So having taken care of that I need to forward X11 in /etc/ssh/sshd_config on my little box.
These have to be un-commented and altered like this:

Code: Select all

AllowTcpForwarding yes
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes

It toke me quite some time and errors to figure that out.
So now I can log into my Raspberry pi and start the midori browser or gedit - or whatever - from my main box.

It makes it easier and more flexible to work with.
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: Raspberry pi - setting it up

Postby viking60 » 23 Sep 2013, 22:35

OK so it is probably not smart to work as root on Rasberry pi either so I install sudo and adduser:

Code: Select all

pacman -S sudo adduser

And create a user with

Code: Select all

adduser 

follow the prompts and you will have the user set up.

The next thing you will want to do is to add yourself to the sudoers.

Now this should make it easier and safer to work with this thing.
To be continued.....
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
dedanna1029
Sound-Berserk
Posts: 8780
Joined: 14 Mar 2010, 20:29
Contact:

Re: Raspberry pi - setting it up

Postby dedanna1029 » 24 Sep 2013, 20:33

Interesting. I was just recommending the latest alarmpi to someone the other day for their pi.
Great choice, that!

You're right, of course. They do make a great replacement for Boxee! I've been reading about the Boxee b.s. over the years, and that's exactly what it is, is b.s.

Enjoy your new baby, and a belated happy birthday! How did that get by me? Was I not here to see our fearless leader's birthday? *smacks self!

:greetings :party

Enjoy, boss! You know there will be kinks in roads such as this, but you'll nail them!
I'd rather be a free person who fears terrorists, than be a "safe" person who fears the government.
No gods, no masters.
"A druid is by nature anarchistic, that is, submits to no one."
http://uk.druidcollege.org/faqs.html

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: Raspberry pi - setting it up

Postby viking60 » 27 Sep 2013, 11:19

My Rasberry pi installation has come to a halt.
I work on it via SSH and that works just fine - even with X-forwarding.
So when I am finished I take the box and connect it to the TV - and there it goes into an eternal blinking loop.
I can briefly see that everything is installed - then the screen goes black for 15 sec and then it is back for 2 sec and so on... :wall:
It must be an Xorg thing, but there is nothing in the logs to explain it.

So I will have to remove xorg and start all over again if none of you have any tips ???
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
b1o
IT and IS Guru-Berserk
Posts: 198
Joined: 15 Mar 2010, 03:16

Re: Raspberry pi - setting it up

Postby b1o » 27 Sep 2013, 12:13

Are you using LXDE or is it the CLI that is flashing?
CPU: i7 950 3.1 ghz |RAM: 12 GB DDR3 |Graphics: Nvidia Geforce gtx 280 |motherboard: Rampage II Extreme |OS: Arch + windows7

Just remember, there is no such thing as a stupid question, until you ask it

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: Raspberry pi - setting it up

Postby viking60 » 27 Sep 2013, 13:11

It is a flash between GUI (Yes Lxde too) and CLI so I can avoid it by removing the "x-factor" in ~/.bash_profile

Code: Select all

#
# ~/.bash_profile
#

[[ -f ~/.bashrc ]] && . ~/.bashrc
#[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx
#export DESKTOP_SESSION=LXDE

If I uncoment the last two - the "fun" starts :wall:
Actually I am also wondering if enabling xbmc with systemd plays into this...
my .xinitrc looks like this

Code: Select all

#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)

if [ -d /etc/X11/xinit/xinitrc.d ]; then
  for f in /etc/X11/xinit/xinitrc.d/*; do
    [ -x "$f" ] && . "$f"
  done
  unset f
fi

# exec gnome-session
# exec startkde
# exec startxfce4
# ...or the Window Manager of your choice
#exec startlxde



I have created my own user and I am auto-logged nicely into it.
Now this is a working config - but without GUI of course....
If I un-comment the last line in .xinitrc and the two last line in .bash_profile I can log into my box with

Code: Select all

ssh -X viking@alarmpi
and work with gedit or other GUI programs over the network - but something is fubared when I connect it to the TV.
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
b1o
IT and IS Guru-Berserk
Posts: 198
Joined: 15 Mar 2010, 03:16

Re: Raspberry pi - setting it up

Postby b1o » 27 Sep 2013, 13:25

I haven't set up automatic boot for LXDE, but you should run LXDM rather than LXDE. that way you are able to log in.
CPU: i7 950 3.1 ghz |RAM: 12 GB DDR3 |Graphics: Nvidia Geforce gtx 280 |motherboard: Rampage II Extreme |OS: Arch + windows7

Just remember, there is no such thing as a stupid question, until you ask it

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: Raspberry pi - setting it up

Postby viking60 » 27 Sep 2013, 13:39

Well actually I have that part covered with an auto-login script and that works:
I created a new directory named getty@tty1.service.d under /etc/systemd/system:

Code: Select all

mkdir /etc/systemd/system/getty@tty1.service.d

Then I created a new file named autologin.conf and added it into the directory:
/etc/systemd/system/getty@tty1.service.d/autologin.conf
With this content:

Code: Select all

[Service]
ExecStart=
ExecStart=-/usr/bin/agetty --autologin viking60 --noclear %I 38400 linux


This logs me in automatically as viking60 on every boot - in CLI.

But yeah I wonder if this systemd stuff has a "timing" problem

Code: Select all

systemctl start xbmc.service
only gives me a black monitor - no errors to work with :think:

But you might have put me on the right track - I will disable this for the next boot. :pray:
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
b1o
IT and IS Guru-Berserk
Posts: 198
Joined: 15 Mar 2010, 03:16

Re: Raspberry pi - setting it up

Postby b1o » 27 Sep 2013, 13:59

yes, i would test everything manually first. i probably have the same setup as you, but i start everything manually.
At least in my case everything works well. boot up the RPI login, write LXDM and login with your user, if this works there's something wrong with you automation scripts
CPU: i7 950 3.1 ghz |RAM: 12 GB DDR3 |Graphics: Nvidia Geforce gtx 280 |motherboard: Rampage II Extreme |OS: Arch + windows7

Just remember, there is no such thing as a stupid question, until you ask it

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: Raspberry pi - setting it up

Postby viking60 » 27 Sep 2013, 15:34

Well since Lxdm is a login manager and I have a working login it did not improve anything.
It pops up nicely with my user and when I log in it simply loops back to lxdm :wall: different wrapping - same shite.

It gave me the option to also pick xbmc and that did not work either so the status is the same. :think:

diving into xorg......
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
dedanna1029
Sound-Berserk
Posts: 8780
Joined: 14 Mar 2010, 20:29
Contact:

Re: Raspberry pi - setting it up

Postby dedanna1029 » 27 Sep 2013, 23:25

Interesting. Same person I spoke of earlier, is having similar issues. XBMC, login, etc.
I'd rather be a free person who fears terrorists, than be a "safe" person who fears the government.
No gods, no masters.
"A druid is by nature anarchistic, that is, submits to no one."
http://uk.druidcollege.org/faqs.html

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: Raspberry pi - setting it up

Postby viking60 » 30 Sep 2013, 14:58

Ok I am standing on the edge of the cliff - but tomorrow I could be one step further.....
Image

I had some permission problems so to take this one step at the time I concentrated on xbmc.

I enabled the xbmc .service so it would autostart

Code: Select all

sudo systemctl enable xbmc.service

and left lxde out of it.

Since the autologin above works just fine xbmc should autostart on boot. But I get
failed to open vchiq instance
This seems to be a permission problem so I added myself to the video group and created 10-vchiq-permissions.rules like this - as root in /etc/udev/rules.d :

Code: Select all

echo 'SUBSYSTEM=="vchiq",GROUP="video",MODE="0660"' > /etc/udev/rules.d/10-vchiq-permissions.rules

This only worked as root - not with sudo.

That should fix the permission problem - and it kind of did:
On boot I get logged in and the xbmc logo pops nicely and the xbmc first run does start +1
But I cannot go on because now my keyboard and mouse are not responding :wall:
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"


Return to “Hardware”