User Tools

Site Tools


This is an old revision of the document!

API and Function Reference for the Oak

Particle API

There is a comprehensive user guide over on the site, which provides detail descriptions and examples of the different built-in functions that you can use.

The following Particle Cloud Function APIs are working, whilst the remainder are not available for use (yet). Please note that there is a known bug in the Particle.subscribe() function, where specifying a unique device ID to subscribe to has no effect. This is a bug on their side, and the current workaround is the specify the MY_DEVICES constant instead, in order to limit the subscription to just the devices you own, rather than including all public events also.

  • Particle.variable()
  • Particle.function()
  • Particle.publish()
  • Particle.subscribe()
  • Particle.unsubscribe()
  • Particle.connect()
  • Particle.disconnect()
  • Particle.connected()
  • Particle.process()
  • Particle.syncTime() - though time is not yet connected to anything


All of the ESP8266 2.0.0 APIs are available

Some ESP8266 libraries that change the WiFi connection settings or state may break your Oak. So be prepared to break out a 3.3v USB to Serial adapter, and follow the recovery instructions to restore your Oak if you mess with thouse!


uint8_t Oak.getEmptyRom(void) - returns the number of the rom slot that is currently empty (0,4, or 8 - because there are sub slots as well that aren't currently used)

bool Oak.connect(void) - connect to the configured wifi only, not Particle - called automatically on boot as part of the Particle.connect()

bool Oak.connected(void) - returns true if wifi is connected (even if particle is not) bool Oak.waitForConnection(void) - loops until wifi connects or 15 seconds pass, returns true if connected at end

uint8_t Oak.bootReason(void) - get the reason for the last reboot from the bootloader

void Oak.rebootToUser(void) - reboot to the current user rom

void Oak.rebootToConfig(void) - reboot to the config rom

void Oak.rebootToFallbackUpdater(void) - reboot to the fallback force system updater - do not use

bool Oak.checkRomImage(uint8_t rom_number) - check if the rom image in the slot specified is valid

uint8_t Oak.currentRom(void) - get the slot of the currently running rom

uint8_t Oak.configRom(void) - get the slot of the config rom

uint8_t Oak.userRom(void) - get the slot of the user rom

uint8_t Oak.updateRom(void) - get the slot of the fallback update rom

uint8_t Oak.otaReboot(void) - was the last reboot caused by an attempt to update

SoftAP Protocol

When the Oak is in config mode it exposes an Access Point that the config wizard uses to change settings. This protocol is detailed here:

Commands are available via http, tcp, and serial.

Full list of commands implemented on the Oak are here: Oak Internal URLs

oak/tutorials/api_reference.1460146078.txt.gz · Last modified: 2016/04/08 13:07 by digistump