Cannot setup Spark Core using Android app SDK

Not sure if this was already addressed somewhere…apologies if it was.

I have a Spark Core and I am trying to set this up using my Android mobile app which I have created using the latest sdk. Login to Particle all working fine. After login, I start a new screen/activity where I am trying to do device setup using setup APIs (ParticleDeviceSetupLibrary.startDeviceSetup(this):wink: But when I start the setup (clicking on the “Ready” button in the particle provided screen), it complains that “No Photon Device Found” in the next page. (Of course, I am in the same wifi network and particle login was successful using cloud sdk).

My device was earlier setup (discovered and claimed) using Tinker app when I first started using it. So I reset this (holding mode button for 3 seconds) and tried to set up again from my app, it looks like the app cannot recognize my Core.

Is Core setup not supported with Android sdk? What would be the solution?
Would really appreciate your help.

Thanks,
Sanjoy

I’m not sure, but this puzzles me

vs.

Are you sure you’re using the correct setup procedure?
In the Particle app you need to choose between adding a Core or a Photon which are two seperate procedures.

I am simply following the device setup guide for android app. Didn’t find anything specific for setting up core.
Also I have no control when particle setup wizard takes over.
Do I needed to change/customize anything so my setup API call tries to discover a core from the network?
If you can provide some more details for those separate procedures you mentioned, that would be great.

It’s a long time since I ploughed through the Particle Android app, but if you can look at the current app source you might get some pointers.

@sdash re: the device setup lib, Core devices aren’t supported. There is support in the Particle app itself for setting up a Core, but that support consists of launching the old Spark Core setup app (or pushing you to the Play store to get the app if it’s not installed).

FWIW, the Spark Core app is open source though, so feel free to check out how that works here: https://github.com/spark/android-app This is a good starting point for most of the setup specific code for the core: https://github.com/spark/android-app/blob/master/SparkCore/src/io/spark/core/android/smartconfig/SmartConfigService.java

Hope that helps.

@jensck, thanks a ton! Took a quick look into these. Looks like I have to do a lot of plumbing and need to create a separate app for Core setup. So some work needs to be done to make that work from my own app. Since I am not an Android expert, and already made some progress on my current app using the latest Particle android sdk, I think I would rather stick to this and get a photon instead. Also, eventually my final uptake would be bluz boards for this project, so would make sense to make my current app work. (Assuming device setup would work seamlessly for bluz devices as well since those are essentially photons and extends Particle cloud capabilities anyway. May be @eely22 can confirm?).

However, I think it would be good to have the latest device setup sdk support Core as well. Will it be hard to integrate the SmartConfig in the current setup API implementation? Isn’t there strong enough requirement? Just trying to understand…

Will it be hard to integrate the SmartConfig in the current setup API implementation?

It wouldn’t be hard per se, but it would be a good amount of work.

Isn’t there strong enough requirement? Just trying to understand…

No problem. I’m not aware of any hard technical barrier to including support for the Core; as you guessed, I think it’s mostly an issue of demand (or a relative lack of it). I’m not in a position to comment officially though – @ido or @zachary , either of you care to chime in on this?

I haven’t spent a lot of time with the Particle Android SDK to be honest. Our app, for now, is mainly the gateway code. Setup isn’t the same with bluz since there is no need to pass credentials to the device (so no SoftAP or CC3000 Smart Config). Essentially, you just pick a Bluetooth LE device, and it connects to the cloud.

The only real setup we have to worry about is claiming the device and particle account login. That we will probably use the SDK for, and will add that soon.

Thanks @jensck! I could integrate the setup wizard into my own app using a Photon!

Eric, thanks for your comments. What I understand from your post is that gateway would connect to the wifi automatically, without having to pass any credentials from the app. But then how does gateway really get connected to wifi without credentials - is there other mechanism? Didn’t quite get that… Also claiming the gateway via app is not yet available - is this only for Android or iOS also?
We can connect offline on these.

Don’t want to speak for Eric, but as I understand their gateway it’s using a Photon or a P0/P1 module so the WiFi setup for this part of it will in fact be Particles standard procedure.