Registering ESP32 with Sigfox: Device IDs & PAC Keys Setup

Sigfox is a leading Low-Power Wide-Area Network (LPWAN) technology designed for IoT applicationsConnecting ESP32 to Cloud Services via Wi-FiConnecting ESP32 to Cloud Services via Wi-FiDiscover how to connect your ESP32 to AWS, Azure, and Google Cloud using secure Wi-Fi. This guide covers setup, error handling, and low power strategies. that require infrequent, small data transmissions over long distances. To integrate an ESP32-based device into the Sigfox network, secure registration is essential. This involves managing Device IDs and PAC Keys, which are critical for authentication and secure communicationConnecting ESP32 to Cloud Services via Wi-FiConnecting ESP32 to Cloud Services via Wi-FiDiscover how to connect your ESP32 to AWS, Azure, and Google Cloud using secure Wi-Fi. This guide covers setup, error handling, and low power strategies.. This guide provides a detailed walkthrough of the registration process, credential management, and best practices for deploying Sigfox-enabled ESP32 devices.

Table of Contents🔗

1. Understanding Device IDs and PAC Keys

2. SigfoxSigfox Message Encoding: Packing Sensor Data into 12-byte PayloadsSigfox Message Encoding: Packing Sensor Data into 12-byte PayloadsLearn efficient data encoding techniques for Sigfox's constrained 12-byte payloads. Discover bitwise operations, structured encoding & CBOR strategies. Device Registration Workflow

3. Retrieving Device Credentials

4. Registering a Device on the SigfoxSigfox Message Encoding: Packing Sensor Data into 12-byte PayloadsSigfox Message Encoding: Packing Sensor Data into 12-byte PayloadsLearn efficient data encoding techniques for Sigfox's constrained 12-byte payloads. Discover bitwise operations, structured encoding & CBOR strategies. Backend

5. Securing Device Credentials

6. Practical Implementation on the ESP32Setting Up ESP32 as a Wi-Fi Access PointSetting Up ESP32 as a Wi-Fi Access PointMaster ESP32 AP configuration with our step-by-step guide. Set up a secure, local IoT network using practical code examples and optimization tips.

7. Best Practices and Security ConsiderationsZigbee Over-the-Air (OTA) Firmware Updates with ESP32 CoordinatorsZigbee Over-the-Air (OTA) Firmware Updates with ESP32 CoordinatorsSecure your IoT network with OTA firmware upgrades using an ESP32 coordinator. Our guide details firmware setup, packaging, security, and troubleshooting.

8. TroubleshootingConnecting ESP32 to Cloud Services via Wi-FiConnecting ESP32 to Cloud Services via Wi-FiDiscover how to connect your ESP32 to AWS, Azure, and Google Cloud using secure Wi-Fi. This guide covers setup, error handling, and low power strategies. Registration Issues

Understanding Device IDs and PAC Keys🔗

Every SigfoxSigfox Message Encoding: Packing Sensor Data into 12-byte PayloadsSigfox Message Encoding: Packing Sensor Data into 12-byte PayloadsLearn efficient data encoding techniques for Sigfox's constrained 12-byte payloads. Discover bitwise operations, structured encoding & CBOR strategies. device is assigned two critical credentials:

ParameterDescriptionExample Format
Device IDUnique 32-bit identifier for the device.1A23B4C5
PAC Key128-bit Pre-Authentication Code (PAC) used for initial device activation.4D6F7A... (hex)
  • Device ID: Publicly visible but immutable. Used for device addressing.
  • PAC Key: Private and used only once during device activation. After activation, a Session Key is generated for ongoing communication.

These credentials are pre-programmed into the Sigfox module (e.g., Wisol SFM10RxIntegrating Sigfox Wisol Modules (SFM10Rx) with ESP32Integrating Sigfox Wisol Modules (SFM10Rx) with ESP32Learn to connect ESP32 to Sigfox via Wisol modules in this detailed guide. Optimize power consumption and deploy low-energy IoT sensor nodes effectively.) and are required to register the device on the Sigfox backend. The Device ID identifies the device, while the PAC Key ensures secure communicationConnecting ESP32 to Cloud Services via Wi-FiConnecting ESP32 to Cloud Services via Wi-FiDiscover how to connect your ESP32 to AWS, Azure, and Google Cloud using secure Wi-Fi. This guide covers setup, error handling, and low power strategies. during activation.

Sigfox Device Registration Workflow🔗

1. Hardware SetupZigbee Green Power: Ultra-Low-Power Energy Harvesting SolutionsZigbee Green Power: Ultra-Low-Power Energy Harvesting SolutionsDiscover how ZGP enables battery-free IoT devices through energy harvesting with ESP32 integrations, supporting smart home and industrial applications.:

Connect a Sigfox-compatible module (e.g., Wisol SFM10RxIntegrating Sigfox Wisol Modules (SFM10Rx) with ESP32Integrating Sigfox Wisol Modules (SFM10Rx) with ESP32Learn to connect ESP32 to Sigfox via Wisol modules in this detailed guide. Optimize power consumption and deploy low-energy IoT sensor nodes effectively.) to the ESP32 via UART:

// ESP32 UART Configuration for Wisol SFM10Rx
#define UART_RX_PIN 16
#define UART_TX_PIN 17
HardwareSerial SigfoxSerial(1);
SigfoxSerial.begin(9600, SERIAL_8N1, UART_RX_PIN, UART_TX_PIN);

2. Retrieve Device ID/PAC:

Extract credentials using AT commandsUsing Quectel BC66/BG96 Modules with ESP32 for NB-IoT ConnectivityUsing Quectel BC66/BG96 Modules with ESP32 for NB-IoT ConnectivityExplore our detailed tutorial on integrating Quectel BC66/BG96 with ESP32 for low-power, reliable NB-IoT connectivity. Learn hardware setup and AT commands. sent via UART:

void getSigfoxCredentials() {
  SigfoxSerial.println("AT$I=10");  // Request Device ID
  delay(100);
  SigfoxSerial.println("AT$I=11");  // Request PAC Key
  delay(100);
}

3. Backend Registration:

4. Activation:

On first transmission, the Sigfox networkIntegrating Sigfox Wisol Modules (SFM10Rx) with ESP32Integrating Sigfox Wisol Modules (SFM10Rx) with ESP32Learn to connect ESP32 to Sigfox via Wisol modules in this detailed guide. Optimize power consumption and deploy low-energy IoT sensor nodes effectively. validates the PAC Key and issues a Session Key stored on the device.

Retrieving Device Credentials🔗

Before registering your ESP32-based SigfoxSigfox Message Encoding: Packing Sensor Data into 12-byte PayloadsSigfox Message Encoding: Packing Sensor Data into 12-byte PayloadsLearn efficient data encoding techniques for Sigfox's constrained 12-byte payloads. Discover bitwise operations, structured encoding & CBOR strategies. device, you’ll need to retrieve the Device ID and PAC Key from the SigfoxSigfox Message Encoding: Packing Sensor Data into 12-byte PayloadsSigfox Message Encoding: Packing Sensor Data into 12-byte PayloadsLearn efficient data encoding techniques for Sigfox's constrained 12-byte payloads. Discover bitwise operations, structured encoding & CBOR strategies. module. These credentials are typically printed on the module or provided in the module’s documentation.

For Wisol modulesIntegrating Sigfox Wisol Modules (SFM10Rx) with ESP32Integrating Sigfox Wisol Modules (SFM10Rx) with ESP32Learn to connect ESP32 to Sigfox via Wisol modules in this detailed guide. Optimize power consumption and deploy low-energy IoT sensor nodes effectively., credentials are often pre-provisioned. Use this Arduino sketch to fetch them:

#include <HardwareSerial.h>
HardwareSerial SigfoxSerial(1);
void setup() {
  Serial.begin(115200);
  SigfoxSerial.begin(9600, SERIAL_8N1, 16, 17);
}
void loop() {
  if (Serial.available()) {
    String cmd = Serial.readStringUntil('\n');
    SigfoxSerial.println(cmd);
  }
  if (SigfoxSerial.available()) {
    String response = SigfoxSerial.readStringUntil('\n');
    Serial.println("Sigfox: " + response);
  }
}
  • Run commands AT$I=10 and AT$I=11 in the Serial Monitor to retrieve credentials.

Registering a Device on the Sigfox Backend🔗

Once you have the Device ID and PAC Key, follow these steps to register your device:

1. Log in to the SigfoxSigfox Message Encoding: Packing Sensor Data into 12-byte PayloadsSigfox Message Encoding: Packing Sensor Data into 12-byte PayloadsLearn efficient data encoding techniques for Sigfox's constrained 12-byte payloads. Discover bitwise operations, structured encoding & CBOR strategies. Backend:

Access the SigfoxSigfox Message Encoding: Packing Sensor Data into 12-byte PayloadsSigfox Message Encoding: Packing Sensor Data into 12-byte PayloadsLearn efficient data encoding techniques for Sigfox's constrained 12-byte payloads. Discover bitwise operations, structured encoding & CBOR strategies. Backend using your account credentials.

2. Add a New Device:

Navigate to the Device section and click Add a Device. Enter the Device ID and PAC Key when prompted.

3. Assign a Device Type:

Associate the device with a Device Type, which defines the message format, callback configurations, and other settings.

4. Activate the Device:

The backend will use the PAC Key to authenticate and activate the device. Once activated, the device is ready to send and receive messages over the Sigfox networkIntegrating Sigfox Wisol Modules (SFM10Rx) with ESP32Integrating Sigfox Wisol Modules (SFM10Rx) with ESP32Learn to connect ESP32 to Sigfox via Wisol modules in this detailed guide. Optimize power consumption and deploy low-energy IoT sensor nodes effectively..

Securing Device Credentials🔗

The Device ID and PAC Key are critical for secure communicationConnecting ESP32 to Cloud Services via Wi-FiConnecting ESP32 to Cloud Services via Wi-FiDiscover how to connect your ESP32 to AWS, Azure, and Google Cloud using secure Wi-Fi. This guide covers setup, error handling, and low power strategies.. Follow these best practices to protect them:

1. Secure Storage: Never hardcode PAC Keys in firmware. Use ESP32’sCombining Wi-Fi with Deep Sleep for Low-Power ApplicationsCombining Wi-Fi with Deep Sleep for Low-Power ApplicationsLearn how to integrate Wi-Fi and deep sleep on ESP32 to maximize battery life in IoT devices. This guide offers practical tips and step-by-step instructions. NVS (Non-Volatile Storage) or hardware Secure Elements.

#include <nvs_flash.h>
nvs_handle_t handle;
nvs_open("sigfox", NVS_READWRITE, &handle);
nvs_set_str(handle, "pac_key", "4D6F7A...");
nvs_commit(handle);

2. Rotation: If your SigfoxSigfox Message Encoding: Packing Sensor Data into 12-byte PayloadsSigfox Message Encoding: Packing Sensor Data into 12-byte PayloadsLearn efficient data encoding techniques for Sigfox's constrained 12-byte payloads. Discover bitwise operations, structured encoding & CBOR strategies. operator supports PAC Key rotation, automate re-registration via downlinks.

3. Data Minimization: Transmit PAC Keys only during provisioning (e.g., via BLE with encryptionConnecting ESP32 to Cloud Services via Wi-FiConnecting ESP32 to Cloud Services via Wi-FiDiscover how to connect your ESP32 to AWS, Azure, and Google Cloud using secure Wi-Fi. This guide covers setup, error handling, and low power strategies.).

Practical Implementation on the ESP32🔗

Here’s a step-by-step example of integrating an ESP32 with a SigfoxSigfox Message Encoding: Packing Sensor Data into 12-byte PayloadsSigfox Message Encoding: Packing Sensor Data into 12-byte PayloadsLearn efficient data encoding techniques for Sigfox's constrained 12-byte payloads. Discover bitwise operations, structured encoding & CBOR strategies. module:

1. Hardware SetupZigbee Green Power: Ultra-Low-Power Energy Harvesting SolutionsZigbee Green Power: Ultra-Low-Power Energy Harvesting SolutionsDiscover how ZGP enables battery-free IoT devices through energy harvesting with ESP32 integrations, supporting smart home and industrial applications.:

Connect the Sigfox module (e.g., Wisol SFM10RxIntegrating Sigfox Wisol Modules (SFM10Rx) with ESP32Integrating Sigfox Wisol Modules (SFM10Rx) with ESP32Learn to connect ESP32 to Sigfox via Wisol modules in this detailed guide. Optimize power consumption and deploy low-energy IoT sensor nodes effectively.) to the ESP32 via UART.

2. Retrieve Credentials:

Use AT commandsUsing Quectel BC66/BG96 Modules with ESP32 for NB-IoT ConnectivityUsing Quectel BC66/BG96 Modules with ESP32 for NB-IoT ConnectivityExplore our detailed tutorial on integrating Quectel BC66/BG96 with ESP32 for low-power, reliable NB-IoT connectivity. Learn hardware setup and AT commands. to retrieve the Device ID and PAC Key.

3. Register the Device:

Log in to the SigfoxSigfox Message Encoding: Packing Sensor Data into 12-byte PayloadsSigfox Message Encoding: Packing Sensor Data into 12-byte PayloadsLearn efficient data encoding techniques for Sigfox's constrained 12-byte payloads. Discover bitwise operations, structured encoding & CBOR strategies. Backend and register the device using the retrieved credentials.

4. Send a Test Message:

Use the following code to send a message via SigfoxSigfox Message Encoding: Packing Sensor Data into 12-byte PayloadsSigfox Message Encoding: Packing Sensor Data into 12-byte PayloadsLearn efficient data encoding techniques for Sigfox's constrained 12-byte payloads. Discover bitwise operations, structured encoding & CBOR strategies.:

#include <SoftwareSerial.h>
SoftwareSerial sigfoxSerial(16, 17);  // RX, TX pins for UART
void setup() {
  Serial.begin(115200);
  sigfoxSerial.begin(9600);
  // Send a test message
  sigfoxSerial.println("AT$SF=48656C6C6F");  // Send "Hello" in hex
}
void loop() {
  // Handle downlink messages or other tasks
}

5. Monitor the Backend:

Check the SigfoxSigfox Message Encoding: Packing Sensor Data into 12-byte PayloadsSigfox Message Encoding: Packing Sensor Data into 12-byte PayloadsLearn efficient data encoding techniques for Sigfox's constrained 12-byte payloads. Discover bitwise operations, structured encoding & CBOR strategies. Backend to verify that the message was successfully transmitted.

Best Practices and Security Considerations🔗

1. Secure Storage: Use non-volatile memory or hardware security modules to store credentials securely.

2. Regular Audits: Periodically review and update credentials to mitigate risks.

3. Error HandlingConnecting ESP32 to Cloud Services via Wi-FiConnecting ESP32 to Cloud Services via Wi-FiDiscover how to connect your ESP32 to AWS, Azure, and Google Cloud using secure Wi-Fi. This guide covers setup, error handling, and low power strategies.: Implement robust error-checking and retries during registration.

4. Industry StandardsUnderstanding ESP32 Wi-Fi Capabilities and SpecificationsUnderstanding ESP32 Wi-Fi Capabilities and SpecificationsExplore the ESP32’s Wi-Fi features, technical specs and IoT applications to build smart, scalable, and secure connectivity solutions for every project.: Stay updated with SigfoxSigfox Message Encoding: Packing Sensor Data into 12-byte PayloadsSigfox Message Encoding: Packing Sensor Data into 12-byte PayloadsLearn efficient data encoding techniques for Sigfox's constrained 12-byte payloads. Discover bitwise operations, structured encoding & CBOR strategies.’s latest security guidelines.

Troubleshooting Registration Issues🔗

SymptomCauseSolution
AT$I=10/11 returns ERRORModule not initializedPower cycle or check UART wiring
Invalid PAC on backendPAC already usedContact Sigfox operator for reset
No network registrationRegional frequency mismatchVerify module supports RCZ1/RCZ2/RCZ4
// Check Sigfox module region:
SigfoxSerial.println("AT$DR?");  // Response: "RCZ1" (Europe), "RCZ2" (USA), etc.

Conclusion🔗

Managing Device IDs and PAC keys is a foundational step when bringing Sigfox connectivity to your ESP32 projects. By carefully storing and handling these credentials-and by understanding the underlying principles of Sigfox’s registration process-you ensure that your devices can securely and reliably communicate with the Sigfox networkIntegrating Sigfox Wisol Modules (SFM10Rx) with ESP32Integrating Sigfox Wisol Modules (SFM10Rx) with ESP32Learn to connect ESP32 to Sigfox via Wisol modules in this detailed guide. Optimize power consumption and deploy low-energy IoT sensor nodes effectively.. This meticulous attention to detail not only fortifies your IoT deployments but also maximizes the potential of long-range, low-power communications.

Embrace these practices to build robust, secure, and scalable IoT solutionsConnecting ESP32 to Cloud Services via Wi-FiConnecting ESP32 to Cloud Services via Wi-FiDiscover how to connect your ESP32 to AWS, Azure, and Google Cloud using secure Wi-Fi. This guide covers setup, error handling, and low power strategies. that can confidently operate in the dynamic realm of wireless connectivity.

Author: Marcelo V. Souza - Engenheiro de Sistemas e Entusiasta em IoT e Desenvolvimento de Software, com foco em inovação tecnológica.

References🔗

Share article

Related Articles