LowPowerLab Forum

Software support => Pi Gateway => Topic started by: Richelsdorfite on April 21, 2017, 01:24:05 PM

Title: Waiting for socket connection [solved]
Post by: Richelsdorfite on April 21, 2017, 01:24:05 PM
Hi,

I try to install IoT Gateway.

My setup is:

- Raspi 3
- Linux Pi 4.4.50-v7+ #970 SMP Mon Feb 20 19:18:29 GMT 2017 armv7l GNU/Linux
- PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)" NAME="Raspbian GNU/Linux" VERSION_ID="8" VERSION="8 (jessie)"
- Raspberry Pi reference 2017-03-02 Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, f563e32202fad7180c9058dc3ad70bfb7c09f0fb, stage4


During the setup (sudo bash gatewaysetup.sh && sudo rm gatewaysetup.sh) I catch something like npm WARN package.json

As I try to connect with Chrome or IE but : "Waiting for socket connection..."

I edit /bott/config.txt and change enable_uart=1 to 1

I edit /home/pi/gateway/logs/gateway.sys.log and find this log :
module.js:327
    throw err;
    ^

Error: Cannot find module 'async'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/home/pi/gateway/node_modules/nconf/lib/nconf.js:9:13)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)


How can I fix this ?

Yours,

Michel
Title: Re: Waiting for socket connection..
Post by: Felix on April 21, 2017, 01:52:54 PM
Did you use the setup script (https://github.com/LowPowerLab/RaspberryPi-Gateway/blob/master/.setup/gatewaysetup.sh) to install it?
Not 100% sure what your distro is, did you install latest raspbian-jessie from here (https://www.raspberrypi.org/downloads/raspbian/)?

In your case it looks like some packages are missing.

I just tried it on a Pi3 and it works. The npm WARN is ok.
Title: Re: Waiting for socket connection..
Post by: Richelsdorfite on April 21, 2017, 02:11:27 PM
Did you use the setup script to install it? Yes from https://lowpowerlab.com/guide/gateway/?view=all#setup-software (https://lowpowerlab.com/guide/gateway/?view=all#setup-software) and sudo wget https://raw.githubusercontent.com/LowPowerLab/RaspberryPi-Gateway/master/.setup/gatewaysetup.sh[/color]

Not 100% sure what your distro is, did you install latest raspbian-jessie from here? I used Pibakery and kernel version seems to be good: 4.4
Title: Re: Waiting for socket connection..
Post by: Richelsdorfite on April 21, 2017, 02:23:18 PM
As for now, I am not using a Moteino so there is no serial com.
Title: Re: Waiting for socket connection..
Post by: Felix on April 21, 2017, 02:56:58 PM
No moteino is OK, you should see no nodes/data.
Can you please try the official distribution?
PiBakery may use an older distribution and if you dont update it, problems can surface.
Title: Re: Waiting for socket connection..
Post by: Richelsdorfite on April 21, 2017, 03:14:22 PM
I just install May 27 2016 Jessie Lite image and use the script to install the Gateway.

Chrome/IE always prompt "Waiting for socket connection.. "

Am I missing something ?
Title: Re: Waiting for socket connection..
Post by: Richelsdorfite on April 21, 2017, 03:15:16 PM
Quote from: Felix on April 21, 2017, 02:56:58 PM
No moteino is OK, you should see no nodes/data.
Can you please try the official distribution?
PiBakery may use an older distribution and if you dont update it, problems can surface.

I will try tomorrow morning.
Title: Re: Waiting for socket connection..
Post by: Felix on April 21, 2017, 03:54:47 PM
The image may or not be good. Not sure, I mentioned that I tried it on the latest with a Pi3, and it works. So ... rather than debugging why it doesnt work on older images, lets go from a known working point.
Title: Re: Waiting for socket connection..
Post by: Richelsdorfite on April 22, 2017, 03:47:37 AM
Good advice  :)

I am trying !

And with the last raspbian-jessie it's working !!!

As I config my raspi through SSH, the new raspbian distrib install disable SSH. So to enable it :
- with Notepad / Notepad++ or others, create an empty file named SSH.txt
- rename SSH.txt to SSH without .txt extension
- copy this file the top level folder of the sd card (root partition)
- then eject card and insert it into raspi slot.

SSH  is enable !

So, with last Jessie.img, the installation of IOTGateway advocating anything else than :
- Download last Jessie.img
- Enable SSH
- Enbale Wi-fi connection if used
- Run script like Felix website https://lowpowerlab.com/guide/gateway/?view=all#setup-software (https://lowpowerlab.com/guide/gateway/?view=all#setup-software)
cd /home/pi
sudo wget https://raw.githubusercontent.com/LowPowerLab/RaspberryPi-Gateway/master/.setup/gatewaysetup.sh
sudo bash gatewaysetup.sh && sudo rm gatewaysetup.sh



Thanks a lot Felix !

Now, I can play with Moteino !
Title: Re: Waiting for socket connection..
Post by: Felix on April 23, 2017, 08:05:45 AM
Awesome, thanks for the update!