genielabs / HomeGenie

HomeGenie, the programmable automation intelligence
https://homegenie.it
GNU General Public License v3.0
395 stars 155 forks source link

Upgrade from homegenie-beta_1.1.r526 to homegenie_1.2-beta.13 has broken X10 #341

Closed mralapete closed 5 years ago

mralapete commented 5 years ago

Just updated as per above the above using the built in updater which reports an available update and also attempted to manually update but the update has broken X10 functionality using the CM15Pro.

I did notice that there has been a recent version update to the XtenLib after a three year gap in releases as per the Nuget repository.

I reverted to my original version homegenie_1.2-beta and everything is working fine.

tuicemen commented 5 years ago

Beta 13 works fine for X10 with my CM15A! However I've been updating as releases are published using the HG updater. the Updater was fixed in1.2-beta I believe, you may wish to try the updater and see if X10 still fails.

genemars commented 5 years ago

@mralapete did you try a fresh install? I'm also running 1.2-beta.13 and it works with CM15Pro, but I've upgrading with a fresh install from 1.1-stable.527 because the updater was bugged in 1.1-beta.526.

genemars commented 5 years ago

@mralapete also see #334.

mralapete commented 5 years ago

@genemars yes I installed 1.1-stable.527 fresh install, restored my backup config file and X10 was working fine. I then updated to 1.2 beta 13 using the HG updater. Just as the update completes X10 is disabled and cannot be re enabled through the Settings. I tried a fresh install of of 1.2 beta 13 and it also shows X10 as disabled and also cannot be re enabled.

Just to reconfirm, X10 working fine up to and including 1.1 stable v527. No version after that has a working X10 for me. I am using a Raspberry Pi Zero W/Raspbian Lite with Mono V 5.4.0.201.

I do remember there was an issue with what version of Mono would run with HG. Could you tell me what Raspberry Pi setup you are testing on

tuicemen commented 5 years ago

I'm running the Raspbian Stretch Full (GUI) version with out issues. I suspect the issue may be with the Stretch Lite version and a missing dependency.

genemars commented 5 years ago

do you see any suspicious message/error when running hg from the console?

mralapete commented 5 years ago

@genemars I'll check that and report back.

It's very strange behaviour indeed. Never had an issue with X10 in HG before. What was that update in XtenLib you made recently.

genemars commented 5 years ago

@mralapete there was no update at all. I only added CI scripts and updated NLog dependency.

mralapete commented 5 years ago

Ok here's the output from the HG debug

2018-10-19 19:53:39.6530 Debug Setting Interface options 2018-10-19 19:53:39.6841 Trace HomeAutomation.X10: Port=USB 2018-10-19 19:53:39.6841 Trace HomeAutomation.X10: HouseCodes=A,B

2018-10-19 19:54:46.6496 Error System.Exception: X10 CM15Pro device not connecte d. at XTenLib.Drivers.CM15.Open () [0x00022] in <0399acd97f1848eda7cbf0af5103020e >:0

And here's the output from lsusb to show that the CM15Pro is connected and recognised

Bus 001 Device 002: ID 0bc7:0001 X10 Wireless Technology, Inc. ActiveHome (ACPI-compliant)

genemars commented 5 years ago

@mralapete please try 1.2-beta.14 and let me know if this fixes the issue with CM15.

mralapete commented 5 years ago

Just tried it. No change.Still the same error message in the debug.

What device path is HG trying to grab the CM15Pro from. Here's the contents of lsusb

$ lsusb Bus 001 Device 002: ID 0bc7:0001 X10 Wireless Technology, Inc. ActiveHome (ACPI-compliant) Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Vendor ID of the CM15Pro looks fine and is identified correctly as Device 002. The CM15Pro is plugged into a usb-to mini usb cable.

As I stated previously it is working fine in HG v527

genemars commented 5 years ago

@mralapete did you try a fresh install or update? please do a ls -la both from /usr/local/bin/homegenie/ and /usr/local/bin/homegenie/lib/mig and post the output here. I just tried upgrading to 1.2-beta.14 on my Pi and it is still working fine.

mralapete commented 5 years ago

I’m doing this from a fresh install on a Raspberry Pi Zero W using Raspbian Stretch Lite.

Could you confirm what Mono version you are testing with. Is it from the Raspbian repository.

I’ll run those commands you requested as soon as I’m back at base.

genemars commented 5 years ago
Mono JIT compiler version 3.2.8
on Linux raspberrypi 4.9.35-v7+
genemars commented 5 years ago

There's actually a difference with v1.1-stable.527 and it is that *LibUsb.dll* was previously copied from a static version located in the Externals folder of hg repository, while now it is got from the latest NuGet package. So another test you can do is trying to replace the new LibUsb* files with the older ones. These files are located in the /usr/local/bin/homegenie/lib/mig folder.

mralapete commented 5 years ago
 $ ls -la
total 9016
drwxrwxr-x 8 2000  2000    4096 Oct 20 19:04 .
drwxrwsr-x 3 root staff    4096 Oct 20 15:05 ..
-rw-rw-r-- 1 2000  2000     951 Oct 20 11:20 automationgroups.xml
-rw-rw-r-- 1 2000  2000     435 Oct 20 11:20 certaccept.xml
-rwxrwxr-x 1 2000  2000    3072 Oct 20 11:20 Common.dll
-rw-rw-r-- 1 2000  2000     429 Oct 20 11:20 Common.dll.mdb
-rw-rw-r-- 1 2000  2000   10240 Oct 20 11:20 Common.Logging.Core.dll
-rw-rw-r-- 1 2000  2000   44544 Oct 20 11:20 Common.Logging.dll
-rw-rw-r-- 1 2000  2000  151040 Oct 20 11:20 CommonMark.dll
-rw-rw-r-- 1 2000  2000    1463 Oct 20 11:20 CREDITS.TXT
drwxrwxr-x 2 2000  2000    4096 Oct 20 15:05 DEBIAN
-rw-rw-r-- 1 2000  2000    3364 Oct 20 11:20 groups.xml
-rwxrwxr-x 1 2000  2000  295936 Oct 20 11:20 HomeGenie.exe
-rw-rw-r-- 1 2000  2000     702 Oct 20 11:20 HomeGenie.exe.config
-rw-rw-r-- 1 2000  2000  108703 Oct 20 11:20 HomeGenie.exe.mdb
-rw-rw-r-- 1 2000  2000  127549 Oct 20 11:20 homegenie_factory_config.zip
-rw-rw-r-- 1 2000  2000    3072 Oct 20 19:04 homegenie_stats.db
drwxrwxr-x 9 2000  2000    4096 Oct 20 15:05 html
-rw-rw-r-- 1 2000  2000  196096 Oct 20 11:20 ICSharpCode.SharpZipLib.dll
-rw-rw-r-- 1 2000  2000       6 Oct 20 11:20 installed_packages.json
-rw-rw-r-- 1 2000  2000 1801216 Oct 20 11:20 IronPython.dll
-rw-rw-r-- 1 2000  2000  705536 Oct 20 11:20 IronPython.Modules.dll
-rw-rw-r-- 1 2000  2000  637440 Oct 20 11:20 IronPython.SQLite.dll
-rw-rw-r-- 1 2000  2000    7168 Oct 20 11:20 IronPython.Wpf.dll
-rw-rw-r-- 1 2000  2000  249856 Oct 20 11:20 Jint.dll
drwxrwxr-x 4 2000  2000    4096 Oct 20 15:05 lib
-rw-rw-r-- 1 2000  2000    1619 Oct 20 11:20 LICENCE.TXT
-rw-rw-r-- 1 2000  2000   35795 Oct 20 11:20 LICENSE_GPLV3.TXT
-rwxrwxr-x 1 2000  2000    3072 Oct 20 11:20 Linux.dll
-rw-rw-r-- 1 2000  2000     427 Oct 20 11:20 Linux.dll.mdb
drwxr-xr-x 2 root root     4096 Oct 20 15:07 log
-rw-rw-r-- 1 2000  2000   52224 Oct 20 11:20 M2Mqtt.Net.dll
-rw-rw-r-- 1 2000  2000 1069568 Oct 20 11:20 Microsoft.Dynamic.dll
-rw-rw-r-- 1 2000  2000  140800 Oct 20 11:20 Microsoft.Scripting.dll
-rw-rw-r-- 1 2000  2000   89600 Oct 20 11:20 Microsoft.Scripting.Metadata.dll
-rw-rw-r-- 1 2000  2000   23336 Oct 20 11:20 Microsoft.VisualStudio.CodeCoverage.Shim.dll
-rw-rw-r-- 1 2000  2000   75264 Oct 20 11:20 MIG.dll
-rw-rw-r-- 1 2000  2000  109789 Oct 20 11:20 modules.xml
-rwxrwxr-x 1 2000  2000   14336 Oct 20 11:20 NetClientLib.dll
-rw-rw-r-- 1 2000  2000    4613 Oct 20 11:20 NetClientLib.dll.mdb
-rw-rw-r-- 1 2000  2000  662528 Oct 20 11:20 Newtonsoft.Json.dll
-rw-rw-r-- 1 2000  2000     513 Oct 20 11:20 NLog.config
-rw-rw-r-- 1 2000  2000  702464 Oct 20 11:20 NLog.dll
drwxrwxr-x 2 2000  2000    4096 Oct 20 15:05 programs
-rw-rw-r-- 1 2000  2000  119678 Oct 20 11:20 programs.xml
-rwxrwxr-x 1 2000  2000  128000 Oct 20 11:20 Raspberry.IO.Components.dll
-rw-rw-r-- 1 2000  2000     424 Oct 20 11:20 Raspberry.IO.Components.dll.config
-rwxrwxr-x 1 2000  2000    6656 Oct 20 11:20 Raspberry.IO.dll
-rwxrwxr-x 1 2000  2000   51200 Oct 20 11:20 Raspberry.IO.GeneralPurpose.dll
-rwxrwxr-x 1 2000  2000   12800 Oct 20 11:20 Raspberry.IO.InterIntegratedCircuit.dll
-rwxrwxr-x 1 2000  2000   15872 Oct 20 11:20 Raspberry.IO.Interop.dll
-rwxrwxr-x 1 2000  2000   18944 Oct 20 11:20 Raspberry.IO.SerialPeripheralInterface.dll
-rwxrwxr-x 1 2000  2000   12800 Oct 20 11:20 Raspberry.System.dll
-rw-rw-r-- 1 2000  2000    7096 Oct 20 11:20 README.TXT
-rw-rw-r-- 1 2000  2000     428 Oct 20 11:20 release_info.xml
-rw-rw-r-- 1 2000  2000    9948 Oct 20 11:20 scheduler.xml
-rw-rw-r-- 1 2000  2000    9216 Oct 20 11:20 SerialPortLib.dll
-rw-rw-r-- 1 2000  2000  599419 Oct 20 11:20 sqlite3.dll
-rwxr-xr-x 1 root root      943 Oct 20 15:05 startup_debug.sh
-rwxr-xr-x 1 root root      777 Oct 20 15:05 startup.sh
-rw-r--r-- 1 root root     3977 Oct 20 15:07 systemconfig.xml
drwxr-xr-x 2 root root     4096 Oct 20 15:05 tmp
-rw-rw-r-- 1 2000  2000  163840 Oct 20 11:20 Ude.dll
-rw-rw-r-- 1 2000  2000  151040 Oct 20 11:20 UnitsNet.dll
-rw-rw-r-- 1 2000  2000  204288 Oct 20 11:20 UPnP.dll
-rw-rw-r-- 1 2000  2000  226816 Oct 20 11:20 websocket-sharp.dll

/usr/local/bin/homegenie/lib/mig $ ls -la
total 2740
drwxrwxr-x 2 2000 2000    4096 Oct 20 15:05 .
drwxrwxr-x 4 2000 2000    4096 Oct 20 15:05 ..
lrwxrwxrwx 1 root root      42 Oct 20 15:05 libusb-1.0.so -> /lib/arm-linux-gnueabi/libusb-1.0.so.0.1.0
-rw-rw-r-- 1 2000 2000    6144 Oct 20 11:20 LibUsb.Common.dll
-rw-rw-r-- 1 2000 2000  158208 Oct 20 11:20 LibUsbDotNet.LibUsbDotNet.dll
-rw-rw-r-- 1 2000 2000   42496 Oct 20 11:20 MIG.HomeAutomation.dll
-rw-rw-r-- 1 2000 2000   31232 Oct 20 11:20 MIG.Protocols.dll
-rw-rw-r-- 1 2000 2000 2406991 Oct 20 11:20 p1db_custom.xml
-rw-rw-r-- 1 2000 2000   34816 Oct 20 11:20 XTenLib.dll
-rw-rw-r-- 1 2000 2000  103936 Oct 20 11:20 ZWaveLib.dll
genemars commented 5 years ago

So everything is fine with the files. The only thing you can try now is to replace the LibUsbDotNet.dll with the one provided in the old hg release:

LibUsbDotNet.dll (v1.1-stable.527)

Actually I just noticed the name in the new version (that uses a NuGet package) is different and it is LibUsbDotNet.LibUsbDotNet.dll. So just copy the old dll in the same folder (/usr/local/bin/homegenie/lib/mig), restart hg and see what happen.

mralapete commented 5 years ago

OK. I narrowed it down to a firmware issue in the Pi Zero. The release candidate of Raspbian Stretch Lite I was using had a USB bug in the firmware that was changing permissions of the device I was plugging in so it wasn't available to HG. I changed to a revised version of Raspbian Stretch Lite and the CM15 is now available to HG and working.

Looks like I'm experiencing an old problem. HG is not sending email picture attachments with the notifications. If I remember correctly this was down to Helper Class problems