Please login or register.

Login with username, password and session length
Pages: 1 [2] 3 4 ... 7

Author Topic: installing helper programs to pi for X10 integration  (Read 17490 times)

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1750
Re: installing helper programs to pi for X10 integration
« Reply #15 on: October 22, 2018, 04:54:52 PM »

Petera, mochad 1.16 did not work well so I reimaged fresh and installed 1.17 - it ran for a day before stopping.   I am sure it is mochad code issue...     Here are two commands that pretty much show me the program is screwed up:

pi@raspberrypi:~/mochad-0.1.17 $ ./mochad
Message from syslogd@raspberrypi at Oct 21 19:49:49 ...
 mochad[565]: libusb_open_device_with_vid_pid failed

Broadcast message from systemd-journald@raspberrypi (Sun 2018-10-21 19:49:49 UTC):

mochad[565]: libusb_open_device_with_vid_pid failed

Message from syslogd@raspberrypi at Oct 21 19:49:49 ...
 mochad[565]: Could not find/open CM15A/CM19A -5

Broadcast message from systemd-journald@raspberrypi (Sun 2018-10-21 19:49:49 UTC):

mochad[565]: Could not find/open CM15A/CM19A -5

CANNOT FIND THE CM15....   BUT BUT BUT:

Can't locate it right now, but found another status line command where it interogated mochad - and it very clearly stated "CM15 FOUND."   

I could run both commands right after each othere and consistency.  one says cm15 found, other says cm15 not found...

anyway, I recall rumors of a 1.18 ver of mochad but never could find it - I will try that!  Thanks!

Did you try this http://www.domoticz.com/forum/viewtopic.php?f=56&t=21246&p=180247&hilit=mochad#p180247
Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
Re: installing helper programs to pi for X10 integration
« Reply #16 on: October 22, 2018, 05:05:22 PM »

tnx for timer -w1 post;  yes, I have that under control;   if not used, sending a command leaves mochad OPEN and ANY and ALL x10 commands sent or received are seen real time - useful feature!  then that window needs to be close by ^x...   but with -w1 timer sent, it times out and only the command just sent happens and its report back given, then we are returned to pi command line.

I will try the 1.18 you found tonight in front of tv...
 
tnx
Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
Re: installing helper programs to pi for X10 integration
« Reply #17 on: October 22, 2018, 05:10:01 PM »



What version of Mochad are you using. Sounds like your version of the daemon is locking up and disconnecting. You could try version 0.1.18 found here https://github.com/linuxha/.

Mochad 0.1.17 on my Pi is running fine at all times.

I cannot find mochad 1.18 at the site shown?
Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1750
Re: installing helper programs to pi for X10 integration
« Reply #18 on: October 22, 2018, 05:33:14 PM »



What version of Mochad are you using. Sounds like your version of the daemon is locking up and disconnecting. You could try version 0.1.18 found here https://github.com/linuxha/.

Mochad 0.1.17 on my Pi is running fine at all times.

I cannot find mochad 1.18 at the site shown?

0.1.17 should work anyway. Just try Moched on a separate SD card with nothing else running.
Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1750
Re: installing helper programs to pi for X10 integration
« Reply #19 on: October 22, 2018, 05:47:45 PM »

I've posted this before but here it is again...........

NOTE Hansbit on May 10 2018: There is an issue with Mocad 0.1.17 and Debian Stretch that causes nc to become unresponsive after a first command. The solution is to add a time out parameter (-w1) to you nc command. Example:

  echo "pl a1 on" | nc -w1 localhost 1099
Note (assuming your installation is on a Raspberry):

The file 'readme.txt' in '/home/pi/domoticz/scripts' say : 'to use this script, remove the underscore in front of the filename' , so go in the directory and rename the file
 cd /home/pi/domoticz/scripts
 mv _domoticz_main domoticz_main
Make sure the script has executable rights with:
 chmod +x domoticz_main

To use this script you need the latest version (minimum Vs. 1.0.940) to make light buttons in the GUI !
The option 'dim' and 'bright' is still in test !!

You can add the 'Dummy' hardware device, and add manual light/switches

If 0.1.17 is still giving problems go to 0.1.16 and try that
Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
Re: installing helper programs to pi for X10 integration
« Reply #20 on: October 22, 2018, 06:03:22 PM »

I know about -w1 to terminate the command;  the other part about the script is for when you add ocahd command lines to domoticz main script I believe.  Otherwise that section is meaningless.  i went ahead and copied it from _dom... to dom and rebooted and of course no change.  Mochad 1.17 is not seeing the cm115 properly...   I may try 1.16 again since there does not see to be a 1.18 in existence...
Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
Re: installing helper programs to pi for X10 integration
« Reply #21 on: October 22, 2018, 06:12:28 PM »

"Works very well. HOWEVER, In ActiveHomePro, you must clear the CM15A interface memory, then set the CM15A to NOT transceive RF to PL signals (per the instructions). If you skip this step, Mochad may lockup on you."

I DID turn on transceive in recent test...   about same time it started locking up...  hmmm...   I will try turning that off before hosing this version of image...   cant get to it until tomorrow mid morning tho...
Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
Re: installing helper programs to pi for X10 integration
« Reply #22 on: October 22, 2018, 06:18:49 PM »

here is the other command showing how mochad is confused over cm15:

pi@raspberrypi:~/mochad-0.1.17 $ sudo systemctl status mochad
● mochad.service - Start mochad service
   Loaded: loaded (/lib/systemd/system/mochad.service; disabled; vendor preset:
   Active: active (running) since Mon 2018-10-22 21:56:18 UTC; 20min ago
  Process: 273 ExecStart=/usr/local/bin/mochad (code=exited, status=0/SUCCESS)
 Main PID: 276 (mochad)
   CGroup: /system.slice/mochad.service
           └─276 /usr/local/bin/mochad

Oct 22 21:56:18 raspberrypi systemd[1]: Starting Start mochad service...
Oct 22 21:56:18 raspberrypi systemd[1]: Started Start mochad service.
Oct 22 21:56:18 raspberrypi mochad[276]: Found CM15A
Oct 22 21:56:18 raspberrypi mochad[276]: In endpoint 0x81, Out endpoint 0x02

[2]+  Stopped                 sudo systemctl status mochad
pi@raspberrypi:~/mochad-0.1.17 $ ./mochad
pi@raspberrypi:~/mochad-0.1.17 $
Message from syslogd@raspberrypi at Oct 22 22:17:28 ...
 mochad[664]: libusb_open_device_with_vid_pid failed

Broadcast message from systemd-journald@raspberrypi (Mon 2018-10-22 22:17:28 UTC):

mochad[664]: libusb_open_device_with_vid_pid failed


Message from syslogd@raspberrypi at Oct 22 22:17:28 ...
 mochad[664]: Could not find/open CM15A/CM19A -5

Broadcast message from systemd-journald@raspberrypi (Mon 2018-10-22 22:17:28 UTC):

mochad[664]: Could not find/open CM15A/CM19A -5


Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1750
Re: installing helper programs to pi for X10 integration
« Reply #23 on: October 22, 2018, 08:35:36 PM »

Mike not sure of the contents of your Systemd service file but try this one for Mochad. Just change the locations to suit your setup

[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

Use Mochad v 0.1.16 with this
Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
Re: installing helper programs to pi for X10 integration
« Reply #24 on: October 23, 2018, 08:11:10 AM »

tnx.  would that have any affect with my version 1.17?  my understanding it uses u-dev instead of systemd?

And don't these just get it started then not used anymore?  I am guessing here...   but m y mochad is always running as proved by various ps -A and system check commands....   it just seems to loose contact with the cm15...?
Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1750
Re: installing helper programs to pi for X10 integration
« Reply #25 on: October 23, 2018, 09:01:46 AM »

tnx.  would that have any affect with my version 1.17?  my understanding it uses u-dev instead of systemd?

And don't these just get it started then not used anymore?  I am guessing here...   but m y mochad is always running as proved by various ps -A and system check commands....   it just seems to loose contact with the cm15...?

Have a read of this post.   mmauka is a member here and encountered similar difficulties to yourself so did a bit of work on Mochad.
http://forums.x10.com/index.php?topic=22045.30

The UDEV rule is created automatically as soon as you make Mochad from the GitHub. You then create the Systemd service to launch Mochad as a daemon that runs in the background and launches as soon as its called on.

A pure service will only run for a specified amount of time and end. A daemon on the other hand will remain available to the system when it's required https://www.makeuseof.com/tag/control-linux-start-services-daemons/
Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
Re: installing helper programs to pi for X10 integration
« Reply #26 on: October 23, 2018, 09:15:45 AM »

wow.  lots to learn!  tnx.         I have seen some of mmauka's posts;  IIRC he is one that made the 1.18 version, but all it did was add ipv6 so not going to help my issues.

I still need to turn off transceive in cm15 and see if that is whhat is causing it to dissappear...   
Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
Re: installing helper programs to pi for X10 integration
« Reply #27 on: October 23, 2018, 11:53:14 AM »

So I used windows AHP and shut off transceive house codes and now Domoticz is sending code thru mochad 1.17 again to turn lites on and off...   good so far. 

In the last days I saw posts saying I should rename unused _domoticz_main to domoticz_main  to  make mochad work...    no clue, but I did it...  here is that file:

------------------------------------
#!/bin/sh

startup_path=$1
hardware_id=$2
device_id=$3
status=$4
status2=$5
devname=$6

echo "startup_path=${startup_path}, hardware_id=${hardware_id}, device_id=${device_id}, status=${status}, status2=${status2}, devname=${devname}"
---------------------------------------------

and here is the result in the domoticz log:

----------------------
 2018-10-23 15:45:42.859 Error: (Broadlink-RM2) Error Connecting to Broadlink device....192.168.0.3
2018-10-23 15:46:12.371 (Broadlink-RM2) Pushing 'onHeartbeatCallback' on to queue
2018-10-23 15:46:12.389 (Broadlink-RM2) Processing 'onHeartbeatCallback' message
2018-10-23 15:46:12.389 (Broadlink-RM2) Calling message handler 'onHeartbeat'.
2018-10-23 15:46:42.380 (Broadlink-RM2) Pushing 'onHeartbeatCallback' on to queue
2018-10-23 15:46:42.420 (Broadlink-RM2) Processing 'onHeartbeatCallback' message
2018-10-23 15:46:42.420 (Broadlink-RM2) Calling message handler 'onHeartbeat'.
2018-10-23 15:47:12.387 (Broadlink-RM2) Pushing 'onHeartbeatCallback' on to queue
2018-10-23 15:47:12.396 (Broadlink-RM2) Processing 'onHeartbeatCallback' message
2018-10-23 15:47:12.397 (Broadlink-RM2) Calling message handler 'onHeartbeat'.
2018-10-23 15:47:28.611 (Mochad) Lighting 1 (Workshop, B5)
2018-10-23 15:47:28.634 (Mochad) Lighting 1 (Workshop, B5)
2018-10-23 15:47:29.669 (Mochad) Lighting 1 (Workshop, B5)
2018-10-23 15:47:29.607 Status: Executing script: /home/pi/domoticz/scripts/domoticz_main
2018-10-23 15:47:29.705 Status: Executing script: /home/pi/domoticz/scripts/domoticz_main
2018-10-23 15:47:30.663 Status: Executing script: /home/pi/domoticz/scripts/domoticz_main
2018-10-23 15:47:33.075 (Mochad) Lighting 1 (B10, Ele Wrkshop music-lite)
2018-10-23 15:47:33.098 (Mochad) Lighting 1 (B10, Ele Wrkshop music-lite)
2018-10-23 15:47:34.069 Status: Executing script: /home/pi/domoticz/scripts/domoticz_main
2018-10-23 15:47:34.145 Status: Executing script: /home/pi/domoticz/scripts/domoticz_main
2018-10-23 15:47:42.395 (Broadlink-RM2) Pushing 'onHeartbeatCallback' on to queue
2018-10-23 15:47:42.430 (Broadlink-RM2) Processing 'onHeartbeatCallback' message
2018-10-23 15:47:42.430 (Broadlink-RM2) Calling message handler 'onHeartbeat'.
2018-10-23 15:48:12.403 (Broadlink-RM2) Pushing 'onHeartbeatCallback' on to queue
2018-10-23 15:48:12.408 (Broadlink-RM2) Processing 'onHeartbeatCallback' message
2018-10-23 15:48:12.408 (Broadlink-RM2) Calling message handler 'onHeartbeat'.
2018-10-23 15:48:28.129 (Mochad) Lighting 1 (B10, Ele Wrkshop music-lite)
2018-10-23 15:48:28.152 (Mochad) Lighting 1 (B10, Ele Wrkshop music-lite)
2018-10-23 15:48:29.118 Status: Executing script: /home/pi/domoticz/scripts/domoticz_main
2018-10-23 15:48:29.195 Status: Executing script: /home/pi/domoticz/scripts/domoticz_main
2018-10-23 15:48:42.412 (Broadlink-RM2) Pushing 'onHeartbeatCallback' on to queue
2018-10-23 15:48:42.441 (Broadlink-RM2) Processing 'onHeartbeatCallback' message
2018-10-23 15:48:42.442 (Broadlink-RM2) Calling message handler 'onHeartbeat'.
2018-10-23 15:48:45.733 (Mochad) Lighting 1 (Workshop, B5)
2018-10-23 15:48:46.725 Status: Executing script: /home/pi/domoticz/scripts/domoticz_main
2018-10-23 15:49:12.420 (Broadlink-RM2) Pushing 'onHeartbeatCallback' on to queue
2018-10-23 15:49:12.421 (Broadlink-RM2) Processing 'onHeartbeatCallback' message
201
-------------------------------------

Ignoring the broken broadlink above, I see that renamed file is running everytime mochad does something!    I may delete it (I have the _domoticz_main still there) to see if it does anything... 

I am not too worried about the double and triple hits as I have so many repeaters and my main cm15 still active here...
Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1750
Re: installing helper programs to pi for X10 integration
« Reply #28 on: October 23, 2018, 02:28:19 PM »

Clearing timers/macros and turning off transceiver and house code monitoring was mentioned way back. In fact it's mentioned in the instructions when doing the Makefile in Mochad.

I assumed you had already carried that out.
Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
Re: installing helper programs to pi for X10 integration
« Reply #29 on: October 23, 2018, 04:23:10 PM »

ya, I know.  I have seen it all along.  I just have issues with doing things that make no sense - like turning off trancieved codes.   It worked - for 1/2 a day.  working 100% b4 lunch, then I left to go bushhog some of 80 acres across the street;  back and mochad is running, and still responds to such as   echo "pl a1 on" | nc localhost 1099, but domoticz not working...   


sheesh...   I used to think windows are AWFUL and unreliable, but after messing with pi I have new respect for it!
Logged
Pages: 1 [2] 3 4 ... 7
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.