Quantcast
Channel: Intel Communities: Message List
Viewing all articles
Browse latest Browse all 17366

Re: Python, Wiring_x86, I2C LCD, Grove RGB LCD

$
0
0

First, the above script to set up I2C has only been tested on the Galileo Gen 1. The Gen 2 uses a different setup for I2c so will need its own setup.

Running Python Scripts automatically

Now that the system is up and running, the next item is to have scripts run automatically when the system starts. The scripts can be as simple as displaying the IP address and hostname or running your Zombie detection system that monitors the environment and sends you a picture of any stray Zombies that wander into your area.

This is actually quite easy to do.

In the /etc/init.d directory is a file called galileod.sh, which is the last script called before login. I tried to create a script and have it run, but ran into problems as the Python Path wasn't set so python couldn't find its libraries.

Anyway you just need to create the python script, such as the attached testLCD.py, that shows the hostname and IP address and then a test message.

Then open /etc/init.d/galileod.sh with your favorite editor and add a line to the start aglileod() section, such as the bolded line below

------------------------

start_galileod()
{
    echo "Starting galileod"
    start-stop-daemon -q -S -m -p $pidfile -b -x $launcher
    start-stop-daemon -q -S -m -p $pidsreset -b -x $sreset -- -i $input_reset_gpio -o $output_reset_gpio
   /usr/bin/python /media/realroot/wiring/testLCD.py&

 

}

 

Save and reboot and, if you have a I2C LCD attached to you system, you will see your Hostname and IP address

enjoy

rgb


Viewing all articles
Browse latest Browse all 17366

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>