Connecting ESP32 to Sigfox via Wisol Modules Guide

Table of Contents🔗

Why Sigfox for ESP32?🔗

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. is a low-power, long-rangeQuick Comparison: Range, power consumption, costs, and complexity of each technologyQuick Comparison: Range, power consumption, costs, and complexity of each technologyDiscover the ideal wireless solution for your ESP32 IoT project by analyzing range, power, cost, and complexity. Optimize connectivity now. (LPWAN) protocol ideal for sporadic, small-data transmissions (e.g., sensor readings). While the ESP32 lacks native 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. support, external Wisol SFM10Rx modules bridge this gap:

Understanding the Sigfox Network and Wisol SFM10Rx🔗

The Sigfox network is designed for ultra-narrowband, low-power 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.. It targets devices that need to send small messages over long distances while consuming minimal energy. Here’s what makes it special:

The Wisol SFM10Rx, as a Sigfox module, encapsulates this philosophy in its hardware design. It integrates the necessary RF front-end, baseband processing, and security features to interact with Sigfox’s backend services. Its compact design makes it perfect for retrofitting into existing ESP32 systems where 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. connectivity is an added advantage.

Hardware Setup: Wiring SFM10Rx to ESP32🔗

The SFM10Rx communicates via UARTInterfacing ESP32 with Zigbee3.0 Devices (Xiaomi, Philips Hue)Interfacing ESP32 with Zigbee3.0 Devices (Xiaomi, Philips Hue)Unlock seamless smart home integration by following our detailed guide on bridging ESP32 with external Zigbee modules for reliable IoT solutions.. Wire it to 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. as follows:

SFM10Rx PinESP32 PinNotes
VCC3.3VPower supply
GNDGNDCommon ground
TXDGPIO16ESP32’s U2 RX
RXDGPIO17ESP32’s U2 TX

Tip: Add a 10kΩ resistor between SFM10Rx’s RESET pin and 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. GPIO for software reboots.

Software Configuration: AT Commands and Libraries🔗

1. Initialize UART on 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.:

#include <HardwareSerial.h>
HardwareSerial SigfoxSerial(2); // Use UART2
void setup() {
  SigfoxSerial.begin(9600, SERIAL_8N1, 16, 17); // Baud rate, pins
  delay(1000);
  SigfoxSerial.println("AT"); // Test connection
}

2. Send 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. Message:

void sendSigfoxMessage(String payload) {
  SigfoxSerial.print("AT$SF=");
  SigfoxSerial.println(payload);
}

3. Handle Responses:

while (SigfoxSerial.available()) {
  String response = SigfoxSerial.readString();
  if (response.indexOf("OK") != -1) {
    Serial.println("Message sent!");
  }
}

Common 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.:

Message Encoding: Packing Data into 12-Byte Payloads🔗

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. limits payloads to 12 bytes. Use bitwise operationsSigfox 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. to pack data efficiently:

// Example: Pack temperature (float) and humidity (uint8_t)
float temp = 25.6;
uint8_t humidity = 60;
uint8_t payload[12];
// Convert temperature to 16-bit integer (scaled by 10)
int16_t temp_scaled = (int16_t)(temp * 10);
payload[0] = temp_scaled >> 8;   // High byte
payload[1] = temp_scaled & 0xFF; // Low byte
payload[2] = humidity;           // Humidity
// Send payload as HEX string
String hexPayload;
for (int i=0; i<3; i++) {
  if (payload[i] < 0x10) hexPayload += "0";
  hexPayload += String(payload[i], HEX);
}
sendSigfoxMessage(hexPayload);

Sigfox Security: Device ID and PAC Key Management🔗

Secure Storage Tips:

#include <Preferences.h>
Preferences prefs;
prefs.begin("sigfox");
prefs.putString("deviceID", "1234ABC");
prefs.end();
  • Avoid hardcoding keys in firmware.

Real-World Example: Building a Sigfox Sensor Node🔗

Scenario: A battery-powered temperature monitor for remote agricultural fields.

1. Hardware: 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. + SFM10Rx + DS18B20 temperature sensor.

2. Code:

void loop() {
  float temp = readTemperature(); // Custom sensor function
  sendSigfoxMessage(packData(temp));
  ESP32.deepSleep(3600e6); // Sleep for 1 hour
}

3. 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. Cloud:

  • Configure callbacks to forward data to your server.
  • Use geolocation (RSSI-based) for approximate device tracking.

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. supports downlink communication, allowing the network to send commands or acknowledgments back to your device. To enable downlink, add the ,1 parameter to the AT$SFAdaptive Data Rate (ADR) Optimization for LoRaWAN on ESP32Adaptive Data Rate (ADR) Optimization for LoRaWAN on ESP32Optimize your IoT network with our ADR tutorial for ESP32 in LoRaWAN. Learn dynamic transmission tuning, power management, and troubleshooting strategies. command:

SigfoxSerial.println("AT$SF=48656C6C6F,1"); // Send "Hello" and request downlink

The downlink message will be received on the next uplink transmission. Use the AT$RF command to read the downlink data.

Power Optimization: Deep Sleep and Wisol States🔗

SigfoxSerial.println("AT$P=0"); // Enter sleep mode

Current Consumption:

StateCurrent Draw
ESP32 Active~80 mA
ESP32 Deep Sleep~5 µA
SFM10Rx Transmitting~15 mA
SFM10Rx Sleep~0.1 µA

Troubleshooting Common Issues🔗

1. No Response from Module:

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. Message Failed:

3. High Power ConsumptionQuick Comparison: Range, power consumption, costs, and complexity of each technologyQuick Comparison: Range, power consumption, costs, and complexity of each technologyDiscover the ideal wireless solution for your ESP32 IoT project by analyzing range, power, cost, and complexity. Optimize connectivity now.:

Real-World Applications and Use Cases🔗

1. Asset Tracking: Monitor the location and status of remote assets like shipping containers or vehicles.

2. Environmental MonitoringConnecting 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.: Collect data from sensors in hard-to-reach areas, such as forests or agricultural fields.

3. Smart Metering: Transmit utility usage data (water, gas, electricity) to central systems.

4. Industrial IoTSigfox 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.: Monitor equipment health and send alerts for maintenance.

By combining the ESP32 with the SFM10Rx module, you can build robust, energy-efficient IoT devices that leverage the global Sigfox network. Whether you’re tracking assets or monitoring environmental conditions, this integration opens up a world of possibilities for your IoT projectsConnecting 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..

Integrating the Sigfox Wisol SFM10Rx with the ESP32 is as much an art as it is a science. By balancing theoretical principles with real-world testing, you can create efficient, cost-effective 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 are both scalable and reliable. With a clear understanding of the underlying technologies and hands-on coding examples, you’re well-equipped to bring Sigfox connectivity to your next project.

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