### Particle Boron Setup and Web IDE Usage Source: https://docs.particle.io/quickstart/boron This section details the initial setup of the Particle Boron device and introduces the Particle Web IDE as the primary tool for writing, compiling, and deploying code. It covers device registration, cloud connection, and the basic workflow for programming. ```APIDOC Particle Boron Setup & Programming Workflow: 1. **Device Setup**: Connect the Boron device to a power source and use the online setup application (e.g., https://setup.particle.io/) to register the device with your Particle account and connect it to the Particle Device Cloud. * **Prerequisites**: Android or iOS mobile phone, internet connection. * **Outcome**: Device registered and connected to the cloud, enabling programming and OTA updates. 2. **Web IDE Access**: Open the Particle Web IDE in a new browser tab (https://build.particle.io). * **Purpose**: A web-based environment for writing, compiling, and deploying firmware to Particle devices. * **Alternative**: Particle Workbench (VS Code integration) for a traditional embedded development experience. 3. **Loading Example Code**: Select the 'Blink an LED' example from the Web IDE's example library. * **Functionality**: Loads a pre-written sketch that demonstrates basic device control. * **Code Structure**: Declares variables, configures pins in `setup()`, and implements a blinking pattern in `loop()`. 4. **Target Device Selection**: In the Web IDE's Devices tab, verify that the Boron device intended for programming is selected (indicated by a gold star). * **Purpose**: Ensures the compiled firmware is directed to the correct device when multiple devices are managed. 5. **Compile and Flash**: Click the lightning bolt icon in the Web IDE to compile the code and flash it to the selected Boron device. * **Process**: The Particle Device Cloud compiles the source code into a binary file and sends it over-the-air (OTA) to the device. * **Result**: The Boron device executes the compiled firmware (e.g., blinking the onboard LED). ``` -------------------------------- ### Advanced Setup Options for Particle Devices Source: https://docs.particle.io/troubleshooting/connectivity/cloud-debug Details advanced configuration parameters available during the Particle device setup process. These options allow for fine-grained control over firmware versions, device claiming, and product association. ```APIDOC Advanced Setup Options: - Specific Device OS version: Allows selection of a particular Device OS version for flashing. - Do not claim device: Option to skip the device claiming process. - Force claim a Wi-Fi device using a claim code: Enables claiming a Wi-Fi device with a provided claim code. - Add device to a product: - Sandbox Product | Organization Product: Select the product type. - Organization: Specify the organization. - Product: Specify the product name. - Mark as development device: Designates the device for development purposes. - SIM Select: - No change: Keep the current SIM configuration. - Internal SIM (MFF2 SMD Particle SIM): Use the internal Particle SIM. - External SIM (4FF): Use an external SIM card. - Use Ethernet for connectivity: Enables Ethernet connection. Device Type Configuration: - Device Type: Select between Tracker One or Monitor One. - Restore Type: Choose between Tinker (Factory Default) or Custom User Firmware Upload. - Edge Version: Specify the Edge version. - Device OS Version: Select the desired Device OS version. - Upload File: Browse and select a user binary file for upload. - User Firmware URL: Provide a URL for user firmware. - Setup Bit: - Leave value unchanged: Maintain the current setup bit state. - Mark setup done (run firmware normally): Set up the device to run firmware normally. - Mark setup not done (go into listening mode): Set up the device to enter listening mode. - Flash even if system parts are already the correct version: Forces flashing even if components match. - Update NCP (network coprocessor): Updates the network coprocessor firmware. - Enter shipping mode when done: Puts the device into shipping mode upon completion. ``` -------------------------------- ### Wi-Fi Setup Limitations Source: https://docs.particle.io/troubleshooting/connectivity/cloud-debug Details specific device models and scenarios where the current Wi-Fi setup tool cannot be used, directing users to alternative methods like the Web Device Doctor. ```text This Wi-Fi setup tool cannot be used with the Photon and P1. The Web Device Doctor can be used to set Wi-Fi credentials. ``` ```text This option can only be used to configure Wi-Fi devices. ``` -------------------------------- ### Wi-Fi Setup Status and Guidance Source: https://docs.particle.io/troubleshooting/connectivity/cloud-debug Details the progress and outcomes of Wi-Fi setup, including in-progress messages, completion notifications, failure reasons (e.g., invalid password), and recommended recovery steps. ```text Wi-Fi setup in progress... this can take up to 1 minute. ``` ```text Wi-Fi setup compete. Your device will be reset to activate the new configuration. ``` ```text Wi-Fi setup failed. This can happen if the password is invalid. It may help to reset the device and try again. ``` -------------------------------- ### Initiate Device Setup Wizard Source: https://docs.particle.io/reference/mobile-sdks/ios Demonstrates how to present the Particle device setup wizard to guide users through connecting their Particle devices to Wi-Fi. This is the primary method for initiating the setup process. ```Objective-C ParticleSetupMainController *setupController = [[ParticleSetupMainController alloc] init]; setupController.delegate = self; [self presentViewController:setupController animated:YES completion:nil]; ``` ```Swift if let setupController = ParticleSetupMainController() { setupController.delegate = self self.presentViewController(setupController, animated: true, completion: nil) } ``` -------------------------------- ### Device Setup Error Messages and Explanations Source: https://docs.particle.io/troubleshooting/connectivity/cloud-debug Documents common errors encountered during device setup, such as DFU flashing failures, claiming issues, SIM activation problems, and provides explanations or suggested actions for each. ```text DFU flashing failed. Start over ``` ```text Claiming the device failed. This typically occurs because the device is claimed to another user already, or was previously part of a product. ``` ```text Activating the SIM failed This typically occurs because the SIM card is already assigned to another user or a product. Continue Without Activating If you continue without activating the SIM you may not be able to get online until you manually activate the SIM. ``` -------------------------------- ### Particle CLI Command Example Source: https://docs.particle.io/troubleshooting/connectivity/cloud-debug Illustrates the use of the Particle CLI for monitoring device logs, a common troubleshooting step when the device is not responding with log data via other methods. ```text It appears that the device is not responding with log data. The best way to troubleshoot when this occurs is to use the **particle serial monitor** CLI command. ``` -------------------------------- ### Device Mode Requirements for Setup Tool Source: https://docs.particle.io/troubleshooting/connectivity/cloud-debug Specifies the required device operating modes (listening, normal, blinking, safe) for the setup tool to function correctly, and outlines actions for unsupported modes. ```text The device must be in listening mode (blinking dark blue), normal operating mode (breathing cyan), blinking green, blinking cyan or safe mode (breathing magenta) to use this tool. ``` ```text The device cannot be in safe mode (blinking yellow), reset the device or use the Web Device Doctor to repair it. ``` -------------------------------- ### Setup Function for Particle Device Source: https://docs.particle.io/firmware/software-design/finite-state-machines The `setup()` function initializes cellular connectivity, connects to the Particle cloud, and records the startup time. It's essential for devices configured with `SYSTEM_MODE(SEMI_AUTOMATIC)`. ```cpp void setup() { Cellular.on(); Particle.connect(); stateTime = millis(); } ``` -------------------------------- ### Start Device Setup Wizard (Java) Source: https://docs.particle.io/reference/mobile-sdks/android Invoke the Device Setup wizard within your application by calling `startDeviceSetup()`. This method initiates the device configuration process. ```java ParticleDeviceSetupLibrary.startDeviceSetup(someContext); ``` -------------------------------- ### Particle CLI: Wi-Fi Setup Source: https://docs.particle.io/getting-started/cloud/cloud-api Command to configure Wi-Fi settings for a Particle device. This is typically used when the device is in listening mode (blinking dark blue). ```bash particle serial wifi ``` -------------------------------- ### Blink LED (D7) - Basic Source: https://docs.particle.io/getting-started/hardware-tutorials/hardware-examples This example blinks the onboard D7 LED on Particle devices. It demonstrates basic pin configuration and digital output operations using the Particle Device OS. ```cpp const pin_t MY_LED = D7; void setup() { pinMode(MY_LED, OUTPUT); } void loop() { digitalWrite(MY_LED, HIGH); delay(1s); digitalWrite(MY_LED, LOW); delay(1s); } ``` -------------------------------- ### Basic Setup Function Source: https://docs.particle.io/firmware/best-practices/usb-serial An empty `setup()` function, indicating no specific initialization is required for the serial log handler or system threading in this example. `Serial.begin()` is not needed when using `SerialLogHandler`. ```cpp void setup() { } ``` -------------------------------- ### Install Particle Device Setup Library (Gradle) Source: https://docs.particle.io/reference/mobile-sdks/android Add the Particle Device Setup library to your Android project's build.gradle file. This dependency provides the necessary components for device setup functionality. ```gradle dependencies { implementation 'io.particle:devicesetup:0.7.3' } ``` -------------------------------- ### Particle CLI Setup Commands Source: https://docs.particle.io/hardware/tracker/projects/tracker-4-20ma-quad Commands to execute within the Particle CLI for managing libraries and project setup in Particle Workbench. ```shell particle library copy ``` -------------------------------- ### Tracker Edge Firmware Basic Setup Source: https://docs.particle.io/firmware/tracker-edge/tracker-edge-api-reference Example C++ code demonstrating the basic setup for the Particle Tracker Edge firmware. It includes system thread and mode configuration, logging, and the essential calls to Tracker::instance().init() and Tracker::instance().loop(). ```cpp #include "tracker.h" // EXAMPLE #include "Particle.h" #include "tracker_config.h" #include "tracker.h" SYSTEM_THREAD(ENABLED); SYSTEM_MODE(SEMI_AUTOMATIC); #ifndef SYSTEM_VERSION_v400ALPHA1 PRODUCT_ID(PLATFORM_ID); #endif PRODUCT_VERSION(1); SerialLogHandler logHandler(115200, LOG_LEVEL_TRACE, { { "app.gps.nmea", LOG_LEVEL_INFO }, { "app.gps.ubx", LOG_LEVEL_INFO }, { "ncp.at", LOG_LEVEL_INFO }, { "net.ppp.client", LOG_LEVEL_INFO }, }); void setup() { Tracker::instance().init(); Particle.connect(); } void loop() { Tracker::instance().loop(); } ``` -------------------------------- ### C++ State Machine Class - Fluent Configuration Example Source: https://docs.particle.io/firmware/software-design/finite-state-machines Illustrates how to use the fluent-style configuration methods of the `MainStateMachine` class to set parameters like connection timeout and sleep time before calling the setup method. ```C++ void setup() { mainStateMachine .withConnectMaxTime(10min) .withSleepTime(30min) .setup(); } ``` -------------------------------- ### Particle Device Firmware Binaries Source: https://docs.particle.io/troubleshooting/connectivity/cloud-debug A list of firmware binary files for various Particle hardware platforms, including their required minimum Device OS version. These can be used for manual installation if a compatible browser or computer is unavailable. ```APIDOC Platform Firmware Binaries: | Platform | Required Device OS | | --- | --- | | Argon | 4.0.1 | | Asset Tracker / Monitor One | 4.0.0 | | B-SoM | 4.0.1 | | B5-SoM | 4.0.1 | | Boron | 4.0.1 | | E-SoM-X | 4.0.1 | | Electron | 2.3.0 | | M-SoM | 5.5.0 | | P1 | 2.3.0 | | Photon | 2.3.0 | | Photon 2 / P2 | 5.5.0 | Example Download Link Structure: /assets/files/docs-usb-setup-firmware/[platform_name].bin ``` -------------------------------- ### Device Setup Status Indicators Source: https://docs.particle.io/troubleshooting/connectivity/cloud-debug Lists various status messages and indicators encountered during the device setup process, including connection attempts, claiming, firmware flashing, and restore operations. ```text | ![](/assets/images/device-setup/spinner-48.gif) | Connecting to network | | | ``` ```text | ![](/assets/images/device-setup/spinner-48.gif) | Connecting to the Particle cloud | | | ``` ```text | ![](/assets/images/device-setup/spinner-48.gif) | Claiming device | | | ``` ```text Flashing product firmware complete! ``` ```text Flashing cloud debug firmware complete! Monitor the status using the USB serial debug console. ``` ```text Device restore complete! ``` ```text Restore another device ``` -------------------------------- ### Product Creation and Device Association Source: https://docs.particle.io/getting-started/tracker/tracker-setup Steps for creating a product in the Particle console and associating devices with it. This is essential for managing fleets of Asset Tracker devices. ```APIDOC Product Management: Action: Create New Product Steps: 1. Navigate to the 'Products' section in the Particle console. 2. Click 'New Product'. 3. Select 'Asset Tracker (Cellular)' as the product type. 4. Configure product settings, including enabling geolocation data storage. Action: Add Device to Product Steps: 1. Select the desired Asset Tracker product. 2. Go to the 'Devices' section. 3. Click 'Add Devices' then 'Add One Device'. 4. Enter the Device ID (24-character hex) or serial number. Notes: - Adding a device automatically associates its SIM card with the product. - Mark a device as 'development device' to enable direct flashing from Workbench, CLI, or Web IDE. ``` -------------------------------- ### Web-Based Device Setup Source: https://docs.particle.io/getting-started/setup/setup-options Provides instructions for setting up a Particle device using a web browser. This method typically involves visiting a specific URL to initiate the setup process. ```APIDOC Endpoint: https://setup.particle.io Description: Initiates the device setup process via a web browser. Usage: Navigate to the URL in a web browser to begin. Notes: This is the primary method for initial device configuration and Wi-Fi connection. ``` -------------------------------- ### Particle IO Form Body Authentication Example Source: https://docs.particle.io/getting-started/cloud/cloud-api Provides an example of how an access token might be included in the form body for POST or PUT requests to the Particle IO API. The Content-Type is set to application/x-www-form-urlencoded. ```APIDOC arg=255,255,0&access_token=ffff3e262d049ffffc97c5ffffff81cb84f9ffff ``` -------------------------------- ### Particle CLI Command Example Source: https://docs.particle.io/reference/device-os/wifi-setup-options Illustrates the use of the Particle CLI for monitoring device logs, a common troubleshooting step when the device is not responding with log data via other methods. ```text It appears that the device is not responding with log data. The best way to troubleshoot when this occurs is to use the **particle serial monitor** CLI command. ``` -------------------------------- ### Monitor Edge Firmware Basic Setup Source: https://docs.particle.io/firmware/tracker-edge/monitor-edge-api-reference Demonstrates the essential setup for the Monitor Edge firmware, including system threading, mode, product identification, startup routines, and logging configuration. This code should be placed in your main application file. ```cpp #include "Particle.h" #include "edge.h" SYSTEM_THREAD(ENABLED); SYSTEM_MODE(SEMI_AUTOMATIC); #if EDGE_PRODUCT_NEEDED PRODUCT_ID(EDGE_PRODUCT_ID); #endif // EDGE_PRODUCT_NEEDED PRODUCT_VERSION(EDGE_PRODUCT_VERSION); STARTUP( Edge::startup(); ); SerialLogHandler logHandler(115200, LOG_LEVEL_TRACE, { { "app.gps.nmea", LOG_LEVEL_INFO }, { "app.gps.ubx", LOG_LEVEL_INFO }, { "ncp.at", LOG_LEVEL_INFO }, { "net.ppp.client", LOG_LEVEL_INFO }, }); void setup() { Edge::instance().init(); } void loop() { Edge::instance().loop(); } ``` -------------------------------- ### STARTUP() Limitations and Best Practices Source: https://docs.particle.io/reference/device-os/api/macros/startup STARTUP() is best suited for setting GPIO states very early and should avoid most system calls, I2C, SPI, and reliance on global variables due to unpredictable initialization order. Networking setup should remain in setup(). ```APIDOC STARTUP() Macro Usage Guidelines: Purpose: Execute code very early in the startup sequence, ideal for initializing digital I/O and peripherals. Limitations: - Avoid most system calls (e.g., System.sleep(), Particle.publish()). - Avoid I2C (Wire) and SPI. - Do not rely on global variables being fully initialized. - Code referenced by STARTUP() runs before setup(), but I/O pins are in their default INPUT state for a period. Recommended Usage: - Setting GPIO state (e.g., pinMode, digitalWrite). - Calling specific functions like WiFi.selectAntenna() on Gen 2 devices. - Calling System.setPowerConfiguration() or System.enableFeature(). Gen 2 Devices (STM32 - E-Series, Electron, Photon, P1): Acceptable calls include: - cellular_credentials_set() - WiFi.selectAntenna() - Mouse.begin() - Keyboard.begin() Pin Behavior (D3, D5, D6, D7): - Briefly taken over for JTAG/SWD after reset. - D3, D5, D7 are pulled high. - D6 is pulled low. - D4 is left floating. - This state change can affect circuits connected to these pins. ``` -------------------------------- ### Device OS API Reference Link Source: https://docs.particle.io/troubleshooting/connectivity/cloud-debug Provides a link to the comprehensive Device OS API reference for in-depth device programming. ```text * Get deep into device programming with the [Device OS API reference](/reference/device-os/firmware/). ``` -------------------------------- ### Download Tracker Edge Firmware (ZIP) Source: https://docs.particle.io/getting-started/tracker/tracker-eval-tutorials Download a pre-configured project zip file for Particle Workbench to get started with the Tracker Edge firmware. This simplifies the initial setup for prototyping. ```text Download **tracker-temperature.zip** Open the **tracker-temperature** folder in Workbench using **File - Open...** From the Command Palette (Command-Shift-P or Ctrl-Shift-P), use **Particle: Configure Project for Device**. ``` -------------------------------- ### Device OS API Reference Link Source: https://docs.particle.io/reference/device-os/wifi-setup-options Provides a link to the comprehensive Device OS API reference for in-depth device programming. ```text * Get deep into device programming with the [Device OS API reference](/reference/device-os/firmware/). ``` -------------------------------- ### Synchronize LEDs on Beam Break Source: https://docs.particle.io/getting-started/hardware-tutorials/hardware-examples This example uses two Particle devices on the same account. When a beam is broken on either device, the blue LEDs on both devices light up. When the beam is intact again, both LEDs turn off. ```cpp // This is a placeholder for the actual C++ code that would be flashed to the Particle devices. // The provided text describes the functionality but does not include the full code snippet. // Example functionality: // void setup() { // // Initialize pins, cloud communication // } // void loop() { // // Read sensor state // // Publish state changes // // Subscribe to state changes from other devices // // Control D7 LED based on received state // } ``` -------------------------------- ### TCPClient Example Usage Source: https://docs.particle.io/reference/device-os/api/tcpclient/tcpclient Demonstrates how to use the TCPClient class to establish a connection to a web server, send an HTTP GET request, and read the response. It includes setup for serial communication and error handling for connection failures. ```cpp // EXAMPLE USAGE TCPClient client; byte server[] = { 74, 125, 224, 72 }; // Google void setup() { // Make sure your Serial Terminal app is closed before powering your device Serial.begin(9600); // Wait for a USB serial connection for up to 30 seconds waitFor(Serial.isConnected, 30000); Serial.println("connecting..."); if (client.connect(server, 80)) { Serial.println("connected"); client.println("GET /search?q=unicorn HTTP/1.0"); client.println("Host: www.google.com"); client.println("Content-Length: 0"); client.println(); } else { Serial.println("connection failed"); } } void loop() { if (client.available()) { char c = client.read(); Serial.print(c); } if (!client.connected()) { Serial.println(); Serial.println("disconnecting."); client.stop(); for(;;); } } ``` -------------------------------- ### Blink LED (D7) - Faster Blink Source: https://docs.particle.io/getting-started/hardware-tutorials/hardware-examples An alternative example for blinking the onboard D7 LED on Particle devices, using shorter delay intervals for a faster blink rate. Demonstrates using milliseconds for delay. ```cpp const pin_t MY_LED = D7; void setup() { pinMode(MY_LED, OUTPUT); } void loop() { digitalWrite(MY_LED, HIGH); delay(250ms); digitalWrite(MY_LED, LOW); delay(250ms); } ``` -------------------------------- ### Tracker Edge Firmware Manual Download Source: https://docs.particle.io/hardware/tracker/projects/tracker-gpio Instructions for manually downloading and setting up the Tracker Edge firmware from GitHub, including submodule initialization. ```shell git clone https://github.com/particle-iot/tracker-edge cd tracker-edge git submodule update --init --recursive ``` -------------------------------- ### Install React Native Dependencies Source: https://docs.particle.io/reference/device-os/wifi-setup-options Installs project dependencies for the React Native BLE setup using npm. The `--legacy-peer-deps` flag is used to resolve potential conflicts between React versions. ```bash cd rn-ble-setup npm install --legacy-peer-deps ``` -------------------------------- ### MCP23008-RK Library Installation Source: https://docs.particle.io/hardware/tracker/projects/tracker-gpio Instructions for installing the MCP23008-RK library via the Particle Workbench Command Palette. ```APIDOC Library Installation: - Open the Command Palette in Workbench. - Select 'Particle: Install Library'. - Enter 'MCP23008-RK' and press Enter. Library Documentation: - Available at: https://github.com/rickkas7/MCP23008-RK ``` -------------------------------- ### Command Line Interface (CLI) Setup Source: https://docs.particle.io/getting-started/setup/setup-options Details the setup process using the Particle Command Line Interface (CLI). This method is for developers who prefer terminal-based operations. ```APIDOC Command: particle setup cli Description: Guides the user through setting up Particle devices using the command-line interface. Usage: Execute the command in a terminal after installing the Particle CLI. Prerequisites: Particle CLI must be installed. Related Commands: particle serial wifi, particle usb connect ``` -------------------------------- ### Particle CLI Command Example Source: https://docs.particle.io/tools/doctor Illustrates the use of the Particle CLI for monitoring device logs, a common troubleshooting step when the device is not responding with log data via other methods. ```text It appears that the device is not responding with log data. The best way to troubleshoot when this occurs is to use the **particle serial monitor** CLI command. ``` -------------------------------- ### Android Native Example - MainActivity Configuration Source: https://docs.particle.io/reference/device-os/wifi-setup-options This Java snippet configures the `setupCode` and `mobileSecret` variables within the `MainActivity` for the Particle Android BLE example. It specifies the device name for setup and the mobile secret used for authentication, which is typically found on the device's QR sticker. ```Java private final String setupCode = "aabbcc"; // Mobile secret available on the QR sticker on the device private final String mobileSecret = "AAAAAAAAAAAAAAA"; ``` -------------------------------- ### Curl Example: Get Integration Source: https://docs.particle.io/reference/cloud-apis/api Example using curl to retrieve a specific integration by its ID from the Particle IO API. ```bash curl https://api.particle.io/v1/integrations/12345 \ -H "Authorization: Bearer :access_token" ``` -------------------------------- ### Blink LED (D7) - Startup Execution Source: https://docs.particle.io/getting-started/hardware-tutorials/hardware-examples This code snippet includes the SYSTEM_THREAD(ENABLED) directive, ensuring the LED blinking code runs immediately at startup, before the device connects to the Particle cloud. ```cpp SYSTEM_THREAD(ENABLED); const pin_t MY_LED = D7; void setup() { pinMode(MY_LED, OUTPUT); } void loop() { digitalWrite(MY_LED, HIGH); delay(1s); digitalWrite(MY_LED, LOW); delay(1s); } ``` -------------------------------- ### List Products API Source: https://docs.particle.io/getting-started/cloud/cloud-api Details the API endpoint for listing all products available in the sandbox for the authenticated user. This is a simple GET request. ```APIDOC List Products API: Endpoint: /reference/cloud-apis/api/#list-products Method: GET Description: Retrieves a list of all products accessible within the user's sandbox. Request: Headers: Authorization: Bearer Body: None Response: Status: 200 OK Body: A JSON array of product objects, each containing details like product ID, name, etc. ``` -------------------------------- ### Compile Example Applications Source: https://docs.particle.io/getting-started/device-os/firmware-libraries Compiles the example applications for your library to ensure they function correctly with the migrated structure. Replace `` with the actual name of your example application. ```bash particle compile photon examples/ ``` -------------------------------- ### Curl Example: Get Integration for Product Source: https://docs.particle.io/reference/cloud-apis/api Example using curl to retrieve a specific integration by its ID for a given product from the Particle IO API. ```bash curl https://api.particle.io/v1/products/:productIdOrSlug/integrations/12345 \ -H "Authorization: Bearer :access_token" ``` -------------------------------- ### Particle CLI - Compile and Flash Examples Source: https://docs.particle.io/getting-started/developer-tools/workbench Commands for compiling library examples for specific device targets and flashing them to devices. Supports saving compiled firmware and OTA flashing. ```APIDOC particle compile [--saveTo ] Compiles a library example for a specified device target. Parameters: target: The target device platform (e.g., 'boron'). source: The path to the library example directory (e.g., 'examples/1-simple'). --saveTo : Optional. Specifies the output filename for the compiled binary (e.g., 'firmware.bin'). Returns: A compiled firmware binary file. Example: particle compile boron examples/1-simple --saveTo firmware.bin particle flash Compiles and flashes a library example to a specified device. Parameters: device: The name or ID of the target device (e.g., 'test2'). source: The path to the library example directory (e.g., 'examples/1-simple'). Returns: The compiled firmware flashed to the device. Example: particle flash test2 examples/1-simple ``` -------------------------------- ### Particle IO GET Request with Authorization Header (jQuery) Source: https://docs.particle.io/getting-started/cloud/cloud-api Demonstrates how to make a GET request to the Particle IO API using jQuery, including the access token in the Authorization header. This method is recommended for all request types. ```javascript $.ajax({ dataType: 'json', error: function(jqXHR) { // Error handing code here }, headers: { 'Authorization': 'Bearer ' + accessToken, 'Accept': 'application/json' }, method: 'GET', success: function(resp, textStatus, jqXHR) { // Success handling code here }, url: 'https://api.particle.io/v1/devices/' + deviceId + '/' + variableName }); ``` -------------------------------- ### Device OS API Reference Link Source: https://docs.particle.io/tools/doctor Provides a link to the comprehensive Device OS API reference for in-depth device programming. ```text * Get deep into device programming with the [Device OS API reference](/reference/device-os/firmware/). ``` -------------------------------- ### Library Directory Structure Example Source: https://docs.particle.io/firmware/best-practices/libraries Details the typical directory layout created when a library is installed locally into a Particle Workbench project, including source files, examples, and license information. ```cpp lib/ CellularHelper/ examples/ library.properties LICENSE README.md src/ CellularHelper.cpp CellularHelper.h ``` -------------------------------- ### Install Expo EAS CLI Source: https://docs.particle.io/reference/device-os/wifi-setup-options Installs the Expo Application Services (EAS) command-line interface globally. This tool is required for building and managing Expo projects, including cloud builds. ```bash npm install --global eas-cli ``` -------------------------------- ### Particle Workbench Firmware Setup Source: https://docs.particle.io/hardware/tracker/projects/tracker-gpio Steps to download, import, and configure the Tracker Edge firmware project using Particle Workbench for local or cloud flashing. ```APIDOC Project Setup: 1. Download tracker-an013.zip. 2. Open the 'tracker-an013' folder in Particle Workbench. Device Configuration: - Use 'Particle: Configure Project for Device' from the Command Palette. Flashing: - Cloud Flash: Use 'Particle: Cloud Flash'. - Cloud Compile: Use 'Particle: Cloud Compile'. - Local Flash: Open CLI window via 'Particle: Launch CLI', then run 'particle library copy'. Development Device Marking: - Ensure the Tracker device is marked as a development device in the Tracker product console to prevent overwriting flashed firmware. ``` -------------------------------- ### Carthage Dependency Setup Source: https://docs.particle.io/reference/mobile-sdks/ios Integrate the Particle iOS Photon Setup Library by adding its repository to your Cartfile and running the Carthage update command. This process fetches and builds the necessary frameworks for your project. ```Text github "particle-iot/particle-photon-setup-ios" ~> 1.0.0 ``` ```Shell carthage update --platform iOS --use-submodules --no-use-binaries ``` -------------------------------- ### Modbus Example Project Source: https://docs.particle.io/hardware/muon-hats/rs485-can-hat A simple example project demonstrating how to read a Modbus temperature and humidity sensor using the RS485 interface. This project requires the appropriate hardware setup and libraries. ```cpp ``` ``` ```