Android Question How to run scripts .py and .sh

AlpVir

Well-Known Member
Licensed User
Longtime User
How to run pyton script (*.py) and "shell bash" (*.sh) script that reside on a web server Apache ?
These scripts do not return output but interact with the hardware of the server (that has an address like name.no-ip.com or name.dlinkddns.com or name.ddns.com).
Thank you in advance
 

lemonisdead

Well-Known Member
Licensed User
Longtime User
Test 5 (the real one) should start gphoto2
This is no more related to B4A as I do understand it but more on your Linux system.
If you were able to execute some bash script from your app, you would be able to execute any script on the server. So, perhaps should you take some time to test the script. Again, it could be any error related to permissions or the parameters used (I don't remember which parameters gphoto2 takes exactly). Good luck
 
Upvote 0

AlpVir

Well-Known Member
Licensed User
Longtime User
I have the impression that the system used here (job2.Initialize ("Job2" Me); job2.PostString (SiteNoIp & "script.php", "")) is valid only for a subset of the script and not for everyone.
I repeat that /var/www/html/unafoto.sh really snaps the photo and then permission should be OK.
 
Upvote 0

AlpVir

Well-Known Member
Licensed User
Longtime User
SOLVED!
I followed these instructions, you will find the link https://www.raspberrypi.org/forums/viewtopic.php?t=2276

I did not use the file unafoto.sh but only unafoto.php call with education B4A
B4X:
job2.PostString (SiteNoIp & "unafoto.php", "")

The picture is taken. I have not applied the further suggestion that there is at the end of the document above ("after each call to gphoto2 I need to do a usb reset")
For now it works !
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…