Raspberry pi Projects

  • Auto start script

    if you want to activate some option automatically in the takeoff of the raspberry pi rather do these manually like activated apache or some script you already write it and you don't know how to do it, then you arrived, in this tutorial you will learn how to set your raspberry pi to line code mode rather auto desktop login and automatically start the scripts you write if it was python or bash script or anything else.

    Preparations

    First, open the Linux shell command by clicking on the icon "LDXEterminal"
    Then write "sudo raspi-config" after that you will see the configurations screen.
    Post
    After that choose the third option "Boot option" to set your way for log in.
    Post
    Now you have a three option:
    B1 Desktop / CLI :which is it for log in option like graphical user or command line and that what we need to choose for this tutorial.
    B2 wait for network at boot : that means the system will stop until connecting the Ethernet port to the router.
    B3 splash screen : it's for starting video before starting the system.
    Post
    And now you choose the second option "consoles autologin" the feature of this option it's automatically login in the shell environment without required any username and password to enter.
    Post
    At the end, you press "ok" then reboot the system and it is necessary for activating the login options in Linux system.
    Don't forget to type "startx" in the command line to start the Desktop.
    Post
    after the new restart go to LDXEterminal and open the file in nano text editor "profile" you find it in etc folder.
    Post
    when you open the file you will see the same photo below, that file includes all the fuses to launch Linux system "do not delete anything" otherwise the system will be crash.
    Post
    go to end line and add the fllawing.
    if [ $(tty) == /dev/tty1 ];then
    home/pi/.set.sh            #this is bash script example 
    sudo python clear_gpio.py  # this is python example
    startx 				       # this is for login to desktop without write this command every time
    fi
    

    I make this in my system to start apache web server at the beginning and the samba file sharing system than the choosing the sound output and at the end autostart to Desktop.
    Post