Got Firestorm running, set up Rpi as AP, no loner working

I decided to try installing Firestorm on an old Rpi 3 (fresh Buster install) using the Github instructions. I do not remember setting a custom port.

I got it working, loaded up 0.0.0.0 on the Rpi, saw the Firestorm page, successfully connected to a Pixelblaze. Both the Rpi and the PB were on my home wifi.

I then decided to set up the Rpi as an AP, which I have never done before, and followed these instructions.

As part of the process, I rebooted. I connected my phone to the Rpi’s wifi network, and hooked the Rpi up to Ethernet.

Loading 0.0.0.0 on the Rpi did not work any more. I was under the assumption that Firestorm starts automatically on boot but nonetheless, I ran pm2 start server.js.

It gave me the usual startup messages, saying that it has successfully started in fork_mode, with 1 instance.

I tried 0.0.0.0 again from the Rpi, no dice. I tried loading the IP address of the Rpi in my phone’s browser, both with and without :3000, no dice.

I understand that this might now be outside the scope of this forum, and more of an Rpi question, but was the tutorial I followed the wrong move?

I basically want to be able to have the Rpi create a wifi network that I can put all PBs on, then I connect my phone to that and access Firestorm. I also set up VNC and SSH and connected successfully before I set up the AP.

That tutorial had me editing a bunch of files, so I don’t think I’ll be able to backtrack without doing a fresh install.

Any ideas?

0.0.0.0 is β€œany address” so definitely not a reliable thing to connect to.

Try sudo netstat -ntlp on the Rpi to see what’s listening on what address (-ntlp options are respectively: Numeric TCP Listening Program)

… then pick a real IP address+port that Firestorm is listening on.

1 Like

0.0.0.0 as a destination often hits the loopback. It’s non-routable, so only the PI would be able to see itself with that address.

0.0.0.0 as a bind-to address is a wildcard, meaning listen everywhere and don’t only bind to a specific IP address / interface.

The reboot thing sounds to me more like a permission issue around port 80. If the steps aren’t followed exactly or anything about how that works has changed, the process PM2 starts may not have privileges to bind to port 80.

Specifically, you need this active anytime you do anything that will create a pm2 process:

alias pm2='authbind --deep pm2'

To fix, delete the service and start it again. Likewise if you change ports. e.g.

alias pm2='authbind --deep pm2'
pm2 delete server
PORT=3000 pm2 start server.js

Check the logs, both the syslog and the pm2 logs, often it will complain there about binding or permission issues.

This was right after powerup, so I don’t see Firestorm.

paulwb@raspberrypi:~ $ sudo netstat -ntlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:5900            0.0.0.0:*               LISTEN      435/vncserver-x11-c 
tcp        0      0 0.0.0.0:53              0.0.0.0:*               LISTEN      439/dnsmasq         
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      445/sshd            
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      379/cupsd           
tcp6       0      0 :::5900                 :::*                    LISTEN      435/vncserver-x11-c 
tcp6       0      0 :::53                   :::*                    LISTEN      439/dnsmasq         
tcp6       0      0 :::22                   :::*                    LISTEN      445/sshd            
tcp6       0      0 ::1:631                 :::*                    LISTEN      379/cupsd

I then started firestorm.

paulwb@raspberrypi:~/firestorm $ pm2 start server.js
[PM2] Spawning PM2 daemon with pm2_home=/home/paulwb/.pm2
[PM2] PM2 Successfully daemonized
[PM2] Starting /home/paulwb/firestorm/server.js in fork_mode (1 instance)
[PM2] Done.
β”Œβ”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ id  β”‚ name      β”‚ namespace   β”‚ version β”‚ mode    β”‚ pid      β”‚ uptime β”‚ β†Ί    β”‚ status    β”‚ cpu      β”‚ mem      β”‚ user     β”‚ watching β”‚
β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ 0   β”‚ server    β”‚ default     β”‚ 0.1.0   β”‚ fork    β”‚ 9860     β”‚ 0s     β”‚ 0    β”‚ online    β”‚ 0%       β”‚ 26.6mb   β”‚ paulwb   β”‚ disabled β”‚
β””β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜


paulwb@raspberrypi:~/firestorm $ sudo netstat -ntlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:5900            0.0.0.0:*               LISTEN      435/vncserver-x11-c 
tcp        0      0 0.0.0.0:53              0.0.0.0:*               LISTEN      439/dnsmasq         
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      445/sshd            
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      379/cupsd           
tcp6       0      0 :::5900                 :::*                    LISTEN      435/vncserver-x11-c 
tcp6       0      0 :::53                   :::*                    LISTEN      439/dnsmasq         
tcp6       0      0 :::22                   :::*                    LISTEN      445/sshd            
tcp6       0      0 ::1:631                 :::*                    LISTEN      379/cupsd

I don’t see it in the list. I’ll try Wizard’s suggestions next.

I did try to access 0.0.0.0 from the Rpi right after installation and it worked. I didn’t know that had a listen-everywhere consequence.

Ah, interesting. I guess it never made it into my .bashrc:

> paulwb@raspberrypi:~/firestorm $ type pm2
> pm2 is hashed (/usr/bin/pm2)

Ok, this got the service running:


paulwb@raspberrypi:~/firestorm $ alias pm2='authbind --deep pm2'
paulwb@raspberrypi:~/firestorm $ pm2 delete server
[PM2] Applying action deleteProcessId on app [server](ids: [ 0 ])
[PM2] [server](0) βœ“
β”Œβ”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ id  β”‚ name      β”‚ namespace   β”‚ version β”‚ mode    β”‚ pid      β”‚ uptime β”‚ β†Ί    β”‚ status    β”‚ cpu      β”‚ mem      β”‚ user     β”‚ watching β”‚
β””β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
[PM2][WARN] Current process list is not synchronized with saved list. App server differs. Type 'pm2 save' to synchronize.
paulwb@raspberrypi:~/firestorm $ pm2 save
[PM2] Saving current process list...
[PM2][WARN] PM2 is not managing any process, skipping save...
[PM2][WARN] To force saving use: pm2 save --force
paulwb@raspberrypi:~/firestorm $ PORT=3000 pm2 start server.js
[PM2] Starting /home/paulwb/firestorm/server.js in fork_mode (1 instance)
[PM2] Done.
β”Œβ”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ id  β”‚ name      β”‚ namespace   β”‚ version β”‚ mode    β”‚ pid      β”‚ uptime β”‚ β†Ί    β”‚ status    β”‚ cpu      β”‚ mem      β”‚ user     β”‚ watching β”‚
β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ 0   β”‚ server    β”‚ default     β”‚ 0.1.0   β”‚ fork    β”‚ 11600    β”‚ 0s     β”‚ 0    β”‚ online    β”‚ 0%       β”‚ 22.8mb   β”‚ paulwb   β”‚ disabled β”‚
β””β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
paulwb@raspberrypi:~/firestorm $ sudo netstat -ntlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:5900            0.0.0.0:*               LISTEN      435/vncserver-x11-c 
tcp        0      0 0.0.0.0:53              0.0.0.0:*               LISTEN      439/dnsmasq         
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      445/sshd            
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      379/cupsd           
tcp6       0      0 :::5900                 :::*                    LISTEN      435/vncserver-x11-c 
tcp6       0      0 :::53                   :::*                    LISTEN      439/dnsmasq         
tcp6       0      0 :::22                   :::*                    LISTEN      445/sshd            
tcp6       0      0 ::1:631                 :::*                    LISTEN      379/cupsd           
tcp6       0      0 :::3000                 :::*                    LISTEN      11600/node 

Firestorm is accessible on the following from the Rpi itself!

http://0.0.0.0:3000/

And then if I connect my phone to the Rpi wifi and go to 192.168.220.1:3000, I get the Firestorm interface!

And I then configured a PB to be on the Rpi wifi, and I can see it in the Firestorm interface.

So this is fixed, thank you so much for the quick help! =)

2 Likes

Dangit, the server does not start after a reboot.

paulwb@raspberrypi:~ $ sudo netstat -ntlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:5900            0.0.0.0:*               LISTEN      418/vncserver-x11-c 
tcp        0      0 0.0.0.0:53              0.0.0.0:*               LISTEN      441/dnsmasq         
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      452/sshd            
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      325/cupsd           
tcp6       0      0 :::5900                 :::*                    LISTEN      418/vncserver-x11-c 
tcp6       0      0 :::53                   :::*                    LISTEN      441/dnsmasq         
tcp6       0      0 :::22                   :::*                    LISTEN      452/sshd            
tcp6       0      0 ::1:631                 :::*                    LISTEN      325/cupsd

I added PORT=3000 pm2 start server.js to rc.local. Is that the right way to do it?

EDIT: Nope.

Ok, reading the Github instructions again was the way to go.

# Run pm2 on boot
sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u pi --hp /home/pi
# If you get "No such file or directory", run `pm2 startup` to see the correct command

So therefore:

paulwb@raspberrypi:~/firestorm $ sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u paulwb --hp /home/paulwb
[PM2] Init System found: systemd
Platform systemd
Template
[Unit]
Description=PM2 process manager
Documentation=https://pm2.keymetrics.io/
After=network.target

[Service]
Type=forking
User=paulwb
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
Environment=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games:/usr/bin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
Environment=PM2_HOME=/home/paulwb/.pm2
PIDFile=/home/paulwb/.pm2/pm2.pid
Restart=on-failure

ExecStart=/usr/lib/node_modules/pm2/bin/pm2 resurrect
ExecReload=/usr/lib/node_modules/pm2/bin/pm2 reload all
ExecStop=/usr/lib/node_modules/pm2/bin/pm2 kill

[Install]
WantedBy=multi-user.target

Target path
/etc/systemd/system/pm2-paulwb.service
Command list
[ 'systemctl enable pm2-paulwb' ]
[PM2] Writing init configuration in /etc/systemd/system/pm2-paulwb.service
[PM2] Making script booting at startup...
[PM2] [-] Executing: systemctl enable pm2-paulwb...
[PM2] [v] Command successfully executed.
+---------------------------------------+
[PM2] Freeze a process list on reboot via:
$ pm2 save

[PM2] Remove init script via:
$ pm2 unstartup systemd

I’ll edit this post after reboot.

EDIT: It worked!

2 Likes