We want to create a remote sensor - nothing complex but I’ve no idea if the photon is up to the task.
For a commercial application it’s critical the user has to be able to easily set up the wifi credentials and do this in a simple way - to this end the SoftAP code seems crucial.
The sensors need to be visible on the users network and the simplest method is by implementing the webduino web sever - no complex apps need building.
So far so good.
I built and tested the Webduino project - I’m confident enough that I can modify it to show what I want in a simple way.
I’ve built and run the SoftAP project - and that worked.
Now creating a project that has both SoftAP and webduino - compiles ok and runs the server ok, but when flipping into listening mode by holding the button down - the access point runs but there is no setup page displayed when trying to view its web page.
I’ve read that the SoftAP is resource hungry, and may not function like this. So my question is… will it? Am I doing something wrong or am I asking too much of this device, because this is what we expect to be able to do. I would have thought that there would be a complete working example of a webserver running complete with a return to soft AP feature as the basis of a deployable project.
I have got the same issue although I am not using webduino. In my experience my applications require free memory of no less than 39700 bytes to avoid some sort of application hang or softAP page not opening. It is not just softAP, the wifi credentials storage and connection consumes heap/stack - there are some very good topics written on this by @rickkas7.
I don’t know what UI you have, I have got a screen and 4 buttons so it is possible to tell the user that a system restart is required before WiFi setup can be run. I have also had to do a lot of memory organisation (use retained RAM - there is 3K extra there!)
Well, I was just about to delete this topic because I reflashed it and this time it worked.
I’m using nothing but the sample code although I’ve no idea if it’s now going to be reliable enough for commercial deployment. I’m torn between carrying on or looking for a platform that has more resources.
In a nutshell: this is my compile. How do you get 39700 bytes when I can see only 22kb or so in total?
Flash used 34152 / 110592 30.9 %
RAM used 1920 / 20480 9.4 %
If you add logging and monitor on a serial terminal what level of free memory =System.freeMemory();
do you have when you initiate setup? The RAM used is a compiler output not what is happening at runtime!
There is also something I just re-opened another thread on this morning. The free memory varies between devices with exactly the same software and on the same WAP that have been restarted the same way. So it could be that the next flash or compile and flash it won’t work if you are operating on the edge.
Yes - of course it is you’re right!
I’ve only just started playing with this after a break of a few years. I haven’t implemented serial monitor or anything. This was supposed to be a quick get something alive exercise … which in fairness it is.
I failed to get the mDNS code to work properly so jumped to the Weduino + SoftAp.
I would have thought that this concept would be one of the core types of deployment because we don’t want end users managing particle accounts etc. If we limit access to the local network using the webserver we don’t rely on any external cloud nor worrying about managing it for different user accounts etc.
I disagree about the core type of deployment model - otherwise these would not be Internet of Things devices! There are a host of issues with WiFi which is why Mesh is the way to go hence the excitement of everyone who has received their mesh devices to get them working (can you tell mine haven’t arrived yet?!).
but with mesh it still needs a wifi node to be able to see anything on pcs / laptops or mobile devices…
I don’t want to write special apps for IOS and Android with bluetooth, zigbee wont connect to devices without a hub…
Convince me of the alternative plan and I’ll go there!
No it doesn’t, Ethernet Featherwing with a Xenon or Boron 3G. Another issue with WiFi is that for corporate environments - WPA Enterprise security isn’t really working. Corporates consider wired ethernet or 3G much more secure. I do agree that if WiFi works it is easier and cheaper!
It’s cost will be the killer I think. Instead of a single photon ( or whatever) , now I need two mesh devices and a wired gateway. A new enclosure to house the hub + PSU. I can’t see it working for this product at this time.
More crucially, my project just came out of Soft AP mode but isn’t running the webserver - had to reset it physically. I can’t be doing with this
FWIW, I’ve thought about this more. I don’t intend to run a webserver on the device. I’m just going to have it post sensor variables as and when to the cloud. Hopefully the Soft Ap can run and coreside properly with a smaller piece of code which sort of brings me to the next issue… that of best practise for managing several hundred potential end users with their own sensor data being posted to the cloud under one particle account. Subsequently giving each end user a portal to view their sensor data, both current and historic. Is this being done by anyone. Seems like a typical usage scenario… how is this best done?
Going back a few years to when I started with this the architecture decision was to build our own Web App and manage the customer relationship and access through that. That has worked out well and gives the seller of the connected devices most control. However, that comes at a cost, they have sunk a large sum of money into the development of the web app. You may be able to use the Rules Engine or Losant. I don’t know how well these would work and for your project. There are products out in the market now that give you that on a subscription model - take a look at Device Pilot.