pigpiod is a daemon to control Remote GPIO (Raspberry Pi).
I'm trying to load it remotely from rpi#1 on rpi#2, unsuccessfuly.
Both RPi run Python 3.5 With Ubuntu 16.04.
when using on local machine- daemon's executed OK:
def runpigpiod_local():
subprocess.run(['sudo','pigpiod'])
BUT- when trying to execute it remotely- it fails
def runpigpiod(adress):
result = subprocess.run(['ssh','guy#192.168.2.112','sudo pigpiod'])
output:
guy#192.168.2.112's password:
sudo: no tty present and no askpass program specified
Question is answered in:
Configuring Remote GPIO
Related
I am running QtScrcpy to mirror and control multiple android devices from PC (win). In the same time running Python script which remote stepper motors (turntable). What I need is to send command adb shell input keyevent 24 to android devices via Python somehow.
You can use AndroidViewClient/culebra and create a script like this (this is a minimalistic version)
#! /usr/bin/env python3
from com.dtmilano.android.viewclient import ViewClient
ViewClient.connectToDeviceOrExit()[0].press('VOLUME_UP')
I am not sure how to approach this project but my goal is to have a python script constantly running on a ubuntu server in the cloud then being able to connect to my server via ssh and then being able to interact with the python script that is running but i am not sure where to start.
use screen or tmux after establishing ssh connection.
Install tmux (it is usually installed by default) just in case:
sudo apt install tmux
them run tmux
Inside the tmux session, you can run the script and interact with it.
Whenever you got disconnected; the script will continue working.
After re-establishing ssh connection you can do tmux at and continue working with your script and check its log.
For more information on tmux check out this link.
I'm running a python script on a remote computer's terminal after ssh-ing into it.
The script has a few cv2.imshow() statements in it that open up windows on the remote host.
I would like these windows to open on the local host.
I have tried using X forwarding (ssh -X host) but that does not solve my problem.
(I confirmed X forwarding works by running gedit and nautilus)
PS: Both remote and local hosts have Ubuntu 14.04 if that matters.
I have a simple python script on a Raspberry Pi connected using WiFi that activates an LED. Simple enough.
Is it possible to launch that python script from another device attached to the same network using a simple button in VB.net? Thanks in advance for your help!
You will need to use system call in VB, which run the following command in your PC:
ssh user#rpi:/path/to/command.py arg1 arg2
see this, How do I call a Windows shell command using VB6?.
You will need to run ssh server on the rpi, and possibly set passwordless ssh access using keys.
For ssh on windows, you need either cygwin or putty.
So I have tornado server setup on my vps running ubuntu 12.04. So when I am ssh'd into my server or am vnc'd in there the site loads static/templates files just fine. But when I exit out of ssh or terminate vnc python throws error that the file it was looking for does not exist.
[Errno 2] No such file or directory
When I execute the server I just run the python command to run it as a background process, and once its successfully running and exit out.
I have the server running at www.calapp.manangandhi.com
Edit: As per the answer below I was able to figure out a way for it to work. here si the link to daemonizing tornado application, there are other ways suggested in the thread as well. https://groups.google.com/forum/?fromgroups=#!topic/python-tornado/4cxKEFsS0RE
Are you trying to say that you run the server from within the ssh shell? If so, your problem is most likely that on shutdown of the shell, the software gets a HUP and disconnects despite being in the background. You need the software to daemonize and detach completely from the running terminal. If you're using a toolkit, look up "starting as daemon" or launch your software from within DJB's supervise or other system-wide launcher system.