Ankündigung

Einklappen
Keine Ankündigung bisher.

Raspberry Image Version 2.2 mit SmarthomeNG 1.5.1

Einklappen
Dieses Thema ist geschlossen.
X
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    Bezüglich develop Version kann ich mir ein Skript vorstellen, das zwischen dev u master hin und her schalten lässt.

    Pymodbus schau ich mir an.

    Config: Es ist halt alles 1:1 aus SmarthomeNG. Da schon im Image vorzukonfigurieren finde ich nicht so gut. Hilfe gibt es auf der sh github Seite

    Kommentar


      Hi, ich habe gesehen das PyModbus auch für SmarthomeNG angefordert wurde, kann sein, dass das demnächst dann drin ist...

      Kommentar


        Funzt das Image auch mit einem PI Zero W?
        Geniale Menschen sind selten ordentlich, ordentliche selten genial. (Albert Einstein)

        Kommentar


          Vielen Dank erstmal für das tolle Image!

          ich habe das System jetzt das zweite mal aufgesetzt, da ich Probleme mit den Rechten und mir diese zerschossen habe.

          Nun aber stehe ich vor einem, hoffentlich kleinem, Problem.

          Es betrifft die Kommunikation zwischen SmartVisu und SmarthomeNG,
          ich habe mehrere plugin.yaml Einstellungen probiert, in der SmartVisu bekomme ich aber
          immer Websocket Error undefined. Das Backend ist auch nicht aufrufbar (http://192.168.1.77:8383/) (http://192.168.1.77 - jedoch zeigt die defaultSite an)

          SmartVisu Einstellungen:
          System: SmartHome.py
          Host: 192.168.1.77 (IP des Raspberry)
          Port: 2424
          Reconnect: ON

          Meine plugin.yaml:

          Code:
          %YAML 1.1
          ---
          BackendServer:
              class_name: BackendServer
              class_path: plugins.backend
              user: admin
              password: admin
          
          knx:
              class_name: KNX
              class_path: plugins.knx
              host: 127.0.0.1
              port: 6720
          #     send_time: 600    # update date/time every 600 seconds, default none
          #     time_ga: 13/0/0    # default none
          #     date_ga: 6/0/1    # default none
          #     busmonitor: True  # log all knx messages, default false
          #     readonly: True    ## don't write to knx bus, default false"
          #     instance: default
          
          websocket:
              class_name: WebSocket
              clas_path: plugins.visu_websocket
          #    wsproto: 4
          #    acl: rw
          
          smartvisu:
              class_name: SmartVisu
              class_path: plugins.visu_smartvisu
              smartvisu_dir: /var/www/html/smartvisu
          
          cli:
              class_name: CLI
              class_path: plugins.cli
              ip: 192.168.1.77
              update: 'True'
          #   password: admin
          
          sql:
              class_name: SQL
              class_path: plugins.sqlite
          
          # ow:
          #     class_name: OneWire
          #     class_path: plugins.onewire
          #     host: 127.0.0.1
          #     port: 4304
          
          # visu:
          #     class_name: WebSocket
          #     class_path: plugins.visu
          #     smartvisu_dir: /var/www/html/smartVISU
          tail /usr/local/smarthome/var/log/smarthome.log

          Code:
          2017-06-14  23:18:47 INFO     Main         Loading '/usr/local/smarthome/etc/plugin.yaml' to 'OrderedDict'
          2017-06-14  23:18:47 ERROR    Main         Unhandled exception: string indices must be integers
          <class 'TypeError'>
            File "/usr/local/smarthome/bin/smarthome.py", line 653, in <module>
              sh.start()
            File "/usr/local/smarthome/bin/smarthome.py", line 315, in start
              self._plugins = lib.plugin.Plugins(self, configfile=self._plugin_conf_basename)
            File "/usr/local/smarthome/lib/plugin.py", line 61, in __init__
              value = _conf[plugin][arg]
          Zuletzt geändert von schorge; 14.06.2017, 22:22.
          RaspberryPi B+ und Pi2, Enertex KNXnet/IP Interface u TULIP, XS1-FS20, QNap TS-212, OpenELEC, Asterisk TK

          Kommentar


            Hallo, ich brauche noch mal eien Tip, habe Probleme bei der Installation der richtigen pymodbus Version...

            Im Pluggit Plugin wird die Google Version verwendet:
            # pymodbus library from https://code.google.com/p/pymodbus/
            Code:
             [B]Installing[/B]
            
            
            You can install using pip or easy install by issuing the following commands in a terminal window (make sure you have correct permissions or a virtualenv currently running):  easy_install -U pymodbus pip install -U pymodbus
            
            Otherwise you can pull the trunk source and install from there:  svn checkout http://pymodbus.googlecode.com/svn/trunk/ pymodbus-read-only cd pymodbus-read-only python setup.py install
            Das hatte ich so auch unter SH gemacht aber massive Probleme mit dem Bus bekommen , manche Konvertierungen scheinenn einfach nicht zu gehen...

            Um das Modbus Problem einzugrenzen habe ich ein Jessi light installiert, dann
            Code:
            sudo apt-get update && sudo apt-get upgrade
            und danach
            Code:
            sudo apt-get install python-pymodbus
            Darauf hin hatte ich eine funktionierende Python Umgebung incl. Pymodbus und konnte alles vom Bus lesen wie geplant...

            Mit der Obigen SH Installation funktionieren identische Logiken nicht... also ein Problem der Pymodbus Version...

            Code:
            sudo apt-get update && sudo apt-get upgrade
            auf dem SH Image scheitert an der Stick Größe -> Platte Voll

            Code:
            sudo apt-get update
            sudo apt-get install python-pymodbus
            führt nun wieder zu einer defekten??? pymodbus Instllation
            Code:
            2017-06-15 17:50:07 ERROR    plugin       Main         Plugin Solaredge exception: No module named 'pymodbus' -- plugin.py:__init__:94
            Traceback (most recent call last):
              File "/usr/local/smarthome/lib/plugin.py", line 90, in __init__
                plugin_thread = PluginWrapper(smarthome, plugin, classname, classpath, args, instance)
              File "/usr/local/smarthome/lib/plugin.py", line 127, in __init__
                exec("import {0}".format(classpath))
              File "<string>", line 1, in <module>
              File "/usr/local/smarthome/plugins/solaredge/__init__.py", line 31, in <module>
                from pymodbus.constants import Endian
            Ich vermute nun, dass das ggf an verschienen Python versione liegt - blicke da aber nicht wirklich durch - wie komme ich weiter?

            Ratlos.. Uwe
            Zuletzt geändert von bmx; 16.06.2017, 11:48.

            Kommentar


              Hast Du mit pip3 installiert? Sonst hat pip Dir pymodbus in die Python 2.7 Installation installiert.
              Viele Grüße
              Martin

              There is no cloud. It's only someone else's computer.

              Kommentar


                Aktuell habe ich ohne PIP installiert...

                Code:
                sudo apt-get update
                sudo apt-get install python-pymodbus
                geht das dann auch schief?

                Auf dem Jessi Light läuft es damit...
                Zuletzt geändert von bmx; 16.06.2017, 11:47.

                Kommentar


                  Hattest du denn im Jessi Python 2 oder 3 installiert und verwendet?

                  Kommentar


                    Habe gerade Jessi hochgefahren, wie sehe ich das ?

                    In Skript steht #!/usr/bin/env python ---------> geändert auf python3 läuft aber auch
                    Beim SH steht dort #!/usr/bin/env python3

                    Aufrufen mit
                    Code:
                    python /home/pi/modbustest.py
                    Sorry kein Plan von den ganzen Versionen...

                    PS: gerade gesehen, es ist Python 2 wohl... mal sehen ob ich auch Python3 testen kann...
                    Code:
                    pi@raspberrypi-test:~ $ python
                    Python 2.7.9 (default, Sep 17 2016, 20:26:04)
                    [GCC 4.9.2] on linux2
                    Ich installiere Python 3.4 mal nach , Jessi light hat nur 2.4 dabei...
                    Vermutlich habe ich dann den selben Fehler wie unter SH...

                    De Eigentliche Frage: Wie installiere ich das mittels PIP korrekt das es dann auch läuft... bzw. kann ich die selbe Version von Pymodbus nutzen... ichhabe Syntaktische Fehler unter Python 3, die ich bei Jessi (2.4.) nicht hatte... ggf hat sich hier aber auch Pymodbus verändert, ich werde das mal im Jessi testen...


                    und bin gescheitert: nach:
                    Code:
                    sudo apt-get install python3
                    
                    sudo apt-get install python3-setuptools
                    sudo apt-get install python3-pip
                    
                    sudo easy_install3 -U pymodbus
                    
                    >
                    File "/tmp/easy_install-xio33owb/pymodbus-1.2.0/pymodbus/__init__.py", line 37
                    True, False = (1 == 1), (0 == 1)
                    ^
                    SyntaxError: can't assign to keyword
                    Zuletzt geändert von bmx; 16.06.2017, 11:47.

                    Kommentar


                      Was ist wenn du es beim Image mit dem installierst?
                      Code:
                      svn checkout [URL]http://pymodbus.googlecode.com/svn/trunk/[/URL] pymodbus-read-only
                      cd pymodbus-read-only
                      python3 setup.py
                      musst vermutlich noch davor
                      Code:
                      apt-get install subversion
                      Zuletzt geändert von Onkelandy; 16.06.2017, 21:32.

                      Kommentar


                        Ich habe mal zurückgesetzt und versucht:

                        apt-get update und dann

                        (#)~:$ apt-get install svn 20:03:49
                        Paketlisten werden gelesen... Fertig
                        Abhängigkeitsbaum wird aufgebaut.
                        Statusinformationen werden eingelesen.... Fertig
                        E: Paket svn kann nicht gefunden werden.

                        (#)~:$ svn checkout http://pymodbus.googlecode.com/svn/trunk/ pymodbus-read-only-bash: svn: Kommando nicht gefunden.
                        [Exit 127 ]

                        Kommentar


                          Package heißt subversion statt svn

                          Kommentar


                            okay, svn ist nun da aber:

                            (#)~:$ svn checkout http://pymodbus.googlecode.com/svn/trunk/ pymodbus-read-only svn: E160013: Unable to connect to a repository at URL 'http://pymodbus.googlecode.com/svn/trunk'
                            svn: E160013: »/svn/trunk« Pfad nicht gefunden

                            Ich glaube die aktuelle Entwicklung liegt hier : https://github.com/riptideio/pymodbus

                            Aber da hatte ich ja Problem beim Installieren... wie geht es mit dem Image am besten?

                            uwe
                            Zuletzt geändert von boardman; 16.06.2017, 22:11.

                            Kommentar


                              Ja, soweit ich weiss, wurde googlecode eingestellt.

                              Unter https://github.com/riptideio/pymodbus steht:
                              Furthermore, it should work fine under any python version > 2.3 with a python 3.0 branch currently being maintained as well.
                              Also würde ich vielleicht mal den branch python3 verwenden: https://github.com/riptideio/pymodbus/tree/python3

                              SVN brauchst du dann auch nicht unbedingt, für GitHub nimmst du besser git:
                              Code:
                              git clone https://github.com/riptideio/pymodbus -b python3 --single-branch

                              Kommentar


                                das ging nun fix...
                                (#)~:$ git clone https://github.com/riptideio/pymodbus -b python3 --single-branch 22:59:40
                                Klone nach 'pymodbus'...
                                remote: Counting objects: 2878, done.
                                remote: Compressing objects: 100% (2/2), done.
                                remote: Total 2878 (delta 0), reused 1 (delta 0), pack-reused 2876
                                Empfange Objekte: 100% (2878/2878), 1.95 MiB | 640.00 KiB/s, Fertig.
                                Löse Unterschiede auf: 100% (1975/1975), Fertig.
                                Prüfe Konnektivität... Fertig.
                                (#)~:$

                                ich teste ob es installiert ist

                                Hm, ich hoffe ich habe nichts vergessen, aber ich bekommen nun eine ganz neuen Fehler den ich nicht einordnen kann:

                                Code:
                                2017-06-16 23:44:29 DEBUG    plugin       Main         Plugin: Solaredge -- plugin.py:__init__:58
                                --- Logging error ---
                                --- Logging error ---
                                2017-06-16 23:44:29 ERROR    smarthome    Main         Unhandled exception: 'utf-8' codec can't decode byte 0xe4 in position 110: invalid continuation byte
                                <class 'UnicodeDecodeError'>
                                  File "/usr/local/smarthome/bin/smarthome.py", line 653, in <module>
                                    sh.start()
                                  File "/usr/local/smarthome/bin/smarthome.py", line 315, in start
                                    self._plugins = lib.plugin.Plugins(self, configfile=self._plugin_conf_basename)
                                  File "/usr/local/smarthome/lib/plugin.py", line 94, in __init__
                                    logger.exception("Plugin {0} exception: {1}".format(plugin, e))
                                  File "/usr/local/lib/python3.5/logging/__init__.py", line 1314, in exception
                                    self.error(msg, *args, exc_info=exc_info, **kwargs)
                                  File "/usr/local/lib/python3.5/logging/__init__.py", line 1308, in error
                                    self._log(ERROR, msg, args, **kwargs)
                                  File "/usr/local/lib/python3.5/logging/__init__.py", line 1415, in _log
                                    self.handle(record)
                                  File "/usr/local/lib/python3.5/logging/__init__.py", line 1425, in handle
                                    self.callHandlers(record)
                                  File "/usr/local/lib/python3.5/logging/__init__.py", line 1487, in callHandlers
                                    hdlr.handle(record)
                                  File "/usr/local/lib/python3.5/logging/__init__.py", line 855, in handle
                                    self.emit(record)
                                  File "/usr/local/lib/python3.5/logging/handlers.py", line 75, in emit
                                    self.handleError(record)
                                  File "/usr/local/lib/python3.5/logging/__init__.py", line 908, in handleError
                                    traceback.print_exception(t, v, tb, None, sys.stderr)
                                  File "/usr/local/lib/python3.5/traceback.py", line 100, in print_exception
                                    type(value), value, tb, limit=limit).format(chain=chain):
                                  File "/usr/local/lib/python3.5/traceback.py", line 487, in __init__
                                    self._load_lines()
                                  File "/usr/local/lib/python3.5/traceback.py", line 500, in _load_lines
                                    self.__context__._load_lines()
                                  File "/usr/local/lib/python3.5/traceback.py", line 500, in _load_lines
                                    self.__context__._load_lines()
                                  File "/usr/local/lib/python3.5/traceback.py", line 498, in _load_lines
                                    frame.line
                                  File "/usr/local/lib/python3.5/traceback.py", line 282, in line
                                    self._line = linecache.getline(self.filename, self.lineno).strip()
                                  File "/usr/local/lib/python3.5/linecache.py", line 16, in getline
                                    lines = getlines(filename, module_globals)
                                  File "/usr/local/lib/python3.5/linecache.py", line 47, in getlines
                                    return updatecache(filename, module_globals)
                                  File "/usr/local/lib/python3.5/linecache.py", line 137, in updatecache
                                    lines = fp.readlines()
                                  File "/usr/local/lib/python3.5/codecs.py", line 321, in decode
                                    (result, consumed) = self._buffer_decode(data, self.errors, final)
                                 -- smarthome.py:_excepthook:542
                                ^C2017-06-16 23:44:36 INFO     smarthome    Main         Number of Threads: 7 -- smarthome.py:stop:379
                                2017-06-16 23:44:36 INFO     smarthome    Main         SmartHomeNG stopped -- smarthome.py:stop:403
                                Exception ignored in: <module 'threading' from '/usr/local/lib/python3.5/threading.py'>
                                Traceback (most recent call last):
                                  File "/usr/local/lib/python3.5/threading.py", line 1288, in _shutdown
                                    t.join()
                                  File "/usr/local/lib/python3.5/threading.py", line 1054, in join
                                    self._wait_for_tstate_lock()
                                  File "/usr/local/lib/python3.5/threading.py", line 1070, in _wait_for_tstate_lock
                                    elif lock.acquire(block, timeout):
                                  File "/usr/local/smarthome/bin/smarthome.py", line 407, in stop
                                    exit()
                                  File "/usr/local/lib/python3.5/_sitebuiltins.py", line 26, in __call__
                                    raise SystemExit(code)
                                SystemExit: None
                                Zuletzt geändert von boardman; 16.06.2017, 22:46.

                                Kommentar

                                Lädt...
                                X