lucacalcaterra / risco-mqtt-bridge

Risco Alarm panel to MQTT Server Bridge
MIT License
25 stars 9 forks source link

State not always updating, timeout/lag for a few minutes #12

Closed pergolafabio closed 5 years ago

pergolafabio commented 5 years ago

Luca

I have one issue though with the mqtt alarm

Sometimes the state like armed / disarmed … comes it with a lag, sometimes 3-4 minutes after the alarm has armed or disarmed I see the state changing…. If I then do it again in the irisco app, the state is then almost instantly

I don’t know where the issue is, in your polling? In mqtt sending to HA … can I enable logging somewhere too see what the issue is next time?

Does this sounds familiar?

how can i enable logging? the logs in log folder are only logging issues/errors , so not relevant to this issue

lucacalcaterra commented 5 years ago

@pergolafabio Tnx for feedback.

Are you logs empty ?

In this case, the level log is set to print only warn and errors only.

Change the env on Node.js to development (set NODE_ENV=development in Windows, export NODE_ENV=development in Linux) and restart you app, so logs are on DEBUG level.

If there are no exceptions, is difficult to troubleshoot it

pergolafabio commented 5 years ago

hmm, i installed node v8 directly on a synology so i need to find that Node.js file somewhere :)

the debug mode, is not something i can enable in your package? i needs to be done in node.js itself ?

pergolafabio commented 5 years ago

look in screenshot, what node.js file need i to edit? probably one in the v8 dir, but witch one? the last one in install dir?

https://www.dropbox.com/s/4wqltugqlpbjyzz/nodejs.JPG?dl=0

lucacalcaterra commented 5 years ago

Can you find the project dir on your synology ? Inside logs folder should be there two files . Check them

lucacalcaterra commented 5 years ago

ps i suggest you docker

pergolafabio commented 5 years ago

yes; not used docker yet, no time to setup :)

in your project dir i also see lots of node.js files this one probably?

/node_modules/debug/node.js

see screenshot https://www.dropbox.com/s/f5m4i3koct1i5fm/node2.JPG?dl=0

lucacalcaterra commented 5 years ago

Any way your project is running under docker (as you can see from path :-) ) Check the this path: ./volume1/docker/risco/risco-mqtt-bridge/logs . Exists ? Should be there two log files

pergolafabio commented 5 years ago

yes, there are 2 files there but no errors there, it only logs when there is an error like , was a while ago

10-01-2019 22:41:24 error: error! Cannot connect to MQTT Server: Error: Connection refused: Not authorized

10-01-2019 22:42:20 info: Arming status: disarmed 10-01-2019 22:42:20 info: publish messages on MQTT Server

verry strange i dont have new log files, since we had a power interruption this weekend and i needed to reboot my synology last log is froma month ago

pergolafabio commented 5 years ago

hmm, maybe it doesnt update my logs, since i start it with a script file upon boot with synology, i have a task created there, that needs to run upon boot

in the .sh file i have entered :

exec node /volume1/docker/risco/risco-mqtt-bridge/app.js

is it maybe why no log files are being created?

pergolafabio commented 5 years ago

an no, you see indeed a docker path, but thats just a share :) where i have other things running on it so no, not using docker :), just the startup script

pergolafabio commented 5 years ago

ok, for testing i killed my .sh script, and did fire this manually in putty

node /volume1/docker/risco/risco-mqtt-bridge/app.js

i see now debugging come through, but log files are not updated

lucacalcaterra commented 5 years ago

ok, so follow the previous post about setting node environment to development

pergolafabio commented 5 years ago

... yes, but i still dont know in what file i need to change the environment to development i have dozens of node.js files

pergolafabio commented 5 years ago

hmm, trying to setup your docker in the docker app on my synology but cant start it ...

this error : Error: Cannot find module './config/config.js'

not sure what i am doint wrong in the setup do you see any error in my config?

that file /folder in left column is a local folder on synology https://www.dropbox.com/s/nrqqvatqvk197yw/risco1.JPG?dl=0 https://www.dropbox.com/s/tse5suinsidbut1/risco2.JPG?dl=0

lucacalcaterra commented 5 years ago

You must copy a config.js with your parameter and mount as volume; on the second screenshoot , if you read well you've mounted a config folder.... instead you must mount config.js file in the host

Il giorno lun 4 feb 2019 alle ore 13:45 pergolafabio < notifications@github.com> ha scritto:

hmm, trying to setup your docker in the docker app on my synology but cant start it ...

this error : Error: Cannot find module './config/config.js'

not sure what i am doint wrong in the setup do you see any error in my config?

that file /folder in left column is a local folder on synology https://www.dropbox.com/s/nrqqvatqvk197yw/risco1.JPG?dl=0 https://www.dropbox.com/s/tse5suinsidbut1/risco2.JPG?dl=0

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/lucacalcaterra/risco-mqtt-bridge/issues/12#issuecomment-460236702, or mute the thread https://github.com/notifications/unsubscribe-auth/AA1s0U-zznaaz5IrNysCsBC6eva8DU5yks5vKCtMgaJpZM4ag1DA .

pergolafabio commented 5 years ago

ok, missed that :) now its started, changed environment to development i now see log filling in the docker app 👍 https://www.dropbox.com/s/bjy28w68kx3e4fq/luca1.JPG?dl=0 i have mounted also the log folder, but that folder stays empty is that normal? https://www.dropbox.com/s/bjy28w68kx3e4fq/luca1.JPG?dl=0

i think we have enough, because i can see logging now in the docker app itself? is that good enough now for troubleshootin?

lucacalcaterra commented 5 years ago

You should see the files... try to add s char to log on the host folder (you have log instead of logs); don't think it's fix but try; check the permissions too.

If it's sufficient for troubleshooting ? Difficult to say... check the logs at the moment when the issue of delay occours.

pergolafabio commented 5 years ago

the folder locally, is actually "log" so thats correct also excecuted now in high permission, but doesnt help but lets wait before the next issue arrives, we will see then

lucacalcaterra commented 5 years ago

the folder locally, is actually "log" so thats correct also excecuted now in high permission, but doesnt help but lets wait before the next issue arrives, we will see then

OK

pergolafabio commented 5 years ago

new clean thread here https://github.com/lucacalcaterra/risco-mqtt-bridge/issues/13