Raspberry Pi Motion Camera Not Working - raspberry-pi

I installed motion sensing camera on my Raspberry Pi with this tutorial.
I worked through everything. I'm using Raspbery Pi 3 Model B so there were a few differences but I think I've covered everything.
When I restart the Pi Motion seems to start as if I run sudo service motion status I get something like this:
pi#raspberrypi:~ $ sudo service motion status
● motion.service - LSB: Start Motion detection
Loaded: loaded (/etc/init.d/motion)
Active: active (exited) since Thu 2018-03-08 21:08:08 UTC; 3min 0s ago
Process: 1271 ExecStop=/etc/init.d/motion stop (code=exited, status=0/SUCCESS)
Process: 1277 ExecStart=/etc/init.d/motion start (code=exited, status=0/SUCCESS)
Mar 08 21:08:08 raspberrypi systemd[1]: Started LSB: Start Motion detection.
Mar 08 21:08:08 raspberrypi motion[1277]: Starting motion detection daemon: motion.
I can't connect to the browser page from my Mac though. If I use http://:8080 I get an unable to connect error. I did install Apache so If I do http:// I get the default page.
What can I do to get this working?

have you tried http:/[YOUR_IP_ADDRESS]:8081. The 8080 is dedicated to configuration.

Related

Getting error "Failed to start Artifactory service" after Artifactory installation

Getting this error after installing Artifactory
artifactory.service - Artifactory service
Loaded: loaded (/usr/lib/systemd/system/artifactory.service; enabled; vendor preset: disabled)
Active: activating (auto-restart) (Result: protocol) since Mon 2023-02-13 14:14:06 UTC; 43s ago
Process: 1469 ExecStart=/opt/jfrog/artifactory/app/bin/artifactoryManage.sh start (code=exited, status=0/SUCCESS)
Main PID: 26760 (code=exited, status=143)
Feb 13 14:14:06 mbiazelkdynatrace systemd[1]: Failed to start Artifactory service.
Feb 13 14:14:06 mbiazelkdynatrace systemd[1]: Unit artifactory.service entered failed state.
Feb 13 14:14:06 mbiazelkdynatrace systemd[1]: artifactory.service failed.
[root#mbiazelkdynatrace run]# systemctl status artifactory.service
Please help figure out the issue; I've trying this for the last two weeks.
Since you are trying to start for the first time, there may be an issue with ports where the ports required for Artifactory might already being used.
The above snippet does not reveal anything of the issue.
Can you try to perform the below steps.
Stop Artifactory from service.
Navigate to $JFROG_HOME/artifactory/app/bin (ideally /opt/jfrog/artifactory/app/bin if you have not changed the default location)
./artifactoryctl start
Navigate to $JFROG_HOME/artifactory/var/log location
tail the console.log that should reveal what is the issue.
or artifactory-service.log should reveal the issue.
If nothing is found, share the error snippet from artifactory-service.log

What is NGINX Expecting To See Here?

I've been working on trying to integrate onlyoffice with my working nextcloud app. I've attempted this many times and in many different ways. I believe I understand "most" of the mistakes I've made previously...but there always seems to be one more.
Nextcloud is running on a Ubuntu 22.04 VM. I have another VM operating nginx reverse proxy for this and the other apps I want to expose to the outside. I've decided on this attempt to also run onlyoffice on the nextcloud server but using different ports from that app.
Using the modified template suggested for SSL enabled nginx, when I attempt to start the service, I get:
bonzo#cloud:/etc/nginx/conf.d$ systemctl status nginx.service
nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2022-08-05 15:12:02 CDT; 8s ago
Docs: man:nginx(8)
Process: 7990 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)
CPU: 26ms
Aug 05 15:12:02 cloud systemd[1]: Starting A high performance web server and a reverse proxy
server...
Aug 05 15:12:02 cloud nginx[7990]: nginx: [emerg] host not found in upstream "docservice" in
/etc/nginx/includes/ds-docservice.conf:74
Aug 05 15:12:02 cloud nginx[7990]: nginx: configuration file /etc/nginx/nginx.conf test failed
Aug 05 15:12:02 cloud systemd[1]: nginx.service: Control process exited, code=exited,
status=1/FAILURE
Aug 05 15:12:02 cloud systemd[1]: nginx.service: Failed with result 'exit-code'.
Aug 05 15:12:02 cloud systemd[1]: Failed to start A high performance web server and a reverse
proxy server.*
When I looked at the line 74 in ds-docservice.conf, it shows this:
location / {
proxy_pass http://docservice;
}
And, I'm not exactly sure what it is expecting to see there. I haven't included it in this first post but I'd be happy to share my ds.conf or any other logs/configs that would be required for help with this. I also realize this is probably going to be something silly that I've missed or messed up, I'm still new to nginx and integrating onlyoffice has been a lot more difficult than you'd think, from the literature and yt vids I've seen!
Thanks for any help

systemd service activation for Python script fails

I want to register a python script as a daemon service, executed at system startup and running continuously in the background. The script opens network sockets, a local log file and executes a number of threads. The script is well-formed and runs without any compilation or runtime issues.
I used below service file for registration:
[Unit]
Description=ModBus2KNX Gateway Daemon
After=multi-user.target
[Service]
Type=simple
ExecStart=/usr/bin/python3 /usr/bin/ModBusDaemon.py
[Install]
WantedBy=multi-user.target
Starting the service results in below error:
● ModBusDaemon.service - ModBus2KNX Gateway Daemon
Loaded: loaded (/lib/systemd/system/ModBusDaemon.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2021-01-04 21:46:29 CET; 6min ago
Process: 1390 ExecStart=/usr/bin/python3 /usr/bin/ModBusDaemon.py (code=exited, status=1/FAILURE)
Main PID: 1390 (code=exited, status=1/FAILURE)
Jan 04 21:46:29 raspberrypi systemd[1]: Started ModBus2KNX Gateway Daemon.
Jan 04 21:46:29 raspberrypi systemd[1]: ModBusDaemon.service: Main process exited, code=exited, status=1/FAILURE
Jan 04 21:46:29 raspberrypi systemd[1]: ModBusDaemon.service: Failed with result 'exit-code'.
Appreciate your support!
Related posts brought me to the resolution for my issue. Ubuntu systemd custom service failing with python script refers to the same issue. The proposed solution adding the WorkingDirectory to the Service section resolved the issue for me. Though, I could not find the adequate systemd documentation outlining on the implicit dependency.
As MBizm saim you must also add WorkingDirectory.
And After that you must also run these commands:
sudo systemctl daemon-reload
sudo systemctl enable your_service.service
sudo systemctl start your_service.service

How to start pyqt ui application using systemd

I have a pyqt5 UI application which I want to start using systemd service in raspberry pi. For this below is the service code:
[Unit]
Description=QT App
[Service]
User=pi
WorkingDirectory=/home/pi/Documents/qtproj
Environment=DISPLAY=:0
ExecStart=/bin/bash '/home/pi/Documents/qtproj/start_app.sh'
Restart=always
RestartSec=10s
[Install]
WantedBy=graphical.target
As per above code, I am starting start_app.sh script which loads few of the library and then finally start python3 pyqt5 application. When I am starting the above service, it stays in inactive status:
● myqt.service - QT App
Loaded: loaded (/etc/systemd/system/myqt.service; disabled; vendor preset: en
Active: inactive (dead)
Jul 13 09:47:57 pi systemd[1]: Started QT App.
Jul 13 09:47:57 pi sudo[7861]: pi : TTY=unknown ; PWD=/home/pi
Jul 13 09:47:57 pi sudo[7861]: pam_unix(sudo:session): session opened
Jul 13 09:47:58 pi bash[7860]: No protocol specified
Jul 13 09:47:58 pi bash[7860]: qt.qpa.screen: QXcbConnection: Could no
Jul 13 09:47:58 pi bash[7860]: Could not connect to any X display.
Jul 13 09:47:59 pi sudo[7861]: pam_unix(sudo:session): session closed
Jul 13 09:47:59 pi systemd[1]: myqt.service: Main process exited, code
Jul 13 09:47:59 pi systemd[1]: myqt.service: Failed with result 'exit-
Jul 13 09:48:05 pi systemd[1]: Stopped QT App
From the above status its clear that its not able to connect to display although I have give graphical.target. Can anyone please tell me how can I create a systemd service for pyqt5 application. Please help. Thanks
if it is a gui app (graphical USER interface), a logged in user is a requirement.
why not run it from a sytem wide .profile or similar for you system?
for bash that is /etc/profile.

Job for hostapd.service failed because the control process exited with error code

I'm was halfway setting WiFi router for my Raspberry Pi but this appeared:
Job for hostapd.service failed because the control process exited with error code.
See
"systemctl status hostapd.service" and "journalctl -xe" for details.
I've tried to excude systemctl status hostapd.service:
● hostapd.service - Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator
Loaded: loaded (/lib/systemd/system/hostapd.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Thu 2019-07-11 15:50:37 JST; 1s ago
Process: 1673 ExecStart=/usr/sbin/hostapd -P /run/hostapd.pid -B $DAEMON_OPTS ${DAEMON_CONF} (code=ex
7月 11 15:50:37 raspberrypi systemd[1]: Failed to start Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA
7月 11 15:50:37 raspberrypi systemd[1]: hostapd.service: Unit entered failed state.
7月 11 15:50:37 raspberrypi systemd[1]: hostapd.service: Failed with result 'exit-code'.
I'm new to Raspberry Pi. Would appreciate any help. Thank you in advance!
I just had this error happen to me - lengthening the PSK to >= 8 characters resolved the issue.
Today is the second time I've successfully set up a Raspberry Pi 0 W access point. This time i had this error:
ExecStart=/usr/sbin/hostapd -P /run/hostapd.pid -B $DAEMON_OPTS ${DAEMON_CONF} (code=exited, status=1/FAILURE)
After retracing my steps I found that i had made an error in the /etc/default/hostapd file.
I simply forget to enter the ending quotation " symbol at the end of the DAEMON_CONF string.
Also, the driver for the rpi0w in the hostapd.conf file should be nl80211, not brcmfmac.
You've likely made a simple error like I did. Check all your edits.
I've used this site's instructions for my setup
https://www.raspberrypi.org/documentation/configuration/wireless/access-point-routed.md
A trick to get a more specific error is to run the line of code pointed to by ExecStart:
/usr/sbin/hostapd -P /run/hostapd.pid -B $DAEMON_OPTS ${DAEMON_CONF}
Fill in $DAEMON_OPTS and ${DAEMON_CONF} with whatever values you have configured in /etc/default/hostapd.conf. Now you will see a better error, like mispelling of a config or a bad driver.