Closed pav1996 closed 5 years ago
First check if server is properly running with: sudo systemctl status rgc.service
. Show me the output.
Write the parameters in one line, you can modify excisting ones. Remember to reload config after parameters are changed with:
sudo systemctl daemon-reload
sudo systemctl restart rgc.service
the output: pi@raspberrypi:~/rgc/rgc $ sudo systemctl status rgc.service ● rgc.service - Remote GPIO Control Server Loaded: loaded (/lib/systemd/system/rgc.service; enabled) Active: activating (auto-restart) (Result: exit-code) since Sat 2018-12-01 10:31:00 UTC; 1s ago Process: 4417 ExecStart=/usr/bin/python rgc-server.py -port 22 -password 111 (code=exited, status=1/FAILURE) Main PID: 4417 (code=exited, status=1/FAILURE)
Dec 01 10:31:00 raspberrypi systemd[1]: Unit rgc.service entered failed state.
i found another problem i think...after the "sudo bash rgc-setup.sh" command it says unable to locate package python systemd . i dont know if this is relevant...thanks for the help!!
First of all you can't use port 22, it's ssh port already in use. Python systemd is nessesery. Use Backports or pypi to install it.
well i need to have a python version of 3.4 or bigger to install systemd but every (working)way i tried doesnt solve the problem....python is updated but the message stil says that i need 3.4 or bigger
No you don't need python 3, server app is using python 2.
Install this package: https://github.com/systemd/python-systemd
If you have raspbian(debian streach), add backports to get commad apt-get install python-systemd
to work, or install from source like above link shows.
Here is instruction how to add backports: https://stackoverflow.com/questions/52700155/adding-debian-9-stretch-backports-to-my-sources-list
pi@pi:~/rgc $ sudo bash rgc-setup.sh
Hit http://mirrordirector.raspbian.org jessie InRelease
Hit http://archive.raspberrypi.org jessie InRelease
Hit http://mirrordirector.raspbian.org jessie/main armhf Packages
Hit http://archive.raspberrypi.org jessie/main armhf Packages
Hit http://mirrordirector.raspbian.org jessie/contrib armhf Packages
Hit http://archive.raspberrypi.org jessie/ui armhf Packages
Hit http://mirrordirector.raspbian.org jessie/non-free armhf Packages
Hit http://mirrordirector.raspbian.org jessie/rpi armhf Packages
Ign http://archive.raspberrypi.org jessie/main Translation-en_GB
Ign http://archive.raspberrypi.org jessie/main Translation-en
Ign http://archive.raspberrypi.org jessie/ui Translation-en_GB
Ign http://archive.raspberrypi.org jessie/ui Translation-en
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en
Ign http://mirrordirector.raspbian.org jessie/main Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/main Translation-en
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python-systemd
i installed the package but the problem is not solved.....any other ideas? note that i am running the jessie version
thanks
OK, if you installed from source then remove python-systemd
from rgc-setup.sh file and run it again.
the output:
Hit http://archive.raspberrypi.org jessie InRelease
Hit http://mirrordirector.raspbian.org jessie InRelease
Hit http://archive.raspberrypi.org jessie/main armhf Packages
Hit http://archive.raspberrypi.org jessie/ui armhf Packages
Ign http://archive.raspberrypi.org jessie/main Translation-en_GB
Ign http://archive.raspberrypi.org jessie/main Translation-en
Ign http://archive.raspberrypi.org jessie/ui Translation-en_GB
Ign http://archive.raspberrypi.org jessie/ui Translation-en
Hit http://mirrordirector.raspbian.org jessie/main armhf Packages
Hit http://mirrordirector.raspbian.org jessie/contrib armhf Packages
Hit http://mirrordirector.raspbian.org jessie/non-free armhf Packages
Hit http://mirrordirector.raspbian.org jessie/rpi armhf Packages
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en
Ign http://mirrordirector.raspbian.org jessie/main Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/main Translation-en
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-crypto is already the newest version.
python-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 13 not upgraded.
And a status update:
pi@pi:~/rgc $ sudo systemctl status rgc.service
● rgc.service - Remote GPIO Control Server
Loaded: loaded (/lib/systemd/system/rgc.service; enabled)
Active: activating (auto-restart) (Result: exit-code) since Sat 2018-12-01 15:51:47 EET; 2s ago
Process: 3515 ExecStart=/usr/bin/python rgc-server.py -port 8889 -password pass123456 (code=exited, status=1/FAILURE)
Main PID: 3515 (code=exited, status=1/FAILURE)
Dec 01 15:51:47 pi systemd[1]: rgc.service: main process exited, code=exited, status=1/FAILURE Dec 01 15:51:47 pi systemd[1]: Unit rgc.service entered failed state. still nothing i am thinking of changing to streatch maybe its a system problem
This looks like python-systemd is still not installed. Try to install it from backports: https://backports.debian.org/Instructions/
Here is detailed instructions how to add backports:
1.sudo nano /etc/apt/sources.list
2.Paste line:
For stretch: deb http://ftp.debian.org/debian stretch-backports main
For jessie: deb http://ftp.debian.org/debian jessie-backports main
3.sudo apt-get update
IF GPG key ERROR:
4.sudo apt-get install dirmngr
5.
gpg --keyserver pgpkeys.mit.edu --recv-key 8B48AD6246925553
gpg -a --export 8B48AD6246925553 | sudo apt-key add -
gpg --keyserver pgpkeys.mit.edu --recv-key 7638D0442B90D010
gpg -a --export 7638D0442B90D010 | sudo apt-key add -
sudo apt-get update
sudo apt-get install python-systemd
now this W: GPG error: http://ftp.debian.org jessie-backports InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 8B48AD6246925553 NO_PUBKEY 7638D0442B90D010
Look at pkt 4,5 of above instruction.
pi@pi:~ $ gpg --keyserver pgpkeys.mit.edu --recv-key 8B48AD6246925553 gpg: requesting key 46925553 from hkp server pgpkeys.mit.edu
gpgkeys: key 8B48AD6246925553 can't be retrieved gpg: no valid OpenPGP data found. gpg: Total number processed: 0 pi@pi:~ $ pi@pi:~ $ pi@pi:~ $ gpg -a --export 8B48AD6246925553 | sudo apt-key add - gpg: WARNING: nothing exported gpg: no valid OpenPGP data found. pi@pi:~ $ gpg --keyserver pgpkeys.mit.edu --recv-key 7638D0442B90D010 gpg: requesting key 2B90D010 from hkp server pgpkeys.mit.edu gpgkeys: key 7638D0442B90D010 can't be retrieved gpg: no valid OpenPGP data found. gpg: Total number processed: 0 pi@pi:~ $ gpg -a --export 7638D0442B90D010 | sudo apt-key add - gpg: WARNING: nothing exported gpg: no valid OpenPGP data found. pi@pi:~ $
Try sudo apt-get install debian-keyring debian-archive-keyring
now its active but in the app i get connecction refussed any thoughts there?
Connecction refussed where ?In the android app ? check web client.
yes in the app?? check the web client in the phone? how can i do that?
Not necessarily on the phone, open web broweser and type in http://
Ping this address, check if is accessable.
Pinging 192.168.1.104 with 32 bytes of data: Reply from 192.168.1.104: bytes=32 time=103ms TTL=64 Reply from 192.168.1.104: bytes=32 time=7ms TTL=64 Reply from 192.168.1.104: bytes=32 time=8ms TTL=64 Reply from 192.168.1.104: bytes=32 time=5ms TTL=64 Ping statistics for 192.168.1.104: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 5ms, Maximum = 103ms, Average = 30ms
Is this a ping from windows ? Ping from android device ! From windows u can check http://192.168.1.104
address unreachable both from phone and windows (didnt understand that i have to ping from the phone) is it a router problem? maybe a security option i can change? btw from pc it transferred me in a page with your app logo asking for password then when i pressed it gave me a status code 402
now i am in from phone...but i cant control from here
ohhhh fucking finally it works thanks a lot man for baring with me!!!! any way to donate to you for this 8 hours of help?
Sure, donates are very much appreciated. Thank you in advance. Paypal link
ok one last thing!! i know downloading scripts and apps to make new stuff isnt gonna help me much....i want to make my own app to control my rpi remotely (mostly for home automation projects i am working on ) and i have been told to use an app called android studio.... what it your opinion for this app and if its bad can you recommend smth else?
When it comes to writing applications for android, Android studio is the only right choice for now. It allows programming in java/kotlin. But this applies only to the android client. You must write the server application in a different language.
i have tried this app but it seems that i am doing smth wrong here....i succesfully download and install the package....i edited the library as described using different port number and password then i start the server but when i try to connect through the app it fails and the message says pi not responding...also i dont understand the part with the available parameters, am i supposed to write new lines in the library with them or modify some of the excisting ones?