Difference between revisions of "Installation guide: Process and Operator station on the Raspberry Pi"

From Proview Wiki
Jump to: navigation, search
 
Line 1: Line 1:
<p>&nbsp;1) Install Ubuntu 12.10 desktop OS on the development (virtual) machine:<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Host system is Microsoft Windows 7 Ultimate 64 bit, fully patched, 2 socket XeonE5620, 32GB RAM&nbsp; ::VM environment is Oracle VM VirtualBox 4.2.6r82870 with Extension Pack hosted on above <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Boot the iso on the VM <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; English, install ubuntu <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Download updates while installing <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Install this third party software <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Erase disk and install ubuntu <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Chicago <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; English (us), english (us) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Hostname pwrDevel <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Require login pw <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Restart<br /><br />2) Patch the install<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo apt-get update <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo apt-get dist-upgrade <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; restart (for new kernel)<br /><br />3) Install virtualbox tools<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo apt-get install linux-headers-generic dkms build-essential <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; From vbox menu pick: Devices | Install Guest Additions <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Allow autorun prompt to procede, authenticate <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Restart<br /><br /><br />4) Minimize annoyances<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Get rid of advertising and the global menu <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo apt-get remove unity-lens-shopping appmenu-gtk appmenu-gtk3 appmenu-qt <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Launch firefox, disable 'global menu integration' extension <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Logout, log back in<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; turn off spyware<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; launch "System Settings | Privacy" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pick "Search Results," pick "Include online search results: Off" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pick "Diagnostics", uncheck "Send error reports to Canonical", pick "Record Activity: OFF" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo add-apt-repository ppa:tualatrix/ppa <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo add-apt-repository ppa:satyajit-happy/themes <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo add-apt-repository ppa:indicator-multiload/stable-daily <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo apt-get update <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo apt-get install gnome-shell synaptic gconf-editor gnome-tweak-tool ubuntu-tweak nautilus-open-terminal<br /><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; note: accept defaults for gdm<br /><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo apt-get install orion-gtk-theme indicator-multiload compizconfig-settings-manager <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; right click desktop pick "Change Desktop Background", select non-orange and non-purple background <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from Dash, launch "System Load Indicator" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; launch "System Settings | Ubuntu Tweak" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pick "Tweaks | Miscellaneous", pick "Overlay scrollbars: Normal" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pick "Tweaks | Theme", pick "Gtk theme: Orion", "Icon theme: gnome", "Window theme: Radiance" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pick "Tweaks | Desktop Icons", pick "Show Computer", "Show mounted volumes" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pick "Tweaks | Unity", adjust "Launcher icon size" to not waste so much screen space <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pick "Tweaks | Window", pick "Window control button...: Right"<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from Dash, launch "CompizConfig Settings Manager" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; un-check "Snapping Windows" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; delete unneeded icons from launcher: the "bag", the libre office stuff, the "U"s, the advertising <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add "Terminal" to launcher <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo apt-get install geany <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add "Geany" to launcher<br /><br /><br />5) Install prerequisites for 'Proview build from source code'<br /><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install some packages (note: openssh-server is not really a prerequisite) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo apt-get install make flex libgtk2.0-dev libdb5.1-dev libdb5.1++-dev libasound2-dev doxygen libmysql++-dev xfonts-100dpi openssh-server <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install java JDK <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; download tarball from http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cd /usr/local <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo tar -zxvf /home/&lt;userID&gt;/jdk-7u17-linux-x64.tar.gz <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo chown -R root:root jdk1.7.0_17/ <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo -s <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cd /etc/profile.d <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; touch proview.build.sh <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vi proview.build.sh <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; insert the following lines: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; export jdk=/usr/local/jdk1.7.0_17 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; export PATH=$PATH:$jdk/bin <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save edited file, exit vi <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit (from sudo)<br /><br /><br />6) Install Proview development environment &amp; debug runtime<br /><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; wget -Opwr48_4.8.6-3.2_amd64.deb http://sourceforge.net/projects/proview/files/proview/proview_4.8.6-3/ubuntu_12.10/pwr48_4.8.6-3.2_amd64.deb/download <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo dpkg -i pwr48_4.8.6-3.2_amd64.deb <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo adduser pwrp sudo <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; logout <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; login as pwrp <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fix annoyances <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from launcher, pick "System Settings | Brightness and Lock" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pick "Lock: OFF" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cd <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo chown pwrp:pwrp Desktop <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install antlr <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; wget http://www.antlr2.org/download/antlr-2.7.7.tar.gz <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tar -zxvf antlr-2.7.7.tar.gz <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; geany ~/antlr-2.7.7/lib/cpp/antlr/CharScanner.hpp <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add: #include &lt;strings.h&gt;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; include &lt;stdio.h&gt; <br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save changes and exit <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cd ~/antlr-2.7.7 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ./configure <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; make <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo make install <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; change max shared memory <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo geany /etc/sysctl.conf <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; insert a line at the end: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; kernel.shmmax=67108864 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save changes, exit geany <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo -s <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo 67108864 &gt; /proc/sys/kernel/shmmax <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit<br /><br /><br /><br />7)) Install Proview source<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; login as pwrp <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cd <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; wget -Opwrsrc_4.8.6-3.2.tar.gz http://sourceforge.net/projects/proview/files/proview/proview_4.8.6-3/pwrsrc_4.8.6-3.2.tar.gz/download <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tar -zxvf pwrsrc_4.8.6-3.2.tar.gz<br /><br />8) Bake the raspberry pi<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; get the wheezy image 2013-02-09 via torrent <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; write to 8 GB Class 10 SD card <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; boot <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; using the Raspi-config tool: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; expand_rootfs <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; configure_keyboard <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; English (US) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; English (US) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The default for the keyboard layout <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; No compose key <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Control-Alt-Backspace to terminal X server: No <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; change_pass <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; change_locale <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; en_US.UTF-8 UTF-8 only <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; default locale for system environment: none <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; change_timezone: US Central <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ssh: Enable <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; boot_behavior: No <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Finish <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reboot <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; login as pi <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo apt-get update <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo apt-get dist-upgrade <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo apt-get install tightvncserver <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo apt-get install libgtk2.0-dev <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo rm /etc/ssh/ssh_host_* <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo dpkg-reconfigure openssh-server <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo adduser pwrp <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; use password = 'pwrp' (same as Proview distro default) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo adduser pwrp dialout <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (this is for arduino access) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo visudo <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; insert following line under the "root ALL=(ALL) ALL" Line: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pwrp ALL=(ALL) ALL <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save changes, exit <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo nano /etc/security/limits.conf <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; insert the following:<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - rtprio 99 <br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save and exit <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo nano /etc/pam.d/su <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; uncomment line: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; session required pam_limits.so <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save and exit <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (note: this allows the pwr service start to set pwr tasks' realtime priorities) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (note2: also applies to the pwrp tightvncserver X session, since that is launched with su also) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo nano /etc/init.d/tightvncserver <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; insert the following into the new file:<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; !/bin/sh<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /etc/init.d/tightvncserver <br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VNCUSER='pwrp' <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case "$1" in <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; start) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; su $VNCUSER -c '/usr/bin/tightvncserver :0 -geometry 1024x768 -depth 24' <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo "Starting TightVNC Server for $VNCUSER "<br /><br />&nbsp;&nbsp;&nbsp; stop) <br />&nbsp;&nbsp;&nbsp; pkill Xtightvnc <br />&nbsp;&nbsp;&nbsp; echo "TightVNC Server stopped"<br /><br />&nbsp;&nbsp;&nbsp; ) <br /><br />&nbsp;&nbsp;&nbsp; echo "Usage: /etc/init.d/tightvncserver {start|stop}" <br />&nbsp;&nbsp;&nbsp; exit 1<br /><br />&nbsp;&nbsp;&nbsp; esac <br />&nbsp;&nbsp;&nbsp; exit 0 <br />&nbsp;&nbsp;&nbsp; save changes, exit nano <br />&nbsp;&nbsp;&nbsp; sudo chmod 755 /etc/init.d/tightvncserver <br />&nbsp;&nbsp;&nbsp; sudo update-rc.d tightvncserver defaults <br />&nbsp;&nbsp;&nbsp; exit (i.e. logout) <br />&nbsp;&nbsp;&nbsp; login as pwrp <br />&nbsp;&nbsp;&nbsp; mkdir ~/proview <br />&nbsp;&nbsp;&nbsp; vncpasswd <br />&nbsp;&nbsp;&nbsp; enter and confirm <br />&nbsp;&nbsp;&nbsp; no view-only password <br />&nbsp;&nbsp;&nbsp; sudo nano /etc/hostname <br />&nbsp;&nbsp;&nbsp; change to desired node name (e.g. rpi3) <br />&nbsp;&nbsp;&nbsp; save and exit <br />&nbsp;&nbsp;&nbsp; cd <br />&nbsp;&nbsp;&nbsp; ssh-keygen -t rsa <br />&nbsp;&nbsp;&nbsp; cd ~/.ssh <br />&nbsp;&nbsp;&nbsp; touch authorized_keys <br />&nbsp;&nbsp;&nbsp; chmod 600 authorized_keys <br />&nbsp;&nbsp;&nbsp; choose a static IPv4 address <br />&nbsp;&nbsp;&nbsp; sudo nano /etc/hosts <br />&nbsp;&nbsp;&nbsp; update with hostname and ip <br />&nbsp;&nbsp;&nbsp; add any other nodes which will participate in the distributed control system <br />&nbsp;&nbsp;&nbsp; sudo nano /etc/network/interfaces <br />&nbsp;&nbsp;&nbsp; change eth0 to (substitute actual network values): <br />&nbsp;&nbsp;&nbsp; iface eth0 inet static <br />&nbsp;&nbsp;&nbsp; address 192.168.0.1 <br />&nbsp;&nbsp;&nbsp; netmask 255.255.255.0 <br />&nbsp;&nbsp;&nbsp; network 192.168.0.0 <br />&nbsp;&nbsp;&nbsp; broadcast 192.168.0.255 <br />&nbsp;&nbsp;&nbsp; gateway 192.168.0.254 <br />&nbsp;&nbsp;&nbsp; save changes and exit <br />&nbsp;&nbsp;&nbsp; sudo shutdown -r now <br />&nbsp;&nbsp;&nbsp; login to X desktop using vnc client (to verify X is working)<br /><br />9) Configure ssh access from dev to rpi<br /><br />&nbsp;&nbsp;&nbsp; logon to dev as pwrp <br /><br />&nbsp;&nbsp;&nbsp; do this only once: <br />&nbsp;&nbsp;&nbsp; ssh-keygen -t rsa <br />&nbsp;&nbsp;&nbsp; sudo geany /etc/hosts <br />&nbsp;&nbsp;&nbsp; insert line for raspberry pi machine(s) and any other hosts in the distributed system <br />&nbsp;&nbsp;&nbsp; save and exit <br />&nbsp;&nbsp;&nbsp; scp /home/pwrp/.ssh/id_rsa.pub rpi3:/home/pwrp/.ssh/authorized_keys<br /><br />10) Install cross platform dev tools on dev<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; logon to dev as pwrp <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo apt-get install ia32-libs git <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cd <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mkdir rpitools <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cd rpitools <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo git clone git://github.com/raspberrypi/tools.git <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; create symbolic links to compilers and archiver as a workaround on rather long fully qualified names - <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Proview merge tool has a hardcoded alloc of 80 chars max for the FQ name of each of these tools): <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo -s <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ln -s /home/pwrp/rpitools/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc /usr/bin/arm-gcc <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ln -s /home/pwrp/rpitools/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++ /usr/bin/arm-g++ <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ln -s /home/pwrp/rpitools/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-ar /usr/bin/arm-ar <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit<br /><br />11) Get a copy of the rpi headers and libraries to compile and link against, respectively<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; logon to dev as pwrp <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rsync -avz -e ssh pwrp@rpi3:/usr/include /home/pwrp/rpi <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo rsync -avz -e ssh pwrp@rpi3:/usr/lib/arm-linux-gnueabihf /usr/lib <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo rsync -avz -e ssh pwrp@rpi3:/lib/arm-linux-gnueabihf /lib<br /><br />12) Setup the build environment<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; logon to dev as pwrp <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cd <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; geany ~/.envarm <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; insert the following into this new file:<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .envarm:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; env for Proview development for raspberry pi<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; export pwre_cc=/usr/bin/arm-gcc <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; export pwre_cxx=/usr/bin/arm-g++ <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; export pwre_ar=/usr/bin/arm-ar <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; export pwr_host_exe=/usr/pwr48/os_linux/hw_x86_64/exp/exe <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; export pwre_host_exe=/usr/pwr48/os_linux/hw_x86_64/exp/exe <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; export pwre_env_db=/home/pwrp/pwre_env_db <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; export pwre_bin=/home/pwrp/pwrsrc_4.8.6-3/src/tools/pwre/src/os_linux <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; export pwre_dir_symbols=$pwre_bin/dir_symbols.mk <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; export PATH=$PATH:/home/pwrp/rpitools/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; source $pwre_bin/pwre_function <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save and exit <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; geany ~/.bashrc <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; insert at end of file: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; source ~/.envarm <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save and exit <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; close all Terminal(s) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; launch Terminal <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cd <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mkdir pwrrls_4.8.6-3 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; define a PWRE environment for the build: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pwre add v486_arm <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Environment&nbsp; : v486_arm <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Module.........: rt <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Source root....: /home/pwrp/pwrsrc_4.8.6-3/src <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Import root....: /usr/pwr48/os_linux/hw_x86_64 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Build root.....: /home/pwrp/pwrrls_4.8.6-3 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Build type.....: dbg <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- OS.............: linux <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Hardware.......: arm <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Description....: X48arm <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; himBH</p>
+
; '''1) Install Ubuntu 12.10 desktop OS on the development (virtual) machine:'''<br />
<p>13) Fixup Proview config script<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; logon to dev as pwrp <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cd /home/pwrp/pwrsrc_4.8.6-3/src/tools/pwre/src/os_linux <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cp pwre_configure.sh pwre_configure.sh.org <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cd <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; geany /home/pwrp/pwrsrc_4.8.6-3/src/tools/pwre/src/os_linux/pwre_configure.sh <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; insert after line 311: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pwre_config_check_lib gtk GTK gtk gtk 0 "/usr/lib/arm-linux-gnueabihf/libgtk-x11-2.0.so" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pwre_config_check_include gtk GTK 1 "/home/pwrp/rpi/include/gtk-2.0/gtk/gtk.h" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; as a sanity check, the code block should look like: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if test $pwre_hw = = "hw_arm"; then <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pwre_config_check_lib gtk GTK gtk gtk 0 "/usr/lib/arm-linux-gnueabihf/libgtk-x11-2.0.so" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pwre_config_check_include gtk GTK 1 "/home/pwrp/rpi/include/gtk-2.0/gtk/gtk.h" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pwre_config_check_include jni JNI 1 $jdk/include/jni.h <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pwre_config_check_include jni JNI 0 $jdk/include/linux/jni_md.h <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save and exit <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pwre init v486_arm <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pwre configure <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; need to figure out some paths, will use the output from "pwre configure" to help, <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this is a little tedious: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; geany /home/pwrp/pwrrls_4.8.6-3/pwre_arm_linux.cnf <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; find line "export pwre_conf_libgtk=" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; note the embedded command, e.g. "pkg-config --libs gtk+-2.0", designate as "cmd1" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; find line "export pwre_conf_incdirgtk=" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; note the embedded command, e.g. "pkg-config --cflags gtk+-2.0", designate as "cmd2". the commands will now be run on the rpi: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ssh rpi3 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; execute cmd1: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pkg-config --libs gtk+-2.0 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save the output in a new temp file, e.g. in geany <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; execute cmd2: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pkg-config --cflags gtk+-2.0 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save the output to the temp file <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit from ssh session <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in the temp file, replace "usr/include" with "home/pwrp/rpi/include" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in geany, open /home/pwrp/pwrsrc_4.8.6-3/src/tools/pwre/src/os_linux/pwre_configure.sh <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; find line "export pwre_conf_libgtk=" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hard-code the contents of that assign to the output of cmd1, e.g.: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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\"" &gt;&gt; $cfile <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; find line "export pwre_conf_incdirgtk=" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hard-code the contents of that assign to the edited output of cmd2, e.g.: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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 \"" &gt;&gt; $cfile <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; find line "echo "export pwre_conf_lib=\"-lpthread -lm -lrt -lcrypt\"" &gt;&gt; $cfile" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add X11 and db5.1 libraries, e.g.: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo "export pwre_conf_lib=\"-lpthread -lm -lrt -lcrypt -lX11 -ldb-5.1\"" &gt;&gt; $cfile <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; find line "echo "export pwre_conf_libdir=\"$conf_libdir\"" &gt;&gt; $cfile" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hard-code the assignment to: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo "export pwre_conf_libdir=\"-L/usr/lib/arm-linux-gnueabihf -Wl,-rpath=/usr/lib/arm-linux-gnueabihf -Wl,-rpath=/lib/arm-linux-gnueabihf\"" &gt;&gt; $cfile <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; find line "echo "export pwre_conf_incdir=\"$conf_incdir\"" &gt;&gt; $cfile" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hard-code the assignment to: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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\"" &gt;&gt; $cfile <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save the edited file <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cd <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mkdir pwrCustom <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save the edited file (again) as ~/pwrCustom/pwre_configure.sh.custom <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit geany<br /><br />14) Fixup Proview source tree<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fix service start script: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cp /home/pwrp/pwrsrc_4.8.6-3/src/tools/pkg/deb_armel/pwrrt/pwr ~/pwrCustom <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; geany ~/pwrCustom/pwr <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for each of the functions: pwr_start, pwr_stop, pwr_reload, pwr_kill: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; replace the "whoami" conditional test from "root" to "pwrp" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if using an arduino uno, add the following line within the create_wrapper function, after the umask command: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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" &gt;&gt; $wrapper <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save and exit <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fix code error: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; geany /home/pwrp/pwrsrc_4.8.6-3/sev/lib/sev/src/sev_db.cpp <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add open curly brace on line 52: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else if ( type = = sev_eDbType_Sqlite) { <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add close curly brace after line 58. <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; code block should now look like: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( type = = sev_eDbType_Mysql) {<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if defined PWRE_CONF_MYSQL <br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return sev_dbms::open_database();<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else <br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf( "** Release is not built with mysql\n"); <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 0;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; endif <br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else if ( type = = sev_eDbType_Sqlite) {<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if defined PWRE_CONF_SQLITE3 <br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return sev_dbsqlite::open_database();<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else <br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf( "** Release is not built with sqlite3\n"); <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 0;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; endif <br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 0; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end example code block <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save the edited file as: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ~/pwrCustom/sev_db.cpp <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit geany <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; edit the build package script, it will not create a *.deb file as-is: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; geany ~/pwrsrc_4.8.6-3/src/tools/pkg/deb_armel/pwrrt/build.sh <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "# Create directories" section, insert line: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mkdir -p $pkgroot/usr/pwrp/adm/db <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; uncomment lines which copy op to cnf <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; uncomment lines which copy user to cnf <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add following lines to "# Copy user to cnf" section: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cp $pwre_broot/$pwre_target/exp/inc/pwr_arduino_uno.ino $pkgroot/usr/pwrrt/cnf/user <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cp $pwre_sroot/tools/pkg/deb/adm/proview_icon.png $pkgroot/usr/pwrrt/cnf/user <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cp /home/pwrp/pwrCustom/Proview.desktop $pkgroot/usr/pwrrt/cnf/user <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; after the "# Copy user to cnf" section, insert the following lines:<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Copy user security data <br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mkdir -p $pkgroot/usr/pwrp/adm/db <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cp $pwre_sroot/tools/pkg/deb/adm/pwr_user2.dat $pkgroot/usr/pwrp/adm/db <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; comment out line "dpkg-buildpackage -aarmel -b" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add following lines: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; packagename=pwrrt-$version.tar.gz <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tar -czf ../$packagename * <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save the edited file as: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ~/pwrCustom/build.sh <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit geany <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; geany ~/pwrCustom/fixPwrSource.sh <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; insert the following lines into the new file:<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; !/bin/bash<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fix some missing dependencies<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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/ <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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/ <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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/ <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cp /usr/include/db.h /home/pwrp/pwrsrc_4.8.6-3/src/exe/rt_elog_dump/src <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cp /usr/include/db.h /home/pwrp/pwrsrc_4.8.6-3/xtt/lib/xtt/src <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cp /usr/include/db.h /home/pwrp/pwrsrc_4.8.6-3/xtt/lib/xtt/gtk <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mkdir /home/pwrp/pwrsrc_4.8.6-3/wb/lib/wb/src/antlr <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cp /home/pwrp/antlr-2.7.7/lib/cpp/antlr/* /home/pwrp/pwrsrc_4.8.6-3/wb/lib/wb/src/antlr <br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fix code error<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cp ~/pwrCustom/sev_db.cpp /home/pwrp/pwrsrc_4.8.6-3/sev/lib/sev/src/sev_db.cpp <br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; copy build script which creates just a tarball, not a debian package, and includes some custom rpi/arduino specific stuff<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cp ~/pwrCustom/build.sh /home/pwrp/pwrsrc_4.8.6-3/src/tools/pkg/deb_armel/pwrrt <br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; copy custom pwre_configure.sh<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cp /home/pwrp/pwrCustom/pwre_configure.sh.custom /home/pwrp/pwrsrc_4.8.6-3/src/tools/pwre/src/os_linux/pwre_configure.sh <br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; copy custom pwr service control script<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cp ~/pwrCustom/pwr /home/pwrp/pwrsrc_4.8.6-3/src/tools/pkg/deb_armel/pwrrt/ <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save and exit <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; chmod 755 ~/pwrCustom/fixPwrSource.sh <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; geany ~/pwrCustom/Proview.desktop <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; insert the following lines into the new file: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Desktop Entry] <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Name=Proview <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Comment=SCADA Operator Station <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Exec=/home/pwrp/.xtt_start <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Icon=proview_icon <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Terminal=false <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Type=Application <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MimeType=text/plain <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Categories=GTK <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save and exit</p>
+
 
<p>15) Final cleanup<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; logon to dev as pwrp <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; delete /home/pwrp/pwrsrc_4.8.6-3 (and all contents) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; delete everything from /home/pwrp/pwrrls_4.8.6-3, leaving the folder <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unpack the source (again): <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cd <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tar -zxvf pwrsrc_4.8.6-3.2.tar.gz<br /><br />16) Build Proview for raspberry pi<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; logon to dev as pwrp <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cd <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pwre list <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pwre init v486_arm <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ./pwrCustom/fixPwrSource.sh <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pwre create_all_modules <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pwre import rt <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pwre import java <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pwre import op <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pwre configure <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ./pwrCustom/fixPwrSource.sh <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pwre ebuild rt <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pwre ebuild op <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pwre build tools/pkg deb_armel <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; note: to enable pkg rebuild (when make says nothing to do): <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; touch /home/pwrp/pwrsrc_4.8.6-3/src/tools/pkg/deb_armel/pwrrt/control<br /><br /><br />17) Install Proview runtime and op station on Raspberry Pi<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; logon to dev as pwrp <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; geany ~/pwrCustom/installRpi.sh <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; insert the following lines into the new file:<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; !/bin/bash<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install Proview package on Raspberry Pi<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unpack the tarball<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cd /home/pwrp/proview <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tar -zxvf pwrrt-.tar.gz <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; chown -R pwrp:pwrp /home/pwrp/proview<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; configure target dirs, install the archive<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -d -o pwrp -g pwrp /usr/pwrrt <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -d -o pwrp -g pwrp /usr/pwrrt/cnf <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -d -o pwrp -g pwrp /usr/pwrrt/cnf/op <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -d -o pwrp -g pwrp /usr/pwrrt/cnf/user <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -d -o pwrp -g pwrp /usr/pwrrt/exe <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -d -o pwrp -g pwrp /usr/pwrrt/lib <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -d -o pwrp -g pwrp /usr/pwrrt/load <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -d -o pwrp -g pwrp /pwrp <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -d -o pwrp -g pwrp /pwrp/arm_linux <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -d -o pwrp -g pwrp /pwrp/arm_linux/exe <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -d -o pwrp -g pwrp /pwrp/arm_linux/lib <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -d -o pwrp -g pwrp /pwrp/arm_linux/lis <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -d -o pwrp -g pwrp /pwrp/arm_linux/obj <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -d -o pwrp -g pwrp /pwrp/common <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -d -o pwrp -g pwrp /pwrp/common/db <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -d -o pwrp -g pwrp /pwrp/common/inc <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -d -o pwrp -g pwrp /pwrp/common/load <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -d -o pwrp -g pwrp /pwrp/common/log <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -d -o pwrp -g pwrp /pwrp/common/loghist <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -d -o pwrp -g pwrp /pwrp/common/web <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -d /usr/pwrp <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -d -o pwrp -g pwrp /usr/pwrp/adm <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -d -o pwrp -g pwrp /usr/pwrp/adm/db <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -d /usr/share/doc/pwrrt <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -D /home/pwrp/proview/etc/* /etc <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -D /home/pwrp/proview/etc/init.d/* /etc/init.d <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -D -m 644 /home/pwrp/proview/usr/pwrrt/cnf/proview.cnf /etc <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -D -o pwrp -g pwrp /home/pwrp/proview/usr/pwrrt/* /usr/pwrrt <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -D -o pwrp -g pwrp /home/pwrp/proview/usr/pwrrt/cnf/* /usr/pwrrt/cnf <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -D -o pwrp -g pwrp /home/pwrp/proview/usr/pwrrt/exe/* /usr/pwrrt/exe <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -D -o pwrp -g pwrp /home/pwrp/proview/usr/pwrrt/lib/* /usr/pwrrt/lib <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -D -o pwrp -g pwrp /home/pwrp/proview/usr/pwrrt/load/* /usr/pwrrt/load <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -D -o pwrp -g pwrp /home/pwrp/proview/usr/pwrrt/cnf/op/.??* /usr/pwrrt/cnf/op <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -D -o pwrp -g pwrp /home/pwrp/proview/usr/pwrrt/cnf/user/.??* /usr/pwrrt/cnf/user <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -D -o pwrp -g pwrp /home/pwrp/proview/usr/pwrp/adm/db/* /usr/pwrp/adm/db <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -D -m 644 /home/pwrp/proview/usr/share/doc/pwrrt/* /usr/share/doc/pwrrt <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -D -m 644 /home/pwrp/proview/usr/share/man/man1/* /usr/share/man/man1 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -D -o pwrp -g pwrp -m 775 /home/pwrp/proview/usr/pwrrt/cnf/user/.??* /home/pwrp <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -D -o pwrp -g pwrp -m 775 /home/pwrp/proview/usr/pwrrt/cnf/user/* /home/pwrp <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -D -m 644 /home/pwrp/proview/usr/pwrrt/cnf/user/proview_icon.png /usr/share/pixmaps <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -D -o pwrp -g pwrp -m 644 /home/pwrp/proview/usr/pwrrt/cnf/user/Proview.desktop /home/pwrp/Desktop <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if [ -f /home/pwrp/pwr_arduino_uno.ino ] <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; then <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -d -o pwrp -g pwrp /home/pwrp/sketchbook <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install -d -o pwrp -g pwrp /home/pwrp/sketchbook/pwr_arduino_uno <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mv /home/pwrp/pwr_arduino_uno.ino /home/pwrp/sketchbook/pwr_arduino_uno <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; chown pwrp:pwrp /home/pwrp/sketchbook/pwr_arduino_uno/pwr_arduino_uno.ino <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fi <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save and exit <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; scp /home/pwrp/pwrrls_4.8.6-3/os_linux/hw_arm/bld/pkg/pwrrt-.tar.gz pwrp@rpi3:~/proview <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; scp /home/pwrp/pwrCustom/installRpi.sh pwrp@rpi3:~/ <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ssh rpi3 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cd <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; chmod 775 installRpi.sh <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo ./installRpi.sh <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo update-rc.d pwr defaults <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit (from ssh session) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 18) create proof-of-concept Proview project <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; logon to dev as pwrp <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; one-time fix so plc prog will build: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mkdir /home/pwrp/pwrrls_4.8.6-3/os_linux/hw_x86_64 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mkdir /home/pwrp/pwrrls_4.8.6-3/os_linux/hw_x86_64/exp <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mkdir /home/pwrp/pwrrls_4.8.6-3/os_linux/hw_x86_64/exp/exe <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end one time fix <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; on the desktop, double-click Proview V4.8 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; accept (and respect) the license terms <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; using "PwR Project List": <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; enter edit mode <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add a BaseReg object, child to Bases <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; open the new object, set attributes: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ObjectName: BaseV48arm <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Version&nbsp; : X48arm <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Path&nbsp; : /home/pwrp/pwrrls_4.8.6-3 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; close the object <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save changes <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; note: the new base define is reflected as a new line in /usr/pwrp/adm/db/pwr_projectlist.dat <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the binding to the release build's path is via the "X48arm" token, which will be used below <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add a $Hier object, sibling to Bases <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set ObjectName attribute = "testProjects" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add a ProjectReg object, child of testProjects <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; open new object, set attributes: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ObjectName : piPOC <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Description: Raspberry Pi Proof of Concept <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Version&nbsp; : X48arm <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (note: Version attr binds the project to the BaseV48arm) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; close the object <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save changes <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Confirm Actions: Yes <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; note: the new project is reflected as a new directory tree at /usr/local/pwrp/pipoc <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; leave edit mode <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; right-click piPOC, pick Open Project <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; using "Configure Directory Volume": <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; enter "Production QBUS id" = 5 (this is arbitrary, but better than using defaults, for troubleshooting) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; click Next <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; click Next <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; click No <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; click Next <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; click Next <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; click Skip this node <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; click Next <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; click Yes <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; using "Configure Root Volume": <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pick Operator Station <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; click Next <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; click Next <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; click Next <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; using "PwR VolPipoc, pwrp on pipoc": <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from the drop-down menu, pick "File | Volume Attributes..." <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; change the "OperatingSystem" attribute to "CustomBuild" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; close the object <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save changes <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; close the window <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; using "PwR Directory, pwrp on pipoc": <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; enter edit mode <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; open pipoc object, set attributes: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NodeName&nbsp; : rpi3 (i.e. the hostname of the target rpi) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OperatingSystem: CustomBuild <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BootNode:&nbsp; : rpi3 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Address&nbsp; : 192.168.0.1 (i.e. the IPv4 address of the rpi) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; close the object <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add a CustomBuild object as child to pipoc <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; open the new object, set attributes: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ObjectName&nbsp; : build <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cc&nbsp; : /usr/bin/arm-gcc <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cxx&nbsp; : /usr/bin/arm-g++ <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ar&nbsp; : /usr/bin/arm-ar <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OperatingSystem: Linux on ARM <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Platform&nbsp; : arm_linux <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Release&nbsp; : X48arm <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; close the object <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save changes <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; leave edit mode <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; right-click "VolPipoc", pick Open Volume <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; using "PwR VolPipoc, pwrp on pipoc": <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; enter edit mode <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in the right pane, delete the Maintenance object <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in the right pane, delete the OpDefault object <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in the right pane, delete the WebHandler object <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in the right pane, delete the WebBrowser object <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add a XttGraph object as child to Op <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set ObjectName to Display1 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; open Op object, set attributes: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UserName&nbsp; : pwrp <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FastAvail[0]&nbsp; : Nodes-Pipoc-Op-Display1 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; close the object <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in the center pane, add a $PlantHier object <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set ObjectName to Bakery <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add a $PlantHier, child to Bakery <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set ObjectName to Signals <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add two Iv objects as children of Signals <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set ObjectName's to Iin and Iout, respectively <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add a PlcPgm object as child of Bakery <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set ObjectName to Plc <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save changes <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; leave edit mode <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; right-click Bakery-Plc, pick Open Program <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; using "Bakery-Plc" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; enter edit mode <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add a GetIv object <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add a StoIv object <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; connect the GetIv output to the StoIv input <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from drop-down menu, pick "View | Palette | Plant". Using the right-pane <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; plant hierarchy: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Connect (bind) Signals-Iin to GetIv <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Connect (bind) Signals-Iout to StoIv <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save changes <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; leave edit mode <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; close the window <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; using "PwR VolPipoc, pwrp on pipoc": <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; right click Nodes-Op-Display1 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pick "Open Ge..." <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; using "PwR Ge display1" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add two ValueInputMedium objects <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; record the coordinates for the area to display, i.e. the area which contains the two objects <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from the drop-down menu, pick "File | Graph Attributes" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; enter the x &amp; y coordinates for this display area <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; close the object <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; double-click one of the ValueInputMedium objects, set attribute: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Value.Format&nbsp; : %6d <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; close object <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; repeat for the other Input object <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; View "Plant Hierarchy", select Bakery-Signals-Iin <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; press Ctrl key, double-click on first ValInpMed object (binds signal to object) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; repeat, bind Iout to other display object <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pick "File | Save" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; close the window <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; using "PwR VolPipoc, pwrp on pipoc": <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from drop-down menu, pick "Functions | Build Node" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; example output as shown in "Proview Development Console": <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Setting base /usr/pwr48 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Open pipoc <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; args: pipoc pwrp pwrp <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Welcome to <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pipoc V4.8 Raspberry Pi Proof of Concept <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Revision history <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2013-03-09 pwrp Project created <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Processing line: 50 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Building volume directory <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Opening volume 'VolPipoc' <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Berkeley DB 5.1.29: (October 25, 2011) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; info get: 0 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Build node pipoc <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Plc window generated Bakery-Plc-W <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /home/pwrp/pwrrls_4.8.6-3 is baseroot <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Setting base /home/pwrp/pwrrls_4.8.6-3 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Cross compilation ARM_LINUX <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Plc window compiled for arm_linux optimized -O3 Bakery-Plc-W <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /home/pwrp/pwrrls_4.8.6-3 is baseroot <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Setting base /home/pwrp/pwrrls_4.8.6-3 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Cross compilation ARM_LINUX <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Plc plcpgm compiled for arm_linux optimized -O3 Bakery-Plc <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Web startpage generated $pwrp_web/index.html <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /home/pwrp/pwrrls_4.8.6-3 is baseroot <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Setting base /home/pwrp/pwrrls_4.8.6-3 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Cross compilation ARM_LINUX <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Building archive for volume: 000_001_001_001 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Archive built for volume: 000_001_001_001 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Working with load file volume 'VolPipoc'... <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Open file... <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Successfully created load file for volume 'VolPipoc' <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- 26 objects with a total body size of 26392 bytes were written to new file. <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Creating bootfile for node rpi3 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Plc thread generated priority 22, scantime 0.10000 s, 1 plcpgm's <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /home/pwrp/pwrrls_4.8.6-3 is baseroot <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Setting base /home/pwrp/pwrrls_4.8.6-3 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Cross compilation ARM_LINUX <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Plc process compiled for arm_linux optimized -O3 Dummy <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /home/pwrp/pwrrls_4.8.6-3 is baseroot <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Setting base /home/pwrp/pwrrls_4.8.6-3 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Cross compilation ARM_LINUX <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Plc program linked for arm_linux node plc_rpi3_0005_plc <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Build node pipoc <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end example output <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from drop-down menu, pick "Functions | Distribute" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; using "Distributor": <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; select rpi3 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from the drop-down menu, pick "Functions | Distribute" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; example output in "Proview Development Console": <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pwrp_pkg_rpi3_0001.tgz 100% 1705KB 1.7MB/s 00:00 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- No package installed <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Installing package pwrp_pkg_rpi3_0001.tgz <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Unpack package pwrp_pkg_rpi3_0001.tgz <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Move files to target directories <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo: no tty present and no askpass program specified <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end example output <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; there will be some warnings in Workbench Messages re missing files, ignore these <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit from the Proview development environment (close all windows in reverse order of opening them) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 19) run the test project <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; connect to rpi3 via vnc client <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nano ~/.xtt_start <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; edit the rt_xtt invoke to launch the operator station: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $pwr_exe/rt_xtt Nodes-Pipoc-Op &amp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save changes and exit <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo nano /etc/proview.cnf <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; edit the qcomBusId to 5 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save changes and exit <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo shutdown -r now <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (so the pwr service will pick up the new bus ID) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; connect to rpi3 via vnc client <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; start the op station: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; double-click the Proview desktop icon <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; launch Display1 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; verify manually entering a value in Iin is copied to Iout <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; verify manually entering a value in Iout is overwritten by value in Iin <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; verify status is green <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; note: to reset runtime from an abend: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; source pwr_stop.sh <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --------------------------------------------------------------------------------------------------- <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OK, proof of concept works, let's have another pi do some I/O <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; after all, what good is a SCADA system without I/O? <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---------------------------------------------------------------------------------------------------<br /><br />20) Build another rpi (nobody can have just one!), hostname rpi2<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install base OS (item 8 above) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; config new pi for ssh (item 9 above) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install Proview (item 17 above) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo nano /etc/proview.cnf <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; edit the qcomBusId to 5 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save changes and exit <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 21) configure rpi2 for arduino <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; login to rpi2 as pwrp <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; connect the arduino device <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo apt-get install arduino <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; launch arduino <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pick "Tools | Board | Arduino Uno" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pick "Tools | Serial Port | /dev/ttyACM0" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pick "File | Sketchbook | pwr_arduino_uno" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in sketch, verify debug assignment is 0 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; verify baudRate is 19200 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; upload sketch to the arduino <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; note: due to the bizarre handling of serial in Linux (i.e. raw, cooked, much interference by software layers, etc.), <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the following config is needed prior to starting the pwr runtime: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; stty -F /dev/sttyACM0 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 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this config is included in the "pwr" service start script as per edits in sections above. <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (as a side note, if the Uno is connected to a virtual machine via VirtualBox, if you bind the Uno device from the (Windows) host <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; to the VM using USB and not COM, then things seem to work in Proview debug runtime. Again, the stty config needs to be run prior to runtime start.)<br /><br />22) Update Proview project<br /><br />&nbsp;&nbsp;&nbsp; logon to dev as pwrp <br /><br />&nbsp;&nbsp;&nbsp; launch Proview <br />&nbsp;&nbsp;&nbsp; using "PwR Project List" <br />&nbsp;&nbsp;&nbsp; from the menu, pick "File | Open | GlobalVolumeList" <br />&nbsp;&nbsp;&nbsp; using "PwR Global Volume List" <br />&nbsp;&nbsp;&nbsp; enter edit mode <br />&nbsp;&nbsp;&nbsp; add a VolumeReg object as sibling of VolPipoc <br />&nbsp;&nbsp;&nbsp; open object, set attributes: <br />&nbsp;&nbsp;&nbsp; ObjectName&nbsp; : VolPipoc2 <br />&nbsp;&nbsp;&nbsp; Description&nbsp; : 0.1.1.2 pipoc <br />&nbsp;&nbsp;&nbsp; VolumeId&nbsp; : _V0.1.1.2 <br />&nbsp;&nbsp;&nbsp; Project&nbsp; : pipoc <br />&nbsp;&nbsp;&nbsp; close the object <br />&nbsp;&nbsp;&nbsp; save changes <br />&nbsp;&nbsp;&nbsp; leave edit mode <br />&nbsp;&nbsp;&nbsp; close the window <br />&nbsp;&nbsp;&nbsp; using "PwR Project List" <br />&nbsp;&nbsp;&nbsp; open PiPOC project <br />&nbsp;&nbsp;&nbsp; enter edit mode<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add a RootVolumeConfig object as sibling of VolPipoc <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; open object, set attribute: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ObjectName&nbsp; : VolPipoc2 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; close the object<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add a NodeConfig object as sibling to pipoc <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; open object, set attributes: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ObjectName&nbsp; : pipoc2 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NodeName&nbsp; : rpi2 (i.e. the hostname of the target rpi) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OperatingSystem: CustomBuild <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BootNode:&nbsp; : rpi2 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Address&nbsp; : 192.168.0.2 (i.e. the IPv4 address of the rpi) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; close the object<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add a CustomBuild as child to pipoc2 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; open object, set attributes: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ObjectName&nbsp; : build <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cc&nbsp; : /usr/bin/arm-gcc <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cxx&nbsp; : /usr/bin/arm-g++ <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ar&nbsp; : /usr/bin/arm-ar <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OperatingSystem: Linux on ARM <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Platform&nbsp; : arm_linux <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Release&nbsp; : X48arm <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; close the object <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; open pipoc2's RootVolumeLoad object, set attribute: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ObjectName&nbsp; : VolPipoc2 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; close the object<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save changes <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; click Yes to "Do you want to create this Volume?" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; leave edit mode<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; right click VolPipoc2, pick OpenVolume <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; using "Configure Root Volume" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pick "Operator Station" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; click Next <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; click Next <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; click Next <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; using "PwR VolPipoc2, pwrp on pipoc" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; enter edit mode <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from the drop-down menu, pick "File | Volume Attributes..." <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; change the "OperatingSystem" attribute to "CustomBuild" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; close the object <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in the right pane, delete the Maintenance object <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in the right pane, delete the OpDefault object <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in the right pane, delete the WebHandler object <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in the right pane, delete the WebBrowser object<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add a XttGraph object as child to Op <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set ObjectName to Display2<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; open Op object, set attributes: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UserName&nbsp; : pwrp <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AutoStart[0]&nbsp; : Nodes-Pipoc2-Op-Display2 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FastAvail[0]&nbsp; : Nodes-Pipoc2-Op-Display2 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; close the object <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add a Arduino_USB object as child of Pipoc2 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; open object, set attributes: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ObjectName&nbsp; : Arduino <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; close object <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add a Arduino_Uno object as child of Arduino <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; open object, set attributes: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ObjectName&nbsp; : Uno1 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Device&nbsp; : /dev/ttyACM0 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BaudRate&nbsp; : 19200 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; close object <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add a ChanAi object as child of Uno1 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; open object, set attributes: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ObjectName&nbsp; : Ai0 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Number&nbsp; : 0 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RawValRangeLow&nbsp; : 0 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RawValRangeHigh&nbsp; : 1023 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ChannelSigValRangeLow&nbsp; : 0 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ChannelSigValRangeHigh : 5 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SensorSigValRangeLow&nbsp; : 0 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SensorSigValRangeHigh&nbsp; : 5 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ActValRangeLow&nbsp; : 0 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ActValRangeHigh&nbsp; : 1023 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; close object <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add a ChanDo object as child of Uno1 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; open object, set attributes: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ObjectName&nbsp; : Do2 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Number&nbsp; : 2 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; close object <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add a ChanDi object as child of Uno1 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; open object, set attributes: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ObjectName&nbsp; : Di4 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Number&nbsp; : 4 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; close object <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in the center pane, add a $PlantHier object <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set ObjectName to Bakery2 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add a $PlantHier object, child to Bakery2 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set ObjectName to Signals <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add an Ai object as child of Signals <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; open object, set attributes: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ObjectName&nbsp; : Ai0 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SigChanCon&nbsp; : Nodes-Pipoc2-Arduino-Uno1-Ai0 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; close object <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add a Di object as child of Signals <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; open object, set attributes: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ObjectName&nbsp; : Di4 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SigChanCon&nbsp; : Nodes-Pipoc2-Arduino-Uno1-Di4 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; close object <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add a Do object as child of Signals <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; open object, set attributes: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ObjectName&nbsp; : Do2 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SigChanCon&nbsp; : Nodes-Pipoc2-Arduino-Uno1-Do2 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; close object <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add a PlcPgm object as child of Bakery2 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set ObjectName to Plc2 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save changes <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; leave edit mode <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; right-click Bakery2-Plc, pick Open Program <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; using "Bakery2-Plc2" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; enter edit mode <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save changes (there are none - but we need the sub-window to exist) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; leave edit mode <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; close the window <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; using "PwR VolPipoc, pwrp on pipoc": <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; right click Nodes-Op-Display2 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pick "Open Ge..." <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; using "PwR Ge display2" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add one ValueInputMedium object <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add two ValueMedium objects <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; note the coordinates for the area to display <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from the drop-down menu, pick "File | Graph Attributes" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; enter the x &amp; y coordinates for display area noted above <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; close the object <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; double-click the ValueInputMedium object, set attribute: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Value.Format&nbsp; : %6d <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; close object <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; repeat for the first ValueMedium object <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; repeat with %6.2f for other ValueMedium object <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; View Plant Hierarchy, select Bakery2-Signals-Do2 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; press Ctrl key, double-click on ValueInputMedium object <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; note: this connects the display object to the target plant signal<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; repeat, connect Di4 to ValMed, connect Ai0 to other ValMed<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pick "File | Save" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; close the window <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; using "PwR VolPipoc2, pwrp on pipoc": <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from drop-down menu, pick "Functions | Build Node" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from drop-down menu, pick "Functions | Distribute" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; using "Distributor": <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; select rpi2 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from the drop-down menu, pick "Functions | Distribute" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit from the Proview development environment (close all windows)<br /><br />23) use the Arduino<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; connect to rpi2 via VNC X window <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; restart the runtime: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sudo service pwr restart <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hint: if problems, then to get some diagnostics: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cd <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; source pwr_stop.sh <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rt_ini -i &amp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ps -ef | grep rt <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; edit ~./.xtt_start to launch the operator station windows:<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; !/bin/bash <br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; source /etc/pwrp_profile <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $pwr_exe/rt_xtt Nodes-Pipoc2-Op &amp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save changes and exit <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; double-click the Proview desktop icon <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in Display2, the analog in value will vary slightly due to noise (unless you have connected a pot or some signal to it) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; experiment with the Di and Do values <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; finish</p>
+
::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
<div id="_mcePaste" class="mcePaste" style="position: absolute; left: -10000px; top: 4332px; width: 1px; height: 1px; overflow: hidden;">13) Fixup Proview config script<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; logon to dev as pwrp <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cd /home/pwrp/pwrsrc_4.8.6-3/src/tools/pwre/src/os_linux <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cp pwre_configure.sh pwre_configure.sh.org <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cd <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; geany /home/pwrp/pwrsrc_4.8.6-3/src/tools/pwre/src/os_linux/pwre_configure.sh <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; insert after line 311: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pwre_config_check_lib gtk GTK gtk gtk 0 "/usr/lib/arm-linux-gnueabihf/libgtk-x11-2.0.so" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pwre_config_check_include gtk GTK 1 "/home/pwrp/rpi/include/gtk-2.0/gtk/gtk.h" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; as a sanity check, the code block should look like: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if test $pwre_hw = = "hw_arm"; then <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pwre_config_check_lib gtk GTK gtk gtk 0 "/usr/lib/arm-linux-gnueabihf/libgtk-x11-2.0.so" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pwre_config_check_include gtk GTK 1 "/home/pwrp/rpi/include/gtk-2.0/gtk/gtk.h" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pwre_config_check_include jni JNI 1 $jdk/include/jni.h <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pwre_config_check_include jni JNI 0 $jdk/include/linux/jni_md.h <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save and exit <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pwre init v486_arm <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pwre configure <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; need to figure out some paths, will use the output from "pwre configure" to help, <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this is a little tedious: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; geany /home/pwrp/pwrrls_4.8.6-3/pwre_arm_linux.cnf <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; find line "export pwre_conf_libgtk=" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; note the embedded command, e.g. "pkg-config --libs gtk+-2.0", designate as "cmd1" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; find line "export pwre_conf_incdirgtk=" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; note the embedded command, e.g. "pkg-config --cflags gtk+-2.0", designate as "cmd2". the commands will now be run on the rpi: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ssh rpi3 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; execute cmd1: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pkg-config --libs gtk+-2.0 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save the output in a new temp file, e.g. in geany <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; execute cmd2: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pkg-config --cflags gtk+-2.0 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save the output to the temp file <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit from ssh session <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in the temp file, replace "usr/include" with "home/pwrp/rpi/include" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in geany, open /home/pwrp/pwrsrc_4.8.6-3/src/tools/pwre/src/os_linux/pwre_configure.sh <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; find line "export pwre_conf_libgtk=" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hard-code the contents of that assign to the output of cmd1, e.g.: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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\"" &gt;&gt; $cfile <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; find line "export pwre_conf_incdirgtk=" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hard-code the contents of that assign to the edited output of cmd2, e.g.: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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 \"" &gt;&gt; $cfile <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; find line "echo "export pwre_conf_lib=\"-lpthread -lm -lrt -lcrypt\"" &gt;&gt; $cfile" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add X11 and db5.1 libraries, e.g.: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo "export pwre_conf_lib=\"-lpthread -lm -lrt -lcrypt -lX11 -ldb-5.1\"" &gt;&gt; $cfile <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; find line "echo "export pwre_conf_libdir=\"$conf_libdir\"" &gt;&gt; $cfile" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hard-code the assignment to: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo "export pwre_conf_libdir=\"-L/usr/lib/arm-linux-gnueabihf -Wl,-rpath=/usr/lib/arm-linux-gnueabihf -Wl,-rpath=/lib/arm-linux-gnueabihf\"" &gt;&gt; $cfile <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; find line "echo "export pwre_conf_incdir=\"$conf_incdir\"" &gt;&gt; $cfile" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hard-code the assignment to: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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\"" &gt;&gt; $cfile <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save the edited file <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cd <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mkdir pwrCustom <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save the edited file (again) as ~/pwrCustom/pwre_configure.sh.custom <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit geany<br /><br />14) Fixup Proview source tree<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fix service start script: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cp /home/pwrp/pwrsrc_4.8.6-3/src/tools/pkg/deb_armel/pwrrt/pwr ~/pwrCustom <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; geany ~/pwrCustom/pwr <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for each of the functions: pwr_start, pwr_stop, pwr_reload, pwr_kill: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; replace the "whoami" conditional test from "root" to "pwrp" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if using an arduino uno, add the following line within the create_wrapper function, after the umask command: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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" &gt;&gt; $wrapper <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save and exit <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fix code error: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; geany /home/pwrp/pwrsrc_4.8.6-3/sev/lib/sev/src/sev_db.cpp <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add open curly brace on line 52: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else if ( type = = sev_eDbType_Sqlite) { <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add close curly brace after line 58. <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; code block should now look like: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( type = = sev_eDbType_Mysql) {<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if defined PWRE_CONF_MYSQL <br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return sev_dbms::open_database();<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else <br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf( "** Release is not built with mysql\n"); <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 0;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; endif <br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else if ( type = = sev_eDbType_Sqlite) {<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if defined PWRE_CONF_SQLITE3 <br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return sev_dbsqlite::open_database();<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else <br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf( "** Release is not built with sqlite3\n"); <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 0;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; endif <br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 0; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end example code block <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save the edited file as: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ~/pwrCustom/sev_db.cpp <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit geany <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; edit the build package script, it will not create a *.deb file as-is: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; geany ~/pwrsrc_4.8.6-3/src/tools/pkg/deb_armel/pwrrt/build.sh <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "# Create directories" section, insert line: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mkdir -p $pkgroot/usr/pwrp/adm/db <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; uncomment lines which copy op to cnf <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; uncomment lines which copy user to cnf <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add following lines to "# Copy user to cnf" section: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cp $pwre_broot/$pwre_target/exp/inc/pwr_arduino_uno.ino $pkgroot/usr/pwrrt/cnf/user <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cp $pwre_sroot/tools/pkg/deb/adm/proview_icon.png $pkgroot/usr/pwrrt/cnf/user <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cp /home/pwrp/pwrCustom/Proview.desktop $pkgroot/usr/pwrrt/cnf/user <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; after the "# Copy user to cnf" section, insert the following lines:<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Copy user security data <br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mkdir -p $pkgroot/usr/pwrp/adm/db <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cp $pwre_sroot/tools/pkg/deb/adm/pwr_user2.dat $pkgroot/usr/pwrp/adm/db <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; comment out line "dpkg-buildpackage -aarmel -b" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add following lines: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; packagename=pwrrt-$version.tar.gz <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tar -czf ../$packagename * <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save the edited file as: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ~/pwrCustom/build.sh <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit geany <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; geany ~/pwrCustom/fixPwrSource.sh <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; insert the following lines into the new file:<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; !/bin/bash<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fix some missing dependencies<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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/ <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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/ <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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/ <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cp /usr/include/db.h /home/pwrp/pwrsrc_4.8.6-3/src/exe/rt_elog_dump/src <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cp /usr/include/db.h /home/pwrp/pwrsrc_4.8.6-3/xtt/lib/xtt/src <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cp /usr/include/db.h /home/pwrp/pwrsrc_4.8.6-3/xtt/lib/xtt/gtk <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mkdir /home/pwrp/pwrsrc_4.8.6-3/wb/lib/wb/src/antlr <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cp /home/pwrp/antlr-2.7.7/lib/cpp/antlr/* /home/pwrp/pwrsrc_4.8.6-3/wb/lib/wb/src/antlr <br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fix code error<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cp ~/pwrCustom/sev_db.cpp /home/pwrp/pwrsrc_4.8.6-3/sev/lib/sev/src/sev_db.cpp <br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; copy build script which creates just a tarball, not a debian package, and includes some custom rpi/arduino specific stuff<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cp ~/pwrCustom/build.sh /home/pwrp/pwrsrc_4.8.6-3/src/tools/pkg/deb_armel/pwrrt <br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; copy custom pwre_configure.sh<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cp /home/pwrp/pwrCustom/pwre_configure.sh.custom /home/pwrp/pwrsrc_4.8.6-3/src/tools/pwre/src/os_linux/pwre_configure.sh <br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; copy custom pwr service control script<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cp ~/pwrCustom/pwr /home/pwrp/pwrsrc_4.8.6-3/src/tools/pkg/deb_armel/pwrrt/ <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save and exit <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; chmod 755 ~/pwrCustom/fixPwrSource.sh <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; geany ~/pwrCustom/Proview.desktop <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; insert the following lines into the new file: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Desktop Entry] <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Name=Proview <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Comment=SCADA Operator Station <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Exec=/home/pwrp/.xtt_start <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Icon=proview_icon <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Terminal=false <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Type=Application <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MimeType=text/plain <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Categories=GTK <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save and exit</div>
+
::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
 +
::Boot the iso on the VM
 +
::English, install ubuntu
 +
::Download updates while installing
 +
::Install this third party software
 +
::Erase disk and install ubuntu
 +
::Chicago
 +
::English (us), english (us)
 +
::Hostname pwrDevel
 +
::Require login pw
 +
::Restart<br /><br />
 +
 
 +
;'''2) Patch the install'''<br />
 +
 
 +
::sudo apt-get update
 +
::sudo apt-get dist-upgrade
 +
::restart (for new kernel)<br /><br />
 +
 
 +
; 3) '''Install virtualbox tools'''<br />
 +
 
 +
::sudo apt-get install linux-headers-generic dkms build-essential 
 +
::From vbox menu pick: Devices | Install Guest Additions 
 +
::Allow autorun prompt to procede, authenticate 
 +
::Restart <br />
 +
 
 +
 
 +
;4) Minimize annoyances''' <br /><br />
 +
 
 +
::Get rid of advertising and the global menu
 +
::sudo apt-get remove unity-lens-shopping appmenu-gtk appmenu-gtk3 appmenu-qt
 +
::Launch firefox, disable 'global menu integration' extension
 +
::Logout, log back in<br />
 +
 
 +
::turn off spyware'''<br />
 +
 
 +
::launch "System Settings | Privacy"
 +
::pick "Search Results," pick "Include online search results: Off"
 +
::pick "Diagnostics", uncheck "Send error reports to Canonical", pick "Record Activity: OFF"
 +
::sudo add-apt-repository ppa:tualatrix/ppa
 +
::sudo add-apt-repository ppa:satyajit-happy/themes
 +
::sudo add-apt-repository ppa:indicator-multiload/stable-daily
 +
::sudo apt-get update
 +
::sudo apt-get install gnome-shell synaptic gconf-editor gnome-tweak-tool ubuntu-tweak nautilus-open-terminal<br />
 +
 
 +
 
 +
::'''note: accept defaults for gdm'''<br />
 +
 
 +
 
 +
::sudo apt-get install orion-gtk-theme indicator-multiload compizconfig-settings-manager
 +
::right click desktop pick "Change Desktop Background", select non-orange and non-purple background
 +
::from Dash, launch "System Load Indicator"
 +
::launch "System Settings | Ubuntu Tweak"
 +
::pick "Tweaks | Miscellaneous",  pick "Overlay scrollbars: Normal"
 +
::pick "Tweaks | Theme",          pick "Gtk theme: Orion", "Icon theme: gnome", "Window theme: Radiance"
 +
::pick "Tweaks | Desktop Icons",  pick "Show Computer", "Show mounted volumes"
 +
::pick "Tweaks | Unity",          adjust "Launcher icon size" to not waste so much screen space
 +
::pick "Tweaks | Window",        pick "Window control button...: Right"<br />
 +
 
 +
::from Dash, launch "CompizConfig Settings Manager"
 +
::un-check "Snapping Windows"       
 +
::delete unneeded icons from launcher: the "bag", the libre office stuff, the "U"s, the advertising
 +
::add "Terminal" to launcher
 +
::sudo apt-get install geany
 +
::add "Geany" to launcher<br />
 +
 
 +
 
 +
;5) '''Install prerequisites for 'Proview build from source code'''' <br />
 +
<br />
 +
::install some packages (note: openssh-server is not really a prerequisite)
 +
::sudo apt-get install make flex libgtk2.0-dev libdb5.1-dev libdb5.1++-dev libasound2-dev doxygen libmysql++-dev xfonts-100dpi openssh-server
 +
::install java JDK
 +
::download tarball from http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
 +
::cd /usr/local
 +
::sudo tar -zxvf /home/<userID>/jdk-7u17-linux-x64.tar.gz
 +
::sudo chown -R root:root jdk1.7.0_17/
 +
::sudo -s
 +
::cd /etc/profile.d
 +
::touch proview.build.sh
 +
::vi proview.build.sh
 +
::insert the following lines:
 +
::export jdk=/usr/local/jdk1.7.0_17
 +
::export PATH=$PATH:$jdk/bin
 +
::save edited file, exit vi 
 +
::exit (from sudo)<br />
 +
<br />
 +
;6) '''Install Proview development environment & debug runtime'''
 +
<br />
 +
::wget -Opwr48_4.8.6-3.2_amd64.deb http://sourceforge.net/projects/proview/files/proview/proview_4.8.6-3/ubuntu_12.10/pwr48_4.8.6-3.2_amd64.deb/download                   
 +
::sudo dpkg -i pwr48_4.8.6-3.2_amd64.deb               
 +
::sudo adduser pwrp sudo               
 +
::logout               
 +
::login as pwrp               
 +
::fix annoyances               
 +
::from launcher, pick "System Settings | Brightness and Lock"               
 +
::pick "Lock: OFF"               
 +
::exit               
 +
::cd               
 +
::sudo chown pwrp:pwrp Desktop               
 +
::install antlr               
 +
::wget http://www.antlr2.org/download/antlr-2.7.7.tar.gz               
 +
::tar -zxvf antlr-2.7.7.tar.gz               
 +
::geany ~/antlr-2.7.7/lib/cpp/antlr/CharScanner.hpp               
 +
::add: #include <strings.h>               
 +
::#include <stdio.h>               
 +
::save changes and exit               
 +
::cd ~/antlr-2.7.7               
 +
::./configure               
 +
::make               
 +
::sudo make install               
 +
::change max shared memory               
 +
::sudo geany /etc/sysctl.conf               
 +
::insert a line at the end:               
 +
::kernel.shmmax=67108864               
 +
::save changes, exit geany               
 +
::sudo -s               
 +
::echo 67108864 > /proc/sys/kernel/shmmax               
 +
::exit<br />
 +
 
 +
 
 +
 
 +
 
 +
;7)) '''Install Proview source'''<br />
 +
 
 +
::login as pwrp
 +
::cd     
 +
::wget -Opwrsrc_4.8.6-3.2.tar.gz http://sourceforge.net/projects/proview/files/proview/proview_4.8.6-3/pwrsrc_4.8.6-3.2.tar.gz/download
 +
::tar -zxvf pwrsrc_4.8.6-3.2.tar.gz<br />
 +
 
 +
;8) '''Bake the raspberry pi'''<br />
 +
 
 +
::get the wheezy image 2013-02-09 via torrent
 +
::write to 8 GB Class 10 SD card
 +
::boot
 +
::using the Raspi-config tool:
 +
::expand_rootfs
 +
::configure_keyboard
 +
::English (US)
 +
::English (US)
 +
::The default for the keyboard layout
 +
::No compose key
 +
::Control-Alt-Backspace to terminal X server: No
 +
::change_pass
 +
::change_locale
 +
::en_US.UTF-8 UTF-8  only
 +
::default locale for system environment: none
 +
::change_timezone: US Central
 +
::ssh: Enable
 +
::boot_behavior: No
 +
::Finish
 +
::reboot
 +
::login as pi
 +
::sudo apt-get update
 +
::sudo apt-get dist-upgrade
 +
::sudo apt-get install tightvncserver
 +
::sudo apt-get install libgtk2.0-dev
 +
::sudo rm /etc/ssh/ssh_host_*
 +
::sudo dpkg-reconfigure openssh-server
 +
::sudo adduser pwrp
 +
::use password = 'pwrp' (same as Proview distro default)
 +
::sudo adduser pwrp dialout
 +
::(this is for arduino access)
 +
::sudo visudo
 +
::insert following line under the "root ALL=(ALL) ALL" Line:
 +
::pwrp ALL=(ALL) ALL
 +
::save changes, exit
 +
::sudo nano /etc/security/limits.conf
 +
::insert the following:
 +
::*    -  rtprio  99
 +
::save and exit
 +
::sudo nano /etc/pam.d/su
 +
::uncomment line:
 +
::session    required  pam_limits.so
 +
::save and exit
 +
::(note: this allows the pwr service start to set pwr tasks' realtime priorities)
 +
::(note2: also applies to the pwrp tightvncserver X session, since that is launched with su also)
 +
::sudo nano /etc/init.d/tightvncserver
 +
::insert the following into the new file:
 +
::#!/bin/sh
 +
::# /etc/init.d/tightvncserver
 +
::VNCUSER='pwrp'
 +
::case "$1" in
 +
::start)
 +
::su $VNCUSER -c '/usr/bin/tightvncserver :0 -geometry 1024x768 -depth 24'
 +
::echo "Starting TightVNC Server for $VNCUSER "
 +
::;;
 +
::stop)
 +
::pkill Xtightvnc
 +
::echo "TightVNC Server stopped"
 +
::;;
 +
::*)
 +
::echo "Usage: /etc/init.d/tightvncserver {start|stop}"
 +
::exit 1
 +
::;;
 +
::esac
 +
::exit 0
 +
::save changes, exit nano
 +
::sudo chmod 755 /etc/init.d/tightvncserver
 +
::sudo update-rc.d tightvncserver defaults
 +
::exit (i.e. logout)
 +
::login as pwrp
 +
::mkdir ~/proview
 +
::vncpasswd
 +
::enter and confirm
 +
::no view-only password
 +
::sudo nano /etc/hostname
 +
::change to desired node name (e.g. rpi3)
 +
::save and exit
 +
::cd
 +
::ssh-keygen -t rsa
 +
::cd ~/.ssh
 +
::touch authorized_keys
 +
::chmod 600 authorized_keys
 +
::choose a static IPv4 address
 +
::sudo nano /etc/hosts
 +
::update with hostname and ip
 +
::add any other nodes which will participate in the distributed control system
 +
::sudo nano /etc/network/interfaces
 +
::change eth0 to (substitute actual network values):
 +
::iface eth0 inet static
 +
::address 192.168.0.1
 +
::netmask 255.255.255.0
 +
::network 192.168.0.0
 +
::broadcast 192.168.0.255
 +
::gateway 192.168.0.254
 +
::save changes and exit       
 +
::sudo shutdown -r now
 +
::login to X desktop using vnc client  (to verify X is working)<br />
 +
 
 +
;9) '''Configure ssh access from dev to rpi'''
 +
::logon to dev as pwrp
 +
::do this only once:
 +
::ssh-keygen -t rsa
 +
::sudo geany /etc/hosts
 +
::insert line for raspberry pi machine(s) and any other hosts in the distributed system
 +
::save and exit
 +
::scp /home/pwrp/.ssh/id_rsa.pub rpi3:/home/pwrp/.ssh/authorized_keys<br />
 +
 
 +
;10) '''Install cross platform dev tools on dev'''<br />
 +
 
 +
::logon to dev as pwrp
 +
::sudo apt-get install ia32-libs git
 +
::cd
 +
::mkdir rpitools
 +
::cd rpitools
 +
::sudo git clone git://github.com/raspberrypi/tools.git
 +
::create symbolic links to compilers and archiver as a workaround on rather long fully qualified names -
 +
::(Proview merge tool has a hardcoded alloc of 80 chars max for the FQ name of each of these tools):
 +
::sudo -s
 +
::ln -s /home/pwrp/rpitools/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc  /usr/bin/arm-gcc
 +
::ln -s /home/pwrp/rpitools/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++  /usr/bin/arm-g++
 +
::ln -s /home/pwrp/rpitools/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-ar  /usr/bin/arm-ar
 +
::exit<br />
 +
 
 +
;11) '''Get a copy of the rpi headers and libraries to compile and link against, respectively'''<br />
 +
 
 +
::logon to dev as pwrp
 +
::rsync      -avz -e ssh pwrp@rpi3:/usr/include                /home/pwrp/rpi
 +
::sudo rsync -avz -e ssh pwrp@rpi3:/usr/lib/arm-linux-gnueabihf /usr/lib
 +
::sudo rsync -avz -e ssh pwrp@rpi3:/lib/arm-linux-gnueabihf    /lib  <br />
 +
   
 +
;12) '''Setup the build environment'''<br />
 +
 
 +
::logon to dev as pwrp
 +
::cd
 +
::geany ~/.envarm
 +
::insert the following into this new file:
 +
::#  .envarm:
 +
::# env for Proview development for raspberry pi
 +
::#
 +
::#
 +
::export pwre_cc=/usr/bin/arm-gcc
 +
::export pwre_cxx=/usr/bin/arm-g++
 +
::export pwre_ar=/usr/bin/arm-ar
 +
::export pwr_host_exe=/usr/pwr48/os_linux/hw_x86_64/exp/exe
 +
::export pwre_host_exe=/usr/pwr48/os_linux/hw_x86_64/exp/exe
 +
::export pwre_env_db=/home/pwrp/pwre_env_db
 +
::export pwre_bin=/home/pwrp/pwrsrc_4.8.6-3/src/tools/pwre/src/os_linux
 +
::export pwre_dir_symbols=$pwre_bin/dir_symbols.mk
 +
::export PATH=$PATH:/home/pwrp/rpitools/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin       
 +
::source $pwre_bin/pwre_function       
 +
::save and exit
 +
::geany ~/.bashrc
 +
::insert at end of file:       
 +
::source ~/.envarm
 +
::save and exit
 +
::close all Terminal(s)
 +
::launch Terminal
 +
::cd
 +
::mkdir pwrrls_4.8.6-3
 +
::define a PWRE environment for the build:
 +
::pwre add v486_arm
 +
::--
 +
::-- Environment    : v486_arm
 +
::-- Module.........: rt
 +
::-- Source root....: /home/pwrp/pwrsrc_4.8.6-3/src
 +
::-- Import root....: /usr/pwr48/os_linux/hw_x86_64
 +
::-- Build root.....: /home/pwrp/pwrrls_4.8.6-3
 +
::-- Build type.....: dbg
 +
::-- OS.............: linux
 +
::-- Hardware.......: arm
 +
::-- Description....: X48arm
 +
::--
 +
::himBH<br />
 +
 
 +
;13) '''Fixup Proview config script'''<br />
 +
 
 +
::logon to dev as pwrp
 +
::cd /home/pwrp/pwrsrc_4.8.6-3/src/tools/pwre/src/os_linux
 +
::cp pwre_configure.sh pwre_configure.sh.org
 +
::cd
 +
::geany /home/pwrp/pwrsrc_4.8.6-3/src/tools/pwre/src/os_linux/pwre_configure.sh
 +
::insert after line 311:
 +
::pwre_config_check_lib gtk      GTK      gtk gtk 0 "/usr/lib/arm-linux-gnueabihf/libgtk-x11-2.0.so"
 +
::pwre_config_check_include gtk  GTK  1 "/home/pwrp/rpi/include/gtk-2.0/gtk/gtk.h"
 +
::as a sanity check, the code block should look like:
 +
::if test $pwre_hw == "hw_arm"; then
 +
::
 +
::pwre_config_check_lib gtk      GTK  gtk gtk 0 "/usr/lib/arm-linux-gnueabihf/libgtk-x11-2.0.so"
 +
::pwre_config_check_include gtk  GTK  1 "/home/pwrp/rpi/include/gtk-2.0/gtk/gtk.h"
 +
::
 +
::
 +
::pwre_config_check_include jni  JNI  1 $jdk/include/jni.h
 +
::pwre_config_check_include jni  JNI  0 $jdk/include/linux/jni_md.h
 +
::save and exit
 +
::pwre init v486_arm
 +
::pwre configure
 +
::need to figure out some paths, will use the output from "pwre configure" to help,
 +
::this is a little tedious:         
 +
::geany /home/pwrp/pwrrls_4.8.6-3/pwre_arm_linux.cnf
 +
::find line "export pwre_conf_libgtk="
 +
::note the embedded command, e.g. "pkg-config --libs gtk+-2.0", designate as "cmd1"
 +
::find line "export pwre_conf_incdirgtk="
 +
::note the embedded command, e.g. "pkg-config --cflags gtk+-2.0", designate as "cmd2". the commands will now be run on the rpi:
 +
::ssh rpi3
 +
::execute cmd1:
 +
::pkg-config --libs gtk+-2.0
 +
::save the output in a new temp file, e.g. in geany
 +
::execute cmd2:
 +
::pkg-config --cflags gtk+-2.0
 +
::save the output to the temp file
 +
::exit from ssh session
 +
::in the temp file, replace "usr/include" with "home/pwrp/rpi/include"
 +
::in geany, open /home/pwrp/pwrsrc_4.8.6-3/src/tools/pwre/src/os_linux/pwre_configure.sh
 +
::find line "export pwre_conf_libgtk="
 +
::hard-code the contents of that assign to the output of cmd1, e.g.:
 +
::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
 +
::find line "export pwre_conf_incdirgtk="
 +
::hard-code the contents of that assign to the edited output of cmd2, e.g.:
 +
::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
 +
::find line "echo "export pwre_conf_lib=\"-lpthread -lm -lrt -lcrypt\"" >> $cfile"
 +
::add X11 and db5.1 libraries, e.g.:
 +
::echo "export pwre_conf_lib=\"-lpthread -lm -lrt -lcrypt -lX11 -ldb-5.1\"" >> $cfile
 +
::find line "echo "export pwre_conf_libdir=\"$conf_libdir\"" >> $cfile"
 +
::hard-code the assignment to:
 +
::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
 +
::find line "echo "export pwre_conf_incdir=\"$conf_incdir\"" >> $cfile"
 +
::hard-code the assignment to:
 +
::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
 +
::save the edited file
 +
::cd
 +
::mkdir pwrCustom
 +
::save the edited file (again) as ~/pwrCustom/pwre_configure.sh.custom
 +
::exit geany<br />
 +
 
 +
;14) '''Fixup Proview source tree'''<br />
 +
 
 +
::fix service start script:
 +
::cp /home/pwrp/pwrsrc_4.8.6-3/src/tools/pkg/deb_armel/pwrrt/pwr ~/pwrCustom
 +
::geany  ~/pwrCustom/pwr
 +
::for each of the functions: pwr_start, pwr_stop, pwr_reload, pwr_kill:
 +
::replace the "whoami" conditional test from "root" to "pwrp"
 +
::if using an arduino uno, add the following line within the create_wrapper function, after the umask command:
 +
::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
 +
::save and exit
 +
::fix code error:
 +
::geany /home/pwrp/pwrsrc_4.8.6-3/sev/lib/sev/src/sev_db.cpp
 +
::add open curly brace on line 52:
 +
::else if ( type == sev_eDbType_Sqlite) {
 +
::add close curly brace after line 58.
 +
::code block should now look like:       
 +
::if ( type == sev_eDbType_Mysql) {
 +
::#if defined PWRE_CONF_MYSQL
 +
::return sev_dbms::open_database();
 +
::#else
 +
::printf( "** Release is not built with mysql\n");
 +
::return 0;
 +
::#endif
 +
::}
 +
::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");
 +
::return 0;
 +
::#endif
 +
::}
 +
::else
 +
::return 0;
 +
::}
 +
::end example code block   
 +
::save the edited file as:
 +
::~/pwrCustom/sev_db.cpp
 +
::exit geany
 +
::edit the build package script, it will not create a *.deb file as-is:
 +
::geany ~/pwrsrc_4.8.6-3/src/tools/pkg/deb_armel/pwrrt/build.sh
 +
::"# Create directories" section, insert line:
 +
::mkdir -p $pkgroot/usr/pwrp/adm/db
 +
::uncomment lines which copy op  to cnf
 +
::uncomment lines which copy user to cnf
 +
::add following lines to "# Copy user to cnf" section:
 +
::cp $pwre_broot/$pwre_target/exp/inc/pwr_arduino_uno.ino $pkgroot/usr/pwrrt/cnf/user
 +
::cp $pwre_sroot/tools/pkg/deb/adm/proview_icon.png      $pkgroot/usr/pwrrt/cnf/user
 +
::cp /home/pwrp/pwrCustom/Proview.desktop                $pkgroot/usr/pwrrt/cnf/user   
 +
::after the "# Copy user to cnf" section, insert the following lines:
 +
::# Copy user security data
 +
::mkdir -p $pkgroot/usr/pwrp/adm/db
 +
::cp $pwre_sroot/tools/pkg/deb/adm/pwr_user2.dat $pkgroot/usr/pwrp/adm/db
 +
::comment out line "dpkg-buildpackage -aarmel -b"
 +
::add following lines:
 +
::packagename=pwrrt-$version.tar.gz
 +
::tar -czf ../$packagename *
 +
::save the edited file as:
 +
::~/pwrCustom/build.sh
 +
::exit geany
 +
::geany ~/pwrCustom/fixPwrSource.sh
 +
::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/
 +
::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/
 +
::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/
 +
::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
 +
::cp /usr/include/db.h                                      /home/pwrp/pwrsrc_4.8.6-3/src/exe/rt_elog_dump/src
 +
::cp /usr/include/db.h                                      /home/pwrp/pwrsrc_4.8.6-3/xtt/lib/xtt/src
 +
::cp /usr/include/db.h                                      /home/pwrp/pwrsrc_4.8.6-3/xtt/lib/xtt/gtk
 +
::
 +
::mkdir /home/pwrp/pwrsrc_4.8.6-3/wb/lib/wb/src/antlr
 +
::cp /home/pwrp/antlr-2.7.7/lib/cpp/antlr/*                  /home/pwrp/pwrsrc_4.8.6-3/wb/lib/wb/src/antlr 
 +
::
 +
::# fix code error
 +
::#
 +
::cp ~/pwrCustom/sev_db.cpp                                  /home/pwrp/pwrsrc_4.8.6-3/sev/lib/sev/src/sev_db.cpp
 +
::
 +
::# 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
 +
::
 +
::# 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
 +
::
 +
::# copy custom pwr service control script
 +
::#
 +
::cp ~/pwrCustom/pwr                                        /home/pwrp/pwrsrc_4.8.6-3/src/tools/pkg/deb_armel/pwrrt/
 +
::save and exit
 +
::chmod 755 ~/pwrCustom/fixPwrSource.sh
 +
::geany ~/pwrCustom/Proview.desktop
 +
::insert the following lines into the new file:     
 +
::[Desktop Entry]
 +
::Name=Proview
 +
::Comment=SCADA Operator Station
 +
::Exec=/home/pwrp/.xtt_start
 +
::Icon=proview_icon
 +
::Terminal=false
 +
::Type=Application
 +
::MimeType=text/plain
 +
::Categories=GTK
 +
::save and exit <br />
 +
   
 +
;15) '''Final cleanup'''<br />
 +
 
 +
::logon to dev as pwrp
 +
::delete /home/pwrp/pwrsrc_4.8.6-3 (and all contents)
 +
::delete everything from /home/pwrp/pwrrls_4.8.6-3, leaving the folder
 +
::unpack the source (again):
 +
::cd
 +
::tar -zxvf pwrsrc_4.8.6-3.2.tar.gz  <br />
 +
   
 +
;16) '''Build Proview for raspberry pi'''<br />
 +
 
 +
::logon to dev as pwrp
 +
::cd
 +
::pwre list
 +
::pwre init v486_arm     
 +
::./pwrCustom/fixPwrSource.sh
 +
::pwre create_all_modules
 +
::pwre import rt
 +
::pwre import java
 +
::pwre import op
 +
::pwre configure
 +
::./pwrCustom/fixPwrSource.sh
 +
::pwre ebuild rt
 +
::pwre ebuild op
 +
::pwre build tools/pkg deb_armel
 +
::note: to enable pkg rebuild (when make says nothing to do):
 +
::touch /home/pwrp/pwrsrc_4.8.6-3/src/tools/pkg/deb_armel/pwrrt/control<br />
 +
 
 +
 
 +
;17) '''Install Proview runtime and op station on Raspberry Pi'''<br />
 +
 
 +
::logon to dev as pwrp
 +
::geany ~/pwrCustom/installRpi.sh
 +
::insert the following lines into the new file:
 +
::#!/bin/bash
 +
::#
 +
::# install Proview package on Raspberry Pi
 +
::#
 +
::# unpack the tarball
 +
::#
 +
::cd /home/pwrp/proview
 +
::tar -zxvf pwrrt-.tar.gz       
 +
::chown -R pwrp:pwrp /home/pwrp/proview<br />
 +
 
 +
::
 +
::# configure target dirs, install the archive
 +
::#
 +
::install -d -o pwrp -g pwrp /usr/pwrrt
 +
::install -d -o pwrp -g pwrp /usr/pwrrt/cnf
 +
::install -d -o pwrp -g pwrp /usr/pwrrt/cnf/op
 +
::install -d -o pwrp -g pwrp /usr/pwrrt/cnf/user
 +
::install -d -o pwrp -g pwrp /usr/pwrrt/exe
 +
::install -d -o pwrp -g pwrp /usr/pwrrt/lib
 +
::install -d -o pwrp -g pwrp /usr/pwrrt/load
 +
::
 +
::install -d -o pwrp -g pwrp /pwrp
 +
::install -d -o pwrp -g pwrp /pwrp/arm_linux
 +
::install -d -o pwrp -g pwrp /pwrp/arm_linux/exe
 +
::install -d -o pwrp -g pwrp /pwrp/arm_linux/lib
 +
::install -d -o pwrp -g pwrp /pwrp/arm_linux/lis
 +
::install -d -o pwrp -g pwrp /pwrp/arm_linux/obj
 +
::
 +
::install -d -o pwrp -g pwrp /pwrp/common
 +
::install -d -o pwrp -g pwrp /pwrp/common/db
 +
::install -d -o pwrp -g pwrp /pwrp/common/inc
 +
::install -d -o pwrp -g pwrp /pwrp/common/load
 +
::install -d -o pwrp -g pwrp /pwrp/common/log
 +
::install -d -o pwrp -g pwrp /pwrp/common/loghist
 +
::install -d -o pwrp -g pwrp /pwrp/common/web
 +
::
 +
::install -d                /usr/pwrp
 +
::install -d -o pwrp -g pwrp /usr/pwrp/adm
 +
::install -d -o pwrp -g pwrp /usr/pwrp/adm/db
 +
::
 +
::install -d  /usr/share/doc/pwrrt
 +
::
 +
::install -D /home/pwrp/proview/etc/*                                /etc
 +
::install -D /home/pwrp/proview/etc/init.d/*                        /etc/init.d
 +
::install -D -m 644 /home/pwrp/proview/usr/pwrrt/cnf/proview.cnf    /etc
 +
::
 +
::install -D -o pwrp -g pwrp /home/pwrp/proview/usr/pwrrt/*          /usr/pwrrt
 +
::install -D -o pwrp -g pwrp /home/pwrp/proview/usr/pwrrt/cnf/*      /usr/pwrrt/cnf
 +
::install -D -o pwrp -g pwrp /home/pwrp/proview/usr/pwrrt/exe/*      /usr/pwrrt/exe
 +
::install -D -o pwrp -g pwrp /home/pwrp/proview/usr/pwrrt/lib/*      /usr/pwrrt/lib
 +
::install -D -o pwrp -g pwrp /home/pwrp/proview/usr/pwrrt/load/*    /usr/pwrrt/load
 +
::
 +
::install -D -o pwrp -g pwrp /home/pwrp/proview/usr/pwrrt/cnf/op/.??*  /usr/pwrrt/cnf/op
 +
::install -D -o pwrp -g pwrp /home/pwrp/proview/usr/pwrrt/cnf/user/.??* /usr/pwrrt/cnf/user
 +
::
 +
::install -D -o pwrp -g pwrp /home/pwrp/proview/usr/pwrp/adm/db/*    /usr/pwrp/adm/db
 +
::
 +
::install -D -m 644 /home/pwrp/proview/usr/share/doc/pwrrt/*        /usr/share/doc/pwrrt
 +
::install -D -m 644 /home/pwrp/proview/usr/share/man/man1/*          /usr/share/man/man1
 +
::
 +
::install -D -o pwrp -g pwrp -m 775 /home/pwrp/proview/usr/pwrrt/cnf/user/.??* /home/pwrp
 +
::install -D -o pwrp -g pwrp -m 775 /home/pwrp/proview/usr/pwrrt/cnf/user/*    /home/pwrp
 +
::
 +
::install -D                -m 644 /home/pwrp/proview/usr/pwrrt/cnf/user/proview_icon.png  /usr/share/pixmaps
 +
::install -D -o pwrp -g pwrp -m 644 /home/pwrp/proview/usr/pwrrt/cnf/user/Proview.desktop  /home/pwrp/Desktop       
 +
::
 +
::if [ -f /home/pwrp/pwr_arduino_uno.ino ]
 +
::then
 +
::install -d -o pwrp -g pwrp /home/pwrp/sketchbook
 +
::install -d -o pwrp -g pwrp /home/pwrp/sketchbook/pwr_arduino_uno
 +
::mv /home/pwrp/pwr_arduino_uno.ino /home/pwrp/sketchbook/pwr_arduino_uno
 +
::chown pwrp:pwrp /home/pwrp/sketchbook/pwr_arduino_uno/pwr_arduino_uno.ino
 +
::fi
 +
::save and exit
 +
::scp /home/pwrp/pwrrls_4.8.6-3/os_linux/hw_arm/bld/pkg/pwrrt-.tar.gz pwrp@rpi3:~/proview
 +
::scp /home/pwrp/pwrCustom/installRpi.sh pwrp@rpi3:~/
 +
::ssh rpi3
 +
::cd
 +
::chmod 775 installRpi.sh
 +
::sudo ./installRpi.sh
 +
::sudo update-rc.d pwr defaults
 +
::exit (from ssh session)
 +
::18) create proof-of-concept Proview project
 +
::logon to dev as pwrp
 +
::
 +
::one-time fix so plc prog will build:
 +
::mkdir /home/pwrp/pwrrls_4.8.6-3/os_linux/hw_x86_64
 +
::mkdir /home/pwrp/pwrrls_4.8.6-3/os_linux/hw_x86_64/exp
 +
::mkdir /home/pwrp/pwrrls_4.8.6-3/os_linux/hw_x86_64/exp/exe     
 +
::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
 +
::end one time fix
 +
::
 +
::on the desktop, double-click Proview V4.8
 +
::accept (and respect) the license terms
 +
::using "PwR Project List":
 +
::enter edit mode
 +
::add a BaseReg object, child to Bases
 +
::open the new object, set attributes:
 +
::ObjectName: BaseV48arm
 +
::Version  : X48arm
 +
::Path      : /home/pwrp/pwrrls_4.8.6-3
 +
::close the object
 +
::save changes
 +
::note: the new base define is reflected as a new line in /usr/pwrp/adm/db/pwr_projectlist.dat
 +
::the binding to the release build's path is via the "X48arm" token, which will be used below
 +
::add a $Hier object, sibling to Bases
 +
::set ObjectName attribute = "testProjects"
 +
::add a ProjectReg object, child of testProjects
 +
::open new object, set attributes:
 +
::ObjectName : piPOC
 +
::Description: Raspberry Pi Proof of Concept
 +
::Version    : X48arm 
 +
::(note: Version attr binds the project to the BaseV48arm)
 +
::close the object
 +
::save changes
 +
::Confirm Actions: Yes
 +
::note: the new project is reflected as a new directory tree at /usr/local/pwrp/pipoc
 +
::leave edit mode
 +
::right-click piPOC, pick Open Project
 +
::using "Configure Directory Volume":
 +
::enter "Production QBUS id" = 5      (this is arbitrary, but better than using defaults, for troubleshooting)
 +
::click Next
 +
::click Next
 +
::click No
 +
::click Next
 +
::click Next
 +
::click Skip this node
 +
::click Next
 +
::click Yes
 +
::using "Configure Root Volume":
 +
::pick Operator Station
 +
::click Next
 +
::click Next
 +
::click Next
 +
::using "PwR VolPipoc, pwrp on pipoc":
 +
::from the drop-down menu, pick "File | Volume Attributes..."
 +
::change the "OperatingSystem" attribute to "CustomBuild"
 +
::close the object
 +
::save changes
 +
::close the window
 +
::using "PwR Directory, pwrp on pipoc":
 +
::enter edit mode
 +
::
 +
::open pipoc object, set attributes:
 +
::NodeName      : rpi3        (i.e. the hostname of the target rpi)
 +
::OperatingSystem: CustomBuild
 +
::BootNode:      : rpi3
 +
::Address        : 192.168.0.1 (i.e. the IPv4 address of the rpi)
 +
::close the object
 +
::
 +
::add a CustomBuild object as child to pipoc
 +
::open the new object, set attributes:
 +
::ObjectName    : build
 +
::cc            : /usr/bin/arm-gcc
 +
::cxx            : /usr/bin/arm-g++
 +
::ar            : /usr/bin/arm-ar
 +
::OperatingSystem: Linux on ARM
 +
::Platform      : arm_linux
 +
::Release        : X48arm
 +
::close the object
 +
::
 +
::save changes
 +
::leave edit mode
 +
::right-click "VolPipoc", pick Open Volume       
 +
::using "PwR VolPipoc, pwrp on pipoc":
 +
::enter edit mode
 +
::
 +
::in the right pane, delete the Maintenance object
 +
::in the right pane, delete the OpDefault object
 +
::in the right pane, delete the WebHandler object
 +
::in the right pane, delete the WebBrowser object
 +
::
 +
::add a XttGraph object as child to Op
 +
::set ObjectName to Display1
 +
::
 +
::open Op object, set attributes:
 +
::UserName      : pwrp
 +
::FastAvail[0]  : Nodes-Pipoc-Op-Display1
 +
::close the object
 +
::
 +
::in the center pane, add a $PlantHier object
 +
::set ObjectName to Bakery
 +
::
 +
::add a $PlantHier, child to Bakery
 +
::set ObjectName to Signals
 +
::
 +
::add two Iv objects as children of Signals
 +
::set ObjectName's to Iin and Iout, respectively
 +
::
 +
::add a PlcPgm object as child of Bakery
 +
::set ObjectName to Plc
 +
::
 +
::save changes
 +
::leave edit mode
 +
::
 +
::right-click Bakery-Plc, pick Open Program
 +
::using "Bakery-Plc"
 +
::enter edit mode
 +
::
 +
::add a GetIv object
 +
::add a StoIv object
 +
::
 +
::connect the GetIv output to the StoIv input
 +
::
 +
::from drop-down menu, pick "View | Palette | Plant". Using the right-pane
 +
::plant hierarchy:
 +
::Connect (bind) Signals-Iin to GetIv
 +
::Connect (bind) Signals-Iout to StoIv
 +
::
 +
::save changes
 +
::leave edit mode
 +
::close the window
 +
::using "PwR VolPipoc, pwrp on pipoc":
 +
::right click Nodes-Op-Display1
 +
::pick "Open Ge..."
 +
::using "PwR Ge display1"
 +
::
 +
::add two ValueInputMedium objects
 +
::
 +
::record the coordinates for the area to display, i.e. the area which contains the two objects
 +
::from the drop-down menu, pick "File | Graph Attributes"
 +
::enter the x & y coordinates for this display area
 +
::close the object
 +
::
 +
::double-click one of the ValueInputMedium objects, set attribute:
 +
::Value.Format    : %6d
 +
::close object
 +
::
 +
::repeat for the other Input object
 +
::
 +
::View "Plant Hierarchy", select Bakery-Signals-Iin
 +
::press Ctrl key, double-click on first ValInpMed object (binds signal to object)
 +
::
 +
::repeat, bind Iout to other display object
 +
::
 +
::pick "File | Save"
 +
::close the window
 +
::using "PwR VolPipoc, pwrp on pipoc":
 +
::from drop-down menu, pick "Functions | Build Node"
 +
::example output as shown in "Proview Development Console":           
 +
::Setting base /usr/pwr48
 +
::Open pipoc
 +
::args: pipoc pwrp pwrp 
 +
::-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
 +
::Welcome to
 +
::pipoc          V4.8    Raspberry Pi Proof of Concept
 +
::
 +
::Revision history
 +
::2013-03-09      pwrp    Project created
 +
::-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
 +
::-- Processing line: 50
 +
::-- Building volume directory
 +
::-- Opening volume 'VolPipoc'
 +
::Berkeley DB 5.1.29: (October 25, 2011)
 +
::info get: 0
 +
::-- Build node pipoc
 +
::-- Plc window generated            Bakery-Plc-W
 +
::/home/pwrp/pwrrls_4.8.6-3 is baseroot
 +
::Setting base /home/pwrp/pwrrls_4.8.6-3
 +
::-- Cross compilation ARM_LINUX
 +
::-- Plc window compiled for arm_linux optimized -O3 Bakery-Plc-W
 +
::/home/pwrp/pwrrls_4.8.6-3 is baseroot
 +
::Setting base /home/pwrp/pwrrls_4.8.6-3
 +
::-- Cross compilation ARM_LINUX
 +
::-- Plc plcpgm compiled for arm_linux optimized -O3 Bakery-Plc
 +
::-- Web startpage generated $pwrp_web/index.html
 +
::/home/pwrp/pwrrls_4.8.6-3 is baseroot
 +
::Setting base /home/pwrp/pwrrls_4.8.6-3
 +
::-- Cross compilation ARM_LINUX
 +
::-- Building archive for volume: 000_001_001_001
 +
::-- Archive built for volume: 000_001_001_001
 +
::-- Working with load file volume 'VolPipoc'...
 +
::-- Open file...
 +
::-- Successfully created load file for volume 'VolPipoc'
 +
::-- 26 objects with a total body size of 26392 bytes were written to new file.
 +
::-- Creating bootfile for node rpi3
 +
::-- Plc thread generated priority 22, scantime  0.10000 s, 1 plcpgm's
 +
::/home/pwrp/pwrrls_4.8.6-3 is baseroot
 +
::Setting base /home/pwrp/pwrrls_4.8.6-3
 +
::-- Cross compilation ARM_LINUX
 +
::-- Plc process compiled for arm_linux optimized -O3 Dummy
 +
::/home/pwrp/pwrrls_4.8.6-3 is baseroot
 +
::Setting base /home/pwrp/pwrrls_4.8.6-3
 +
::-- Cross compilation ARM_LINUX
 +
::-- Plc program linked for arm_linux  node plc_rpi3_0005_plc
 +
::-- Build node pipoc
 +
::end example output         
 +
::from drop-down menu, pick "Functions | Distribute"
 +
::using "Distributor":
 +
::select rpi3
 +
::from the drop-down menu, pick "Functions | Distribute"
 +
::example output in "Proview Development Console":               
 +
::pwrp_pkg_rpi3_0001.tgz                        100% 1705KB  1.7MB/s  00:00   
 +
::-- No package installed
 +
::-- Installing package pwrp_pkg_rpi3_0001.tgz
 +
::-- Unpack package pwrp_pkg_rpi3_0001.tgz
 +
::-- Move files to target directories
 +
::sudo: no tty present and no askpass program specified
 +
::end example output         
 +
::there will be some warnings in Workbench Messages re missing files, ignore these       
 +
::exit from the Proview development environment (close all windows in reverse order of opening them)
 +
::19) run the test project
 +
::connect to rpi3 via vnc client
 +
::
 +
::nano ~/.xtt_start
 +
::edit the rt_xtt invoke to launch the operator station:     
 +
::$pwr_exe/rt_xtt Nodes-Pipoc-Op &
 +
::save changes and exit
 +
::
 +
::sudo nano /etc/proview.cnf
 +
::edit the qcomBusId to 5
 +
::save changes and exit
 +
::
 +
::sudo shutdown -r now
 +
::(so the pwr service will pick up the new bus ID)
 +
::connect to rpi3 via vnc client
 +
::
 +
::start the op station:
 +
::double-click the Proview desktop icon
 +
::
 +
::launch Display1
 +
::verify manually entering a value in Iin is copied to Iout
 +
::verify manually entering a value in Iout is overwritten by value in Iin
 +
::verify status is green
 +
::
 +
::note: to reset runtime from an abend:
 +
::source pwr_stop.sh
 +
::
 +
::---------------------------------------------------------------------------------------------------       
 +
::OK, proof of concept works, let's have another pi do some I/O
 +
::after all, what good is a SCADA system without I/O?
 +
::---------------------------------------------------------------------------------------------------  <br />
 +
   
 +
::
 +
;20) '''Build another rpi (nobody can have just one!), hostname rpi2'''<br />
 +
 
 +
::install base OS (item 8 above)
 +
::config new pi for ssh (item 9 above)
 +
::install Proview (item 17 above)
 +
::sudo nano /etc/proview.cnf
 +
::edit the qcomBusId to 5
 +
::save changes and exit
 +
::21) configure rpi2 for arduino
 +
::login to rpi2 as pwrp
 +
::connect the arduino device
 +
::sudo apt-get install arduino
 +
::launch arduino
 +
::pick "Tools | Board | Arduino Uno"
 +
::pick "Tools | Serial Port | /dev/ttyACM0"
 +
::pick "File | Sketchbook | pwr_arduino_uno"
 +
::in sketch, verify debug assignment is 0
 +
::verify baudRate is 19200
 +
::upload sketch to the arduino
 +
::
 +
::note: due to the bizarre handling of serial in Linux (i.e. raw, cooked, much interference by software layers, etc.),
 +
::the following config is needed prior to starting the pwr runtime:
 +
::
 +
::stty -F /dev/sttyACM0 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
 +
::this config is included in the "pwr" service start script as per edits in sections above.
 +
::
 +
::(as a side note, if the Uno is connected to a virtual machine via VirtualBox, if you bind the Uno device from the (Windows) host
 +
::to the VM using USB and not COM, then things seem to work in Proview debug runtime. Again, the stty config needs to be run prior to runtime start.) <br />
 +
   
 +
;22) '''Update Proview project'''
 +
::logon to dev as pwrp
 +
::launch Proview
 +
::
 +
::using "PwR Project List"
 +
::from the menu, pick "File | Open | GlobalVolumeList"       
 +
::using "PwR Global Volume List"
 +
::enter edit mode
 +
::add a VolumeReg object as sibling of VolPipoc
 +
::open object, set attributes:
 +
::ObjectName    :  VolPipoc2
 +
::Description  :  0.1.1.2    pipoc
 +
::VolumeId      :  _V0.1.1.2
 +
::Project      :  pipoc
 +
::close the object
 +
::save changes
 +
::leave edit mode
 +
::close the window           
 +
::using "PwR Project List"
 +
::open PiPOC project
 +
::enter edit mode<br />
 +
 
 +
::
 +
::add a RootVolumeConfig object as sibling of VolPipoc
 +
::open object, set attribute:
 +
::ObjectName    :  VolPipoc2
 +
::close the object<br />
 +
 
 +
::
 +
::add a NodeConfig object as sibling to pipoc
 +
::open object, set attributes:
 +
::ObjectName    :  pipoc2
 +
::NodeName      : rpi2        (i.e. the hostname of the target rpi)
 +
::OperatingSystem: CustomBuild
 +
::BootNode:      : rpi2
 +
::Address        : 192.168.0.2 (i.e. the IPv4 address of the rpi)
 +
::close the object<br />
 +
 
 +
::
 +
::add a CustomBuild as child to pipoc2
 +
::open object, set attributes:
 +
::ObjectName    : build
 +
::cc            : /usr/bin/arm-gcc
 +
::cxx            : /usr/bin/arm-g++
 +
::ar            : /usr/bin/arm-ar
 +
::OperatingSystem: Linux on ARM
 +
::Platform      : arm_linux
 +
::Release        : X48arm
 +
::close the object
 +
::
 +
::open pipoc2's RootVolumeLoad object, set attribute:
 +
::ObjectName    : VolPipoc2
 +
::close the object<br />
 +
 
 +
::
 +
::save changes
 +
::click Yes to "Do you want to create this Volume?"
 +
::leave edit mode<br />
 +
 
 +
::
 +
::right click VolPipoc2, pick OpenVolume
 +
::using "Configure Root Volume"
 +
::pick "Operator Station"
 +
::click Next
 +
::click Next
 +
::click Next
 +
::using "PwR VolPipoc2, pwrp on pipoc"
 +
::enter edit mode
 +
::from the drop-down menu, pick "File | Volume Attributes..."
 +
::change the "OperatingSystem" attribute to "CustomBuild"
 +
::close the object       
 +
::in the right pane, delete the Maintenance object
 +
::in the right pane, delete the OpDefault object
 +
::in the right pane, delete the WebHandler object
 +
::in the right pane, delete the WebBrowser object<br />
 +
 
 +
::
 +
::add a XttGraph object as child to Op
 +
::set ObjectName to Display2<br />
 +
 
 +
::
 +
::open Op object, set attributes:
 +
::UserName      : pwrp
 +
::AutoStart[0]  : Nodes-Pipoc2-Op-Display2
 +
::FastAvail[0]  : Nodes-Pipoc2-Op-Display2
 +
::close the object
 +
::
 +
::add a Arduino_USB object as child of Pipoc2
 +
::open object, set attributes:
 +
::ObjectName      : Arduino
 +
::close object
 +
::
 +
::add a Arduino_Uno object as child of Arduino
 +
::open object, set attributes:
 +
::ObjectName      : Uno1
 +
::Device          : /dev/ttyACM0
 +
::BaudRate        : 19200
 +
::close object
 +
::
 +
::add a ChanAi object as child of Uno1
 +
::open object, set attributes:
 +
::ObjectName            : Ai0
 +
::Number                : 0
 +
::RawValRangeLow        : 0
 +
::RawValRangeHigh        : 1023
 +
::ChannelSigValRangeLow  : 0
 +
::ChannelSigValRangeHigh : 5
 +
::SensorSigValRangeLow  : 0
 +
::SensorSigValRangeHigh  : 5
 +
::ActValRangeLow        : 0
 +
::ActValRangeHigh        : 1023
 +
::close object
 +
::
 +
::add a ChanDo object as child of Uno1
 +
::open object, set attributes:
 +
::ObjectName      : Do2
 +
::Number          : 2
 +
::close object
 +
::
 +
::add a ChanDi object as child of Uno1
 +
::open object, set attributes:
 +
::ObjectName      : Di4
 +
::Number          : 4
 +
::close object
 +
::
 +
::in the center pane, add a $PlantHier object
 +
::set ObjectName to Bakery2
 +
::
 +
::add a $PlantHier object, child to Bakery2
 +
::set ObjectName to Signals
 +
::
 +
::add an Ai object as child of Signals
 +
::open object, set attributes:
 +
::ObjectName      : Ai0
 +
::SigChanCon      : Nodes-Pipoc2-Arduino-Uno1-Ai0
 +
::close object
 +
::
 +
::add a Di object as child of Signals
 +
::open object, set attributes:
 +
::ObjectName      : Di4
 +
::SigChanCon      : Nodes-Pipoc2-Arduino-Uno1-Di4
 +
::close object
 +
::
 +
::add a Do object as child of Signals
 +
::open object, set attributes:
 +
::ObjectName      : Do2
 +
::SigChanCon      : Nodes-Pipoc2-Arduino-Uno1-Do2
 +
::close object
 +
::
 +
::add a PlcPgm object as child of Bakery2
 +
::set ObjectName to Plc2
 +
::
 +
::save changes
 +
::leave edit mode
 +
::
 +
::right-click Bakery2-Plc, pick Open Program
 +
::using "Bakery2-Plc2"
 +
::enter edit mode
 +
::save changes (there are none - but we need the sub-window to exist)
 +
::leave edit mode
 +
::close the window
 +
::using "PwR VolPipoc, pwrp on pipoc":
 +
::right click Nodes-Op-Display2
 +
::pick "Open Ge..."
 +
::using "PwR Ge display2"       
 +
::add one ValueInputMedium object
 +
::add two ValueMedium objects
 +
::
 +
::note the coordinates for the area to display
 +
::from the drop-down menu, pick "File | Graph Attributes"
 +
::enter the x & y coordinates for display area noted above
 +
::close the object
 +
::
 +
::double-click the ValueInputMedium object, set attribute:
 +
::Value.Format    : %6d
 +
::close object
 +
::
 +
::repeat for the first ValueMedium object
 +
::repeat with %6.2f for other ValueMedium object
 +
::
 +
::View Plant Hierarchy, select Bakery2-Signals-Do2
 +
::press Ctrl key, double-click on ValueInputMedium object
 +
::note: this connects the display object to the target plant signal<br />
 +
 
 +
::
 +
::repeat, connect Di4 to ValMed,  connect Ai0 to other ValMed<br />
 +
 
 +
::
 +
::pick "File | Save"
 +
::close the window
 +
::using "PwR VolPipoc2, pwrp on pipoc":
 +
::from drop-down menu, pick "Functions | Build Node"
 +
::from drop-down menu, pick "Functions | Distribute"
 +
::using "Distributor":
 +
::select rpi2
 +
::from the drop-down menu, pick "Functions | Distribute"         
 +
::exit from the Proview development environment (close all windows)<br />
 +
 
 +
;23) '''use the Arduino'''  <br />
 +
     
 +
::connect to rpi2 via VNC X window
 +
::restart the runtime:
 +
::sudo service pwr restart
 +
::hint: if problems, then to get some diagnostics:
 +
::cd
 +
::source  pwr_stop.sh
 +
::rt_ini -i &
 +
::ps -ef | grep rt
 +
::edit ~./.xtt_start to launch the operator station windows:
 +
::#!/bin/bash
 +
::source /etc/pwrp_profile
 +
::$pwr_exe/rt_xtt Nodes-Pipoc2-Op &
 +
::save changes and exit
 +
::double-click the Proview desktop icon
 +
::in Display2, the analog in value will vary slightly due to noise (unless you have connected a pot or some signal to it)
 +
::experiment with the Di and Do values     
 +
::finish

Latest revision as of 04:39, 27 August 2013

1) Install Ubuntu 12.10 desktop OS on the development (virtual) machine:
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
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
Boot the iso on the VM
English, install ubuntu
Download updates while installing
Install this third party software
Erase disk and install ubuntu
Chicago
English (us), english (us)
Hostname pwrDevel
Require login pw
Restart

2) Patch the install
sudo apt-get update
sudo apt-get dist-upgrade
restart (for new kernel)

3) Install virtualbox tools
sudo apt-get install linux-headers-generic dkms build-essential
From vbox menu pick: Devices | Install Guest Additions
Allow autorun prompt to procede, authenticate
Restart


4) Minimize annoyances

Get rid of advertising and the global menu
sudo apt-get remove unity-lens-shopping appmenu-gtk appmenu-gtk3 appmenu-qt
Launch firefox, disable 'global menu integration' extension
Logout, log back in
turn off spyware
launch "System Settings | Privacy"
pick "Search Results," pick "Include online search results: Off"
pick "Diagnostics", uncheck "Send error reports to Canonical", pick "Record Activity: OFF"
sudo add-apt-repository ppa:tualatrix/ppa
sudo add-apt-repository ppa:satyajit-happy/themes
sudo add-apt-repository ppa:indicator-multiload/stable-daily
sudo apt-get update
sudo apt-get install gnome-shell synaptic gconf-editor gnome-tweak-tool ubuntu-tweak nautilus-open-terminal


note: accept defaults for gdm


sudo apt-get install orion-gtk-theme indicator-multiload compizconfig-settings-manager
right click desktop pick "Change Desktop Background", select non-orange and non-purple background
from Dash, launch "System Load Indicator"
launch "System Settings | Ubuntu Tweak"
pick "Tweaks | Miscellaneous", pick "Overlay scrollbars: Normal"
pick "Tweaks | Theme", pick "Gtk theme: Orion", "Icon theme: gnome", "Window theme: Radiance"
pick "Tweaks | Desktop Icons", pick "Show Computer", "Show mounted volumes"
pick "Tweaks | Unity", adjust "Launcher icon size" to not waste so much screen space
pick "Tweaks | Window", pick "Window control button...: Right"
from Dash, launch "CompizConfig Settings Manager"
un-check "Snapping Windows"
delete unneeded icons from launcher: the "bag", the libre office stuff, the "U"s, the advertising
add "Terminal" to launcher
sudo apt-get install geany
add "Geany" to launcher


5) Install prerequisites for 'Proview build from source code'


install some packages (note: openssh-server is not really a prerequisite)
sudo apt-get install make flex libgtk2.0-dev libdb5.1-dev libdb5.1++-dev libasound2-dev doxygen libmysql++-dev xfonts-100dpi openssh-server
install java JDK
download tarball from http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
cd /usr/local
sudo tar -zxvf /home/<userID>/jdk-7u17-linux-x64.tar.gz
sudo chown -R root:root jdk1.7.0_17/
sudo -s
cd /etc/profile.d
touch proview.build.sh
vi proview.build.sh
insert the following lines:
export jdk=/usr/local/jdk1.7.0_17
export PATH=$PATH:$jdk/bin
save edited file, exit vi
exit (from sudo)


6) Install Proview development environment & debug runtime


wget -Opwr48_4.8.6-3.2_amd64.deb http://sourceforge.net/projects/proview/files/proview/proview_4.8.6-3/ubuntu_12.10/pwr48_4.8.6-3.2_amd64.deb/download
sudo dpkg -i pwr48_4.8.6-3.2_amd64.deb
sudo adduser pwrp sudo
logout
login as pwrp
fix annoyances
from launcher, pick "System Settings | Brightness and Lock"
pick "Lock: OFF"
exit
cd
sudo chown pwrp:pwrp Desktop
install antlr
wget http://www.antlr2.org/download/antlr-2.7.7.tar.gz
tar -zxvf antlr-2.7.7.tar.gz
geany ~/antlr-2.7.7/lib/cpp/antlr/CharScanner.hpp
add: #include <strings.h>
  1. include <stdio.h>
save changes and exit
cd ~/antlr-2.7.7
./configure
make
sudo make install
change max shared memory
sudo geany /etc/sysctl.conf
insert a line at the end:
kernel.shmmax=67108864
save changes, exit geany
sudo -s
echo 67108864 > /proc/sys/kernel/shmmax
exit



7)) Install Proview source
login as pwrp
cd
wget -Opwrsrc_4.8.6-3.2.tar.gz http://sourceforge.net/projects/proview/files/proview/proview_4.8.6-3/pwrsrc_4.8.6-3.2.tar.gz/download
tar -zxvf pwrsrc_4.8.6-3.2.tar.gz
8) Bake the raspberry pi
get the wheezy image 2013-02-09 via torrent
write to 8 GB Class 10 SD card
boot
using the Raspi-config tool:
expand_rootfs
configure_keyboard
English (US)
English (US)
The default for the keyboard layout
No compose key
Control-Alt-Backspace to terminal X server: No
change_pass
change_locale
en_US.UTF-8 UTF-8 only
default locale for system environment: none
change_timezone: US Central
ssh: Enable
boot_behavior: No
Finish
reboot
login as pi
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install tightvncserver
sudo apt-get install libgtk2.0-dev
sudo rm /etc/ssh/ssh_host_*
sudo dpkg-reconfigure openssh-server
sudo adduser pwrp
use password = 'pwrp' (same as Proview distro default)
sudo adduser pwrp dialout
(this is for arduino access)
sudo visudo
insert following line under the "root ALL=(ALL) ALL" Line:
pwrp ALL=(ALL) ALL
save changes, exit
sudo nano /etc/security/limits.conf
insert the following:
  • - rtprio 99
save and exit
sudo nano /etc/pam.d/su
uncomment line:
session required pam_limits.so
save and exit
(note: this allows the pwr service start to set pwr tasks' realtime priorities)
(note2: also applies to the pwrp tightvncserver X session, since that is launched with su also)
sudo nano /etc/init.d/tightvncserver
insert the following into the new file:
  1. !/bin/sh
  2. /etc/init.d/tightvncserver
VNCUSER='pwrp'
case "$1" in
start)
su $VNCUSER -c '/usr/bin/tightvncserver :0 -geometry 1024x768 -depth 24'
echo "Starting TightVNC Server for $VNCUSER "
stop)
pkill Xtightvnc
echo "TightVNC Server stopped"
  • )
echo "Usage: /etc/init.d/tightvncserver {start|stop}"
exit 1
esac
exit 0
save changes, exit nano
sudo chmod 755 /etc/init.d/tightvncserver
sudo update-rc.d tightvncserver defaults
exit (i.e. logout)
login as pwrp
mkdir ~/proview
vncpasswd
enter and confirm
no view-only password
sudo nano /etc/hostname
change to desired node name (e.g. rpi3)
save and exit
cd
ssh-keygen -t rsa
cd ~/.ssh
touch authorized_keys
chmod 600 authorized_keys
choose a static IPv4 address
sudo nano /etc/hosts
update with hostname and ip
add any other nodes which will participate in the distributed control system
sudo nano /etc/network/interfaces
change eth0 to (substitute actual network values):
iface eth0 inet static
address 192.168.0.1
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.254
save changes and exit
sudo shutdown -r now
login to X desktop using vnc client (to verify X is working)
9) Configure ssh access from dev to rpi
logon to dev as pwrp
do this only once:
ssh-keygen -t rsa
sudo geany /etc/hosts
insert line for raspberry pi machine(s) and any other hosts in the distributed system
save and exit
scp /home/pwrp/.ssh/id_rsa.pub rpi3:/home/pwrp/.ssh/authorized_keys
10) Install cross platform dev tools on dev
logon to dev as pwrp
sudo apt-get install ia32-libs git
cd
mkdir rpitools
cd rpitools
sudo git clone git://github.com/raspberrypi/tools.git
create symbolic links to compilers and archiver as a workaround on rather long fully qualified names -
(Proview merge tool has a hardcoded alloc of 80 chars max for the FQ name of each of these tools):
sudo -s
ln -s /home/pwrp/rpitools/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc /usr/bin/arm-gcc
ln -s /home/pwrp/rpitools/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++ /usr/bin/arm-g++
ln -s /home/pwrp/rpitools/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-ar /usr/bin/arm-ar
exit
11) Get a copy of the rpi headers and libraries to compile and link against, respectively
logon to dev as pwrp
rsync -avz -e ssh pwrp@rpi3:/usr/include /home/pwrp/rpi
sudo rsync -avz -e ssh pwrp@rpi3:/usr/lib/arm-linux-gnueabihf /usr/lib
sudo rsync -avz -e ssh pwrp@rpi3:/lib/arm-linux-gnueabihf /lib
12) Setup the build environment
logon to dev as pwrp
cd
geany ~/.envarm
insert the following into this new file:
  1. .envarm:
  2. env for Proview development for raspberry pi
export pwre_cc=/usr/bin/arm-gcc
export pwre_cxx=/usr/bin/arm-g++
export pwre_ar=/usr/bin/arm-ar
export pwr_host_exe=/usr/pwr48/os_linux/hw_x86_64/exp/exe
export pwre_host_exe=/usr/pwr48/os_linux/hw_x86_64/exp/exe
export pwre_env_db=/home/pwrp/pwre_env_db
export pwre_bin=/home/pwrp/pwrsrc_4.8.6-3/src/tools/pwre/src/os_linux
export pwre_dir_symbols=$pwre_bin/dir_symbols.mk
export PATH=$PATH:/home/pwrp/rpitools/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin
source $pwre_bin/pwre_function
save and exit
geany ~/.bashrc
insert at end of file:
source ~/.envarm
save and exit
close all Terminal(s)
launch Terminal
cd
mkdir pwrrls_4.8.6-3
define a PWRE environment for the build:
pwre add v486_arm
--
-- Environment  : v486_arm
-- Module.........: rt
-- Source root....: /home/pwrp/pwrsrc_4.8.6-3/src
-- Import root....: /usr/pwr48/os_linux/hw_x86_64
-- Build root.....: /home/pwrp/pwrrls_4.8.6-3
-- Build type.....: dbg
-- OS.............: linux
-- Hardware.......: arm
-- Description....: X48arm
--
himBH
13) Fixup Proview config script
logon to dev as pwrp
cd /home/pwrp/pwrsrc_4.8.6-3/src/tools/pwre/src/os_linux
cp pwre_configure.sh pwre_configure.sh.org
cd
geany /home/pwrp/pwrsrc_4.8.6-3/src/tools/pwre/src/os_linux/pwre_configure.sh
insert after line 311:
pwre_config_check_lib gtk GTK gtk gtk 0 "/usr/lib/arm-linux-gnueabihf/libgtk-x11-2.0.so"
pwre_config_check_include gtk GTK 1 "/home/pwrp/rpi/include/gtk-2.0/gtk/gtk.h"
as a sanity check, the code block should look like:
if test $pwre_hw == "hw_arm"; then
pwre_config_check_lib gtk GTK gtk gtk 0 "/usr/lib/arm-linux-gnueabihf/libgtk-x11-2.0.so"
pwre_config_check_include gtk GTK 1 "/home/pwrp/rpi/include/gtk-2.0/gtk/gtk.h"
pwre_config_check_include jni JNI 1 $jdk/include/jni.h
pwre_config_check_include jni JNI 0 $jdk/include/linux/jni_md.h
save and exit
pwre init v486_arm
pwre configure
need to figure out some paths, will use the output from "pwre configure" to help,
this is a little tedious:
geany /home/pwrp/pwrrls_4.8.6-3/pwre_arm_linux.cnf
find line "export pwre_conf_libgtk="
note the embedded command, e.g. "pkg-config --libs gtk+-2.0", designate as "cmd1"
find line "export pwre_conf_incdirgtk="
note the embedded command, e.g. "pkg-config --cflags gtk+-2.0", designate as "cmd2". the commands will now be run on the rpi:
ssh rpi3
execute cmd1:
pkg-config --libs gtk+-2.0
save the output in a new temp file, e.g. in geany
execute cmd2:
pkg-config --cflags gtk+-2.0
save the output to the temp file
exit from ssh session
in the temp file, replace "usr/include" with "home/pwrp/rpi/include"
in geany, open /home/pwrp/pwrsrc_4.8.6-3/src/tools/pwre/src/os_linux/pwre_configure.sh
find line "export pwre_conf_libgtk="
hard-code the contents of that assign to the output of cmd1, e.g.:
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
find line "export pwre_conf_incdirgtk="
hard-code the contents of that assign to the edited output of cmd2, e.g.:
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
find line "echo "export pwre_conf_lib=\"-lpthread -lm -lrt -lcrypt\"" >> $cfile"
add X11 and db5.1 libraries, e.g.:
echo "export pwre_conf_lib=\"-lpthread -lm -lrt -lcrypt -lX11 -ldb-5.1\"" >> $cfile
find line "echo "export pwre_conf_libdir=\"$conf_libdir\"" >> $cfile"
hard-code the assignment to:
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
find line "echo "export pwre_conf_incdir=\"$conf_incdir\"" >> $cfile"
hard-code the assignment to:
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
save the edited file
cd
mkdir pwrCustom
save the edited file (again) as ~/pwrCustom/pwre_configure.sh.custom
exit geany
14) Fixup Proview source tree
fix service start script:
cp /home/pwrp/pwrsrc_4.8.6-3/src/tools/pkg/deb_armel/pwrrt/pwr ~/pwrCustom
geany ~/pwrCustom/pwr
for each of the functions: pwr_start, pwr_stop, pwr_reload, pwr_kill:
replace the "whoami" conditional test from "root" to "pwrp"
if using an arduino uno, add the following line within the create_wrapper function, after the umask command:
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
save and exit
fix code error:
geany /home/pwrp/pwrsrc_4.8.6-3/sev/lib/sev/src/sev_db.cpp
add open curly brace on line 52:
else if ( type == sev_eDbType_Sqlite) {
add close curly brace after line 58.
code block should now look like:
if ( type == sev_eDbType_Mysql) {
  1. if defined PWRE_CONF_MYSQL
return sev_dbms::open_database();
  1. else
printf( "** Release is not built with mysql\n");
return 0;
  1. endif
}
else if ( type == sev_eDbType_Sqlite) {
  1. if defined PWRE_CONF_SQLITE3
return sev_dbsqlite::open_database();
  1. else
printf( "** Release is not built with sqlite3\n");
return 0;
  1. endif
}
else
return 0;
}
end example code block
save the edited file as:
~/pwrCustom/sev_db.cpp
exit geany
edit the build package script, it will not create a *.deb file as-is:
geany ~/pwrsrc_4.8.6-3/src/tools/pkg/deb_armel/pwrrt/build.sh
"# Create directories" section, insert line:
mkdir -p $pkgroot/usr/pwrp/adm/db
uncomment lines which copy op to cnf
uncomment lines which copy user to cnf
add following lines to "# Copy user to cnf" section:
cp $pwre_broot/$pwre_target/exp/inc/pwr_arduino_uno.ino $pkgroot/usr/pwrrt/cnf/user
cp $pwre_sroot/tools/pkg/deb/adm/proview_icon.png $pkgroot/usr/pwrrt/cnf/user
cp /home/pwrp/pwrCustom/Proview.desktop $pkgroot/usr/pwrrt/cnf/user
after the "# Copy user to cnf" section, insert the following lines:
  1. Copy user security data
mkdir -p $pkgroot/usr/pwrp/adm/db
cp $pwre_sroot/tools/pkg/deb/adm/pwr_user2.dat $pkgroot/usr/pwrp/adm/db
comment out line "dpkg-buildpackage -aarmel -b"
add following lines:
packagename=pwrrt-$version.tar.gz
tar -czf ../$packagename *
save the edited file as:
~/pwrCustom/build.sh
exit geany
geany ~/pwrCustom/fixPwrSource.sh
insert the following lines into the new file:
  1. !/bin/bash
  2. 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/
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/
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/
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
cp /usr/include/db.h /home/pwrp/pwrsrc_4.8.6-3/src/exe/rt_elog_dump/src
cp /usr/include/db.h /home/pwrp/pwrsrc_4.8.6-3/xtt/lib/xtt/src
cp /usr/include/db.h /home/pwrp/pwrsrc_4.8.6-3/xtt/lib/xtt/gtk
mkdir /home/pwrp/pwrsrc_4.8.6-3/wb/lib/wb/src/antlr
cp /home/pwrp/antlr-2.7.7/lib/cpp/antlr/* /home/pwrp/pwrsrc_4.8.6-3/wb/lib/wb/src/antlr
  1. fix code error
cp ~/pwrCustom/sev_db.cpp /home/pwrp/pwrsrc_4.8.6-3/sev/lib/sev/src/sev_db.cpp
  1. 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
  1. 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
  1. copy custom pwr service control script
cp ~/pwrCustom/pwr /home/pwrp/pwrsrc_4.8.6-3/src/tools/pkg/deb_armel/pwrrt/
save and exit
chmod 755 ~/pwrCustom/fixPwrSource.sh
geany ~/pwrCustom/Proview.desktop
insert the following lines into the new file:
[Desktop Entry]
Name=Proview
Comment=SCADA Operator Station
Exec=/home/pwrp/.xtt_start
Icon=proview_icon
Terminal=false
Type=Application
MimeType=text/plain
Categories=GTK
save and exit
15) Final cleanup
logon to dev as pwrp
delete /home/pwrp/pwrsrc_4.8.6-3 (and all contents)
delete everything from /home/pwrp/pwrrls_4.8.6-3, leaving the folder
unpack the source (again):
cd
tar -zxvf pwrsrc_4.8.6-3.2.tar.gz
16) Build Proview for raspberry pi
logon to dev as pwrp
cd
pwre list
pwre init v486_arm
./pwrCustom/fixPwrSource.sh
pwre create_all_modules
pwre import rt
pwre import java
pwre import op
pwre configure
./pwrCustom/fixPwrSource.sh
pwre ebuild rt
pwre ebuild op
pwre build tools/pkg deb_armel
note: to enable pkg rebuild (when make says nothing to do):
touch /home/pwrp/pwrsrc_4.8.6-3/src/tools/pkg/deb_armel/pwrrt/control


17) Install Proview runtime and op station on Raspberry Pi
logon to dev as pwrp
geany ~/pwrCustom/installRpi.sh
insert the following lines into the new file:
  1. !/bin/bash
  2. install Proview package on Raspberry Pi
  3. unpack the tarball
cd /home/pwrp/proview
tar -zxvf pwrrt-.tar.gz
chown -R pwrp:pwrp /home/pwrp/proview
  1. configure target dirs, install the archive
install -d -o pwrp -g pwrp /usr/pwrrt
install -d -o pwrp -g pwrp /usr/pwrrt/cnf
install -d -o pwrp -g pwrp /usr/pwrrt/cnf/op
install -d -o pwrp -g pwrp /usr/pwrrt/cnf/user
install -d -o pwrp -g pwrp /usr/pwrrt/exe
install -d -o pwrp -g pwrp /usr/pwrrt/lib
install -d -o pwrp -g pwrp /usr/pwrrt/load
install -d -o pwrp -g pwrp /pwrp
install -d -o pwrp -g pwrp /pwrp/arm_linux
install -d -o pwrp -g pwrp /pwrp/arm_linux/exe
install -d -o pwrp -g pwrp /pwrp/arm_linux/lib
install -d -o pwrp -g pwrp /pwrp/arm_linux/lis
install -d -o pwrp -g pwrp /pwrp/arm_linux/obj
install -d -o pwrp -g pwrp /pwrp/common
install -d -o pwrp -g pwrp /pwrp/common/db
install -d -o pwrp -g pwrp /pwrp/common/inc
install -d -o pwrp -g pwrp /pwrp/common/load
install -d -o pwrp -g pwrp /pwrp/common/log
install -d -o pwrp -g pwrp /pwrp/common/loghist
install -d -o pwrp -g pwrp /pwrp/common/web
install -d /usr/pwrp
install -d -o pwrp -g pwrp /usr/pwrp/adm
install -d -o pwrp -g pwrp /usr/pwrp/adm/db
install -d /usr/share/doc/pwrrt
install -D /home/pwrp/proview/etc/* /etc
install -D /home/pwrp/proview/etc/init.d/* /etc/init.d
install -D -m 644 /home/pwrp/proview/usr/pwrrt/cnf/proview.cnf /etc
install -D -o pwrp -g pwrp /home/pwrp/proview/usr/pwrrt/* /usr/pwrrt
install -D -o pwrp -g pwrp /home/pwrp/proview/usr/pwrrt/cnf/* /usr/pwrrt/cnf
install -D -o pwrp -g pwrp /home/pwrp/proview/usr/pwrrt/exe/* /usr/pwrrt/exe
install -D -o pwrp -g pwrp /home/pwrp/proview/usr/pwrrt/lib/* /usr/pwrrt/lib
install -D -o pwrp -g pwrp /home/pwrp/proview/usr/pwrrt/load/* /usr/pwrrt/load
install -D -o pwrp -g pwrp /home/pwrp/proview/usr/pwrrt/cnf/op/.??* /usr/pwrrt/cnf/op
install -D -o pwrp -g pwrp /home/pwrp/proview/usr/pwrrt/cnf/user/.??* /usr/pwrrt/cnf/user
install -D -o pwrp -g pwrp /home/pwrp/proview/usr/pwrp/adm/db/* /usr/pwrp/adm/db
install -D -m 644 /home/pwrp/proview/usr/share/doc/pwrrt/* /usr/share/doc/pwrrt
install -D -m 644 /home/pwrp/proview/usr/share/man/man1/* /usr/share/man/man1
install -D -o pwrp -g pwrp -m 775 /home/pwrp/proview/usr/pwrrt/cnf/user/.??* /home/pwrp
install -D -o pwrp -g pwrp -m 775 /home/pwrp/proview/usr/pwrrt/cnf/user/* /home/pwrp
install -D -m 644 /home/pwrp/proview/usr/pwrrt/cnf/user/proview_icon.png /usr/share/pixmaps
install -D -o pwrp -g pwrp -m 644 /home/pwrp/proview/usr/pwrrt/cnf/user/Proview.desktop /home/pwrp/Desktop
if [ -f /home/pwrp/pwr_arduino_uno.ino ]
then
install -d -o pwrp -g pwrp /home/pwrp/sketchbook
install -d -o pwrp -g pwrp /home/pwrp/sketchbook/pwr_arduino_uno
mv /home/pwrp/pwr_arduino_uno.ino /home/pwrp/sketchbook/pwr_arduino_uno
chown pwrp:pwrp /home/pwrp/sketchbook/pwr_arduino_uno/pwr_arduino_uno.ino
fi
save and exit
scp /home/pwrp/pwrrls_4.8.6-3/os_linux/hw_arm/bld/pkg/pwrrt-.tar.gz pwrp@rpi3:~/proview
scp /home/pwrp/pwrCustom/installRpi.sh pwrp@rpi3:~/
ssh rpi3
cd
chmod 775 installRpi.sh
sudo ./installRpi.sh
sudo update-rc.d pwr defaults
exit (from ssh session)
18) create proof-of-concept Proview project
logon to dev as pwrp
one-time fix so plc prog will build:
mkdir /home/pwrp/pwrrls_4.8.6-3/os_linux/hw_x86_64
mkdir /home/pwrp/pwrrls_4.8.6-3/os_linux/hw_x86_64/exp
mkdir /home/pwrp/pwrrls_4.8.6-3/os_linux/hw_x86_64/exp/exe
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
end one time fix
on the desktop, double-click Proview V4.8
accept (and respect) the license terms
using "PwR Project List":
enter edit mode
add a BaseReg object, child to Bases
open the new object, set attributes:
ObjectName: BaseV48arm
Version  : X48arm
Path  : /home/pwrp/pwrrls_4.8.6-3
close the object
save changes
note: the new base define is reflected as a new line in /usr/pwrp/adm/db/pwr_projectlist.dat
the binding to the release build's path is via the "X48arm" token, which will be used below
add a $Hier object, sibling to Bases
set ObjectName attribute = "testProjects"
add a ProjectReg object, child of testProjects
open new object, set attributes:
ObjectName : piPOC
Description: Raspberry Pi Proof of Concept
Version  : X48arm
(note: Version attr binds the project to the BaseV48arm)
close the object
save changes
Confirm Actions: Yes
note: the new project is reflected as a new directory tree at /usr/local/pwrp/pipoc
leave edit mode
right-click piPOC, pick Open Project
using "Configure Directory Volume":
enter "Production QBUS id" = 5 (this is arbitrary, but better than using defaults, for troubleshooting)
click Next
click Next
click No
click Next
click Next
click Skip this node
click Next
click Yes
using "Configure Root Volume":
pick Operator Station
click Next
click Next
click Next
using "PwR VolPipoc, pwrp on pipoc":
from the drop-down menu, pick "File | Volume Attributes..."
change the "OperatingSystem" attribute to "CustomBuild"
close the object
save changes
close the window
using "PwR Directory, pwrp on pipoc":
enter edit mode
open pipoc object, set attributes:
NodeName  : rpi3 (i.e. the hostname of the target rpi)
OperatingSystem: CustomBuild
BootNode:  : rpi3
Address  : 192.168.0.1 (i.e. the IPv4 address of the rpi)
close the object
add a CustomBuild object as child to pipoc
open the new object, set attributes:
ObjectName  : build
cc  : /usr/bin/arm-gcc
cxx  : /usr/bin/arm-g++
ar  : /usr/bin/arm-ar
OperatingSystem: Linux on ARM
Platform  : arm_linux
Release  : X48arm
close the object
save changes
leave edit mode
right-click "VolPipoc", pick Open Volume
using "PwR VolPipoc, pwrp on pipoc":
enter edit mode
in the right pane, delete the Maintenance object
in the right pane, delete the OpDefault object
in the right pane, delete the WebHandler object
in the right pane, delete the WebBrowser object
add a XttGraph object as child to Op
set ObjectName to Display1
open Op object, set attributes:
UserName  : pwrp
FastAvail[0]  : Nodes-Pipoc-Op-Display1
close the object
in the center pane, add a $PlantHier object
set ObjectName to Bakery
add a $PlantHier, child to Bakery
set ObjectName to Signals
add two Iv objects as children of Signals
set ObjectName's to Iin and Iout, respectively
add a PlcPgm object as child of Bakery
set ObjectName to Plc
save changes
leave edit mode
right-click Bakery-Plc, pick Open Program
using "Bakery-Plc"
enter edit mode
add a GetIv object
add a StoIv object
connect the GetIv output to the StoIv input
from drop-down menu, pick "View | Palette | Plant". Using the right-pane
plant hierarchy:
Connect (bind) Signals-Iin to GetIv
Connect (bind) Signals-Iout to StoIv
save changes
leave edit mode
close the window
using "PwR VolPipoc, pwrp on pipoc":
right click Nodes-Op-Display1
pick "Open Ge..."
using "PwR Ge display1"
add two ValueInputMedium objects
record the coordinates for the area to display, i.e. the area which contains the two objects
from the drop-down menu, pick "File | Graph Attributes"
enter the x & y coordinates for this display area
close the object
double-click one of the ValueInputMedium objects, set attribute:
Value.Format  : %6d
close object
repeat for the other Input object
View "Plant Hierarchy", select Bakery-Signals-Iin
press Ctrl key, double-click on first ValInpMed object (binds signal to object)
repeat, bind Iout to other display object
pick "File | Save"
close the window
using "PwR VolPipoc, pwrp on pipoc":
from drop-down menu, pick "Functions | Build Node"
example output as shown in "Proview Development Console":
Setting base /usr/pwr48
Open pipoc
args: pipoc pwrp pwrp
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
Welcome to
pipoc V4.8 Raspberry Pi Proof of Concept
Revision history
2013-03-09 pwrp Project created
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
-- Processing line: 50
-- Building volume directory
-- Opening volume 'VolPipoc'
Berkeley DB 5.1.29: (October 25, 2011)
info get: 0
-- Build node pipoc
-- Plc window generated Bakery-Plc-W
/home/pwrp/pwrrls_4.8.6-3 is baseroot
Setting base /home/pwrp/pwrrls_4.8.6-3
-- Cross compilation ARM_LINUX
-- Plc window compiled for arm_linux optimized -O3 Bakery-Plc-W
/home/pwrp/pwrrls_4.8.6-3 is baseroot
Setting base /home/pwrp/pwrrls_4.8.6-3
-- Cross compilation ARM_LINUX
-- Plc plcpgm compiled for arm_linux optimized -O3 Bakery-Plc
-- Web startpage generated $pwrp_web/index.html
/home/pwrp/pwrrls_4.8.6-3 is baseroot
Setting base /home/pwrp/pwrrls_4.8.6-3
-- Cross compilation ARM_LINUX
-- Building archive for volume: 000_001_001_001
-- Archive built for volume: 000_001_001_001
-- Working with load file volume 'VolPipoc'...
-- Open file...
-- Successfully created load file for volume 'VolPipoc'
-- 26 objects with a total body size of 26392 bytes were written to new file.
-- Creating bootfile for node rpi3
-- Plc thread generated priority 22, scantime 0.10000 s, 1 plcpgm's
/home/pwrp/pwrrls_4.8.6-3 is baseroot
Setting base /home/pwrp/pwrrls_4.8.6-3
-- Cross compilation ARM_LINUX
-- Plc process compiled for arm_linux optimized -O3 Dummy
/home/pwrp/pwrrls_4.8.6-3 is baseroot
Setting base /home/pwrp/pwrrls_4.8.6-3
-- Cross compilation ARM_LINUX
-- Plc program linked for arm_linux node plc_rpi3_0005_plc
-- Build node pipoc
end example output
from drop-down menu, pick "Functions | Distribute"
using "Distributor":
select rpi3
from the drop-down menu, pick "Functions | Distribute"
example output in "Proview Development Console":
pwrp_pkg_rpi3_0001.tgz 100% 1705KB 1.7MB/s 00:00
-- No package installed
-- Installing package pwrp_pkg_rpi3_0001.tgz
-- Unpack package pwrp_pkg_rpi3_0001.tgz
-- Move files to target directories
sudo: no tty present and no askpass program specified
end example output
there will be some warnings in Workbench Messages re missing files, ignore these
exit from the Proview development environment (close all windows in reverse order of opening them)
19) run the test project
connect to rpi3 via vnc client
nano ~/.xtt_start
edit the rt_xtt invoke to launch the operator station:
$pwr_exe/rt_xtt Nodes-Pipoc-Op &
save changes and exit
sudo nano /etc/proview.cnf
edit the qcomBusId to 5
save changes and exit
sudo shutdown -r now
(so the pwr service will pick up the new bus ID)
connect to rpi3 via vnc client
start the op station:
double-click the Proview desktop icon
launch Display1
verify manually entering a value in Iin is copied to Iout
verify manually entering a value in Iout is overwritten by value in Iin
verify status is green
note: to reset runtime from an abend:
source pwr_stop.sh
---------------------------------------------------------------------------------------------------
OK, proof of concept works, let's have another pi do some I/O
after all, what good is a SCADA system without I/O?
---------------------------------------------------------------------------------------------------
20) Build another rpi (nobody can have just one!), hostname rpi2
install base OS (item 8 above)
config new pi for ssh (item 9 above)
install Proview (item 17 above)
sudo nano /etc/proview.cnf
edit the qcomBusId to 5
save changes and exit
21) configure rpi2 for arduino
login to rpi2 as pwrp
connect the arduino device
sudo apt-get install arduino
launch arduino
pick "Tools | Board | Arduino Uno"
pick "Tools | Serial Port | /dev/ttyACM0"
pick "File | Sketchbook | pwr_arduino_uno"
in sketch, verify debug assignment is 0
verify baudRate is 19200
upload sketch to the arduino
note: due to the bizarre handling of serial in Linux (i.e. raw, cooked, much interference by software layers, etc.),
the following config is needed prior to starting the pwr runtime:
stty -F /dev/sttyACM0 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
this config is included in the "pwr" service start script as per edits in sections above.
(as a side note, if the Uno is connected to a virtual machine via VirtualBox, if you bind the Uno device from the (Windows) host
to the VM using USB and not COM, then things seem to work in Proview debug runtime. Again, the stty config needs to be run prior to runtime start.)
22) Update Proview project
logon to dev as pwrp
launch Proview
using "PwR Project List"
from the menu, pick "File | Open | GlobalVolumeList"
using "PwR Global Volume List"
enter edit mode
add a VolumeReg object as sibling of VolPipoc
open object, set attributes:
ObjectName  : VolPipoc2
Description  : 0.1.1.2 pipoc
VolumeId  : _V0.1.1.2
Project  : pipoc
close the object
save changes
leave edit mode
close the window
using "PwR Project List"
open PiPOC project
enter edit mode
add a RootVolumeConfig object as sibling of VolPipoc
open object, set attribute:
ObjectName  : VolPipoc2
close the object
add a NodeConfig object as sibling to pipoc
open object, set attributes:
ObjectName  : pipoc2
NodeName  : rpi2 (i.e. the hostname of the target rpi)
OperatingSystem: CustomBuild
BootNode:  : rpi2
Address  : 192.168.0.2 (i.e. the IPv4 address of the rpi)
close the object
add a CustomBuild as child to pipoc2
open object, set attributes:
ObjectName  : build
cc  : /usr/bin/arm-gcc
cxx  : /usr/bin/arm-g++
ar  : /usr/bin/arm-ar
OperatingSystem: Linux on ARM
Platform  : arm_linux
Release  : X48arm
close the object
open pipoc2's RootVolumeLoad object, set attribute:
ObjectName  : VolPipoc2
close the object
save changes
click Yes to "Do you want to create this Volume?"
leave edit mode
right click VolPipoc2, pick OpenVolume
using "Configure Root Volume"
pick "Operator Station"
click Next
click Next
click Next
using "PwR VolPipoc2, pwrp on pipoc"
enter edit mode
from the drop-down menu, pick "File | Volume Attributes..."
change the "OperatingSystem" attribute to "CustomBuild"
close the object
in the right pane, delete the Maintenance object
in the right pane, delete the OpDefault object
in the right pane, delete the WebHandler object
in the right pane, delete the WebBrowser object
add a XttGraph object as child to Op
set ObjectName to Display2
open Op object, set attributes:
UserName  : pwrp
AutoStart[0]  : Nodes-Pipoc2-Op-Display2
FastAvail[0]  : Nodes-Pipoc2-Op-Display2
close the object
add a Arduino_USB object as child of Pipoc2
open object, set attributes:
ObjectName  : Arduino
close object
add a Arduino_Uno object as child of Arduino
open object, set attributes:
ObjectName  : Uno1
Device  : /dev/ttyACM0
BaudRate  : 19200
close object
add a ChanAi object as child of Uno1
open object, set attributes:
ObjectName  : Ai0
Number  : 0
RawValRangeLow  : 0
RawValRangeHigh  : 1023
ChannelSigValRangeLow  : 0
ChannelSigValRangeHigh : 5
SensorSigValRangeLow  : 0
SensorSigValRangeHigh  : 5
ActValRangeLow  : 0
ActValRangeHigh  : 1023
close object
add a ChanDo object as child of Uno1
open object, set attributes:
ObjectName  : Do2
Number  : 2
close object
add a ChanDi object as child of Uno1
open object, set attributes:
ObjectName  : Di4
Number  : 4
close object
in the center pane, add a $PlantHier object
set ObjectName to Bakery2
add a $PlantHier object, child to Bakery2
set ObjectName to Signals
add an Ai object as child of Signals
open object, set attributes:
ObjectName  : Ai0
SigChanCon  : Nodes-Pipoc2-Arduino-Uno1-Ai0
close object
add a Di object as child of Signals
open object, set attributes:
ObjectName  : Di4
SigChanCon  : Nodes-Pipoc2-Arduino-Uno1-Di4
close object
add a Do object as child of Signals
open object, set attributes:
ObjectName  : Do2
SigChanCon  : Nodes-Pipoc2-Arduino-Uno1-Do2
close object
add a PlcPgm object as child of Bakery2
set ObjectName to Plc2
save changes
leave edit mode
right-click Bakery2-Plc, pick Open Program
using "Bakery2-Plc2"
enter edit mode
save changes (there are none - but we need the sub-window to exist)
leave edit mode
close the window
using "PwR VolPipoc, pwrp on pipoc":
right click Nodes-Op-Display2
pick "Open Ge..."
using "PwR Ge display2"
add one ValueInputMedium object
add two ValueMedium objects
note the coordinates for the area to display
from the drop-down menu, pick "File | Graph Attributes"
enter the x & y coordinates for display area noted above
close the object
double-click the ValueInputMedium object, set attribute:
Value.Format  : %6d
close object
repeat for the first ValueMedium object
repeat with %6.2f for other ValueMedium object
View Plant Hierarchy, select Bakery2-Signals-Do2
press Ctrl key, double-click on ValueInputMedium object
note: this connects the display object to the target plant signal
repeat, connect Di4 to ValMed, connect Ai0 to other ValMed
pick "File | Save"
close the window
using "PwR VolPipoc2, pwrp on pipoc":
from drop-down menu, pick "Functions | Build Node"
from drop-down menu, pick "Functions | Distribute"
using "Distributor":
select rpi2
from the drop-down menu, pick "Functions | Distribute"
exit from the Proview development environment (close all windows)
23) use the Arduino
connect to rpi2 via VNC X window
restart the runtime:
sudo service pwr restart
hint: if problems, then to get some diagnostics:
cd
source pwr_stop.sh
rt_ini -i &
ps -ef | grep rt
edit ~./.xtt_start to launch the operator station windows:
  1. !/bin/bash
source /etc/pwrp_profile
$pwr_exe/rt_xtt Nodes-Pipoc2-Op &
save changes and exit
double-click the Proview desktop icon
in Display2, the analog in value will vary slightly due to noise (unless you have connected a pot or some signal to it)
experiment with the Di and Do values
finish
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox