Solved - Pi 3 manual install webapp issues

General Discussion

Solved - Pi 3 manual install webapp issues

Postby timlegge » Sun Apr 10, 2016 6:03 am

Hi

As mentioned in a previous post I have gotten a Pi3 to talk to the AD2PI via ser2sock and can see events when I telnet to the device on port 10000.

If I issue a 'C' via telnet I get the Config results:

!CONFIG>ADDRESS=18&CONFIGBITS=ff00&LRR=N&EXP=NNNNN&REL=NNNN&MASK=ffffffff&DEDUPLICATE=N

In the webapp I see the log show:

2016-4-10 10:39:31 arm The alarm system has been armed.
2016-4-10 10:12:56 disarm The alarm system has been disarmed.
2016-4-9 23:43:31 arm The alarm system has been armed.

However the keypad shows: Please wait Loading and the diagnostics will not open the device

ser2sock is running as the pi user
gunicorn appears twice in a ps output the first process is run by root the second is run by the pi user. I assume that root started the process to open 443 and then changed the owner to be pi.

any ideas where to look?

See post 10 viewtopic.php?f=3&t=282&start=10#p1584
Tim
Last edited by timlegge on Wed Apr 13, 2016 4:45 pm, edited 1 time in total.
timlegge
Junior Nut
Junior Nut
 
Posts: 31
Joined: Sat Apr 09, 2016 5:33 pm

Re: Pi 3 manual install webapp issues

Postby timlegge » Sun Apr 10, 2016 6:07 am

Also, maybe related:
tail -f /var/log/nginx/error.log

2016/04/10 11:06:30 [error] 6016#0: *23 upstream prematurely closed connection while reading response header from upstream, client: 192.168.10.40, server: , request: "GET /socket.io/1/?t=1460297190916 HTTP/1.1", upstream: "http://127.0.0.1:5000/socket.io/1/?t=1460297190916", host: "192.168.10.113", referrer: "https://192.168.10.113/keypad/"
timlegge
Junior Nut
Junior Nut
 
Posts: 31
Joined: Sat Apr 09, 2016 5:33 pm

Re: Pi 3 manual install webapp issues

Postby kevin » Sun Apr 10, 2016 9:09 am

Check your nginx version - and reinstall according to manual install instructions. The nginx version that ships with the pi is very old and doesn't support the websockets.
Not an employee of the company. Just here to help and keep things clean.
kevin
Platinum Nut
Platinum Nut
 
Posts: 994
Joined: Fri Aug 16, 2013 10:10 am

Re: Pi 3 manual install webapp issues

Postby timlegge » Sun Apr 10, 2016 10:12 am

I believe that the instructions say 1.7.4

raspberrypi:~ $ /usr/sbin/nginx -v
nginx version: nginx/1.7.4
pi@raspberrypi:~ $

I can install the most recent if that is better.

Tim
timlegge
Junior Nut
Junior Nut
 
Posts: 31
Joined: Sat Apr 09, 2016 5:33 pm

Re: Pi 3 manual install webapp issues

Postby kevin » Sun Apr 10, 2016 12:44 pm

1.7.4 is good - it's gotta be something else. You can control it via ser2sock, so that is good - it's gotta be something with the gunicorn worker (that duplicate processes is a little odd to me) or something else. Can you confirm how you went through setup? If the ad2pi is local to the raspberry pi you are running the webapp on, you should choose "Local Device" in setup, and check "Share device on network" to enable ser2sock sharing. The only other thing I can think of is settings for host/IP address/ports in setup. Potentially a browser issue not being able to use websocket, but I would not put that at the top of the list.

Does it work correctly if you bypass nginx? http://<pi ip address>:5000
Not an employee of the company. Just here to help and keep things clean.
kevin
Platinum Nut
Platinum Nut
 
Posts: 994
Joined: Fri Aug 16, 2013 10:10 am

Re: Pi 3 manual install webapp issues

Postby timlegge » Sun Apr 10, 2016 5:13 pm

Hi

I followed the instructions on the git page: https://github.com/nutechsoftware/alarmdecoder-webapp to do the install

Th AD2PI is installed on the raspberry pi that is running the entire install. My web browser is on another computer accessing the webapp via its IP address.

Yes, http://<pi ip address>:5000 works fine (it brings the web page)

I have noticed that if I chaek the modules under diagonistics I see the following in Red:

distutils cffi PIL speaklater
cookielib
usb google
compileall html5lib dateutil ujson
chardet optparse Crypto
requests
pycparser
Cookie dns simplejson imghdr
pycurl
FixTk sndhdr distlib
getopt csv pyftdi urllib3 lxml
colorama bz2 xmlrpclib

Tim
timlegge
Junior Nut
Junior Nut
 
Posts: 31
Joined: Sat Apr 09, 2016 5:33 pm

Re: Pi 3 manual install webapp issues

Postby timlegge » Sun Apr 10, 2016 7:00 pm

Hi

Also when connected to:http://alarmdecoder.local:5000

I see the following in the browser's dev tools

GET http://alarmdecoder.local:5000/socket.i ... 0343580434 net::ERR_EMPTY_RESPONSE

It seems like the socket.io is not responding correctly

Tim
timlegge
Junior Nut
Junior Nut
 
Posts: 31
Joined: Sat Apr 09, 2016 5:33 pm

Re: Pi 3 manual install webapp issues

Postby kevin » Sun Apr 10, 2016 7:30 pm

Please verify the settings you used in webapp setup

You can ignore those "missing modules" those are irrelevant.
Not an employee of the company. Just here to help and keep things clean.
kevin
Platinum Nut
Platinum Nut
 
Posts: 994
Joined: Fri Aug 16, 2013 10:10 am

Re: Pi 3 manual install webapp issues

Postby timlegge » Sun Apr 10, 2016 7:53 pm

Device ad2pi
Location local device
Path /dev/ttyAMA0
Speed 115200
Share checked
Ser2sock path /etc/Ser2sock
Address 127.0.0.1
Port 10000
Encrypt not checked
Panel honeywell
Alarm mask fffffff
Web app mask fffffff

Tim
timlegge
Junior Nut
Junior Nut
 
Posts: 31
Joined: Sat Apr 09, 2016 5:33 pm

Re: Pi 3 manual install webapp issues

Postby kevin » Sun Apr 10, 2016 8:56 pm

Try switching that '127.0.0.1' to 'alarmdecoder.local' and see if that helps with the websocket connection. I have a feeling the 'localhost' value there doesn't route correctly through.
Not an employee of the company. Just here to help and keep things clean.
kevin
Platinum Nut
Platinum Nut
 
Posts: 994
Joined: Fri Aug 16, 2013 10:10 am

Next

Return to General

Who is online

Users browsing this forum: No registered users and 4 guests

cron