Communicate directly to a Photon (no WiFi network)?

Hi all,

I can unfortunately not find a definitive answer to this question on the forums, nor on the References.
For the company I’m working at we are looking into setting out a series of prototypes to users in the field. We want people to have a small device with them and a smartphone app that they can control the device with. They will use it outdoor (n = 50 to n = 300)

I would like the smartphone app to communicate to a Photon driving the device directly. This is crucial, since we are often outdoors, there is no opportunity for ‘connecting to an SSID’. Also, we do not want to bother our use population with ‘connecting the photon to whatever WiFi you at’. I am interested in using the Photon because I have good experience with them in other projects.

I see a lot of replies by ‘mdma’ in various topics that this feature was ‘soon to be implemented’, which were all in either 2015 or 2016. Mentioning things like ‘direct photon to photon communication’ or ‘wifi direct support’.

I would like to know if this is possible.
EDIT: Does it work by using WiFi.listen() in combination with the system thread? So that it creates a SoftAP and I can make smartphone apps connect to it and exchange data? Or is this not feasible / another way?

SoftAP should work, but it somehow doesn’t line up with this statement of yours

SoftAP would require your users to connect their phones to the Photon’s SoftAP.

Thanks, that’s good to hear.
What I meant was, that people do not have to connect to variable (public) WiFis while they are outdoors (train station, library, etc…) to keep the system working. But connecting to the same SoftAP (the Photon) is no problem.

How would this work? Instead of Particle.publish(), what method would I need to use to send and receive commands from the Photon in an app? I’m experienced in software development (inc Android) but would like to know in which direction to go to realize this direct communication.

I see.
In that case, would it be feasible to have the user store a set of WiFi credentials on the device that allows it to connect to the users mobile hotspot so that it can connect to the cloud through that as soon the user has the hotspot enabled and comes close to the device?
This would seem to be a more intuitive approach IMO.

But if you want to go for SoftAP, my first choice would be via a custom SoftAP web page as shown here
Photon SoftAP Inputs

Or you could go with TCPClient/TCPServer

I will discuss your first suggestion here within the team, even though I feel reluctant about it.
The user population we are approaching for our research are ‘regular users’, non-tech savy (not like you and me).
I would not like to instruct and teach them about what a ‘mobile hotspot’ is and/or have a selection criterion for our users that they need to have ‘a mobile cellular data bundle’ if they want to participate in the study.

Your suggestion on SoftAP and custom web page is clear, thanks. We will also look into that.

Hmm, I think most users of smart phones should be smart enough to understand what their omnipresent pocket companion is capable of.
Even my non-techy 70 year old mother is using her phone hotspot to tether her tablet to, and I don’t think the average Dutch is anywhere less techy than she :wink:

But sure, you know your focus group best - just don’t underestimate them, rather try to confirm your gut-feeling and base your decission on that.
Or even offer both options and let them choose.

3 Likes

Hi all,

I could not find anything about WiFi direct in the documentation yet. Does that mean it is still not implemented? I need to communicate between particle photon and a laptop in outdoor without a repeater. I can see softap can work in this situation. Should I continue with softap implementation? or there is development towards wifi direct?

I am not aware of any plans to implement wifi direct on the Photon.

I should proceed with softap for point to point communicaiton?

@ashokbhayal, I am not aware of any other way to connect without a WiFi AP so yes.

@peekay123, I was able to create soft AP and put photon into listening. But according to documentation softAP mode blocks application code, and accepts only WiFi credentials. How can i exchange data between them?

SYSTEM_THREAD(ENABLED) will take care of that.