X10 Community Forum

💬General Category => Mac/Linux & Open Source and the X10 Home => Raspberry Pi, Arduino & other SBC => Topic started by: Tuicemen on August 27, 2018, 07:14:42 AM

Title: The Pi Alexa X10 Hub
Post by: Tuicemen on August 27, 2018, 07:14:42 AM
While playing with different PI options for x10 software I notice almost all used heyU ore Mochad to supply the required drivers depending on the X10 interface used.
I could do a step by step on how to create one for the x10 community but there seems to be little interest in this type of build your own. However I will say you'll need a PI and a cm15 or cm19 for this your pi should be installed with Debian lite though it does work with the full GUI installed
Basically all that is then required is ha-bridge and mochad both are open source. and details for installing are on this forum.

Since I had a SD card I was using for trying different X10 software for the PI I decided to try creating a script to put everything together in one downloadable installer. This was done more as an experiment and for myself but I realized their may be some here interested in a simple downloadable installer.
If this is the case I'll spend a bit more time on this and add x10 codes for one house code1-16 to the configuration file, then users only need to rename the devices.

Title: Re: The Pi Alexa X10 Hub
Post by: brobin on August 27, 2018, 03:39:11 PM
Sounds great!  :)% Thank you. I currently use Housecode N for my Alexa triggers if that's an option but A for Alexa would be fine too.
Title: Re: The Pi Alexa X10 Hub
Post by: Tuicemen on August 27, 2018, 04:22:52 PM
As this was intended more for my personal use I've added House code "L" On/Off  & AllLightsOn/Off but it is easy for end users to change the house codes when they rename the devices.

I've not added dimming as I have no way to test that here.
However with a little reading of the Ha-bridge help file and the mochad read me users should be able to figure it out and post what works best for them.

I have a working script but I'm still working out the downloadable self extracting part B:( ::) :'
I was sure I had made the script executable B:(
Title: Re: The Pi Alexa X10 Hub
Post by: Tuicemen on August 27, 2018, 06:03:40 PM
Well discovered part of the issue was a read permission on my server B:(
However the auto installer link stops half way through, even thought the script runs fine from the PI :o ???
Maybe my internet connection  as it is a rainy day here my connection may be cutting out causing this . ::) :'
Title: Re: The Pi Alexa X10 Hub
Post by: HA Dave on August 27, 2018, 07:23:39 PM
….. I have a working script but I'm still working out the downloadable self extracting part B:( ::) :'
I was sure I had made the script executable B:(


I know this can't be easy! Take your time. I'll be ready to try it when you're ready to release it.
Title: Re: The Pi Alexa X10 Hub
Post by: brobin on August 27, 2018, 09:37:19 PM
Guess it's finally time for me to order a piece of pi!  Is the Zero W the right flavor?  Other than a power supply do I need anything else?
Title: Re: The Pi Alexa X10 Hub
Post by: Tuicemen on August 28, 2018, 07:29:22 AM
A PI Zero W will work the plain zero will not as it doesn't have WiFi.
The Zerro W is what I used in my CM15 mod http://forums.x10.com/index.php?topic=30322.0
If this is your first PI you may wish to get the Min SD already loaded with Debian. but a blank min SD card will work. You'll just need to load Debian from your PC to the card.
 >!
Title: Re: The Pi Alexa X10 Hub
Post by: Tuicemen on August 28, 2018, 10:18:25 AM
Seems mochad conflicts with HG B:(
I think this is because HG is accessing the libusb with its own driver ::) :'
Users that are thinking about this should keep that in mind. This will be intended to be installed on a new Debian install.
I'm also having issues with Alexa discovering devices B:( this has always been a on again off again issue for me at the off grid place.
So I need to look into that a bit more. B:(
If you haven't voted on this yet please do, It will affect whether I continue on with this.


 >!
Title: Re: The Pi Alexa X10 Hub
Post by: Tuicemen on August 28, 2018, 07:36:23 PM
couple of issues I've ran into
1: sometimes  the send commands work with the
Code: [Select]
./x10cmd... sometimes it needs to be changed to
Code: [Select]
sh x10cmd... B:(  this one has me stumped.

2:If you wished to run your pi on Raspbian lite the installer will worked but ha-bridge fails to run. I then realized the lite version doesn't include java. B:( you'll need to run
Code: [Select]
sudo apt-get update && sudo apt-get install oracle-java8-jdk prior to running the installer. :(

3: some times the x10cmd file needs to be made executable  with
Code: [Select]
sudo chmod -x ha-bridge/x10cmd and a reboot is always needed to take affect. maybe that's why the chmod in the installer is failing. ::) :'
4: the Alexa discovery issue appears to have been a weather event :o

I'll continue to plug along with this chmod thing.
 >!

Title: Re: The Pi Alexa X10 Hub
Post by: Tuicemen on August 29, 2018, 08:39:43 AM
Looks like the script is making the x10cmd file executable the Pi just needs to be rebooted in order for it to take affect :)%
As for the command to issue a x10 call I've changed that to sh x10cmd..... as  this seems to work more often then ./x10cmd....

I suspected any home automation program that uses mochad (and many do) will work with this.
I decided to test this theory and installed Domoticz (https://domoticz.com/) as I had yet to test that software.
Although it did install and did not affect x10 sends from the bridge or Domoticz, it was not without problems.
The Domoticz web server lost connection while I was setting up the pi mother board sensors.
I'm not sure if this is a issue with the sensor module in Domoticz or the three programs running at the same time was to much for the PI.
I'll play with this a bit more over the next few days.
I believe the installer is ready for testing as it has worked on my pi (different SD cards) with a full or lite Debian stretch installed.

If you wish to test this PM me and I'll respond with the link ;)
 >!
Title: Re: The Pi Alexa X10 Hub
Post by: brobin on August 29, 2018, 12:57:31 PM

If this is your first PI you may wish to get the Min SD already loaded with Debian. but a blank min SD card will work.
 >!

I've found cards with Noobs and Raspbian but not Debian. I can d/l and copy to a card but I'm not sure which flavor of Debian to d/l. Sorry to be so dense but this will be my first SBC and I'm not up to speed.
Title: Re: The Pi Alexa X10 Hub
Post by: petera on August 29, 2018, 01:24:50 PM

If this is your first PI you may wish to get the Min SD already loaded with Debian. but a blank min SD card will work.
 >!

I've found cards with Noobs and Raspbian but not Debian. I can d/l and copy to a card but I'm not sure which flavor of Debian to d/l. Sorry to be so dense but this will be my first SBC and I'm not up to speed.

Tuicemen refers to Debian on a number of occasions. It should read Raspbian in the case of the Pi.
Title: Re: The Pi Alexa X10 Hub
Post by: petera on August 29, 2018, 01:44:24 PM
Looks like the script is making the x10cmd file executable the Pi just needs to be rebooted in order for it to take affect :)%
As for the command to issue a x10 call I've changed that to sh x10cmd..... as  this seems to work more often then ./x10cmd....

I suspected any home automation program that uses mochad (and many do) will work with this.
I decided to test this theory and installed Domoticz (https://domoticz.com/) as I had yet to test that software.
Although it did install and did not affect x10 sends from the bridge or Domoticz, it was not without problems.
The Domoticz web server lost connection while I was setting up the pi mother board sensors.
I'm not sure if this is a issue with the sensor module in Domoticz or the three programs running at the same time was to much for the PI.
I'll play with this a bit more over the next few days.
I believe the installer is ready for testing as it has worked on my pi (different SD cards) with a full or lite Debian stretch installed.

If you wish to test this PM me and I'll respond with the link ;)
 >!

As you probably already know, X10 in Homegenie runs without the need to install Mochad or Heyu using the Xtenlib which Gene utilised to run his project on the .Net Framework and later on Linux via Mono. He's done a lot of work on the subject. Check out his work in the area on the GitHub X10 Home Automation Library for .NET

Bearing this in mind I'd imagine you would get conflicts making calls to an external instance of Mochad as a separate service running as a daemon. I certainly couldn't confirm this but it would make sense.

David Wallis over at the Homegenie Club states that he has internalised the Homegenie/Alexa bridge within Homegenie. You may want to PM him or post on the forum to confirm this. It may save you a little time with this project.
Title: Re: The Pi Alexa X10 Hub
Post by: Tuicemen on August 29, 2018, 01:53:31 PM

I've found cards with Noobs and Raspbian but not Debian. I can d/l and copy to a card but I'm not sure which flavor of Debian to d/l. Sorry to be so dense but this will be my first SBC and I'm not up to speed.

Tuicemen refers to Debian on a number of occasions. It should read Raspbian in the case of the Pi.
Yes you'll not find Debian with noobs  Raspbian is what you want  thanks for the clarification petera
Title: Re: The Pi Alexa X10 Hub
Post by: Tuicemen on August 29, 2018, 02:28:38 PM

Bearing this in mind I'd imagine you would get conflicts making calls to an external instance of Mochad as a separate service running as a daemon. I certainly couldn't confirm this but it would make sense.

David Wallis over at the Homegenie Club states that he has internalised the Homegenie/Alexa bridge within Homegenie. You may want to PM him or post on the forum to confirm this. It may save you a little time with this project.
Originally this was to be a single use PI project not to have another automation software installed along side it on the same PI.
The Pi was original designed and created for just that, a single project development board. I full well expected conflicts with a software not using Mochad.
I like to push my PI 3b+ as it is a bit more powerful then the other older ones available. I highly double my zero would run this and a Home automation software that used mochad with out over heating but I'll definably test this over the winter.
Ha-Bridge runs fine with HG, and in reality if you use HG, ha-bridge can make calls to it, you don't need this project or Mochad.

From what I read on David Walls HG Alexa bridge the internalizing was more to auto pull HG devices into the Bridge. Something that can't be done with HA-Bridge for HG, but could be if BWS Systems created a helper for it which he's done for HA, OpenHab, Domoticz, and other softwares.
That being said I continued to play with this and Domoticz but this time on a Raspian stretch full install (with GUI) so I can monitor the CPU usage as I add things to Domoticz.
Originally I wasn't keen on the feel of Domoticz but it is growing on me! I may just keep it on a SD card with this project to do a good comparison against HG. But that's another thread.


 
Title: Re: The Pi Alexa X10 Hub
Post by: petera on August 29, 2018, 02:47:39 PM

Bearing this in mind I'd imagine you would get conflicts making calls to an external instance of Mochad as a separate service running as a daemon. I certainly couldn't confirm this but it would make sense.

David Wallis over at the Homegenie Club states that he has internalised the Homegenie/Alexa bridge within Homegenie. You may want to PM him or post on the forum to confirm this. It may save you a little time with this project.
Originally this was to be a single use PI project not to have another automation software installed along side it on the same PI.
The Pi was original designed and created for just that, a single project development board. I full well expected conflicts with a software not using Mochad.
I like to push my PI 3b+ as it is a bit more powerful then the other older ones available. I highly double my zero would run this and a Home automation software that used mochad with out over heating but I'll definably test this over the winter.
Ha-Bridge runs fine with HG, and in reality if you use HG, ha-bridge can make calls to it, you don't need this project or Mochad.

From what I read on David Walls HG Alexa bridge the internalizing was more to auto pull HG devices into the Bridge. Something that can't be done with HA-Bridge for HG, but could be if BWS Systems created a helper for it which he's done for HA, OpenHab, Domoticz, and other softwares.
That being said I continued to play with this and Domoticz but this time on a Raspian stretch full install (with GUI) so I can monitor the CPU usage as I add things to Domoticz.
Originally I wasn't keen on the feel of Domoticz but it is growing on me! I may just keep it on a SD card with this project to do a good comparison against HG. But that's another thread.

Yes Domoticz is another one worth trying. I have a copy aon an SD card which I spun up to test its ability with X10. Another one I found quick to configure X10 on.

I think it's safe to say now that X10 works on a Raspberry Pi. As to where a potential user can take it beyond that is entirely up to them.

It will be nice to see member's progress with X10 and its integration with home automation in general on the Raspberry Pi in the coming months whichever flavour they choose. One thing is for certain, the Raspberry Pi is a serious contender for X10's attention.
Title: Re: The Pi Alexa X10 Hub
Post by: Tuicemen on August 29, 2018, 02:57:21 PM

I think it's safe to say now that X10 works on a Raspberry Pi. As to where a potential user can take it beyond that is entirely up to them.
I don't think will X10work on a PI really was ever in doubt. the doubt was how easy it is to actually setup.
The more projects which include X10 that are posted and shared about just may get others to at least attempt using a PI for X10

Quote

It will be nice to see member's progress with X10 and its integration with home automation in general on the Raspberry Pi in the coming months whichever flavour they choose. One thing is for certain, the Raspberry Pi is a serious contender for X10's attention.
I agree and this forum has some of the more imaginative members that are more then willing to share their stories.
Title: Re: The Pi Alexa X10 Hub
Post by: brobin on August 29, 2018, 03:03:13 PM

I've found cards with Noobs and Raspbian but not Debian. I can d/l and copy to a card but I'm not sure which flavor of Debian to d/l. Sorry to be so dense but this will be my first SBC and I'm not up to speed.

Tuicemen refers to Debian on a number of occasions. It should read Raspbian in the case of the Pi.
Yes you'll not find Debian with noobs  Raspbian is what you want  thanks for the clarification petera

Thank you both. I thought that might be the case.
Title: Re: The Pi Alexa X10 Hub
Post by: petera on August 29, 2018, 03:30:28 PM

I think it's safe to say now that X10 works on a Raspberry Pi. As to where a potential user can take it beyond that is entirely up to them.
I don't think will X10work on a PI really was ever in doubt. the doubt was how easy it is to actually setup.
The more projects which include X10 that are posted and shared about just may get others to at least attempt using a PI for X10

Quote

It will be nice to see member's progress with X10 and its integration with home automation in general on the Raspberry Pi in the coming months whichever flavour they choose. One thing is for certain, the Raspberry Pi is a serious contender for X10's attention.
I agree and this forum has some of the more imaginative members that are more then willing to share their stories.

I have learnt over the last couple of months that new concepts introduced into old systems to rescue them can meet with resistance, however when survival of the species depends on these new concepts people usually embrace the changes when they understand the bigger picture.

What I will say is my old PCs have come and gone yet my old lamp modules, appliance modules and my X10 controllers are still doing the job they were built to do. They don't care who or what is feeding them as long as they are being fed.
Title: Re: The Pi Alexa X10 Hub
Post by: Tuicemen on August 29, 2018, 03:35:48 PM
What I will say is my old PCs have come and gone yet my old lamp modules, appliance modules and my X10 controllers are still doing the job they were built to do. They don't care who or what is feeding them as long as they are being fed.
rofl Yes, I've gone through a number of PCs since starting with X10 as well, and some of my original modules are still in use today though maybe in a different location.
Title: Re: The Pi Alexa X10 Hub
Post by: petera on August 29, 2018, 04:12:22 PM
What I will say is my old PCs have come and gone yet my old lamp modules, appliance modules and my X10 controllers are still doing the job they were built to do. They don't care who or what is feeding them as long as they are being fed.
rofl Yes, I've gone through a number of PCs since starting with X10 as well, and some of my original modules are still in use today though maybe in a different location.

Still buying job lots of X10 equipment on eBay auctions. Great source for backup and spares at a fraction of the RSP. In tests over 90% of it is in good working order. Unfortunately my old PC equipment didn't fare as well. I just use plug in heaters when the room gets cold now  :)
Title: Re: The Pi Alexa X10 Hub
Post by: brobin on August 29, 2018, 06:33:04 PM
Found a nice starter kit on Amazon for $27 delivered: Vilros Basic Starter Kit - includes Pi Zero W, Power Supply, Clear Case, header, heat sink, OTG & HDMI adapters and other stuff.  I've flashed a Raspbian image on a 16G card so I'll be ready to go once the mailman shows up on Friday.
Title: Re: The Pi Alexa X10 Hub
Post by: petera on August 29, 2018, 07:25:16 PM
Found a nice starter kit on Amazon for $27 delivered: Vilros Basic Starter Kit - includes Pi Zero W, Power Supply, Clear Case, header, heat sink, OTG & HDMI adapters and other stuff.  I've flashed a Raspbian image on a 16G card so I'll be ready to go once the mailman shows up on Friday.

That sounds about right. Does the Pi Zero you ordered have the pre soldered headers.

If you follow the config instructions for installing Raspbian on the Raspberry Pi W you should be up and running quickly. No need to mess around with Ethernet either. It can all be done after you image your card and before you remove it from your SD card reader.

For Windows users a useful utility called WinSCP allows you to manage the files on your SD card while it's still mounted in Windows. Many have mentioned not seeing the file system whike mounted in Windows. Remember its the Boot and not the Root folder you drop your config files into. It's all drag and drop so it's easy to use and it's free to download.

Other tools which are useful in the Windows environment for SD card management are SD Formatter for reformatting at a low level your SD card to its original size and Win32 Disk Image. Others are using Etcher which is a catch all solution but it's entirely up to you what you feel most comfortable using.
Title: Re: The Pi Alexa X10 Hub
Post by: brobin on August 29, 2018, 09:03:48 PM
Thanks for the tip on Win SCP, I'll check it out.  I used Etcher to flash the download to a new 16G card I had. 3 clicks and done. Took just 15 min to flash and verify - didn't even need to unzip the d/l.  The header supplied in the starter kit is not soldered which is fine as I'm more comfortable with a soldering iron than with programming.  Will I need the header for this project?  Or should I just put it in anyway before it gets lost.
Title: Re: The Pi Alexa X10 Hub
Post by: petera on August 30, 2018, 06:21:53 AM
Thanks for the tip on Win SCP, I'll check it out.  I used Etcher to flash the download to a new 16G card I had. 3 clicks and done. Took just 15 min to flash and verify - didn't even need to unzip the d/l.  The header supplied in the starter kit is not soldered which is fine as I'm more comfortable with a soldering iron than with programming.  Will I need the header for this project?  Or should I just put it in anyway before it gets lost.

No unless you want to play around with GPIO sensors in Homegenie there's no need for it for the initial install of Raspbian and whatever home automation software you intend to install.
Title: Re: The Pi Alexa X10 Hub
Post by: dhouston on August 30, 2018, 07:16:50 AM
The header supplied in the starter kit is not soldered which is fine as I'm more comfortable with a soldering iron than with programming.  Will I need the header for this project?  Or should I just put it in anyway before it gets lost.
I suggest installing it so you can later install an RTC.
Title: Re: The Pi Alexa X10 Hub
Post by: Tuicemen on August 30, 2018, 07:35:52 AM
The header is not needed for this project.
If you plan on using your PI for another purpose you may require it. The RTC is also not needed for this as Alexa handles timers  and the PI gets its time from the internet as soon as it connects.
Without the internet there is no connection to Alexa.
Title: Re: The Pi Alexa X10 Hub
Post by: brobin on August 30, 2018, 12:39:07 PM
Thanks all for the info about the header. I think I'll wait till there's a need as I found that there are at least two types of headers so if and when needed I can install based on the specific device.  Based on the teachings of Moore, whichever I put in now will certainly be the opposite of what I'll want in the future  B:(.
Title: Re: The Pi Alexa X10 Hub
Post by: petera on August 30, 2018, 01:32:27 PM
Thanks all for the info about the header. I think I'll wait till there's a need as I found that there are at least two types of headers so if and when needed I can install based on the specific device.  Based on the teachings of Moore, whichever I put in now will certainly be the opposite of what I'll want in the future  B:(.

Yes when buying the Raspberry Pi Zero, the three models available are the Raspberry Pi Zero (no wireless), Raspberry Pi Zero W (wireless, bluetooth but no GPIO headers, supplied separately and need to be soldered to the board) and Raspberry Pi Zero WH (wireless, Bluetooth with headers already attached to the board).

For convenience the WH model is the best option to purchase. Soldering is not to everyone's liking and there's also the risk of damaging the board if it is soldered incorrectly.
Title: Re: The Pi Alexa X10 Hub
Post by: brobin on August 31, 2018, 12:27:47 AM
The choice between male and female headers, depending on what and how to connect another device, is what I'm holding off for. Adafruit also offers M & F headers than can be HAMMERED in (WTF!? :o) for those who are solder averse. That can't be good on several levels!
Having been a kit builder and tinkerer since 1962, soldering has become second nature. For things like headers, wetting the pads with a little flux can help ensure that there's good flow with no bridges or blobs (maybe that's what's in the stuff my urologist gave me :D). 
Title: Re: The Pi Alexa X10 Hub
Post by: Tuicemen on September 09, 2018, 08:20:24 AM
As I stated before, HA-Bridge unfortunately doesn't work with Google Home due to how Google has chosen to work with Hue hubs, it no longer works with software bridges directly.
However it is possible to get Google assistant working with a Pi in a number of different ways.
I had created a small server app for windows which allowed Google control using the SmartThings app and figured this could be done with a PI as well. With some digging I discovered this has already been done with Mochad  and over  4 years ago.
I'll play with this when I get some free time. ::) :'

Of course you can always do the PI project to turn your Pi into a Google Mini.
I also understand there is a project to turn the PI into an Alexa Device
Both of these projects can be found on Github for those interested.
Title: Re: The Pi Alexa X10 Hub
Post by: petera on September 09, 2018, 09:17:54 AM
As I stated before, HA-Bridge unfortunately doesn't work with Google Home due to how Google has chosen to work with Hue hubs, it no longer works with software bridges directly.
However it is possible to get Google assistant working with a Pi in a number of different ways.
I had created a small server app for windows which allowed Google control using the SmartThings app and figured this could be done with a PI as well. With some digging I discovered this has already been done with Mochad  and over  4 years ago.
I'll play with this when I get some free time. ::) :'

Of course you can always do the PI project to turn your Pi into a Google Mini.
I also understand there is a project to turn the PI into an Alexa Device
Both of these projects can be found on Github for those interested.

Yes both Mochad and Heyu are well worth investigating. Quite a few successful projects built around them with X10 in mind. In fact Heyu is working nicely for me under Home Assistant.
Title: Re: The Pi Alexa X10 Hub
Post by: Tuicemen on September 14, 2018, 09:24:50 AM
Since there have been no volunteers to test this I can't expand on this.
The poll also shows there is little to no interest in this so I'll shelf this project.
 >!
Title: Re: The Pi Alexa X10 Hub
Post by: petera on September 14, 2018, 11:23:16 AM
Since there have been no volunteers to test this I can't expand on this.
The poll also shows there is little to no interest in this so I'll shelf this project.
 >!

There's a sense of suspicion about all things Raspberry Pi. Probably heightened by the fact that the platform you run on it depends on a flavour of Linux, Raspbian, as it's OS.

Age seems to be another underlying issue mentioned as to why certain people don't feel they can embrace it and jump up and down at the mere mention of it. For the life of me I cannot understand why.

There are others who have successfully deployed the Raspberry Pi in the home automation and maybe feel slightly intimidated sharing their experiences here or are sharing them elsewhere in the relevant forum.

Personally speaking I've settled on Home Assistant on the Raspberry Pi more than manages
X10 and many other elements of home automation.

For the Windows diehards there is a version of Home Assistant that will run in Windows.

I'm not a Google Home user. I do play about with Alexa from time to time but I don't really have a need for it. Ironically one of the grand children were blasting music in the living room recently while trying to scream at Alexa to turn on the light. I heard the racket walked into the room and pressed the light switch. Enough said about Alexa  :)%
Title: Re: The Pi Alexa X10 Hub
Post by: brobin on September 14, 2018, 11:45:30 AM
Since there have been no volunteers to test this I can't expand on this.
The poll also shows there is little to no interest in this so I'll shelf this project.
 >!

I didn't realize you were looking for a volunteer.  I've got my PiZW ready to go.
Title: Re: The Pi Alexa X10 Hub
Post by: Tuicemen on September 17, 2018, 05:44:27 PM
@brobin
I believe the installer is ready for testing as it has worked on my pi (different SD cards) with a full or lite Debian stretch installed.

If you wish to test this PM me and I'll respond with the link ;)
 >!
Private message me if you wish to test and I'll dig up the link to the script installer.
 >!
Title: Re: The Pi Alexa X10 Hub
Post by: dave w on September 17, 2018, 05:49:24 PM
Ironically one of the grand children were blasting music in the living room recently while trying to scream at Alexa to turn on the light. I heard the racket walked into the room and pressed the light switch. Enough said about Alexa.
rofl
Title: Re: The Pi Alexa X10 Hub
Post by: Tuicemen on September 20, 2018, 05:13:57 PM
Although I did shelve the project I decided to post the installer and a small write up on my forum.
http://forums.tuicemen.net/index.php?topic=1310.0

 >!
Title: Re: The Pi Alexa X10 Hub
Post by: brobin on September 20, 2018, 05:50:58 PM
Thanks Tuice!  :)% I'll check it out.  >!
Title: Re: The Pi Alexa X10 Hub
Post by: brobin on September 23, 2018, 01:35:27 AM
Installed the Pi Alexa X10 Hub this evening and it works perfectly.  If all one needs is an X10-Alexa Bridge to use with an already established system like Stargate, Ocelot or AHP, this is the answer.  Once I got the Pi up and running (incredibly simple) all I had to do was type the one line that Tuice provided.  When the installation finished I typed the Pi's IP address into my laptop's browser and HA Bridge popped right up.   :)%  Alexa discovered the new devices and the commands worked first time.

Thank you Tuicemen for taking the time to do this.  I also appreciate the editing instructions you posted on your site.  #:) >!

Title: Re: The Pi Alexa X10 Hub
Post by: Tuicemen on September 23, 2018, 07:19:19 AM
Glad you had no issues with the install or setup I tried to make it as simple as possible.
Others may be interested in which Pi model your running not that it should make a difference.
 >!
Title: Re: The Pi Alexa X10 Hub
Post by: brobin on October 05, 2018, 12:45:37 PM
My PiZW Alexa hub is working great (Thanks Tuice  >! ) except for the requirement for frequent reboots. When Alexa can't find the device I see that the Pi has gone offline and needs a reboot. I don't know enough (yet) about Pi's to know where to look for the problem and any ideas would be appreciated.  It's a Pi Zero W located within 25' of the router showing excellent signal running Raspbian Stretch (w/GUI) on a 32GB Class 10 card. Power supply is 5.1V 3A. The only things plugged into it are the power supply and the CM-19A through a 4 port unpowered OTG hub. TIA for any thoughts.
Title: Re: The Pi Alexa X10 Hub
Post by: brobin on October 05, 2018, 02:24:49 PM
More info and maybe - hopefully - a fix.  In hunting around online I came across this post: https://tech.scargill.net/pi-zero-wi-fi-automatic-reconnect/

Basically, he says that Pi Zero's are defaulted to NOT reconnecting to WiFi after signal loss. So if the router reboots, bye bye miss american pi!  B:(
I don't see the logic in setting the default that way on a device that is WiFi only but nobody asked me.  :' In any case, the post provides some text to add to /etc/network/interfaces that presumably solves the problem by changing the default.  After learning how to add permissions to change the file I have it done and will be doing some testing this evening.

Title: Re: The Pi Alexa X10 Hub
Post by: Tuicemen on October 05, 2018, 02:30:52 PM
There have been reports of the zerro not working well with powered hubs infact several teport toasting ther ZeroW.
I'd remove the powered hub it may be causing the zero to over heat and shutting down. You don't need any thing else USB plugged into it if you set up ssh.you can remote into the terminal for any installs and such. Or set up VNC and remote desktop into it. I've not had a issue with my zerro losing wifi but all that is plugged in is the CM15 and power cord.
Title: Re: The Pi Alexa X10 Hub
Post by: petera on October 05, 2018, 02:35:59 PM
There have been reports of the zerro not working well with powered hubs infact several teport toasting ther ZeroW.
I'd remove the powered hub it may be causing the zero to over heat and shutting down. You don't need any thing else USB plugged into it if you set up ssh.you can remote into the terminal for any installs and such. Or set up VNC and remote desktop into it. I've not had a issue with my zerro losing wifi but all that is plugged in is the CM15 and power cord.

Definitely wouldn't use a powered hub on a Pi Zero. Causes mayhem with settings and you really have to know how to set up and configure USB manually if anything goes wrong.
Title: Re: The Pi Alexa X10 Hub
Post by: brobin on October 05, 2018, 03:31:34 PM
As I mentioned I'm using an UNpowered hub so that's not an issue.
Title: Re: The Pi Alexa X10 Hub
Post by: Tuicemen on October 05, 2018, 04:07:15 PM
Sorry I missed read your post.  :-[ Still I"d just go to an USB mini to regular adapter over the Hub.  The other thing you could look at setting up is a Crontab event to regularly reboot the PI. Another thing would be to set your router so the same IP is always asigned to the PI Mac address. Some routers call this port forwarding but thats not the same other refer to it as Ip reserve which is more accurate. My router has both.
Title: Re: The Pi Alexa X10 Hub
Post by: brobin on October 05, 2018, 05:11:05 PM
I have "address reservation" set for the Pi so whenever the router sees a DHCP request from the Pi's MAC it will assign the same IP.  I'm going to see how the change to the Interfaces file works when I test it tonight & if there's still an issue I'll look at the chrontab option. I saw one script where it will run a ping test every 5 min and if there's no response it'll reboot.  Typically I wouldn't have the hub in place but for now it's there so I can plug in a kb & mouse while I'm still working with it. There's also a $10 item on Amazon that's a combo USB hub & Ethernet port to eliminate WiFi altogether which I don't mind since it 'lives' in my server closet.
Title: Re: The Pi Alexa X10 Hub
Post by: Tuicemen on October 05, 2018, 05:19:43 PM
You might wish to look into enabling SSH then you can set things up from your PC using  Putty(SSH) to log into your pi terminal. If you realy need to see the pi destop(GUI) you can enable VNC. And log in fro your PC.
Title: Re: The Pi Alexa X10 Hub
Post by: petera on October 05, 2018, 06:07:17 PM
My PiZW Alexa hub is working great (Thanks Tuice  >! ) except for the requirement for frequent reboots. When Alexa can't find the device I see that the Pi has gone offline and needs a reboot. I don't know enough (yet) about Pi's to know where to look for the problem and any ideas would be appreciated.  It's a Pi Zero W located within 25' of the router showing excellent signal running Raspbian Stretch (w/GUI) on a 32GB Class 10 card. Power supply is 5.1V 3A. The only things plugged into it are the power supply and the CM-19A through a 4 port unpowered OTG hub. TIA for any thoughts.

With your Pi Zero powered up and the hub plugged in type lsusb and paste the results?

Also type dmesg and paste those results too.
Title: Re: The Pi Alexa X10 Hub
Post by: brobin on October 05, 2018, 10:31:27 PM
My PiZW Alexa hub is working great (Thanks Tuice  >! ) except for the requirement for frequent reboots. When Alexa can't find the device I see that the Pi has gone offline and needs a reboot. I don't know enough (yet) about Pi's to know where to look for the problem and any ideas would be appreciated.  It's a Pi Zero W located within 25' of the router showing excellent signal running Raspbian Stretch (w/GUI) on a 32GB Class 10 card. Power supply is 5.1V 3A. The only things plugged into it are the power supply and the CM-19A through a 4 port unpowered OTG hub. TIA for any thoughts.

With your Pi Zero powered up and the hub plugged in type lsusb and paste the results?

Also type dmesg and paste those results too.
It's a lengthy file so I've attached it rather than paste. Thanks for looking at it.  The Pi is staying connected to WiFi so far but, oddly, lights weren't responding. Both Alexa and in HA-bridge it showed commands being executed and the CM-19A LED would flicker but no X10 signal was received. Rebooting the Pi solved it but I don't know what 'it' is. B:(
Title: Re: The Pi Alexa X10 Hub
Post by: petera on October 06, 2018, 07:38:35 AM
You say the only thing you have plugged into the USB port is the X10 controller. Lsusb doesn't lie. rofl. You have a keyboard, a trackball device and the x10 controller and of course the usb hub as can be seen from here

Bus 001 Device 003: ID 0bc7:0002 X10 Wireless Technology, Inc. Firecracker
Interface (ACPI-compliant)
Bus 001 Device 005: ID 413c:2003 Dell Computer Corp. Keyboard
Bus 001 Device 004: ID 047d:2048 Kensington Orbit Trackball with Scroll Ring
Bus 001 Device 002: ID 1a40:0101 Terminus Technology Inc. Hub

My advice from looking at your USB hub is, get another. There's a lot of cheapo Chinese USB hubs doing the rounds. They are completely hit and miss. Something like this https://www.amazon.co.uk/AmazonBasics-4-Port-Ultra-Mini-Bus-powered/dp/B003M0NURK or https://www.zdnet.com/article/hands-on-raspberry-pi-zero-3-port-usb-hub-with-ethernet/

I do suggest that you have a good search before buying Pi accessories as these boards are quite sensitive to voltage fluctuations. A pull down in voltage for any reason can easily send the board into a reboot loop
Title: Re: The Pi Alexa X10 Hub
Post by: Tuicemen on October 06, 2018, 07:47:42 AM
The Pi is staying connected to WiFi so far but, oddly, lights weren't responding. Both Alexa and in HA-bridge it showed commands being executed and the CM-19A LED would flicker but no X10 signal was received. Rebooting the Pi solved it but I don't know what 'it' is. B:(
this to me indicates something else like line noise or a power sucker.
Did the wall wart your using with your Pi come with the PI?
Where is and what are you using as an x10 transceiver?
My suspicion is the wall wart is getting hot an starts to emit noise onto the powerline.
If you have another 5volt 2 amp power supply try it.
Title: Re: The Pi Alexa X10 Hub
Post by: petera on October 06, 2018, 08:38:53 AM
The Pi is staying connected to WiFi so far but, oddly, lights weren't responding. Both Alexa and in HA-bridge it showed commands being executed and the CM-19A LED would flicker but no X10 signal was received. Rebooting the Pi solved it but I don't know what 'it' is. B:(
this to me indicates something else like line noise or a power sucker.
Did the wall wart your using with your Pi come with the PI?
Where is and what are you using as an x10 transceiver?
My suspicion is the wall wart is getting hot an starts to emit noise onto the powerline.
If you have another 5volt 2 amp power supply try it.

He already stated he was using a CM19A which is confirmed by the lsusb command.

I doubt his power supply is the issue as he has a 3ah overhead from a 5.1 volt output. He would have to test his setup under load and without load to confirm this.

Using a USB hub on the Raspberry Pi comes with its own peculiarities. That's why UDEV rules were introduced to typically bind a particular device to a particular port.

If hot plugging is working ok that would not be an issue. In the case of a hub the kernel is not seeing the device that is being hot plugged as the same device so it keeps assigning it a different COM port

This is all clearly explained here https://www.sparkfun.com/news/2332

With your system powered up and all USB devices connected unplug your CM19a and plug it back in again. Now type dmesg again and paste the output. I will be able to see what port the kernel is binding the CM19a to after a hot swap.
Title: Re: The Pi Alexa X10 Hub
Post by: Tuicemen on October 06, 2018, 09:23:03 AM
The CM19 LED is blinking when a X10 command is sent from the ZeroW. This usually indicates the X10 command is being sent. This seems like (to me) the issue is not with the Zero. brobin's issue is nothing turns on/off which indicates the signal isn't getting from the CM19 to the transceiver or from the transceiver to the device.
 Since the CM19 does draw power via USB (the CM15 doesn't) it is possible it doesn't get sufficiant power to send the RF due to the Zerro over heating and only gets enough power to blink the LED though that seems unlikely.

A simple unplug and repowering the Zero shouldn't remedy the issue mediately  :o
A 3 amp wall wart indicates this is not made for PIs as 2 amps is recommended. Unless the specs have changed since I got mine. ::) :'

If brobin was using the other ports then unplugged the devices or swapped them and this cause the X10 commands to stop working then the CM19 should not blink as the Zero would be confused as to where to send the signal.
Title: Re: The Pi Alexa X10 Hub
Post by: petera on October 06, 2018, 09:56:45 AM
The CM19 LED is blinking when a X10 command is sent from the ZeroW. This usually indicates the X10 command is being sent. This seems like (to me) the issue is not with the Zero. brobin's issue is nothing turns on/off which indicates the signal isn't getting from the CM19 to the transceiver or from the transceiver to the device.
 Since the CM19 does draw power via USB (the CM15 doesn't) it is possible it doesn't get sufficiant power to send the RF due to the Zerro over heating and only gets enough power to blink the LED though that seems unlikely.

A simple unplug and repowering the Zero shouldn't remedy the issue mediately  :o
A 3 amp wall wart indicates this is not made for PIs as 2 amps is recommended. Unless the specs have changed since I got mine. ::) :'

If brobin was using the other ports then unplugged the devices or swapped them and this cause the X10 commands to stop working then the CM19 should not blink as the Zero would be confused as to where to send the signal.

The reason I asked him to hot plug the CM19 is I don't see from the results of dmesg what COM port his CM19 is assigned to.I can find this quickly from the results of a hot swap. I'm looking for something like dev ttyUSB0 so I know what USB port the CM19a has been assigned to.

He can have as many amps over on the power supply but not under. Voltage is the important indicator. Under voltage and the Zero will power off, and over equals toast.

There's at least four issues here that could be causing the problem. One standing out at the moment is the OTG Controller driver being loaded by the kernel. It's loading as a high speed controller and then dropping back to low speed. That will cause havoc with USB devices particularly if they are high speed devices.

If you want to parse the results of the lsusb/dmesg file yourself you may be able to see something I'm not.

@brobin I imagine is not on line yet so I'm leaving it for the moment till he is.

All I'm trying to do is eliminate the obvious from the resources available before I could indicate what his actual problem is.
Title: Re: The Pi Alexa X10 Hub
Post by: petera on October 06, 2018, 11:40:52 AM
@brobin just one little caveat on the CM19a controller.

I'm not sure what software you are using to test your CM19a controller. Bear in mind that Mochad doesn't fully support the full X10 command set using the CM19a controller. There is a little fiddling about that can be done to achieve this but it is not straightforward.

Just have a read up on this http://drbacchus.com/getting-your-cm19a-working-on-linux/

It's not down as supported in the XtenLib which HomeGenie relies on but it's protocol is similar to the CM15 controller so it may work.

I do not have a CM19 but must get one to test it out.
Title: Re: The Pi Alexa X10 Hub
Post by: Tuicemen on October 06, 2018, 12:01:11 PM
When I thought up the Alexa Hub I designed it to use Mochad,Ha-Bridge and the CM15A. I couldn't test with the Zero W and CM19 as both of these are at my city place.
Since brobin is posting in this thread and asked for the installer, mochad woud be installed with HA-Bridge. If HG is also installed that would explain issues with sending as the drivers would conflict. Perhaps brobin could confirm what is loaded on his Zero W
Title: Re: The Pi Alexa X10 Hub
Post by: petera on October 06, 2018, 12:44:16 PM
For the correct driver to load at boot the CM19a USB device Vendor ID must be correctly identified. That's what I'm trying to identify here. If not he will have to remove the offending driver manually and modprobe the correct one.

Loading the incorrect driver will give the appearance of the device working but its behaviour will be erratic.

I have to log off now but I'll check in later to see if he made any progress.
Title: Re: The Pi Alexa X10 Hub
Post by: brobin on October 06, 2018, 05:47:08 PM
WOW! Thanks for all the input guys.  Let me answer as much as I can and then I'll run the dmesg again.

I have a Pi Zero W powered by a 5.1 VDC 3A power supply with a cable that has a pushbutton switch to make rebooting easy. The power supply appears to be as advertised and is not causing any offensive noise as testing from a Palmpad at the same time as the issue appeared worked fine. As petera pointed out, the extra ampacity won't hurt the pi and may be beneficial in running the CM-19A.  Photos attached. 

I have the OTG hub plugged in and, yes, the dmesg I posted shows the mouse and keyboard as I needed them to enter the commands as I haven't yet done what's needed to get into the Pi via the web. Right now going to the Pi's IP puts me on the HA-Bridge page. When not in use the KB & mouse are unplugged. I'll eliminate the OTG hub and just use an adapter once I've set up web access or can do it now for testing.  Coincidentally, I ordered the same OTG hub w/Ethernet in the ZDnet article yesterday and Amazon will deliver it tomorrow (Ya gotta love free Sunday delivery!)

The CM-19A transmits to an RR501 plugged into an early version XTBR in the same room (10' away) and there is an XTB-IIR in the house so I have no apparent signal issues. As I mentioned above, transmitting from a Palmpad worked. 

Since I modified the Interfaces file with the info I mentioned yesterday, the Pi has had no WiFi drops so I'm hoping that's solved.  Also, since I rebooted to solve the signal issue it has not reappeared.

Regarding what's loaded, I've kept it simple as I only want to use this as an Alexa hub. After installing Raspbian Stretch (full version) and letting it go through updating, I ran Tuice's hub installer which works perfectly.  The only other thing I've done is the change to the Interfaces file for the WiFi issue.  I don't need anything else as the Stargate does all the heavy lifting.  In fact, the hub is just used to send ON/OFF to unit codes on a vacant house code which the Stargate uses to trigger macros.

At is point, my thinking is that the PiZW is sending to the CM-19A because the light flickered and the RR501 is OK as it worked with the Palmpad.  My IR temperature gun shows the power supply exterior at 79F and the Pi's heatsink at 85F so overheating is an unlikely culprit.
That leaves a few possibilities; either the PiZW was sending corrupt data or the CM-19A had a problem solved by a reboot.  I wish I would have rebooted just the CM-19A first rather than rebooting both.  Sitting between the two is the OTG hub so maybe that's the culprit. If/when it happens again I'll be able to experiment further.

Title: Re: The Pi Alexa X10 Hub
Post by: brobin on October 06, 2018, 06:24:09 PM
Here's the new dmesg file that I ran after unplugging and plugging in the CM-19A to the OTG hub. I really appreciate the time and help.
Title: Re: The Pi Alexa X10 Hub
Post by: brobin on October 06, 2018, 07:30:42 PM
Until I need to use the KB/mouse again I've replaced the OTG hub with a simple adapter. I'd run dmesg again without the hub but I can't do that till I set up SSH  B:(

I might be able to do that later tonight.
Title: Re: The Pi Alexa X10 Hub
Post by: petera on October 06, 2018, 08:37:45 PM
It's late here so I'm finishing now.

What I do suggest is that you disconnect the hub and plug the CM19a directly into the Pi Zero and run dmesg and paste the output. Do all the unplugging when the Pi Zero is powered off.

Clearly with your current setup the USB Vendor ID is not correctly identified and will not bind to a valid COM port. In fact its reporting as a mouse which clearly is useless. You are now up to 7 USB devices connected which is a sure sign of problems.

Hubs do work but they need to have reliable chipsets and that hub you are using doesn't act like one of them. Keep things simple until you have a reliable connection and operation of your CM19a
Title: Re: The Pi Alexa X10 Hub
Post by: brobin on October 06, 2018, 09:49:48 PM
Ah HA! I have NOT been powering down when plugging/unplugging into the USB hub. Perhaps that's causing some confusion.  On the bright side, it's now been running and working without issue for 24 hours without a hiccup.  Next up: learn how to add SSH/VNC and implement so I can put the KB, mouse and hub away for good and then run dmesg again.  I have a book and will try it tonight.  I do have a backup of everything as is.
Title: Re: The Pi Alexa X10 Hub
Post by: brobin on October 07, 2018, 01:15:48 AM
Well, getting VNC and SSH working was easier than I thought it would be. Just 15 minutes to do both.  :)% Still a LOT more to learn but it's easier than learning Fortran was in 1968!  ::)

I've attached the latest dmesg file after a fresh reboot with the CM-19A plugged into an OTG adapter without the hub.  Thanks again for looking at it.
Title: Re: The Pi Alexa X10 Hub
Post by: dhouston on October 07, 2018, 06:17:25 AM
...it's easier than learning Fortran was in 1968!  ::)

The hardest part was shuffling all those punch cards.
Title: Re: The Pi Alexa X10 Hub
Post by: petera on October 07, 2018, 07:47:11 AM
Well, getting VNC and SSH working was easier than I thought it would be. Just 15 minutes to do both.  :)% Still a LOT more to learn but it's easier than learning Fortran was in 1968!  ::)

I've attached the latest dmesg file after a fresh reboot with the CM-19A plugged into an OTG adapter without the hub.  Thanks again for looking at it.

Ok you're CM19a has been detected and correctly identified

[ 1.521744] usb 1-1: New USB device found, idVendor=0bc7, idProduct=0002
[ 1.521769] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 1.521782] usb 1-1: Product: USB Transceiver
[ 1.521792] usb 1-1: Manufacturer: X10 wireless Technology Inc

The kernel OTG device driver being used by the USB hub is struggling to manage the i/o of your USB devices. There is quite a few errors in the dmesg to this effect. I reckon the hub chipset is not properly supported by the kernel

What you really need to do is power off, remove the hub completely, plug the CM19a directly into the Pi Zero and then power up the Pi Zero. No keyboards and no mouse. Then paste the results of the dmesg and the lsusb. Also type lspci and paste the results of this too.
Title: Re: The Pi Alexa X10 Hub
Post by: brobin on October 07, 2018, 02:24:51 PM
The 'report3' file that I attached was done withOUT the OTG hub but I saw that too and wasn't sure what to make of it. I did that after rebooting with nothing but the CM19, power and HDMI cable plugged in but I'll run it again without the HDMI cable which I don't need now. Photo shows current setup with my trusted assistant, Mr. Bill.  Also I received the OTG hub w/Ethernet as shown in the ZDnet article so I'll run dmesg with that config too for comparison. 
Title: Re: The Pi Alexa X10 Hub
Post by: petera on October 07, 2018, 02:53:35 PM
Ok. So you have a new hub now.

Do you have an image taken of your SD card before you started experimenting with it. The reason I ask is that you have a number of kernel drivers registered with your system that may need to be removed manually in order to get your system working normally.

Title: Re: The Pi Alexa X10 Hub
Post by: brobin on October 07, 2018, 03:02:41 PM
I haven't plugged in the new hub yet but will in a few minutes. The last dmesg (report3) and this one attached, report4, are both with NO hub as pictured in my last post. I noticed that while a hub is still reported, it is a 1 port rather than a 4 port. It appears the OTG cable pictured is seen as a 1 port hub.  I'll try with a different OTG cable too.
Title: Re: The Pi Alexa X10 Hub
Post by: petera on October 07, 2018, 03:13:25 PM
I haven't plugged in the new hub yet but will in a few minutes. The last dmesg (report3) and this one attached, report4, are both with NO hub as pictured in my last post. I noticed that while a hub is still reported, it is a 1 port rather than a 4 port. It appears the OTG cable pictured is seen as a 1 port hub.  I'll try with a different OTG cable too.

See my post above about manually removing kernel drivers/modules.

This type of behaviour is a result of how the kernel was handling your USB devices via your OTG hub. It's possible that you will have to manually remove the offending drivers/modules if they are still showing on boot up.

Could you confirm if you have an image taken of your SD card before you started experimenting.
Title: Re: The Pi Alexa X10 Hub
Post by: brobin on October 07, 2018, 03:14:04 PM
The attached dmesg, Report5, is with a different brand OTG cable and no hub.  Next up will be with the new hub.
Title: Re: The Pi Alexa X10 Hub
Post by: brobin on October 07, 2018, 03:16:12 PM
I did take an image two nights ago but that image was with the 4 port hub in place.
Title: Re: The Pi Alexa X10 Hub
Post by: brobin on October 07, 2018, 03:33:28 PM
And now, Report6, taken with the new powered 3 port hub w/Ethernet.  This hub will not work without power (I tried).  I am powering the hub with the same power supply as before. The pi's power cord is unplugged and the hub is powering the pi.  BTW, the CM19a is working with all configurations so far.
Title: Re: The Pi Alexa X10 Hub
Post by: brobin on October 07, 2018, 03:49:12 PM
...it's easier than learning Fortran was in 1968!  ::)

The hardest part was shuffling all those punch cards.

...and waiting two days to see the results!  The punch cards were replaced by paper tape in the following and my final year of HS. Still a two day wait though.
Title: Re: The Pi Alexa X10 Hub
Post by: petera on October 07, 2018, 03:52:11 PM
And now, Report6, taken with the new powered 3 port hub w/Ethernet.  This hub will not work without power (I tried).  I am powering the hub with the same power supply as before. The pi's power cord is unplugged and the hub is powering the pi.  BTW, the CM19a is working with all configurations so far.

Do you have a separate power supply for the hub and one for the Pi Zero. You shouldn't really be powering the Pi Zero via a USB hub. Voltage drops will cause your wifi and your CM19a to periodically drop connection. It's fine to use a powered hub with the Pi Zero but not to power it and your USB devices at the same time.

Your dmesg looks a little healthier. You could do with removing drivers/modules that are currently registered with the system and not in use but it's not critical at the moment.

Have you taken an image of your SD card at any stage. It really is important when experimenting with setups.
Title: Re: The Pi Alexa X10 Hub
Post by: brobin on October 07, 2018, 03:59:53 PM
Yes, I took an image of the SD card two nights ago so I have another SD card ready to go.

In playing around some more it turns out that this hub does NOT need it's own power and WILL work from the pi. I may have jumped the gun before and not waited long enough for the boot up to finish. 

For now everything seems to working reliably.  My next test will be plugging in an ethernet cable to the new hub.
Title: Re: The Pi Alexa X10 Hub
Post by: petera on October 07, 2018, 04:16:05 PM
Yes, I took an image of the SD card two nights ago so I have another SD card ready to go.

In playing around some more it turns out that this hub does NOT need it's own power and WILL work from the pi. I may have jumped the gun before and not waited long enough for the boot up to finish. 

For now everything seems to working reliably.  My next test will be plugging in an ethernet cable to the new hub.

Ok.

My advice from here is to power the Pi Zero with its own supply and the Hub with its own supply.

This will ensure you avoid any voltage drops or over amperage draws which can cause the behaviour you originally reported.

Also I suggest you revert to your image of two days ago as it should help remove some of the unwanted modules which were registered with the system during your experimentation.

Had you an ATI Remote attached to your system at any stage. Did it have a USB to serial adaptor attached to it.
Title: Re: The Pi Alexa X10 Hub
Post by: dave w on October 07, 2018, 04:37:24 PM
...it's easier than learning Fortran was in 1968!  ::)
The hardest part was shuffling all those punch cards.
Been there, done that. Good ole Hollerith code.
Title: Re: The Pi Alexa X10 Hub
Post by: brobin on October 07, 2018, 04:55:16 PM
No ATI remote or serial interface, the only things ever connected is the CM19A, keyboard and mouse.  I've tried using the Ethernet port on the hub but no joy either powered or unpowered.  I didn't try power to both as I've read that bad things can happen when doing that.  Could be a bad hub or maybe the pi needs to be told to look for it. Since the WiFi seems stable now I'm just going to revert the image to two days ago and use the 'no-hub' configuration and see how it goes. So far it's been rock solid since the initial hiccup.

Thanks to everyone for their input and help and @petera thank you for all the time and analysis - I've learned a LOT in the last 24 hours.  I'll post any new info. 
Title: Re: The Pi Alexa X10 Hub
Post by: petera on October 07, 2018, 06:03:20 PM
No ATI remote or serial interface, the only things ever connected is the CM19A, keyboard and mouse.  I've tried using the Ethernet port on the hub but no joy either powered or unpowered.  I didn't try power to both as I've read that bad things can happen when doing that.  Could be a bad hub or maybe the pi needs to be told to look for it. Since the WiFi seems stable now I'm just going to revert the image to two days ago and use the 'no-hub' configuration and see how it goes. So far it's been rock solid since the initial hiccup.

Thanks to everyone for their input and help and @petera thank you for all the time and analysis - I've learned a LOT in the last 24 hours.  I'll post any new info.

There's so many fairy tales and myths on Raspberry Pis it's hard to wade through them. This is an informed post you can read yourself to give you an idea on the power supply issue. https://www.domoticz.com/forum/viewtopic.php?t=21645&start=260

Ideally the Pi Zero is designed for specific one device projects, hence the single USB port. For any heavier USB requirements I'd use a standard Raspberry Pi model.

I've never been a big fan of USB hubs powered or not and particularly in the Linux for reasons I've explained above. Going that route you will need to have a good look at the modprobe command which will allow you to manually add or remove drivers/modules which cause IRQ conflicts or are not recognised by your USB devices on boot.

Glad you're up and running now. You now know what commands to run and what to look for when having problems. Familiarise yourself with the output of dmesg as its a very useful fault finding tool.
Title: Re: The Pi Alexa X10 Hub
Post by: brobin on October 10, 2018, 01:07:43 PM
The Pi Alexa Hub continues to work well but I've noticed that response time varies widely and unpredictably. When I say "Alexa turn on desk," Alexa responds instantly with "OK," but there can then be a lag of 1 to 9 seconds before the CM19A flickers. If I test 5 times in a row I will have 5 different response times mostly around 5 seconds.  Not a big deal, I'm in no hurry, but it's just long enough to wonder whether I have to repeat the command.  Any ideas on this are appreciated.  The same CM19A under Alex10 did not have any delays.
Title: Re: The Pi Alexa X10 Hub
Post by: Tuicemen on October 10, 2018, 01:25:55 PM
I'm not sure if when using Alex10 on your PC you were running via wi-fi or ethernet. Wi-fi has a slower data transfer rate and I'm not sure what the Zero is rated at verses what you were using on your PC.
 Also I have noticed delays at times for other Alexa calls of late, so I suspect the server needs a update as the user base keeps growing and more options are added.
Amazon just rolled out an update to the Alexa app so that too could be causing a slowdown as all apps are updating.
Title: Re: The Pi Alexa X10 Hub
Post by: petera on October 10, 2018, 04:17:50 PM
I'm not sure if when using Alex10 on your PC you were running via wi-fi or ethernet. Wi-fi has a slower data transfer rate and I'm not sure what the Zero is rated at verses what you were using on your PC.
 Also I have noticed delays at times for other Alexa calls of late, so I suspect the server needs a update as the user base keeps growing and more options are added.
Amazon just rolled out an update to the Alexa app so that too could be causing a slowdown as all apps are updating.

You know how temperamental women can be  :)

Seriously, Alexa is a fun toy and once you view it that way you'll not have any problems. Clearly it's a way for Amazon to win hearts and minds with a much bigger goal in mind. I wouldn't entrust any form of mission critical tasks to it. Each day it's a case of what you see (or in her case what she chooses to hear) is what you get.

I've no doubt there's bigger plans in the pipeline for Alexa but for the moment she jumps to attention or takes her time. It's not down to Tuicemen's Alex10.
Title: Re: The Pi Alexa X10 Hub
Post by: Tuicemen on October 10, 2018, 06:15:24 PM

You know how temperamental women can be  :)
rofl
Her hearing like my wife's seems to be selective too.
Title: Re: The Pi Alexa X10 Hub
Post by: dave w on October 10, 2018, 06:28:59 PM
Also I have noticed delays at times for other Alexa calls of late, so I suspect the server needs a update as the user base keeps growing and more options are added.
Yes, I am seeing that also.
I was wondering if the problem might be with Homeseer. Because most of our Alexa calls are for HA and not the news, weather, etc. I had no comparison to a non-home automation call.  Now I know.
Title: Re: The Pi Alexa X10 Hub
Post by: brobin on October 10, 2018, 07:08:34 PM
I had the Alex10 laptop - an agonizingly slow old Sony - on WiFi too.  At my other place I'm using a CM15A that I'll compare when I'm back there late next week.  I thought it might have something to do with the pi's wifi power saver but there was no difference after turning that off.  It's probably just the server as you both suggested. I figured that when the 'OK' response is immediate the action should be as well but as I think about it, at my other place the action is often completed before I hear the 'OK' or sometimes Alexa says she can't find the device but the action completes anyway. Go figure!
 I agree that Alexa isn't for mission critical tasks and it's probably only a matter of time before Alexa starts giving US the commands! 
Title: Re: The Pi Alexa X10 Hub
Post by: petera on October 11, 2018, 09:31:39 AM
Also I have noticed delays at times for other Alexa calls of late, so I suspect the server needs a update as the user base keeps growing and more options are added.
Yes, I am seeing that also.
I was wondering if the problem might be with Homeseer. Because most of our Alexa calls are for HA and not the news, weather, etc. I had no comparison to a non-home automation call.  Now I know.

Are you routing your Alexa calls via MyHS or directly to your system.

Title: Re: The Pi Alexa X10 Hub
Post by: Tuicemen on October 11, 2018, 09:50:04 AM
I had the Alex10 laptop - an agonizingly slow old Sony - on WiFi too.  At my other place I'm using a CM15A that I'll compare when I'm back there late next week. 
The CM19 will naturally be slower then the CM15 though the difference shouldn't be to noticeable.
The CM19 has to send RF to a transceiver which then converts the RF to PLC and sends the command over the power line. The CM15 is sending the signal directly to the powerline.
Title: Re: The Pi Alexa X10 Hub
Post by: brobin on October 11, 2018, 10:37:41 AM
Yes the RF can add a few milliseconds delay which is generally not noticeable.  Last night, before I unplugged the power supply from the X10 module per your advice, I ran the Halt command. After plugging in the PS and waiting for the boot to finish, Alexa requests would return 'OK' but nothing would happen.  B:( I unplugged the CM19a from the OTG dongle, plugged it back in and Bingo! now the delays are gone - at least for now.  The CM19a is responding the instant that Alexa says OK.  :)% 
Title: Re: The Pi Alexa X10 Hub
Post by: Tuicemen on October 11, 2018, 01:33:47 PM
Sounds like a mochad issue not detecting the CM19 on boot. I hope that doesn't happen every reboot.
Nice to hear your delay has now be reduced.
Title: Re: The Pi Alexa X10 Hub
Post by: brobin on October 11, 2018, 01:41:02 PM
Seems to have been a one off occurrence. I don't know why or if it's related but it only happened the one time I used 'halt' before pulling the power on the pi.  In any case, the delays are gone now. :)
Title: Re: The Pi Alexa X10 Hub
Post by: petera on October 11, 2018, 04:38:59 PM
What version of Mochad are you using. Certain versions are notorious for RF lockups and delays.
Title: Re: The Pi Alexa X10 Hub
Post by: Tuicemen on October 11, 2018, 04:43:34 PM
the script for the Alexa x10 Hub installs 17
Title: Re: The Pi Alexa X10 Hub
Post by: petera on October 11, 2018, 04:52:24 PM
the script for the Alexa x10 Hub installs 17

Ver 0.1.17 has a little bug that can be adjusted but ver 0.1.16 is a lot more stable. As you probably know Raspbian is a subset of Debian.

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:

  CM15Pro
  echo "pl a1 on" | nc -w1 localhost 1099
  CM19A
  echo "rf a1 on" | nc -w1 localhost 1099
Title: Re: The Pi Alexa X10 Hub
Post by: Tuicemen on October 11, 2018, 05:52:56 PM
If I remember that is what the demo calls look like for devices in HA-Bridge when the installer script is run.

Brobin might confirm this as I don't have the Alexa Hub currently running here. HA-Bridge is setup with HG here.
Title: Re: The Pi Alexa X10 Hub
Post by: brobin on October 11, 2018, 07:28:58 PM
I'm happy to check - where do I look?
Title: Re: The Pi Alexa X10 Hub
Post by: Tuicemen on October 12, 2018, 08:20:26 AM
I'm happy to check - where do I look?
I had a look at the script seems HA-Bridge is loaded using the X10cmd.sh file to execute mochad commands,
so you won't find the command line in HA-Bridge
This uses -q 1 parameter. the -w 1 parameter if I remember now didn't work -q 1 was suggested as the alternative.
Title: Re: The Pi Alexa X10 Hub
Post by: petera on October 16, 2018, 11:20:10 AM
@Tuicemen might be worth compiling, installing and testing ver 0.1.18 of Mochad. It includes support for IPv6. https://github.com/linuxha/mochad
Title: Re: The Pi Alexa X10 Hub
Post by: Tuicemen on October 16, 2018, 12:00:52 PM
That may be something I'll  look at doing once HA season sets in. I've ordered another PI Zerro W to play with as my current ones are in operation working well with HG. However since there is little to no interest in the Alexa X10 Hub I feel it will be a waste of time.
Title: Re: The Pi Alexa X10 Hub
Post by: brobin on October 16, 2018, 12:15:21 PM
Maybe little but not "no" - I love it! :)%
I'm really surprised that there's not more interest in this.  It's not only useful but a great way to get started learning the pi environment.  Even though you did all the heavy lifting I've learned a lot and am encouraged to go further. 
Title: Re: The Pi Alexa X10 Hub
Post by: petera on October 16, 2018, 02:05:25 PM
Maybe little but not "no" - I love it! :)%
I'm really surprised that there's not more interest in this.  It's not only useful but a great way to get started learning the pi environment.  Even though you did all the heavy lifting I've learned a lot and am encouraged to go further.

I'd imagine there would be if everyone stayed positive about the project instead of picking holes in it at every opportunity particularly those who have no real interest in it.

I asked @Tuicemen to run a poll and ten users expressing interest should be good enough to continue. The alternatives as it stands don't look too promising.
Title: Re: The Pi Alexa X10 Hub
Post by: petera on October 16, 2018, 02:07:48 PM
That may be something I'll  look at doing once HA season sets in. I've ordered another PI Zerro W to play with as my current ones are in operation working well with HG. However since there is little to no interest in the Alexa X10 Hub I feel it will be a waste of time.

Also there's been a development in the XtenLib and a new version downloadable from the NUGET repository. You could test that on HomeGenie if it's not already included https://www.nuget.org/packages/XTenLib/1.0.10
Title: Re: The Pi Alexa X10 Hub
Post by: alzy on January 05, 2019, 03:41:56 PM
With brobin's help and his infinite patience, I have a PiAlexaHub running on my Pi Zero W with a cm19a interface! The only change I made to the image was to add a wpa_supplicant.config file once the image was written to give me headless setup. As brobin reported, It handles the cm19a well. I have a 2.5 A Pi supply.
Brobin, thanks again! :)% >!

Is it possible to dim with this setup? If so how? Any help would be appreciated.
Title: Re: The Pi Alexa X10 Hub
Post by: Tuicemen on January 05, 2019, 05:39:40 PM
If I'm not mistaken there is a readme file in the mochad folder that explains different calls that are available
Title: Re: The Pi Alexa X10 Hub
Post by: alzy on January 05, 2019, 06:50:00 PM
Your directions for Setting up Mochad to call X10 devices in HA-Bridge say:

assuming you have the script file called X10cmd and its in the ha-bridge folder
1- on command is: ./x10cmd pl a1 on
2- off the command is: ./x10cmd pl a1 off
3- AllLightsOn is ./x10cmd pl a all_lights_on
4- AllLightsOff is: ./x10cmd pl a all_lights_off
5- One step Dim is: ./x10cmd pl a1 dim
« Last Edit: August 24, 2018, 01:08:27 PM by Tuicemen »

Since "x10cmd rf e3 on" and "x10cmd rf e3 off" work, I tried "x10cmd rf e3 dim" for Dim Item but Pi crashes and I have to reboot.
Title: Re: The Pi Alexa X10 Hub
Post by: Tuicemen on January 05, 2019, 06:52:24 PM
Your directions for Setting up Mochad to call X10 devices in HA-Bridge say:

assuming you have the script file called X10cmd and its in the ha-bridge folder
1- on command is: ./x10cmd pl a1 on
2- off the command is: ./x10cmd pl a1 off
3- AllLightsOn is ./x10cmd pl a all_lights_on
4- AllLightsOff is: ./x10cmd pl a all_lights_off
5- One step Dim is: ./x10cmd pl a1 dim
« Last Edit: August 24, 2018, 01:08:27 PM by Tuicemen »

Since "x10cmd rf e3 on" and "x10cmd rf e3 off" work, I tried "x10cmd rf e3 dim" for Dim Item but Pi crashes and I have to reboot.
  that's why I said refer to the Mochad readme what you are running is a beta image.
Title: Re: The Pi Alexa X10 Hub
Post by: alzy on January 05, 2019, 06:55:06 PM
Oh! Sorry. I am running headless so i don't know how to access the Readme. What's the ssh command?
Title: Re: The Pi Alexa X10 Hub
Post by: Tuicemen on January 05, 2019, 07:09:05 PM
nano "file name"
Title: Re: The Pi Alexa X10 Hub
Post by: alzy on January 06, 2019, 08:02:32 AM
Readme file says that the command I used was correct. But it crashed the Pi when executed from the bridge gui.
Any thoughts? Thanks! B:(
Title: Re: The Pi Alexa X10 Hub
Post by: Tuicemen on January 06, 2019, 08:29:40 AM
Readme file says that the command I used was correct. But it crashed the Pi when executed from the bridge gui.
Any thoughts? Thanks! B:(
Don't use the dim commands?
Seriously, you could look at other versions on mochad. I'm not sure now what version I had used for initial testing but an older version may be a better option for you.
 >!
Title: Re: The Pi Alexa X10 Hub
Post by: petera on January 06, 2019, 08:36:40 AM
Readme file says that the command I used was correct. But it crashed the Pi when executed from the bridge gui.
Any thoughts? Thanks! B:(

Bjonica's version from this link works with all the relevant X10 commands using CM19. Just read up on the release notes and follow instructions https://github.com/bjonica/mochad
Title: Re: The Pi Alexa X10 Hub
Post by: alzy on January 06, 2019, 08:41:35 AM
Thanks!
Title: Re: The Pi Alexa X10 Hub
Post by: alzy on January 06, 2019, 08:53:50 AM
Thanks, but that is the same info as in the readme with the same command reference.
Title: Re: The Pi Alexa X10 Hub
Post by: petera on January 06, 2019, 09:06:01 AM
Thanks, but that is the same info as in the readme with the same command reference.

Well that version works with all the X10 commands using a CM19
Title: Re: The Pi Alexa X10 Hub
Post by: alzy on January 06, 2019, 09:30:01 AM
Well it doesn't seem to work in this configuration. If I trigger a dim command from the bridge it crashes the Pi. B:(
Title: Re: The Pi Alexa X10 Hub
Post by: brobin on January 06, 2019, 10:07:17 AM
I think the point is that the version of mochad in the image should be replaced with the earlier version of mochad to be able to use the dim commands. That means replacing mochad in the image you have.
Title: Re: The Pi Alexa X10 Hub
Post by: alzy on January 06, 2019, 10:11:26 AM
I am confused. The readme file on the Pi says it should work. Is that readme file not the info for the installed version? Thanks.
Title: Re: The Pi Alexa X10 Hub
Post by: brobin on January 06, 2019, 10:26:03 AM
It appears the dim command function was broken in the version on the image.  Reverting to the image recommended by petera reportedly works.  Your next question (as would be mine) is probably, "OK, how do I do that?" 
Title: Re: The Pi Alexa X10 Hub
Post by: Tuicemen on January 06, 2019, 10:57:33 AM
I am confused. The readme file on the Pi says it should work. Is that readme file not the info for the installed version? Thanks.
the image Brobin supplied was the Raspbian Stretch Full which I believe he ran the initial script on.
the full Stretch image includes many unneeded applications all of which are newer then mochad. Any one of these could be the issue.

It is possible to remove many unneeded applications and disable the Desktop ( which if you haven't done is still using resources)

I started a new poll for this on my forum with a 10 day time limit even thought this is of no use to me I'll look at a recreation given 10 positive poll submissions on my forum.
Title: Re: The Pi Alexa X10 Hub
Post by: alzy on January 06, 2019, 11:04:45 AM
Sounds like you are feeling better! Welcome back! And thanks for the pole! :)%
Title: Re: The Pi Alexa X10 Hub
Post by: alzy on January 06, 2019, 11:14:40 AM
where do I find the POLL?
Title: Re: The Pi Alexa X10 Hub
Post by: brobin on January 06, 2019, 11:27:08 AM
 The poll is at http://forums.tuicemen.net/index.php?topic=1310.0
 C'mon everyone - VOTE!!
Title: Re: The Pi Alexa X10 Hub
Post by: Tuicemen on January 06, 2019, 12:10:33 PM
Sounds like you are feeling better! Welcome back! And thanks for the pole! :)%
Im not100% just yet but maybe in 10 day
Title: Re: The Pi Alexa X10 Hub
Post by: alzy on January 06, 2019, 12:13:17 PM
Don't overdo it! ;)
Title: Re: The Pi Alexa X10 Hub
Post by: alzy on January 06, 2019, 02:13:36 PM
petera's post links to the same version 0.1.17 that is already on the PI. Any thoughts? Thanks! B:(
Title: Re: The Pi Alexa X10 Hub
Post by: Tuicemen on January 29, 2019, 09:12:58 AM
There are lots of older versions of mochad out there. All that I can say is try working backwards till you find one that works for you. Also if you didn't do an apt-get update and upgrade then try that first.
Seems there has been enough interest on my site to create an image for this so from my experience with PXH2.0 I'll attempt a universal image which will install on any Pi. ;)
For those that may be late to finding this all developement and testing results will be posted to my forum as will the download link once available.  http://forums.tuicemen.net/index.php
Title: Re: The Pi Alexa X10 Hub
Post by: dhouston on January 29, 2019, 04:41:21 PM
How about adding support for this...
https://www.dailymail.co.uk/sciencetech/article-6644101/Machine-read-mind-convert-THOUGHTS-speech-developed-scientists.html (https://www.dailymail.co.uk/sciencetech/article-6644101/Machine-read-mind-convert-THOUGHTS-speech-developed-scientists.html)

Of course, it might destroy a lot of marriages.  :'
Title: Re: The Pi Alexa X10 Hub
Post by: HA Dave on January 29, 2019, 11:36:21 PM
How about adding support for this...
https://www.dailymail.co.uk/sciencetech/article-6644101/Machine-read-mind-convert-THOUGHTS-speech-developed-scientists.html (https://www.dailymail.co.uk/sciencetech/article-6644101/Machine-read-mind-convert-THOUGHTS-speech-developed-scientists.html)

Of course, it might destroy a lot of marriages.  :'

Or enrich a lot of lives! In 2006 (I believe) Bill, of BVC exploited MS SAPI5 voice recon to create Bill's Voice Commander.... which controlled X10 using voice commands. (I used BVC effectively for a decade.... before Amazon introduced Alexa.) But Bill had originally developed the the voice control for X10 to aid/assist people with limited mobility.

After BVC.... Bill looked in Mindflex [games] (for mind control of whatever). We both purchased similar units and the possiablities were interesting. But well over my head.... and Bill seemed to lose interest. But the technology is there.





Title: Re: The Pi Alexa X10 Hub
Post by: dhouston on January 30, 2019, 07:59:15 AM
In 1996 I introduced a program called SpeakOUT! that did just the opposite of BVC in that it gave a voice to those who had lost the ability to speak due to ALS, CP, strokes, brain injuries, etc. It ran under W95 and could be used with a speakerphone modem to make/receive phone calls and one young man with CP used it on a laptop to become a DJ at a local bistro.

It was because some users also had mobility issues that I discovered X10 and added X10 control to SpeakOUT!

I also looked into some of the voice control and/or thought control technologies but none were then ready for primetime.

However, those technologies had little in common with the tech behind Alexa and the Alexa-related thought-to-speech tech described in the article.
Title: Re: The Pi Alexa X10 Hub
Post by: HA Dave on January 30, 2019, 12:21:54 PM
……. However, those technologies had little in common with the tech behind Alexa and the Alexa-related thought-to-speech tech described in the article.

Alexa speech is unique... as it is not based on a human voice (whereas female US, Siri is actually created by using recordings of Susan Bennett ~ voice actor). And I understand experimental trials of various methods are great. But I think the tech is there now..... the profit margins..... maybe not so much

Interestingly.... Alexa is expected to evolve in her use of pronunciations and language skills as the millions and millions of user hours add up.