Hi all,
So I am working on a project where I need to be able to upload data from a raspberry pi to a mySQL database. I also need to be able to run scripts on the raspberry pi via an Android App. Thus far I have looked into installing a LAMP server on a pi, using my private desktop PC as a WAMP server as well as potentially using GoDaddy as a LAMP server. However, I wanted to avoid forwarding ports which made me decide against the LAMP server on a pi as well as the WAMP sever on my PC. Is it possible to be able to open a web socket between the Pi and a GoDaddy (or other vps service) which I could run a script on the Pi when the VPS receives a prompt? Just to clarify I'll write a little flow chart below detailing what I'm attempting to do:
Android App button press sends encoded message to VPS to run a particular script on the Pi ->
VPS receives message and deciphers message in php script->
VPS php script sends message to Pi to run program.py->
Pi runs program.py
Another option I have considered is polling the VPS although I am not very familiar with how to implement it. I would imagine that I would do it using php scripts, but I am still learning php. Would it be easier to implement my raspberry pi control using a polling method? Just as further information, I am already going to be transferring a small amount of data from the pi to the VPS about once every 1-5 minutes.
Thank you for any help you guys give!