Install seems o.k., but no web server online at the end

Hi. I have a Rpi3b, on which i already run Home Assistant and DSMR. I thought i would also try install WebThings on the Rpi3.

I’ve followed https://github.com/mozilla-iot/gateway . But at the end, when i try to access the server from a client (from my laptop), i can’t find the server. I’ve tried ip-address:8080, <…:4443:>, tried editting default.js and change the port to 8280 to see whether something else was in way.

I’ve run npm run debug: at some point, the lines on the console turn from black to grey, and it seems to stop at “Finished updating add-ons”… I did a “netstat -l” on the Rpi, where i do recognize Home Assistant and DSRM, but don’t see something that could be WebThings.

What can i check?

With netstat, I normally run

sudo netstat -nlp

This will show the processes that are listening. The gateway will show up as a process of ‘node’

You can also check the log files in ~/.mozilla-iot/log

Also, make sure that the gateway is actually running:

ps -ef | grep node

Make sure you’re using http://ip-address:8080 and https://ip-address:4443 (i.e. http versus https)

When you run the gateway from a self-install it typically runs webpack which can take a few minutes before the gateway starts listening on the TCP port.

If your ps shows webpack, then the gateway isn’t listening yet. If it shows something simpler (like node gateway.js) then the gateway is running.

Thank you for the help. sudo netstat -nlp gives

netstat -nlp output

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 192.168.1.134:51827 0.0.0.0:* LISTEN 535/python3
tcp 0 0 0.0.0.0:8180 0.0.0.0:* LISTEN 660/nginx: master p
tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN 559/dnsmasq
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 556/sshd
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 436/postgres
tcp 0 0 0.0.0.0:8123 0.0.0.0:* LISTEN 535/python3
tcp 0 0 0.0.0.0:1883 0.0.0.0:* LISTEN 387/mosquitto
tcp 0 0 0.0.0.0:445 0.0.0.0:* LISTEN 668/smbd
tcp 0 0 0.0.0.0:8000 0.0.0.0:* LISTEN 799/videop2proxy
tcp 0 0 127.0.0.1:59047 0.0.0.0:* LISTEN 535/python3
tcp 0 0 0.0.0.0:8554 0.0.0.0:* LISTEN 799/videop2proxy
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN 668/smbd
tcp6 0 0 :::53 :::* LISTEN 559/dnsmasq
tcp6 0 0 :::22 :::* LISTEN 556/sshd
tcp6 0 0 ::1:5432 :::* LISTEN 436/postgres
tcp6 0 0 :::1883 :::* LISTEN 387/mosquitto
tcp6 0 0 :::445 :::* LISTEN 668/smbd
tcp6 0 0 :::139 :::* LISTEN 668/smbd
udp 0 0 0.0.0.0:38231 0.0.0.0:* 799/videop2proxy
udp 0 0 0.0.0.0:47090 0.0.0.0:* 361/avahi-daemon: r
udp 0 0 0.0.0.0:53 0.0.0.0:* 559/dnsmasq
udp 0 0 0.0.0.0:67 0.0.0.0:* 559/dnsmasq
udp 0 0 0.0.0.0:68 0.0.0.0:* 528/dhcpcd
udp 0 0 192.168.1.255:137 0.0.0.0:* 665/nmbd
udp 0 0 192.168.1.122:137 0.0.0.0:* 665/nmbd
udp 0 0 192.168.1.255:137 0.0.0.0:* 665/nmbd
udp 0 0 192.168.1.134:137 0.0.0.0:* 665/nmbd
udp 0 0 0.0.0.0:137 0.0.0.0:* 665/nmbd
udp 0 0 192.168.1.255:138 0.0.0.0:* 665/nmbd
udp 0 0 192.168.1.122:138 0.0.0.0:* 665/nmbd
udp 0 0 192.168.1.255:138 0.0.0.0:* 665/nmbd
udp 0 0 192.168.1.134:138 0.0.0.0:* 665/nmbd
udp 0 0 0.0.0.0:138 0.0.0.0:* 665/nmbd
udp 0 0 224.0.0.50:9898 0.0.0.0:* 535/python3
udp 164032 0 0.0.0.0:5353 0.0.0.0:* 535/python3
udp 164032 0 0.0.0.0:5353 0.0.0.0:* 535/python3
udp 164032 0 0.0.0.0:5353 0.0.0.0:* 535/python3
udp 0 0 0.0.0.0:5353 0.0.0.0:* 535/python3
udp 164032 0 0.0.0.0:5353 0.0.0.0:* 535/python3
udp 164032 0 0.0.0.0:5353 0.0.0.0:* 535/python3
udp 164032 0 0.0.0.0:5353 0.0.0.0:* 535/python3
udp 0 0 0.0.0.0:5353 0.0.0.0:* 535/python3
udp 0 0 0.0.0.0:5353 0.0.0.0:* 361/avahi-daemon: r
udp6 0 0 :::53 :::* 559/dnsmasq
udp6 0 0 :::5353 :::* 361/avahi-daemon: r
udp6 0 0 :::50994 :::* 361/avahi-daemon: r
raw6 0 0 :::58 :::* 7 528/dhcpcd
Active UNIX domain sockets (only servers)
Proto RefCnt Flags Type State I-Node PID/Program name Path
unix 2 [ ACC ] STREAM LISTENING 7978 1/init /run/systemd/private
unix 2 [ ACC ] SEQPACKET LISTENING 7987 1/init /run/udev/control
unix 2 [ ACC ] STREAM LISTENING 12341 436/postgres /var/run/postgresql/.s.PGSQL.5432
unix 2 [ ACC ] STREAM LISTENING 7992 1/init /run/systemd/fsck.progress
unix 2 [ ACC ] STREAM LISTENING 8009 1/init /run/systemd/journal/stdout
unix 2 [ ACC ] STREAM LISTENING 11338 528/dhcpcd /var/run/dhcpcd.sock
unix 2 [ ACC ] STREAM LISTENING 11340 528/dhcpcd /var/run/dhcpcd.unpriv.sock
unix 2 [ ACC ] STREAM LISTENING 13598 682/python3 /var/tmp/gunicorn–dsmr_webinterface.socket
unix 2 [ ACC ] STREAM LISTENING 11913 665/nmbd /var/run/samba/nmbd/unexpected
unix 2 [ ACC ] STREAM LISTENING 1590188 31726/systemd /run/user/1000/systemd/private
unix 2 [ ACC ] STREAM LISTENING 1590193 31726/systemd /run/user/1000/gnupg/S.gpg-agent
unix 2 [ ACC ] STREAM LISTENING 1590196 31726/systemd /run/user/1000/gnupg/S.gpg-agent.browser
unix 2 [ ACC ] STREAM LISTENING 1590198 31726/systemd /run/user/1000/gnupg/S.gpg-agent.ssh
unix 2 [ ACC ] STREAM LISTENING 1590200 31726/systemd /run/user/1000/gnupg/S.gpg-agent.extra
unix 2 [ ACC ] STREAM LISTENING 15069 530/python /var/run/supervisor.sock.530
unix 2 [ ACC ] STREAM LISTENING 10743 1/init /run/thd.socket
unix 2 [ ACC ] STREAM LISTENING 10745 1/init /var/run/avahi-daemon/socket
unix 2 [ ACC ] STREAM LISTENING 10748 1/init /var/run/dbus/system_bus_socket

“ps -ef | grep node” gives : “pi 32432 31740 0 22:46 pts/0 00:00:00 grep --color=auto node”

I did check the logs, but don’t see any problems:

run-app.log

2019-04-19 20:49:52.799 INFO : Creating database: /home/pi/.mozilla-iot/log/logs.sqlite3
2019-04-19 20:49:55.627 INFO : wifi-setup: waitForWiFi: networks exist: [ ‘Teeuwen’ ]
2019-04-19 20:49:55.781 INFO : wifi-setup: waitForWifi: connection found
2019-04-19 20:49:55.788 INFO : DNS config is: raspberrypi
2019-04-19 20:49:55.790 INFO : Service Discovery: changing profile - local domain is now: raspberrypi
2019-04-19 20:49:57.415 INFO : Service Discovery: state changed to: true
2019-04-19 20:49:57.445 INFO : HTTPS server listening on port 4443
2019-04-19 20:49:57.447 INFO : Redirector listening on port 8280
2019-04-19 20:50:07.607 INFO : Checking for add-on updates…
2019-04-19 20:50:07.997 INFO : Finished updating add-ons
2019-04-19 21:05:07.556 INFO : Opening database: /home/pi/.mozilla-iot/log/logs.sqlite3
2019-04-19 21:05:09.371 INFO : wifi-setup: waitForWiFi: networks exist: [ ‘Teeuwen’ ]
2019-04-19 21:05:09.514 INFO : wifi-setup: waitForWifi: connection found
2019-04-19 21:05:09.522 INFO : DNS config is: raspberrypi
2019-04-19 21:05:09.526 INFO : Service Discovery: changing profile - local domain is now: raspberrypi
2019-04-19 21:05:10.714 INFO : Service Discovery: state changed to: true
2019-04-19 21:05:10.752 INFO : HTTPS server listening on port 4443
2019-04-19 21:05:10.755 INFO : Redirector listening on port 8280
2019-04-19 21:05:20.947 INFO : Checking for add-on updates…
2019-04-19 21:05:21.351 INFO : Finished updating add-ons

What kind of OS are you running on top of you Pi?
Home Assistant downloadable images are based on a special Linux derivat…

“cat /etc/os-release” gives

" PRETTY_NAME=“Raspbian GNU/Linux 9 (stretch)”

NAME=“Raspbian GNU/Linux”

VERSION_ID=“9”

VERSION=“9 (stretch)”

ID=raspbian

ID_LIKE=debian

HOME_URL=“http://www.raspbian.org/

SUPPORT_URL=“http://www.raspbian.org/RaspbianForums

BUG_REPORT_URL=“http://www.raspbian.org/RaspbianBugs”"

Once the gateway is running, I see the following:

pi@gateway:~$ ps -ef | grep node
pi         984   893  0 20:07 ?        00:00:00 sh -c node build/gateway.js
pi         987   984 51 20:07 ?        00:00:03 node build/gateway.js
pi        1234   969  0 20:07 ttyS0    00:00:00 grep --color=auto node

The fact that you’re not seeing the line with node build/gateway.js tells me that the gateway isn’t running.

netstat also doesn’t show any processes listening on port 8280.

How are you starting the gateway?

Thank you for your help/time.

I followed https://github.com/mozilla-iot/gateway . At the end it says “npm start”, which is what i did. Afaik, i did every step on that page, except from the optional ones.