Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. ioBroker Allgemein
    4. Iphone verliert immer das wlan???

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    Iphone verliert immer das wlan???

    This topic has been deleted. Only users with topic management privileges can see it.
    • Thomas Braun
      Thomas Braun Most Active @denjo last edited by Thomas Braun

      @denjo sagte in Iphone verliert immer das wlan???:

      wobei datei und ordner da sind sehe ich ja über filezilla

      Du hast ja auch mein Login prompt als Befehl eingegeben. Das funktioniert natürlich nicht.

      chmod 0754

      Hatte ich bewusst so gesetzt. Das Skript muss nicht für User außerhalb des iobrokers ausführbar sein.

      D 1 Reply Last reply Reply Quote 0
      • OliverIO
        OliverIO @denjo last edited by OliverIO

        @denjo
        Du hast bei den curl Befehlen den falschen Port eingetragen. Simple api horcht bei mir auf 8087

        OliverIO 1 Reply Last reply Reply Quote 0
        • D
          denjo @Thomas Braun last edited by

          @thomas-braun

          sudo -u iobroker chmod 0754 /opt/iobroker/cmd/iphone.sh
          

          habe das jetzt nochmal ausgeführt nun sind die rechte auf 754
          und den port habe ich auf 5663 wie im adapter steht geämdert.

          was soll ich jetzt genau eingeben zum testen?

          Thomas Braun 1 Reply Last reply Reply Quote 0
          • Thomas Braun
            Thomas Braun Most Active @denjo last edited by

            @denjo sagte in Iphone verliert immer das wlan???:

            /opt/iobroker/cmd/iphone.sh

            Du kannst jetzt z. B. in das Verzeichnis wechseln und das skript auf der Konsole ausführen:

            cd /opt/iobroker/cmd/iphone.sh
            ./iphone.sh
            

            Dann siehst du schon mal ob es drundsätzlich läuft.
            Das dann ggf. in den ioBroker einweben ist der nächste Step.
            Kann dir @OliverIO bestimmt noch helfen.

            D 1 Reply Last reply Reply Quote 0
            • D
              denjo @Thomas Braun last edited by

              @thomas-braun
              habe jetzt die meldung

              pi@raspberrypi:/opt/iobroker/cmd $ ./iphone.sh
              PING 192.168.178.82 (192.168.178.82) 56(84) bytes of data.
              From 192.168.178.98 icmp_seq=1 Destination Host Unreachable
              
              --- 192.168.178.82 ping statistics ---
              1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms
              
              Phone 192.168.178.82 is not present
              curl: (52) Empty reply from server
              pi@raspberrypi:/opt/iobroker/cmd $
              
              

              das iphone ist gerade nicht da

              1 Reply Last reply Reply Quote 0
              • OliverIO
                OliverIO @OliverIO last edited by OliverIO

                @denjo sagte in Iphone verliert immer das wlan???:

                curl: (52) Empty reply from server

                hast du den simple api adapter installiert?
                hast du die portnummer angepasst?
                hast du datenpunkte angelegt, wo der status eingetragen werden soll?
                hast du die ggfs datenpunktbezeichnungen in den zeilen mit curl angepasst?

                D 1 Reply Last reply Reply Quote 0
                • D
                  denjo @OliverIO last edited by

                  @oliverio ja alles gemacht

                  OliverIO 1 Reply Last reply Reply Quote 0
                  • OliverIO
                    OliverIO @denjo last edited by OliverIO

                    @denjo

                    dann dein angepasstes script hier nochmal posten

                    deine Ausgabe sollte ungefähr so aussehen. Hier mit 2 IP-Adressen.
                    eine erreichbar, eine nicht erreichbar

                    PING 192.168.1.209 (192.168.1.209) 56(84) bytes of data.
                    From 192.168.1.85 icmp_seq=1 Destination Host Unreachable
                    
                    --- 192.168.1.209 ping statistics ---
                    1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms
                    
                    Phone 192.168.1.209 is not present
                    {"id":"0_userdata.0.Anwesenheit.192-168-1-209","value":0,"val":0}PING 192.168.1.225 (192.168.1.225) 56(84) bytes of data.
                    
                    --- 192.168.1.225 ping statistics ---
                    1 packets transmitted, 0 received, 100% packet loss, time 0ms
                    
                    Phone 192.168.1.225 is detected!
                    
                    D 1 Reply Last reply Reply Quote 0
                    • D
                      denjo @OliverIO last edited by

                      @OliverIO

                      function wakeIphone() {
                          exec("bash /opt/iobroker/cmd/iphone.sh")
                      }
                       
                      schedule ("*/3 * * * *", function(){
                              wakeIphone();  
                      });
                       
                      
                      OliverIO 1 Reply Last reply Reply Quote 0
                      • OliverIO
                        OliverIO @denjo last edited by

                        @denjo

                        ok und jetzt nochmal iphone.sh
                        nur da musstest du ja etwas anpassen

                        D 1 Reply Last reply Reply Quote 0
                        • D
                          denjo @OliverIO last edited by denjo

                          @oliverio

                          #!/bin/bash
                           #Enter your ip of your device here
                          DEVICES="192.168.178.82"
                           
                          for i in `echo $DEVICES`; do
                           
                              ping $i -c 1 
                              hping3 -2 -c 10 -p 5353 -i u1 $i -q >/dev/null 2>&1
                              sleep 1
                              # Only arp specific device, grep for a mac-address
                              status=`arp -an $i | awk '{print $4}' | grep "..:..:..:..:..:.."`
                              #A mac will be 17 characters including the ":"
                              IP=${i//./-}
                              if [ ${#status} -eq 17 ]; then
                                  echo "Phone $i is detected!"
                           		curl http://192.168.178.98:5663/set/0_userdata.0.Anwesenheit.$IP?value=1
                              else
                                  echo "Phone $i is not present"
                           		curl http://192.168.178.98:5663/set/0_userdata.0.Anwesenheit.$IP?value=0
                              fi
                          done
                          
                          

                          das ist der erstellte datenpunkt

                          "_id": "0_userdata.0.Anwesenheit",
                          
                          pi@raspberrypi:/opt/iobroker/cmd $ pi@raspberrypi:/opt/iobroker/cmd $ ./iphone.sh
                          
                          --- 192.168.178.82 ping statistics ---
                          1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms
                          -bash: pi@raspberrypi:/opt/iobroker/cmd: Datei oder Verzeichnis nicht gefunden
                          
                          Phone 192.168.178.82 is not present
                          curl: (52) Empty reply from server
                          
                          
                          OliverIO 1 Reply Last reply Reply Quote 0
                          • OliverIO
                            OliverIO @denjo last edited by OliverIO

                            @denjo

                            ok
                            1.)
                            du musst auch noch die Datenpunkte für die IP anlegen.
                            Das macht das Script oder der simple api adapter nicht
                            also im iobroker Objektbaum den "Ordner" Anwesenheit auswählen,
                            dann + Knopf drücken
                            dann
                            192-168-178-82

                            mit Typ Zeichenkette anlegen

                            2.)

                            Warum steht da in der curl zeile als port 5663?
                            wie ist die einstellung im iobroker bei deiner instanz für simple api?
                            bei mir sieht es so aus. also steht bei mir an der stelle der port 8087

                            dba1deb3-1666-4f4c-9b61-3a83536e94c0-image.png

                            D 1 Reply Last reply Reply Quote 0
                            • D
                              denjo @OliverIO last edited by

                              @oliverio achso dachte anwesenheit muss ein objekt sein. jetzt habe ich einen ordner und da drin ein objekt "number" mit 192-168-178-82

                              pi@raspberrypi:/opt/iobroker/cmd $ ./iphone.sh
                              PING 192.168.178.82 (192.168.178.82) 56(84) bytes of data.
                              From 192.168.178.98 icmp_seq=1 Destination Host Unreachable
                              
                              --- 192.168.178.82 ping statistics ---
                              1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms
                              
                              Phone 192.168.178.82 is not present
                              curl: (52) Empty reply from server
                              
                              

                              ja den port hatte ich irgendwann mal geändert der ist wirklich 5663

                              OliverIO 1 Reply Last reply Reply Quote 0
                              • OliverIO
                                OliverIO @denjo last edited by

                                @denjo

                                @denjo sagte in Iphone verliert immer das wlan???:

                                curl: (52) Empty reply from server

                                irgendwas stimmt dann an dem link nicht oder am datenpunkt.

                                warum hast du jetzt number genommen?

                                @oliverio sagte in Iphone verliert immer das wlan???:

                                dann
                                192-168-178-82
                                mit Typ Zeichenkette anlegen

                                bitte aufmerksam lesen und genau das machen was da steht, sonst kann sich das hier nochmal hinziehen.

                                dann bitte in die datenpunkteinstellung gehen und im reiter "raw" den kasten markieren und kopieren.
                                bei mir sieht es so aus

                                {
                                  "_id": "0_userdata.0.Anwesenheit.192-168-1-209",
                                  "type": "state",
                                  "common": {
                                    "name": "IPhone",
                                    "role": "",
                                    "type": "string",
                                    "read": true,
                                    "write": true,
                                    "desc": "Manuell erzeugt",
                                    "def": "",
                                    "custom": {
                                      "history.0": {
                                        "enabled": true,
                                        "changesOnly": true,
                                        "debounce": 0,
                                        "maxLength": "10",
                                        "retention": "31536000",
                                        "changesRelogInterval": 0,
                                        "changesMinDelta": 0,
                                        "aliasId": ""
                                      }
                                    }
                                  },
                                  "native": {},
                                  "from": "system.adapter.admin.0",
                                  "user": "system.user.admin",
                                  "ts": 1626116496107,
                                  "acl": {
                                    "object": 1636,
                                    "state": 1636,
                                    "owner": "system.user.admin",
                                    "ownerGroup": "system.group.administrator"
                                  }
                                }
                                

                                Falls der _id und der type und der common.type nicht ähnlich aussieht,
                                dan lösche den ganzen Ast nochmal,
                                markiere 0_userdata.0 drücke dann den Plus-Knopf und gebe das folgende ein

                                Anwesenheit.192-168-178-82
                                

                                Es wird dann zwar genauso aussehen, aber die innere Struktur ist dennoch eine andere.

                                D 1 Reply Last reply Reply Quote 0
                                • D
                                  denjo @OliverIO last edited by denjo

                                  @oliverio das ist das objekt

                                  {
                                    "common": {
                                      "name": "192-168-178-82",
                                      "desc": "Manuell erzeugt",
                                      "role": "state",
                                      "type": "string",
                                      "read": true,
                                      "write": true,
                                      "def": ""
                                    },
                                    "type": "state",
                                    "from": "system.adapter.admin.0",
                                    "user": "system.user.admin",
                                    "ts": 1638458158185,
                                    "_id": "0_userdata.0.Anwesenheit.192-168-178-82",
                                    "acl": {
                                      "object": 1636,
                                      "state": 1636,
                                      "owner": "system.user.admin",
                                      "ownerGroup": "system.group.administrator"
                                    }
                                  }
                                  

                                  und das kommt jetzt wieder

                                  pi@raspberrypi:/opt/iobroker/cmd $ ./iphone.sh
                                  PING 192.168.178.82 (192.168.178.82) 56(84) bytes of data.
                                  From 192.168.178.98 icmp_seq=1 Destination Host Unreachable
                                  
                                  --- 192.168.178.82 ping statistics ---
                                  1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms
                                  
                                  Phone 192.168.178.82 is not present
                                  curl: (52) Empty reply from server
                                  
                                  

                                  jetzt ist meine freundin wieder da und ich habe die meldung

                                  pi@raspberrypi:/opt/iobroker/cmd $ ./iphone.sh
                                  PING 192.168.178.82 (192.168.178.82) 56(84) bytes of data.
                                  64 bytes from 192.168.178.82: icmp_seq=1 ttl=64 time=5.56 ms
                                  
                                  --- 192.168.178.82 ping statistics ---
                                  1 packets transmitted, 1 received, 0% packet loss, time 0ms
                                  rtt min/avg/max/mdev = 5.560/5.560/5.560/0.000 ms
                                  Phone 192.168.178.82 is detected!
                                  curl: (52) Empty reply from server
                                  
                                  

                                  aber am objekt ändert sich nix

                                  1 Reply Last reply Reply Quote 0
                                  • OliverIO
                                    OliverIO last edited by

                                    @denjo
                                    irgendwas stimmt mit dem simple-api adapter nicht

                                    ich habe gerade mal ausprobiert was passiert wenn der datenpunkt einen falschen namen hat oder wenn der simpleapi adapter nicht läuft

                                    curl: (7) Failed to connect to 192.168.1.85 port 8087: Verbindungsaufbau abgelehnt
                                    
                                    "error: datapoint \"0_userdata.0.Anwesenheitx.192-168-1-225\" not found"
                                    

                                    das sind jetzt die rückmeldungen an der stelle wo bei dir curl: (52) Empty reply from server
                                    dazu finde ich aber hier im forum keine hilfreicdhe antwort

                                    probier mal das folgende direkt auf der kommandozeile

                                    curl http://192.168.1.85:8087/get/0_userdata.0.Anwesenheit.192-168-1-209
                                    

                                    natürlich die ip und port des iobrokers anpassen, sowie den Datenpunktnamen anpassen
                                    Beachte das get anstatt des set

                                    da sollte sowas zurückkommen

                                    {"val":0,"ack":false,"ts":1626116496107,"q":0,"from":"system.adapter.admin.0","user":"system.user.admin","lc":1638449061416,"_id":"0_userdata.0.Anwesenheit.192-168-1-209","type":"state","common":{"name":"IPhone","role":"","type":"string","read":true,"write":true,"desc":"Manuell erzeugt","def":"","custom":{"history.0":{"enabled":true,"changesOnly":true,"debounce":0,"maxLength":"10","retention":"31536000","changesRelogInterval":0,"changesMinDelta":0,"aliasId":""}}},"native":{},"acl":{"object":1636,"state":1636,"owner":"system.user.admin","ownerGroup":"system.group.administrator"}}
                                    

                                    probiere auch mal andere existierende Datenpunkte aus.

                                    D 1 Reply Last reply Reply Quote 0
                                    • D
                                      denjo @OliverIO last edited by denjo

                                      @oliverio

                                      pi@raspberrypi:~ $ curl http://192.168.178.98:5663/get/0_userdata.0.Anwesenheit.192-168-178-82
                                      {"val":"","ack":true,"ts":1638458158185,"q":32,"from":"system.adapter.admin.0","user":"system.user.admin","lc":1638458158198,"common":{"name":"192-168-178-82","desc":"Manuell erzeugt","role":"state","type":"string","read":true,"write":true,"def":""},"type":"state","_id":"0_userdata.0.Anwesenheit.192-168-178-82","acl":{"object":1636,"state":1636,"owner":"system.user.admin","ownerGroup":"system.group.administrator"}}pi@raspberrypi:~ $
                                      
                                      

                                      Screenshot 2021-12-02 172306.jpg

                                      ich habe auch gerade gesehen das ich zwei dateien jetzt in den cmd ordner drin habe
                                      iphone.sh
                                      iphone.sh.save

                                      OliverIO 1 Reply Last reply Reply Quote 0
                                      • OliverIO
                                        OliverIO @denjo last edited by

                                        @denjo sagte in Iphone verliert immer das wlan???:

                                        curl http://192.168.178.98:5663/get/0_userdata.0.Anwesenheit.192-168-178-82

                                        und jetzt auf der kommandozeile

                                        curl http://192.168.178.98:5663/set/0_userdata.0.Anwesenheit.192-168-178-82?value=1
                                        

                                        oder eine andere zahl als 1 damit du veränderung siehst

                                        D 1 Reply Last reply Reply Quote 0
                                        • D
                                          denjo @OliverIO last edited by denjo

                                          @oliverio ja hat sich auf 1 geändert

                                          also langsam schnall ich das auch so alles wie das funktioniert aber bin ratlos

                                          OliverIO 1 Reply Last reply Reply Quote 0
                                          • O
                                            Olfrygt last edited by

                                            für was brauchst du denn diese true false?
                                            ich haben meine anwesenheit z.b. mit dem yahka adapter geregelt, funktioniert super.
                                            im yahka ein gerät erstellt und am iphone eine automation bei ankommen und verlassen

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate
                                            FAQ Cloud / IOT
                                            HowTo: Node.js-Update
                                            HowTo: Backup/Restore
                                            Downloads
                                            BLOG

                                            903
                                            Online

                                            31.9k
                                            Users

                                            80.1k
                                            Topics

                                            1.3m
                                            Posts

                                            ping adapter
                                            10
                                            65
                                            4134
                                            Loading More Posts
                                            • Oldest to Newest
                                            • Newest to Oldest
                                            • Most Votes
                                            Reply
                                            • Reply as topic
                                            Log in to reply
                                            Community
                                            Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                                            The ioBroker Community 2014-2023
                                            logo