Installation guide: Process and Operator station on the Raspberry Pi
From Proview Wiki
- 1) Install Ubuntu 12.10 desktop OS on the development (virtual) machine:
</dt>
- Host system is Microsoft Windows 7 Ultimate 64 bit, fully patched, 2 socket XeonE5620, 32GB RAM ::VM environment is Oracle VM VirtualBox 4.2.6r82870 with Extension Pack hosted on above </dd>
- Create virtual machine (VM): 4GB RAM, 30GB disk, bridged network adaptor, enable 3D accel, no floppy boot, bidir clipboard, shared folder to pwr docs, otherwise defaults </dd>
- Boot the iso on the VM </dd>
- English, install ubuntu </dd>
- Download updates while installing </dd>
- Install this third party software </dd>
- Erase disk and install ubuntu </dd>
- Chicago </dd>
- English (us), english (us) </dd>
- Hostname pwrDevel </dd>
- Require login pw </dd>
- Restart
</dd> - Create virtual machine (VM): 4GB RAM, 30GB disk, bridged network adaptor, enable 3D accel, no floppy boot, bidir clipboard, shared folder to pwr docs, otherwise defaults </dd>
- Host system is Microsoft Windows 7 Ultimate 64 bit, fully patched, 2 socket XeonE5620, 32GB RAM ::VM environment is Oracle VM VirtualBox 4.2.6r82870 with Extension Pack hosted on above </dd>
- 2) Patch the install
</dt>
- sudo apt-get update </dd>
- sudo apt-get dist-upgrade </dd>
- restart (for new kernel)
</dd> - sudo apt-get dist-upgrade </dd>
- sudo apt-get update </dd>
- 3) Install virtualbox tools
</dt>
- sudo apt-get install linux-headers-generic dkms build-essential </dd>
- From vbox menu pick: Devices | Install Guest Additions </dd>
- Allow autorun prompt to procede, authenticate </dd>
- Restart
</dd> - From vbox menu pick: Devices | Install Guest Additions </dd>
- sudo apt-get install linux-headers-generic dkms build-essential </dd>
- 4) Minimize annoyances
</dt>
- Get rid of advertising and the global menu </dd>
- sudo apt-get remove unity-lens-shopping appmenu-gtk appmenu-gtk3 appmenu-qt </dd>
- Launch firefox, disable 'global menu integration' extension </dd>
- Logout, log back in
</dd> - sudo apt-get remove unity-lens-shopping appmenu-gtk appmenu-gtk3 appmenu-qt </dd>
- Get rid of advertising and the global menu </dd>
- turn off spyware
</dd>
- turn off spyware
- launch "System Settings | Privacy" </dd>
- pick "Search Results," pick "Include online search results: Off" </dd>
- pick "Diagnostics", uncheck "Send error reports to Canonical", pick "Record Activity: OFF" </dd>
- sudo add-apt-repository ppa:tualatrix/ppa </dd>
- sudo add-apt-repository ppa:satyajit-happy/themes </dd>
- sudo add-apt-repository ppa:indicator-multiload/stable-daily </dd>
- sudo apt-get update </dd>
- sudo apt-get install gnome-shell synaptic gconf-editor gnome-tweak-tool ubuntu-tweak nautilus-open-terminal
</dd> - pick "Search Results," pick "Include online search results: Off" </dd>
- launch "System Settings | Privacy" </dd>
- note: accept defaults for gdm
</dd>
- note: accept defaults for gdm
- sudo apt-get install orion-gtk-theme indicator-multiload compizconfig-settings-manager </dd>
- right click desktop pick "Change Desktop Background", select non-orange and non-purple background </dd>
- from Dash, launch "System Load Indicator" </dd>
- launch "System Settings | Ubuntu Tweak" </dd>
- pick "Tweaks | Miscellaneous", pick "Overlay scrollbars: Normal" </dd>
- pick "Tweaks | Theme", pick "Gtk theme: Orion", "Icon theme: gnome", "Window theme: Radiance" </dd>
- pick "Tweaks | Desktop Icons", pick "Show Computer", "Show mounted volumes" </dd>
- pick "Tweaks | Unity", adjust "Launcher icon size" to not waste so much screen space </dd>
- pick "Tweaks | Window", pick "Window control button...: Right"
</dd> - right click desktop pick "Change Desktop Background", select non-orange and non-purple background </dd>
- sudo apt-get install orion-gtk-theme indicator-multiload compizconfig-settings-manager </dd>
- from Dash, launch "CompizConfig Settings Manager" </dd>
- un-check "Snapping Windows" </dd>
- delete unneeded icons from launcher: the "bag", the libre office stuff, the "U"s, the advertising </dd>
- add "Terminal" to launcher </dd>
- sudo apt-get install geany </dd>
- add "Geany" to launcher
</dd> - un-check "Snapping Windows" </dd>
- from Dash, launch "CompizConfig Settings Manager" </dd>
- 5) Install prerequisites for 'Proview build from source code'
</dt>
- install some packages (note: openssh-server is not really a prerequisite) </dd>
- sudo apt-get install make flex libgtk2.0-dev libdb5.1-dev libdb5.1++-dev libasound2-dev doxygen libmysql++-dev xfonts-100dpi openssh-server </dd>
- install java JDK </dd>
- download tarball from <a class="external free" rel="nofollow" href="http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html">http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html</a> </dd>
- cd /usr/local </dd>
- sudo tar -zxvf /home/<userID>/jdk-7u17-linux-x64.tar.gz </dd>
- sudo chown -R root:root jdk1.7.0_17/ </dd>
- sudo -s </dd>
- cd /etc/profile.d </dd>
- touch proview.build.sh </dd>
- vi proview.build.sh </dd>
- insert the following lines: </dd>
- export jdk=/usr/local/jdk1.7.0_17 </dd>
- export PATH=$PATH:$jdk/bin </dd>
- save edited file, exit vi </dd>
- exit (from sudo)
</dd> - sudo apt-get install make flex libgtk2.0-dev libdb5.1-dev libdb5.1++-dev libasound2-dev doxygen libmysql++-dev xfonts-100dpi openssh-server </dd>
- install some packages (note: openssh-server is not really a prerequisite) </dd>
- 6) Install Proview development environment & debug runtime </dt>
- wget -Opwr48_4.8.6-3.2_amd64.deb <a class="external free" rel="nofollow" href="http://sourceforge.net/projects/proview/files/proview/proview_4.8.6-3/ubuntu_12.10/pwr48_4.8.6-3.2_amd64.deb/download">http://sourceforge.net/projects/proview/files/proview/proview_4.8.6-3/ubuntu_12.10/pwr48_4.8.6-3.2_amd64.deb/download</a> </dd>
- sudo dpkg -i pwr48_4.8.6-3.2_amd64.deb </dd>
- sudo adduser pwrp sudo </dd>
- logout </dd>
- login as pwrp </dd>
- fix annoyances </dd>
- from launcher, pick "System Settings | Brightness and Lock" </dd>
- pick "Lock: OFF" </dd>
- exit </dd>
- cd </dd>
- sudo chown pwrp:pwrp Desktop </dd>
- install antlr </dd>
- wget <a class="external free" rel="nofollow" href="http://www.antlr2.org/download/antlr-2.7.7.tar.gz">http://www.antlr2.org/download/antlr-2.7.7.tar.gz</a> </dd>
- tar -zxvf antlr-2.7.7.tar.gz </dd>
- geany ~/antlr-2.7.7/lib/cpp/antlr/CharScanner.hpp </dd>
- add: #include <strings.h>
- include <stdio.h>
- save changes and exit </dd>
- cd ~/antlr-2.7.7 </dd>
- ./configure </dd>
- make </dd>
- sudo make install </dd>
- change max shared memory </dd>
- sudo geany /etc/sysctl.conf </dd>
- insert a line at the end: </dd>
- kernel.shmmax=67108864 </dd>
- save changes, exit geany </dd>
- sudo -s </dd>
- echo 67108864 > /proc/sys/kernel/shmmax </dd>
- exit
</dd> - sudo dpkg -i pwr48_4.8.6-3.2_amd64.deb </dd>
- wget -Opwr48_4.8.6-3.2_amd64.deb <a class="external free" rel="nofollow" href="http://sourceforge.net/projects/proview/files/proview/proview_4.8.6-3/ubuntu_12.10/pwr48_4.8.6-3.2_amd64.deb/download">http://sourceforge.net/projects/proview/files/proview/proview_4.8.6-3/ubuntu_12.10/pwr48_4.8.6-3.2_amd64.deb/download</a> </dd>
- 7)) Install Proview source
</dt>
- login as pwrp </dd>
- cd </dd>
- wget -Opwrsrc_4.8.6-3.2.tar.gz <a class="external free" rel="nofollow" href="http://sourceforge.net/projects/proview/files/proview/proview_4.8.6-3/pwrsrc_4.8.6-3.2.tar.gz/download">http://sourceforge.net/projects/proview/files/proview/proview_4.8.6-3/pwrsrc_4.8.6-3.2.tar.gz/download</a> </dd>
- tar -zxvf pwrsrc_4.8.6-3.2.tar.gz
</dd> - cd </dd>
- login as pwrp </dd>
- 8) Bake the raspberry pi
</dt>
- get the wheezy image 2013-02-09 via torrent </dd>
- write to 8 GB Class 10 SD card </dd>
- boot </dd>
- using the Raspi-config tool: </dd>
- expand_rootfs </dd>
- configure_keyboard </dd>
- English (US) </dd>
- English (US) </dd>
- The default for the keyboard layout </dd>
- No compose key </dd>
- Control-Alt-Backspace to terminal X server: No </dd>
- change_pass </dd>
- change_locale </dd>
- en_US.UTF-8 UTF-8 only </dd>
- default locale for system environment: none </dd>
- change_timezone: US Central </dd>
- ssh: Enable </dd>
- boot_behavior: No </dd>
- Finish </dd>
- reboot </dd>
- login as pi </dd>
- sudo apt-get update </dd>
- sudo apt-get dist-upgrade </dd>
- sudo apt-get install tightvncserver </dd>
- sudo apt-get install libgtk2.0-dev </dd>
- sudo rm /etc/ssh/ssh_host_* </dd>
- sudo dpkg-reconfigure openssh-server </dd>
- sudo adduser pwrp </dd>
- use password = 'pwrp' (same as Proview distro default) </dd>
- sudo adduser pwrp dialout </dd>
- (this is for arduino access) </dd>
- sudo visudo </dd>
- insert following line under the "root ALL=(ALL) ALL" Line: </dd>
- pwrp ALL=(ALL) ALL </dd>
- save changes, exit </dd>
- sudo nano /etc/security/limits.conf </dd>
- insert the following:
- - rtprio 99
- save and exit </dd>
- sudo nano /etc/pam.d/su </dd>
- uncomment line: </dd>
- session required pam_limits.so </dd>
- save and exit </dd>
- (note: this allows the pwr service start to set pwr tasks' realtime priorities) </dd>
- (note2: also applies to the pwrp tightvncserver X session, since that is launched with su also) </dd>
- sudo nano /etc/init.d/tightvncserver </dd>
- insert the following into the new file:
- !/bin/sh
- /etc/init.d/tightvncserver
- VNCUSER='pwrp' </dd>
- case "$1" in </dd>
- start) </dd>
- su $VNCUSER -c '/usr/bin/tightvncserver :0 -geometry 1024x768 -depth 24' </dd>
- echo "Starting TightVNC Server for $VNCUSER "
- </dt>
- write to 8 GB Class 10 SD card </dd>
- stop) </dd>
- pkill Xtightvnc </dd>
- echo "TightVNC Server stopped"
- </dt>
- get the wheezy image 2013-02-09 via torrent </dd>
- )
- </dt>
</dd>
- 9) Configure ssh access from dev to rpi
- logon to dev as pwrp </dd>
- do this only once: </dd>
- ssh-keygen -t rsa </dd>
- sudo geany /etc/hosts </dd>
- insert line for raspberry pi machine(s) and any other hosts in the distributed system </dd>
- save and exit </dd>
- scp /home/pwrp/.ssh/id_rsa.pub rpi3:/home/pwrp/.ssh/authorized_keys
</dd> - ssh-keygen -t rsa </dd>
- 10) Install cross platform dev tools on dev
</dt>
- logon to dev as pwrp </dd>
- sudo apt-get install ia32-libs git </dd>
- cd </dd>
- mkdir rpitools </dd>
- cd rpitools </dd>
- sudo git clone <a class="external free" rel="nofollow" href="git://github.com/raspberrypi/tools.git">git://github.com/raspberrypi/tools.git</a> </dd>
- create symbolic links to compilers and archiver as a workaround on rather long fully qualified names - </dd>
- (Proview merge tool has a hardcoded alloc of 80 chars max for the FQ name of each of these tools): </dd>
- sudo -s </dd>
- ln -s /home/pwrp/rpitools/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc /usr/bin/arm-gcc </dd>
- ln -s /home/pwrp/rpitools/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++ /usr/bin/arm-g++ </dd>
- ln -s /home/pwrp/rpitools/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-ar /usr/bin/arm-ar </dd>
- exit
</dd> - sudo apt-get install ia32-libs git </dd>
- logon to dev as pwrp </dd>
- 11) Get a copy of the rpi headers and libraries to compile and link against, respectively
</dt>
- logon to dev as pwrp </dd>
- rsync -avz -e ssh pwrp@rpi3:/usr/include /home/pwrp/rpi </dd>
- sudo rsync -avz -e ssh pwrp@rpi3:/usr/lib/arm-linux-gnueabihf /usr/lib </dd>
- sudo rsync -avz -e ssh pwrp@rpi3:/lib/arm-linux-gnueabihf /lib
</dd> - rsync -avz -e ssh pwrp@rpi3:/usr/include /home/pwrp/rpi </dd>
- logon to dev as pwrp </dd>
- 12) Setup the build environment
</dt>
- logon to dev as pwrp </dd>
- cd </dd>
- geany ~/.envarm </dd>
- insert the following into this new file:
- .envarm:
- env for Proview development for raspberry pi
- export pwre_cc=/usr/bin/arm-gcc </dd>
- export pwre_cxx=/usr/bin/arm-g++ </dd>
- export pwre_ar=/usr/bin/arm-ar </dd>
- export pwr_host_exe=/usr/pwr48/os_linux/hw_x86_64/exp/exe </dd>
- export pwre_host_exe=/usr/pwr48/os_linux/hw_x86_64/exp/exe </dd>
- export pwre_env_db=/home/pwrp/pwre_env_db </dd>
- export pwre_bin=/home/pwrp/pwrsrc_4.8.6-3/src/tools/pwre/src/os_linux </dd>
- export pwre_dir_symbols=$pwre_bin/dir_symbols.mk </dd>
- export PATH=$PATH:/home/pwrp/rpitools/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin </dd>
- source $pwre_bin/pwre_function </dd>
- save and exit </dd>
- geany ~/.bashrc </dd>
- insert at end of file: </dd>
- source ~/.envarm </dd>
- save and exit </dd>
- close all Terminal(s) </dd>
- launch Terminal </dd>
- cd </dd>
- mkdir pwrrls_4.8.6-3 </dd>
- define a PWRE environment for the build: </dd>
- pwre add v486_arm </dd>
- -- </dd>
- -- Environment : v486_arm </dd>
- -- Module.........: rt </dd>
- -- Source root....: /home/pwrp/pwrsrc_4.8.6-3/src </dd>
- -- Import root....: /usr/pwr48/os_linux/hw_x86_64 </dd>
- -- Build root.....: /home/pwrp/pwrrls_4.8.6-3 </dd>
- -- Build type.....: dbg </dd>
- -- OS.............: linux </dd>
- -- Hardware.......: arm </dd>
- -- Description....: X48arm </dd>
- -- </dd>
- himBH
</dd> - cd </dd>
- logon to dev as pwrp </dd>
- 13) Fixup Proview config script
</dt>
- logon to dev as pwrp </dd>
- cd /home/pwrp/pwrsrc_4.8.6-3/src/tools/pwre/src/os_linux </dd>
- cp pwre_configure.sh pwre_configure.sh.org </dd>
- cd </dd>
- geany /home/pwrp/pwrsrc_4.8.6-3/src/tools/pwre/src/os_linux/pwre_configure.sh </dd>
- insert after line 311: </dd>
- pwre_config_check_lib gtk GTK gtk gtk 0 "/usr/lib/arm-linux-gnueabihf/libgtk-x11-2.0.so" </dd>
- pwre_config_check_include gtk GTK 1 "/home/pwrp/rpi/include/gtk-2.0/gtk/gtk.h" </dd>
- as a sanity check, the code block should look like: </dd>
- if test $pwre_hw == "hw_arm"; then </dd>
- </dd>
- pwre_config_check_lib gtk GTK gtk gtk 0 "/usr/lib/arm-linux-gnueabihf/libgtk-x11-2.0.so" </dd>
- pwre_config_check_include gtk GTK 1 "/home/pwrp/rpi/include/gtk-2.0/gtk/gtk.h" </dd>
- </dd>
- </dd>
- pwre_config_check_include jni JNI 1 $jdk/include/jni.h </dd>
- pwre_config_check_include jni JNI 0 $jdk/include/linux/jni_md.h </dd>
- save and exit </dd>
- pwre init v486_arm </dd>
- pwre configure </dd>
- need to figure out some paths, will use the output from "pwre configure" to help, </dd>
- this is a little tedious: </dd>
- geany /home/pwrp/pwrrls_4.8.6-3/pwre_arm_linux.cnf </dd>
- find line "export pwre_conf_libgtk=" </dd>
- note the embedded command, e.g. "pkg-config --libs gtk+-2.0", designate as "cmd1" </dd>
- find line "export pwre_conf_incdirgtk=" </dd>
- note the embedded command, e.g. "pkg-config --cflags gtk+-2.0", designate as "cmd2". the commands will now be run on the rpi: </dd>
- ssh rpi3 </dd>
- execute cmd1: </dd>
- pkg-config --libs gtk+-2.0 </dd>
- save the output in a new temp file, e.g. in geany </dd>
- execute cmd2: </dd>
- pkg-config --cflags gtk+-2.0 </dd>
- save the output to the temp file </dd>
- exit from ssh session </dd>
- in the temp file, replace "usr/include" with "home/pwrp/rpi/include" </dd>
- in geany, open /home/pwrp/pwrsrc_4.8.6-3/src/tools/pwre/src/os_linux/pwre_configure.sh </dd>
- find line "export pwre_conf_libgtk=" </dd>
- hard-code the contents of that assign to the output of cmd1, e.g.: </dd>
- echo "export pwre_conf_libgtk=\"-lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lglib-2.0\"" >> $cfile </dd>
- find line "export pwre_conf_incdirgtk=" </dd>
- hard-code the contents of that assign to the edited output of cmd2, e.g.: </dd>
- echo "export pwre_conf_incdirgtk=\"-pthread -I/home/pwrp/rpi/include/gtk-2.0 -I/usr/lib/arm-linux-gnueabihf/gtk-2.0/include -I/home/pwrp/rpi/include/atk-1.0 -I/home/pwrp/rpi/include/cairo -I/home/pwrp/rpi/include/gdk-pixbuf-2.0 -I/home/pwrp/rpi/include/pango-1.0 -I/home/pwrp/rpi/include/gio-unix-2.0/ -I/home/pwrp/rpi/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include -I/home/pwrp/rpi/include/pixman-1 -I/home/pwrp/rpi/include/freetype2 -I/home/pwrp/rpi/include/libpng12 \"" >> $cfile </dd>
- find line "echo "export pwre_conf_lib=\"-lpthread -lm -lrt -lcrypt\"" >> $cfile" </dd>
- add X11 and db5.1 libraries, e.g.: </dd>
- echo "export pwre_conf_lib=\"-lpthread -lm -lrt -lcrypt -lX11 -ldb-5.1\"" >> $cfile </dd>
- find line "echo "export pwre_conf_libdir=\"$conf_libdir\"" >> $cfile" </dd>
- hard-code the assignment to: </dd>
- echo "export pwre_conf_libdir=\"-L/usr/lib/arm-linux-gnueabihf -Wl,-rpath=/usr/lib/arm-linux-gnueabihf -Wl,-rpath=/lib/arm-linux-gnueabihf\"" >> $cfile </dd>
- find line "echo "export pwre_conf_incdir=\"$conf_incdir\"" >> $cfile" </dd>
- hard-code the assignment to: </dd>
- echo "export pwre_conf_incdir=\"-I /home/pwrp/rpi/include -I/usr/local/jdk1.7.0_17/include -I/usr/local/jdk1.7.0_17/include/linux\"" >> $cfile </dd>
- save the edited file </dd>
- cd </dd>
- mkdir pwrCustom </dd>
- save the edited file (again) as ~/pwrCustom/pwre_configure.sh.custom </dd>
- exit geany
</dd> - cd /home/pwrp/pwrsrc_4.8.6-3/src/tools/pwre/src/os_linux </dd>
- logon to dev as pwrp </dd>
- 14) Fixup Proview source tree
</dt>
- fix service start script: </dd>
- cp /home/pwrp/pwrsrc_4.8.6-3/src/tools/pkg/deb_armel/pwrrt/pwr ~/pwrCustom </dd>
- geany ~/pwrCustom/pwr </dd>
- for each of the functions: pwr_start, pwr_stop, pwr_reload, pwr_kill: </dd>
- replace the "whoami" conditional test from "root" to "pwrp" </dd>
- if using an arduino uno, add the following line within the create_wrapper function, after the umask command: </dd>
- echo "stty -F /dev/ttyACM0 10:0:8be:0:3:1c:7f:15:1:0:1:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0" >> $wrapper </dd>
- save and exit </dd>
- fix code error: </dd>
- geany /home/pwrp/pwrsrc_4.8.6-3/sev/lib/sev/src/sev_db.cpp </dd>
- add open curly brace on line 52: </dd>
- else if ( type == sev_eDbType_Sqlite) { </dd>
- add close curly brace after line 58. </dd>
- code block should now look like: </dd>
- if ( type == sev_eDbType_Mysql) {
- if defined PWRE_CONF_MYSQL
- return sev_dbms::open_database();
- else
- printf( "** Release is not built with mysql\n"); </dd>
- return 0;
- endif
- } </dd>
- else if ( type == sev_eDbType_Sqlite) {
- if defined PWRE_CONF_SQLITE3
- return sev_dbsqlite::open_database();
- else
- printf( "** Release is not built with sqlite3\n"); </dd>
- return 0;
- endif
- } </dd>
- else </dd>
- return 0; </dd>
- } </dd>
- end example code block </dd>
- save the edited file as: </dd>
- ~/pwrCustom/sev_db.cpp </dd>
- exit geany </dd>
- edit the build package script, it will not create a *.deb file as-is: </dd>
- geany ~/pwrsrc_4.8.6-3/src/tools/pkg/deb_armel/pwrrt/build.sh </dd>
- "# Create directories" section, insert line: </dd>
- mkdir -p $pkgroot/usr/pwrp/adm/db </dd>
- uncomment lines which copy op to cnf </dd>
- uncomment lines which copy user to cnf </dd>
- add following lines to "# Copy user to cnf" section: </dd>
- cp $pwre_broot/$pwre_target/exp/inc/pwr_arduino_uno.ino $pkgroot/usr/pwrrt/cnf/user </dd>
- cp $pwre_sroot/tools/pkg/deb/adm/proview_icon.png $pkgroot/usr/pwrrt/cnf/user </dd>
- cp /home/pwrp/pwrCustom/Proview.desktop $pkgroot/usr/pwrrt/cnf/user </dd>
- after the "# Copy user to cnf" section, insert the following lines:
- Copy user security data
- mkdir -p $pkgroot/usr/pwrp/adm/db </dd>
- cp $pwre_sroot/tools/pkg/deb/adm/pwr_user2.dat $pkgroot/usr/pwrp/adm/db </dd>
- comment out line "dpkg-buildpackage -aarmel -b" </dd>
- add following lines: </dd>
- packagename=pwrrt-$version.tar.gz </dd>
- tar -czf ../$packagename * </dd>
- save the edited file as: </dd>
- ~/pwrCustom/build.sh </dd>
- exit geany </dd>
- geany ~/pwrCustom/fixPwrSource.sh </dd>
- insert the following lines into the new file:
- !/bin/bash
- fix some missing dependencies
- cp /home/pwrp/pwrsrc_4.8.6-3/nmps/lib/nmps/src/nmps.h /home/pwrp/pwrsrc_4.8.6-3/src/exe/rt_sim/src/ </dd>
- cp /home/pwrp/pwrsrc_4.8.6-3/src/exe/rt_elog/src/rt_elog.h /home/pwrp/pwrsrc_4.8.6-3/xtt/lib/xtt/src/ </dd>
- cp /home/pwrp/pwrsrc_4.8.6-3/src/exe/rt_elog/src/rt_elog.h /home/pwrp/pwrsrc_4.8.6-3/xtt/lib/xtt/gtk/ </dd>
- cp /home/pwrp/pwrsrc_4.8.6-3/src/exe/rt_elog/src/rt_elog.h /home/pwrp/pwrsrc_4.8.6-3/src/exe/rt_elog_dump/src </dd>
- cp /usr/include/db.h /home/pwrp/pwrsrc_4.8.6-3/src/exe/rt_elog_dump/src </dd>
- cp /usr/include/db.h /home/pwrp/pwrsrc_4.8.6-3/xtt/lib/xtt/src </dd>
- cp /usr/include/db.h /home/pwrp/pwrsrc_4.8.6-3/xtt/lib/xtt/gtk </dd>
- </dd>
- mkdir /home/pwrp/pwrsrc_4.8.6-3/wb/lib/wb/src/antlr </dd>
- cp /home/pwrp/antlr-2.7.7/lib/cpp/antlr/* /home/pwrp/pwrsrc_4.8.6-3/wb/lib/wb/src/antlr </dd>
- fix code error
- cp ~/pwrCustom/sev_db.cpp /home/pwrp/pwrsrc_4.8.6-3/sev/lib/sev/src/sev_db.cpp </dd>
- copy build script which creates just a tarball, not a debian package, and includes some custom rpi/arduino specific stuff
- cp ~/pwrCustom/build.sh /home/pwrp/pwrsrc_4.8.6-3/src/tools/pkg/deb_armel/pwrrt </dd>
- copy custom pwre_configure.sh
- cp /home/pwrp/pwrCustom/pwre_configure.sh.custom /home/pwrp/pwrsrc_4.8.6-3/src/tools/pwre/src/os_linux/pwre_configure.sh </dd>
- copy custom pwr service control script
- cp ~/pwrCustom/pwr /home/pwrp/pwrsrc_4.8.6-3/src/tools/pkg/deb_armel/pwrrt/ </dd>
- save and exit </dd>
- chmod 755 ~/pwrCustom/fixPwrSource.sh </dd>
- geany ~/pwrCustom/Proview.desktop </dd>
- insert the following lines into the new file: </dd>
- [Desktop Entry] </dd>
- Name=Proview </dd>
- Comment=SCADA Operator Station </dd>
- Exec=/home/pwrp/.xtt_start </dd>
- Icon=proview_icon </dd>
- Terminal=false </dd>
- Type=Application </dd>
- MimeType=text/plain </dd>
- Categories=GTK </dd>
- save and exit
</dd> - cp /home/pwrp/pwrsrc_4.8.6-3/src/tools/pkg/deb_armel/pwrrt/pwr ~/pwrCustom </dd>
- fix service start script: </dd>
- 15) Final cleanup
</dt>
- logon to dev as pwrp </dd>
- delete /home/pwrp/pwrsrc_4.8.6-3 (and all contents) </dd>
- delete everything from /home/pwrp/pwrrls_4.8.6-3, leaving the folder </dd>
- unpack the source (again): </dd>
- cd </dd>
- tar -zxvf pwrsrc_4.8.6-3.2.tar.gz
</dd> - delete /home/pwrp/pwrsrc_4.8.6-3 (and all contents) </dd>
- logon to dev as pwrp </dd>
- 16) Build Proview for raspberry pi
</dt>
- logon to dev as pwrp </dd>
- cd </dd>
- pwre list </dd>
- pwre init v486_arm </dd>
- ./pwrCustom/fixPwrSource.sh </dd>
- pwre create_all_modules </dd>
- pwre import rt </dd>
- pwre import java </dd>
- pwre import op </dd>
- pwre configure </dd>
- ./pwrCustom/fixPwrSource.sh </dd>
- pwre ebuild rt </dd>
- pwre ebuild op </dd>
- pwre build tools/pkg deb_armel </dd>
- note: to enable pkg rebuild (when make says nothing to do): </dd>
- touch /home/pwrp/pwrsrc_4.8.6-3/src/tools/pkg/deb_armel/pwrrt/control
</dd> - cd </dd>
- logon to dev as pwrp </dd>
- 17) Install Proview runtime and op station on Raspberry Pi
</dt>
- logon to dev as pwrp </dd>
- geany ~/pwrCustom/installRpi.sh </dd>
- insert the following lines into the new file:
- !/bin/bash
- install Proview package on Raspberry Pi
- unpack the tarball
- cd /home/pwrp/proview </dd>
- tar -zxvf pwrrt-.tar.gz </dd>
- chown -R pwrp:pwrp /home/pwrp/proview
</dd> - geany ~/pwrCustom/installRpi.sh </dd>
- logon to dev as pwrp </dd>
-
- configure target dirs, install the archive
- install -d -o pwrp -g pwrp /usr/pwrrt </dd>
- install -d -o pwrp -g pwrp /usr/pwrrt/cnf </dd>
- install -d -o pwrp -g pwrp /usr/pwrrt/cnf/op </dd>
- install -d -o pwrp -g pwrp /usr/pwrrt/cnf/user </dd>
- install -d -o pwrp -g pwrp /usr/pwrrt/exe </dd>
- install -d -o pwrp -g pwrp /usr/pwrrt/lib </dd>
- install -d -o pwrp -g pwrp /usr/pwrrt/load </dd>
- </dd>
- install -d -o pwrp -g pwrp /pwrp </dd>
- install -d -o pwrp -g pwrp /pwrp/arm_linux </dd>
- install -d -o pwrp -g pwrp /pwrp/arm_linux/exe </dd>
- install -d -o pwrp -g pwrp /pwrp/arm_linux/lib </dd>
- install -d -o pwrp -g pwrp /pwrp/arm_linux/lis </dd>
- install -d -o pwrp -g pwrp /pwrp/arm_linux/obj </dd>
- </dd>
- install -d -o pwrp -g pwrp /pwrp/common </dd>
- install -d -o pwrp -g pwrp /pwrp/common/db </dd>
- install -d -o pwrp -g pwrp /pwrp/common/inc </dd>
- install -d -o pwrp -g pwrp /pwrp/common/load </dd>
- install -d -o pwrp -g pwrp /pwrp/common/log </dd>
- install -d -o pwrp -g pwrp /pwrp/common/loghist </dd>
- install -d -o pwrp -g pwrp /pwrp/common/web </dd>
- </dd>
- install -d /usr/pwrp </dd>
- install -d -o pwrp -g pwrp /usr/pwrp/adm </dd>
- install -d -o pwrp -g pwrp /usr/pwrp/adm/db </dd>
- </dd>
- install -d /usr/share/doc/pwrrt </dd>
- </dd>
- install -D /home/pwrp/proview/etc/* /etc </dd>
- install -D /home/pwrp/proview/etc/init.d/* /etc/init.d </dd>
- install -D -m 644 /home/pwrp/proview/usr/pwrrt/cnf/proview.cnf /etc </dd>
- </dd>
- install -D -o pwrp -g pwrp /home/pwrp/proview/usr/pwrrt/* /usr/pwrrt </dd>
- install -D -o pwrp -g pwrp /home/pwrp/proview/usr/pwrrt/cnf/* /usr/pwrrt/cnf </dd>
- install -D -o pwrp -g pwrp /home/pwrp/proview/usr/pwrrt/exe/* /usr/pwrrt/exe </dd>
- install -D -o pwrp -g pwrp /home/pwrp/proview/usr/pwrrt/lib/* /usr/pwrrt/lib </dd>
- install -D -o pwrp -g pwrp /home/pwrp/proview/usr/pwrrt/load/* /usr/pwrrt/load </dd>
- </dd>
- install -D -o pwrp -g pwrp /home/pwrp/proview/usr/pwrrt/cnf/op/.??* /usr/pwrrt/cnf/op </dd>
- install -D -o pwrp -g pwrp /home/pwrp/proview/usr/pwrrt/cnf/user/.??* /usr/pwrrt/cnf/user </dd>
- </dd>
- install -D -o pwrp -g pwrp /home/pwrp/proview/usr/pwrp/adm/db/* /usr/pwrp/adm/db </dd>
- </dd>
- install -D -m 644 /home/pwrp/proview/usr/share/doc/pwrrt/* /usr/share/doc/pwrrt </dd>
- install -D -m 644 /home/pwrp/proview/usr/share/man/man1/* /usr/share/man/man1 </dd>
- </dd>
- install -D -o pwrp -g pwrp -m 775 /home/pwrp/proview/usr/pwrrt/cnf/user/.??* /home/pwrp </dd>
- install -D -o pwrp -g pwrp -m 775 /home/pwrp/proview/usr/pwrrt/cnf/user/* /home/pwrp </dd>
- </dd>
- install -D -m 644 /home/pwrp/proview/usr/pwrrt/cnf/user/proview_icon.png /usr/share/pixmaps </dd>
- install -D -o pwrp -g pwrp -m 644 /home/pwrp/proview/usr/pwrrt/cnf/user/Proview.desktop /home/pwrp/Desktop </dd>
- </dd>
- if [ -f /home/pwrp/pwr_arduino_uno.ino ] </dd>
- then </dd>
- install -d -o pwrp -g pwrp /home/pwrp/sketchbook </dd>
- install -d -o pwrp -g pwrp /home/pwrp/sketchbook/pwr_arduino_uno </dd>
- mv /home/pwrp/pwr_arduino_uno.ino /home/pwrp/sketchbook/pwr_arduino_uno </dd>
- chown pwrp:pwrp /home/pwrp/sketchbook/pwr_arduino_uno/pwr_arduino_uno.ino </dd>
- fi </dd>
- save and exit </dd>
- scp /home/pwrp/pwrrls_4.8.6-3/os_linux/hw_arm/bld/pkg/pwrrt-.tar.gz pwrp@rpi3:~/proview </dd>
- scp /home/pwrp/pwrCustom/installRpi.sh pwrp@rpi3:~/ </dd>
- ssh rpi3 </dd>
- cd </dd>
- chmod 775 installRpi.sh </dd>
- sudo ./installRpi.sh </dd>
- sudo update-rc.d pwr defaults </dd>
- exit (from ssh session) </dd>
- 18) create proof-of-concept Proview project </dd>
- logon to dev as pwrp </dd>
- </dd>
- one-time fix so plc prog will build: </dd>
- mkdir /home/pwrp/pwrrls_4.8.6-3/os_linux/hw_x86_64 </dd>
- mkdir /home/pwrp/pwrrls_4.8.6-3/os_linux/hw_x86_64/exp </dd>
- mkdir /home/pwrp/pwrrls_4.8.6-3/os_linux/hw_x86_64/exp/exe </dd>
- cp ~/pwrsrc_4.8.6-3/src/exp/com/src/os_linux/pwrp_env.sh /home/pwrp/pwrrls_4.8.6-3/os_linux/hw_x86_64/exp/exe </dd>
- end one time fix </dd>
- </dd>
- on the desktop, double-click Proview V4.8 </dd>
- accept (and respect) the license terms </dd>
- using "PwR Project List": </dd>
- enter edit mode </dd>
- add a BaseReg object, child to Bases </dd>
- open the new object, set attributes: </dd>
- ObjectName: BaseV48arm </dd>
- Version : X48arm </dd>
- Path : /home/pwrp/pwrrls_4.8.6-3 </dd>
- close the object </dd>
- save changes </dd>
- note: the new base define is reflected as a new line in /usr/pwrp/adm/db/pwr_projectlist.dat </dd>
- the binding to the release build's path is via the "X48arm" token, which will be used below </dd>
- add a $Hier object, sibling to Bases </dd>
- set ObjectName attribute = "testProjects" </dd>
- add a ProjectReg object, child of testProjects </dd>
- open new object, set attributes: </dd>
- ObjectName : piPOC </dd>
- Description: Raspberry Pi Proof of Concept </dd>
- Version : X48arm </dd>
- (note: Version attr binds the project to the BaseV48arm) </dd>
- close the object </dd>
- save changes </dd>
- Confirm Actions: Yes </dd>
- note: the new project is reflected as a new directory tree at /usr/local/pwrp/pipoc </dd>
- leave edit mode </dd>
- right-click piPOC, pick Open Project </dd>
- using "Configure Directory Volume": </dd>
- enter "Production QBUS id" = 5 (this is arbitrary, but better than using defaults, for troubleshooting) </dd>
- click Next </dd>
- click Next </dd>
- click No </dd>
- click Next </dd>
- click Next </dd>
- click Skip this node </dd>
- click Next </dd>
- click Yes </dd>
- using "Configure Root Volume": </dd>
- pick Operator Station </dd>
- click Next </dd>
- click Next </dd>
- click Next </dd>
- using "PwR VolPipoc, pwrp on pipoc": </dd>
- from the drop-down menu, pick "File | Volume Attributes..." </dd>
- change the "OperatingSystem" attribute to "CustomBuild" </dd>
- close the object </dd>
- save changes </dd>
- close the window </dd>
- using "PwR Directory, pwrp on pipoc": </dd>
- enter edit mode </dd>
- </dd>
- open pipoc object, set attributes: </dd>
- NodeName : rpi3 (i.e. the hostname of the target rpi) </dd>
- OperatingSystem: CustomBuild </dd>
- BootNode: : rpi3 </dd>
- Address : 192.168.0.1 (i.e. the IPv4 address of the rpi) </dd>
- close the object </dd>
- </dd>
- add a CustomBuild object as child to pipoc </dd>
- open the new object, set attributes: </dd>
- ObjectName : build </dd>
- cc : /usr/bin/arm-gcc </dd>
- cxx : /usr/bin/arm-g++ </dd>
- ar : /usr/bin/arm-ar </dd>
- OperatingSystem: Linux on ARM </dd>
- Platform : arm_linux </dd>
- Release : X48arm </dd>
- close the object </dd>
- </dd>
- save changes </dd>
- leave edit mode </dd>
- right-click "VolPipoc", pick Open Volume </dd>
- using "PwR VolPipoc, pwrp on pipoc": </dd>
- enter edit mode </dd>
- </dd>
- in the right pane, delete the Maintenance object </dd>
- in the right pane, delete the OpDefault object </dd>
- in the right pane, delete the WebHandler object </dd>
- in the right pane, delete the WebBrowser object </dd>
- </dd>
- add a XttGraph object as child to Op </dd>
- set ObjectName to Display1 </dd>
- </dd>
- open Op object, set attributes: </dd>
- UserName : pwrp </dd>
- FastAvail[0] : Nodes-Pipoc-Op-Display1 </dd>
- close the object </dd>
- </dd>
- in the center pane, add a $PlantHier object </dd>
- set ObjectName to Bakery </dd>
- </dd>
- add a $PlantHier, child to Bakery </dd>
- set ObjectName to Signals </dd>
- </dd>
- add two Iv objects as children of Signals </dd>
- set ObjectName's to Iin and Iout, respectively </dd>
- </dd>
- add a PlcPgm object as child of Bakery </dd>
- set ObjectName to Plc </dd>
- </dd>
- save changes </dd>
- leave edit mode </dd>
- </dd>
- right-click Bakery-Plc, pick Open Program </dd>
- using "Bakery-Plc" </dd>
- enter edit mode </dd>
- </dd>
- add a GetIv object </dd>
- add a StoIv object </dd>
- </dd>
- connect the GetIv output to the StoIv input </dd>
- </dd>
- from drop-down menu, pick "View | Palette | Plant". Using the right-pane </dd>
- plant hierarchy: </dd>
- Connect (bind) Signals-Iin to GetIv </dd>
- Connect (bind) Signals-Iout to StoIv </dd>
- </dd>
- save changes </dd>
- leave edit mode </dd>
- close the window </dd>
- using "PwR VolPipoc, pwrp on pipoc": </dd>
- right click Nodes-Op-Display1 </dd>
- pick "Open Ge..." </dd>
- using "PwR Ge display1" </dd>
- </dd>
- add two ValueInputMedium objects </dd>
- </dd>
- record the coordinates for the area to display, i.e. the area which contains the two objects </dd>
- from the drop-down menu, pick "File | Graph Attributes" </dd>
- enter the x & y coordinates for this display area </dd>
- close the object </dd>
- </dd>
-