Photon working as a standalone micro

What is the code needed to have the Photon work as a standard (non-connected) micro?

I have an application that will be tested in an area without an online connection so I do not want the Photon to keep searching for a connection. Rather, I just need it to run its program …

Have you tried searching the forum for terms like “without wifi”?

2 Likes

Thank you @ScruffR. This search worked. I had tried a different search but the results were all about not being able to connect …

2 Likes

Hi @ScruffR,

I tried your post in:

As soon as I add the following statements,

SYSTEM_MODE(SEMI_AUTOMATIC)
SYSTEM_THREAD(ENABLED)

I get this error:

expected constructor, destructor, or type conversion before '(' token

We’d need to see more of your code to tell.
You can also post a SHARE THIS REVISION link for us to test your exact project.

Thank you @ScruffR.

When I moved the statements from the first lines to later, the code compiled. Is this a bug?

Below are the first lines in the code:

//=============================================================================
//SYSTEM_MODE(SEMI_AUTOMATIC)
//SYSTEM_THREAD(ENABLED)

#include "application.h"
#include "SdFat.h"

#include <math.h>

#include <PublishManager.h>              //https://github.com/bveenema/PublishManager
PublishManager<> publishManager;

#include "Adafruit_VC0706.h"

#include "ParticleFtpClient.h"
#include <time.h>

using namespace particleftpclient;
ParticleFtpClient ftp = ParticleFtpClient();

SYSTEM_MODE(SEMI_AUTOMATIC)
SYSTEM_THREAD(ENABLED)

//=============================================================================

What would happen if SYSTEM_THREAD(ENABLED) is not used in the case of no WiFi?

Thanks again.

The problem is potentially related to #include "application.h" (which should now rather be #include <Particle.h>).
Since this is usually included at the top of the code by the preprocessor automatically when dealing with .ino files, you’d not need to include it at all, hence we don’t normally see this kind of issue.

1 Like

Thank you @ScruffR. Will make the change.