Skip to content

Latest commit

 

History

History
80 lines (79 loc) · 3.9 KB

iScape-Raspberry-Setup.md

File metadata and controls

80 lines (79 loc) · 3.9 KB

iScape interactive Quiz documentation

Adding or editing questions

All the questions and their details (answers, images, tips, how dangerous) are stored in src/data/ and as a single file for each language or location.

See this file for example:
https://github.com/fablabbcn/iscape-air-pollution-quiz/blob/express/src/data/en.js

There is also a helper file for translations here

Example:
If you select the first suggestion in a question:
"I live in a house near a busy highway"
You get the first item from the results:
‘Pollution is typically higher’,
and the first image, the first tip etc.

If you need to add a question, we recommend you copy and paste a question and then edit it, to make sure that all the commas and curly braces are intact. A single question is everything inside, along with the curly braces {}

When you are done, you can make a Pull request on Github, and we will review it and put it in production.

Setup the Raspberry Pi for offline mode

This will list the steps needed to make a normal Raspberry Pi run and auto play the iScape quiz offline.

  1. Make sure you have a Raspberry Pi with the Raspbian OS

  2. Install required software
    cd
    git clone https://github.com/fablabbcn/iscape-air-pollution-quiz
    curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
    export NVM_DIR="$HOME/.nvm"
    nvm install 8
    cd iscape-air-pollution-quiz
    nvm use 8
    npm i

  3. Start the quiz locally automatically on reboot.
    Add the following line to the bottom of.bashrc
    cd iscape-air-pollution-quiz/ && npm run logger &

  4. Start a browser in full screen
    Edit .config/lxsession/LXDE-pi/autostart and make sure it has the following:

    #@xscreensaver -no-splash
    @xset s noblank
    @xset s off
    @xset -dpms
    @point-rpi
    @/usr/bin/chromium-browser --incognito --kiosk http://localhost:3000

    This disables the screensaver and blank screen and starts it in full screen ‘kiosk’ mode.

  5. Reboot the kit

Using an RTC clock for offline mode

https://learn.adafruit.com/adding-a-real-time-clock-to-raspberry-pi/set-rtc-time

  • Enable i2c on the Pi
  • Add dtoverlay=i2c-rtc,pcf8523 to /boot/config.txt

Retrieve log files

The log files should be at ~/log.txt

They are in the format:

  • StartDate, EndDate, TotalExposure, Each questions Guess [0 or 1]

FAQ

  • The site does not load right away.
    • This is normal. It takes time to start the whole app on a Raspberry Pi. It will load within a minute.
  • Black border around screen on Raspberry Pi. This can happen on some TV screens or monitors.