1
votes

The following commands (to get a small screen working) execute just fine if I type them in from the LXTerminal window while running Raspian on a raspberry Pi once my desktop is loaded:

  • sudo modprobe spi-bcm2708
  • sudo modprobe fbtft_device name=adafruitts rotate=90
  • export FRAMEBUFFER=/dev/fb1
  • startx

I'm new to Pi and Python, and after piecing together several forum posts, the best way I thought to do this would be to run a python script from the /etc/xdg/lxsession/LXDE/autostart config file- I just don't know what the python script should say to automaticlaly open a LXTerminal window and type in the commands?

Any help would be much appreciated, thanks!

1
why do you need python? - jfs
You don't need Python. Use a bash shell script. - William Denman

1 Answers

0
votes

Don't try to open a terminal window from python. Just use the os.system() command to run the three commands you show, if you insist on using python. Even easier would be a bash script into which you can write the three commands just as you have written them above.

Even better, and to get rid of the need to somewhere type the sudo password, add the three commands without sudo to /etc /rc.local just before the exit 0.