Announcement

Collapse
No announcement yet.

changing port in ubuntu

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    changing port in ubuntu

    I am trying to use Pete's method to add a remote controller to my network. I am running my main hs3 on a windows 10 machine and I have 2 other machines running Linux (Ubuntu 16 on raspberry pi and an odroid)

    I am using the razeberry card on the RPI3 unit which I want to use as remote. I can get it to connect but when it connects it tries to add itself as a device on /dev/ttyACM0 unfortunately I already have a device on that port which is Aeon Labs Aeotec Z-Stick.

    Is there a way to force the z-stick to another port?

    Thanks!

    #2
    @Craig,

    Way back when I tried to do this using Z-Wave using windows to linux or linux to windows it didn't work. That said maybe today it'll work.

    Yes you can change the dev/ttyACM0 to port dev/ttyACM1 on the RPi3 or do that with the USB stick using UDev.

    For windows to see the com port from linux you could change the name to one that is utilized and is free serial port in windows.

    Something like this in Linux

    1 - create a symbolic link to the ttyAMA0 device and call it com1 or com2 or com3 (whichever one is free on the windows machine)

    ln -s /dev/com1 /dev/ttyAMA0

    2 - Windows HS3 should connect to the zwave device defined as com1

    or

    try changing the windows z-wave ini file to using the /dev/ttyAMA0 device. Not sure if the windows z-wave ini file has the same com port settings.
    It should work cuz it is seeing the device on the RPi3.

    IFace_0_COMPort=/dev/ttyAMA0












    .
    Last edited by Pete; August 10, 2016, 12:37 AM.
    - Pete

    Auto mator
    Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
    Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
    HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

    HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
    HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

    X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

    Comment


      #3
      I tried to create the link but it couldn't do it because the file already exists. Should I delete it and try?
      It should reappear when I plug back in the device correct?

      Comment


        #4
        used ln -sf

        this is the outcome

        Aug-12 4:20:31 PM Warning Plugin Z-Wave is not responding but it is still running, not restarting yet. Aug-12 4:20:31 PM Info Plugin Z-Wave with instance: has disconnected Aug-12 4:20:28 PM Error Initializing plug-in(1): Z-Wave Instance::Error, wrong OS type Aug-12 4:20:28 PM Z-Wave This plug-in is formatted for Linux and will not run on this OS, exiting Aug-12 4:20:28 PM Z-Wave InitIO called, plug-in version 3.0.1.87 is being initialized... Aug-12 4:20:28 PM Info Plugin Z-Wave has connected. IP:10.0.0.49:49226 Aug-12 4:19:12 PM HSTouch Server Debug 04:19:12:3412 ~ Value change ref:849 Address:C5AD19B4

        Comment


          #5
          I dunno if it going to work. The Linux and Windows Z-Wave plugin are two different animals. Many most of the HS3 Plugins work both in Linux and Windows. They are interchangeable.

          BTW you can also try to run the Windows Z-Wave exe file the Linux box. It will load using mono except you may have issues with the backward / forward slash stuff.

          Watch it run in the terminal console: mono Z-WavePlugin.exe server Homeseermothershipserverip

          So:

          Aug-12 4:20:31 PM Warning Plugin Z-Wave is not responding but it is still running, not restarting yet. Aug-12 4:20:31 PM Info Plugin Z-Wave with instance: has disconnected

          Aug-12 4:20:28 PM Error Initializing plug-in(1): Z-Wave Instance::Error, wrong OS type

          Aug-12 4:20:28 PM Z-Wave This plug-in is formatted for Linux and will not run on this OS, exiting

          Aug-12 4:20:28 PM Z-Wave InitIO called, plug-in version 3.0.1.87 is being initialized...

          ======================================================
          Above it saids it is the wrong OS.

          Below it saids it connected.
          ======================================================

          Aug-12 4:20:28 PM Info Plugin Z-Wave has connected. IP:10.0.0.49:49226

          Aug-12 4:19:12 PM HSTouch Server Debug 04:19:12:3412 ~ Value change ref:849 Address:C5AD19B4 * this is a real Z-Wave device

          If you run the z-wave plugin on Linux in console mode you will see more. If it loads remotely then you can see that as a remote plugin in windows and configure Z-Wave and variables will be created.

          Maybe it'll ignore the OS errors and load up anyways and run. When I tried this it didn't work.
          Last edited by Pete; August 13, 2016, 08:20 PM.
          - Pete

          Auto mator
          Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
          Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
          HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

          HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
          HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

          X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

          Comment


            #6
            yeh no it didn't work. not sure why because I thought its the same file as widows with just a different config. Ok so I installed Ubuntu on my min maching and going to port over my wife craft to it, a couple questions.

            1) whats the best way to move things over fro windows to Linux?
            2) I would like to use my pi zeros as remote zwave controllers but for some reason they don't want to connect because they both attach theself and everything goes great. The reason they don't want to connect is because the remote and the host both user the same ports ports idea on how to get them connected

            Comment


              #7
              I thought its the same file as widows with just a different config.

              I thought so too a while back. The Windows and Linux Homeseer Z-Wave plugins are different.

              whats the best way to move things over from windows to Linux?

              Many folks have been able to utilize a back up / restore which works now using the newest Mono V4.X in Linux which works OK for events / variables. I moved HS3 Pro machine to Linux. There are plugins which work fine in Windows remotely talking to the Linux mothership. (IE: UPB, Kinect, Alexa and more). (Windows to Windows, Windows to Linux, Linux to Linux). Here only used Wintel in the beginning days of HS3. A few months afterwards switched over to Linux starting from scratch as I really didn't have many variables, events or plugins running. The Windows HS3 / original Zee used a Z-Wave stick such that the transfer of the Z-Wave configuration over to the GPIO card was easy.

              I would like to use my pi zeros as remote zwave controllers

              For Windows HS3 best solution is using ZNet's. If HS sold the ZNet software a la carte you could maybe DIY this. As stated previously it works Linux to Linux but it isn't that much plug and play.

              I have a HS start up event that runs a Linux script which SSH's to the Z-Wave RPi2 with a GPIO Z-Wave controller. If I disconnect the link or power down the RPi2/Z-Wave device the connection is not restored unless I manually run the event on the mother ship.



              For Z-Wave the nodes remain on the controller such that you can just move the controller from Windows to Linux.
              - Pete

              Auto mator
              Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
              Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
              HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

              HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
              HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

              X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

              Comment


                #8
                Script sounds interesting. I already have one zero running but it's running the full hs3, wold love to do the remote thing not sure how many copies of hs3 I can have running. The problem I am having with the remote even to nix too nix is they use the same port ttyamao. How do you get around that?

                Comment


                  #9
                  The script run just echos the commands from the client Z-Wave machine via SSH.

                  You run the script via Homeseer 3 on startup such that it connects to the Z-Wave RPi2.

                  You copy over the encryption keys so you do not have to utilize a password.

                  Here is the bash script that HS runs. Note that you can utilize any user. Copying over the SSH keys makes it so you do not have to utilize a password.

                  Note that this is a one to one connection only. You can run one script with multiple connections but each connection has to be configured first.

                  Code:
                  #!/bin/bash
                  #: Description: Enables the required modules Homeseer Z-Wave
                  
                  ssh root@zwave-RPi2IP "/usr/bin/mono /HomeSeer/HSPI_ZWave.exe server=mothership IP >> /dev/null 2>&1"
                  Now to copy over the keys you only have to do this once. I do this today for remote controller stuff, 1-wire temperature stuff, coms between HS3 Pro and HS3 Zee-2 lite.

                  Here is an example and picture.



                  1 - ssh-keygen

                  Code:
                  Generating public/private rsa key pair.
                  Enter file in which to save the key (/home/demo/.ssh/id_rsa):
                  
                  Enter passphrase (empty for no passphrase): *here just hit return for new passphrase.
                  Enter same passphrase again:
                  
                  Your identification has been saved in /root/.ssh/id_rsa.
                  Your public key has been saved in /root/.ssh/id_rsa.pub.
                  The key fingerprint is:
                  8c:e9:7c:fa:bf:c4:e5:9c:c9:b8:60:1f:fe:1c:d3:8a root@here
                  The key's randomart image is:
                  +--[ RSA 2048]----+
                  |                 |
                  |                 |
                  |                 |
                  |       +         |
                  |      o S   .    |
                  |     o   . * +   |
                  |      o + = O .  |
                  |       + = = +   |
                  |      ....Eo+    |
                  +-----------------+
                  2 - copy the key to the client.

                  Code:
                  cat ~/.ssh/id_rsa.pub | ssh username@remote_host "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"
                  You will be asked to supply the password for the remote account:

                  Code:
                  The authenticity of host '111.111.11.111 (111.111.11.111)' can't be established.
                  ECDSA key fingerprint is fd:fd:d4:f9:77:fe:73:84:e1:55:00:ad:d6:6d:22:fe.
                  Are you sure you want to continue connecting (yes/no)? yes
                  demo@111.111.11.111's password:
                  After entering the password, your key will be copied, allowing you to log in without a password:

                  Code:
                  ssh username@remote_IP_host
                  Attached Files
                  Last edited by Pete; August 18, 2016, 11:17 AM.
                  - Pete

                  Auto mator
                  Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
                  Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
                  HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

                  HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
                  HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

                  X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

                  Comment


                    #10
                    Do i need to have HomeSeer installed on the remote side or just the plug in how should i start the script? create an event?

                    You awesome Pete, thanks foir the help!!!

                    Comment


                      #11
                      Do i need to have HomeSeer installed on the remote side or just the plug in how should i start the script?

                      No just the plugin. I have done this with other stuff.

                      how should i start the script? create an event?

                      Yes; learned here. Create a connection event running the bash script and put it in your startup like so.

                      Well here are three plugins with devices plugged in to slave RPi2. All the same way running in the Homeseer mothership Startup.vb script. IE: been testing here with an added UPB PIM and CM11A PIM plugged in adjacent to the RPi2 in the attic. Main UPB / X10 PIMs are in the basement adjacent to the fuse panel. This is all related to the ability of being able to connect a plugin remotely to HS3. IE: mono plugin.exe server=ipofmothership.

                      I do this also with remote 1-wire sensors plugged in to the RPi2 in the attic. The HS3 Pro and the HS3 Lite both grab the 1-wire data this way. It is even simpler as the 1-wire program just writes a text file every minute and the remote HS3 boxes grab the data. You could probably modify Z-Net for a site to site connection adding more controllers to it. Physically the controllers are connected locally. I would though like to see (and it's been mentioned before) a multi-protocol Z-Net which does more than Z-Wave but doesn't run Homeseer.

                      I have tested a few HS3 plugins that only run on windows and they do work talking to the Linux mothership. The changes are minimal working with the author of the plugins. Wish that HST would fix / update the Z-Wave plugin such that it would work identically running in Windows to Linux or Linux to Windows today. None the less here my mickey mouse fix to this has been to run Windows server VM(s) on the HS3 Ubuntu 64 bit box. Works fine for the time bean.

                      Just a few weeks back relating to work stuff did a small RPi2 set up in a server room with just terminal connections to routers / switches such that I had both serial / network connectivity without having to go in to the server room (it was too cold in there for me). It is much smaller than my terminal boxes from the 2000's that I would utilize for configuring multiple routers.

                      Very simple way is just to run the old software called minicom remotely and sessions per serial port for the pure meat of a serial connection look see.

                      ' Start X10
                      hs.triggerevent("X10PluginRun")
                      ' Start ZWave
                      hs.triggerevent("ZWavePluginRun")
                      ' Start UPB
                      hs.triggerevent("UPBPluginRun")


                      I enabled a Homeseer 3 startup script which connects to the slave Z-Wave RPi2 which in turn runs the connect to the mothership script.

                      I wrote up a quickie clip and paste in the DIY section relating to RPi2/RPi3 Jessie and GPIO port use. It is different on Jessie versus Wheezy versus RPi2/RPi3.
                      Last edited by Pete; August 19, 2016, 01:50 PM.
                      - Pete

                      Auto mator
                      Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
                      Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
                      HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

                      HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
                      HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

                      X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

                      Comment

                      Working...
                      X