myhouse-project / myHouse

Home monitoring and automation suite with interactive Slack bot
GNU General Public License v3.0
2 stars 0 forks source link

Web interface not accessible after installation #156

Closed user2684 closed 5 years ago

user2684 commented 7 years ago

https://forum.mysensors.org/topic/6038/implementing-a-new-controller/4 waiting for logs

Reported by: user2684

user2684 commented 7 years ago

Hi There were no logs in the log folder. I will try a fresh installation using V2.2 (I think i may have installed a snapshot of v2.3 as i was looking at the mysensors plugin). I will let you know in the morning. Should the web interface just be accessed using http://192.168.1.3 in my case? Regards Mark

Original comment by: *anonymous

user2684 commented 7 years ago

Hi, in this case try running it manually with "sudo python myHouse.py" from within the folder where it is located, you should see there if there is any error. And yes, start with 2.2, 2.3-dev is still not fully functional. Of course I'll let you know once the mysensors plugin will be working, I'd love if you can help me testing it! The web interface runs on port 80 so the URL is correct. Other caveat in case can be useful, python 3.x is not supported yet but if you are running a fresh raspian installation 2.7 is the default so you should be fine Thanks

Original comment by: user2684

user2684 commented 7 years ago

Ok re-installed this morning on a fressh rasbian lite. I copied the files to /Home/pi just to save on the permissions problem with the /opt directory. Ran the install script which gave no errors. Then tried the web interface and there was nothing there. So then as per your instructions i ran "sudo python myHouse.py" Below is the terminal output.

input.py              README.md
install.py            scheduler.py
language_en.dict          sensors.py
LICENSE.txt           slack.py
logger.py             sms.py
logs                  smtp.py
myHouse.py            template_email.html
oracle.py             template_service.sh
output.py             template_web.html
plugin_ads1x15.py         tmp
plugin_command.py         upgrade.py
plugin_csv.py             utils.py
plugin_dht.py             utils.pyc
plugin_ds18b20.py         web
plugin_earthquake.py          webserver.py
plugin_gpio.py
pi@raspberrypi:~/myHouse $ sudo python myHouse.py
Traceback (most recent call last):
  File "myHouse.py", line 6, in <module>
    import utils
  File "/home/pi/myHouse/utils.py", line 5, in <module>
    import requests
ImportError: No module named requests
pi@raspberrypi:~/myHouse $ 

Original comment by: rmtucker63

user2684 commented 7 years ago

Oh forgot to mention python ver:- Python 2.7.9 (default, Sep 17 2016, 20:26:04)

Original comment by: rmtucker63

user2684 commented 7 years ago

Thanks, looks like the python-requests package is not installed. True, I couldn't test the installation on many systems but I have always found it already pre-installed. Try with the following and then run myHouse manually again:

sudo apt-get install python-requests

Thanks

Original comment by: user2684

user2684 commented 7 years ago

There must be something bigger missing on a fresh rasbian install. I now get the following:-

pi@raspberrypi:~/myHouse $ sudo python myHouse.py
Traceback (most recent call last):
  File "myHouse.py", line 6, in <module>
    import utils
  File "/home/pi/myHouse/utils.py", line 19, in <module>
    import logger
  File "/home/pi/myHouse/logger.py", line 5, in <module>
    import config
  File "/home/pi/myHouse/config.py", line 2, in <module>
    import simplejson as json
ImportError: No module named simplejson
pi@raspberrypi:~/myHouse $ 

Original comment by: rmtucker63

user2684 commented 7 years ago

Somethings went defintely wrong while installing the dependencies, let's try manually for now and then I'll try to reproduce the same once I'll get a spare board. Go with a:

sudo pip install simplejson

and if something else is missing try with the same approach.

Thanks!

Original comment by: user2684

user2684 commented 7 years ago

Yes kept on doing it till i reached this:- Not sure where to go now. Luckily the pi is great for this just pop the card out and put my original domoticz card back in While i wait for a fix:

pi@raspberrypi:~/myHouse $ sudo python myHouse.py Traceback (most recent call last): File "myHouse.py", line 11, in import sensors File "/home/pi/myHouse/sensors.py", line 11, in import db File "/home/pi/myHouse/db.py", line 11, in import scheduler File "/home/pi/myHouse/scheduler.py", line 3, in from apscheduler.schedulers.background import BackgroundScheduler ImportError: No module named schedulers.background

Original comment by: rmtucker63

user2684 commented 7 years ago

Thanks for your patience with this first of all. Looks like the installation script installed none of the dependencies then. As a temporary workaround this is the list of commands to run (copy&paste) to install them all:

sudo apt-get update
sudo apt-get install -y redis-server
sudo apt-get install -y python-flask
sudo apt-get install -y python-redis
sudo apt-get install -y python-numpy
sudo apt-get install -y python-rpi.gpio
sudo pip install APScheduler
sudo pip install slackclient
sudo pip install simplejson
sudo pip install python-Levenshtein
sudo pip install fuzzywuzzy
sudo pip install pyicloud
sudo pip install motionless
sudo pip install flask-compress
sudo pip install jsonschema
sudo pip install paho-mqtt
sudo apt-get install -y mosquitto
sudo apt-get install -y libttspico-utils
sudo apt-get install -y python-opencv
sudo pip install gTTS
sudo apt-get install -y mpg123
sudo pip install SpeechRecognition
sudo apt-get install -y sox
sudo apt-get install -y flac
sudo apt-get install -y pocketsphinx
sudo pip install Adafruit_Python_DHT
sudo pip install Adafruit_ADS1x15
sudo apt-get install -y python-feedparser

Then running myHouse manually should work :-)

If time allows, after that would be great if you can change "debug" from False to True at the beginning of install.py, run it again with sudo and save the output somewhere. In this way we can see the output of each command and the error that is for sure thrown somewhere by the installation script.

Original comment by: user2684

user2684 commented 7 years ago

Right just bear with me. I will re-format the card from scratch and re-install. I just had a thought maybe i am wrong but is pip installed on rasbian? I will let you know when i am ready.

Original comment by: rmtucker63

user2684 commented 7 years ago

After a fresh install if i type pip at the command prompt it does not exist?

Original comment by: rmtucker63

user2684 commented 7 years ago

i have done a sudo apt-get install python-pip. I will now run install.py with debug turned on.

Original comment by: rmtucker63

user2684 commented 7 years ago

Here is the attatched debug from the install. I can now see the web interface even though it looks like there were some errors in the debug.

Original comment by: rmtucker63

user2684 commented 7 years ago

I get this in the web interface. Does it look correct for a straight copy of the example json? I presume there is a lot missing because it is not setup correctly?

Original comment by: rmtucker63

user2684 commented 7 years ago

Hi Mark, thanks again for helping me troubleshoting this! So looks like python-pip is not installed on a vanilla raspian (strange it was there in the few systems I got this installed). I'll fix this. Looking at the logs, I've noticed there is another package missing, required for compiling some of the python modules:

sudo apt-get install python-dev

After installing it, I'd be better to run the installation script again (it is safe to run it multiple times), it should fix some of the broken modules which could be problematic later on.

The web interface in front of you is expected and not caused by an incorrect setup. It is limited since most of the modules in the configuration file are not enabled because require some customizations first. Let me know of course if you need any help with the configuration. Thanks

Original comment by: user2684

user2684 commented 7 years ago

No Problem. Anyway i know i will need a lot of help understanding the config !!! python-pip maybe on the full rasbian image (with the frontend etc) but it is not on the lite version. see here:- https://www.raspberrypi.org/documentation/linux/software/python.md

The Raspi i keep using is my daughters kodi setup and she is in from school now so no more testing till she is at school in the morning sadly.(I have a Raspi3 in the post though so we can get down to some proper testing).

So if i run

sudo apt-get install python-dev

Then re-run

sudo python install.py

Do you want the debug log again?

Original comment by: rmtucker63

user2684 commented 7 years ago

Got it, so I'll need to both add python-pip and python-dev to the installation script to make this working on the lite versoin. I'll keep this ticket open as a reminder. No need for the debug log this time :-) Thanks

Original comment by: user2684

user2684 commented 7 years ago

Where is the best place to ask questions about the config (setting up wunderground) etc. Or do i just raise a ticket? Just thought because i have an api key it would be a good example.

Original comment by: rmtucker63

user2684 commented 7 years ago

It would be probably easier to use the forum just created: https://sourceforge.net/p/my-house/forum/general/ Generally speaking, start setting up the api key in plugins->wunderground, then set general->latitude and general->longitude and finally review the "outdoor" module. Start by enabling it and then review all the configured sensors and widgets.

Thanks

Original comment by: user2684

user2684 commented 7 years ago

Original comment by: user2684