Coder Social home page Coder Social logo

mirror's Introduction

Running the code on a Raspberry Pi

  • Install the following on the Raspberry Pi:

    • Flask webserver (sudo pip install flask)
    • Chromium web browser
  • In the app.js, set your credentials to retrieve weather and calendar information:

  • Languages can be changed in app.js (assuming they are supported) here:

    • var langOptions = ['en', 'fr', 'sw'];
  • Autostart the web application, the motion detection script and chromium in kiosk mode by editing ~/.config/lxsession/LXDE-pi/autostart as follows:

@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
@xscreensaver -no-splash

@xset s off
@xset -dpms
@xset s noblank
@sudo /usr/bin/python /home/pi/Programming/mirror/motion/motion.py
@sudo /usr/bin/python /home/pi/Programming/mirror/webapp/app.py
@sed -i 's/"exited_cleanly": false/"exited_cleanly": true/' ~/.config/chromium/Default/Preferences
@sed -i 's/"exit_type": "Crashed"/"exit_type": "None"/' ~/.config/chromium/Default/Preferences
@chromium-browser --noerrdialogs --kiosk http://localhost:5000 --no-first-run --touch-events=enabled --fast --fast-start --disable-popup-blocking --disable-infobars --disable-session-crashed-bubble --disable-tab-switcher --disable-translate

Operations

  • If for some reason you get logged off Google, you'll need to authenticate again for which you'll need to interact with your Pi's GUI. This can be challenging if you don't have a mouse or keyboard connected to it.
    • Install xrpd on the Pi
    sudo apt-get install xrdp
    
    • Edit ~/.config/lxsession/LXDE-pi/autostart and comment the following line (that's because Chromium only opens in one session at a time):
    @chromium-browser --noerrdialogs --kiosk http://localhost:5000 --no-first-run --touch-events=enabled --fast --fast-start --disable-popup-blocking --disable-infobars --disable-session-crashed-bubble --disable-tab-switcher --disable-translate
    
    • Reboot the Pi
    • From a computer on the same LAN, Remote connect to the Pi's IP
    • Enter your user credentials (the keyboard layout can be different)
    • Open Chromium and go to localhost:5000
    • Click the login button and enter your google credentials
    • Log out the remote session
    • Uncomment the above line in ~/.config/lxsession/LXDE-pi/autostart and reboot

mirror's People

Contributors

avanobberghen avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.