How to set a WiFi Credential via Internet?

Hello

Lets suppose that I have a spark core in a place that I do not have access, and in that place they decide to change the wireless crendentials. I would like to chage the wifi credential without go there.

is there an option?
Curl, SPARKJS …

Regards

If I may be so bold as to rephrase your question:"can I use the internet, without internet?"
Well, turn of your modem/router and try to browse the web, and you’ll figure that one out soon enough :wink:
If the Core(/photon) isn’t connected to the internet, you can’t send something to it. It’s like talking to empty space, since there isn’t anything that can pick up what you’re saying.
You can only change those credentials when you’re on-site, by either hooking it up to your computer, or by using the Smart Config/Tinker app.

2 Likes

Hello Moors7

As you say, Tinker app can use the internet withouth internet. You can set up the wi-fi credential however the spark core is not connected, I would like to do the same via internet. Do you know how the Tinker app can do that?

Regards

Actually, the Tinker app can’t do cloud interaction without the internet either. For connecting your Core however, no internet access is required. You do need to be connected to the relevant router, and have those credentials on hand.
I’ll try a (REALLY REALLY) simplified explaination of the connection process: when you use the app to connect your Core, the credentials get sent out in tiny packages. These will float through the ether to the router. The Core is able to pick up these packages, combine them, and decrypt them, thus recreating the credentials. It then uses those to connect to the relevant router.
Seeing as the Core need to pick up those packages, you won’t be able to do that over the internet (not to mention the fact that the Core would have to be in listening mode to be able to add credentials).

May I ask what the use case is you’re preparing for? Perhaps there are viable alternatives which you haven’t yet thought of?

The use case is the following:

I would like to sell a product that use the spark core. So I would like to develop a web app that let the user add a new product using the id of the spark core (This part is done). However, I would like also to let them configure the Wifi Credential, They could run the web app on-site and configure the WiFi credentials, So I would like to know how the tinkker app to the process that you described above (protocols, the headers and so on), in order to do the same but using javascript or other language? or Do you know another option to achieve that?

Regards

It may be possible for the core to attempt to connect to wifi, and, when that proves unsuccessful to enter listening mode and then for your clients to get physically close to the core and update the wifi credentials using a similar app like Tinker.

However @Moors7 is correct, once you clients change their wifi password the core will no longer have access to the internet. They would need to get physically close enough to the core to “reset” or “update” the core’s wifi credentials.

Does that make sense?

Hello

Yes, You are right, so How could I develop a tinker similar app to let them to configure. The app have to be a Web so I have to use javascript, I think so., and also How could put the code in the spark that you describe ("the core to attempt to connect to wifi, and, when that proves unsuccessful to enter listening mode ")

Regards

I’m not sure you can put the code you require in javascript as a web app. The core uses SmartConfig by TI to configure itself. Feel free to read up on it here: http://processors.wiki.ti.com/index.php/CC3000_Smart_Config

You might be able to use a java applet embded in a webpage.

As for the listening mode question, let me get back to you

Dear @harrisonhjones, Thank for your help, I would not want to use java, but I´m reading that It is the only way. Your link give me a point to start with my problem. I will be waiting for your help with the listening mode question.

Regards

@1032429417,

I would suggest creating a web app with Serial API that allows you to talk to the core via Serial in Listening mode. This will allow the user to send in wifi credentials via a web page.

However, do remember to add in redundancy for users to revert to this mode in case the SSID/password is incorrect :wink:

What about Photon? How can its wifi be configured without tinker app?

The Spark team has said that Photon will use a SoftAP to set credentials at a minimum. I imagine that there will be other ways to set them as well.