Please login or register.

Login with username, password and session length
Advanced search  

News:

The X10Hub (PiX10Hub) is here! Created by the Community, for the Community.:)% #:)

Pages: [1] 2 3 ... 7

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

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 13
  • Posts: 923
installing helper programs to pi for X10 integration
« on: October 17, 2018, 06:32:50 PM »

In the last 3 weeks I have learned something significant about raspbian stretch operating system:  THE LITE AND THE LARGER FULL GUI SYSTEMS WILL NOT RUN THE SAME PROGRAMS! 

I spent approx. 100 hours over the last 2 weeks trying to get various various python3 helper programs to load so my Domoticz HA program could use them.  Programs that load via:

sudo apt-get install python3-pip
sudo pip3 install Crypto
sudo pip3 install broadlink
sudo pip3 install pyaes
sudo cp -r /usr/local/lib/python3.5/dist-packages/Crypto/ /usr/lib/python3.5/
sudo cp -r /usr/local/lib/python3.5/dist-packages/broadlink /usr/lib/python3.5/

NONE would load on my various full stretch with GUI images.  ALL failed on openSSL errors among others.  I COULD get them to load if I updated from python3.5 to 3.6 or 3.7, but then the new python would not react well with the old still required python3.5.  So no go.

I had the idea to try a stretch LITE image...  BINGO - EVERYTHING LOADS AND SO FAR WORKS. 

I wanted to share this huge find;  if you cannot get a pi with full stretch to load programs properly, try the LITE version.
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 265
  • Posts: 9464
  • I don't work for X10, I use it successfuly!
    • Tuicemen Software
Re: installing helper programs to pi for X10 integration
« Reply #1 on: October 17, 2018, 07:29:25 PM »

The full GUI version (Raspbian) include python, java and a few other programing languages these are not always the version required.  ::) :'  the lite version is lite and includes none of these so they must be loaded.
This is one reason I stayed away from some software when trying to find the best fit for a newbie and PI with Linux.
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Find extra info @ My forum

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 13
  • Posts: 923
Re: installing helper programs to pi for X10 integration
« Reply #2 on: October 17, 2018, 07:37:23 PM »

actually the LITE includes python 3.5 so I did  not need to load it.
Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 19
  • Posts: 1091
Re: installing helper programs to pi for X10 integration
« Reply #3 on: October 18, 2018, 06:31:25 AM »

actually the LITE includes python 3.5 so I did  not need to load it.

Mike the Lite version of any Linux version is exactly that. A stripped down version of the OS and the bare essentials to get your Pi booting to the CLI.

It allows you to select particular packages like Python to install from scratch with all it's relevant dependencies. So many other packages rely on Python to operate and particular versions you will find have a release candidate tied to them. The Desktop version of Raspbian will have many Python reliant packages installed.

To get the latest version of Python from the Raspbian repositories the sudo apt-get update and the sudo apt-get upgrade will achieve this. Bear in mind that the Debian repositories (the repositories where most of the Raspbian packages are extracted from) are usually a number of versions behind.

In order to acquire a later version you need to step outside of the Aptitude package manager and compile and install the latest version from a GitHub. Once you begin doing this you need to know what you are doing as this method will not know or check that you already have an earlier version installed. If a later version of a package is installed on top of an earlier version it usually ends up in a broken OS.

I have mentioned it here many times to go with Raspbian Lite and now you have discovered why. Nothing magic really. Installing Raspbian Lite allows you to construct and tailor your own Raspbian distribution particularly when it comes to using your distribution as a server, as in Domoticz or HomeGenie.

You should never need to use a GUI on a server as all maintenance should be carried out remotely once the initial installation has been completed. Using the Raspbian Lite version alllows you to construct a dedicated server with only the essential packages that relate to that server's operability. Nothing more, nothing less.

Packages that require SSL authentication to install can be resolved by installing the relevant SSL certificates on your system. Whether you use the Lite or the Desktop version is not relevant here.

If you want to tie your system to a particular release of a package it's just a case of issuing a particular command to make the Aptitude manager aware of this.

Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 13
  • Posts: 923
Re: installing helper programs to pi for X10 integration
« Reply #4 on: October 18, 2018, 09:49:31 AM »

Perhaps the pi gods just do not want me to join their membership group! 

So I am almost finished making this 8gb card the way I want it and do a last SSH install (pyaes) and it complains...   OK, maybe need a reboot first.  reboot.  it is gone.

this morning come in and see all kinds of crashes  - mostly something called something dev...   won't get to sign in line, no wifi.  can't get to where I can try to recover.  Oh well.  What is another 20 hours of trying to build a raspbianpi card?

So last week I buy 10pc 8gb cards on ebay as I only had 1 left each 8 & 16gb.  I certainly do not want to be waiting on 2Mb/s writes onto a 16gb card anymore! 

So image a new LITE onto 8gb card (5.0Mb/sec), relatively fast.  Will start anew this morning...   I know I should make back up image on way thru - just another 1/2 hour each time taker...  At least I now know that a LITE is required to get python programs to load without errors into -V 3.5!
Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 19
  • Posts: 1091
Re: installing helper programs to pi for X10 integration
« Reply #5 on: October 18, 2018, 06:52:04 PM »

Perhaps the pi gods just do not want me to join their membership group! 

So I am almost finished making this 8gb card the way I want it and do a last SSH install (pyaes) and it complains...   OK, maybe need a reboot first.  reboot.  it is gone.

this morning come in and see all kinds of crashes  - mostly something called something dev...   won't get to sign in line, no wifi.  can't get to where I can try to recover.  Oh well.  What is another 20 hours of trying to build a raspbianpi card?

So last week I buy 10pc 8gb cards on ebay as I only had 1 left each 8 & 16gb.  I certainly do not want to be waiting on 2Mb/s writes onto a 16gb card anymore! 

So image a new LITE onto 8gb card (5.0Mb/sec), relatively fast.  Will start anew this morning...   I know I should make back up image on way thru - just another 1/2 hour each time taker...  At least I now know that a LITE is required to get python programs to load without errors into -V 3.5!

Mike both the LIte and the Desktop feed off the same repository so they will both give you the latest version of a particular package if you require it. If you find there is a package version you do not need just use the remove or purge commands prior to installing the one you do.

Python as you have now learned is quite specific on its version numbering when installing. As I said before once you step outside the Aptitude installer you're pretty much at the mercy of compilers.

Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 13
  • Posts: 923
Re: installing helper programs to pi for X10 integration
« Reply #6 on: October 20, 2018, 08:50:01 AM »

So reality is  many python helper programs will NOT install on raspbian FULL GUI  operating system, yet install just fine on raspbian LITE.  Although I agree BOTH versions are based on the same code, reality is reality, and ONLY the LITE version allows the various python programs I required for integrating both X10 (mochad) & Broadlink (broadlink, pyaes, cypro) to install.

THIS time, having 8gb cards instead of 16gb, and buying  more (all class 4 - remember that was the fastest version back ini 8gb days), I was able to make backup images as I added each program, at the rate of 19MB/s so 6 minute writes, 1.5 minute confirms.  I will post a link my fully installed domoticz running system once finished tweaking.

I am still learning how to use the built in, integrated into domoticz, learn and save function functions of broadlink, and my mochad is not being 100% for some reason - it appears my cm15 is still behind an x10 powerline filter.  Learn RF button pushes seem to build switches 100% of the time, but then the switch does not turn lite on/off but 20% of the time.  I know it can work because I DID have it working 100% solid in a past install.

I need to thank both Tuiceman and petera for all your patience and help along this journey.  I continue to learn little linux commands each day.  Latest was CHOWN as broadlink installed a folder to hold its learned codes as root owned so I could not look into it easily.   
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 265
  • Posts: 9464
  • I don't work for X10, I use it successfuly!
    • Tuicemen Software
Re: installing helper programs to pi for X10 integration
« Reply #7 on: October 20, 2018, 09:24:51 AM »

I dont think I was of any helpto you on this endeavor mike.
You stuck with this when many would have thrown in the towel.(me included)
I'll give Domonticz more of a go after hunting season as I'll have more time then. I look forward to your link as I'm sure it will be helpful to many users looking at a x10 pi setup.
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Find extra info @ My forum

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 19
  • Posts: 1091
Re: installing helper programs to pi for X10 integration
« Reply #8 on: October 21, 2018, 07:08:05 AM »

So reality is  many python helper programs will NOT install on raspbian FULL GUI  operating system, yet install just fine on raspbian LITE.  Although I agree BOTH versions are based on the same code, reality is reality, and ONLY the LITE version allows the various python programs I required for integrating both X10 (mochad) & Broadlink (broadlink, pyaes, cypro) to install.

THIS time, having 8gb cards instead of 16gb, and buying  more (all class 4 - remember that was the fastest version back ini 8gb days), I was able to make backup images as I added each program, at the rate of 19MB/s so 6 minute writes, 1.5 minute confirms.  I will post a link my fully installed domoticz running system once finished tweaking.

I am still learning how to use the built in, integrated into domoticz, learn and save function functions of broadlink, and my mochad is not being 100% for some reason - it appears my cm15 is still behind an x10 powerline filter.  Learn RF button pushes seem to build switches 100% of the time, but then the switch does not turn lite on/off but 20% of the time.  I know it can work because I DID have it working 100% solid in a past install.

I need to thank both Tuiceman and petera for all your patience and help along this journey.  I continue to learn little linux commands each day.  Latest was CHOWN as broadlink installed a folder to hold its learned codes as root owned so I could not look into it easily.

Mike, generally program authors distribute their work via what is known as a package installer. Take for instance, HomeGenie which has been discussed at length here. The package installer used in this case is Gdebi.

Gdebi will assemble all the component parts (dependencies) of a particular program and will check to see if your system already has any of those required components already installed. If not it will install them before it installs the main body of the program.

If you are using a Lite version of the OS it will probably need to install more component parts but the main thing is it will install what is needed for their program to run on your system. The fact that you are running the Lite or Desktop version of the OS is not an underlying factor here.

You can come across a program, usually from a GitHub that will not include the facility of a package manager. The author usually points out that you need to install other component parts prior to manually installing their program.

The final scenario you are likely to encounter is a program on a GitHub which is source code that needs to be compiled and built prior to installation. This is a fairly technical method and the author makes assumptions that you are very familiar with the Linux OS. You will have worked out yourself what component parts are required to compile these programs yourself.

PIP, another package installer which you are now familiar with, allows you to install a Python designed program onto your your system. This program and it's dependencies (in your case Domoticz) will be tied to a particular version of Python at the time of installation and should receive regular updates from the author. Not in all cases though as you've experienced with the Broadlink module. That's when you experience difficulties as different program modules are demanding different versions of Python.

I found this to be an interesting read on the subject https://www.datacamp.com/community/tutorials/pip-python-package-manager
Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 13
  • Posts: 923
Re: installing helper programs to pi for X10 integration
« Reply #9 on: October 21, 2018, 07:31:45 PM »

So I had broadlink working, it would learn IR & non X10 codes,, then repeat them back from the switch I made for them.  Then sometime yesterday it stopped working, would not go into learn mode (orange light on), and would not send code when switch pushed.    hmmm...   oh well, par for my course.

I re imaged a card with the working version from the day before, still did not fix broadlink...

meanwhile, mochad stopped working.  Had it at 100% working, loaded all my x10 devices into dommoticz, including a couple ds10 door security switches and keyfob kr10 arm/disarm.   kr10 would not send to arm my security, but I did not expect it to - that is what broadlink was for.  But all working.  ds10 shows cute locked padlock when closed, red siren when open...

remade image complete minus mochad, reinstalled mochad and it worked fine again - all morning.  then stopped working again.

ps -A shows mochad still running.   echo "pl a3 on" | nc  -w1 localhost 1099 sends but does not report back working.  ./mochad reports it cannot find a cm15.

I just wonder how others are getting these pi's to run consistently for any length of time...
Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 19
  • Posts: 1091
Re: installing helper programs to pi for X10 integration
« Reply #10 on: October 21, 2018, 08:20:03 PM »

So I had broadlink working, it would learn IR & non X10 codes,, then repeat them back from the switch I made for them.  Then sometime yesterday it stopped working, would not go into learn mode (orange light on), and would not send code when switch pushed.    hmmm...   oh well, par for my course.

I re imaged a card with the working version from the day before, still did not fix broadlink...

meanwhile, mochad stopped working.  Had it at 100% working, loaded all my x10 devices into dommoticz, including a couple ds10 door security switches and keyfob kr10 arm/disarm.   kr10 would not send to arm my security, but I did not expect it to - that is what broadlink was for.  But all working.  ds10 shows cute locked padlock when closed, red siren when open...

remade image complete minus mochad, reinstalled mochad and it worked fine again - all morning.  then stopped working again.

ps -A shows mochad still running.   echo "pl a3 on" | nc  -w1 localhost 1099 sends but does not report back working.  ./mochad reports it cannot find a cm15.

I just wonder how others are getting these pi's to run consistently for any length of time...

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

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

bkenobi

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 18
  • Posts: 1725
Re: installing helper programs to pi for X10 integration
« Reply #11 on: October 22, 2018, 11:48:08 AM »

There is also another possibility as to why an installer works on lite but not the GUI install.  In some cases, a program is compatible with one version of a dependency but not the newest variant.  An example of this is HG which works with older versions of Mono but not the latest version (not sure if that's still the case, it's been a while since last install).  As a result, if you installed a newer version of Raspbian, HG would install but not function correctly.  Going back to an older version worked.

It's possible that the Lite version didn't have a dependency installed so the installer took care of it.  The GUI version had a newer version of the dependency and so the installer didn't touch it.  The newer version wouldn't work with the app and things were broken.  This may be correctable by removing that dependency and installing an older version, but it could affect other things...a bit of a quagmire!

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 265
  • Posts: 9464
  • I don't work for X10, I use it successfuly!
    • Tuicemen Software
Re: installing helper programs to pi for X10 integration
« Reply #12 on: October 22, 2018, 12:06:38 PM »

  An example of this is HG which works with older versions of Mono but not the latest version (not sure if that's still the case, it's been a while since last install). 
the latest stable version of HG I believe works with the latest mono but I believe petera discovered it now need the newer mono for some of the User created addon programs. so it appears HG latest beta versions at least now require the new mono.
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Find extra info @ My forum

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 265
  • Posts: 9464
  • I don't work for X10, I use it successfuly!
    • Tuicemen Software
Re: installing helper programs to pi for X10 integration
« Reply #13 on: October 22, 2018, 12:14:30 PM »

I just wonder how others are getting these pi's to run consistently for any length of time...
My Pis have been running just fine under HG.
I tryed Domonticz On another SB as I didn't wish to put my HA setup out of commission while playing with Domonticz.
That was a good desission as I couldn't keep Domoticz running longenough to do a good assessment.

As petera suggested if everything else seems to be running on the Pi try another version of Mochad.
 If that still doesn't help move on to another Software. ( maybe something easier to setup)

Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Find extra info @ My forum

mike

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

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

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

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

mochad[565]: libusb_open_device_with_vid_pid failed

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

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

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

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

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

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

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

Logged
Pages: [1] 2 3 ... 7
 

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