Skip to content

Latest commit

 

History

History
239 lines (169 loc) · 7.5 KB

README.md

File metadata and controls

239 lines (169 loc) · 7.5 KB

Phone-Piper

Set of user editable scripts to control android apps.

Features

  • Scripting with a simple JSON language
  • Device agnostic, the script is separate from the view
  • Logging, it prints what it's doing
  • Editing, built in method to make or edit views
  • Extensible, views are built upon other views
  • Screen saver to stop burn-in

Getting Started

Real Device

  1. Have the right phone/resolution
    • Samsung S7 (1080P)
    • More devices are possible, but I only have a limited # of phones. If I was provided screen shots for every needed screen, I could build another definition.
  2. Install Java 8
  3. Install a way to communicate with your Android device
  4. Get the helper app, and install it onto your device
  5. Get this app
  6. Make sure ADB works
  7. Run the app
    • From Source with JetBrains IntelliJ
      • you need to setup a Java 8 configuration to execute com.mgatelabs.piper.Runner
      • Set the program argument to SERVER
      • Set the VM argument to -Dserver.port=8090
      • Change the working directory to the working folder included with the source
    • From the zip release
      • Run server.bat
  8. Open your browser to http://localhost:8090/piper

MEmu

  1. Install Java 8
  2. Download a released version
  3. Unzip the release
  4. Get the helper app, and install it onto Memu
  5. If you're running the latest version, open Settings > Network and change NAT to Bridge
    • If your version does not have bridging as an option please see Memu notes in the bottom
  6. Run the helper app on Memu, minimize the app and open FFBE
  7. Open the extracted PhonePiper release and run server.bat
  8. Open your browser to http://localhost:8090/piper
  9. Click the create new configuration button
  10. Set the name to MEMU Farming
  11. The Device is either MEMU-1080 or MEmu7-1080.
    • Use MEMU-1080 if you're on the default install.
    • If it's android 7.0 or beyond use MEmu7-1080.
    • If you choose the wrong one, the app may appear to lockup
  12. Set the View to 1080x1920
  13. Set the Script to farming
    • If you have more scripts to load press the + button to choose another. Script order does matter.
  14. Set the IP
    • NAT Mode: 127.0.0.1
    • Bridge Mode: See helper app for IP address
  15. Set the ADB variable
    • For me it was C:\Program Files\Microvirt\MEmu\adb
  16. Direct, leave this blank, unless you have multiple instances of MEmu running. It would typically be the IP:PORT of the instance or serial number.
  17. Connection
    • NAT Mode: USB
    • Bridge Mode: WIFI
  18. Throttle is used to slow down processing. Set it to 25 for a faster run, but it will work harder.
  19. Hit save config so you don't lose what you typed.
    • All settings are saved to your local browser
  20. Tap Run Script
  21. If everything is good you should be on the Run tab
  22. Before you start anything visit the Variables tab and adjust a few things. Also always hit update after changing something.
    • Set your Player Level for energy calculation purposes
    • Disable Raid & Arena, you don't have scripts for those yet.
    • Choose your Farm Party, the unit group that you TMR farm with.
  23. Goto the setting tab and see if Update Preview does anything. If you get a image back of the screen, you have a connection to the helper app.
  24. It's time to start, from the home screen navigate to the earth shrine menu. Later you won't need to do this.
  25. From the Run tab press Play/Pause. And it should start to TMR farm.

Common Configurations

Server setup

For running on an Raspberry PI

  1. git clone https://github.com/mgatelabs/PhonePiper.git
  2. cd PhonePiper
  3. mvn clean compile package
  4. cd working
  5. java -Dserver.port=8090 -jar ../target/phone-piper.jar server

Memu notes

Bridge

For Bridge routing there is no additional configuration needed

NAT

For NAT routing you need to do the following.

  1. Make sure MEmu is closed
  2. Edit the file \MEmu install directory\MemuHyperv VMs\MEmu\MEmu.memu
  3. And these lines under Adapter[slot=0], NAT

<Forwarding name="ADB" proto="1" hostip="127.0.0.1" hostport="21503" guestip="10.0.2.15" guestport="5555"/> <Forwarding name="PPH" proto="1" hostip="127.0.0.1" hostport="8080" guestip="10.0.2.15" guestport="8080"/>

Update Guide

This will include instructions for setting up Phone Piper to run on a Raspberry PI. You need to have working headless Raspberry PI before attempting to get Phone-Piper working.

Raspberry PI Setup

Device Setup

First thing you need to do is insure everything is up to date

sudo apt-get update

Next you need to upgrade your system

sudo apt-get upgrade

Now reboot it for all changes to take effect

sudo reboot

Software Setup

Install Git

sudo apt-get install wget git-core

Install ADB

sudo apt-get install -y android-tools-adb

Install Java 8

sudo apt-get install oracle-java8-jdk

Install Maven

sudo apt-get install maven

Installing Scripts

Goto the root folder

cd ~

Create a folder for the scripts (Example for FFBE)

mkdir ffbe

Clone the latest scripts

git clone [email protected]:mgatelabs/PhonePiperFFBE.git ./ffbe

Installing Phone Piper

Goto the root folder

cd ~

Make a new folder Phone-Piper

mkdir Phone-Piper

Clone the latest source

git clone [email protected]:mgatelabs/PhonePiper.git ./Phone-Piper

Build from source

cd Phone-Piper

mvn clean compile package

Auto-start Phone Piper

You need to copy the file phone_piper to the /etc/init.d folder

sudo cp ~/Phone-Piper/extra/phone-piper /etc/init.d

Make the file runable

sudo chmod +x /etc/init.d/phone-piper

Install the script

sudo systemctl enable phone-piper

Update Phone Piper

Copy the phone-piper-build script to the home directory

cp ~/Phone-Piper/extra/phone-piper-build ~/

Make the script runable

sudo chmod +x ~/phone-piper-build

Run the update script. The system will reboot after it's finished

cd ~

./phone-piper-build

Useful Links

Getting the Raspberry Pi Webcam working

https://pimylifeup.com/raspberry-pi-webcam-server/

Fixing a permission issue

https://raspberrypi.stackexchange.com/questions/78715/motion-daemon-var-log-motion-motion-log-permission-denied