ifconfig wlan0 into the command line and looking at the result that says
inet addr:) Then, there is a button on the web app that you press to launch your script. since the pi is hosting the web app, it knows when you press that button, and launches the script! This might sound complicated, but it's not really...
If you would like to use this approach, I would recommend using the Flask python framework to host your web app. Here's a great tutorial for building some internet-controlled leds, which you could easily change to control a script instead:
Here would be your script that you'd run on the pi:
contents of /home/pi/webApp/droneServerScript.py:
from flask import Flask, render_template, request
from subprocess import Popen
app = Flask(__name__)
x = Popen(["put your launch command here. for example, if you launch it with 'python script.py', replace this message with that."])
if __name__ == "__main__":
app.run(host='0.0.0.0', port=80, debug=True)
then , in the same directory, put a html file called
the contents of
<a href="/runscript">run the script</a>
sudo nano /etc/rc.local, and add
sudo python /home/pi/webApp/droneServerScript.py
to the bottom. This will make it so that your server starts up automatically every time your pi boots!
hope this helps and feel free to ask for clarification!