genielabs / HomeGenie

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

CM15A not playing nice #464

Closed Barry-IA closed 1 year ago

Barry-IA commented 1 year ago

Hi Folks!

Requesting help on getting my CM15A to play nice with HomeGenie.

Hardware: RPi 4 (4 GB), 64-bit Bullseye, CM15A HomeGenie v1.4.0-beta.30

(A while back I had a question about v1.3-stable.19 not updating on my RPi 3 running Buster [32-bit]. Still won’t so I’m going with a new system. I did import the scheduler from the original system to the new.)

Issue is the CM15A controller. In ‘Settings’ it is detected as: Device Port “CM15 (USB)” Reload (with a red symbol with a slash through it above) House Codes M, N, O, P (are correct) “Device Manager” is grayed out

barry@raspberrypi:~ $ lsusb | grep -i x10 Bus 001 Device 003: ID 0bc7:0001 X10 Wireless Technology, Inc. ActiveHome (ACPI-compliant)

So seems like the CM15A is being detected just the data isn’t going anywhere. (Graphics switch from On to Off, etc.,)

From /home/homegenie/log/homegenie.log: Error System.Exception: X10 CM15Pro device not connected. (Is ‘Pro’ the same as my CM15A?)

From /home/homegenie/systemconfig.xml:

      </Interface>
      <Interface Domain="HomeAutomation.X10" IsEnabled="true" AssemblyName="MIG.HomeAutomation.dll">
        <Options>
          <Option Name="Port" Value="USB" />
          <Option Name="HouseCodes" Value="M,N,O,P" />
        </Options>
      </Interface>

(Is that .dll file right?? I’m using Linux/Bullseye.)

So what do I need to get this working? Thanks! Barry ``

EnGamma commented 1 year ago

Happy days. Now all you have to do is logically document your efforts and your findings. As I wasn’t testing this version I cannot verify your results. I’m still a little puzzled how anyone else using X10 on HG got this working and how it wasn’t flagged until now. The main thing is your CM15 is doing its job correctly.

@Barry-IA Are you planning on doing what @mralapete suggests in his second sentence? I would really appreciate it.

mralapete commented 1 year ago

Happy days. Now all you have to do is logically document your efforts and your findings. As I wasn’t testing this version I cannot verify your results. I’m still a little puzzled how anyone else using X10 on HG got this working and how it wasn’t flagged until now. The main thing is your CM15 is doing its job correctly.

@Barry-IA Are you planning on doing what @mralapete suggests in his second sentence? I would really appreciate it.

Effectively you need to create a UDEV rule that will allow your CM15 to be correctly mounted and the correct ownerships/permissions assigned to it to allow HG access to the USB port. By default HG no longer runs as root or so the author states.

Typically this is an example of what you need to do to get CM15 functioning correctly in HG. Again depending on how familiar you are with a Linux environment this should be quite straightforward. https://askubuntu.com/questions/1372825/udev-rule-for-similar-devices

I did suggest to Barry to try and install HG on his RPI4 In Ubuntu as I suspect thats where all the testing/development/ installation has been done to date. It certainly wasn’t on RaspiOS otherwise this issue would have arisen by now.

This is an example of a UDEV rule I created a number of years back I to get the CM15 working in Mochad. It will give you a basic outline of what is needed while you wait for Barry to document his findings and/or the author to resolve this

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"

bkenobi commented 1 year ago

In the beginning of March I received a message from Gene indicating an issue I had had with 1.3’s Scheduler may have been corrected in 1.4. I’ll admit to not having tested that yet due to some of the ‘quirks’ I encountered.

I also received a list of issue closures a few days ago suggesting that nearly a dozen issues had been resolved. Since some of those took a lot of effort on my side to develop a workaround/fix, I'm hoping the codebase has included a fix. I'd hate to think that the author was just closing issues to make it seem like they weren't an issue or alternately putting it back on the user to confirm that the issue still remains. Since I don't have the hardware to look at v1.4 I guess I'll leave that to other users to determine if all of the issues closed on the same day were deleted or resolved.

mralapete commented 1 year ago

In the beginning of March I received a message from Gene indicating an issue I had had with 1.3’s Scheduler may have been corrected in 1.4. I’ll admit to not having tested that yet due to some of the ‘quirks’ I encountered.

I also received a list of issue closures a few days ago suggesting that nearly a dozen issues had been resolved. Since some of those took a lot of effort on my side to develop a workaround/fix, I'm hoping the codebase has included a fix. I'd hate to think that the author was just closing issues to make it seem like they weren't an issue or alternately putting it back on the user to confirm that the issue still remains. Since I don't have the hardware to look at v1.4 I guess I'll leave that to other users to determine if all of the issues closed on the same day were deleted or resolved.

Hard to call when an issue is just reported as closed with no further explanation. I do know that RPI3 out of the box with HG 1.3 never worked in conjunction with GPIO and that wonderful work you did on resolving that issue and the subsequent issue you opened has been closed too.

There are now two testers who have reported a similar issue with HG1.4 with CM15 in RaspiOS so I assume that qualifies as a legitimate issue and will be addressed by the author in due course. Maybe as suggested already other users attempted to upgrade to HG1.4, experienced a similar issue and didn’t bother reporting it and just remained on HS1.3 v19. Who knows.

Barry-IA commented 1 year ago

My little thread has really exploded! Welcome to the new folks! As I reminder it just looks like I know this stuff: in reality just good at 'cookbooking' and being tenacious about troubleshooting. May not be pretty but it works!

And now my post: Hi Folks!

Did the draft for a guideline to install HomeGenie and run from Terminal. Started with a freshly imaged SD card. Started following my instructions, noted Gene updated and either added a pleasant surprise or something I did in prior experiments didn’t work right: the automatic importing of the old configuration!

I’m still using the RPi4 just to speed things up. Also reduced the card capacity from 32 GB to 16 GB. At this point I’m only using 4.4 GB (33%). An 8 GB card might work but might be snug: I don’t know if any files are created/copied/etc. (The ZIP/unZIP process can use double the size of the original file.) Logs could take a lot of room….

Hardware: Raspberry Pi (initially installed on RPi 4 for speeding up processes. Transfer to RPi 3.) OS = Bullseye, 64-bit.Configure so can be used headless. µSD = 32 GB; test 16 CM15A (Also said to work with CM15Pro, CM19)

Check the CM15A is detected: lsusb | grep X10

Install HomeGenie: Follow guide at https://homegenie.it/ for the most recent version:

wget https://github.com/genielabs/HomeGenie/releases/download/v1.4.0-beta.36/homegenie_1.4.0-beta.36_linux-arm64.zip

unzip homegenie_1.4.0-beta.36_linux-arm64.zip This will create and extract to $HOME/homegenie.

sudo adduser homegenie sudo groupadd homegenie sudo usermod -a -G homegenie $USER


Note: the above section isn’t fully tested: I had only the usermod line line for compatibility between Terminal and System Service options; found I needed to do the groupadd. That fixed things but when I went back to add the Serial Port/GPIO options the adduser line whined the group was already present. Why adding a user gives a group exists error I don’t know. (Yet!)


Enabling CM15/CM19 USB controller for X10 home automation: sudo apt-get install libusb-1.0-0 libusb-1.0-0-dev sudo nano /etc/udev/rules.d/98-cm15_cm19.rules Insert the lines:

CM15 AND CM19 X10 controllers

ATTRS{idVendor}=="0bc7", ATTRS{idProduct}=="0001", MODE="0660", GROUP="homegenie" ATTRS{idVendor}=="0bc7", ATTRS{idProduct}=="0002", MODE="0660", GROUP="homegenie" save the file and reboot.

Running in a terminal: Set the current directory to homegenie and run the ./HomeGenie command: cd homegenie ./HomeGenie To stop the application press CTRL + C

Initial Configuration: Access using a browser – either on the Pi itself or remotely: http://:/ Where • ‘’ is the IP address of the Pi. (Should have been made static in the configuration for headless operation.) • ‘’ can be 80 or the first available port starting from 8080. (ex. http://192.168.1.150:8080/) Note: The port settings can be changed either from the maintenance page or editing systemconfig.xml file located in the application folder.

Note: Firefox’s Private Browsing Mode fails to connect. Use regular mode.

Follow instructions on screen.

To import previous X10 Schedule:

Click the ‘3 vertical dots’ icon at upper right

Maintenance > Restore


Start comments section...

Installed version 37 Picked up my X10 devices (including P3 which was not programmed in earlier tests) without using the thumbdrive!!

Offline though.

IS connected!! (Tested P2)

Apparently will say ‘OFFLINE” until is manually turned on|off or by the programme.

Seemed to have automatically entered everything except some of the OpenWeatherMap configuration.

End comments section.


Optional post-installation steps Enabling audio playback and voice synthesis:

Audio playback utilities

sudo apt-get install alsa-utils lame

Embedded speech synthesis engine

sudo apt-get install libttspico-utils Granting access to the Serial port and/or GPIO to the homegenie user: sudo gpasswd -a homegenie dialout sudo gpasswd -a homegenie gpio

tuicemen commented 1 year ago

I guess I'm just a lucky user I've never had issue with HG seeing my CM15A . I've installed the 64 bit version as well as the net 472. on the Rasbian lite OS. (Pi 3 & zero 2) With the exception of when I forgot to install the x10 prerequisite. I also didn't use a keyboard or mouse but used ssh from another machine to install HG.

mralapete commented 1 year ago

Did you forget to create your service daemon. No mention of it there or none I can see. You really need one to leave HG running unattended.

EnGamma commented 1 year ago

@Barry-IA @mralapete @genemars

Thanks for the X10 CM15A udev advice. My CM15A is now communicating with HG 1.4 for the first time. FYI, here is the udev rule I'm using:

` cat restore_files/98-cm15a.rules

# X10 CM15A X10 controller ATTRS{idVendor}=="0bc7", ATTRS{idProduct}=="0001", MODE="664", GROUP="plugdev" `

mralapete commented 1 year ago

Just to confirm that these instructions followed exactly as the author has them laid out will in fact install any/all varieties of HG1.4. It’s a 40 minute install from a blank SD card on an RPI3b+ to a working HG1.4 using a CM15 for X10. I freed up a board and sd card just to see for myself.

You could close this issue now, mark it as resolved and reference the author’s installation instructions so as not to confuse any other potential testers.

I won’t be doing any further testing (lack of time and patience these days) with this version but at least I know any other potential testers should find it simple enough to install https://homegenie.it/

mralapete commented 1 year ago

@Barry-IA @mralapete @genemars

Thanks for the X10 CM15A udev advice. My CM15A is now communicating with HG 1.4 for the first time. FYI, here is the udev rule I'm using:

` cat restore_files/98-cm15a.rules

X10 CM15A X10 controller ATTRS{idVendor}=="0bc7", ATTRS{idProduct}=="0001", MODE="664", GROUP="plugdev" `

Yes the UDEV rules were missing from the original instructions I imagine. That has now been addressed and all is working normally.

Barry-IA commented 1 year ago

Did you forget to create your service daemon. No mention of it there or none I can see. You really need one to leave HG running unattended.

Hi mralapete!

Apologies for the delay in responding: lost Internet service Monday around noon and wasn’t restored until Tuesday mid-afternoon. ‘Oddly’ not due to the severe storms in the region (I’m ~200 miles west of Chicago) those those also provided some excitement and delays.

As for using the service daemon, I have not activated yet only because it made testing here easier. Agree HomeGenie needs to run unattended.

I think we have the main issue of the CM15A not being detected resolved. I did find a problem with the imported schedule not running but have not had time to look into it, plus that would be a separate issue.

Barry

Barry-IA commented 1 year ago

Hi Folks! I am going to close this thread as completed and solved -- left it open for a week to allow for any comments and as none seems we're all satisfied.
I did create a new HG from a fresh SD card -- version 37 IIRC. Delayed Step 4 to go to the 'optional' section first. Imported my schedule/configuration from 1.13 and all went properly. Thanks for all the assistance and patience! Barry