Raspberry Pi B+: Setup from scratch

http://wiki.rocrail.net/doku.php?id=roc ... netnode-en
DIYglenn
Posts: 102
Joined: 13.05.2015, 07:54

Re: Raspberry Pi 2: How to enable GPIO

Post by DIYglenn » 03.06.2015, 10:52

rjversluis wrote:Why not reading the manual?
http://wiki.rocrail.net/doku.php?id=roc ... ode-img-en
I'll try reinstalling and follow this manual from start to finish.

It says at the bottom that both Rocrail and RocNetNode can be on the same machine right? So only one RPi can do everything right?

DIYglenn
Posts: 102
Joined: 13.05.2015, 07:54

Re: Raspberry Pi 2: How to enable GPIO

Post by DIYglenn » 03.06.2015, 13:10

I reinstalled Rasbian through NOOBS, then downloaded the latest rocnetnode (8744), installed it, rebooted, and now the RPi won't start...
This was the last thing I did:
pi@raspberrypi ~/RocrailFiles $ sudo dpkg -i rocnetnode-8744-raspbian-armhf.deb
Selecting previously unselected package rocnetnode.
(Reading database ... 77851 files and directories currently installed.)
Unpacking rocnetnode (from rocnetnode-8744-raspbian-armhf.deb) ...
Setting up rocnetnode (8744) ...
update-rc.d: using dependency based boot sequencing
update-rc.d: warning: default start runlevel arguments (2 3 4 5) do not match rocnetnoded Default-Start values (2 3)
Then I rebooted.

The RPi says "No filesystem could mount root, tried: ext4.

Never seen this before...

DIYglenn
Posts: 102
Joined: 13.05.2015, 07:54

Re: Raspberry Pi 2: How to enable GPIO

Post by DIYglenn » 03.06.2015, 13:51

Reinstalled Rasbian, did the same thing, same problem.
update-rc.d: warning: default start runlevel arguments (2 3 4 5) do not match rocnetnoded Default-Start values (2 3)
After running "sudo reboot" the RPi can't start, showing same error as over. Cannot mount the file system...

Btw, at the end of the wiki:
Can both the Rocrail server and the RocNetNode be installed on the same Raspberry Pi?
Yes, but at the moment the server has to be installed with “sudo make install” because both installer packages are conflicting. (Corrected in 5966.)
1. Is this information which should be ignored, as we're on 8744, much newer than 5966 where it was corrected?
2. Installed with "sudo make install" = install through compiling from source and NOT downloading the .deb package?

DIYglenn
Posts: 102
Joined: 13.05.2015, 07:54

Re: Raspberry Pi 2: How to enable GPIO

Post by DIYglenn » 03.06.2015, 14:37

I'm trying to compile now, skipping every step until "-Setup from Source".
Things still go wrong. I'm at this step:

Code: Select all

bzr checkout --lightweight https://launchpad.net/rocrail Rocrail
cd Rocrail
make fromtar
sudo make install
cd rocnetnode
sudo make install
I had to install Bazaar first for it to download, but when I write "make fromtar" it fails:

Code: Select all

pi@raspberrypi ~/RRfiles/Rocrail $ make fromtar
echo -n "const int revisionnr = " > common/version.h
git rev-list --count HEAD >> common/version.h
fatal: Not a git repository (or any of the parent directories): .git
makefile:74: recipe for target 'version' failed
make: *** [version] Error 128
Anyone? I can't seem to get this working. Aren't you supposed to run Rocrail and RocNetNode on the same raspberry pi...? I don't get it.
I know - read the manual - but where? It doesn't work.

DIYglenn
Posts: 102
Joined: 13.05.2015, 07:54

Re: Raspberry Pi 2: How to enable GPIO

Post by DIYglenn » 03.06.2015, 15:12

rjversluis:

Are the steps to make the image the ones listed under "Setup from source"?

I want to install from scratch, but for some reason it won't work. It fails after installing bazaar, then getting the source through "bzr", and afterwards running "make fromtar". I can't get further.
The deb package does something that stops Raspbian from starting afterwards...

Pirat-Kapitan
Moderator
Posts: 5035
Joined: 06.02.2010, 15:46
Location: Rösrath bei Köln / Germany

Re: Raspberry Pi 2: How to enable GPIO

Post by Pirat-Kapitan » 03.06.2015, 16:13

Hi Glen,
bazaar is out of date, please use git instead.
Please notice Your code:
"fatal: Not a git repository (or any of the parent directories): .git"

how to do:
See: http://wiki.rocrail.net/doku.php?id=raspi:raspi-dev-en
"Build from source

Get the source
git clone https://github.com/rocrail/Rocrail.git Rocrail"

J.

same wiki-page, TOP "Documentation":
"Documentation

Rocrail auf RasPi installieren, incl. Einrichtung eines RasPi (German full edition / Deutsche Vollversion)
How to install Rocrail on a RasPi (English very short edition)
Rocrail installeren op RasPi als AP (Dutch edition)"

DIYglenn
Posts: 102
Joined: 13.05.2015, 07:54

Re: Raspberry Pi 2: How to enable GPIO

Post by DIYglenn » 04.06.2015, 09:11

Thanks! I guess I just got confused by the wiki.

I'm pulling it from github now, the same way I did it on my Mac.

:)

Will try the rest of the guide from there.

DIYglenn
Posts: 102
Joined: 13.05.2015, 07:54

Re: Raspberry Pi 2: How to enable GPIO

Post by DIYglenn » 04.06.2015, 12:04

I'll do a write-up when I'm finished.

A couple of quick questions:

- I still get this error from "update-rc.d":

Code: Select all

update-rc.d: warning: default start runlevel arguments (2 3 4 5) do not match rocnetnoded Default-Start values (2 3)
But now the raspberry pi would restart, in comparison to running the deb-package! So at least I'm getting somewhere.

Another quick question: Is both I2C and SPI needed, or just I2C? Blacklist.conf is deprecated, so they have to be activated through "raspi-config", which is simple enough.
But looking at the wiki, both I2C and SPI are removed from the blacklist in the example?:
# blacklist spi and i2c by default (many users don't need them)

#blacklist spi-bcm2708
#blacklist i2c-bcm2708
But only I2C is added to modules:
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
# Parameters can be specified after the module name.
snd-bcm2835
i2c-bcm2708
i2c-dev
So should "spi-dev" and "spi-bcm2708" be there as well?
Last edited by DIYglenn on 04.06.2015, 14:11, edited 2 times in total.

DIYglenn
Posts: 102
Joined: 13.05.2015, 07:54

Re: Raspberry Pi 2: How to enable GPIO

Post by DIYglenn » 04.06.2015, 13:58

A lot of different problems, but I'm getting there. Blacklist.conf is deprecated, so I enabled I2C through raspi-config. After that I configured "/etc/modules (added the last two), because raspi-config would only enable i2c-bcm2708:

Code: Select all

# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
# Parameters can be specified after the module name.

snd-bcm2835
i2c-bcm2708
i2c-dev
I then rebooted, and ran this command to check that i2c-dev was now running in addition to i2c-bcm2708:

Code: Select all

pi@raspberry ~ $ lsmod | grep i2c
i2c_dev                 6709  0 
i2c_bcm2708             6200  0 
pi@raspberry ~ $ 
Then I checked with this command:

Code: Select all

pi@raspberry ~ $ sudo i2cdetect -y 1
sudo: unable to resolve host <hostname>
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         
pi@raspberry ~ $ 
So now I'm this far on a scratch install. As I said, I will do a writeup on the full install, it was a lot of tinkering to get this far.
Btw. do I HAVE to remove the hostname from /etc/hosts?
Hosts
The last line in file /etc/hosts: (127.0.1.1 raspberrypi)

Code: Select all

127.0.0.1	localhost
::1		localhost ip6-localhost ip6-loopback
fe00::0		ip6-localnet
ff00::0		ip6-mcastprefix
ff02::1		ip6-allnodes
ff02::2		ip6-allrouters

127.0.1.1	raspberrypi
must be deleted.
This is needed to retrieve the real IP address of this node.
It messes up something, because now I get "sudo: unable to resolve host <hostname>" everytime I write "sudo ..."

I would also like to get a comment on this:

Code: Select all

update-rc.d: warning: default start runlevel arguments (2 3 4 5) do not match rocnetnoded Default-Start values (2 3)
Is it necessary to limit it to only level 2 and 3? When setting up "rocraild" I used "update-rc.d rocraild defaults" from the wiki example, and it didn't give any errors...
Maybe I should think this the other way around instead; Why would raspbian in text only need run level 4 and 5, it can probably be set to have a default value of 2 and 3. I'll test this later.
AFAIK 4 isn't in use and 5 is GUI?

There's still nothing in "RocNetNode" on RocView though... But the green LED is blinking from PI01. No LED on PI02.
rocnetnode.png
You do not have the required permissions to view the files attached to this post.
Last edited by DIYglenn on 04.06.2015, 18:05, edited 1 time in total.

DIYglenn
Posts: 102
Joined: 13.05.2015, 07:54

Re: Raspberry Pi 2: How to enable GPIO

Post by DIYglenn » 04.06.2015, 14:32

My brain started working again:

After logging in with RocView from my Mac, I clicked "File -> Rocrail Properties -> Controller" and added "rocnet" which I named "RocNetLocal" and set the address to "127.0.0.1" (localhost)
RocNetLocal.png
Then, still from RocView, I went to "Programming -> RocNet -> Setup" and could find the node with the correct external sub-IP.
(Btw. is this the reason for removing "127.0.1.1" from hosts? I re-added it, but it still shows the external IP :) )
RocNetNode available.png
- So I've kept the original setting in /etc/hosts, because I don't know why you should remove the hostname from there, as the external IP is still shown in RocNet?
- Also - Should my Sprog controller be activated on RocNet setup or Rocrail properties? It's on the same device... It makes more sense to activate it directly in Rocrail server?

I can't communicate with PI02 or PI03, nothing happens. The LED is blinking on PI01, "Show" activates the red LED, so it seems correct.
This is the error if I try to click set:

Code: Select all

16.14.20 node [14] reports a [I2C](2)error, reason [write](2) on address [32]
Also, if I go to RocNet and change the ID to 0 or 1, it restarts, and increases the ID by 2, I can't set it. But it remembers the UID-Name I've set.:

Code: Select all

16.24.30 controller reports emergency: power off, stop all
16.24.30 node 65535 has been shutdown
16.24.29 controller reports emergency: power off, stop all
16.24.29 node 14 has been shutdown
16.14.20 node [14] reports a [I2C](2)error, reason [write](2) on address [32]
Please help me out. I'm finally getting further, but I'm still not at a place where I can communicate with sensors. I've gained a much better understanding of how everything is built together, but still it's tricky to get it working properly on one Raspberry Pi.

GCA-Pi02 has 5V between (-) and (+), and has 5V between (-) and pin 1-8 on I/O[1..4]

For some reason, i2c_dev is now on "2" instead of 0 at the end. I have no idea if this means anything. Anyways, this is the info I get:

Code: Select all

pi@raspberry ~ $ i2cdetect -l
i2c-1	i2c       	20804000.i2c                    	I2C adapter
pi@raspberry ~ $ lsmod | grep i2c
i2c_dev                 6709  2 
i2c_bcm2708             6200  0 
pi@raspberry ~ $ 
You do not have the required permissions to view the files attached to this post.

DIYglenn
Posts: 102
Joined: 13.05.2015, 07:54

Re: Raspberry Pi 2: Setup from scratch

Post by DIYglenn » 04.06.2015, 18:14

Anyone experienced anything similar?

I'm pretty new to I2C with RPi, so I can't figure this one out...

DIYglenn
Posts: 102
Joined: 13.05.2015, 07:54

Re: Raspberry Pi 2: Setup from scratch

Post by DIYglenn » 05.06.2015, 08:22

Still trying to find where the error is, I edited /etc/modules again:
etcmodules.png
i2c_dev is the only one that has to be there. i2c_bcm2708 is activated by raspi-config.

Still no luck though. I can't find PI02 or PI03.
You do not have the required permissions to view the files attached to this post.

DIYglenn
Posts: 102
Joined: 13.05.2015, 07:54

Re: Raspberry Pi 2: Setup from scratch

Post by DIYglenn » 05.06.2015, 09:36

I did a "sudo apt-get update && sudo apt-get upgrade" to make sure everything was at the latest version.
This did for some reason mess everything up.
NO modules are loaded now. i2c etc. can't be found.

Too quickly sum up, this is what I did to get as far as I am now:

- Install Rasbian through NOOBS
- Activate I2C and SSH through raspi-config
- Install libudev-dev (sudo apt-get install libudev-dev)
- Install the latest libusb-1.0.xx
- Get Rocrail surce from github, make fromtar (errors on rocview because of no wxwidgets)
- Make install etc. (fails at rocview)
- rocnetnode; Make install (took like 1 second)
- Copy rocnetnoded and rocraild to /etc/init.d/ and *.sh to /opt/rocrail/
- Add i2c-dev to /etc/modules.

PI02/PI03 not detectable

- Apt-get update/upgrade

Now all modules are gone on the RPi... lsmod = empty

DIYglenn
Posts: 102
Joined: 13.05.2015, 07:54

Re: Raspberry Pi 2: Setup from scratch

Post by DIYglenn » 05.06.2015, 11:40

I tried with the image, but I didn't get any further.
"i2cdetect -y 1" still shows no attached components.

And rocrail wasn't on the image, just RocNetNode.

I've tried powering the RPi from USB and connecting directly to PI02 or PI03, still no luck in discovering any of the units.

Do I need to install firmware to the chips or something? There's just nothing happening.

DIYglenn
Posts: 102
Joined: 13.05.2015, 07:54

Re: Raspberry Pi 2: Setup from scratch

Post by DIYglenn » 05.06.2015, 11:53

Waaaaaait a minute.

"Raspberry Pi Model B+ V1.2"

Is this model to old?

Post Reply

Return to “RocNetNode”