Raspberry Pi Car infotainment

Hi

I have understood that several of us is thinking of using a Raspberry Pi in the car.

I am using the original 7" tft. A USB gps dongle and internet connection via my phone's WiFi.


I have managed to get a "ignition" function using one of the GPIO:s.

It recuired to install busybox to get the script working.

Comments

  • edited October 2018

    My script looks like this:

    </p> <h1>!/system/bin/sh</h1> <h1>init</h1> <h1>Set up GPIO 4 and set to input</h1> <p>echo "4" > /sys/class/gpio/export<br /> echo "in" > /sys/class/gpio/gpio4/direction</p> <h1>Main code</h1> <p>while :<br /> do<br /> #check status of ignition pin<br /> is=<code>cat /sys/class/gpio/gpio4/value

    # Check if dislay status us the same as GPIO pin used
    if [ "$is" != "$(dumpsys power | grep -c "Display Power: state=ON")" ]
    then
    if [ x"$is" = x"0" ]
    then
    # turn off screen
    input keyevent 223
    fi
    if [ x"$is" = x"1" ]
    then
    # turn on screen
    input keyevent 224
    fi
    fi
    sleep 3
    done

  • Hey @Pebert,

    Wow, I’m really happy someone is starting to post a topic about working with the GPIO! I’m currently also trying to get some sensors working with the system, but I experience quite a lot of problems with the “read only” system or “access denied” on the root, etc.

    Could you maybe explain where you did put the script and how you work with busybox to make this work?
    I think there a lot of people on the platform who have similar issues to start with some more advanced stuff like scripts for GPIO.

    I will try to post useful insights too when I can launch development. Maybe we can help each other out here. :)

  • I downloaded and followed the instructions here:

    https://github.com/Gnurou/busybox-android

    I think it requires that you have a linux computer that can run the install script.

    Then, when the busybox is installed I put the script under /data/data, and another script under /data/init.d/ that just starts the first script.

    I can upload the scripts here at bit later, need to extract them from my node first.

  • Thank you @Pebert for the information. I will try that as soon as possible. If you have the scripts available it would be great.

    I have a Mac so there should be no problem with the installation script.

  • Hey @Pebert,

    Thank you again for the description, I can now use busybox. If you could upload the two scripts, it would be great. So I have a preference point and know the code in the scripts should definitely work.

  • You can find my script here.

    http://adgj.se/ignition.sh

    I have put it under /data/data/

    Then under /data/init.d/ I have put this to start up the script
    http://adgj.se/start_ignition

    Hardware wise i have a relay that short circuits GPIO 4 with ground when not active.
  • Thank you very much for the scripts! I will start playing with them now. ;)

  • Your script doesn't define the execution trigger. Is it really executed? Please check other files in /data/init.d for how such files should start.

  • null
    What do you mean?

    It starts with

    ### BEGIN INIT INFO
    # Exec: boot
    # Type: permanent
    ### END INIT INFO
  • OK, it is correct then.

  • Someone know what is the command to power off with security the Android System? (for example, when we press the button power off of the ignition App fo the Emeteria) @kalkov

Sign In or Register to comment.