Need Advice with "Small scale Family Project" & photon setup

Hi,

i am building something inspired by this as a christmas present for my family. (will share of course when done)

the 3 prototypes are working fine so far (not yet in “lamp form”).

Since i will give these lamps away to “not so technical persons” as well and i dont want them to claim their photons (they wont even know what that means) i still need to give them the possibility to connect to their WiFi of course.

Here are my plans, and i would appreciate some advice if this makes no sense or there is a better way to do this.

  • The Photons are in Semi-Automatic Mode and the Status LED is mirrored to the whole lamp (see here)
  • If there is no (Cloud) Connection in like 30 Seconds, automatically switch to listening mode (WiFi.Listen())
  • Make my own android app like the SDK Setup example for WiFi Connection Setup
  • Leave out all the Claiming and Tinkering Stuff.
  • The only way i can think this is possible would be to HARDCODE my credentials in the Android App. Not sure if that would be such a good idea (and i dont know if it is even possible to do it that way. i am also not yet really comfortable with Java/Android since i am more of a .net Coder.
  • Bonus: Of course some friends and coworkers i showed the prototypes are also interested - so in case i build & maintain more of them i also have to think about a possibility to define “groups” of devices or even let the user do this.
  • I am not yet ready for upgrading my account - 49$ per month for a christmas present on top of the devices itself is not really negotiable to my wife (-; - this wouldnt help me with WiFi Setup anyways i guess.

EDIT: Now that i wrote all this down it comes to my mind that i probably wont need any credentials at all for the (already claimed by me) photons in the android app just for softAP WiFi setup.

2 Likes

About the WiFi, you could also make an easy windows application that sets the credentials via serial. Very easy to do, requires a little amount of programming and no need to hardcode any credentials.

Setting the ‘groups’ of devices could be done in a similar way. Then, using particle.publish() you could pass the groupname as well, besides the colours, making only specific devices that are in that certain group listen to that publish.

Connecting the device to a WiFi network is one thing, but how do you intend to control your gift once it’s connected?

If you want to use e.g. Particle.function() you’d need the access token and so you may need to think how you’ll go about either sharing your own token with others or have different accounts which you share (or not) with your family to have seperate access tokens for yourself and different user groups.

Why would any of my family members need my (or any) token?

All photons would stay in my own account, preinstalled with my firmware (incl. function/publish/subscribe).

All they would have to do is touch the lamp and it lights up (and all the other ones in that group too) - which is already working actually.

It’s actually not that difficult to accomplish what you want to do. The easiest way, would be to hardcode their Wi-Fi credentials into the photon. Then, when they bring their unit home, It should simply work.

wifi.setCredentials()

That was what I meant, but not worded right.

Should they be able to use Particle.function() and such or will only you do this?
In the first case they’d need a token in the latter not.


But some other thoughts

I’d rather go for some on-demand solution since the WiFi might drop during night and if placed next to the bed I would find it a bit anoying if blinking blue Listening Mode would wake me up :wink: (sure it could be switched off at night too)

  • add a button (e.g. duplicate the SETUP button, which would be good for troubleshooting over the phone e.g. to put the Photon into Safe Mode or so)
  • or have a timeout after power up, after e.g. 5min don’t go into Listening Mode anymore -
  • or set a less “intrusive” light pattern for Listening Mode

I’m not sure if this actually works unless you also set the encryption cipher in addition to the encryption scheme (which the future user might not actually know ;-)).
And what if they decide to change their WiFi credentials?

You could also try one of these browser-based solutions. Keep in mind that safari is problematic, but Chrome should work:

3 Likes

Ah ok, now i get it.

If there would be any external control of the lamps via clients like an android app i would let these clients talk to my server (or azure) and handling the api calls there.

The button approach might be a good idea. I will test some szenarios as soon as i have the final design ready and in lamp form.

1 Like

that looks nice. i’ll check it out

Edit: That actually works right out of the box - even from my mobile phone.

2 Likes

Yeah, you have to know what kind of wifi network your family is on.

The use case suggests that it need not be too complicated a solution that encompasses every possible failure mode.

:wink:

you’re right… still, it also should work for a long time without me driving through the country with my laptop every time they change their WiFi or get a new router :wink:

also: as failsafe as possible - yes. easy: no

i also take these opportunities to learn as much as somehow possible (even if this should actually include learning a bit of Java. :relaxed:

i DID fell in love with that browser-based tool for now though…

3 Likes

@smnnekho I’m glad you found the browser-based tool helpful.

I’d like to point out that you can very, very easily create an .exe or .app that acts exactly like that browser-based tool. The instructions are in the readme. It truly requires a very basic level of command line knowledge.

That approach will be much smoother since it’ll automate the setup procedure. Just something to think about if you want to make a very low-friction package.

Thanks @msolters, i went for the html/js option and included the html + js files as assets in my android app and display them in a webview. that way i dont even need to have internet access before connecting to the photon. Exactly what i needed and it works great.

http://community.particle.io/t/photon-softap-usage/11035/187?u=smnnekho

Apologies for being a numpty,
So, I’m not a Java / web coder and the first time I ever saw / read up on meteor was today.

Trying to create ‘my own label’ version of the SoftAP setup using meteor.
But first ensure I can get the unmodified version to work.

I’ve taken the zip file from github , I’ve run it locally which seemed to work, so I tried to simply deploy it to my own name at meteor, and it tells me that it is now serving at xxxx.meteor.com, but all that happens is I get a message saying Website crashed.
Any advice appreciated.

Sure @rowifi, that’s an easy fix.

Out of the box, the Meteor app is designed to be launched as a local (“native”) Electron app. This allows it to be distributed as a standalone executable.

The problem is, that the Meteor cloud won’t allow an app to be launching its own executables, so it produces the error you see. The meteor log command should tell you more, if you’re interested.

The easiest fix is to remove the package that includes Electron:

  meteor remove arboleya:electrify

After doing this, re-run the Meteor app, and then re-deploy. The deployed web site should then work fine!