Hat es schon jemand umgesetzt das er sich bei einem Verbindungsabbruch automatisch wieder verbindet?
Posts by Jetiman
-
-
Habe das gleiche mit dem Pi2 gemacht. Da Funktioniert es mit sudo systemctl enable watchdog.service
-
-
BTW: "stop" brauchst Du nach dem Installieren des wd, nicht. Mach mal nach dem enablen, start und danach einen reboot des PI.
Keine Änderung. Bleibt nach dem reboot aus.
Der pi 256 verhält sich in einigen Sachen echt anders.
-
So, sd karte grade neu gemacht.
Code
Display Moresudo apt-get install watchdog sudo systemctl status watchdog sudo systemctl stop watchdog sudo systemctl enable watchdog sudo reboot sudo systemctl status watchdog ● watchdog.service - watchdog daemon Loaded: loaded (/lib/systemd/system/watchdog.service; static) Active: inactive (dead)
Danach in der [font="Source Sans Pro, Tahoma, Helvetica Neue, Arial, sans-serif"][font="Source Sans Pro, Tahoma, Helvetica Neue, Arial, sans-serif"]In der [/font][font="Source Sans Pro, Tahoma, Helvetica Neue, Arial, sans-serif"]"/etc/watchdog.conf" habe ich "watchdog-device = /dev/watchdog" und "max-load-1 = 24" aktiviert[/font]
Funktioniert aber auch nicht.[/font]Ich habe nichts anderes gemacht. Das System ist ganz frisch.
Wieso geht es da bei mir nicht?
-
Moin,
nun rennt er. Hast du schon was in der "/etc/watchdog.conf" geändert??Gruss Bernd
In der [font="Source Sans Pro, Tahoma, Helvetica Neue, Arial, sans-serif"]"/etc/watchdog.conf" habe ich "watchdog-device = /dev/watchdog" und "max-load-1 = 24" aktiviert[/font]
Ich habe nur uv4l-server und den [font="Source Sans Pro, Tahoma, Helvetica Neue, Arial, sans-serif"]watchdog[/font] installiert.[font="Source Sans Pro, Tahoma, Helvetica Neue, Arial, sans-serif"]Nach dem reboot ist er wieder aus.[/font]
[font="Source Sans Pro, Tahoma, Helvetica Neue, Arial, sans-serif"]Irgendwo habe ich ein Fehler (Oder auch Denkfehler) drin.[/font]
-
OK. Wie Du aus dem Beitrag von DG8BR erkennen/sehen kannst, funktioniert der watchdog in jeder Hinsicht mit systemd. Evtl. liegt es an deinen manuellen Änderungen/Ergänzungen (... die Du anfangs für dich behalten hast), dass es jetzt nicht richtig funktioniert.
Hatte was an [font="Source Sans Pro, Tahoma, Helvetica Neue, Arial, sans-serif"]uv4l_uvc geändert, aber sonst nichts.[/font]
Habe dies aber rückgängig gemacht.Code
Display Morepi@raspberrypi:/etc/init.d $ sudo systemctl status watchdog ● watchdog.service - watchdog daemon Loaded: loaded (/lib/systemd/system/watchdog.service; static) Active: active (running) since Di 2016-04-26 23:59:11 CEST; 3s ago Process: 1709 ExecStart=/bin/sh -c [ $run_watchdog != 1 ] || exec /usr/sbin/watchdog $watchdog_options (code=exited, status=0/SUCCESS) Process: 1706 ExecStartPre=/bin/sh -c [ -z "${watchdog_module}" ] || [ "${watchdog_module}" = "none" ] || /sbin/modprobe $watchdog_module (code=exited, status=0/SUCCESS) Main PID: 1711 (watchdog) CGroup: /system.slice/watchdog.service └─1711 /usr/sbin/watchdog Apr 26 23:59:11 raspberrypi watchdog[1711]: starting daemon (5.14): Apr 26 23:59:11 raspberrypi watchdog[1711]: int=1s realtime=yes sync=no soft=no mla=24 mem=0 Apr 26 23:59:11 raspberrypi watchdog[1711]: ping: no machine to check Apr 26 23:59:11 raspberrypi watchdog[1711]: file: no file to check Apr 26 23:59:11 raspberrypi watchdog[1711]: pidfile: no server process to check Apr 26 23:59:11 raspberrypi watchdog[1711]: interface: no interface to check Apr 26 23:59:11 raspberrypi watchdog[1711]: temperature: no sensors to check Apr 26 23:59:11 raspberrypi watchdog[1711]: test=none(0) repair=none(0) alive=/dev/watchdog heartbeat=none to=root no_act=no force=no Apr 26 23:59:11 raspberrypi watchdog[1711]: cannot open /dev/watchdog (errno = 2 = 'No such file or directory') Apr 26 23:59:11 raspberrypi systemd[1]: Started watchdog daemon.
Apr 26 23:59:11 raspberrypi watchdog[1711]: cannot open /dev/watchdog (errno = 2 = 'No such file or directory')
-
Jetzt wäre auch der Zeitpunkt, wann manuell hinzugefügt und war das noch hinzugefügt, als Du enablen wolltest?
[/font]Nein.
Code
Display Morepi@raspberrypi:~ $ systemd-analyze blame 2.875s networking.service 2.157s keyboard-setup.service 1.800s dphys-swapfile.service 1.799s lightdm.service 1.589s uv4l_raspicam.service 1.457s systemd-logind.service 1.144s systemd-remount-fs.service 1.062s alsa-restore.service 1.059s console-setup.service 1.051s dhcpcd.service 953ms kbd.service 934ms triggerhappy.service 892ms udisks2.service 758ms systemd-fsck-root.service 618ms systemd-journal-flush.service 604ms avahi-daemon.service 577ms fake-hwclock.service 558ms systemd-setup-dgram-qlen.service 556ms systemd-modules-load.service 540ms ntp.service 515ms raspi-config.service 502ms hdparm.service 427ms systemd-udev-trigger.service 417ms polkitd.service 416ms kmod-static-nodes.service 368ms dev-mqueue.mount 348ms user@1000.service 345ms systemd-tmpfiles-setup.service 337ms plymouth-read-write.service 315ms rsyslog.service 283ms rc-local.service 261ms systemd-tmpfiles-setup-dev.service 228ms sys-kernel-config.mount 219ms systemd-fsck@dev-mmcblk0p1.service 218ms udev-finish.service 193ms sys-kernel-debug.mount 179ms systemd-sysctl.service 172ms systemd-user-sessions.service 168ms systemd-update-utmp-runlevel.service 126ms plymouth-quit-wait.service 113ms plymouth-quit.service 104ms sys-fs-fuse-connections.mount 102ms watchdog.service 100ms systemd-random-seed.service 91ms boot.mount 65ms systemd-update-utmp.service 63ms systemd-udevd.service 46ms systemd-rfkill@rfkill0.service pi@raspberrypi:~ $
Code
Display Morepi@raspberrypi:~ $ sudo systemctl enable watchdog Synchronizing state for watchdog.service with sysvinit using update-rc.d... Executing /usr/sbin/update-rc.d watchdog defaults Executing /usr/sbin/update-rc.d watchdog enable The unit files have no [Install] section. They are not meant to be enabled using systemctl. Possible reasons for having this kind of units are: 1) A unit may be statically enabled by being symlinked from another unit's .wants/ or .requires/ directory. 2) A unit's purpose may be to act as a helper for some other unit which has a requirement dependency on it. 3) A unit may be started when needed via activation (socket, path, timer, D-Bus, udev, scripted systemctl call, ...). pi@raspberrypi:~ $
reboot
-
Was hast Du aus dem /etc/init.d-Verzeichnis raus genommen? Hattest Du in dieses Verzeichnis, etwas manuell eingefügt?
Evtl. haben die Entwickler aus den aufgelisteten Gründen, das Enablen der watchdog.service-Unit, nicht vorgesehen.
Hatte den [font="Source Sans Pro, Tahoma, Helvetica Neue, Arial, sans-serif"]uv4l_uvc manuell hinzugefügt. Aber habe das anders gelöst.[/font]
[font="Source Sans Pro, Tahoma, Helvetica Neue, Arial, sans-serif"]Wieso/ seit wann funktioniert die normale Methode mit dem Watchdog nicht mehr?
[/font] -
Habe in aus /etc/init.d/ raus genommen.
Aber jetzt kommt:
Codepi@raspberrypi:~ $ sudo systemctl enable watchdog.service The unit files have no [Install] section. They are not meant to be enabled using systemctl. Possible reasons for having this kind of units are: 1) A unit may be statically enabled by being symlinked from another unit's .wants/ or .requires/ directory. 2) A unit's purpose may be to act as a helper for some other unit which has a requirement dependency on it. 3) A unit may be started when needed via activation (socket, path, timer, D-Bus, udev, scripted systemctl call, ...).
-
Code
Display Morepi@raspberrypi:~ $ sudo systemctl stop watchdog.service pi@raspberrypi:~ $ systemctl status watchdog.service ● watchdog.service - watchdog daemon Loaded: loaded (/lib/systemd/system/watchdog.service; static) Active: inactive (dead) since Di 2016-04-26 23:11:51 CEST; 4s ago Process: 1280 ExecStopPost=/bin/sh -c [ $run_wd_keepalive != 1 ] || false (code=exited, status=1/FAILURE) Process: 596 ExecStart=/bin/sh -c [ $run_watchdog != 1 ] || exec /usr/sbin/watchdog $watchdog_options (code=exited, status=0/SUCCESS) Process: 587 ExecStartPre=/bin/sh -c [ -z "${watchdog_module}" ] || [ "${watchdog_module}" = "none" ] || /sbin/modprobe $watchdog_module (code=exited, status=0/SUCCESS) Main PID: 606 (code=exited, status=0/SUCCESS) pi@raspberrypi:~ $ sudo systemctl enable watchdog.service Synchronizing state for watchdog.service with sysvinit using update-rc.d... Executing /usr/sbin/update-rc.d watchdog defaults insserv: warning: script 'uv4l_uvc' missing LSB tags and overrides insserv: There is a loop between service watchdog and uv4l_uvc if stopped insserv: loop involving service uv4l_uvc at depth 2 insserv: loop involving service watchdog at depth 1 insserv: Stopping uv4l_uvc depends on watchdog and therefore on system facility `$all' which can not be true! insserv: exiting now without changing boot order! update-rc.d: error: insserv rejected the script header *** Error in `systemctl': double free or corruption (fasttop): 0x7f99afe8 *** pi@raspberrypi:~ $ sudo systemctl start watchdog.service pi@raspberrypi:~ $ systemctl status watchdog.service ● watchdog.service - watchdog daemon Loaded: loaded (/lib/systemd/system/watchdog.service; static) Active: active (running) since Di 2016-04-26 23:12:08 CEST; 7s ago Process: 1280 ExecStopPost=/bin/sh -c [ $run_wd_keepalive != 1 ] || false (code=exited, status=1/FAILURE) Process: 1417 ExecStart=/bin/sh -c [ $run_watchdog != 1 ] || exec /usr/sbin/watchdog $watchdog_options (code=exited, status=0/SUCCESS) Process: 1414 ExecStartPre=/bin/sh -c [ -z "${watchdog_module}" ] || [ "${watchdog_module}" = "none" ] || /sbin/modprobe $watchdog_module (code=exited, status=0/SUCCESS) Main PID: 1419 (watchdog) CGroup: /system.slice/watchdog.service └─1419 /usr/sbin/watchdog
-
Moin,
oh ha!!Aber ein crontab-eintrag schreiben.
Gut, jeder nach seiner facon.Gruss Bernd
Funktioniert so aber
euch
Edit: Werde ich
-
Jetiman: Warum probierst du meinen Vorschlag nicht??
So versiert bin ich in der Sache nicht.
Habe es jetzt in der crontab mit @reboot sudo systemctl start watchdog.service -
Code
Display Morepi@raspberrypi:~ $ sudo systemctl start watchdog.service pi@raspberrypi:~ $ systemctl status watchdog.service ● watchdog.service - watchdog daemon Loaded: loaded (/lib/systemd/system/watchdog.service; static) Active: active (running) since Di 2016-04-26 22:20:41 CEST; 5s ago Process: 1615 ExecStart=/bin/sh -c [ $run_watchdog != 1 ] || exec /usr/sbin/watchdog $watchdog_options (code=exited, status=0/SUCCESS) Process: 1612 ExecStartPre=/bin/sh -c [ -z "${watchdog_module}" ] || [ "${watchdog_module}" = "none" ] || /sbin/modprobe $watchdog_module (code=exited, status=0/SUCCESS) Main PID: 1617 (watchdog) CGroup: /system.slice/watchdog.service └─1617 /usr/sbin/watchdog pi@raspberrypi:~ $
Okay, mit
startet er neu. Zwar schneller als die eingestellte 1 Minute aber naja
Was muss ich tun damit der automatisch startet?
Und wieso funktioniert die alte Methode nicht mehr? :s
-
-
Code
Display Morepi@raspberrypi:~ $ sudo apt-get install watchdog Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: watchdog 0 upgraded, 1 newly installed, 0 to remove and 72 not upgraded. Need to get 78.1 kB of archives. After this operation, 179 kB of additional disk space will be used. Get:1 http://mirrordirector.raspbian.org/raspbian/ jessie/main watchdog armhf 5.14-3 [78.1 kB] Fetched 78.1 kB in 0s (123 kB/s) Preconfiguring packages ... Selecting previously unselected package watchdog. (Reading database ... 126386 files and directories currently installed.) Preparing to unpack .../watchdog_5.14-3_armhf.deb ... Unpacking watchdog (5.14-3) ... Processing triggers for systemd (215-17+deb8u4) ... Processing triggers for man-db (2.7.0.2-5) ... Setting up watchdog (5.14-3) ... /run/udev or .udevdb or .udev presence implies active udev. Aborting MAKEDEV invocation. /run/udev or .udevdb or .udev presence implies active udev. Aborting MAKEDEV invocation. update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults Processing triggers for systemd (215-17+deb8u4) ... pi@raspberrypi:~ $ systemctl list-unit-files | grep -i watchdog watchdog.service static
-
Hi,
ich habe noch einen Pi erster Generation liegen. (256 ram)
Nun bin ich bei gegangen und lade mir das Raspbian Jessie lite vom 2016-03-18 von raspberrypi.org.
Lade mir den watchdog "sudo apt-get install watchdog" runter.Wenn ich jetzt mit "sudo modprobe bcm2708_wdog" ihn aktivieren meint er "modprobe: FATAL: Module bcm2708_wdog not found.".
Habe auch schon einmal versucht alles vorher zu aktualisieren inklusive rpi-update aber der Fehler war immer noch vorhanden.
Woran liegt das?
-
Hallo,
ich habe von der Telekom einen Hybrid Anschluss.
Da es Probleme gibt mit MySql+LTE möchte das die Verbindungen nur über DSL geht und nicht über LTE.Das ist auch soweit auch kein Problem, ich kann im Router festlegen das bestimmte Ports nur über DSL gehen und nicht über LTE.
Wenn ich den Port 3306 auf DSL schalte, funktioniert volkszaehler. Der nachteil ist aber dann das alle MySql Verbindungen über DSL gehen.PS: volkszaehler ist auf dem PI - MySQL auf einem RootServer.
Jetzt wollte ich einfach eine Portweiterleitung von zb. 1234 auf 3306 auf dem Root einstellen.
Port 1234 im Router nur über DSL.Aber....
Wie stelle ich das mit volkszaehler an?Wenn ich in der "volkszaehler.conf.php" aus
$config['db']['host'] = 'RootServerIP';
einfach
$config['db']['host'] = 'RootServerIP:1234';
mache, verbindet er nicht zum RootServer, auch nicht wenn ich da
$config['db']['host'] = 'RootServerIP:3306';
nehme.Woran kann das liegen?
Danke im voraus
-
Okay, habe das nun etwas anders gelöst.
Ich sagte ja, ich kann die Sprache nicht so ^^.Bash
Display More#!/bin/bash # Den Zustand des Eingangs lesen previous=$(gpio read 6) # Endlose Schleife while true do # Den Zustand des Eingangs lesen pin=$(gpio read 6) # Wenn der Eingang von 0 auf 1 gewechselt hat if [ $pin -gt $previous ] then # Das Programm starten echo "Hier das Programm starten" /home/pi/gpio/zahler/middleware/zahler1.sh & else # Eine 0,3 Sekunde schlafen, damit der Prozessor nicht so sehr belastet wird sleep 0.3 fi # Der aktuelle Wert wird der alte Wert für den nächsten Durchlauf previous=$pin done
-
Hi,
ich bin in C nicht so gut, wenn nicht schlecht
Nun möchte ich ein Beispiel Script von WiringPi erweitern, weiss aber nicht wie.
https://github.com/WiringPi/Wi…lob/master/examples/isr.c
C
Display More/* * isr.c: * Wait for Interrupt test program - ISR method * * How to test: * Use the SoC's pull-up and pull down resistors that are avalable * on input pins. So compile & run this program (via sudo), then * in another terminal: * gpio mode 0 up * gpio mode 0 down * at which point it should trigger an interrupt. Toggle the pin * up/down to generate more interrupts to test. * * Copyright (c) 2013 Gordon Henderson. *********************************************************************** * This file is part of wiringPi: * https://projects.drogon.net/raspberry-pi/wiringpi/ * * wiringPi is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * wiringPi is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with wiringPi. If not, see <http://www.gnu.org/licenses/>. *********************************************************************** */ #include <stdio.h> #include <string.h> #include <errno.h> #include <stdlib.h> #include <wiringPi.h> // What GPIO input are we using? // This is a wiringPi pin number #define BUTTON_PIN 0 // globalCounter: // Global variable to count interrupts // Should be declared volatile to make sure the compiler doesn't cache it. static volatile int globalCounter = 0 ; /* * myInterrupt: ********************************************************************************* */ void myInterrupt (void) { ++globalCounter ; } /* ********************************************************************************* * main ********************************************************************************* */ int main (void) { int myCounter = 0 ; if (wiringPiSetup () < 0) { fprintf (stderr, "Unable to setup wiringPi: %s\n", strerror (errno)) ; return 1 ; } if (wiringPiISR (BUTTON_PIN, INT_EDGE_FALLING, &myInterrupt) < 0) { fprintf (stderr, "Unable to setup ISR: %s\n", strerror (errno)) ; return 1 ; } for (;;) { printf ("Waiting ... ") ; fflush (stdout) ; while (myCounter == globalCounter) delay (100) ; printf (" Done. counter: %5d\n", globalCounter) ; myCounter = globalCounter ; } return 0 ; }
Das Script Funktioniert soweit.
Nun möchte ich das er beim Counter hochzählen ein .sh script aufruft. Weiss aber halt nicht genau wie ich es anstellen soll.Wäre super wenn mir da jemand helfen könnte.