Portál AbcLinuxu, 6. května 2025 01:40
Vidím to v logoch, lebo som nastavil logovanie stavu offline/online a tiež som nastavil skript aby sa R-Pi každú pol-hodinu reštartoval ak je systém offline.To restartovani celeho RPi je zbytecne, staci pokud je to opravdu nutne restartovat sit, nebo jen DHCP, ale idealni by bylo zjistit pricinu. Mohl by jsi detailne popsat "som nastavil logovanie" a taky by se hodil ten " som nastavil skript" skript.
#!/bin/bash # internet connection check based on pinging public dns ip(s) IPtoCheck=("208.67.222.222" "208.67.220.220" "1.1.1.1" "1.0.0.1" "9.9.9.9" "149.112.112.112") countOnline=0 for ip in "${IPtoCheck[@]}" do sleep 10 if ping -q -c 1 -W 1 $ip >/dev/null then echo "$ip is online" countOnline=$((countOnline+1)) else echo "$ip is offline" fi done if [ $countOnline -gt 0 ] then echo "we are probably online" else echo "we are probably offline" # we are probably offline - need to reboot and hope modem will reconnect after reboot echo "rebooting..." sleep 60 echo $(date)" >> "$(realpath $0)" >> no internet connection (rebooting now)" >> /home/openhabian/logs sudo reboot fiTu je skript modem-autoconnect.sh, ktorý spúšťam cez systemd vždy pri štarte PC. V skripte som cenzuroval môj PIN pre SIM kartu v modeme, inak je skript ako originál.
#!/bin/bash echo $(date)" >> "$(realpath $0)" >> modem autoconnect starts" /home/openhabian/logs # if I do not use this delay - it sometimes does not work sleep 5 # unlocking the SIM card with PIN sudo mbimcli -d /dev/cdc-wdm0 -p --enter-pin=**** # if I do not use this delay - it sometimes does not work sleep 3 # connecting the modem to the internet sudo mbim-network /dev/cdc-wdm0 startTu je uvítacie info ktoré vidím po pripojení sa do terminálu cez SSH (zvýraznil som "podozrivé" riadky).
############################################################################### ############### openhabian ################################################## ############################################################################### ## Ip = Unable to parse ip . Please debug. ## Release = Raspbian GNU/Linux 11 (bullseye) ## Kernel = Linux 5.10.63-v7l+ ## Platform = none ## Uptime = 0 day(s). 9:13:42 ## CPU Usage = 1.01% avg over 4 cpu(s) (4 core(s) x 1 socket(s)) ## CPU Load = 1m: 0.24, 5m: 0.10, 15m: 0.05 ## Memory = Free: 0.45GB (24%), Used: 1.42GB (76%), Total: 1.87GB ## Swap = Free: 2.43GB (100%), Used: 0.00GB (0%), Total: 2.43GB ## Root = Free: 8.39GB (61%), Used: 5.31GB (39%), Total: 14.33GB ## Updates = 14 apt updates available. ## Sessions = 1 session(s) ## Processes = 145 running processes of 32768 maximum processes ############################################################################### _ _ _ ____ _ ___ ___ ___ ___ | | | | / \ | __ ) (_) ____ ___ / _ \ / _ \ / _ \ / _ \ | |_| | / _ \ | _ \ | | / _ \ / _ \ | (_) | (_) | __/| | | || _ | / ___ \ | |_) )| || (_) || | | | \___/| __/ \___/|_| |_||_| |_|/_/ \_\|____/ |_| \__|_||_| | | |_| openHAB 3.1.0 - Release Build
Dec 9 14:23:25 openhabian systemd[1]: comitup-web.service: Main process exited, code=exited, status=1/FAILURE Dec 9 14:23:25 openhabian systemd[1]: comitup-web.service: Failed with result 'exit-code'. Dec 9 14:23:31 openhabian systemd[1]: comitup-web.service: Scheduled restart job, restart counter is at 1422. Dec 9 14:23:31 openhabian systemd[1]: Stopped Comitup Web Service. Dec 9 14:23:31 openhabian systemd[1]: Started Comitup Web Service. Dec 9 14:23:31 openhabian comitup-web[21589]: Traceback (most recent call last): Dec 9 14:23:31 openhabian comitup-web[21589]: File "/usr/sbin/comitup-web", line 11 Dec 9 14:23:31 openhabian comitup-web[21589]: load_entry_point('comitup==1.31', 'console_scripts', 'comitup-web')() Dec 9 14:23:31 openhabian comitup-web[21589]: File "/usr/share/comitup/web/comitupweb.py", line 171, in main Dec 9 14:23:31 openhabian comitup-web[21589]: ciu_client.ciu_points() Dec 9 14:23:31 openhabian comitup-web[21589]: File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 141, in __call__ Dec 9 14:23:31 openhabian comitup-web[21589]: return self._connection.call_blocking(self._named_service, Dec 9 14:23:31 openhabian comitup-web[21589]: File "/usr/lib/python3/dist-packages/dbus/connection.py", line 652, in call_blocking Dec 9 14:23:31 openhabian comitup-web[21589]: reply_message = self.send_message_with_reply_and_block( Dec 9 14:23:31 openhabian comitup-web[21589]: dbus.exceptions.DBusException: org.freedesktop.DBus.Python.BrokenPipeError: Traceback (most recent call last): Dec 9 14:23:31 openhabian comitup-web[21589]: File "/usr/lib/python3/dist-packages/dbus/service.py", line 711, in _message_cb Dec 9 14:23:31 openhabian comitup-web[21589]: retval = candidate_method(self, *args, **keywords) Dec 9 14:23:31 openhabian comitup-web[21589]: File "/usr/share/comitup/comitup/statemgr.py", line 71, in access_points Dec 9 14:23:31 openhabian comitup-web[21589]: aps = iwscan.candidates() Dec 9 14:23:31 openhabian comitup-web[21589]: File "/usr/share/comitup/comitup/iwscan.py", line 106, in candidates Dec 9 14:23:31 openhabian comitup-web[21589]: p.start() Dec 9 14:23:31 openhabian comitup-web[21589]: File "/usr/lib/python3.9/multiprocessing/process.py", line 121, in start Dec 9 14:23:31 openhabian comitup-web[21589]: self._popen = self._Popen(self) Dec 9 14:23:31 openhabian comitup-web[21589]: File "/usr/lib/python3.9/multiprocessing/context.py", line 224, in _Popen Dec 9 14:23:31 openhabian comitup-web[21589]: return _default_context.get_context().Process._Popen(process_obj) Dec 9 14:23:31 openhabian comitup-web[21589]: File "/usr/lib/python3.9/multiprocessing/context.py", line 277, in _Popen Dec 9 14:23:31 openhabian comitup-web[21589]: return Popen(process_obj) Dec 9 14:23:31 openhabian comitup-web[21589]: File "/usr/lib/python3.9/multiprocessing/popen_fork.py", line 16, in __init__ Dec 9 14:23:31 openhabian comitup-web[21589]: util._flush_std_streams() Dec 9 14:23:31 openhabian comitup-web[21589]: File "/usr/lib/python3.9/multiprocessing/util.py", line 435, in _flush_std_streams Dec 9 14:23:31 openhabian comitup-web[21589]: sys.stdout.flush() Dec 9 14:23:31 openhabian comitup-web[21589]: BrokenPipeError: [Errno 32] Broken pipe
WIFI-HW WIFI WWAN-HW WWAN enabled disabled enabled enableNajradšej by som len nejako zablokoval len ten proces "dhcpcd" ktorý hlási SIGPIPE logy. Lebo ja potrebujem bluetooth a predpokladám, že ak sa mi aj podarí vypnúť wifi hardwerovo, tak prídem o bluetooth (?).
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.