Main Menu

Raspberry pi 3

Started by microblades, November 06, 2016, 10:26:52 PM

microblades

I'm really new to all of this...but I still decided to dive in to getting the gateway working on a pi3.

So far, I seem to have most everything working, up to my current problem. :)

I'm able to run gateway.js without any further errors. But I'm seeing the "Waiting for socket connection.." on the webpage. In the chrome javascript console I'm showing 2 errors:

"Failed to load resource: the server responded with a status of 502 (Bad Gateway) https://192.168.1.15/socket.io/socket.io.js"
"(index):483 Uncaught ReferenceError: io is not defined(...)"

I'm assuming the second error is related to the first error. I am running current versions of all software and socket.io.js.

A note on the launch of gateway.js: on launch I'm not a lot of messages in the console. Seems there should be more, but maybe not. The output is below, and that's all I'm currently seeing:

pi@raspberrypi:~/gateway $ [11-06-16_19:16:08.871] [INFO]  LOADING USER METRICS...
[11-06-16_19:16:08.885] [INFO]  NO USER METRICS DEFINED (dir: /userMetrics), SKIPPING

Any help would be appreciated...and some understanding that I'm less than an amature. lol :)

redpoll123

I have installed the gateway software on a Raspberry Pi 3.
and also have come up against the "Waiting for socket connection.." on the webpage.
Same errors in the chrome javascript console.
The gateway.js starts and runs with no errors.

When the webpage is loaded the nginx default.error.log has an entry like this

2016/11/06 21:44:14 [error] 545#0: *44 peer closed connection in SSL handshake while SSL handshaking to upstream,
client: 192.168.1.9, server: default, request: "GET /socket.io/socket.io.js HTTP/1.1", upstream: "https://127.0.0.1:8080/socket.io/socket.io.js",
host: "192.168.1.11", referrer: "https://192.168.1.11/"


Felix

I think these socket.io errors may have to do with different socket.io versions between the client and server. If you installed the socket.io server manually and it's the last version you may need to initialize it differently.
There's an expressjs branch you can take a look at. See the differences in socket.io init between the master and this branch. Also check the socket.io docs for the differences in init.
Otherwise you could install the older version on the server (v1.3.7) until I will update all the sources to work with the latest socket.io.

microblades

Thank you Felix. I'm going to try and spend some time on this over the next week or two. I've come across a few examples of later releases of socket.io and raspbian jessie. I'm going to start with those simplified versions, then incorporate what I learn in to the gateway stack.

I'm hoping somebody smarter than me chimes in that has already made some progress. :)