# Has anybody managed to get the local cloud setup with a Photon with any degree of reliability?

**URL:** <https://community.particle.io/t/has-anybody-managed-to-get-the-local-cloud-setup-with-a-photon-with-any-degree-of-reliability/42979>\
**Category:** Cloud\
**Created:** [July 12, 2018, 7:13pm UTC](https://community.particle.io/t/has-anybody-managed-to-get-the-local-cloud-setup-with-a-photon-with-any-degree-of-reliability/42979 "2018-07-12T19:13:06Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jawa](https://avatars.discourse-cdn.com/v4/letter/j/b19c9b/32.png) [@Jawa](https://community.particle.io/u/Jawa)\
**Post date:** [July 12, 2018, 7:13pm UTC](https://community.particle.io/t/has-anybody-managed-to-get-the-local-cloud-setup-with-a-photon-with-any-degree-of-reliability/42979/1 "2018-07-12T19:13:06Z")

</div>

It appears that Particle abandoned updating its local cloud server about three years ago: [https://github.com/particle-iot/spark-server](https://github.com/particle-iot/spark-server)

There is a fork that was last updated about a month ago here: [https://github.com/Brewskey/spark-server](https://github.com/Brewskey/spark-server)

The code has been cleaned up and organized quite a bit, but it still doesn’t seem to work very well. Has anyone gotten this thing to work? What combination of OS, Node, and spark-server did you use?  
I’m running on Raspberrian Jessie, the latest Brewskey spark-server, the latest particle-cli, and the latest spark firmware, origin/release/v0.8.0-rc.8 My symptoms are, no matter what combination of keys doctor, keys server, and setup I use, I never get past the rapid cyan flash.  
I can connect to local wifi fine, and the keys I’ve generated show up the spark-servers database, but the Photon will not connect to the local cloud.

---

<div class="post-metadata">

**Author:** ![KyleG](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/kyleg/32/11077_2.png) [@KyleG](https://community.particle.io/u/KyleG)\
**Post date:** [July 27, 2018, 12:04am UTC](https://community.particle.io/t/has-anybody-managed-to-get-the-local-cloud-setup-with-a-photon-with-any-degree-of-reliability/42979/2 "2018-07-27T00:04:18Z")

</div>

Let me ping someone that might be able to help, @rickkas7 or @ParticleD are you able to assist?

---

<div class="post-metadata">

**Author:** ![dfarny](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/dfarny/32/19688_2.png) [@dfarny](https://community.particle.io/u/dfarny)\
**Post date:** [January 16, 2019, 10:30am UTC](https://community.particle.io/t/has-anybody-managed-to-get-the-local-cloud-setup-with-a-photon-with-any-degree-of-reliability/42979/3 "2019-01-16T10:30:58Z")

</div>

@Jawa We use the Brewskey server in production, around 500 devices deployed. It works great and it is very stable. It gives us full control over our fleet and I am glad I decided to go with own cloud. Sometimes the connection on customer’s side is not reliable and the error logs from cloud helps us to analyze the situation…

We use function calls, events publishing, subscribing, webhooks. All running smooth.

---

<div class="post-metadata">

**Author:** ![Mjones](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mjones/32/21658_2.png) [@Mjones](https://community.particle.io/u/Mjones)\
**Post date:** [January 16, 2019, 4:23pm UTC](https://community.particle.io/t/has-anybody-managed-to-get-the-local-cloud-setup-with-a-photon-with-any-degree-of-reliability/42979/4 "2019-01-16T16:23:35Z")

</div>

Can you share the details on the brewskey server? @dfarny

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [January 16, 2019, 4:41pm UTC](https://community.particle.io/t/has-anybody-managed-to-get-the-local-cloud-setup-with-a-photon-with-any-degree-of-reliability/42979/5 "2019-01-16T16:41:05Z")

</div>

The repo is here

> **[Brewskey/spark-server](https://github.com/Brewskey/spark-server)**
>
> An API compatible open source server for interacting with devices speaking the spark-protocol - Brewskey/spark-server

  
and @Brewskey is also a member here

---

<div class="post-metadata">

**Author:** ![Brewskey](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/brewskey/32/11322_2.png) [@Brewskey](https://community.particle.io/u/Brewskey)\
**Post date:** [January 16, 2019, 5:52pm UTC](https://community.particle.io/t/has-anybody-managed-to-get-the-local-cloud-setup-with-a-photon-with-any-degree-of-reliability/42979/6 "2019-01-16T17:52:14Z")

</div>

What would you like to know?

Most of the setup instructions are in a readme in the github repo.

---

<div class="post-metadata">

**Author:** ![Mjones](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mjones/32/21658_2.png) [@Mjones](https://community.particle.io/u/Mjones)\
**Post date:** [January 29, 2019, 4:42pm UTC](https://community.particle.io/t/has-anybody-managed-to-get-the-local-cloud-setup-with-a-photon-with-any-degree-of-reliability/42979/7 "2019-01-29T16:42:18Z")

</div>

Sorry it has taken me so long to reply, I’ve been busy with other projects. I haven’t had a chance to set this up and run a test server yet, but my biggest question from the beginning, for a locally hosted cloud, is how do you direct traffic to your server instead of particles?

---

<div class="post-metadata">

**Author:** ![ninjatill](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/ninjatill/32/17370_2.png) [@ninjatill](https://community.particle.io/u/ninjatill)\
**Post date:** [January 29, 2019, 5:13pm UTC](https://community.particle.io/t/has-anybody-managed-to-get-the-local-cloud-setup-with-a-photon-with-any-degree-of-reliability/42979/8 "2019-01-29T17:13:20Z")

</div>

How to point your device to your local server is answered in the github repo readme file:

```auto

6. Put your core into listening mode, and run
particle identify
to get your core id. You willl need this id later

7. The next steps will generate a bunch of keys for your device. I recommend mkdir ..\temp and cd ..\temp

8. Change server keys to local cloud key + IP Address

particle keys server ..\spark-server\data\default_key.pub.pem --host IP_ADDRESS
Note You can go back to using the particle cloud by downloading the public key here. You will need to run particle config particle, particle keys server cloud_public.der, and particle keys doctor your_core_id while your device is in DFU mode.

9. Create and provision access on your local cloud with the keys doctor:
   particle keys doctor your_core_id

At this point you should be able to run normal cloud commands and flash binaries. You can add any webhooks you need, call functions, or get variable values.

```

---

<div class="post-metadata">

**Author:** ![Mjones](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mjones/32/21658_2.png) [@Mjones](https://community.particle.io/u/Mjones)\
**Post date:** [January 29, 2019, 5:25pm UTC](https://community.particle.io/t/has-anybody-managed-to-get-the-local-cloud-setup-with-a-photon-with-any-degree-of-reliability/42979/9 "2019-01-29T17:25:36Z")

</div>

I figured there was a simple explanation, I just hadn’t had the time to go through everything. Thanks @ninjatill

---

<div class="post-metadata">

**Author:** ![Brewskey](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/brewskey/32/11322_2.png) [@Brewskey](https://community.particle.io/u/Brewskey)\
**Post date:** [January 29, 2019, 5:33pm UTC](https://community.particle.io/t/has-anybody-managed-to-get-the-local-cloud-setup-with-a-photon-with-any-degree-of-reliability/42979/10 "2019-01-29T17:33:55Z")

</div>

Yeah, if you follow the readme you should be able to get it up and running (at least on your local machine) in 10-20 minutes.

If you are putting this in production, I highly recommend that you use MongoDB instead of the in-memory DB that spark-server ships with.

---

<div class="post-metadata">

**Author:** ![Mjones](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mjones/32/21658_2.png) [@Mjones](https://community.particle.io/u/Mjones)\
**Post date:** [January 29, 2019, 5:35pm UTC](https://community.particle.io/t/has-anybody-managed-to-get-the-local-cloud-setup-with-a-photon-with-any-degree-of-reliability/42979/11 "2019-01-29T17:35:02Z")

</div>

This would be for production, where would I find the MongoDB?

---

<div class="post-metadata">

**Author:** ![ninjatill](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/ninjatill/32/17370_2.png) [@ninjatill](https://community.particle.io/u/ninjatill)\
**Post date:** [January 29, 2019, 5:41pm UTC](https://community.particle.io/t/has-anybody-managed-to-get-the-local-cloud-setup-with-a-photon-with-any-degree-of-reliability/42979/12 "2019-01-29T17:41:30Z")

</div>

> [@Mjones](#):
>
> This would be for production, where would I find the MongoDB?

> **[Download MongoDB Community Server](https://www.mongodb.com/try/download/community)**
>
> Download MongoDB Community Server non-relational database to take your next big project to a higher level!

---

<div class="post-metadata">

**Author:** ![Brewskey](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/brewskey/32/11322_2.png) [@Brewskey](https://community.particle.io/u/Brewskey)\
**Post date:** [January 29, 2019, 5:46pm UTC](https://community.particle.io/t/has-anybody-managed-to-get-the-local-cloud-setup-with-a-photon-with-any-degree-of-reliability/42979/13 "2019-01-29T17:46:05Z")

</div>

I didn’t write documentation for it but you basically have to set up a mongo instance and then override the settings. It’s very straight-forward.

---

<div class="post-metadata">

**Author:** ![Mjones](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mjones/32/21658_2.png) [@Mjones](https://community.particle.io/u/Mjones)\
**Post date:** [January 29, 2019, 5:52pm UTC](https://community.particle.io/t/has-anybody-managed-to-get-the-local-cloud-setup-with-a-photon-with-any-degree-of-reliability/42979/14 "2019-01-29T17:52:49Z")

</div>

You guys are awesome, thank you.

---

<div class="post-metadata">

**Author:** ![Jawa](https://avatars.discourse-cdn.com/v4/letter/j/b19c9b/32.png) [@Jawa](https://community.particle.io/u/Jawa)\
**Post date:** [February 2, 2019, 8:09pm UTC](https://community.particle.io/t/has-anybody-managed-to-get-the-local-cloud-setup-with-a-photon-with-any-degree-of-reliability/42979/15 "2019-02-02T20:09:24Z")

</div>

So, I can’t get it to work on a fresh copy of raspbian.  
I’ve followed the instructions listed here:

> **[Brewskey/spark-server](https://github.com/Brewskey/spark-server)**
>
> An API compatible open source server for interacting with devices speaking the spark-protocol - Brewskey/spark-server

After I login, keys server, keys doctor, and setup, the best I can get is a fast flash cyan. The photon never is acknowledged as being on the local cloud.

WHAT EXACT VERSIONS OF EVERYTHING ARE YOU GUYS USING?  
Can you go from a completely virgin environment and get something working?

pi@higgs:~ $ uname -a  
Linux higgs 4.14.79-v7+ #1159 SMP Sun Nov 4 17:50:20 GMT 2018 armv7l GNU/Linux  
pi@higgs:~ $ cat /etc/os-release  
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/](http://www.raspbian.org/)"  
SUPPORT\_URL="[http://www.raspbian.org/RaspbianForums](http://www.raspbian.org/RaspbianForums)"  
BUG\_REPORT\_URL=“[http://www.raspbian.org/RaspbianBugs](http://www.raspbian.org/RaspbianBugs)”

pi@higgs:~/spark-server $ npm --version  
6.7.0  
pi@higgs:~/spark-server $ node --version  
v8.11.1  
pi@higgs:~/spark-server $

(opencv\_env)[kujawa@nikola tmp]$ particle list  
bob [26002b000247353137323334] (Product -1) is offline

[2019-02-02T20:07:56.372Z] INFO: DeviceServer.js/9012 on higgs: Connected Devices (devices=0, sockets=0)  
[2019-02-02T20:08:06.377Z] INFO: DeviceServer.js/9012 on higgs: Connected Devices (devices=0, sockets=0)  
[2019-02-02T20:08:16.381Z] INFO: DeviceServer.js/9012 on higgs: Connected Devices (devices=0, sockets=0)  
[2019-02-02T20:08:26.390Z] INFO: DeviceServer.js/9012 on higgs: Connected Devices (devices=0, sockets=0)  
[2019-02-02T20:08:36.403Z] INFO: DeviceServer.js/9012 on higgs: Connected Devices (devices=0, sockets=0)  
[2019-02-02T20:08:46.407Z] INFO: DeviceServer.js/9012 on higgs: Connected Devices (devices=0, sockets=0)

Steps I used to set up the server:

sudo apt-get install nodejs npm  
sudo npm install -g npm@latest --unsafe-perms  
sudo apt-get install dfu-util  
sudo apt-get install libusb-1.0-0-dev libusb-1.0-0  
sudo apt-get install git  
sudo npm install -g particle-cli --unsafe-perm

git clone [https://github.com/Brewskey/spark-server.git](https://github.com/Brewskey/spark-server.git)  
cd spark-server/  
npm install oauth2-server  
vi spark-server/.env

GITHUB\_AUTH\_TYPE=basic  
GITHUB\_AUTH\_USERNAME=ivorjawa  
GITHUB\_AUTH\_PASSWORD=

npm install --verbose  
grep -i admin dist/settings.js  
vi dist/settings.js

npm run start:prod

particle config higgs apiUrl "[http://192.168.86.141:8080](http://192.168.86.141:8080)"  
particle config higgs  
particle cloud login

pi@higgs:~ $ particle identify

Your device id is 26002b000247353137323334  
Your system firmware version is 0.5.3  
pi@higgs:~ $ mkdir temp  
pi@higgs:~ $ cd temp

1. Press and hold both the RESET/RST and MODE/SETUP buttons simultaneously.

2. Release only the RESET/RST button while continuing to hold the MODE/SETUP button.

3. Release the MODE/SETUP button once the device begins to blink yellow.

pi@higgs:~/temp $ particle keys server …/spark-server/data/default\_key.pub.pem  
Creating DER format file  
Okay! New keys in place, your device will not restart.  
pi@higgs:~/temp $

pi@higgs:~/temp $ particle keys doctor 26002b000247353137323334  
New Key Created!  
Saved!  
Saved!  
attempting to add a new public key for device 26002b000247353137323334  
submitting public key succeeded!  
Okay! New keys in place, your device should restart.

pi@higgs:~/temp $ particle identify

Your device id is 26002b000247353137323334  
Your system firmware version is 0.5.3  
pi@higgs:~/temp $ particle setup

---

<div class="post-metadata">

**Author:** ![Jawa](https://avatars.discourse-cdn.com/v4/letter/j/b19c9b/32.png) [@Jawa](https://community.particle.io/u/Jawa)\
**Post date:** [February 10, 2019, 4:40pm UTC](https://community.particle.io/t/has-anybody-managed-to-get-the-local-cloud-setup-with-a-photon-with-any-degree-of-reliability/42979/16 "2019-02-10T16:40:12Z")

</div>

Argh. My mistake. Wrong port.

particle keys server …/spark-server/data/default\_key.pub.pem --protocol tcp --host 192.168.86.141 --port 5683

Everything is happy now. Thanks, everyone.

Closed bug here:

> <https://github.com/Brewskey/spark-server/issues/270>

---

<div class="post-metadata">

**Author:** ![Mason\_Curtis](https://avatars.discourse-cdn.com/v4/letter/m/edb3f5/32.png) [@Mason\_Curtis](https://community.particle.io/u/Mason_Curtis)\
**Post date:** [May 25, 2021, 3:17pm UTC](https://community.particle.io/t/has-anybody-managed-to-get-the-local-cloud-setup-with-a-photon-with-any-degree-of-reliability/42979/17 "2021-05-25T15:17:32Z")

</div>

@ParticleD @Brewskey @Jawa I am looking to use this to set up a local cloud for my Photon devices. Anyone know if this git is still working? I have read all the documentation but I am struggling to get it to work. I can keep trying or post my issues but I wanted to check and see if it was even still working for anyone?

---

<div class="post-metadata">

**Author:** ![dfarny](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/dfarny/32/19688_2.png) [@dfarny](https://community.particle.io/u/dfarny)\
**Post date:** [May 25, 2021, 7:06pm UTC](https://community.particle.io/t/has-anybody-managed-to-get-the-local-cloud-setup-with-a-photon-with-any-degree-of-reliability/42979/18 "2021-05-25T19:06:59Z")

</div>

Yes, we use Brewskey cloud in production, a fleet of 800 Photons… very reliable.
