# Best use case to deploying app/products using Photon to customers?

**URL:** <https://community.particle.io/t/best-use-case-to-deploying-app-products-using-photon-to-customers/48039>\
**Category:** General\
**Created:** [February 26, 2019, 12:15am UTC](https://community.particle.io/t/best-use-case-to-deploying-app-products-using-photon-to-customers/48039 "2019-02-26T00:15:00Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![steeves](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/steeves/32/13652_2.png) [@steeves](https://community.particle.io/u/steeves)\
**Post date:** [February 26, 2019, 12:15am UTC](https://community.particle.io/t/best-use-case-to-deploying-app-products-using-photon-to-customers/48039/1 "2019-02-26T00:15:00Z")

</div>

Hi,

I read about how to deploying application to customer [https://docs.particle.io/tutorials/device-cloud/authentication/](https://docs.particle.io/tutorials/device-cloud/authentication/). I need to deploy some product (application particle) to my customers and I choose Photon WiFi for. How customer will be able to setup the WiFi on the Photon ? Right now is very simple for me to use my Particle app and setup a new device but what’s append when my customer far of you ?

I have product just sent publish and another product will able to turn on/off a relay and for that I need to use a token.

Anyone can refer to the right way to done that ?

---

<div class="post-metadata">

**Author:** ![armor](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/armor/32/18398_2.png) [@armor](https://community.particle.io/u/armor)\
**Post date:** [February 26, 2019, 7:46am UTC](https://community.particle.io/t/best-use-case-to-deploying-app-products-using-photon-to-customers/48039/2 "2019-02-26T07:46:05Z")

</div>

@steeves Have you setup your software as a product? If you are going to have many devices out in the field then you will likely need the features in the console to manage devices, groups of devices and software updates even if the application is very simple.

With regards wifi setup there are a few approaches:

1. Use the softap code and example to have the device become a wifi AP and web server that hosts a site to allow a user via a browser to update the wifi credentials.
2. You could write your own mobile app.
3. Build a simple interface (screen and buttons/keyboard input) to allow a user to directly enter wifi credentials to each device.
4. Do a setup via USB serial with a terminal app on a PC and use ‘w’.
5. If wifi credentials are always the same you can hard code them in your application or have them read from external media like an SD card - the details are then deleted after successful setup.

There are probably more options but you get the idea.

---

<div class="post-metadata">

**Author:** ![steeves](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/steeves/32/13652_2.png) [@steeves](https://community.particle.io/u/steeves)\
**Post date:** [February 27, 2019, 1:28am UTC](https://community.particle.io/t/best-use-case-to-deploying-app-products-using-photon-to-customers/48039/3 "2019-02-27T01:28:41Z")

</div>

Thanks @armor

Yes I use products in Particle Console for manage app update etc. For my product using Electron it’s very easy because I made the setup myself, activate the SIM card, test and ship to the customers but for a WiFi product is not the same.

Do I need to ask the customer first for credentials ?  
What’s append when the customer change the WiFi password or SSID on the WiFi Router ?

While I write this message I think I need to search for softap 🙂

Where is the sample to achieve that and example for page customization ?

thanks for sharing

---

<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:** [February 27, 2019, 6:27am UTC](https://community.particle.io/t/best-use-case-to-deploying-app-products-using-photon-to-customers/48039/4 "2019-02-27T06:27:53Z")

</div>

You could look at this post

> [@Photon SoftAP Inputs](https://community.particle.io/t/photon-softap-inputs/31289/23):
>
> This would be one way to add two extra inputs to the index.html (just replace the original with this) const char index\_html[] = "\<!DOCTYPE html\>" "\<html\>" "\<head\>" " \<meta name='viewport' content='width=device-width, initial-scale=1'\>" " \<title\>Setup your device\</title\>" " \<link rel='stylesheet' type='text/css' href='style.css'\>" "\</head\>" "\<body\>" " \<h1\>Connect me to your WiFi!\</h1\>" " \<h3\>My device ID:\</h3\>" " \<input type=text id='device-id' size='25' value='' disabled /\>" " \<button t…

The basics this solution builds on can be found here  
[https://docs.particle.io/reference/device-os/firmware/photon/#softap-http-pages](https://docs.particle.io/reference/device-os/firmware/photon/#softap-http-pages)

---

<div class="post-metadata">

**Author:** ![armor](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/armor/32/18398_2.png) [@armor](https://community.particle.io/u/armor)\
**Post date:** [February 27, 2019, 7:12am UTC](https://community.particle.io/t/best-use-case-to-deploying-app-products-using-photon-to-customers/48039/5 "2019-02-27T07:12:04Z")

</div>

@scruffr beat me to the link. One thing to say about the wifi setup is that you need to initiate the setup and give feedback to a user. If your product already has a screen that’s easy if not then you need at least a button and 1 or 2 LEDs. Lastly, the softAP setup can only handle WPA2 authenticTion and not Enterprise.

---

<div class="post-metadata">

**Author:** ![steeves](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/steeves/32/13652_2.png) [@steeves](https://community.particle.io/u/steeves)\
**Post date:** [March 1, 2019, 3:35pm UTC](https://community.particle.io/t/best-use-case-to-deploying-app-products-using-photon-to-customers/48039/6 "2019-03-01T15:35:23Z")

</div>

Thanks @ScruffR and @armor I’ll look that during the weekend. I try to find the reference for Argon, look not implemented to do the same SoftAP. It’s true ?

---

<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:** [March 1, 2019, 3:40pm UTC](https://community.particle.io/t/best-use-case-to-deploying-app-products-using-photon-to-customers/48039/7 "2019-03-01T15:40:40Z")

</div>

Correct.  
The Argon does currently not support SoftAP and it’s not yet clear if that feature will ever be added.  
The current understanding is that BLE should provide a better UX and hence has a much higher priority than SoftAP.

---

<div class="post-metadata">

**Author:** ![steeves](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/steeves/32/13652_2.png) [@steeves](https://community.particle.io/u/steeves)\
**Post date:** [March 4, 2019, 12:34am UTC](https://community.particle.io/t/best-use-case-to-deploying-app-products-using-photon-to-customers/48039/8 "2019-03-04T00:34:49Z")

</div>

Hi @ScruffR I testing during the weekend the softap on the photon. I am able to make a dummy app from the Web IDE using the lib SoftApLib by Juvenal Guzman and set the correct WiFi.

When I try to use the lib in my program, using Particle Dev soft, I have a problem (see the screenshot)

What’s wrong ?

 ![01](https://us1.discourse-cdn.com/flex026/uploads/particle/original/3X/1/2/12b242913c211f6fabb7e942be34db20c11a3c69.png)

---

<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:** [March 4, 2019, 6:17am UTC](https://community.particle.io/t/best-use-case-to-deploying-app-products-using-photon-to-customers/48039/9 "2019-03-04T06:17:11Z")

</div>

Are you sure you are compiling the correct project?  
AFAICT neither the library nor the example use `stl_vector.h`.

Also what device OS version are you targeting?  
How did you import the library in Dev?

I’d suggest you forget Particle Dev and rather transition to Particle Workbench.

---

<div class="post-metadata">

**Author:** ![steeves](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/steeves/32/13652_2.png) [@steeves](https://community.particle.io/u/steeves)\
**Post date:** [March 4, 2019, 12:39pm UTC](https://community.particle.io/t/best-use-case-to-deploying-app-products-using-photon-to-customers/48039/10 "2019-03-04T12:39:50Z")

</div>

Hi @ScruffR  
In my project I use the lib for OLED SSD1306 and I target Photon 1.0.1.

I import the lib like #include \<SoftAPLib.h\> and like that in the properties dependencies.SoftAPLib=1.0.1

Yes I use Particle Workbench for my others Gen 3 devices

---

<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:** [March 4, 2019, 12:47pm UTC](https://community.particle.io/t/best-use-case-to-deploying-app-products-using-photon-to-customers/48039/11 "2019-03-04T12:47:12Z")

</div>

> [@steeves](#):
>
> Yes I use Particle Workbench for my others Gen 3 devices

And why not for Gen1 & 2?

For your issue with SSD1306 there already is an answer

> [@\[SOLVED\] 0.5.0.rc.1 compile issue with Adafruit SSD1306 library](https://community.particle.io/t/solved-0-5-0-rc-1-compile-issue-with-adafruit-ssd1306-library/22176):
>
> Whilst testing 0.5.0.rc.1 and softAP implementation, found that with the Web IDE there was compiler compatibility issue with the Adafruit Adafruit\_SSD1306 library. Was getting multiple compile time issues like this: /usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4\_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/stl\_vector.h:1108:23: error: macro "swap" requires 2 arguments, but only 1 given swap(vector& \_\_x) For the softAP implementation, one needs to #include “Par…

---

<div class="post-metadata">

**Author:** ![steeves](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/steeves/32/13652_2.png) [@steeves](https://community.particle.io/u/steeves)\
**Post date:** [March 4, 2019, 12:52pm UTC](https://community.particle.io/t/best-use-case-to-deploying-app-products-using-photon-to-customers/48039/12 "2019-03-04T12:52:05Z")

</div>

Look now fixed, I define in this order

#include \<math.h\>  
#include “Particle.h”  
#include \<SoftAPLib.h\>  
#include “Adafruit\_GFX.h”  
#include “Adafruit\_SSD1306.h”

I don’t know the real reason for use Gen 3 with WB but when complete this project, I promise to switch 🙂

Thanks for your help, is not resolved

---

<div class="post-metadata">

**Author:** ![steeves](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/steeves/32/13652_2.png) [@steeves](https://community.particle.io/u/steeves)\
**Post date:** [March 17, 2019, 9:21pm UTC](https://community.particle.io/t/best-use-case-to-deploying-app-products-using-photon-to-customers/48039/13 "2019-03-17T21:21:15Z")

</div>

Hi @ScruffR you ask me 2 weeks agos why I don’t use Particle Workbench ? The problem i tested today just to create a hello word app a tried to compile and flash and I got error. Can you share me please a link when I can be sure to follow instructions ? I am able to compile for Photon but not for Argon

```auto
iMac:test me$ particle compile argon
Compile failed: Target device argon is not valid
        eg. particle compile core xxx
        eg. particle compile photon xxx

```

---

<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:** [March 18, 2019, 4:26am UTC](https://community.particle.io/t/best-use-case-to-deploying-app-products-using-photon-to-customers/48039/14 "2019-03-18T04:26:27Z")

</div>

Can you run `particle --vesion`  
This message suggests you are running an ancient version of CLI. Currently we are at 1.39.0

in Particle Workbench you can run Ctrl/Cmd+Shift+P ![image](https://us1.discourse-cdn.com/flex026/uploads/particle/original/3X/3/f/3fb5f1e137b575aa441204fa8e485908856dc8af.png)

You can also try Ctrl/Cmd+Shift+B to get local building options.

BTW, Particle Workbench doesn’t support the Spark Core.

---

<div class="post-metadata">

**Author:** ![steeves](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/steeves/32/13652_2.png) [@steeves](https://community.particle.io/u/steeves)\
**Post date:** [March 18, 2019, 4:45am UTC](https://community.particle.io/t/best-use-case-to-deploying-app-products-using-photon-to-customers/48039/15 "2019-03-18T04:45:37Z")

</div>

Hi

Version is 1.39.0  
I follow another thread where you indicated the uninstall Local Compilar and reinstall. I am able to compile for Argon like Particle compile argon, I can see the .bin file.

When I try to flash like particle flash my\_argon, no luck

bash-3.2$ particle flash my\_argon  
Including:  
src/bob.ino  
src/bob.cpp  
project.properties  
attempting to flash firmware to your device my\_argon  
Flash device failed: Request Timed Out  
bash-3.2$

---

<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:** [March 18, 2019, 4:51am UTC](https://community.particle.io/t/best-use-case-to-deploying-app-products-using-photon-to-customers/48039/16 "2019-03-18T04:51:21Z")

</div>

When you have a binary, can you run a `particle binary inspect <yourFirmware.bin>` to double check it is actually targeted for Argon (I had instances where that wasn’t the case).

If an OTA update fails try putting the device into Safe Mode and flash again.  
Before running that command, I’d also remove the `bob.cpp` file. This is a byproduct of the local compile but your implicit cloud compile may get tripped up by that.  
If you don’t want to implicitly cloud compile you should run `particle flash my_argon <yourFirmware.bin>` tho’
