User Tools

Site Tools


cammos-rpi-displays

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
cammos-rpi-displays [2015/04/08 17:37] snargcammos-rpi-displays [2015/06/22 11:57] (current) snarg
Line 6: Line 6:
   - Load the img onto an sd card (using dd on linux or Win32DiskImager on windows).   - Load the img onto an sd card (using dd on linux or Win32DiskImager on windows).
   - Boot up your raspberry pi, and load a terminal.   - Boot up your raspberry pi, and load a terminal.
 +
 +==== Change default password ====
 +The default password for the "pi" user on Raspbian is "raspberry". Type the following to change it.<code>sudo passwd pi</code>
 +
 +==== Change keyboard layout to US ====
 +  - Type this:<code>sudo nano /etc/default/keyboard</code>
 +  - Then find where it says<code>XKBLAYOUT=”gb”</code>
 +  - Change to<code>XKBLAYOUT=”us”</code>
 +  - Save and exit.
 +
 +==== Static IP instructions====
 +This is optional, samba and vnc will work fine on DHCP settings.
 +
 +  - Type this to change the network settings:<code>sudo nano /etc/network/interfaces</code>
 +  - Comment out the line:<code>iface eth0 inet dhcp</code> by adding a “#” to the start
 +  - Add the following making sure you change the IP  address for the different PI<code>#Section added for Static IP
 +
 +auto eth0
 +
 +iface eth0 inet static
 +#(Change to the IP you require)
 +address 10.106.228.231
 +gateway 10.106.224.250
 +netmask 255.255.248.0
 +network 10.106.228.0
 +broadcast 10.106.231.255</code>
 +  - Save and exit nano.
 +  - Restart new network configuration by typing the following:<code>sudo /etc/init.d/networking restart</code>
  
 ==== SAMBA instructions:==== ==== SAMBA instructions:====
 +Note this is only useful if the rpi is going to be located on the same LAN as the computer that will be uploading files to it. Alternately openssh-server can be used with no further changes (ie filezilla or winscp from windows) as this is pre-installed and working by default on Raspbian.
   - type this to install samba server:<code>sudo apt-get install samba</code>   - type this to install samba server:<code>sudo apt-get install samba</code>
   - edit the smb.conf with this: <code>sudo nano /etc/samba/smb.conf</code>   - edit the smb.conf with this: <code>sudo nano /etc/samba/smb.conf</code>
Line 21: Line 50:
   - Create the directory referenced by that share with:<code>mkdir /home/pi/sampleshare</code>   - Create the directory referenced by that share with:<code>mkdir /home/pi/sampleshare</code>
   - Restart samba with:<code>sudo /etc/init.d/samba restart</code>   - Restart samba with:<code>sudo /etc/init.d/samba restart</code>
-  - +
 ==== Autostarting firefox/iceweasel ==== ==== Autostarting firefox/iceweasel ====
   - Type this to install iceweasel: <code>sudo apt-get install iceweasel</code>   - Type this to install iceweasel: <code>sudo apt-get install iceweasel</code>
Line 42: Line 71:
   - Press F11 to go fullscreen (this setting will be remembered between reboots).   - Press F11 to go fullscreen (this setting will be remembered between reboots).
   - Close firefox/iceweasel (to make sure settings get saved) and reboot the raspberry pi to test.   - Close firefox/iceweasel (to make sure settings get saved) and reboot the raspberry pi to test.
 +
 +==== Switching on Tab Mix Plus Tab Slideshow after bootup ====
 +There seems to be no setting to have slideshow mode active by default on start. To solve this we'll script xdotool to send the CTRL+F9 keystroke to firefox after it has loaded. Note: for this to work, you need to have completed setting this keybinding in the instructions above for Setting up Tab Mix Plus.
 +  - Install xdotool:<code>sudo apt-get install xdotool</code>
 +  - Create a script with:<code>nano activate_slideshow.sh</code>
 +  - Paste the following commands into the script:<code>#!/bin/bash
 +
 +# delay to let firefox/iceweasel load
 +sleep 120
 +
 +#find what windowID firefox/iceweasel is using
 +WID=`xdotool search "Iceweasel" | head -1`
 +
 +#activate the window
 +xdotool windowactivate --sync $WID
 +
 +#send CTRL+F9 to it to start the tab slideshow feature of tab mix plus
 +xdotool key "ctrl+F9"</code>
 +  - Make the script executable with:<code>chmod +x activate_slideshow.sh</code>
 +  - Edit the LXDE autostart file:<code>nano ~/.config/lxsession/LXDE-pi/autostart</code>
 +  - Add the following line to the end:<code>~/activate_slideshow.sh</code>
 +
 +==== Alternative to tab mix plus tab slideshow ====
 +This method for rotating the tabs gives more flexibility to script PGDOWN keystrokes etc to scroll multiple PDF pages. Do this *instead* of the above CTRL+F9 method.
 +Note: we use xte from xautomation package for keystroke events on RPI debian wheezy instead of xtotool, because xtotool on latest Raspbian seems to have a 100% cpu openbox bug. We use xtotool only to activate focus on the correct window.
 +  - Install xdotool and xautomation:<code>sudo apt-get install xdotool xautomation</code>
 +  - Create a script with:<code>nano manual_tab_slideshow.sh</code>
 +  - Paste the following commands into the script:<code>#!/bin/bash
 +
 +#initial delay while iceweasel loads
 +sleep 120
 +
 +
 +#find what windowID firefox/iceweasel is using
 +WID=`xdotool search "Iceweasel" | head -1`
 +
 +while true
 +do
 +        # delay for reading the page
 +        sleep 20
 +
 +        #activate the window
 +        xdotool windowactivate --sync $WID
 +        #Page down
 +        xte 'key Page_Down'
 +
 +
 +        #delay for reading the page
 +        sleep 20
 +
 +        #activate the window
 +        xdotool windowactivate --sync $WID
 +        #Home to go back to top of current tab
 +        xte 'key Home'
 +        #ctrl+tab to go to next tab
 +        xte 'keydown Control_L'
 +        xte 'key Tab'
 +        xte 'keyup Control_L'
 +done</code>
 +  - Make the script executable with:<code>chmod +x manual_tab_slideshow.sh</code>
 +  - Edit the LXDE autostart file:<code>nano ~/.config/lxsession/LXDE-pi/autostart</code>
 +  - Add the following line to the end:<code>~/manual_tab_slideshow.sh</code>
 +
 +==== Setting firefox to auto load tabs after crash without confirmation ====
 +If the Raspberry pi is unsafely shut down (ie power pulled), firefox will come back with a crash recovery page. This increases the maximum number of "crashes" before this is displayed.
 +   - go to about:config in the address bar, press "I'll be careful"
 +   - Search for browser.sessionstore.max_resumed_crashes and set it to 100
  
 ==== VNC instructions ==== ==== VNC instructions ====
Line 48: Line 144:
   - Enter password twice, enter to store in default location, then CTRL+C to quit x11vnc after its fired up.   - Enter password twice, enter to store in default location, then CTRL+C to quit x11vnc after its fired up.
   - Type the following to edit the autostart file (make sure the directory exists first)<code>nano ~/.config/lxsession/LXDE-pi/autostart</code>   - Type the following to edit the autostart file (make sure the directory exists first)<code>nano ~/.config/lxsession/LXDE-pi/autostart</code>
-  - Add the line:<code>@x11vnc -forever -usepw</code>+  - Add the line:<code>@x11vnc -forever -usepw -shared</code>
   - Save and exit.   - Save and exit.
   - Reboot and test.   - Reboot and test.
Line 60: Line 156:
 ==== Turning off screen blanking ==== ==== Turning off screen blanking ====
   - Type the following to edit the autostart file (make sure the directory exists first)<code>nano ~/.config/lxsession/LXDE-pi/autostart</code>   - Type the following to edit the autostart file (make sure the directory exists first)<code>nano ~/.config/lxsession/LXDE-pi/autostart</code>
-  - Add the lines:<code>@xset s off +  - Add the lines:<code>xset s off 
-@xset -dpms</code>+xset -dpms</code>
   - Save and exit.   - Save and exit.
   - Reboot and test.   - Reboot and test.
 +
 +==== How to run a cron job every 5 minutes ====
 +
 +
 +To edit the crontab, use the command <code>crontab -e</code> This uses the editor specified in the environment variable$EDITOR, and if the variable is empty, this defaults to nano
 +
 +The format of a crontab is 6 columns, space (or tab) separated. The first 5 columns detail the time when to run a command, which is specified in the last column. The last "column" makes up all the remaining characters, inclusive of spaces. Here is an example:
 +<code>5 * * * * /home/aspera/my_script.sh</code>
 +
 +What the above shows, per column:
 +  - Minute to run on, a value of 0-59: 5 means on the 5th minute of the hour
 +  - The Hour, a value of 0-23: * means every hour
 +  - Day of the Month, 1-31: * means every day of the month
 +  - The Month, 1-12: * means every month
 +  - Day of the Week, 0-7 (0 and 7 are both Sunday): * means every day
 +  - The Command: In this case, a command at /home/aspera/my_script.sh
 +
 +With older crontabs, like the one on legacy Solaris, this is mostly all that can be done. One variation is to use comma separated lists. Modern crontabs can use string names for days, and wildcards with increments. So, to create an entry that runsmy_script.sh every 5 minutes would be as follows on Linux:
 +<code>*/5 * * * * sudo mount -a</code>
 +
 +The */5 notation in the first column means "every 5 minutes". To make this every 10 minutes, */10 is used.
 +
 +==== Remotely checking to see what screen connector is active ====
 +
 +the command to see the status of displays and resolution in Xorg is "xrandr". Remoting in with vnc or on the device itself, xrandr by itself will be enough. From an ssh session xrandr needs to know which display server to query, as the shell isnt a child of the Xorg process:
 +<code>DISPLAY=:0.0 xrandr</code>
  
cammos-rpi-displays.1428485835.txt.gz · Last modified: 2015/04/08 17:37 by snarg