# Is using Firestorm the right way to go

**URL:** <https://forum.electromage.com/t/is-using-firestorm-the-right-way-to-go/892>\
**Category:** Uncategorized\
**Created:** [January 10, 2021, 12:38pm UTC](https://forum.electromage.com/t/is-using-firestorm-the-right-way-to-go/892 "2021-01-10T12:38:35Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![TechDoctor](https://forum.electromage.com/letter_avatar_proxy/v4/letter/t/3ec8ea/32.png) [@TechDoctor](https://forum.electromage.com/u/TechDoctor)\
**Post date:** [January 10, 2021, 12:38pm UTC](https://forum.electromage.com/t/is-using-firestorm-the-right-way-to-go/892/1 "2021-01-10T12:38:35Z")

</div>

I have a Pixel Blaze V2 and a V3 on order.  
What I want to do is use my home automation system ([Loxone](https://www.loxone.com)) to control the pixel blaze.  
Now Loxone can deal with some HTTP commands (It can control a Sonos sound system using this method) so I have been trying to control the PB directly from Loxone but that’s not possible, or I am doing something wrong.  
So my next thought was to use the scripting block within Loxone . This is based on Pico C so don’t really know where to start there. But the only command I could see that might be of use is char_httpget(char_address,char\*page); But don’t know how to implement this.  
So my real question is is Firestorm the way to go and use the HTTP commands to get Loxone to control the PB.

---

<div class="post-metadata">

**Author:** ![jeff](https://forum.electromage.com/user_avatar/forum.electromage.com/jeff/32/3473_2.png) [@jeff](https://forum.electromage.com/u/jeff)\
**Post date:** [January 10, 2021, 4:46pm UTC](https://forum.electromage.com/t/is-using-firestorm-the-right-way-to-go/892/2 "2021-01-10T16:46:10Z")

</div>

Hi! Firestorm seems viable for this. Did you see how you can use the “/command” API with http GET?

> **[simap/Firestorm](https://github.com/simap/Firestorm#command-get)**
>
> Pixelblaze Firestorm is a centralized control console for Pixelblaze WiFi LED controllers - simap/Firestorm

---

<div class="post-metadata">

**Author:** ![TechDoctor](https://forum.electromage.com/letter_avatar_proxy/v4/letter/t/3ec8ea/32.png) [@TechDoctor](https://forum.electromage.com/u/TechDoctor)\
**Post date:** [January 10, 2021, 9:10pm UTC](https://forum.electromage.com/t/is-using-firestorm-the-right-way-to-go/892/3 "2021-01-10T21:10:56Z")

</div>

As I don’t have an RPi, I have tried to install Firestorm on my Ubuntu laptop (its a dual boot with Windows 10) but I can’t seem to get it to work.  
When I type the command yarn it says " Error: There are no scenarios; must have at least one"

Also how do you access the Firestorm UI, the github basically says there is one, but no mention of how to access it.

Any help greatly appreciated

---

<div class="post-metadata">

**Author:** ![jeff](https://forum.electromage.com/user_avatar/forum.electromage.com/jeff/32/3473_2.png) [@jeff](https://forum.electromage.com/u/jeff)\
**Post date:** [January 10, 2021, 10:52pm UTC](https://forum.electromage.com/t/is-using-firestorm-the-right-way-to-go/892/4 "2021-01-10T22:52:34Z")

</div>

Sure - I run Firestorm locally on OSX. I access the UI at [http://0.0.0.0](http://0.0.0.0) (assuming you’ve started it without the `PORT=` env var set first as shown in the docs).

On Ubuntu, looks like you might be running the wrong yarn. Scroll down to the ~70 point upvoted answer here:

> <https://stackoverflow.com/questions/53471063/yarn-error-there-are-no-scenarios-must-have-at-least-one/53471064#53471064>

---

<div class="post-metadata">

**Author:** ![TechDoctor](https://forum.electromage.com/letter_avatar_proxy/v4/letter/t/3ec8ea/32.png) [@TechDoctor](https://forum.electromage.com/u/TechDoctor)\
**Post date:** [January 11, 2021, 9:52pm UTC](https://forum.electromage.com/t/is-using-firestorm-the-right-way-to-go/892/5 "2021-01-11T21:52:01Z")

</div>

Still no joy. Followed the instructions. Had to remove cmdtest first  
When I run yarn I get this error message

> error archiver@5.0.2: The engine “node” is incompatible with this module. Expected version “\>= 10”. Got “8.10.0”  
> error Found incompatible module.  
> info Visit [yarn install | Yarn](https://yarnpkg.com/en/docs/cli/install) for documentation about this command.

Not too sure what to do now. Did visit the yarn page above but not much help really.

---

<div class="post-metadata">

**Author:** ![wizard](https://forum.electromage.com/user_avatar/forum.electromage.com/wizard/32/4_2.png) [@wizard](https://forum.electromage.com/u/wizard)\
**Post date:** [January 11, 2021, 10:42pm UTC](https://forum.electromage.com/t/is-using-firestorm-the-right-way-to-go/892/6 "2021-01-11T22:42:15Z")

</div>

@TechDoctor,  
Based on the error message, the version of nodejs on your system is too old.

If you have ubuntu 18.04, this page may help explain what’s going on and how to get a newer version:  
[https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-18-04](https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-18-04)

---

<div class="post-metadata">

**Author:** ![jeff](https://forum.electromage.com/user_avatar/forum.electromage.com/jeff/32/3473_2.png) [@jeff](https://forum.electromage.com/u/jeff)\
**Post date:** [January 12, 2021, 2:37am UTC](https://forum.electromage.com/t/is-using-firestorm-the-right-way-to-go/892/7 "2021-01-12T02:37:27Z")

</div>

In addition to Wizard’s link… I don’t really know my way around Node, but I’ve gotten similar messages and if you have other stuff on your system that needs that early system node (v8.10.0), you can use [Node Version Manager (nvm)](https://github.com/nvm-sh/nvm) to quickly install a LTS (long term support) version of Node like this:

```bash
nvm install v14.15.4
# then
nvm use v14.15.4
# or
nvm alias default v14.15.4

```

---

<div class="post-metadata">

**Author:** ![TechDoctor](https://forum.electromage.com/letter_avatar_proxy/v4/letter/t/3ec8ea/32.png) [@TechDoctor](https://forum.electromage.com/u/TechDoctor)\
**Post date:** [January 12, 2021, 11:58pm UTC](https://forum.electromage.com/t/is-using-firestorm-the-right-way-to-go/892/8 "2021-01-12T23:58:51Z")

</div>

Yeah finally got it to work. So thanks to Wizard and Jeff for pointing me in the right direction.  
Had to remove Apache2 to get it to work.  
Couldn’t use port 80 so set server to 3000 .  
I now have the Firestorm server working and can access it from my main pc.  
Got the 0.0.0.0:3000/discover to work. But can’t seem to change the patterns.  
Its fairly late here, so I must be missing something really obvious. So going to sleep on it.

---

<div class="post-metadata">

**Author:** ![TechDoctor](https://forum.electromage.com/letter_avatar_proxy/v4/letter/t/3ec8ea/32.png) [@TechDoctor](https://forum.electromage.com/u/TechDoctor)\
**Post date:** [January 13, 2021, 3:31pm UTC](https://forum.electromage.com/t/is-using-firestorm-the-right-way-to-go/892/9 "2021-01-13T15:31:12Z")

</div>

I can now change the patterns in a web browser using the GET command but for some reason I can’t get the POST command to work.  
And Loxone still won’t communicate with Firestorm. But at least I am a step or two nearer.

---

<div class="post-metadata">

**Author:** ![wizard](https://forum.electromage.com/user_avatar/forum.electromage.com/wizard/32/4_2.png) [@wizard](https://forum.electromage.com/u/wizard)\
**Post date:** [January 13, 2021, 7:48pm UTC](https://forum.electromage.com/t/is-using-firestorm-the-right-way-to-go/892/10 "2021-01-13T19:48:06Z")

</div>

@TechDoctor,  
I didn’t see HTTP POST support in Loxone.

The GET flavor command supports the same stuff as the POST flavor command, so you don’t POST unless it is more convenient for you.

What Loxone script are you trying? It looks like a subset of C, so we might be able to help with at least that part.

---

<div class="post-metadata">

**Author:** ![TechDoctor](https://forum.electromage.com/letter_avatar_proxy/v4/letter/t/3ec8ea/32.png) [@TechDoctor](https://forum.electromage.com/u/TechDoctor)\
**Post date:** [January 13, 2021, 9:27pm UTC](https://forum.electromage.com/t/is-using-firestorm-the-right-way-to-go/892/11 "2021-01-13T21:27:22Z")

</div>

Yeah got it working.  
@wizard I am using the Loxone virtual outputs rather than the Pico C scripting, much easier.  
So you set up a Virtual output with the ip address of the computer firestorm is running on so in my case this is [http://192.168.1.101:3000](http://192.168.1.101:3000)  
So once you have done this you then create a virtual output command for each pattern or command you wish to send.  
So I have a pattern called White  
So in the virtual command where is says command for on you enter  
**/command?command=%7B%22programName%22%3A+%22White%22%7D&ids=3601529**  
Set HTTP Method for ON to POST and leave everything else as is or blank.  
Now you need to set up a virtual input to trigger the virtual command. Set this to push button join this to the virtual command. And that its.  
So far I have only done two commands but at least it works.

This also means I can remotely control the PixelBlaze when away from the house if I want to.

---

<div class="post-metadata">

**Author:** ![TechDoctor](https://forum.electromage.com/letter_avatar_proxy/v4/letter/t/3ec8ea/32.png) [@TechDoctor](https://forum.electromage.com/u/TechDoctor)\
**Post date:** [February 9, 2021, 8:07pm UTC](https://forum.electromage.com/t/is-using-firestorm-the-right-way-to-go/892/12 "2021-02-09T20:07:22Z")

</div>

Ahhh. Just got mi RPi 4 4GB. Followed the instructions to install Firestorm. All worked OK, just had a power outage, and when the power came back on Firestorm doesn’t run. So I thought I will re-install everything. I now get this error message

> env: ‘/usr/lib/node\_modules/pm2/bin/pm2’: No such file or directory

The command I used was

> sudo env PATH=$PATH:/usr/bin /usr/lib/node\_modules/pm2/bin/pm2 startup systemd -u pi --hp /home/pi

So not too sure what to do now.  
The only thing I have found out is that the node\_modules directory doesn’t exist.

---

<div class="post-metadata">

**Author:** ![wizard](https://forum.electromage.com/user_avatar/forum.electromage.com/wizard/32/4_2.png) [@wizard](https://forum.electromage.com/u/wizard)\
**Post date:** [February 9, 2021, 8:27pm UTC](https://forum.electromage.com/t/is-using-firestorm-the-right-way-to-go/892/13 "2021-02-09T20:27:12Z")

</div>

Hi @TechDoctor,  
I think the location of pm2 moves around between versions. What do you get if you run

```auto
which pm2

```

If a path pops up, and is different, try replacing it in the instructions.

BTW you only need to get that once to set pm2 to run on startup. If it is running on startup, then this is the key bit that causes pm2 to load Firestorm:

Note, be sure your alias is still active before running these!

```auto
pm2 start server.js 
pm2 save

```

You should see an entry for Firestorm if you query pm2 for a list of services:

```auto
pm2 list

```

---

<div class="post-metadata">

**Author:** ![TechDoctor](https://forum.electromage.com/letter_avatar_proxy/v4/letter/t/3ec8ea/32.png) [@TechDoctor](https://forum.electromage.com/u/TechDoctor)\
**Post date:** [February 10, 2021, 12:58pm UTC](https://forum.electromage.com/t/is-using-firestorm-the-right-way-to-go/892/14 "2021-02-10T12:58:37Z")

</div>

Many thanks got there eventually. The path was incorrect. For anyone else having similar problems the path is

> /usr/local/bin/pm2

so the command you use at this point will be

> #run pm2 on boot  
> sudo env PATH=$PATH:/usr/bin /usr/local/bin/pm2 startup systemd -u pi --hp /home/pi

And note there is a space between **../bin** and **/usr/local…**  
Once I followed your instructions I rebooted the PI and then waited a few minutes to makes sure everything was up and running and it works. Will reboot later to see if it all works again.

---

<div class="post-metadata">

**Author:** ![TechDoctor](https://forum.electromage.com/letter_avatar_proxy/v4/letter/t/3ec8ea/32.png) [@TechDoctor](https://forum.electromage.com/u/TechDoctor)\
**Post date:** [February 10, 2021, 1:13pm UTC](https://forum.electromage.com/t/is-using-firestorm-the-right-way-to-go/892/15 "2021-02-10T13:13:53Z")

</div>

Looks like I spoke too soon, it has stopped working. Will try and figure out what is going on and report back.  
This is what I get when the command **yarn server** is run

> > listening on 80  
> > Pixelblaze Discovery Server listening on 0.0.0.0: 1889  
> > events.js:174  
> > throw er; // Unhandled ‘error’ event  
> > ^
> 
> Error: listen EACCES: permission denied 0.0.0.0:80  
> at Server.setupListenHandle [as \_listen2] (net.js:1263:19)  
> at listenInCluster (net.js:1328:12)  
> at Server.listen (net.js:1415:7)  
> at Function.listen (/home/pi/Firestorm/node\_modules/express/lib/application.js:618:24)  
> at Object. (/home/pi/Firestorm/server.js:24:5)  
> at Module.\_compile (internal/modules/cjs/loader.js:778:30)  
> at Object.Module.\_extensions..js (internal/modules/cjs/loader.js:789:10)  
> at Module.load (internal/modules/cjs/loader.js:653:32)  
> at tryModuleLoad (internal/modules/cjs/loader.js:593:12)  
> at Function.Module.\_load (internal/modules/cjs/loader.js:585:3)  
> Emitted ‘error’ event at:  
> at emitErrorNT (net.js:1307:8)  
> at process.\_tickCallback (internal/process/next\_tick.js:63:19)  
> at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)  
> at startup (internal/bootstrap/node.js:283:19)  
> at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)  
> error Command failed with exit code 1.  
> info Visit [yarn run | Yarn](https://yarnpkg.com/en/docs/cli/run) for documentation about this command.

When I do the

> pm2 list

I get

![pm2 list](https://forum.electromage.com/uploads/default/original/1X/9c7eeb1feb7f5719780c7474a2ae784856b738c4.png)

Thats it for now

I am back to using my ubuntu install on my laptop, to see if there is anything funny going on. But Firestorm runs perfectly.  
But when I do \*\*pm2 list \*\* the fields are empty  
But it is working . I am at a loss as to what to do now.

---

<div class="post-metadata">

**Author:** ![wizard](https://forum.electromage.com/user_avatar/forum.electromage.com/wizard/32/4_2.png) [@wizard](https://forum.electromage.com/u/wizard)\
**Post date:** [February 10, 2021, 5:17pm UTC](https://forum.electromage.com/t/is-using-firestorm-the-right-way-to-go/892/16 "2021-02-10T17:17:56Z")

</div>

@TechDoctor,  
`pm2` is a tool for running nodejs services in the background. Running `yarn server` runs Firestorm in your terminal but pm2 is already running it for you in the background.

You do not need to run `yarn server` anymore. Once pm2 is set up to run Firestorm on startup (and this appears to be the case now), you wont be able to run another copy on the same port and you will see errors like above. If you reboot your Pi, you should be able to get to Firestorm via browser by pointing it at your Pi’s IP address.

It is possible to get pm2 to run Firestorm without permission to use port 80, which is what all of the `alias` and `authbind` stuff is about in the instructions. On most Linux/unix systems port 80 (and all ports below 1024) are restricted to authorized users on the system. The authbind stuff is what allows the `pi` user to run Firestorm on port 80.

You can see the console output (and more) of Firestorm when it is running via `pm2` by running this:

```auto
pm2 logs server --lines 1000 --nostream

```

This will show the last 1000 lines of both the error and stdout streams.

If you see something like “Error: listen EACCES: permission denied 0.0.0.0:80” in the pm2 log, then permissions aren’t set up properly to allow pm2 to use port 80. It is **critical** that pm2 be run via authbind, like so:

```auto
authbind --deep pm2

```

Which is what the `alias` command in the instructions is all about. I make note if this in the instructions here:

```auto
alias pm2='authbind --deep pm2'

#...

#I believe the pm2 alias with authbind is critical here
#alternatively `authbind --deep pm2 start server.js` might work
pm2 start server.js 
pm2 save

```

Try rebooting fresh, once online, can you access Firestorm at the Pi’s IP on port 80? If not, try running these 3 commands above (in the Firestorm directory) again.

You can also verify that the authbind config for port 80 exists, and is owned by `pi` by running

```auto
ls -l /etc/authbind/byport/80

```

---

<div class="post-metadata">

**Author:** ![TechDoctor](https://forum.electromage.com/letter_avatar_proxy/v4/letter/t/3ec8ea/32.png) [@TechDoctor](https://forum.electromage.com/u/TechDoctor)\
**Post date:** [February 10, 2021, 8:56pm UTC](https://forum.electromage.com/t/is-using-firestorm-the-right-way-to-go/892/17 "2021-02-10T20:56:59Z")

</div>

> [@wizard](#):
>
> Error: listen EACCES: permission denied 0.0.0.0:80

Now I did see this in the log file, so re did the alias command and then  
**pm2 start server.js**  
I get the message

> [PM2][ERROR] Script already launched, add -f option to force re-execution

Then did the **pm save** command.  
Which appears to be successful.  
Doing the  
ls -l /etc/authbind/byport/80  
I get **-rwxr-xr-x 1 pi root 0 Feb 9 19:51 /etc/authbind/byport/80**

I feel I am doing something really silly for it not to work. But I did follow the original instructions to the letter and then where needed changed directory paths.  
So still not working.  
Ah just had a thought I do have XRDP running on the Pi so I can remote login from my windows pc would that cause any problems.

Update.  
XRDP uses 0.0.0.0 so just deleted it.  
Installed Putty on my Windows PC  
Still can’t get it to work after re-installing on the PI.  
I think I will start again with a fresh Pi OS install, and redo it. Fingers crossed.

---

<div class="post-metadata">

**Author:** ![wizard](https://forum.electromage.com/user_avatar/forum.electromage.com/wizard/32/4_2.png) [@wizard](https://forum.electromage.com/u/wizard)\
**Post date:** [February 10, 2021, 9:43pm UTC](https://forum.electromage.com/t/is-using-firestorm-the-right-way-to-go/892/18 "2021-02-10T21:43:52Z")

</div>

> [@TechDoctor](#):
>
> I get the message
> 
> > [PM2][ERROR] Script already launched, add -f option to force re-execution
> 
> Then did the **pm save** command.

I hate to ask and don’t mean to be pedantic, but did you use the `-f` option? Otherwise I imagine the command didn’t do anything.

If it still didn’t work with `-f` you can delete the entry and that should allow you to re-add it.

```auto
pm2 delete server

```

* * *

Do you have another webserver using port 80? If so, then yes there is a conflict. Firestorm also needs port 1889, but that is much less common.

What do you get when you run this?

```auto
sudo netstat -ltnp | grep 80 

```

You can run Firestorm’s webserver on a different port using the PORT environment variable. I think modifying the start command with something like this should work as pm2 docs say they pick up the environment, though I haven’t tested it:

```auto
PORT=3000 pm2 start server.js

```

* * *

I also recommend that you run `pm2 flush` to clear out the logs so you can more easily see if a change produces no errors.

---

<div class="post-metadata">

**Author:** ![TechDoctor](https://forum.electromage.com/letter_avatar_proxy/v4/letter/t/3ec8ea/32.png) [@TechDoctor](https://forum.electromage.com/u/TechDoctor)\
**Post date:** [February 10, 2021, 10:07pm UTC](https://forum.electromage.com/t/is-using-firestorm-the-right-way-to-go/892/19 "2021-02-10T22:07:10Z")

</div>

![pm2 list 2.0](https://forum.electromage.com/uploads/default/original/1X/7f07b17b319ef59a52bc54691988f65fde6e8ead.png)

I take it there should only be one Server running.

I think I am going to re-install the Pi OS. Will be quicker for everyone and safer on my sanity I think.  
Thanks for all your help its been amazing.

---

<div class="post-metadata">

**Author:** ![wizard](https://forum.electromage.com/user_avatar/forum.electromage.com/wizard/32/4_2.png) [@wizard](https://forum.electromage.com/u/wizard)\
**Post date:** [February 10, 2021, 11:44pm UTC](https://forum.electromage.com/t/is-using-firestorm-the-right-way-to-go/892/20 "2021-02-10T23:44:07Z")

</div>

Ah, it seems the -f option doesn’t replace, but force-adds. Hopefully some `pm2 delete server` commands would clear that up, as would a full reinstall!

[Next page](https://forum.electromage.com/t/is-using-firestorm-the-right-way-to-go/892.md?page=2)
