Page 1 of 1

AD2PI WebApp stuck on testing after DB init

PostPosted: Fri Mar 10, 2017 3:00 am
by darwin
Hi,

I lost my admin password, so I ran the manage.py script to re-init the database, as suggested in related topic in this forum to go through the configuration again. I got stuck on the Device Testing portion of the WebApp set up, it just does not finish. Running webApp version v0.7.1-0-g2e4492f.
I SSH into the Pi and I can telnet to the Alarm Decoder, I can read the configuration, reboot it, activate and deactivate the alarm, etc, so that works.
Any suggestions on what may be going on and how to fix it? Thank you.

Re: AD2PI WebApp stuck on testing after DB init

PostPosted: Fri Mar 10, 2017 3:55 am
by darwin
I kept trying to recover connectivity from the WebApp and now the device has become unresponsive. I will attempt a hard reset (removing power) to see if that get is unstuck.

Re: AD2PI WebApp stuck on testing after DB init

PostPosted: Fri Mar 10, 2017 10:06 am
by kevin
Are you using our official image or did you follow the manual instructions?

Please list the versions of installed packages as well as your alarmdecoder configuration

What portion of device testing fails? Send? Receive? Open? Do the logs say anything useful?

Re: AD2PI WebApp stuck on testing after DB init

PostPosted: Sat Mar 11, 2017 4:18 pm
by darwin
Hi Kevin,

I got a bundle from you and it is an official image (I did an upgrade from the WebApp) Now, at this point the communication with the Alarm decoder has stopped (it was working before, the WebApp was not, but now I cannot reach the Alarm Decoder), this is the output:
Code: Select all
pi@alarmdecoder:~ $ telnet localhost 10000
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
!
#
*

the !* and ^ is what I put in there to check if the Decoder was responding. Now, when I run the ser2sock this is the output:
Code: Select all
pi@alarmdecoder:~ $ ser2sock
ser2sock[1638]: [✔] Using config file: /etc/ser2sock/ser2sock.conf
ser2sock[1638]: [✔] Serial 2 Socket Relay version V1.5.2 starting
ser2sock[1638]: [✘] Fatal error binding to server port 10000 errno: 98
ser2sock[1638]: [✘] ERROR initializing listen socket :Address already in use
ser2sock[1638]: [✘] exiting

I cannot check the version of the AlarmDecoder because it is unresponsive
Code: Select all
pi@alarmdecoder:~ $ telnet localhost 10000
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
V

and the WebApp version is listed in the previous post.

Re: AD2PI WebApp stuck on testing after DB init

PostPosted: Sat Mar 11, 2017 4:34 pm
by darwin
One more thing, here is the output of nginx
Code: Select all
pi@alarmdecoder:~ $ sudo nginx
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] still could not bind()
pi@alarmdecoder:~ $

Re: AD2PI WebApp stuck on testing after DB init

PostPosted: Sat Mar 11, 2017 4:40 pm
by timlegge
Address is in use meens nginx is still running.

sudo nginx restart

darwin wrote:One more thing, here is the output of nginx
Code: Select all
pi@alarmdecoder:~ $ sudo nginx
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
)
nginx: [emerg] still could not bind()
pi@alarmdecoder:~ $

Re: AD2PI WebApp stuck on testing after DB init

PostPosted: Sat Mar 11, 2017 6:44 pm
by darwin
Thank you for your reply!. I don't think that is the issue. I stopped and restarted ser2sock, nginx and gunicorn, and after that reboot the pi, no change, still cannot telnet to the decoder.

Code: Select all
pi@alarmdecoder:~ $ sudo killall nginx
pi@alarmdecoder:~ $ sudo killall ser2sock
pi@alarmdecoder:~ $ sudo killall gunicorn
gunicorn: no process found
pi@alarmdecoder:~ $ sudo service ser2sock start
pi@alarmdecoder:~ $ sudo service nginx start
pi@alarmdecoder:~ $ sudo service gunicorn start
pi@alarmdecoder:~ $ ser2sock
ser2sock[1110]: [✔] Using config file: /etc/ser2sock/ser2sock.conf
ser2sock[1110]: [✔] Serial 2 Socket Relay version V1.5.2 starting
ser2sock[1110]: [✔] Listening socket created on port 10000
ser2sock[1110]: [✔] daemonizing the process
pi@alarmdecoder:~ $ telnet localhost 10000
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
*
^C


I can however "screen" into the serial port after killing ser2sock

Code: Select all
screen /dev/serial0 115200
!
!Ademco Keypad Emulator V2.2a.8.2
!Copyright (C) 2008-2015 Nu Tech Software Solutions, Inc.
!Reproduction without permission is prohibited
!By Sean Mathews <coder@f34r.com>
!For support email AlarmDecoder@support.nutech.com
!www.AlarmDecoder.com
!Reading configuration.
!UART init.
!Ready. Press ! for configuration.
[10010001000000003A--],002,[f70000008002001c08000000000000],"****DISARMED****  READY TO ARM  "

!VER:ffffffff,V2.2a.8.2,TX;RX;SM;VZ;RF;ZX;RE;AU;3X;CG;DD;MF;LR;KE;MK;CB;DS;ER
[10010001000000003A--],002,[f70000008002001c08000000000000],"****DISARMED****  READY TO ARM  "

so the UART seems to be working well.But looks like something in the configuration of the services is wrong. Thank you again for your help

Re: AD2PI WebApp stuck on testing after DB init

PostPosted: Sat Mar 11, 2017 11:10 pm
by kevin
Please check your ser2sock configuration file in /etc/ser2sock/ and make sure it is binding to the correct serial port

Also in the webapp if you do not have "Share decoder on your network" checked, the webapp will bind to the serial port directly and ser2sock will fail

As far as the other services "address already in use" usually indicates the services are already running and need to be stopped/started again.