Announcement

Collapse
No announcement yet.

What version of Mochad works best with CM15a plugin

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

    #16
    I am not sure why you are having this issue and I'll need to look into this further. I did a couple of quick tests on my system to see how mochad reacted in different scenarios:

    1) Boot R-Pi with CM15a connected:
    - mochad is run by systemd and CM15a is recognized; mochad continues to run.
    - CM15a plugin sees mochad running, connects normally and CM15a functions properly.

    2) Boot R-Pi without CM15a connected:
    - mochad is started by systemd, does not find CM15a and exits normally.
    - CM15a plugin does not find mochad running, starts it (not as a service), attempts to connect and fails and responds with "Unable to communicate with CM15A..."
    ** Attaching the CM15a in at this point does nothing and the plugin continues to log "Unable to communicate..."
    ** Restarting the plugin with the CM15a connected results in mochad being restarted, CM15a recognized and plugin operates properly.

    I was under the impression that mochad is supposed to start whenever a CM15a is connected, but discovered this is not the case on my system.

    I will have to look into this further. I am really busy with my business so it will likely be a bit before I can devote some time to this.
    Best regards,
    -Mark-

    If you're not out on the edge, you're taking up too much room!
    Interested in 3D maps? Check out my company site: Solid Terrain Modeling

    Comment


      #17
      Appreciate that Mark.

      I was doing a little research on Mochad and it's versions. Since the introduction of Jessie it appears that Mochad has had difficulties with the CM15 unit with the introduction of the Systemd service method of launching it. The following link shows a version Mochad 0.1.17 which appears to address this problem.

      https://sourceforge.net/projects/mochad/files/

      I wonder if this version of Mochad was included with HS3 Pro for Linux would this resolve the problem I'm experiencing. Alternatively, if there was a way to remove the packaged version of Mochad which would allow the user to install their own.

      Comment


        #18
        I have read that systemd is a bit of a heavy hitter (higher utilization than Upstart) on the RPi2 / Jessie build.

        Relating to starting Mochad there is some posting on the Domoticz forum / wiki relating to inserting a delay to the startup old way.

        Note: I found that mochad would not start from my rc.local on my raspberry pi 3 running Raspbian "Jessie", but whenever i entered the same command from the cli by hand it would start up just fine. After a while i simply added a "sleep 20" statement before calling mochad in my rc.local and everything has been working fine ever since. The Raspberry 3 starts up very very fast, so my guess is the CM15Pro device is not ready yet when Mochad is started from rc.local.

        When testing here with HS3 in Linux I open up a couple of ssh sessions to the HS3 box.

        One is just to run HS3 in console mode using the ./go command. It is very chatty kathy.

        I then open a second terminal SSH window in case I have to do anything.

        Here just did a quickie test downloading HS3 Pro to the laptop and running it via the ./go command.

        Extracted the HS3 tar file. Started Homeseer 3

        Went to the original CM15A plugin offered by Mark in the updater v3.0.0.5 . Installed plugin and enabled it. First message here was that Mochad was not installed.

        02:47:45:1618:[Updater]->Downloading update: HomeSeer X10 (CM15A)
        02:47:45:3025:[Updater]->Update HSPI_CM15A.exe downloaded successfully
        02:47:45:3028:[Updater]->Installing package HomeSeer X10 (CM15A)
        02:47:45:3716:[Updater]->Copying file: \home\pete\Downloads\HomeSeer\HSPI_CM15A.exe
        02:47:45:3723:[Updater]->Install/Update of package HomeSeer X10 (CM15A) was successful.
        Connecting to server at 127.0.0.1...
        02:48:11:5896:[Info]->Plugin CM15A has connected. IP:127.0.0.1:56700
        Connected, waiting to be initialized...
        02:48:11:7118:[CM15A]->mochad is not running, starting...
        CM15A, system files were installed sucessfully.
        02:48:11:7184:[CM15A]->Error connecting to CM15A service: Connection refused


        All I saw created was the mochad subdirectory with the rules file.

        IBMNBK:/home/pete/Downloads/HomeSeer/mochad# ls
        91-usb-x10-controllers.rules mochad


        Not really sure about the SEL or even the Zee2.

        Apologies I take it back. I rebooted and do see the rules set under udev.

        ICS-IBMNBK:/etc/udev/rules.d$ ls
        60-vboxdrv.rules 91-usb-x10-controllers.rules

        So enabling the CM15A plugin is installing Mochad ==> homeseer mochad subdirectory, udev rules and /usr/local/bin/mochad file.

        IBMNBK:/etc/udev/rules.d$ cd /usr/local/bin
        pete@ICS-IBMNBK:/usr/local/bin$ ls moch*
        mochad
        pete@ICS-IBMNBK:/usr/local/bin$

        I do not see anything under systemd or upstart directories and cannot really test unless I have a CM15A.

        That said it does autostart mochad when you plug in the CM15A device automagically. Udev is just put in to memory such that I do not think you need to start it with systemd or upstart.

        Reading some more it seemed to cause issues ....reported on the micasa verde site....so the fix there was to start the service rather than the program in Udev.

        1. get the mochad systemctl service configured and working using the information provided here: hxxp://archlinuxarm.org/forum/viewtopic.php?f=15&t=5691

        cat /usr/lib/systemd/system/mochad.service
        [Unit]
        Description=Mochad X10 Daemon
        Requires=systemd-udevd.service
        After=systemd-udevd.service

        [Service]
        Type=forking
        GuessMainPID=yes
        ExecStart=/usr/bin/mochad
        Restart=on-abort

        [Install]
        WantedBy=multi-user.target


        2. change the udev rule to start the mochad service instead of trying to start the mochad process directly.

        cat /etc/udev/rules.d/91-usb-x10-controllers.rules
        SUBSYSTEM=="usb", ATTR{idVendor}=="0bc7", ATTR{idProduct}=="0001", RUN+="/usr/bin/systemctl start mochad"
        SUBSYSTEM=="usb", ATTR{idVendor}=="0bc7", ATTR{idProduct}=="0002", RUN+="/usr/bin/systemctl start mochad"


        Just a guess here is that with Wheezy or Ubuntu 14.04 you could just use the udev to start mochad so the original Zee Wheezy build didn't need anything else.

        With the introduction of the Zee2 on Jessie and Ubuntu 16.04 it didn't start correctly with a direct link to mochad so instead it changed over to using a systemd start / udev systemd start.

        A quickie check would be to download the cm15A plugin zip file. It should contain installation script and probably mochad.

        It is here: hxxp://homeseer.com/updates3/HSPI_CM15A_linux_3_0_0_5.zip

        Unzipped the HSPI_CM15A_linux_3_0_0_5.zip and it only contains HSPI_CM15A.exe and install text file.

        install.txt file shows:

        xxxx,[CHECKVERSION],3.0.0.13
        HSPI_CM15A.exe,.,0

        I am discombobulated as I do not know how it installed mochad on my laptop here that never has run Homeseer before.
        Last edited by Pete; October 11, 2017, 04:10 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


          #19
          Pete

          I've checked through a lot of Mochad/CM15 problem posts so I got a general idea of what users were experiencing.Had me rethink the problem.

          Mark

          I removed all reference to Mochad in the HS3 pro download. I built version Mochad 0.1.17 and installed it on a Raspbian Stretch build with Mono 5 and x10 is working fine at the moment. It seemed to be the quickest and easiest route to solving the problem.

          Thanks for your time Mark.

          Comment


            #20
            Yeah just looked at the installation files for Hs3 Pro and it does have the Mochad directory when it gets unzipped.
            - 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


              #21
              Pete, thanks for digging into this!

              Yes, HS3 Pro Linux includes the mochad directory and files. Looking at the source code I see that the CM15a plugin checks at Init() if mochad is in /usr/local/bin, and if not it copies mochad to /usr/local/bin/ and copies 91-usb-x10-controllers.rules to /etc/udev/rules.d/. Systemd is not referenced in the source code and the original .rules file appears to just run mochad directly when the CM15a is plugged in.

              Later, the plugin checks whether mochad is running and if not launches it.

              concordseer, I am glad you were able to get mochad v.17 working! I'll work to get that build into a future release of the CM15a plugin and see if there is a better way to handle the 'install' of mochad. Thanks for your patience.
              Best regards,
              -Mark-

              If you're not out on the edge, you're taking up too much room!
              Interested in 3D maps? Check out my company site: Solid Terrain Modeling

              Comment


                #22
                Mark, so far so good with Mochad 0.1.17.

                Just came across this GitHub from a chap called Neil Cherry. He's testing IPV6 tables (which may be of use to some) so its now at Mochad 0.1.18

                https://github.com/linuxha/mochad

                As far as I can see the CM15 was "hacked" to extract some form of working solution for Linux. Still a bit unknown of its inner workings from what I read but certainly a work in progress.

                I still have a fair bit of X10 equipment at my disposal , some dating back quite a few years and still in good working order, and it fits in nicely with HS3 (once its working of course).

                I wonder how long the current crop of controllers will last operating 24/7. Built in obsolescence is the key to manufacturing processes these days

                Comment


                  #23
                  Great that v17 is working for you, thanks for making the effort to figure it out! Let me know if you decide to try v18. IPv6 is likely not an issue when using mochad with HS, but maybe good to keep it current.

                  Most of my HA system is X10 with devices that have been running for more than 30 years which still work just fine. Of course those were built at a time when manufacturers had pride in their work and designed products to "last forever." Sad that those days are gone.
                  Best regards,
                  -Mark-

                  If you're not out on the edge, you're taking up too much room!
                  Interested in 3D maps? Check out my company site: Solid Terrain Modeling

                  Comment


                    #24
                    Just did a fresh install similar to the one I carried out when I installed Mochad 0.1.17. This time I used a CM11 instead of a CM15. The difference with the installation was amazing. So straightforward. I now have the choice of which x10 controller to use now.

                    Sticking with x10 for the foreseeable future. If I do decide to upgrade to Mochad 0.1.18 I'll post the results here.

                    Thanks for you help Mark.

                    Comment


                      #25
                      Great, glad that the X10 plugin for the CM11a/Ti103 hardware went smoothly. Of course these simply use a serial port while the CM15a is USB and requires the AH driver under Windows (very limited) or mochad under Linux, so more complicated!
                      Best regards,
                      -Mark-

                      If you're not out on the edge, you're taking up too much room!
                      Interested in 3D maps? Check out my company site: Solid Terrain Modeling

                      Comment


                        #26
                        Originally posted by Pete View Post
                        Yeah just looked at the installation files for Hs3 Pro and it does have the Mochad directory when it gets unzipped.
                        Just discovered that this HS3 version of mochad, which is also deposited in /usr/local/bin when the CM15 plugin is installed, won't run on Ubuntu 16.04.3 and Mono 5X.

                        I've installed mochad 0.1.16 and that works.

                        Doesn't need udev rules to run. I've deleted all the udev rules in fact.

                        Comment


                          #27
                          The plugin will start mochad if it is not running, but it only checks once at startup (not while it is running). If you unplug and re-plug your CM15a mochad will not be started and your CM15a will not work until the plugin is restarted or HS3 is restarted. The UDEV rules start mochad when the CM15a is plugged in, so if you ever want to disconnect and reconnect your CM15a without restarting the plugin or HS3 you'll need the UDEV rule.
                          Best regards,
                          -Mark-

                          If you're not out on the edge, you're taking up too much room!
                          Interested in 3D maps? Check out my company site: Solid Terrain Modeling

                          Comment


                            #28
                            I've just read the posts in this thread and even though the thread is rather old, I'd like to add a question if I may.

                            I recently installed the HS3 PRO on a Raspberry Pi4 and I have come across a peculiar problem: I installed mochad and created a service file to run mochad when the CM15PRO is connected to my Pi.
                            Looking at the netstat info it seems to connect properly to the CM15PRO and I can see the X10 commands:
                            10/02 21:55:07 Rx PL HouseUnit: B14
                            10/02 21:55:08 Rx PL House: B Func: Off
                            10/02 22:03:08 Tx PL HouseUnit: B12
                            10/02 22:03:08 Tx PL House: B Func: On
                            10/02 22:03:14 Tx PL HouseUnit: B12
                            10/02 22:03:14 Tx PL House: B Func: Off
                            10/02 22:10:22 Rx PL HouseUnit: B11
                            10/02 22:10:23 Rx PL House: B Func: On
                            10/02 22:10:27 Rx PL HouseUnit: B11
                            10/02 22:10:28 Rx PL House: B Func: Off
                            10/02 22:21:44 Rx PL HouseUnit: B11
                            10/02 22:21:44 Rx PL House: B Func: On
                            10/02 22:21:49 Rx PL HouseUnit: B11
                            10/02 22:21:49 Rx PL House: B Func: Off
                            10/02 22:27:53 Rx PL HouseUnit: B11
                            10/02 22:27:54 Rx PL House: B Func: On
                            10/02 22:27:58 Rx PL HouseUnit: B11
                            10/02 22:27:59 Rx PL House: B Func: Off
                            10/02 22:51:05 Rx PL HouseUnit: B11
                            10/02 22:51:06 Rx PL House: B Func: On
                            10/02 22:51:10 Rx PL HouseUnit: B11
                            10/02 22:51:11 Rx PL House: B Func: Off

                            I have created the devices in Homeseer and when I turn a device on and off (an X10 power switch) it responds. So it looks like everything works.

                            However, when I try to use the change of a device's value to initiate an event it does not work (f.i.if B11 is turned on ....etc.) In fact I don't see any reference to the X10 devices in the homeseer log (even though I unchecked the tick mark to not log commands from the device.

                            Click image for larger version

Name:	B12.png
Views:	517
Size:	364.4 KB
ID:	1330330

                            So sending commands to the devices works but triggering events based on the values of the devices does not work.

                            Any idea what I'm doing wrong?

                            Comment


                              #29
                              If you would, please try creating a device with an address less than 10 (B9
                              for example
                              ) and let me know if value change events trigger for that device.

                              Note that the settings on the device "Configuration" tab are HomeSeer settings and they do not affect the CM15a plugin settings. So unchecking "Do not log commands from this device" will not log X10 commands but you should see log entries when the device is changed from the UI.
                              Best regards,
                              -Mark-

                              If you're not out on the edge, you're taking up too much room!
                              Interested in 3D maps? Check out my company site: Solid Terrain Modeling

                              Comment


                                #30
                                Closing the issue raised above by mroovers…

                                This issue was handled via private messaging and ended up being a problem with an alarm panel being used to send X10 commands when motion sensors attached to the panel were triggered.

                                This is resolved and no changes were made to the CM15a plugin.
                                Best regards,
                                -Mark-

                                If you're not out on the edge, you're taking up too much room!
                                Interested in 3D maps? Check out my company site: Solid Terrain Modeling

                                Comment

                                Working...
                                X