Using Particle Dev and WiFi

If I’m using Particle Dev, how can I manipulate the Wi-Fi radio, like WiFi.on()? I presume I need to include a library, but I can’t figure out which one. :frowning:


No you don’t need to add a library manually since the WiFi object gets instanciated and included via application.h which gets automatically #included to .INO projects by the preprocessor or you’ll have to include it yourself in .H/.CPP files.

Thanks. However, I’m using Particle Dev (the stand-along-ish Atom-based editor), and it appears that local compilations do not automagically include application.h. What’s the right way to address this? Do I do something similar to other libraries, namely clone the repository, copy the necessary bits into the same level directory as my application, and then compile locally?

There might be a misconception.
While Particle Dev is a local editor, it does not compile locally but sends the project files to the Particle build farm and downloads the resulting bin.

What’s your main project files name and path?
Do you get any error messages?

Ahhhhh, sorry, my bad. Is there a way to do a completely local toolchain?

The directory is /Users/i831533/src/Arduino/SAP/OCM_demo, and the name of the file is OCMdemo_photon.ino.

Following up to my own post, for some inexplicable reason, it now works. I didn’t change anything. :smile:

1 Like

Yes, you can set up a local toolchain.
A nice and easy installer was put together by @mumblepins and can be found here
Toolchain for Windows Installer

Just saw you got it working now - congrats :+1:
One thing you need to watch out is that you have to save the file, since only the stored files will be compiled and not what you see in the IDE.
This comes from the fact that only stored edits can actually be sent to the build farm :wink:

But to test the accessability of functions like WiFi.on() and such you could try this short sketch (saved in a .INO file)


void setup()
  pinMode(D7, OUTPUT);
  digitalWrite(D7, HIGH);;
  while(!Serial.available);  // wait till you enter some byte via USB serial
  digitalWrite(D7, LOW);
  Serial.println("Now we are connected to WiFi");

void loop()

I don’t suppose there’s a Mac installer for the local toolchain, is there?


There are some threads about that too
[Debugging] Netbeans IDE on Mac OSX [17 June 2015]
Help setting up Eclipse development environment on Mac - SOLVED
(Almost) no-brainer linux virtual machine for firmware building