RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    1. Home
    2. Tags
    3. python
    Log in to post
    • All categories
    • thelostsoulT

      screentool.py - Copy images from RetroPie to your PC

      Watching Ignoring Scheduled Pinned Locked Moved Projects and Themes samba screenshots python
      1
      0 Votes
      1 Posts
      309 Views
      No one has replied
    • C

      Setting ServoStik using python and GPIO pins

      Watching Ignoring Scheduled Pinned Locked Moved Help and Support gpio python servostik
      8
      0 Votes
      8 Posts
      956 Views
      flagrant99F

      I just got it working with the following python script using rgbcommander's servostik linux command line. Hardware mode is not needed.

      http://users.telenet.be/rgbcommander/

      from gpiozero import Button from subprocess import check_call from signal import pause #Functions def onGpio3Open(): #Arcade 1up switched to OFF check_call(['sudo', 'poweroff']) print("gpio3Released") check_call(['sudo', 'poweroff']) def onGpio17Closed(): print("gpio17Pressed") check_call(['sudo', './SetServoStik', '8']) def onGpio27Closed(): print("gpio27Pressed") check_call(['sudo', './SetServoStik', '4']) #Main Execution Starts Here gpio3Btn = Button(3) gpio3Btn.when_released = onGpio3Open gpio17Btn = Button(17) gpio17Btn.when_pressed = onGpio17Closed gpio27Btn = Button(27) gpio27Btn.when_pressed = onGpio27Closed pause()
    • T

      Open Program from Python script

      Watching Ignoring Scheduled Pinned Locked Moved Help and Support kodi python popen script github
      5
      0 Votes
      5 Posts
      640 Views
      T

      @mitu Ah, that scuppers those plans then. I think I'll give this up as a failed experiment. I did manage to get Kodi to launch from my green button by importing psutil and check_output and changing the code to

      espid = int(check_output(["pidof","-s","emulationstation"])) es = psutil.Process(espid) es.suspend() Kodi = subprocess.Popen("/home/pi/RetroPie/roms/ports/Kodi.sh") Kodi.wait es.resume()

      But then the script would no longer start from my crontab on boot so not really usable.

    • R

      Don't really know what to do here... (Python project into Arcade Retropie system)

      Watching Ignoring Scheduled Pinned Locked Moved Help and Support python rom retropie game help
      5
      0 Votes
      5 Posts
      1k Views
      H

      Mystic Mine is a Python game included in RetroPie. You can find it in the Experimental packages. I strongly recommend you to study how this game is programmed as it runs very well on the Raspberry Pi.

      The scriptmodule that installs and configures this game in RetroPie is here: https://github.com/RetroPie/RetroPie-Setup/blob/master/scriptmodules/ports/mysticmine.sh

    • W

      input_pipe another joystick mapper

      Watching Ignoring Scheduled Pinned Locked Moved Ideas and Development joystick mappin joystick development python x86
      10
      1 Votes
      10 Posts
      2k Views
      F

      This looks grate and just what I need. Do you have a complete idiots guide on how to setup on raspberry pi? I have two ultrastik 360s and two dragon rise joystick buttons i want to combine one ultrastik with one dragon rise for player 1 and the the other two for player 2. I've lost count of how many methods I've found and tried but can't get anything working... Been at it for weeks now. Any help greatly appreciated.

      I am a complete noob so a step by step guide is really needed thanks

    • G

      Aimtrak Installation Issue

      Watching Ignoring Scheduled Pinned Locked Moved Help and Support aimtrak python optional packag
      47
      0 Votes
      47 Posts
      9k Views
      EfriimE

      @sdabbs
      I don't know sorry. Try using pip to check and upgrade py modules.

      pip list pip upgrade xxx.xxx
    • W

      Retropie error trying to use 2nd screen to display rom art and options with 2 switch's for select and option scrolling.

      Watching Ignoring Scheduled Pinned Locked Moved Projects and Themes tft screen 2nd screen retropie ili9341 python
      3
      0 Votes
      3 Posts
      595 Views
      S

      I too found this arcade 3D print and had huge problems getting the diplay to work. Thanks to this old post I got it working after all. For all of you who also stumble over this post the code that has to be executed has changed a bit: "sudo apt-get install build-essential python-dev python-smbus python-pip python-pil python-numpy git" otherwise it aborts with an error.
      Thanks watson49 for posting your solution. I wouldn't have been able to do it otherwise!

    • D

      emulationstation running as a service

      Watching Ignoring Scheduled Pinned Locked Moved Help and Support service script python
      3
      0 Votes
      3 Posts
      1k Views
      K

      I want to start emulationstation on-demand, this is what I've come up with:

      Emulationstation heavily depends on a terminal being allocated for it to work. It switches a lot between graphical and text-mode. So in "/etc/systemd/system/my-emulationstation.service":

      [Unit] Description=my emulationstation [Service] User=pi ExecStart=/usr/local/bin/run-emulationstation Type=simple StandardInput=tty-force TTYVHangup=yes TTYPath=/dev/tty20 TTYReset=yes

      Also, there's a bug that requires emulationstation to be started inside /home/pi, so in "/usr/local/bin/run-emulationstation":

      #! /bin/bash # switch to same tty allocated in .service chvt 20 # cd to home cd /home/pi # run emulationstation in foreground process /opt/retropie/supplementary/emulationstation/emulationstation.sh

      And for the curious: I want it to start when specific hardware is attached, specifically an 8Bitdo Zero Bluetooth Gamepad. So in "/etc/udev/rules.d/50-my-emulationstation.rules":

      ACTION=="add", SUBSYSTEM=="input", ATTR{name}=="8Bitdo Zero GamePad", TAG+="systemd", ENV{SYSTEMD_WANTS}="my-emulationstation"
    • ?

      I messed up my settings.

      Watching Ignoring Scheduled Pinned Locked Moved Help and Support runcommand retropie menu python
      21
      0 Votes
      21 Posts
      2k Views
      mituM

      @John_RM_70 Try one command at a time and see which ones locks up the Pi. It's probably tvservice, but it could be because of the previous command, which specifies might specify an invalid mode.
      Have you tried tvservice -p (preferred mode) ?

    • C

      Modify Power Button Behaviour to 'Hold for three seconds'??

      Watching Ignoring Scheduled Pinned Locked Moved ControlBlock, PowerBlock & Co. retropie shutdown python script delay
      3
      0 Votes
      3 Posts
      761 Views
      C

      @mitu said in Modify Power Button Behaviour to 'Hold for three seconds'??:

      You can increase the bouncetime from 2sec to something larger.

      Even as it is now, just a single quick push will shut the software down - i dont have to hold the button at all.

      Perhaps I need to use a different script that relies on the button being held.

    • J

      Python script for shutting down the Raspberry Pi after a certain time

      Watching Ignoring Scheduled Pinned Locked Moved Help and Support python script retropie retropie 4.4 raspberry pi
      2
      0 Votes
      2 Posts
      633 Views
      R

      @JToivonen got what you mean and here is the "un modified" solution...simply if you're playing plug the usb controller and when you finish just unplug it and it will shutdown automatically!, even when a power trigger happens "electricity went off then come back again" and found that your gamepad isn't connected it will shut down :)
      here is the python file you just need to edit the line that kills qjoypad to kill whole system add poweroff or shutdown -h as you use in your momentry switch
      don't forget to make the file run at start and special thanks to pablo

      idea behind the script is that system creates a js0 file for controller 1 inputs and js1 for controller 2 when connected and so on, the script searches for that file if it's found that mean you've connected the gamepad and probably playing a game and when you finish unplugging the gamepad removes js0 file and when the script discovers the file is not found it kills an app process called qjoypad which you'll change to shutdown

      please note you're not gonna use //User Variables section in this code so just ignore it.

    • T

      Environment variable DISPLAY is empty

      Watching Ignoring Scheduled Pinned Locked Moved Help and Support display pyautogui python
      5
      0 Votes
      5 Posts
      1k Views
      T

      Ok I see... So it's possible to use my script and retropie However, only on a computer.
      Thanks for the information I wasn't aware that on RP almost all emulators don't run on X.

      Thanks a lot :)

    • M

      Runcommand usage from python script not working

      Watching Ignoring Scheduled Pinned Locked Moved Ideas and Development runcommand python raspbian
      7
      0 Votes
      7 Posts
      732 Views
      cyperghostC

      @mesym Well I don't know what's wrong but this worked for me. It starts Tetris and shows me pointer adress. Something wrong with your py-fu?

      import os import time import subprocess p = subprocess.Popen(['/opt/retropie/supplementary/runcommand/runcommand.sh','0', '_SYS_', 'gb', '/home/pi/RetroPie/roms/gb/Tetris (JUE) (V1.0) [!].gb']) while 1: print(p) time.sleep(5)
    • X

      Key press simulation failed

      Watching Ignoring Scheduled Pinned Locked Moved Help and Support python 4.9.35-v7+ uinput x11
      1
      0 Votes
      1 Posts
      438 Views
      No one has replied
    • M

      Bluetooth can't connect via RetroPie-Setup

      Watching Ignoring Scheduled Pinned Locked Moved Help and Support bluetooth gobject python raspberry pi 2b
      9
      0 Votes
      9 Posts
      5k Views
      M

      @mitu I did it, but then suddenly my wi-fi dongle stopped working. Then I tried some more troubleshooting attempts for that and messed stuff up even more.

      Much as it pains me, I'm just reinstalling RetroPie and doing it all from scratch. I made backups of everything, so hopefully I'll be able to salvage some of my customizations.

    • I

      Keyboard input over serial into Pi. How to inject characters into ES, Retroarch?

      Watching Ignoring Scheduled Pinned Locked Moved Help and Support pi zero c64 keyboard serial python
      3
      0 Votes
      3 Posts
      567 Views
      I

      i'm afraid I cant find much on how to output to this from python. Im no coder, it needs to be call-able from python once Ive done with my process.

      thanks for info!.. do you have any more?

      Other options please! what other options do I have to get my character input into ES and retroarch please?

    • cyperghostC

      [Tutorial] Get text output from bash files into your python script!

      Watching Ignoring Scheduled Pinned Locked Moved Ideas and Development cyperghost python
      38
      0 Votes
      38 Posts
      11k Views
      cyperghostC

      @carlos0371 I left the recalbox-script in original state. So there it reboots the whole Pi

    • Drakaen391D

      Remote Monitoring

      Watching Ignoring Scheduled Pinned Locked Moved Projects and Themes python
      10
      0 Votes
      10 Posts
      2k Views
      Drakaen391D

      so my remote monitering script helped rule out overheating on my pie

      its become unstable suddenly... so time to backup and reflash

    • HoraceAndSpiderH

      PySkool as Port?

      Watching Ignoring Scheduled Pinned Locked Moved Ideas and Development python ports pyskool skooldaze pygame
      2
      0 Votes
      2 Posts
      580 Views
      R

      Hi
      you can try it your self
      from command line type

      wget https://pyskool.ca/downloads/pyskool/pyskool_1.2.1-1_all.deb
      sudo dpkg -i pyskool_1.2.1-1_all.deb
      run it with pyskool

      if it needs python install it with apt-get install python

    • hansolo77H

      Python on my Tablet?

      Watching Ignoring Scheduled Pinned Locked Moved General Discussion and Gaming python android programming
      6
      0 Votes
      6 Posts
      2k Views
      hansolo77H

      Thanks! I'll give that guide a go, and see what turns up.