Page 29 of 55

Re: [MyDomoAtHome] Support thread

Posted: Monday 18 April 2016 14:41
by lowca
Thx.,
I have some problems., mdah crash if i dont have any camera and room plan...
Maybe its something with my db..

Re: [MyDomoAtHome] Support thread

Posted: Monday 18 April 2016 16:03
by epierre
sorry I've seen that, will fix that tonight.

in the meantime:

sudo apt-get install MyDomoAtHome=0.1.22

Re: [MyDomoAtHome] Support thread

Posted: Monday 18 April 2016 21:44
by epierre
ok new version with standalone auth and auto to domoticz (thanks to spawnrider):

It works in a "key":"value" mode. Basic value is:

{
"app_name": "MyDomoAtHome",
"auth": null,
"domoticz": {
"ssl": false,
"host": "127.0.0.1",
"port": "8080",
"path": "/",
"auth": null,
},
"port": "3002",
"passcode": ""
}

- multi-instances: just change the app_name tag between instances
- change the MDAH port: change the basic (top level) port (here 3002)
- protected device code: change the passcode above
- access domoticz in ssl mode: change domoticz:port and ssl to true
- change domoticz host or port: do it on domoticz:host and domoticz.port
- add a login/pass to access MDAH:change top-level "auth": null to "auth": { "username": "admin", "password": "admin" },
- manage login/pass on domoticz, do the same in domoticz:path

Re: [MyDomoAtHome] Support thread

Posted: Monday 18 April 2016 22:27
by lowca
Thx great work !
But in my system still crash without rooms ... (no camera ok)..

Re: [MyDomoAtHome] Support thread

Posted: Monday 18 April 2016 23:21
by naitsirhc
Hi epierre,

Thanks for your answer.
Did the steps again and am pleased to say, it works (although the HTTPS part)
When I type https://****.no-ip.biz I can see my domoticz homepage.

Unfortunatly I don't get the part:
In the domoticz configuration add a section to redirect to the gateway such as this (change your ip below),
Do I have to add:

location /iss/ {
proxy_pass http://10.0.0.170:3001/;
acces_log /......
error_log /.....
(because I want to test without a password, I deleted
auth_basic "Access Restricted";
auth_basic_user_file "/etc/nginx/.htpasswd";)

in /etc/nginx/sites-available/domoticz?????

Do I have to delete the other location? (127.0.0.1)

and create a .htpasswd for both (using htpasswd from package apache2-utils => htpasswd -c .htaccess YOURusername YOURpasswd)

And how to create the .htpasswd?

Are these the only steps to go to connect Imperihome?

please tell me I'm very close :-)

Re: [MyDomoAtHome] Support thread

Posted: Tuesday 19 April 2016 7:13
by epierre
naitsirhc wrote:
and create a .htpasswd for both (using htpasswd from package apache2-utils => htpasswd -c .htaccess YOURusername YOURpasswd)

And how to create the .htpasswd?

Are these the only steps to go to connect Imperihome?

please tell me I'm very close :-)
Hello,

From yesterday's version you don't need to make this step, just add (see here in section config.json https://github.com/empierre/MyDomoAtHome) :
{
"app_name": "MyDomoAtHome",
"auth": "auth": { "username": "admin", "password": "admin" },
"domoticz": {
"ssl": false,
"host": "127.0.0.1",
"port": "8080",
"path": "/",
"auth": null
},
"port": "3002",
"passcode": ""
}
change login/pass here ;-)

Re: [MyDomoAtHome] Support thread

Posted: Tuesday 19 April 2016 10:07
by ahmedadelhosni
Hello all,

On last Friday I followed the wiki and after a lot of tries the Imperihome was working very well with Domoticz. I tried after all to follow the secure remote access but failed, and on Sunday I suddenly found the Application not working at all. After many tries I decided to create a new raspain jessie image !

Now I am following again the steps in the wiki in here https://www.domoticz.com/wiki/ImperiHome

I installed all required packages and restarted mydomoathome but still when I connet through the App i get this error :
Unnable to connect. Please check your parameters.

my Local API Base Url is : http://192.168.0.4:3002/

my /etc/mydomoathome/config.json

{
"app_name": "MyDomoAtHome",
"auth": null,
"domoticz": {
"ssl": false,
"host": "192.168.0.4",
"port": "8080",
"path": "/",
"auth": null,
},
"port": "3002",
"passcode": ""
}

My domoticz.sh :
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
DESC="Domoticz Home Automation System"
NAME=domoticz
USERNAME=pi
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

DAEMON=/home/$USERNAME/domoticz/$NAME
DAEMON_ARGS="-daemon"
#DAEMON_ARGS="$DAEMON_ARGS -daemonname $NAME -pidfile $PIDFILE"
DAEMON_ARGS="$DAEMON_ARGS -www 8080"
DAEMON_ARGS="$DAEMON_ARGS -sslwww 443"
#DAEMON_ARGS="$DAEMON_ARGS -log /tmp/domoticz.txt"
#DAEMON_ARGS="$DAEMON_ARGS -syslog"



If I go to : http://192.168.0.4:8080/json.htm?type=d ... order=Name
I can find outputs in the browser

If I go to : http://192.168.0.4:8080/devices
I get Domoticz offline from the browser.

The Domoticz App itself is working well.


I am out of ideas !!

THanks.

Re: [MyDomoAtHome] Support thread

Posted: Tuesday 19 April 2016 10:17
by epierre
@ahmedadelhosni sorry, an error in the example above corrected, please remove the extra coma withing the domoticz block:
"auth": null, <-- this one

also if it does not start, check /var/log/mydomoathome

Re: [MyDomoAtHome] Support thread

Posted: Tuesday 19 April 2016 10:31
by ahmedadelhosni
epierre wrote:@ahmedadelhosni sorry, an error in the example above corrected, please remove the extra coma withing the domoticz block:
"auth": null, <-- this one

also if it does not start, check /var/log/mydomoathome
Great. At last it can see my device and the system is added.

Still there is problem in the app now. A pop up window says "MyDodoAtHome (ImperiHome Standard System) : iss : Could not get devices infos."
Also another pop up error window : Multiple local error for 'MyDomoAtHome' . Falling back to remote mode.
Still trying to debug

Thanks for the quick help

Re: [MyDomoAtHome] Support thread

Posted: Tuesday 19 April 2016 10:36
by epierre
ahmedadelhosni wrote:
epierre wrote:@ahmedadelhosni sorry, an error in the example above corrected, please remove the extra coma withing the domoticz block:
"auth": null, <-- this one

also if it does not start, check /var/log/mydomoathome
Great. At last it can see my device and the system is added.

Still there is problem in the app now. A pop up window says "MyDodoAtHome (ImperiHome Standard System) : iss : Could not get devices infos."

Still trying to debug

Thanks for the quick help
check the logs, there could be two processes running or ... this message is just saying the Imperihome application cannot connect the MDAH gateway

Re: [MyDomoAtHome] Support thread

Posted: Tuesday 19 April 2016 10:42
by epierre
@naitsirhc what are you trying to make ? both ssl + login/pass ?

a full SSL for domoticz and MDAH could be:

Code: Select all

access_log off;
 add_header Cache-Control public;
 server_tokens off;
 server  {
   include    /etc/nginx/proxy_params;
   listen 443 ssl;                                          #<== 443 is the default SSL port, change by another port if desired
   keepalive_timeout 70;
   server_name localhost (my_DDNS);      #<== here put domain names (without https://) separated by spaces
   ssl on;
   ssl_certificate             /etc/ssl/ca/server.crt;
   ssl_certificate_key         /etc/ssl/ca/server.key;
   ssl_client_certificate /etc/ssl/ca/ca.crt;
   ssl_verify_client on;
   add_header X-Frame-Options SAMEORIGIN;
   location / {
     proxy_pass http://(DOMOTICZ_IP):8080/;
     access_log /var/log/nginx/domoticz.access.log;
     error_log /var/log/nginx/domoticz.error.log;
    }
location /iss/ {
    proxy_pass http://(MDAH_IP):3002/;
    auth_basic            "Access Restricted";
    auth_basic_user_file  "/etc/nginx/.htpasswd";
    access_log /var/log/nginx/domoticz.access.log;
    error_log /var/log/nginx/domoticz.error.log;
   }
 }

Re: [MyDomoAtHome] Support thread

Posted: Tuesday 19 April 2016 10:42
by ahmedadelhosni
Well I checked the mentioned path in usage.log

This is the output each time I reload the APP.

Code: Select all

{"url":"http://192.168.0.4:8080/json.htm?type=devices&filter=utility&order=Name","headers":{"User-Agent":"request"},"level":"info","message":"","timestamp":"2016-04-19T08:41:59.359Z"}
{"level":"info","message":"Domoticz server: http://192.168.0.4:8080/json.htm","timestamp":"2016-04-19T08:42:03.846Z"}
{"level":"info","message":"Node version: 4.2.2","timestamp":"2016-04-19T08:42:03.870Z"}
{"level":"info","message":"MDAH version: MyDomoAtHome 0.1.27","timestamp":"2016-04-19T08:42:03.873Z"}
{"level":"info","message":"OS version: Linux linux 4.1.13-v7+","timestamp":"2016-04-19T08:42:03.877Z"}
{"level":"info","message":"Hostname: raspberrypi 192.168.0.4 in /var/www","timestamp":"2016-04-19T08:42:03.884Z"}
{"level":"info","message":"MDAH port: 3002","timestamp":"2016-04-19T08:42:03.929Z"}

Re: [MyDomoAtHome] Support thread

Posted: Tuesday 19 April 2016 10:47
by epierre
ahmedadelhosni wrote:Well I checked the mentioned path in usage.log

This is the output each time I reload the APP.
looks fine, still connectivity issue ?

don't reload the app if this is the only message you get

Re: [MyDomoAtHome] Support thread

Posted: Tuesday 19 April 2016 11:08
by ahmedadelhosni
Actually no devices are shown yet. Domoticz App can see devices well.

This for example works fine: http://192.168.0.4:8080/json.htm?type=c ... tchcmd=Off

Code: Select all

{
   "status" : "OK",
   "title" : "SwitchLight"
}
These are the running processes:

Code: Select all

pi@raspberrypi:~/domoticz $ ps aux | grep mydomo
www-data  1641  0.0  0.2   4596  2372 ?        Ss   11:05   0:00 /bin/bash /usr/share/mydomoathome/bin/mydomoathome
www-data  1644  2.7  3.1 123116 29452 ?        Sl   11:05   0:03 node /usr/local/bin/forever --minUptime 1000 --spinSleepTime 1000 --max-old-space-size=128 /usr/share/mydomoathome/app/mdah.js
www-data  1667  4.5  3.9 130452 37816 ?        Sl   11:05   0:04 /usr/bin/node /usr/share/mydomoathome/app/mdah.js
pi        1684  0.0  0.2   4260  1912 pts/0    S+   11:07   0:00 grep --color=auto mydomo


Re: [MyDomoAtHome] Support thread

Posted: Tuesday 19 April 2016 11:11
by epierre
ahmedadelhosni wrote:Actually no devices are shown yet. Domoticz App can see devices well.

This for example works fine: http://192.168.0.4:8080/json.htm?type=c ... tchcmd=Off

Code: Select all

pi@raspberrypi:~/domoticz $ ps aux | grep mydomo
www-data  1641  0.0  0.2   4596  2372 ?        Ss   11:05   0:00 /bin/bash /usr/share/mydomoathome/bin/mydomoathome
www-data  1644  2.7  3.1 123116 29452 ?        Sl   11:05   0:03 node /usr/local/bin/forever --minUptime 1000 --spinSleepTime 1000 --max-old-space-size=128 /usr/share/mydomoathome/app/mdah.js
www-data  1667  4.5  3.9 130452 37816 ?        Sl   11:05   0:04 /usr/bin/node /usr/share/mydomoathome/app/mdah.js
pi        1684  0.0  0.2   4260  1912 pts/0    S+   11:07   0:00 grep --color=auto mydomo

Can you access : http://192.168.0.4:3002/ if yes try the links in it to see devices

Re: [MyDomoAtHome] Support thread

Posted: Tuesday 19 April 2016 11:14
by ahmedadelhosni
epierre wrote:
ahmedadelhosni wrote:Actually no devices are shown yet. Domoticz App can see devices well.

This for example works fine: http://192.168.0.4:8080/json.htm?type=c ... tchcmd=Off

Code: Select all

pi@raspberrypi:~/domoticz $ ps aux | grep mydomo
www-data  1641  0.0  0.2   4596  2372 ?        Ss   11:05   0:00 /bin/bash /usr/share/mydomoathome/bin/mydomoathome
www-data  1644  2.7  3.1 123116 29452 ?        Sl   11:05   0:03 node /usr/local/bin/forever --minUptime 1000 --spinSleepTime 1000 --max-old-space-size=128 /usr/share/mydomoathome/app/mdah.js
www-data  1667  4.5  3.9 130452 37816 ?        Sl   11:05   0:04 /usr/bin/node /usr/share/mydomoathome/app/mdah.js
pi        1684  0.0  0.2   4260  1912 pts/0    S+   11:07   0:00 grep --color=auto mydomo

Can you access : http://192.168.0.4:3002/ if yes try the links in it to see devices
I can acess the link.

I can see results in http://192.168.0.4:8080/json.htm?type=devices

I can not reach this: http://192.168.0.4:3002/devices

Re: [MyDomoAtHome] Support thread

Posted: Tuesday 19 April 2016 11:18
by epierre
@ahmedadelhosni what gives:

curl 'http://192.168.0.4:3002/devices'

anything in the logs ?

Re: [MyDomoAtHome] Support thread

Posted: Tuesday 19 April 2016 14:49
by lowca
@epierre
mdah 0.1.27 no room in room plan = crash ...
/usr/share/mydomoathome/app/mdah.js:1608
With empty room work ok ., but maybe it's a problem also for other users.. :?:

Re: [MyDomoAtHome] Support thread

Posted: Tuesday 19 April 2016 15:01
by epierre
@lowca thanks for reporting, I'll correct that ;-)

Re: [MyDomoAtHome] Support thread

Posted: Tuesday 19 April 2016 22:56
by lowca
@epierre
0.1.28 rooms ok :) Thx ..
When installed on new system ., still problem with
"auth": null, <-- this one extra coma