[PLUG] Home Automation mochad netcat ha-bridge

Ken Stephens kennethgstephens at gmail.com
Sat Dec 5 23:54:56 UTC 2020


Michael,

Put the startup command in the /etc/rc.local.  The OS is a systemd system,
but you can turn on rc.local.service with systemctl.  You should add the &
at the end on the command in rc.local so it can complete.  If there is no
rc.local file create one and make it executable.

Ken

On Sat, Dec 5, 2020 at 1:22 PM Michael Barnes <barnmichael at gmail.com> wrote:

> Anybody have any experience with mochad or netcat?
> My project is using a Raspberry Pi Zero with an X-10 CM-19A transceiver to
> control my Christmas lights from Alexa.
>
> There are two components to this. First is to install mochad to pipe
> commands to the CM-19A. I got mochad installed and it seems to work. From
> the command line or script, I do
>
> echo "rf A2 on" | nc localhost 1099
>
> to turn on the controllers at address A2. Apparently piping the command
> through netcat gets it to mochad and on to the CM-19A. While that works and
> turns on the lights, the command stays open and I have to hit ^C to end and
> get a prompt back. The other issue is mochad does not start automatically
> on boot. The information I found said mochad should start automatically
> when the CM-19A is plugged into the USB port. I'm far from a USB genius, so
> I'm not sure how this is supposed to work. I do have
>
> /etc/udev/rules.d/91-usb-x10-controllers.rules
>
> which contains
> 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"
>
> That should do the deed, but it does not.
>
> So, those are my first two issues, the command not completing cleanly and
> mochad not starting automatically.
>
> The other aspect to this setup is ha-bridge, which is a java thing. It is
> supposed to interface with my Alexa to run scripts on command. I haven't
> gotten far enough along with that to have any questions, yet, but if anyone
> is familiar with it and has any tips to offer, I would appreciate it.
>
> Thanks,
> Michael
> _______________________________________________
> PLUG: https://pdxlinux.org
> PLUG mailing list
> PLUG at pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug
>



More information about the PLUG mailing list