After installing a fresh copy of Raspbian Jessie and following these installation instructions for HS3 Pro Linux version
https://forums.homeseer.com/showthread.php?t=162813
what exactly do I need to do to get x10 working with the CM15a plugin.
I created a Systemd mochad.service similar to your own and the Udev rules are created correctly. I'm still puzzled as to why Mochad is not running on boot. I cannot even start it manually. The CM15 unit is good so that is not the problem
Announcement
Collapse
No announcement yet.
What version of Mochad works best with CM15a plugin
Collapse
X
-
Mark, I tried the CM15 on another Raspberry Pi using Mochad and the unit is working fine. Used the Netcat ans all thhe echo commands
Back to HS3. My setup is practically the same as yours. Systemd file and Udev rules are fine too.I reboot the system and here's the output of systemctl status mochad.service
● mochad.service - mochad is a Linux TCP gateway daemon for X10 CM15A/CM15PRO/CM19A
Loaded: loaded (/etc/systemd/system/mochad.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2017-10-10 18:40:55 IST; 5min ago
Process: 382 ExecStart=/usr/local/bin/mochad (code=exited, status=203/EXEC)
Oct 10 18:40:55 raspberrypi systemd[1]: Failed to start mochad is a Linux TCP gateway daemon for X10 CM15A/CM15PRO/CM19A.
Oct 10 18:40:55 raspberrypi systemd[1]: mochad.service: Unit entered failed state.
Oct 10 18:40:55 raspberrypi systemd[1]: mochad.service: Failed with result 'exit-code'.
Oct 10 18:40:55 raspberrypi systemd[1]: mochad.service: Service hold-off time over, scheduling restart.
Oct 10 18:40:55 raspberrypi systemd[1]: Stopped mochad is a Linux TCP gateway daemon for X10 CM15A/CM15PRO/CM19A.
Oct 10 18:40:55 raspberrypi systemd[1]: mochad.service: Start request repeated too quickly.
Oct 10 18:40:55 raspberrypi systemd[1]: Failed to start mochad is a Linux TCP gateway daemon for X10 CM15A/CM15PRO/CM19A.
Oct 10 18:40:55 raspberrypi systemd[1]: mochad.service: Unit entered failed state.
Oct 10 18:40:55 raspberrypi systemd[1]: mochad.service: Failed with result 'exit-code'.
Clearly the systemd mochad.service is not running.
Leave a comment:
-
Oct-10 1:33:18 PM CM15A Unable to communicate with CM15A, try re-connecting to USB port, will retry in 5 seconds...: Connection refused
Oct-10 1:33:18 PM CM15A Initialization Successful.
Oct-10 1:33:18 PM CM15A Error connecting to CM15A service: Connection refused
Oct-10 1:33:18 PM CM15A mochad is not running, starting...
Oct-10 1:33:18 PM Info Plugin CM15A has connected. IP:127.0.0.1:41410
Oct-10 1:33:16 PM Plug-In Finished initializing plug-in CM15A
Here is a rundown of what is happening:
1) Oct-10 1:33:16 PM Plug-In Finished initializing plug-in CM15A
The plugin has been initialized.
2) Oct-10 1:33:18 PM Info Plugin CM15A has connected. IP:127.0.0.1:41410
HS3 has successfully connected to the plugin instance.
3) Oct-10 1:33:18 PM CM15A mochad is not running, starting...
Plugin sees that mochad is not running and tries to launch it.
4) Oct-10 1:33:18 PM CM15A Error connecting to CM15A service: Connection refused
Nothing returned from mochad
5) Oct-10 1:33:18 PM CM15A Initialization Successful.
This is a bug - it should not report that init was successful.
6) Oct-10 1:33:18 PM CM15A Unable to communicate with CM15A, try re-connecting to USB port, will retry in 5 seconds...: Connection refused
The plugin continues attempting to connect every 5 seconds.
I replicated this behavior by unplugging my CM15a and then enabling the CM15a plugin, and I received these messages on the command line:Broadcast message from systemd-journald@raspberrypi (Tue 2017-10-10 08:47:25 PDT):
mochad[17936]: libusb_open_device_with_vid_pid failed
Broadcast message from systemd-journald@raspberrypi (Tue 2017-10-10 08:47:25 PDT):
mochad[17936]: Could not find/open CM15A/CM19A -5
Message from syslogd@raspberrypi at Oct 10 08:47:25 ...
mochad[17936]: libusb_open_device_with_vid_pid failed
Message from syslogd@raspberrypi at Oct 10 08:47:25 ...
mochad[17936]: Could not find/open CM15A/CM19A -5
root@raspberrypi:/etc/udev#
Check and see if this is the case on your Pi. If mochad does not start when you plug in the CM15a then there is likely an issue with the install of mochad.
I am wondering if there is an issue with your CM15a or USB cable since you mentioned that you saw mochad was running but the plugin could not talk to it. Perhaps you might try testing mochad from the command line without HS3 or the plugin running. This is detailed on the SourceForge page:
== Run it
Plugging a CM15A or CM19A should launch mochad. There no need to run mochad by hand or run it from /etc/rc.local. mochad is launched by a udev rule that matches the CM15A and CM19A USB vendor and product ID codes.
== Use it
Connect to mochad using netcat. For example,
nc localhost 1099
You can connect to mochad from another host by specifying the IP of the host running mochad. netcat is available for Windows at <http://joncraton.org/blog/netcat-for-windows>.
Everything sent by mochad appears on netcat standard output. In the simplest use case, mochad/netcat can be used to see X10 PL and RF activity. For example, run mochad on one host with a CM15A then connect to it using netcat from a netbook. Walk around with various X10 RF remote controls and the netbook to see which remotes work from various locations.
Sample output:
12/07 20:49:10 Rx RF HouseUnit: C3 Func: Off
12/07 20:49:10 Tx PL HouseUnit: C3
12/07 20:49:10 Tx PL House: C Func: Off
12/07 20:49:10 Rx RF HouseUnit: C3 Func: Off
12/07 20:49:10 Tx PL HouseUnit: C3
12/07 20:49:10 Tx PL House: C Func: Off
12/07 20:49:17 Rx RFSEC Addr: 0x11 Func: Lights_Off_SH624
12/07 20:49:17 Rx RFSEC Addr: 0x11 Func: Lights_Off_SH624
12/07 20:49:37 Rx RFSEC Addr: C6:1B:00 Func: Motion_alert_MS10A
12/07 20:49:37 Rx RFSEC Addr: C6:1B:00 Func: Motion_alert_MS10A
12/07 20:49:37 Rx RFSEC Addr: C6:1B:00 Func: Motion_alert_MS10A
12/07 20:49:37 Rx RFSEC Addr: C6:1B:00 Func: Motion_alert_MS10A
Everything sent to netcat standard input is sent to mochad. The following is a brief list of mochad commands.
pl a1 [on|off]
pl a1 [dim|bright] 0..31
pl a1 xdim 0..255
pl a1
pl a2
pl a [on|off|dim|bright|xdim|all_lights_on|all_lights_off|all_unit s_off]
rf a1 [on|off|dim|bright]
st -- show device status including RF security devices
By default, received RF X10 commands are repeated on the PL interface for all house codes. This can be changed using the rftopl command (RF to PL repeater).
rftopl * -- enable all house codes (default)
rftopl abc -- enable for house codes A, B, and C. Disable for all others.
rftopl 0 -- disable for all house codes. This is useful if more than one CM15A is in use. Leaving both enabled will result in PL collisions and redundant commands.
Please see http://sourceforge.net/apps/mediawik...itle=Main_Page for more details on command and event messages.
Leave a comment:
-
Yes Pete that's the Udev rules. Assuming that a Systemd service is setup and enabled and the Udev rules are correct the CM15a plugin should connect to an instance of Mochad which in turn should communicate with the CM15 unit.
I have tried this but the plugin will not connect to the CM15 unit as you can see from the above log. I can separately install Mochad first, configure as above and the plugin will connect to the CM15 unit.
If Mochad is already packaged with HS3 Pro for Linux why can't I get the CM15a plugin to connect to the CM15 unit without installing Mochad separately.
Leave a comment:
-
Here looking at earlier versions of the Zee2 OS and inside of the mochad directory there is a file called.
91-usb-x10-controllers.rules
File appears to be configuring mochad on boot. Note too that this probably relates to the HS3 version of the X10 plugin from way long time ago.
Here have a copy of the orginal Zee OS on an SD card. Never used it as I went to copying it to a larger SD card at the time. Will have a look see at that SD card.
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"Last edited by Pete; October 10, 2017, 08:37 AM.
Leave a comment:
-
Copy of the log when disabled the CM15a plugin, rebooted HS3 and then enabled the CM15a plugin.
Oct-10 1:33:42 PM Info Plugin CM15A with instance: has disconnected
Oct-10 1:33:42 PM Plug-In Shutting down Plug-In: CM15A
Oct-10 1:33:39 PM CM15A Unable to communicate with CM15A, try re-connecting to USB port, will retry in 5 seconds...: Connection refused
Oct-10 1:33:34 PM CM15A Unable to communicate with CM15A, try re-connecting to USB port, will retry in 5 seconds...: Connection refused
Oct-10 1:33:29 PM CM15A Unable to communicate with CM15A, try re-connecting to USB port, will retry in 5 seconds...: Connection refused
Oct-10 1:33:23 PM CM15A Unable to communicate with CM15A, try re-connecting to USB port, will retry in 5 seconds...: Connection refused
Oct-10 1:33:18 PM CM15A Unable to communicate with CM15A, try re-connecting to USB port, will retry in 5 seconds...: Connection refused
Oct-10 1:33:18 PM CM15A Initialization Successful.
Oct-10 1:33:18 PM CM15A Error connecting to CM15A service: Connection refused
Oct-10 1:33:18 PM CM15A mochad is not running, starting...
Oct-10 1:33:18 PM Info Plugin CM15A has connected. IP:127.0.0.1:41410
Oct-10 1:33:16 PM Plug-In Finished initializing plug-in CM15A
Leave a comment:
-
I reinstalled HS3 on a fresh copy of Jessie without installing Mochad as I'd previously done and here's a copy of the log.
Oct-10 01:18:01 CM15A Unable to communicate with CM15A, try re-connecting to USB port, will retry in 5 seconds...: Connection refused
Oct-10 01:17:57 Plug-In Finished initializing plug-in CM15A
Oct-10 01:17:56 CM15A Unable to communicate with CM15A, try re-connecting to USB port, will retry in 5 seconds...: Connection refused
Oct-10 01:17:56 CM15A Initialization Successful.
Oct-10 01:17:56 CM15A Error connecting to CM15A service: Connection refused
Oct-10 01:17:55 CM15A mochad is not running, starting...
Oct-10 01:17:55 Info Plugin CM15A has connected IP:127.0.0.1:55262
Does this look like Mochad is already installed in HS3
Leave a comment:
-
Mark I totally understand and appreciate that you have volunteered your time to answer any x10 related issues where possible. I have taken that on board when asking questions i.e. no unreasonable demands and total patience on any replies that you provide if and when you have the time.
I was not aware that Mochad was installed onto HS3 Linux when the CM15a plugin was installed. I assumed the Installation of Mochad was done as a separate operation prior to the downloading and installation of the CM15a plugin. As Mochad is not available in any of the Debian Repos to my knowledge, any time I've needed it for x10 I've always installed it as a makefile. This might explain why I am having problems with x10 on HS3 Pro. I may have two versions of Mochad running.
I'm currently running HS3 Pro on Raspbian Jessie with Mono 4.6 and have Mochad 0.1.17 installed. From what you have now told me, I'm going to do a fresh install of HS3 Pro and skip the installation of Mochad as you have pointed out this is not necessary.
There's not much in the way of "how to's" for this particular plugin but thanks for the time and the heads up on this error I made on installation. I'm using a similar Systemd file to your own.
I'll let you know how I get on with this revised installation.
Leave a comment:
-
Yes, mochad is started using systemd, here is a copy of 'mochad.service' on my system:Code:[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
Mochad is started when Linux discovers the CM15a hardware plugged in and as far as I know it does not sleep.
What version of HS3 Linux are you running? Was mochad not installed with HS3?
Please note that I am not the author of this plugin but volunteered to support the X10 plugins after HS Tech announced that they would no longer be supporting them.
Leave a comment:
-
Mark, before I carry out any of the testing you suggest could you indicate how Mochad is configured in your Jessie Lite setup. Do you have Mochad run as a service using the Systemd service.
Assuming you originally installed Mochad as a makefile what else did you need to do to ensure that Mochad responded to any calls made by the CM15a plugin. Does the CM15a go into some form of sleep mode after a certain period of time.
Leave a comment:
-
My test system is running JesseLite 4.4 and mochad 0.1.16. When I enable the plugin with a CM15a connected, HS3 starts mochad without any issues and the CM15a functions properly. Here is a snip from my HS3 log after enabling the plugin:Code:Oct-08 08:33:56 Plug-In Finished initializing plug-in CM15A Oct-08 08:33:55 CM15A Initialization Successful. Oct-08 08:33:55 CM15A mochad is not running, starting... Oct-08 08:33:55 Info Plugin CM15A has connected. IP:127.0.0.1:56044
As for testing, with mochad 0.1.17 loaded, enable 'Developer Mode' then enable the CM15a plugin:
1) what is shown for the status of the plugin?
2) what is logged in the HS3 log by the plugin?
3) can you send X10 commands?
4) do you receive X10 commands?
Thanks for your help!
Leave a comment:
-
Originally posted by mfisher View PostTo be perfectly honest I am not sure. I have not looked at mochad in quite some time and I've not reviewed any of the update info. Any chance you'd be willing to load the latest version and test?
Leave a comment:
-
The reason I ask is I've got 0.1.17 on a Raspbian Jessie install which was supposed to to resolve the issue with Systemd and Udev rules.
When I send a command to turn on a light in x10 the log shows that the command had been executed correctly yet nothing happens. When I check systemd status mochad.service mochad is shown as running.
I've just noticed a version 0.0.18 version but all it does is address ipv6 tables which is of no concern to me
Leave a comment:
-
To be perfectly honest I am not sure. I have not looked at mochad in quite some time and I've not reviewed any of the update info. Any chance you'd be willing to load the latest version and test?
- Likes 1
Leave a comment:
-
What version of Mochad works best with CM15a plugin
Mark I was wondering what version of Mochad works best with the CM15a plugin. The reason I ask is that Sourceforge are still offering version 0.1.16 as the latest download yet they have 0.1.17 available which supposedly resolves the issues people were having using the Systemd and Udev system.
I'm using Raspbian Jessie which clearly demands Systemd and the Udev system.Tags: None
Leave a comment: