Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Controllers
  3. Home Assistant
  4. Any plan to implement Ethernet GW?

Any plan to implement Ethernet GW?

Scheduled Pinned Locked Moved Home Assistant
69 Posts 5 Posters 18.1k Views 6 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Dave DanD Dave Dan

    hey Martin.

    Sorry, I've been traveling for a while.

    So I just rebuilt my environment and I can't repro the issue anymore.

    If you can't either and no one else is experiencing this I think we can close this down. My environment might be the only thing that is creating the issue.

    If the issue happen again I can update with the new information.

    martinhjelmareM Offline
    martinhjelmareM Offline
    martinhjelmare
    Plugin Developer
    wrote on last edited by
    #61

    @Dave-Dan

    Great! Then I'll move forward and push my latest changes to my github branch. I'll post here when that is done. You're welcome to test these by the update instructions above.

    If nothing comes up, my plan is to have this merged in the next release of home assistant.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      subutux
      wrote on last edited by
      #62

      Hi,

      I've also tested your pymysensors version with tcp gateway. I've had an excessive cpu usage on my pi Zero (actually, a constant 100%). After some debugging I've found that I've had to add a sleep of 0.2 to the while loop of the top socket readout. My cpu usage returned normal.

      What I've also encountered is that when the tcp gateway looses connection, pymysensors still thinks it's connected. I've buildin an active check by requesting the gateway version every 10 seconds.

      Would you like me to make a pull request ?

      martinhjelmareM 3 Replies Last reply
      0
      • S subutux

        Hi,

        I've also tested your pymysensors version with tcp gateway. I've had an excessive cpu usage on my pi Zero (actually, a constant 100%). After some debugging I've found that I've had to add a sleep of 0.2 to the while loop of the top socket readout. My cpu usage returned normal.

        What I've also encountered is that when the tcp gateway looses connection, pymysensors still thinks it's connected. I've buildin an active check by requesting the gateway version every 10 seconds.

        Would you like me to make a pull request ?

        martinhjelmareM Offline
        martinhjelmareM Offline
        martinhjelmare
        Plugin Developer
        wrote on last edited by
        #63

        @subutux

        Thanks for the feedback!

        I've got some commits that are not pushed yet with some changes, but a pull request should be good anyhow. Great!

        1 Reply Last reply
        0
        • martinhjelmareM martinhjelmare

          I've updated the branch at my fork of pymysensors. If you have installed the ethernet branch of my fork of home-assistant, you should uninstall/reinstall that, or just make a new virtual environment and install again. You should remove the lib directory in your home assistant config directory as well.

          Eg:

          rm -r ~/.homeassistant/lib
          mkvirtualenv -p /usr/bin/python3 hasstest2
          cd ~/dev/home-assistant
          git branch -D mysensors-tcp-gateway
          git fetch origin mysensors-tcp-gateway
          git checkout mysensors-tcp-gateway
          pip3 install -e .
          pip3 install colorlog
          pip3 install python-Levenshtein
          
          martinhjelmareM Offline
          martinhjelmareM Offline
          martinhjelmare
          Plugin Developer
          wrote on last edited by martinhjelmare
          #64

          I've now pushed some updates to my ethernet gateway branch of pymysensors and rebased my home-assistant mysensors-tcp-gateway branch off latest upstream dev branch and pushed that to my github.

          To upgrade follow the instructions below.

          @martinhjelmare said:

          I've updated the branch at my fork of pymysensors. If you have installed the ethernet branch of my fork of home-assistant, you should uninstall/reinstall that, or just make a new virtual environment and install again. You should remove the lib directory in your home assistant config directory as well.

          Eg:

          rm -r ~/.homeassistant/lib
          mkvirtualenv -p /usr/bin/python3 hasstest2
          cd ~/dev/home-assistant
          git branch -D mysensors-tcp-gateway
          git fetch origin mysensors-tcp-gateway
          git checkout mysensors-tcp-gateway
          pip3 install -e .
          pip3 install colorlog
          pip3 install python-Levenshtein
          
          1 Reply Last reply
          0
          • S subutux

            Hi,

            I've also tested your pymysensors version with tcp gateway. I've had an excessive cpu usage on my pi Zero (actually, a constant 100%). After some debugging I've found that I've had to add a sleep of 0.2 to the while loop of the top socket readout. My cpu usage returned normal.

            What I've also encountered is that when the tcp gateway looses connection, pymysensors still thinks it's connected. I've buildin an active check by requesting the gateway version every 10 seconds.

            Would you like me to make a pull request ?

            martinhjelmareM Offline
            martinhjelmareM Offline
            martinhjelmare
            Plugin Developer
            wrote on last edited by martinhjelmare
            #65

            @subutux

            Please rebase your pymysensors branch off my latest updates, before you make the PR. Thanks.

            1 Reply Last reply
            0
            • S subutux

              Hi,

              I've also tested your pymysensors version with tcp gateway. I've had an excessive cpu usage on my pi Zero (actually, a constant 100%). After some debugging I've found that I've had to add a sleep of 0.2 to the while loop of the top socket readout. My cpu usage returned normal.

              What I've also encountered is that when the tcp gateway looses connection, pymysensors still thinks it's connected. I've buildin an active check by requesting the gateway version every 10 seconds.

              Would you like me to make a pull request ?

              martinhjelmareM Offline
              martinhjelmareM Offline
              martinhjelmare
              Plugin Developer
              wrote on last edited by martinhjelmare
              #66

              @subutux

              I went ahead and added your fix for the 100% cpu usage. Although I settled for a very short 0.02 seconds. It was enough for my intel based processor. If you still experience problems and think we should increase it, let me know.

              Please make a PR for the check of the connection here https://github.com/theolind/pymysensors if you have time.

              My plan is to try and have this make the release of home assistant that is planned during this week. I think it should be good enough for a first version now. We can add polish for the next release.

              1 Reply Last reply
              0
              • D Offline
                D Offline
                drock1985
                wrote on last edited by
                #67

                Hi @martinhjelmare

                I see HA got released early, and that the ethernetgateway was added. I'll check it out later on tonight but, thanks again for all the work you do on the MySensors project.

                My Projects
                2 Door Chime Sensor
                Washing Machine Monitor

                martinhjelmareM 1 Reply Last reply
                0
                • D drock1985

                  Hi @martinhjelmare

                  I see HA got released early, and that the ethernetgateway was added. I'll check it out later on tonight but, thanks again for all the work you do on the MySensors project.

                  martinhjelmareM Offline
                  martinhjelmareM Offline
                  martinhjelmare
                  Plugin Developer
                  wrote on last edited by
                  #68

                  @drock1985

                  Yeah, finally! I've been a bit disappointed with myself, that it took a long time and for not finishing this earlier, but now it feels good to have it merged. We still have to polish some things, like checking that the connection is still ok, so all feedback is very welcome and valuable.

                  I need to update the docs at home-assistant.io, and then I might make a new post about the release.

                  BIG THANKS to everyone that tested this:
                  @drock1985
                  @Dave-Dan
                  @Andrew-Sanjanwala
                  @subutux

                  1 Reply Last reply
                  1
                  • S Offline
                    S Offline
                    subutux
                    wrote on last edited by
                    #69

                    @martinhjelmare As soon as i have the time (and clean up my code because it was a hack) i'll create a pull request. i've mine also at 0.02 and my (pi zero) CPU is now at around 8-10%.

                    1 Reply Last reply
                    1
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    16

                    Online

                    11.7k

                    Users

                    11.2k

                    Topics

                    113.0k

                    Posts


                    Copyright 2019 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • MySensors
                    • OpenHardware.io
                    • Categories
                    • Recent
                    • Tags
                    • Popular