GithubHelp home page GithubHelp logo

lxsession's Introduction

Running Raspberry Pi in Kiosk Mode

This tutorial will guide you on how to configure a Raspberry Pi to boot directly into a web page or application without a desktop environment.

Requirements

  • Raspberry Pi 4 with the latest OS installed

Steps

  1. Create an lxsession Directory: If it doesn't already exist, create using the following command:

    mkdir -p ~/.config/lxsession/LXDE-pi
  2. Create an Autostart File: Create an autostart file (e.g., autostart) in the ~/.config/lxsession/LXDE-pi/ directory:

    nano ~/.config/lxsession/LXDE-pi/autostart
  3. Add Startup Programs: Add the programs you want to start automatically to this file. For example, in this case I'm opening a browser with application url, you can add a line like this:

    @/usr/bin/firefox <your-application-url>

    Replace <your-application-url> with the URL of your web application(http://localhost:3000/test).

    Save and Exit: Save the file by pressing Ctrl + X, then Y, and finally Enter.

  4. Configuring Crontab: Starting your server on boot

    • Create a bash script named start-app.sh and include the following code:

      #!/bin/bash
      
      export DISPLAY=:1
      cd /root/Desktop/nodeserver && node index.js
      
    • Open crontab:

      sudo nano /etc/crontab
      

      Include your start script here image

  5. Reboot: Reboot your Raspberry Pi to apply the changes:

    sudo reboot

Your Raspberry Pi should now start with your application open in the Firefox browser.

image

lxsession's People

Contributors

vinayakaraju46 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.