Python script on boot and Controller config on piplay menu
  • Hi there!

    Just a few question.... I didn't find something on this forum about how to add a python script on boot.
    I just bought a GPIO Xmas tree (http://www.pocketmoneytronics.co.uk/?page_id=239), and would like to light on boot :) (it work manually but when i add "sudo python exemple_1.py" in /etc/rc.local it didn't run at all.....)

    And also, is it possible to change button assignement for piplay menu? if yes where? because with my controller (http://www.amazon.fr/CSL-Manette-ordinateur-portable-tablette/dp/B00O0PX1HK/ref=sr_1_2?ie=UTF8&qid=1419418149&sr=8-2&keywords=snes+usb$) who works great out of the box by the way, control assignement are a little messy :) (X for validate, A for escape etc...)

    Thx in advance for your answer!!
  • I think I worked out the problem... First make a file called xmas.sh
    With the following code:
    #!/bin/sh
    sleep 10
    sudo python example_1.py


    Then add this to /etc/rc.local
    /yourpath/to/xmas.sh.sh &


    As for changing controls in the menu, have a look at
    /home/pi/pimame/pimame-menu/controller.yaml
  • Thx for the tips, but unfortunatly, it didn't work.... When i try to run in commad line /home/pi/xmas.sh.sh => no such file.
    So i tried this /home/pi/xmas.sh => permission denied
    :/

    For piplay control menu, everything is fine, thx!
  • Sorry that was supposed to be:
    /home/pi/xmas.sh &

    Then type this into the console
    chmod +x /home/pi/xmas.sh

    To make it executable
  • Ok so now the script works in command line but still don't work on boot :'(
    Maybe i need to put it on other boot script than rc.local...?
  • Try putting it in /home/pi/.profile
    It'll start later than using rc.local though
  • Hi!

    Even in this file it still doesn't work on boot :'( (but still work manually)
    Cause of xmas and New year i managed to test only today ^^

    edit : i find a way, or my mistake... Don't know :p

    I add 2 lines in /home/pi/.profile
    cd ~
    /home/pi/xmas.sh &

    With this it works :D
    Thx!
  • Marking as solved ;)

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!