User Tools

Site Tools


rocnet:rocnetnode-img-en

Differences

This shows you the differences between two versions of the page.


rocnet:rocnetnode-img-en [2022/10/29 07:11] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +====== RocNetNode Raspbian Package======
 +[[:english#command_stations|{{  :interface.png}}]][[:english|{{  :rocrail-logo-35.png}}]][[:rocnet:rocnetnode-en|{{ :rocnet:rocnet-hw.png}}]]
 +[[:english|Content]] -> [[:english#command_stations|Command Stations]] ->  **[[rocnet:rocnet-prot-en|RocNet]]** 
 +  * [[rocnet:rocnet-prot-en|RocNet Protocol]] | **[[:rocnet:rocnetnode-en|RocNetNode]]**
 +    * [[:rocnet:rocnetnode-hwsetup-en|RocNetNode Setup]] | [[:rocnet:rocnetnode-setup-en|RocNetNode Configuration]] | **[[:rocnet:rocnetnode-img-en|Installer package]]**
 +    * [[:gca1-pi01-en|GCA-Pi01]] | [[:rocnet:pi01can-en|Pi01CAN]] | [[:gca_pi02-en|GCA-Pi02]] | [[:gca-pi03-en|GCA-PI03]] | [[:gca-pi04-en|GCA-PI04]] | [[:gca-pi05-en|GCA-Pi05]] | [[:gca-pi06-en|GCA-Pi06]] | [[:GCA-PI07-en|GCA-PI07]] | [[:gca107-en|GCA107 Relay board]] | [[:rocnet:rocdisplay-en|RocDisplay]] | [[:rocnet:fastclock-en|Fast Clock]]
 +  * [[:wiki:user:minou65:rocnetnode-epseak-de|Setup ESpeak (DE)]] | [[:wiki:user:minou65:soundrocnode|Setup Sound (DE)]]
  
 + \\
 +[[http://raspberrypi.org|“Raspberry Pi" is a trademark of the Raspberry Pi Foundation.]]\\
 + \\
 +===== Introduction =====
 +To make the Raspi RocNetNode Plug&Play an installer package which contains all what is needed to configure and operate is provided.\\
 +
 +====Raspbian====
 +The installer target is **[[http://www.raspberrypi.org/downloads|Raspbian]]** and will __not__ install on __Debian__.\\
 +  * [[http://elinux.org/RPi_Easy_SD_Card_Setup|SD Card Setup]]
 +
 +The following error will occur when trying to install on Debian:
 +<code>
 +dpkg: error processing rocnetnode-xxxxx-raspbian-armhf.deb (--install):
 +package architecture (armhf) does not match system (armel)
 +</code>
 +//It is strongly encouraged to use Raspbian because it is optimized for the Rasberry Pi and has therefor better performance.//\\
 + \\
 +
 +===== Package contents =====
 +^ Description ^ File ^
 +| RocNetNode binary | /opt/rocnet/[[:rocnet:rocnetnode-en|rocnetnode]] |
 +| Libraries | /opt/rocnet/[[:dcc232-en|dcc232]].so\\ /opt/rocnet/[[:sprog-en|sprog]].so\\ /opt/rocnet/[[:rfid12-en|rfid12]].so |
 +| Default setup | /opt/rocnet/rocnetnode.ini |
 +| Startup script | /opt/rocnet/rocnetnode.sh |
 +| Update script | /opt/rocnet/update.sh |
 +| Daemon script | /etc/init.d/rocnetnoded |
 +| Configure the I2C modules | postinst |
 +| Configure the RocNetNode as service at run level 2 and 3 | postinst |
 +
 +
 +
 + \\
 +
 +==== Raspi Basic Settings for Rocnetnode ====
 +
 +<code>
 +sudo raspi-config
 +</code>
 +\\
 +   * enable SSH for remote maintenance
 +   * optional: change password
 +   * enable I2C interface for communication with the PIxx
 +   * enable serial interface for RFID communication
 +\\
 +
 +
 +===== Download & Install=====
 +  * https://rocrail.net/software/rocrail-snapshot/
 +With ssh or a direct connection:
 +<code>
 +wget https://wiki.rocrail.net/rocrail-snapshot/RocNetNode-armhf.deb
 +sudo apt install ./RocNetNode-armhf.deb
 +sudo reboot
 +</code>
 +| //Default login: user=pi, password=raspberry// |\\
 +**Note:** The default keyboard layout is used which is English. (**[[http://en.wikipedia.org/wiki/Keyboard_layout|QWERTY]]**)\\
 + \\
 +
 +====Upgrade====
 +Upgrades are, especially after the first roll out, sometimes necessary to fix bugs and to add extra functionality.\\
 +Its done in just a four steps:  
 +<code>
 +sudo service rocnetnoded stop
 +wget https://wiki.rocrail.net/rocrail-snapshot/RocNetNode-armhf.deb
 +sudo apt install ./RocNetNode-armhf.deb
 +sudo service rocnetnoded start
 +</code>
 + \\
 +
 +=====Shutdown=====
 +====Workspace====
 +{{ :rocnet:shutdown-allnodes.png?140}}
 +At shutdown "Rocview & Server" a second question is asked to shutdown all RocNetNodes in case RocNet is one of the controllers in the Rocrail server.\\
 +
 +====Configuration Dialog====
 +See: [[:rocnet:rocnetnode-setup-en#shutdown|RocNetNode Configuration]] -> Shutdown \\
 +====Terminal====
 +<code>
 +sudo service rocnetnoded stop
 +</code>
 +====Power off====
 +This is **not** the preferred way to shutdown RocNetNode because it does not report it to the Rocrail server and at worst case it could be loss of configuration settings.\\ But sometimes an unwanted power off happens and should normally not lead to any problem.\\
 + \\
 +
 +<html><!--
 +=====Pre Configured SD-Card=====
 +| [[:gca:gca-index-en#raspbery_pi_rocnet_boards|Only in combination with a GCA-Pi01 order.]] |
 +The RocNetNode version ist not always up to date so after connecting the RocNetNode to Rocrail an __**[[:rocnet:rocnetnode-setup-en#update|Update]]**__ should be made before proceeding.\\
 + \\
 +
 +=====SD-Card Image=====
 +{{ :rocnet:sd.jpg}}{{ :rocnet:micro-sd.png?100}}
 +| :!: The first thing to do is to __**[[:rocnet:rocnetnode-setup-en#update|update the RocNetNode Software]]**__ on the SD-Card. |\\
 +
 +====Raspberry Pi 2 Model B====
 +  * https://rocrail.net/software/rocrail-snapshot/raspi/rocnetnode-2b-raspbian-wheezy.img.gz (1.1GB)
 +A Micro SD card with 8GB capacity will be a good choice.\\
 +  * It is based on the __**[[http://www.raspberrypi.org/downloads/|RASPBIAN Debian Wheezy Version of Feb.  2015]]**__.
 +  * A Micro SD-Card is needed.
 + \\
 +
 +
 +====Raspberry Pi 1 Model B/B+====
 +  * https://rocrail.net/software/rocrail-snapshot/raspi/rocnetnode-bplus-wheezy-raspbian.img.gz (840MB)
 +This image needs at least a capacity of **4GB** (3.965.190.144 Bytes) on a SD-Card.
 +  * It is based on the __**[[http://www.raspberrypi.org/downloads/|RASPBIAN Debian Wheezy Version of June 2014]]**__.
 +  * A Micro SD-Card is needed for Model B+.
 + \\
 +
 +====Previous images====
 +  * https://rocrail.net/software/rocrail-snapshot/raspi/rrnode-wheezy-raspbian.img.gz (590MB)
 +This image needs __at least__ a capacity of **3.974.103.040** Bytes and is for Model B only. (Samsung SDHC 4GB Calss 4)\\
 +| :!: Some 4GB Cards have less capacity like the SanDisk SDHC 4GB Class 4: **3.965.190.144** Bytes |\\
 +
 + \\
 +
 +====How to install the image====
 +__Read this first if you do not know how to install the image on a SD Card:__
 +  * __**[[http://elinux.org/RPi_Easy_SD_Card_Setup|SD-Card Setup]]**__
 +===Linux===
 +<code>
 +sudo umount /dev/sdx1
 +sudo dd bs=4M if=rocnetnode-bplus-wheezy-raspbian.img of=/dev/sdx
 +</code>
 +Replace /dev/sdx with the device found with:
 +<code>df -h</code>
 +command.\\
 +The output could look like this:
 +<code>
 +Filesystem      Size  Used Avail Use% Mounted on
 +/dev/sda2       292G   33G  245G  12% /
 +none            4,0K      4,0K   0% /sys/fs/cgroup
 +udev            899M  4,0K  899M   1% /dev
 +tmpfs           182M  1,4M  181M   1% /run
 +none            5,0M      5,0M   0% /run/lock
 +none            910M   80K  910M   1% /run/shm
 +none            100M   60K  100M   1% /run/user
 +/dev/sda1        93M  118K   93M   1% /boot/efi
 +/dev/sdb2       2,6G  2,1G  427M  83% /media/rocrail/5d18be51-3217-4679-9c72-a54e0fc53d6b
 +/dev/sdb1        56M  9,5M   47M  17% /media/rocrail/boot
 +</code>
 +In this case the device **/dev/sdb** is the SD-Card.\\
 +Be very careful not to overwrite another disk except the inserted SD-Card!\\ 
 + \\
 +--></html>
 +  
 +
 +====Auto startup====
 +<code>
 +sudo cp ~/Rocrail/rocnetnode/package/rocnetnoded /etc/init.d/rocnetnoded
 +sudo chmod 755 /etc/init.d/rocnetnoded
 +sudo chmod 755 /opt/rocnet/rocnetnode.sh
 +sudo update-rc.d rocnetnoded defaults
 +</code>
 +To re-install afterwards a modified rocnetnoded script it has to be removed first:
 +<code>
 +sudo update-rc.d rocnetnoded remove
 +</code>
 +Otherwise the command does do nothing than show warnings only.\\
 +
 +===Run levels===
 +^ Event ^ Levels ^
 +| Start | 2, 3 |
 +| Stop | 0, 1, 6 |
 +
 +
 + \\
 +===Manually start/stop===
 +The RocNetNode can be manually started and stopped with the service command:
 +<code>
 +sudo service rocnetnoded stop
 +</code>
 + \\
 +
 +====Modifications====
 +===Hosts===
 +The last line in file /etc/hosts: (//127.0.1.1 raspberrypi//)
 +<code>
 +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
 +</code>
 +must be deleted.\\
 +This is needed to retrieve the real IP address of this node.\\
 +
 +
 + \\
 +
 +====I2C====
 +See: __**[[:rocnet:rocnetnode-en#i2c_preparations|I2C preparations]]**__\\
 +| This can only be enabled with the **sudo** command. |\\
 +Remove the modules from the **/etc/modprobe.d/raspi-blacklist.conf** by commenting them out (insert # at the beginning of the following lines):
 +<code>
 +# blacklist spi and i2c by default (many users don't need them)
 +
 +#blacklist spi-bcm2708
 +#blacklist i2c-bcm2708
 +</code>
 +
 +Add them in **/etc/modules**:
 +<code>
 +# /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
 +</code>
 +
 +=====Check the I2C bus=====
 +Get the I2C tools:
 +<code>
 +sudo apt-get install i2c-tools
 +</code>
 +Check bus 1 with 2 x __**[[:gca_pi02-en|GCA-Pi02]]**__:
 +<code>
 +pi@raspberrypi ~ $ sudo i2cdetect -y 1
 +      1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
 +00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
 +10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
 +20: 20 21 22 23 -- -- -- -- -- -- -- -- -- -- -- -- 
 +30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
 +40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
 +50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
 +60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
 +70: -- -- -- -- -- -- -- --    
 +</code>
 +
 +
 + \\
 +
 +=====FAQ=====
 +  - Can both the Rocrail server and the RocNetNode be installed on the same Raspberry Pi?
 +    * Yes.
 +  - I2C stopped working after an Raspbian update
 +    * http://www.raspberrypi.org/forums/viewtopic.php?p=675658#p675658
 + \\
 +
 +=====Links=====
 +  * http://www.raspberrypi.org/downloads
 +  * [[http://www.raspbian.org/|{{http://www.raspbian.org/static/common/raspbian_logo.png?100}}]]
 +  * http://downloads.raspberrypi.org (Also previous Raspbian versions.)
 +  * https://www.realvnc.com/en/connect/download/viewer/
 +  \\
 +=====Technical Details=====
 +The components used for basic I/O are the MCP23017 and the Adafruit 16 channel LED/Servo board. The Adafruit board is based on the PCA9685. Datasheets are readily available for both.  There are many different I2C chips available but most are available only in surface mount.  
 +
 +  * The Adafruit board is available at http://www.adafruit.com/products/815
 + \\
 +  
 +
 +
 +
 +=====Security=====
 +
 +Security of the Rpi (Raspberry Pi) is a topic that is not well covered.  Since the Rpi runs a standard version of Linux, security measures for Linux also apply to the Rpi.  Some of the measures that should be taken are:
 +
 +  - Change the default password for 'pi'.
 +  - Turn off unneeded services such as cups (print), etc.
 +
 +There are other preventative measures that could or should  be taken but is well outside the scope of this reminder.
 +
 + \\
rocnet/rocnetnode-img-en.txt · Last modified: 2022/10/29 07:11 by 127.0.0.1