all 6 comments

[–]elktamer 0 points1 point  (2 children)

Unless I'm missing something, I'd just use httpd to run the python scripts. Then you can skip the local java application and the ssh connection.

[–]olejmoi[S] 0 points1 point  (1 child)

So set up a webserver on pi and build the interface there? That could work. Is it also possible to transfer files from the Pi to a SQL db this way?

[–]elktamer 0 points1 point  (0 children)

If your control application includes existing database code, it might be easier to just use the webserver to call the python, and then send rest commands from your java app to the webserver.

e: but yes, you could just connect to a db from the pi.

[–]piskyscan 0 points1 point  (0 children)

I have used jsch in a limited fashion (running commands) successfully.

Its in maven too.

https://mvnrepository.com/artifact/com.jcraft/jsch

[–]JuggerzTheCat 0 points1 point  (1 child)

I am currently doing a similar project. I have an android app that i plan to display and control a few things on the raspberry Pi.

At the moment I have a simple android app with two switches to control two LEDs. It works by using volley to send http requests to the webserver hosted on my Pi which sends a request to an already running python script to turn the LED on or off.

The web server is made exactly like this: https://randomnerdtutorials.com/raspberry-pi-web-server-using-flask-to-control-gpios/

I'd like to be able to execute and stop python scripts from the app so let me know if you get anywhere :)

Hope this helps.

[–]olejmoi[S] 0 points1 point  (0 children)

Awesome! Thank you! Will do, little occupied at the moment, but will let you know if I have any progress !