Will the photon have WPS? I didn’t think it did (though it has a soft API)
You made my day. Its literally the only thing holding me back from finishing and launching. If you can do this it will stop the annoying ( but awesome ) ‘when can we have the final product’ question I keep getting
Let me know if I can do anything to help.
@peekay123 I almost bought 10 photons in my newest order with but ended up just getting regular cores since I needed them ASAP. Can you elaborate on how Photon does the wifi config better?
The photon uses a soft ap instead of the funky smartconfig to configure the wifi credentials.
Core Setup:
Power Up
Connect phone to Wifi
Run App
Photon Setup
Power Up
EITHER: Run App OR {Connect phone to Photon’s Wifi, Run app}
Make sense?
It does. I still hold out hope you can get a viable solution for us core folks to play with. At the end of the day my product wil be photon but I used cores to build them so far
Mostly makes sense, question about this bit though
I expect you to ship your product/device with the core pre-claimed to your own account but with no WiFi credentials
What are your thoughts on going about this? A simple process comes to mind, not sure if I'm underthinking it..
- Plug in the Core to computer that has the firmware file and Spark CLI
- Put the Core into DFU mode
spark flash --usb firmware.bin
- Get the Core's id
spark identify
spark core add <coreId>
(orspark cloud claim
)spark core rename <coreId> <new_name>
Would it be that simple? If so, the script to do that programmatically seems straightforward.
Separate but related, can anyone share experience or good practices on device naming schemes?
I believe the core must be online to be claimed so your steps would require some extra steps
Just tried it out to verify, you’re right. This section of the documentation could use an update. The only place that states the requirement of being online is when you click “Add a Core” within the web IDE.
Hmm, so then…
- Plug in the Core to computer that has the firmware file and Spark CLI
-
spark setup
– gets the core online, claims it, and names it - Put the Core into DFU mode
spark flash --usb firmware.bin
- Clear the wifi credentials
How would you recommend clearing the wifi credentials? Obviously you can do it manually with the mode button. Can they be cleared from the CLI? I suppose you could code it into the firmware – check the network name with WiFi.SSID()
and if it matches certain networks (like the one at the manufacturer) then WiFi.clearCredentials()
Clearing the WiFi credentials is a interesting problem. I don’t believe it can be done with the CLI.
I would be tempted to look into how the CC3000 patch works. So the steps would be like this:
- Plug in Core
Spark Setup
- Put in DFU mode
Spark flash --usb clear_creds.bin
- Core reboots, clears credentials, and then automatically re-enters DFU mode
Spark flash --usb final_firmware.bin
Should work
Simply hold the MODE button and enter Listening Mode (blinking blue) and hold the MODE button till it flashes blue rapidly to clear Wifi credentials
Or see: http://docs.spark.io/firmware/#wifi-clearcredentials
Wow… I should have known that. Though, tbh I think a firmware which cleared the wifi creds and then went back into DFU mode might actually be faster
How would it automatically re-enter DFU mode? I don't see anything in the firmware docs about being able to enter DFU mode programatically.
That’s a good point, it’s not there, but I know from the CC3000 patcher that it’s possible. Let me look into it
[Edit] Ask and ye shall receive. Call the below function anytime and it will reset into DFU mode
void DFUMode()
{
// From https://github.com/spark/cc3000-patch-programmer/blob/master/src/main.cpp
//RESET INTO DFU MODE PLEASE!
FLASH_OTA_Update_SysFlag = 0xFFFF;
Save_SystemFlags();
//THE BACKUP REGISTERS, THEY DO NOTHING!!
//firmware state flag
BKP_WriteBackupRegister(BKP_DR10, 0xFFFF);
//system health -- SET_SYS_HEALTH(0xFFFF);
BKP_WriteBackupRegister(BKP_DR1, 0xFFFF);
//OTA_FLASHED_Status_SysFlag
USB_Cable_Config(DISABLE);
NVIC_SystemReset();
}
Nice! We’ll be trying this method out in 3-4 weeks on 10-15 products, I’ll report back with the experience.
How goes the account-less version of the mobile app?
Slowly unfortunately. It’s a side project so it’s not on my priority “oh god I need to do this now” list which I’ve been having as of late
No worries, I know how you feel. Let me know if I can help with it
I was wondering after you claim the core and send the product to the customer with WIFI cleared.
What happens when the CORE token is forced to refresh.
The customers App would lose communication and be no longer to get data.
How should we handle this?
Thanks again
Once you claim the core it will be associated with your account. Refreshing tokens is another, separate, issue.
Right now there is no concept of a “core” token. You have account tokens which give you access to your account and your cores.
does that make sense?
For a project in my mind, i need that it’s very easy for my customer to pair the device to wifi !
What is the easiest way ?
@blondie63, there are several ways.
You can either:
- Preconfigure the device before sending it to the customer. You’d have to someway get the credentials before hand. Might be a security nightmare
- Have the customer go through the Smart Config process to configure the device once they had it in their hands
- Have the customer plug the device into their computer and configure the device over serial
Have some awesome guy provide us with an app for our prototypes