Announcement

Collapse
No announcement yet.

Problem with CM15a on new ZEE S2 - Solved!

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

    Problem with CM15a on new ZEE S2 - Solved!

    I took delivery yesterday of a new Zee S2 and a CM15a. It replaces an existing HS2 installation running under Windows Vista.


    - I followed the Getting Started Guide:
    --I connected the Zee S2 to the network
    --I connected the CM15a to the Zee S2 witht he USB cable and powered it up
    --I powered up the Zee S2
    - I went to the web interface and installed and enabled the CM15a Plug-in whose status is OK
    - I created one X-10 device, a dimmable wall switch, using address A11 (I have no Z-Wave devices entered, yet)
    - Went to Device Management and turned the X-10 device A11 on and off but it didn't work.
    - I disabled/enabled the CM15A plug-in, rebooted the Zee S2, disconnected all cabled, reconnected all cables, but, no matter what I did, I can't get the X-10 device to work.
    - Using the HS2 install, I can successfully turn the X-10 device A11 on and off
    - So, I looked at the logs and can see the plugin was found but, every 5 seconds, I get the Connection Refused message

    Jul-24 10:47:50 AM CM15A Unable to communicate with CM15A, try re-connecting to USB port, will retry in 5 seconds...: Connection refused
    Jul-24 10:47:45 AM CM15A Unable to communicate with CM15A, try re-connecting to USB port, will retry in 5 seconds...: Connection refused
    Jul-24 10:47:40 AM CM15A Unable to communicate with CM15A, try re-connecting to USB port, will retry in 5 seconds...: Connection refused
    Jul-24 10:47:35 AM CM15A Unable to communicate with CM15A, try re-connecting to USB port, will retry in 5 seconds...: Connection refused
    Jul-24 10:47:30 AM Plug-In Finished initializing plug-in CM15A
    Jul-24 10:47:30 AM CM15A Unable to communicate with CM15A, try re-connecting to USB port, will retry in 5 seconds...: Connection refused
    Jul-24 10:47:30 AM CM15A Initialization Successful.
    Jul-24 10:47:30 AM CM15A Error connecting to CM15A service: Connection refused
    Jul-24 10:47:29 AM Info Plugin CM15A has connected. IP:127.0.0.1:44132
    Jul-24 10:47:04 AM Plug-In Found plug-in: CM15A, version: 3.0.0.4
    So, I ssh'ed into the Zee S2 and checked the /var/log/messages file for mochad info. I can see that mochad starts, finds the CM15A, and then terminates.

    rroot@HomeTrollerZeeS2V2:/var/log# grep mochad messages
    Jul 24 10:46:51 HomeTrollerZeeS2V2 mochad[1285]: detaching CM15A
    Jul 24 10:46:55 HomeTrollerZeeS2V2 mochad[171]: starting
    Jul 24 10:46:55 HomeTrollerZeeS2V2 mochad[174]: Found CM15A
    Jul 24 10:46:55 HomeTrollerZeeS2V2 mochad[174]: In endpoint 0x81, Out endpoint 0x02
    Jul 24 10:46:55 HomeTrollerZeeS2V2 mochad[204]: starting
    Jul 24 10:46:55 HomeTrollerZeeS2V2 mochad[205]: Found kernel driver 0, trying detach
    Jul 24 10:46:55 HomeTrollerZeeS2V2 mochad[205]: terminated
    There is no mochad process running:

    root@HomeTrollerZeeS2V2:/var/log# ps -ef | grep mochad
    root 944 902 0 10:48 pts/0 00:00:00 grep mochad
    I started mochad from the command line: /usr/local/bin/mochad
    I immediately saw the following in the Zee S2 log and the Connection Refused messages stopped
    Jul-24 10:53:27 AM CM15A Connected to CM15A successfully.
    I connected up to mochad to test the connection to the CM15a. I successfully turned A11 on and off. I, also, turned A8 on and off from my HS2 installation to see if the Zee S2 picked it up (which it did).
    root@HomeTrollerZeeS2V2:/var/log# nc localhost 1099
    pl a11 on
    07/24 10:55:50 Tx PL HouseUnit: A11
    07/24 10:55:50 Tx PL House: A Func: On
    pl a11 off
    07/24 10:55:58 Tx PL HouseUnit: A11
    07/24 10:55:58 Tx PL House: A Func: Off
    07/24 10:56:45 Rx PL HouseUnit: A8
    07/24 10:56:46 Rx PL House: A Func: On
    07/24 10:57:13 Rx PL HouseUnit: A8
    07/24 10:57:13 Rx PL House: A Func: Off
    I re-connected to mochad and went back to the Zee S2 web interface and, again, turn the X-10 device A11 on and off but it still does not work.

    I see the following entries in the logs but mochad does not see them:
    Jul-24 11:01:21 AM Device Control Device: Upstairs Hallway Ceiling Fixture to On (100) by/from: CAPI Control Handler
    Jul-24 11:01:18 AM Device Control Device: Upstairs Hallway Ceiling Fixture to Off (0) by/from: CAPI Control Handler
    root@HomeTrollerZeeS2V2:/var/log# nc localhost 1099
    So, what's the problem here?

    Here's the system info:

    HomeSeer Version: HS3 ZEE S2 Edition 3.0.0.291
    Linux version: Linux HomeTrollerZeeS2V2 4.1.19-v7+ #858 SMP Tue Mar 15 15:56:00 GMT 2016 armv7l GNU/Linux System Uptime: 0 Days 10 Hours 28 Minutes 16 Seconds
    IP Address: 192.168.1.14
    Number of Devices: 1
    Number of Events: 1
    Available Threads: 392

    Enabled Plug-Ins
    3.0.0.4: CM15A
    3.0.0.68: HSTouch Server
    3.0.1.83: Z-Wave

    #2
    Make sure you follow these steps to create the devices: http://board.homeseer.com/showthread.php?t=179522.

    Cheers
    Al
    HS 4.2.8.0: 2134 Devices 1252 Events
    Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

    Comment


      #3
      >>> Make sure you follow these steps to create the devices:
      >>> http://board.homeseer.com/showthread.php?t=179522.

      Thanks for the reply. The thread shows a tab labeled X10 which I didn't/don't see on the Zee S2. When I originally created my X10 device, I saw only the Configuration, Advanced, and Status Graphics tabs and I added the X10 Address, A11, to the Code: field in the Configuration tab.

      Now, when I add a device, I see a fourth tab labeled CM15A. So I deleted the original device and recreated a new device, putting the X10 address in the CM15A tab, and I can successfully turn the device on and off from the web interface (but that's with mochad started manually).

      I rebooted the Zee S2 and I still see the same error messages:

      Jul-24 10:47:50 AM CM15A Unable to communicate with CM15A, try re-connecting to USB port, will retry in 5 seconds...: Connection refused
      Jul-24 10:47:45 AM CM15A Unable to communicate with CM15A, try re-connecting to USB port, will retry in 5 seconds...: Connection refused
      Jul-24 10:47:40 AM CM15A Unable to communicate with CM15A, try re-connecting to USB port, will retry in 5 seconds...: Connection refused
      Jul-24 10:47:35 AM CM15A Unable to communicate with CM15A, try re-connecting to USB port, will retry in 5 seconds...: Connection refused
      Jul-24 10:47:30 AM Plug-In Finished initializing plug-in CM15A
      Jul-24 10:47:30 AM CM15A Unable to communicate with CM15A, try re-connecting to USB port, will retry in 5 seconds...: Connection refused
      Jul-24 10:47:30 AM CM15A Initialization Successful.
      Jul-24 10:47:30 AM CM15A Error connecting to CM15A service: Connection refused
      Jul-24 10:47:29 AM Info Plugin CM15A has connected. IP:127.0.0.1:44132
      Jul-24 10:47:04 AM Plug-In Found plug-in: CM15A, version: 3.0.0.4
      The only difference this time is that when I try to turn on/off the X10 device, I get this message:

      Jul-24 1:42:48 PM CM15A Unable to send to CM15A: The operation is not allowed on non-connected sockets.
      So, again, I ssh'ed into the Zee S2 and checked the /var/log/messages file for mochad info. I can see that mochad starts, finds the CM15A, and then terminates, same as before, and there's is no mochad process running.

      I start mochad, again, manually, and the X10 device now works fine from the web interface.

      So, why is this happening? Why is mochad starting and then terminating?

      Or am I looking at this the wrong way?

      As a workaround, I added /usr/local/bin/mochad to /etc/rc.local.
      Last edited by mikeshapp; July 24, 2016, 12:50 PM. Reason: Added one more piece of information

      Comment


        #4
        Try this.

        Load up HS3 lite with the X10-CM15A plugin disabled.

        SSH to the Zee-2, go to the Homeseer directory and run the plug in manually via mono cm15A.exe .

        Watch the console for errors and do a copy and paste here.

        It could be an issue with what dibs are on what USB ports. You can hard symlink a USB port if you want. IE: do that granular lsusb stuff then symlink to the hardware.

        I have done this a few times now with other RPi2s (with Homeseer and my CumulusMX weather station). I have assumed here that a USB port is a USB port is a USB port and each one is static when it isn't.

        Personally have never used a CM15A here. From years back have used a CM11A and XTB stuff from the get go. (and in the early 2000's the HS TI103).

        Relating to my HS endeavors and going back to utilizing multiple serial / USB ports went to using all Digi stuff here...IE: Digi USB powered hubs and Digi USB connected Edgeports. (well for a time Lantronix/Quatech serial servers stuff too). This was a carry over from having to utilize this stuff for commercial 100% uptime connected hardware in the 1990's. I never have purchased this stuff new and always found a deal on it used or refurbished. After all though the stuff was made to last forever.

        Really though for 1-3 controller connections (serial or USB) you really don't need much more than just direct single to USB connections these days (on the RPi2).

        For a bit here I was also running the CM11A X10 plugin remotely on one RPi2 and connecting it to the attic installed Zee-2. Worked fine.

        I do recall mochad being there in the Homeseer directory in the first Homeseer released Zee device. I think it was utilized back then. I do not really know.
        Last edited by Pete; July 24, 2016, 03:08 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


          #5
          Pete,

          Thanks for the reply. I found the problem and it's the method that's used to start mochad.

          When the Zee S2 boots, the kernel walks the buses, finds the CM15A, and passes it's information on to udev. Udev, then, finds the proper rule in /etc/udev/rules.d/91-usb-x10-controllers.rules:

          SUBSYSTEM=="usb", ATTR{idVendor}=="0bc7", ATTR{idProduct}=="0001", RUN+="/usr/local/bin/mochad"
          SUBSYSTEM=="usb", ATTR{idVendor}=="0bc7", ATTR{idProduct}=="0002", RUN+="/usr/local/bin/mochad"
          As you can see, the udev rule executes /usr/local/bin/mochad and the syslog shows it starting and then terminating.

          The reason for this is that mochad is a daemon (i.e. it runs in the background, not the foreground) and the udev RUN/RUN+ parameter can only execute programs that run in the foreground. So, udev is starting, and then killing, mochad because it's running in the background.

          I went to the mochad web site and found a systemd service file for mochad and did the following:

          - Removed the workaround I added to /etc/rc.local
          - Removed /etc/udev/rules.d/91-usb-x10-controllers.rules
          - Added the systemd file /etc/systemd/system/mochad.service

          [Unit]
          Description=mochad is a Linux TCP gateway daemon for X10 CM15A/CM15PRO/CM19A
          After=sysinit.target

          [Service]
          Type=forking
          ExecStart=/usr/local/bin/mochad
          Restart=on-failure

          [Install]
          WantedBy=multi-user.target
          - Enabled the mochad service to start on boot: systemctl enable mochad

          Now it works properly.

          You could also have modified the 91-usb-x10-controllers.rules files start the service but, since I'm using the CM15A, for me it works just to have it start every time the system boots.

          Comment


            #6
            Good news Mike!!!

            I see you have shown us here on Homeseer the CM15A dependency on mochad.

            I do not recall any similar threads under the CM15A/CM15PRO/CM19A Homeseer 3 X10 threads.

            The issue and related startup for the service mochad is probably the reason why so many Homeseer 3 users of the CM15A have had issues.

            I would have been one of those folks as here moved my original Homeseer 3 Zee RPi directory to a new RPi2 as soon as it was available.

            I never did anything else with the RPi2 other than the directory copy.

            I did the same when the new RPi2 Zee-2 came out as I DIY'd my Z-Wave + GPIO card and put an RTC shim underneath the GPIO card.

            And now recently have moved just the HS3 directory over to an Xi3 Xi5A.

            Here do have a couple of CM11A's on line and connected to Ubuntu 16.04 LAMP servers. Thinking just let my fingers do the walking and never paid attention much to the configurations.

            Thank you Mike!!

            BTW and unrelated have fond memories of Boston from many years ago doing some banking thing there for a few weeks and just about every night (literally) dining at the Wharf (s) there.
            Last edited by Pete; July 24, 2016, 04:58 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


              #7
              >>> I see you have shown us here on Homeseer the CM15A dependency on mochad.

              mochad is a Linux TCP gateway daemon for the X10 CM15A RF (radio frequency) and PL (power line) controller and the CM19A RF controller.

              mochad stands for Multiple Online Controllers for Home Automation Daemon.

              mochad treats the CM15A as a transceiver and ignores all of the CM15A macros, timers, and real-time clock (RTC); therefore, batteries are not necessary because the RTC is not used.

              mochad listens on Port 1099 and you can use the nc command, from the command line, to test the connection to the CM15A/CM19A. Here's an example of turning the Power Line device A11 on and off:

              root@HomeTrollerZeeS2V2:~# nc localhost 1099
              PL A11 on
              07/24 18:45:28 Tx PL HouseUnit: A11
              07/24 18:45:28 Tx PL House: A Func: On


              PL A11 off
              07/24 18:45:36 Tx PL HouseUnit: A11
              07/24 18:45:36 Tx PL House: A Func: Off
              It might work with the CM11A but I don't have one to test. If it doesn't, it's probably just a SMOP (Small Matter Of Programming)!

              >>> BTW and unrelated have fond memories of Boston from many years ago

              It's still a nice town but it's had major changes in the last 15 years and you might not recognize it from then.

              Comment


                #8
                Thank you Mike.

                You had me looking just now here. I went the CPAN Perl set up for my CM11A's connected to the Zoneminder boxes.

                Homeseer 3 is very flexible today versus Homeseer 2 relating to the remote use of plugins.

                IE: you can put an RPi / CM15A right next to your fuse panel and network connect the plugin to the Homeseer 3 mothership wherever it is at in the house.

                In to RTC/Time a bit here installed RTC battery backed up clocks in all of my RPi's and just recently noticed that the Pine64A that I am playing with has one built in and all you need to connect is the battery to it.

                Yup my focus in Boston was primarily work at the time so I didn't really get to tourist around. Wife (the banker) reminded me just now it was probably related to doing stuff for EAB (European American Bank) which my work bank had purchased at the time. I was with a group of 4 of us and we just would agree on where to go together for dinner every night. There were some late nights in to the morning dinners that I recall. That said worked in London for a time and did a tour bus thing one morning on a weekend after working all night, fell asleep on the tour bus and was woken up at the end of the tour at the end of the day. I did sit in front behind the driver and he never woke me up until it was the end of the tour. Next weekend called a friend there and asked her to tour me around London. She did and that was really nice of her (she works for the BBC).

                Self taught here relating to computers from the 1970's. Did 8 years of school which had nothing to do at all with computers. For play and work always did stuff (whatever) doing the doo. I do recall touching on Logan Airport FIDs displays. It was just making an old sun solaris box work with a new Cisco switch. Honestly didn't pay attention to what hardware/software I was playing with...just got it working and that was that. I do recall some bridge falling down in Boston dinging my efforts relating to back and forth city stuff in the middle of the night.
                Last edited by Pete; July 24, 2016, 07:02 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