Monday, February 3, 2014

Using Raspberry Pi for Webview

I've been asked to write up a step by step for using a Raspberry Pi (RPi) computer as an Active911 Webview monitor.

- I purchased a Raspberry Pi computer from Amazon.

- This also needs an operating system.  I bought a 32 GB SD card from Staples and then downloaded the NOOBS image.  Step by step instructions for doing this are at:

- Once that was done, I downloaded the Chromium browser and installed it onto the machine. It seems to be a better browser for handling Active911 Webview.

- Launch Chromium and enter the Registration Code for your Webview session.  This saved it so when I launch it in kiosk mode, it simply logs in.

Now I needed to do some configuring so I can boot the RPi and have it launch Chromium in kiosk mode and not have the screen saver come on (I am connected to a 1080i monitor via an HDMI cable for all of this).

- Enter the following code into a terminal window:

$ sudo nano /etc/lightdm/lightdm.conf

# add the following lines to the [SeatDefaults] section
# don't sleep the screen
xserver-command=X -s 0 dpms
This essentially turns off the screen saver.

Now, you need to set it up to launch Chromium at boot and load the Active911 client.

- Enter the following code:

$ sudo nano /etc/xdg/lxsession/LXDE/autostart 

# comment everything and add the following lines

@xset s off
@xset -dpms
@xset s noblank
@chromium-browser --kiosk
This will launch Chromium about 30 seconds after the computer boots and loads LXDE (the desktop).  You can bypass the entire LXDE session and load Chromium direct but that did not matter to me.

Note, if you want to get out of Kiosk mode, you hit "alt F4" on your keyboard (that's function key 4).

My last problem was some rather thick black lines on all 4 sides of the screen. In other words, there was wasted space due to underscan.  I wanted to fix this.  This is a trial and error process.

- Step 1is to make sure the RPi boots to the same resolution my monitor supports (1920 x 1080).  Launch a terminal window and type:

$ sudo nano /boot/config.txt

Now find the following section of code that is commented out and un-comment it and change it to the resolution you want to use:


I changed mine to read:


- Now you need to adjust the black lines and here is where the trial and error comes in.

Go back to the confix.txt page in a terminal window:

$ sudo nano /boot/config.txt
Now, scroll down until you find the following section:


Your number may be different.  However, to make less black space, you want smaller numbers.  Mine ended up being -60 for each of the overscan settings.  You change them, save the file and then need to re-boot to see your changes.  Took me around 6 tries before I got it to a point I was happy.

UPDATE 02/22/2014:

Next issue was connecting the RPi to a VGA only monitor.  There are HDMI to VGA converter cables out there but after doing some research, most of those draw more power than the RPi can reliably put out of the HDMI port - eventually frying something.  I went with a powered HDMI to VGA converter box, per the recommendation of the RPi forums:

In addition, after doing research on RPi power draws, I decided to ditch the cell phone charger I was using for the power supply and upgrade to a real power supply that could handle the draw the RPi needs:

Hope this helps. Feel free to leave a comment if you find any errors with this tutorial or have other suggestions!


  1. Thanks for the info! I have been using a Pi for a while here, currently I have one reading the serial output from my Peet Bros weather station and updating the CWOP network. This will be great addition for our unmanned station just south of you in Manitou Springs, CO. I have it running here at home and seems to work great. I would like to add sound and or triggers so I can activate a relay for lights or play an MP3 for an alarm.

    BTW, I have a station monitor running on the Arduino platform that monitors temps and AC power at the station for alarms. I'll run the Pi off a dedicated 5V bus that's run off a 12V AGM battery for availability during an outage. I got a 22" Samsung TV with HDMI input (1080x1920) that runs off of 14VDC, so I'll get it working off the backup system as well.

  2. Thanks Chad! Awesome tutorial. Helped me setup a neighboring departments system.

  3. Out of curiosity why did you switch from HDMI to VGA? Was this due to the monitor had VGA only, or was there an issue with HDMI use?

    1. The big monitor we are using is very old and does not have an HDMI input on it. Our only option was VGA.

  4. A few things I had to change with the newest version of wheezy. I did not use noobs. I just downloaded the latest wheezy image for raspberry pi 2. I also expanded the file system to use the entire sd card and overlclocked it to the PI2 setting in raspi-config and it has been very stable.

    Had to change sudo nano /etc/xdg/lxsession/LXDE/autostart
    to sudo nano /etc/xdg/lxsession/LXDE-pi/autostart in order for the autostart to work. I also found that you have to change the autostart function in the raspi-config options then change the autostart file or it overwrites the changes you make.

    The only other thing I do is every time I start a pi project is make sure it is up to date with sudo apt-get update and sudo apt-get upgrade. your guide was easy to understand. It is a lot easier to just start the gui and run chromium then trying to run chromium or another browser stand alone. The raspberry pi 2 has enough power now that you do not have to worry about slowing it down compared to older versions.

    1. There may be one small change with the RPI 3... I found that modifying the autostart for both /etc/xdg/lxsession/LXDE/autostart and /etc/xdg/lxsession/LXDE-pi/autostart did not work. The workaround I found for our RPI's was to sudo nano /home/pi/.config/lxsession/LXDE-pi/autostart

      It worked fine after that.

      Also, installing chromium-browser is a little more complicated on the RPI3, even if you do sudo apt-get update and sudo apt-get upgrade. Following this how-to will get it to work though:

      Hope that helps! Chad, thanks for this!

  5. I have a raspberry pi and active911 running in webview. I have the chrome browser and raspberry pi scheduled to reboot every morning just to mitigate any potential connection issues that may surface during the day or if we lose connection to active 911 (which has happened). One problem that I have is that the map doesn't auto-position itself over our area...but rather positions itself over our city station which is about 20 miles away. I'm thinking its a geolocation issue that my raspberry pi doesn't know where it's located... Anyone have any thoughts on how I would fix?

  6. I was wondering if anyone could please advise me on how to store the registration code. Right now with kiosk mode running it will load the Webview login screen and entering the code gets it going but the problem is if it is rebooted it doesn't hold the code and a manual login is required again. Any help would be greatly appreciated.

  7. Same problem... Doesn't hold the device code when rebooting. Anybody figure this out?

  8. We just set up a PI Zero W at the station. It holds the device code just fine, as long as you have "save passwords" configured in Chromium. It should be under the settings. The issue/question that I have is, if we set up to open the Chromium browser in Kiosk mode, and we have the "home page" set for, already in the browser, is there really a need to specify the web address in the chromium configuration line? I am experiencing issues with Webview losing connection and not being able to re-establish until I reboot the PI.

  9. Can anyone help me to get Webview to autostart in chromium on RPI 3b+? I've tried all variations and strategies in this post/comments. Thank you.