NORA-W36 u-connectXpress user guide

NORA-W36 u-connectXpress

Stand-alone multiradio modules

User guide

short range

This document provides an overview of the u-connectXpress software for u-blox short range modules

and describes how the products can be configured for Wi-Fi and Bluetooth Low Energy use cases.

short rangeshort range

⚡ Quick Navigation Guide for First-Time Users:

Document information

TitleNORA-W36 series u-connectXpress
SubtitleStand-alone multiradio modules
Document typeUser guide
Document numberUBX-23008692
Version and date3.1.0 1-Oct-2025
Disclosure restrictionC1-Public

This document applies to the following products

Product nameSoftware version
NORA-W36 series3.1.0

Disclaimer

u-blox or third parties may hold intellectual property rights in the products, names, logos, and designs included in this document. Copying, reproduction, or modification of this document or any part thereof is only permitted with the express written permission of u-blox. Disclosure to third parties is permitted for clearly public documents only.

The information contained herein is provided "as is" and u-blox assumes no liability for its use. No warranty, either express or implied, is given, including but not limited to, with respect to the accuracy, correctness, reliability, and fitness for a particular purpose of the information. This document may be revised by u-blox at any time without notice. For the most recent documents, visit www.u-blox.com.

Copyright © u-blox AG

1. Overview

This document describes how to set up and use u-blox short range stand-alone modules with u-connectXpress software for NORA-W36. It explains the functionality of different u-blox short range stand-alone modules and includes examples that describe how to use the software in different environments with AT commands. The document is applicable for Bluetooth® Low Energy (LE), multiradio, and Wi-Fi modules.

Several u-blox short range stand-alone modules support open software variants. For more information about the available options, see the corresponding system integration manuals for u-blox short range stand-alone modules.

For older generation modules like ODIN-W2, NINA-W15 and ANNA-B1, u-connectXpress user guide describe the functionality of these modules.

1.1. Getting started with s-center 2

Downloading and installing

  1. Download the latest version of s-center 2
  2. Double click the downloaded file and follow the installation instructions
  3. Launch s-center 2 when the installation is completed

s-center 2

1.2. Product description

u-blox modules are developed for integration into a vast range of devices that demand a high level of reliability, such as those that are typically used in industrial and medical applications.

These professional grade modules operate over an extended temperature range and are approved for radio type application products in many countries. By choosing to use u-blox short range stand-alone modules, the cost and work involved in developing wireless communication solutions is significantly reduced.

ConceptDefinition
HostIn this document, a host refers to the device connected to a u-blox short range stand-alone module through any of the available physical interfaces. In a real application, the host is typically a microcontroller Unit (MCU) running a customer specific application.
ModuleIn this document, module refers to a u-blox stand-alone module. A module can also refer to a self-contained unit or item that is linked with similar units of a larger system that performs a defined task.
Remote deviceA remote device in a wireless network connecting over the Bluetooth Low Energy or Wi-Fi interfaces supported in the module.

1.3. Multiradio and Wi-Fi modules

u-blox compact and powerful stand-alone, multiradio modules are designed for the development of Internet-of-Things (IoT) applications. NORA-W36 modules include an embedded Bluetooth stack, Wi-Fi driver, IP stack, and an application for wireless data transfer. The wireless support includes Bluetooth v5.3 (Low Energy) and dual-band Wi-Fi (2.4 and 5 GHz bands).

The modules support point-to-point and point-to-multipoint configurations and can accommodate concurrent Bluetooth and Wi-Fi connections. The software provides support for micro Access Point.

They are delivered with u-connectXpress software that provides support for u-blox Bluetooth LE Serial Port Service, Generic Attribute Profile (GATT) client and server, Bluetooth beacons, simultaneous Peripheral and Central roles - all configurable from a host by means of AT commands.

2. Quick Start Guide

2.1. Initial setup checklist

Before starting with NORA-W36 configuration, ensure the following setup is complete:

2.1.1. Hardware setup

Essential Hardware Connections:

  • Power Supply (3.3V) - Connect regulated 3.3V power to VCC pin
  • Ground Connection - Connect GND pin to your system's ground reference
  • UART Interface - Connect TX/RX pins between NORA-W36 and host system

Recommended:

  • Reset Circuit - Wire reset pin for hardware reset capability
  • Bootloader Recovery Switches - Install SW1 and SW2 for easy factory reset and bootloader access (see NORA-W36 SIM for details)

2.1.2. Software setup

  • s-center 2 Installation: Download and install s-center 2
  • Serial Connection: Configure correct COM port and baud rate (115200 default)
  • AT Command Testing: Verify communication with basic AT command

UART configuration defaults

Current NORA-W36 UART Settings:

  • Baud Rate: 115200 bps
  • Data Bits: 8
  • Start Bits: 1
  • Stop Bits: 1
  • Parity: None (8N1 format)
  • Hardware Flow Control: Disabled by default (only TX/RX/GND required)

📌 Connection Requirements:

  • Minimum: TX, RX, and GND pins only
  • Recommended for higher baud rates: CTS/RTS pins for hardware flow control

2.1.3. Initial verification commands

StepCommandExpected ResponsePurpose
1ATOKTest basic communication
2ATIModule informationVerify module identity
3AT+GMIu-bloxCheck manufacturer
4AT+GMMNORA-W36Check model
5AT+GMRSoftware versionCheck firmware version

2.2. First connection examples

2.2.1. Quick Wi-Fi connection

📶 Wi-Fi Connection Flow:


    ┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
    │ 📋 Configure    │───▶│ 🔒 Authenticate │───▶│ ✅ Connected    │
    │    Network      │    │    & Secure     │    │    & Online     │
    └─────────────────┘    └─────────────────┘    └─────────────────┘
             │                       │                       │
         SSID/PWD                UWSC=0                  Link Up
    🔧 AT Commands:            🔒 Security:            ✅ Status Events:
    • AT+UWSCP (SSID)         • WPA2/WPA3             • +UEWLU (Link)
    • AT+UWSSW (Password)     • Auto-negotiate        • +UEWSNU (Network)
    • AT+UWSC=0 (Connect)     • 2048-bit keys         • Ready for data!

Basic WPA2/WPA3 Station Connection:

StepCommandDescription
1AT+UWSCP=0,"YourSSID"Set network name
2AT+UWSSW=0,"YourPassword",0Set password (WPA2/WPA3 compatible)
3AT+UWSC=0Connect to network
4Wait for +UEWLU:0,BBBBBBBBBBB,6Wi-Fi link up
5Wait for +UEWSNUNetwork interface up
6AT+UWSNST?Check network configuration

Full Network Configuration Response:


AT+UWSNST?
+UWSNST:0,192.168.1.59             // IPv4 address
+UWSNST:1,255.255.255.0            // Subnet mask
+UWSNST:2,192.168.1.1              // Gateway
+UWSNST:3,192.168.1.1              // Primary DNS
+UWSNST:4,0.0.0.0        // Secondary DNS
+UWSNST:5,[fe80::56f8:2aff:fe10:aad4]        // IPv6 address
OK

💡 Quick Check: For basic connectivity verification, you can query just the IP address:


AT+UWSNST=0
+UWSNST:0,192.168.1.59             // IPv4 address sufficient for most use cases
OK

2.2.2. Quick Bluetooth advertising

📱 Bluetooth LE Advertisement Flow:


    ┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
    │ 🔧 Configure    │───▶│ 📡 Advertise    │───▶│ 📲 Discoverable │
    │   Parameters    │    │   & Beacon      │    │   by Devices    │
    └─────────────────┘    └─────────────────┘    └─────────────────┘
             │                       │                       │
        Set Interval           Start Broadcast          Device Scan
    ⚙️ Configuration:          📡 Broadcasting:         📱 Detection:
    • Interval: 100ms         • Device name            • "NORA-W36"
    • Legacy mode             • BLE 5.3 compliant     • RSSI signal
    • Auto-connectable        • Low power mode        • Available services

Basic BLE Advertising Setup:

StepCommandDescription
1AT+UBTALS=160,160Set legacy advertising parameters (100ms interval)
2AT+UBTALStart legacy advertising
3Device is now discoverableCheck with smartphone BLE scanner

Expected Result: Module appears as "NORA-W36" in Bluetooth device scans

2.2.3. Quick TCP connection test

TCP Socket Communication Flow:


    ┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
    │ 🔌 Create       │───▶│ 🔗 Connect      │───▶│ 📤 Send/Receive │
    │    Socket       │    │   to Server     │    │      Data       │
    └─────────────────┘    └─────────────────┘    └─────────────────┘
             │                       │                       │
        USOCR=6              httpbin.org:80              HTTP GET
    🔧 Socket Setup:          🔗 TCP Connection:         📊 Data Exchange:
    • IPv4 TCP socket         • Remote server            • HTTP protocol
    • System allocated        • Port 80 (HTTP)          • Request/Response
    • Ready for connection    • Bidirectional           • Text-based data

After Wi-Fi connection, test TCP socket:

StepCommandDescription
1AT+USOCR=6Create TCP socket
2AT+USOC=0,"httpbin.org",80Connect to test server
3AT+USOWS=0,"GET / HTTP/1.1\r\nHost: httpbin.org\r\n\r\n"Send HTTP request
4AT+USORS=0,100Read response

Expected Result: HTTP response from httpbin.org server

2.3. Common quick start issues

2.3.1. Communication problems

🔧 Hardware & Communication Troubleshooting:

IssueSymptomSolution
🔇 No response to ATSilent or garbled text✅ Check baud rate (115200), TX/RX/GND wiring (CTS/RTS optional)
ERROR responsesCommands not recognized✅ Check firmware version, command syntax
Connection timeoutsCommands hang✅ Check power supply stability, reset module

2.3.2. Wi-Fi connection issues

📶 Wi-Fi Network Troubleshooting:

IssueSymptomQuick Fix
🚫 Connection failsERROR on AT+UWSC=0✅ Verify SSID and password spelling
No IP addressWi-Fi connects but no +UEWSNU✅ Check DHCP server, router configuration
📡 Weak signalConnection drops frequently✅ Move closer to router, check antenna

Quick Debug Commands:

CommandPurposeUsage
AT+USYEE=1Enable extended error codesRun first to get detailed error information
AT+USYEC?Check last error codeQuery after any failed operation
AT+UWSST=4Check signal strength (RSSI)Monitor connection quality

2.4. Next steps

After successful quick start:

  1. Explore specific use casesWi-Fi use cases or Bluetooth use cases
  2. Learn about securityWPA2/WPA3 configuration
  3. Understand data modesSend and receive data
  4. Advanced featuresTLS configuration, MQTT

3. Key features

The possibility of replacing serial cables with simple wireless connections is a key feature of u-blox modules. It allows system hosts to transfer data to one another over wireless Bluetooth connections that are established between u-blox modules in Central/Peripheral configuration.

Depending on the module capabilities, data from each host is transferred to local u-blox modules over a serial UART interface.

u-blox modules can be configured to automatically establish new connections and/or accept incoming connections using AT commands. For connected hosts, this means that physical serial cables can be replaced with more convenient wireless solutions.

3.1. Bluetooth GATT connection

ble

NORA-W36 can function as either a Central or Peripheral unit, connecting to devices such as laptops, cellular phones, and tablets using the Generic Attribute Profile (GATT).

3.2. Bluetooth SPS connection

ble

NORA-W36 can function as either a Central or Peripheral unit, connecting to devices such as laptops, cellular phones, and tablets via the u-blox Serial Port Service (SPS).

3.3. Wi-Fi station connection

ble

NORA-W36 can operate as a Station connecting to an Access Point.

3.4. Wi-Fi access point connection

ble

NORA-W36 can operate as an Access Point connecting to other devices that operate as Stations.

4. u-connectXpress software

4.1. Operating modes

NORA-W36 operates in the following modes:

  • AT mode (default): AT commands and data can be sent at the same time. Data is sent and received in AT commands and events - in string or binary mode
  • Transparent Mode (TM): All data sent and received on the UART is connected to the remote device
  • Transparent Mode Persistent (TMP): Same as TM, but the connection is established at startup or when the connection is dropped

Additionally, the module supports various low-power modes, which optimize power consumption regardless of the operating mode. See also Low power modes and Power consumption optimization.

Deep sleep is supported with the command AT+UPMDS, see AT command manual and Data sheet for more information.

4.2. Changing operating modes

u-blox modules can be configured to start in any operating mode. Once up and running, the modules can be switched between most modes. The modes are changed with a command or escape sequence sent to the module:

  • Switch from Command mode to Transparent mode using an AT command
  • Switch from Transparent mode to command mode with an escape sequence.

The module is controlled using AT commands in (default) Command mode. In this mode, the host sends control and configuration commands and indicates when data is to be sent over the UART interface.

4.3 NORA-W36 capabilities

u-connectXpress FeaturesCapability in 3.1.0
ChipsetRealtek RTL8720DF
MultiradioBluetooth Low Energy 5.3 Wi-Fi 4 dual band 2,4 and 5 GHz
Wi-Fi capabilities802.11a/b/g/n WPA2 Personal (Station & AP) and WPA3 Personal (Station only) Wi-Fi Multimedia WMM/WME/QoS (802.11e) Protected Management Frames (802.11w) Roaming using Fast BSS Transition (802.11r), Radio Measurement (802.11k), and Wireless Network Management (802.11v)
Wi-Fi Alliance certifiedCertification ID: WFA112253 Date of Certification: 2021-06-07
Bluetooth QualificationDeclaration ID: D065864 QDID: 194774 Qualification date: 2022-02-26 NORA-W36 listing date: 2024-02-19
Wi-Fi Access Point5 Stations connected
TCP/UDP sockets6 Simultaneous sockets (Note that a listening socket requires 2 sockets)
MQTT Connections1 Connection (client)
BLE Central connections3 Peripherals connected
BLE Peripheral connections1 Central connected
BLE Scatternet connections (C+P)Central with 1 Peripheral connected, advertising and allow incoming connection as Peripheral
BLE Link key storage30 Devices. The keys that are the least used are removed first when storage is full
Coexistence Wi-Fi, BLE and TLSMax 1 TLS client, 1 BLE, 2 TCP Client
Data transfer modesBuffer Mode (event and read data), Direct Mode (data in event), Transparent mode (like serial port cable replacement). Buffer Mode is Default, Transparent mode only supports one link. Transparent Mode has highest throughput, then Direct Mode and then Buffer Mode
SPS MTU size244 bytes, 1000 bytes can be sent in AT command
TCP MTU size1460 bytes, 1000 bytes can be sent in AT command
UDP MTU size1460 bytes, 1000 bytes can be sent in AT command
HTTP MTU size1460 bytes, 1000 bytes can be sent in AT command
u-connectXpress software componentsVersions in 3.1.0
Realtek SDK including Bluetooth stack and Wi-Fi drivers6.2 + 6.2_patch_integrated_241111_f5eb173c https://online.realtek.com/Home/Login
lwIP TCP/IP stack2.0.2 https://savannah.nongnu.org/news/?group_id=3159
Mbed TLS cryptographic algorithms3.6.4 https://github.com/Mbed-TLS/mbedtls/releases
u-connectXpress MQTT clientVersions in 3.1.0
MQTT version3.1.1
MQTT capabilitiesPublish, Subscribe, TLS, QoS, Testament and Last will
MQTT maximum packets size5k (5000) bytes for Publish and Subscribe packets
u-connectXpress Enterprise securityCapability in 3.1.0
PEAP Authentication methodPEAPv0 with EAP-MSCHAPv2
EAP Authentication methodEAP Transport Layer Security (EAP-TLS)
EAP-TLS certificate key size supported2048 and 4096 bits
u-connectXpress TLS featureTLS capability in 3.1.0
TLS versionTLS 1.2 and TLS 1.3
TLS max number of connections1
TLS extensions enabled by defaultServer Name Indication (SNI), Maximum Fragment Length Negotiation
TLS Encryption keysAdvanced Encryption Standard (AES). Data Encryption Standard (DES), Rivest Cipher 4 (RC4), and the Camellia cipher are not supported.
X.509 security certificate formats supportedPEM (DER not supported)
TLS over TCP certificate key size supported4096 bits
TLS certificatesUp to 8 certifications (or certificate chains) can be stored. Certificates can be maximum 15360 bytes.
TLS ExtensionsServer name (SNI) Max fragment length: 4096 (4)

More information about the AT commands used in this use cases can be found in the NORA-W36 AT command manual.

5. AT Command Programming

This chapter covers the fundamental concepts of AT command programming with NORA-W36, including command response handling, event management, and timing considerations that are essential before diving into specific protocol implementations.

This chapter covers the fundamental concepts of event-driven programming with NORA-W36, including AT command response handling, Unsolicited Result Code (URC) event management, and data flow fundamentals that are essential before diving into specific protocol implementations.

5.1. Event-driven programming fundamentals

5.1.1. Understanding the event model

NORA-W36 operates on an event-driven architecture where the module continuously monitors for various conditions and notifies the host application through events. This approach enables efficient, asynchronous programming patterns.

Key Concepts:

  • Events are asynchronous - They can occur at any time regardless of when commands are sent
  • Events require handling - Your application must be prepared to process events when they arrive
  • Events provide real-time status - They inform about connection status, data availability, errors, and more

5.1.2. Event types overview

NORA-W36 generates several categories of events:

Event CategoryPurposeExamples
Connection EventsNetwork and device connectivity+UEBTC, +UESOC, +UEWLU
Data EventsIncoming data availability+UESODA, +UESODS, +UESPSDS
Status EventsModule state changes+STARTUP, +UEWSNU, +UEMQC
Error EventsProblem notifications+UESOCL, +UEWLD, +UEMQDC
Security EventsAuthentication and bonding+UEBTB, +UEBTUC, +UEBTUPE

5.2. AT command response handling

5.2.1. Command response types

Every AT command generates predictable response patterns that your application must handle:

5.2.1.1. Synchronous responses (immediate)


// Command sent:
AT+UWSNST?
// Immediate response:
+UWSNST:0,192.168.1.59             // IPv4 address
+UWSNST:1,255.255.255.0            // Subnet mask
+UWSNST:2,192.168.1.1              // Gateway
+UWSNST:3,192.168.1.1              // Primary DNS
+UWSNST:4,0.0.0.0        // Secondary DNS
+UWSNST:5,[fe80:0000:0000:0000:56f8:2aff:fe10:aad4]    // IPv6 address
OK

5.2.1.2. Asynchronous responses (delayed)


// Command sent:
AT+UWSC=0
// Immediate acknowledgment:
OK
// Later event (when connection completes):
+UEWLU:0
+UEWSNU

5.3. Response parsing best practices

5.3.1. Command response validation

5.3.1.1. Always check for ok/error


AT+UBTM=1
OK               // Success - command accepted
// vs
AT+UBTM=1
ERROR            // Failure - command rejected

5.3.1.2. Parse multi-line responses


AT+UBTBDL
+UBTBDL:AAAAAAAAAAAAp              // Bonded device 1 (BD address)
+UBTBDL:BBBBBBBBBBBBp              // Bonded device 2 (BD address)
+UBTBDL:CCCCCCCCCCCCp              // Bonded device 3 (BD address)
OK               // Final confirmation

5.3.1.3. Handle parameter responses


AT+UWSNST?
+UWSNST:0,192.168.1.59             // IPv4 address
+UWSNST:1,255.255.255.0            // Subnet mask
+UWSNST:2,192.168.1.1              // Gateway
+UWSNST:3,192.168.1.1              // Primary DNS
+UWSNST:4,0.0.0.0        // Secondary DNS
+UWSNST:5,[fe80:0000:0000:0000:56f8:2aff:fe10:aad4]    // IPv6 address
OK

5.4. Command timing considerations

Response Timeouts by Command Type:

Command TypeTypical TimeoutMax TimeoutExample
Configuration1 second5 secondsAT+UBTM=1
Connection10 seconds30 secondsAT+UWSC=0
Data Transfer5 seconds15 secondsAT+USOWS=0,"data"
Network Query3 seconds10 secondsAT+UWSNST?

5.5. Unsolicited result code (URC) event management

5.5.1. Understanding urcs

Unsolicited Result Codes (URCs) are events generated by NORA-W36 without being prompted by a command. They provide real-time information about module status, incoming data, and connectivity changes.

URC Characteristics:

  • Unprompted - Arrive without commands being sent
  • Time-critical - Often require immediate handling
  • Context-dependent - May require maintaining state information
  • Protocol-specific - Different protocols generate different URCs

5.5.2. Critical URC categories

5.5.2.1. Connectivity urcs


+UEBTC:0,AAAAAAAAAAAAp             // Bluetooth connected
+UEBTDC:0        // Bluetooth disconnected
+UESOC:0         // Socket connected
+UESOCL:0        // Socket closed
+UEWLU:0         // Wi-Fi link up
+UEWLD:0,4       // Wi-Fi link down (reason code)

5.5.2.2. Data availability urcs


+UESODA:0,128            // 128 bytes available on socket 0
+UESODS:0,"Hello World"            // Direct string data on socket 0
+UESPSDS:0,"SPS Data"              // SPS string data received
+UEMQDA:0        // MQTT data available

5.5.2.3. Status change urcs


+STARTUP         // Module started/restarted
+UEWSNU          // Wi-Fi station network up
+UEWSND          // Wi-Fi station network down
+UEMQC:0         // MQTT connected
+UEMQDC:0        // MQTT disconnected

5.5.3. URC handling strategies

5.5.3.1. Strategy 1: event-driven state machine


// Maintain connection state
connection_state = "DISCONNECTED"
// Handle connection events
if URC == "+UEBTC:0,*":
- connection_state = "BT_CONNECTED"
- start_data_monitoring()
if URC == "+UEBTDC:0":
- connection_state = "DISCONNECTED"
- stop_data_monitoring()

5.5.3.2. Strategy 2: data-driven processing


// Handle data events immediately
if URC == "+UESODS:0,*":
- data = extract_data_from_urc()
- process_incoming_data(data)
if URC == "+UESODA:0,*":
- bytes_available = extract_count_from_urc()
- read_buffered_data(bytes_available)

5.5.3.3. Strategy 3: error recovery


// Handle error conditions
if URC == "+UESOCL:0":
- log_error("Socket closed unexpectedly")
- attempt_reconnection()
if URC == "+UEWLD:0,4":
- log_error("Wi-Fi disconnected - reason 4")
- retry_wifi_connection()

6. Data Handling and Processing

This chapter covers advanced data handling concepts, event processing patterns, and practical implementation strategies for building robust NORA-W36 applications.

6.1. Data flow fundamentals

6.1.1. Data mode overview

NORA-W36 supports multiple data handling modes, each optimized for different use cases:

Data ModeBehaviorEvent TypeBest For
String ModeText data only+UESODS, +UESPSDSJSON, XML, sensor readings
Binary ModeAll data types+UESODB, +UESPSDBFiles, certificates, images
Buffered ModeStore until read+UESODAEvent-driven applications
Direct ModeImmediate delivery+UESODS/+UESODBReal-time applications
Transparent ModeUART passthroughNone (direct UART)Legacy protocol support

6.1.2. Event-data relationship

Understanding Data Event Flow:

  1. Data Arrives at module
  2. Module Processes according to current mode
  3. Event Generated to notify host
  4. Host Application handles event appropriately

6.1.2.1. Buffered mode flow


// Data arrives → stored in buffer
// Event generated:
+UESODA:0,256            // 256 bytes available on socket 0
// Host reads data:
AT+USORS=0,256
+USORS:0,256,"actual data content here..."
OK

6.1.2.2. Direct mode flow


// Data arrives → immediately delivered
+UESODS:0,"immediate data"         // String data delivered directly
// No additional read command needed

6.2. Protocol-specific event patterns

6.2.1. Event categories

6.2.1.1. Wi-Fi socket events


// Connection sequence:
+UESOC:0         // Socket connected
+UESODA:0,128            // Data available (buffered mode)
+UESODS:0,"data"         // Data delivered (direct mode)
+UESOCL:0        // Socket closed

6.2.1.2. Bluetooth SPS events


// SPS connection sequence:
+UESPSC:0        // SPS connected
+UESPSDS:0,"Hello"       // String data received
+UESPSDA:0,64            // Binary data available
+UESPSDC:0       // SPS disconnected

6.2.1.3. MQTT events


// MQTT lifecycle:
+UEMQC:0         // MQTT connected
+UEMQDA:0        // Data available
+UEMQPC:0,123,45         // Publish completed
+UEMQDC:0        // MQTT disconnected

6.3. Event processing best practices

6.3.1. Event handler design patterns

6.3.1.1. Pattern 1: central event dispatcher


function handle_event(event_string):
- if event_string.startswith("+UEBTC"):
- handle_bluetooth_connected(event_string)
- elif event_string.startswith("+UESODS"):
- handle_socket_data(event_string)
- elif event_string.startswith("+STARTUP"):
- handle_module_startup()

6.3.1.2. Pattern 2: state-based processing


function process_event(event, current_state):
- switch current_state:
- case CONNECTING:
- if event == "+UESOC:0":
- transition_to_state(CONNECTED)
- case CONNECTED:
- if event.startswith("+UESODA"):
- handle_data_available(event)

6.3.2. Error handling strategies

6.3.2.1. Robust event processing


function safe_event_handler(event):
- try:
- process_event(event)
- except ParseError:
- log_error("Failed to parse event: " + event)
// Continue processing other events
    except ConnectionError:
- log_error("Connection lost during event processing")
- initiate_reconnection()

6.3.2.2. Event queue management


// Buffer events during critical operations
event_queue = []
critical_operation_active = False
function queue_or_process_event(event):
- if critical_operation_active:
- event_queue.append(event)
- else:
- process_event_immediately(event)

6.4. Performance considerations

Event Processing Guidelines:

  • Keep handlers fast - Long processing can cause event loss
  • Use buffering for high-frequency events
  • Prioritize critical events (connection status over data)
  • Batch process multiple data events when possible

Memory Management:

  • Limit event queue size to prevent memory exhaustion
  • Clean up resources when connections close
  • Monitor buffer usage in high-throughput scenarios

6.5. Practical implementation examples

6.5.1. Basic event loop


// Simple event monitoring loop
while True:
    line = read_from_uart()
    if line.startswith("+"):
// This is an event (URC)
        handle_event(line)
    elif line in ["OK", "ERROR"]:
// This is a command response
        handle_command_response(line)
    elif line.startswith("+STARTUP"):
// Module restarted
        reinitialize_module()

6.6. Connection state management


// Track multiple connection types
connection_states = {
    "wifi": "DISCONNECTED",
    "bluetooth": "DISCONNECTED",
    "mqtt": "DISCONNECTED"
}
// Update states based on events
function update_connection_state(event):
- if "+UEWLU" in event:
- connection_states["wifi"] = "CONNECTED"
- elif "+UEWLD" in event:
- connection_states["wifi"] = "DISCONNECTED"
- elif "+UEBTC" in event:
- connection_states["bluetooth"] = "CONNECTED"
-                // ... etc

6.7. Data collection pattern


// Collect data from multiple sources
data_sources = {
    "socket_0": [],
    "sps_0": [],
    "mqtt": []
}
function handle_data_event(event):
- if "+UESODS:0" in event:
- data = extract_data(event)
- data_sources["socket_0"].append(data)
- elif "+UESPSDS:0" in event:
- data = extract_data(event)
- data_sources["sps_0"].append(data)

6.8. Troubleshooting event handling

6.8.1. Common issues

ProblemSymptomsSolution
Missing EventsExpected URCs not receivedCheck event flow control, verify module state
Event OverflowEvents arriving faster than processingImplement event queue, optimize handlers
Parse ErrorsMalformed event stringsAdd robust parsing with error recovery
State ConfusionApplication state out of sync with moduleImplement state verification commands

6.8.2. Debugging event flow

Enable Debug Logging:


// Log all events for analysis
function debug_log_event(event):
- timestamp = get_current_time()
- log_file.write(f"{timestamp}: {event}")

Verify Event Sources:


// Check which events are actually being generated
AT+UBTM?         // Check Bluetooth mode
AT+UWSNST?       // Check Wi-Fi status
AT+USOST=0       // Check socket status

This foundation in event-driven programming and data handling prepares you for implementing specific protocol use cases covered in subsequent chapters. Understanding these fundamentals is crucial for building robust IoT applications with NORA-W36.

7. Bluetooth use cases

The following Bluetooth Low Energy use case, show some functionality to get started with GATT client, GATT server and SPS.

u-connectXpress BLE default values3.1.0
BLE Mode defaultON, Central and Peripheral (Mode = 3)
BLE Legacy Advertising defaultOFF, enable with AT+UBTAL

The following examples use the MAC address below, this must be replaced by the real MAC address of the devices that are used.

  • Peripheral MAC address: AAAAAAAAAAAA
  • Central MAC address: BBBBBBBBBBB

7.1. Bluetooth GATT client

ble

bt-gatt-client

This use case configures NORA-W36 as a Central device that operates as a GATT client and receives data.

This use case configuration is used in combination with Bluetooth GATT server.

NrInstructionsAT commandAT event
1Check that Bluetooth Central is enabled. 1: Central or 3: Central and Peripheral. If so jump to step 6.AT+UBTM?+UBTM:1 or +UBTM:3
2Enable Bluetooth 1: Central or 3: Central and PeripheralAT+UBTM=1 or AT+UBTM=3OK
3Store commandAT&WOK
4RestartAT+CPWROFFOK
5Wait for NORA-W36 to startup +STARTUP
6Connect to remote deviceAT+UBTC=AAAAAAAAAAAAp+UEBTC:0,AAAAAAAAAAAAp
7Discover Services and look for 180D, which is the descriptor for the Heart Rate service.AT+UBTGPSD=0+UBTGPSD:0,12,65535,180D
8Discover all Service Characteristics and look for 2A37, which is the descriptior for the Heart Rate Measurement characteristics.AT+UBTGSCD=0,12,65535+UBTGSCD:0,13,10,14,2A37
9Use the Value handle, which in this case is 14. The value can vary. Look for 2902, which is the descriptor for the notification.AT+UBTGCDD=0,14,15+UBTGCDD:0,13,15,2902
10Enable notification on the GATT Client the Central in this exampleAT+UBTGCCW=0,15,1OK
11Notification is received on the GATT Client +UEBTGCN:0,14,60 +UEBTGCN:0,14,61 +UEBTGCN:0,14,62

7.2. Bluetooth GATT server

ble

bt-gatt-server

This use case configures NORA-W36 as a Peripheral device that operates as GATT server and sends notifications.

This configuration works in combination with Bluetooth GATT client.

NrInstructionsAT commandAT event
1Check that Bluetooth Peripheral is enabled 2: Peripheral and 3: Central and Peripheral. If so jump to step 6.AT+UBTM?+UBTM:2 or +UBTM:3
2Enable Bluetooth 2: Peripheral or 3: Central and PeripheralAT+UBTM=2 or AT+UBTM=3OK
3Store commandAT&WOK
4RestartAT+CPWROFFOK
5Wait for NORA-W36 to start +STARTUP
6Enable Legacy AdvertisingAT+UBTALOK
7Write the Heart Rate serviceAT+UBTGS=180D+UBTGS:21
8Write the GATT characteristicAT+UBTGC=2A37,3A,01,01,00+UBTGC:30,31
9Activate GATT ServiceAT+UBTGSAOK
10Wait for incoming Bluetooth connection +UEBTC:0,BBBBBBBBBBB
11Get the MTU for the connection (optional)AT+UBTCST=0,3+UBTCST:3,247
12Get the Role for the connection (optional)AT+UBTCST=0,7+UBTCST:7,1
13Send a notification from the GATT Server using the value handleAT+UBTGNS=0,14,60 AT+UBTGNS=0,14,61 AT+UBTGNS=0,14,62OK

7.3. Bluetooth SPS central

ble

bt-sps-central

This use case configures NORA-W36 as a Central device that sends and receives data from another NORA-W36 module operating as a Peripheral device. The communication between the two modules is facilitated using the proprietary u-blox Serial Port Service. It is also possible to connect to other devices that supports the SPS protocol.

This use case operates in combination with Bluetooth SPS peripheral.

NrInstructionsAT commandAT event
1Check that Bluetooth Central is enabled. 1:Central or 3:Central and Peripheral. If so, jump to step 6.AT+UBTM?+UBTM:1 or +UBTM:3
2Enable Bluetooth 1:Central or 3:Central and PeripheralAT+UBTM=1 or AT+UBTM=3OK
3Store commandAT&WOK
4RestartAT+CPWROFFOK
5Wait for NORA-W36 to start +STARTUP
6Initiate Bluetooth discovery. Listen for advertising packets broadcast from Peripheral device.AT+UBTD+UBTD:AAAAAAAAAAAAp,-52,"NORA-W36-AAAAAA",0,10094E4F52412D5733362D414141414141
7Connect BluetoothAT+UBTC=AAAAAAAAAAAAp+UEBTC:0,AAAAAAAAAAAAp
8Read MTU, maximum data sizeAT+UBTCST=0,3+UBTCST:3,247
9Read RSSI (optional)AT+UBTRSS=0+UBTRSS:-52
10Connect SPS using handle of Bluetooth connectionAT+USPSC=0OK
11SPS connection is up +UESPSC:0
12It is now possible to send and receive SPS data in String or Binary mode  
13Disconnect the SPS and Bluetooth connectionAT+UBTDC=0+UESPSDC:0 +UEBTDC:0

7.4. Bluetooth SPS peripheral

ble

bt-sps-central

This use case configures NORA-W36 module as a Peripheral device that sends and receives data from another NORA-W36 module operating as a Central device. The communication between the two modules is facilitated using the proprietary u-blox Serial Port Service. It is also possible to connect to other devices that support the SPS protocol.

This use case configuration is used in combination with Bluetooth SPS central.

NrInstructionsAT commandAT events
1Check that Bluetooth Peripheral is enabled. 2: Peripheral and 3: Central and Peripheral. If so, jump to step 6AT+UBTM?+UBTM:2 or +UBTM:3
2Enable Bluetooth 2: Peripheral or 3: Central and PeripheralAT+UBTM=2 or AT+UBTM=3OK
3Store commandAT&WOK
4RestartAT+CPWROFFOK
5Wait for NORA-W36 to startup +STARTUP
6Enable SPS on PeripheralAT+USPS=1OK
7Enable Legacy AdvertisingAT+UBTALOK
8Peripheral receives Incoming Bluetooth connection +UEBTC:0,BBBBBBBBBBBBp
9Read MTU, maximum data size on bothAT+UBTCST=0,3+UBTCST:3,247
10Read RSSI (optional)AT+UBTRSS=0+UBTRSS:-52
11Central Connect SPS using handle of Bluetooth connectionAT+USPSC=0+UESPSC:0
12It is now possible to send and receive SPS data in String or Binary mode  
13SPS and Bluetooth link is down+UESPSDC:0 +UEBTDC:0 

7.5. Bluetooth advertise

ble

This use case configures NORA-W36 as a peripheral device that operates as a GATT client and receives data.

This use case configuration is used in combination with Apple iPhone using the Apple Notification Center Service (ANCS).

NrInstructionsAT commandAT event
1Check that Bluetooth Peripheral is enabled 2: Peripheral and 3: Central and Peripheral. If so, jump to step 6.AT+UBTM?+UBTM:2 or +UBTM:3
2Enable Bluetooth 2: Peripheral or 3: Central and PeripheralAT+UBTM=2 or AT+UBTM=3OK
3Store commandAT&WOK
4RestartAT+CPWROFFOK
5Wait for NORA-W36 to start +STARTUP
6Set Apple ANCS Advertise data packetAT+UBTAD=1115D0002D121E4B0FA4994ECEB531F40579OK
7Enable Legacy AdvertisingAT+UBTALOK
8Peripheral receives Incoming Bluetooth connection +UEBTC:0,BBBBBBBBBBBBp
9Discover Services and look for 180A that is the Device InformationAT+UBTGPSD=0+UBTGPSD:0,1,5,1800 +UBTGPSD:0,6,9,1801 +UBTGPSD:0,10,14,180A +UBTGPSD:0,15,19,D0611E78BBB44591A5F8487910AE4366 +UBTGPSD:0,20,24,9FA480E0496745429390D343DC5D04AE +UBTGPSD:0,25,28,180F +UBTGPSD:0,29,34,1805 +UBTGPSD:0,35,44,7905F431B5CE4E99A40F4B1E122D00D0 +UBTGPSD:0,45,56,89D3502B0F36433A8EF4C502AD55F8DC
10Discover all Service Characteristics and look for the attribute 2A29, which describes the Manufacturer Name String characteristicsAT+UBTGSCD=0,10,14+UBTGSCD:0,11,02,12,2A29 +UBTGSCD:0,13,02,14,2A24
11Read the Manufacturer Name String Apple Inc. characteristics on handle 12AT+UBTGR=0,12+UBTGR:0,12,4170706C6520496E632E (Apple Inc.)

7.6. Bluetooth security

Pairing

  • Pairing is the initial process where two Bluetooth devices exchange information necessary to establish an encrypted connection
  • During pairing, devices negotiate security parameters, such as encryption keys and authentication methods
  • It ensures that communication between devices remains confidential and secure

Think of pairing as the handshake that sets the foundation for a secure link

Bonding

  • Bonding occurs after successful pairing
  • It involves storing the information from the pairing process on both devices
  • Once bonded, devices remember each other's security credentials (keys) for future reconnections
  • Bonding eliminates the need to repeat the pairing process every time the devices reconnect
  • Essentially, bonding creates a permanent security relationship between the devices

In summary

  • Pairing: Establishes the initial secure connection
  • Bonding: Ensures that the devices remember each other's security details for subsequent interactions
  • Remember, these processes are essential for maintaining the confidentiality and integrity of data exchanged over Bluetooth connections

7.7. Bluetooth security initiator

ble

Bluetooth Security is disabled by default and must be configured and enabled before use.

NrInstructionsAT commandAT event
1Set Bluetooth I/O Capabilities to Display Yes/No (2)AT+UBTIOC=2 
2Set Only allow authenticated bonding with encrypted Bluetooth link (3)AT+UBTBSM=3 
3Allow PairingAT+UBTPM=1 
4Bluetooth BondAT+UBTB=BBBBBBBBBBBBp 
5Bluetooth Connected event +UEBTC:0,BBBBBBBBBBBBp
6Bluetooth User Confirmation event, check the number on both devices, should be the same +UEBTUC:BBBBBBBBBBBBp,786920
7Bluetooth User Confirmation, confirm with yesAT+UBTUC=BBBBBBBBBBBBp,1 
8Bluetooth Bond success +UEBTB:BBBBBBBBBBBBp,0
9Bluetooth Bonded Devices List (optional)AT+UBTBDL+UBTBDL:BBBBBBBBBBBBp

7.8. Bluetooth security responder

ble

Bluetooth Security is disabled by default and must be configured and enabled before use.

NrInstructionsAT commandAT event
1Check that Bluetooth Peripheral is enabled, 2: Peripheral or 3: Central and Peripheral, if so move to step 6AT+UBTM?+UBTM:2 or +UBTM:3
2Enable Bluetooth 2: Peripheral or 3: Central and PeripheralAT+UBTM=2 or AT+UBTM=3OK
3Store commandAT&WOK
4RestartAT+CPWROFFOK
5Wait for NORA-W36 to startup +STARTUP
6Enable Legacy AdvertisingAT+UBTALOK
7Set Bluetooth I/O Capabilities to Display Yes/No (2)AT+UBTIOC=2 
8Set Only allow authenticated bonding with encrypted Bluetooth link (3)AT+UBTBSM=3 
9Allow PairingAT+UBTPM=1 
10Bluetooth Connected event +UEBTC:0,AAAAAAAAAAAAp
11Bluetooth User Confirmation event, check the number on both devices, should be the same +UEBTUC:AAAAAAAAAAAAp,786920
12Bluetooth User Confirmation, confirm with yesAT+UBTUC=AAAAAAAAAAAAp,1 
13Bluetooth Bond success +UEBTB:AAAAAAAAAAAAp,0
14Bluetooth Bonded Devices List (optional)AT+UBTBDL+UBTBDL:AAAAAAAAAAAAp

8. Wi-Fi Connection Use Cases

The following Wi-Fi use cases show basic connectivity functionality to get started with Wi-Fi Station and Access Point connections.

The following examples use the MAC address below, this must be replaced by the real MAC address of the devices that are used.

  • Station MAC address: AAAAAAAAAAAA
  • Access Point MAC address: BBBBBBBBBBB

8.1. Wi-Fi station WPA2 and WPA3

wi-fi-ap

wi-fi-station

Connect as a Wi-Fi station to an Access Point to get access to network.

This use case connects NORA-W36 as a Wi-Fi station to an Access Point for access to the network. The connection is set to DHCP client by default.

To use static IP the AT+UWSIPS set the IP address, gateway, subnet mask and DNS.

8.1.1. WPA2/WPA3 security overview

The NORA-W36 module supports both WPA2 Personal and WPA3 Personal security protocols when operating as a Wi-Fi station, providing enhanced wireless network protection:

Security ProtocolEncryptionKey BenefitsUse Cases
WPA2 PersonalAES-CCMPIndustry standard, broad compatibilityLegacy networks, mixed environments
WPA3 PersonalAES-CCMP/GCMP-256Enhanced security, forward secrecy, SAE protectionModern secure networks, IoT applications

WPA3 Security Enhancements (Station Mode Only):

  • SAE (Simultaneous Authentication of Equals): Stronger password-based authentication
  • Forward Secrecy: Previous session keys remain secure even if password is compromised
  • Enhanced Protection: Resistant to offline dictionary attacks
  • Improved Handshake: More robust authentication process

Note: WPA3 support is available for station mode only. When operating as an Access Point, NORA-W36 supports WPA2 Personal only.

8.1.2. Station connection configuration

NrInstructionsAT commandAT event
1Set SSID for the NetworkAT+UWSCP=0,"ssid"OK
2aSet Password (WPA2/WPA3 compatible)AT+UWSSW=0,"password",0OK
2bSet Password (WPA3 only)AT+UWSSW=0,"password",1OK
3Connect Wi-Fi stationAT+UWSC=0OK
4Wait for Wi-Fi interface +UEWLU:0,BBBBBBBBBBB,6
5Wait for Network interface +UEWSNU
6Check IP address (optional)AT+UWSNST?+UWSNST:0,192.168.1.179 etc.
7Check RSSI (optional)AT+UWSST=4+UWSST:4,-66
8It is now possible to connect TCP and UDP, and then send and receive data in String or Binary mode. It is also possible to connect MQTT.  
9Disconnect Wi-Fi stationAT+UWSDCOK

8.1.3. Wpa security parameter details

AT+UWSSW Command Format:


AT+UWSSW=<interface_id>,<password>,<wpa_threshold>

Parameters:

  • interface_id: Wi-Fi interface (0 = station)
  • password: WPA/WPA2/WPA3 password (8-63 characters)
  • wpa_threshold: Security level selection
  • 0: Accept WPA2 or higher (WPA2/WPA3 compatible)
  • 1: Require WPA3 only (enhanced security)

Security Recommendations:

  • Use wpa_threshold=1 for WPA3-only networks requiring maximum security
  • Use wpa_threshold=0 for broader compatibility with WPA2/WPA3 networks
  • Ensure password meets complexity requirements (minimum 8 characters)

Important Note: If NORA-W36 should connect to Wi-Fi at startup, the Connect, Store and Reset commands should be sent: AT+UWSC=0, AT&W and AT+CPWROFF. The current Wi-Fi Station state is stored in flash and NORA-W36 will try to connect using the Service Set Identifier (SSID) and password stored at startup.

8.1.4. Wi-Fi station command reference

The following section provides detailed documentation for key Wi-Fi station commands using the standardized format:

AT+uwscp - Wi-Fi station connection parameters

Purpose: Configure SSID for Wi-Fi station connection

Syntax:


AT+UWSCP=<interface_id>,<ssid>

Parameters:

  • interface_id: Wi-Fi interface ID (0 = station)
  • ssid: Network SSID name (1-32 characters, quoted string)

Examples:


AT+UWSCP=0,"MyNetwork"             // Set SSID to "MyNetwork"
AT+UWSCP=0,"Office_WiFi_5G"        // Set SSID with special characters

Response: OK on success, ERROR on failure

Notes:

  • Channel selection is automatic during connection
  • Settings can be stored with AT&W followed by AT+CPWROFF to ensure safe flash storage

AT+uwssw - Wi-Fi station security/password

Purpose: Set WPA/WPA2/WPA3 password and security threshold

Syntax:


AT+UWSSW=<interface_id>,<password>,<wpa_threshold>

Parameters:

  • interface_id: Wi-Fi interface ID (0 = station)
  • password: WPA password (8-63 characters, quoted string)
  • wpa_threshold: Security level
  • 0: Accept WPA2 or higher (recommended for compatibility)
  • 1: Require WPA3 only (enhanced security)

Examples:


AT+UWSSW=0,"MyPassword",0          // WPA2/WPA3 compatible
AT+UWSSW=0,"SecurePass123",1       // WPA3 only

Response: OK on success, ERROR on invalid parameters

AT+uwsc - Wi-Fi station connect

Purpose: Initiate connection to configured Wi-Fi network

Syntax:


AT+UWSC=<interface_id>

Parameters:

  • interface_id: Wi-Fi interface ID (0 = station)

Example:


AT+UWSC=0

Response:

  • OK - Connection process started
  • +UEWLU:0,<mac_address>,<channel> - Wi-Fi link established
  • +UEWSNU - Network interface ready

Common Errors:

  • ERROR:1 - Invalid parameters
  • ERROR:8 - Connection timeout
  • ERROR:16 - Authentication failed

AT+uwsdc - Wi-Fi station disconnect

Purpose: Disconnect from current Wi-Fi network

Syntax:


AT+UWSDC[=<interface_id>]

Parameters:

  • interface_id: Optional Wi-Fi interface ID (default: 0)

Example:


AT+UWSDC

Response: OK on success

8.1.5. Wi-Fi station troubleshooting

8.1.5.1. Common connection issues

IssueSymptomsPossible CausesSolutions
Authentication failureERROR on AT+UWSC=0Wrong password, unsupported securityVerify password, check WPA mode support
Connection timeoutCommand hangs, no +UEWLUWeak signal, network issuesCheck RSSI with AT+UWSST=4, move closer to AP
No IP address+UEWLU received but no +UEWSNUDHCP issues, network configCheck router DHCP settings, try static IP
Frequent disconnectionsIntermittent connectivitySignal interference, power saveDisable power save, check for interference

8.1.5.2. Debug commands

CommandPurposeExample Response
AT+USYEE=1Enable extended error codesOK
AT+USYEC?Check last error code+USYEC:16 (auth failed)
AT+UWSST=4Check signal strength+UWSST:4,-65 (RSSI in dBm)
AT+UWSNST?Check network status+UWSNST:0,192.168.1.179 + more params
AT+UWSSCScan for Wi-Fi networks+UWSSC:<bssid>,<ssid>,<channel>,<rssi>,...

8.1.5.3. Step-by-step troubleshooting

  1. Test Basic Communication

   AT
   OK
  1. Enable Extended Errors

   AT+USYEE=1
   OK
  1. Check Current Configuration

   AT+UWSCP=0
   +UWSCP:0,"MyNetwork"
  1. Verify Signal Strength

   AT+UWSST=4
   +UWSST:4,-45          // Good signal (-30 to -50 dBm)
  1. Test Connection

   AT+UWSC=0
   OK
   // Wait for events...
  1. If Connection Fails, Check Error

   AT+USYEC?
   +USYEC:16     // Error code 16 = Authentication failed

8.2. Wi-Fi PEAP enterprise security

wi-fi-ap

Connect as a Wi-Fi station to an Access Point using PEAP (Protected Extensible Authentication Protocol) and a RADIUS server to get access to network.

This use case connects NORA-W36 as a Wi-Fi station to an Access Point for access to the network. The connection is set to DHCP client by default.

<!--- wi-fi-station

--->

NrInstructionsAT commandAT event
1Set SSID for the NetworkAT+UWSCP=0,"NORA-W36 Access Point"OK
2Set the User and Password with TLS 1.3AT+UWSSP=0,2,"peap_user_name","peap_password"OK
3Connect Wi-Fi stationAT+UWSC=0OK
4Wait for Wi-Fi interface +UEWLU:0,BBBBBBBBBBB,6
5Wait for Network interface +UEWSNU
6Check IP address (optional)AT+UWSNST=0+UWSNST:0,192.168.1.179
7Check RSSI (optional)AT+UWSST=4+UWSST:4,-66
8It is now possible to connect TCP and UDP, and then send and receive data in String or Binary mode. It is also possible to connect MQTT.  
9Disconnect Wi-Fi stationAT+UWSDCOK

Important Note: If NORA-W36 should connect to Wi-Fi at startup the Connect, Store and Reset should be sent, AT+UWSC=0, AT&W and AT+CPWROFF, the current Wi-Fi Station state is stored in flash and NORA-W36 will try to connect using Service Set Identifier (SSID) and password stored at startup.

8.3. Wi-Fi EAP-TLS enterprise security

wi-fi-ap

Connect as a Wi-Fi station to an Access Point using Extensible Authentication Protocol (EAP) and EAP Transport Layer Security (EAP-TLS) to get access to network.

This use case connects NORA-W36 as a Wi-Fi station to an Access Point for access to the network. The connection is set to DHCP client by default.

To use static IP the AT+UWSIPS set the IP address, gateway, subnet mask and DNS.

<!---wi-fi-station

--->

NrInstructionsAT commandAT event
1Write X.509 certificate and private key using Binary dataAT+USECUB=0,"ca.pem"{binary_content} + AT+USECUB=1,"client.pem"{binary_content} + AT+USECUB=2,"client.key"{binary_content} Note: Brackets { } should NOT be sentOK
2Set SSID for the NetworkAT+UWSCP=0,"NORA-W36 Access Point"OK
3Set the certificates and key with TLS 1.3AT+UWSSE=0,2,"ca.pem","client.pem","client.key"OK
4Connect Wi-Fi stationAT+UWSC=0OK
5Wait for Wi-Fi interface +UEWLU:0,BBBBBBBBBBB,6
6Wait for Network interface +UEWSNU
7Check IP address (optional)AT+UWSNST=0+UWSNST:0,192.168.1.179
8Check RSSI (optional)AT+UWSST=4+UWSST:4,-66
9It is now possible to connect TCP and UDP, and then send and receive data in String or Binary mode. It is also possible to connect MQTT.  
10Disconnect Wi-Fi stationAT+UWSDCOK

Important Note: If NORA-W36 should connect to Wi-Fi at startup the Connect, Store and Reset should be sent, AT+UWSC=0, AT&W and AT+CPWROFF, the current Wi-Fi Station state is stored in flash and NORA-W36 will try to connect using Service Set Identifier (SSID) and password stored at startup.

TLS Version Options for EAP-TLS:

The second parameter in AT+UWSSE specifies the TLS version:

  • 0: Disable TLS (not recommended for EAP-TLS)
  • 1: TLS 1.2 only
  • 2: TLS 1.3 only (recommended for enhanced security)
  • 3: TLS 1.2 or 1.3 (negotiate highest available)

Security Recommendation: Use TLS 1.3 (parameter 2) for the strongest security posture, as it provides improved encryption algorithms, forward secrecy, and reduced handshake latency.

8.4. Wi-Fi access point WPA2

wi-fi-ap

This use case configures NORA-W36 to act as a Wi-Fi Access Point that allows Wi-Fi Stations to connect, send, and receive data to the module.

The Wi-Fi connection has WPA2 encryption and a DHCP server that automatically assigns IP addresses to devices when they connect to the network.

The server assigns connected devices with IP addresses from 192.168.1.100 + x, where 'x' represents the additional IP addresses that can be assigned to other devices connected to the network.

NrInstructionsAT commandAT event
1Set the SSID and select network channel to 6 to define the frequency bandAT+UWAPCP="NORA-W36 Access Point",6OK
2Set the Password, using WPA2AT+UWAPSW="mypassword"OK
3Activate the Wi-Fi Access point. DHCP Server is enabled by defaultAT+UWAPAOK
4Wait for Access Point +UEWAPU
5Wait for Network interface +UEWAPNU
6Check the IP address of the AP (optional)AT+UWAPNST=0+UWAPNST:0,192.168.1.80
7Station connected +UEWAPSA:AAAAAAAAAAAA
8It is now possible to connect over TCP and UDP, and then send and receive data in String or Binary mode. It is also possible to connect MQTT.  
9Station disconnect +UEWAPSDA:AAAAAAAAAAAA
10Deactivate Wi-Fi Access PointAT+UWAPDOK

Note: If NORA-W36 activates Wi-Fi Access Point at startup, Activate (AT+UWAPA), Store (AT&W) and Reset (AT+CPWROFF) commands should be sent. The current Wi-Fi Access Point state is stored in flash and NORA-W36 then activates the Access Point using the stored SSID and password at startup.

IP address range is 192.168.1.100 + x to connected stations.

8.4.1. Access point security details

Security Limitation: Access Point mode supports WPA2 Personal only. WPA3 is not supported when operating as an Access Point.

AT+UWAPSW Command Format:


AT+UWAPSW=<password>

Parameters:

  • password: WPA2 password (8-63 characters)

Security Features:

  • WPA2 Personal: Industry-standard security with AES-CCMP encryption
  • Password Protection: 8-63 character password requirement
  • DHCP Server: Automatic IP address assignment for connected devices

9. Wi-Fi Security Configuration

This chapter provides comprehensive security guidance for NORA-W36 implementation in production environments, covering wireless security, encryption protocols, certificate management, and operational security considerations.

9.1. Wireless security configuration

9.1.1. Wi-Fi security protocol selection

Recommended Security Hierarchy (Best to Acceptable):

PrioritySecurity ModeUse CaseImplementation
1stWPA3 PersonalNew deployments, high-security IoTAT+UWSSW=0,"password",1
2ndWPA2/WPA3 CompatibleMixed environments, broader compatibilityAT+UWSSW=0,"password",0
3rdEAP-TLS EnterpriseCorporate networks, certificate-basedAT+UWSSE=0,2,"ca.pem","client.pem","client.key"
4thPEAP EnterpriseCorporate networks, username/passwordAT+UWSSP=0,2,"username","password"
AvoidOpen NetworksNever use in productionNot recommended

9.1.2. Password security standards

WPA/WPA2/WPA3 Password Requirements:

Strong Password Criteria:

  • Minimum 12 characters (8 is technical minimum, 12+ recommended)
  • Mixed case letters (A-Z, a-z)
  • Numbers (0-9)
  • Special characters (!@#$%^&*)
  • Avoid dictionary words and predictable patterns

Examples:


// Weak passwords (avoid)
AT+UWSSW=0,"password",0            // Dictionary word
AT+UWSSW=0,"12345678",0            // Sequential numbers
AT+UWSSW=0,"CompanyName",0         // Predictable
// Strong passwords (recommended)
AT+UWSSW=0,"Mx7$kL2@Rt9!uP",0      // Random strong password
AT+UWSSW=0,"BlueTree#2024$IoT",0             // Memorable but complex

9.2. Network architecture security

Station Mode Security:

  • Use WPA3 when available (wpa_threshold=1)
  • Verify network authenticity before connecting
  • Monitor signal strength to detect rogue APs
  • Implement connection timeouts to prevent hanging

Access Point Mode Security:

  • Change default SSID from "NORA-W36"
  • Use complex passwords (12+ characters)
  • Limit connected devices (max 5 stations)
  • Monitor connected devices with +UEWAPSA events
  • Regular password rotation in production

9.3. TLS/SSL security implementation

9.3.1. TLS version configuration

TLS Security Layer Architecture:


    ┌─────────────    ┌─────────────    ┌─────────────
    │🛡 TLS 1.3   │ ── │🔒 TLS 1.2   │ ── │⚠ No TLS    │
    │   (Best)    │    │ (Legacy)    │    │  (Never!)   │
    └─────────────┘    └─────────────┘    └─────────────┘
           │                     │                     │
      Max Security         Good Security         No Security
    🔧 TLS 1.3 Benefits:    🔧 TLS 1.2 Support:    ⚠ Security Risk:
- • Forward secrecy      • Legacy compatibility  • Plain text data
- • 0-RTT handshake      • Proven stability      • No encryption
- • Modern encryption    • Wide support          • Vulnerable to attacks

TLS Security Hierarchy:

PriorityTLS VersionParameterUse CaseSecurity Level
1stTLS 1.32New implementations, maximum security🛡 Highest
2ndTLS 1.2/1.33Transition period, server compatibility🔒 High
3rdTLS 1.21Legacy server support only⚠ Medium
NeverNo TLS0Never use for secure connections🚫 None

Implementation Examples:


// Best: TLS 1.3 only (recommended for new projects)
AT+USOTLS=0,2            // Socket TLS 1.3
AT+UMQTLS=0,2            // MQTT TLS 1.3
AT+UHTCTLS=0,2           // HTTP TLS 1.3
// Good: TLS 1.2/1.3 compatible (legacy support)
AT+USOTLS=0,3            // Negotiate highest available

9.4. Certificate management security

Certificate Security Best Practices:

Certificate Validation:

  • Always validate server certificates in production
  • Use complete certificate chains (CA + intermediate + server)
  • Verify certificate expiration dates before deployment
  • Test certificate chain validity with openssl

Certificate Storage:

  • Limit certificate lifetime (1-2 years maximum)
  • Use secure certificate sources (trusted CAs only)
  • Monitor certificate expiration (automated renewal)
  • Remove unused certificates to free storage

Certificate Upload Security:


// Upload complete certificate chain
AT+USECUB=0,"ca.pem"{binary_ca_cert}         // Root CA
AT+USECUB=1,"intermediate.pem"{binary_int_cert}    // Intermediate CA
AT+USECUB=2,"client.pem"{binary_client_cert}    // Client certificate
AT+USECUB=3,"client.key"{binary_private_key}    // Private key (secure!)

Certificate Validation Commands:


// List all certificates
AT+USECL?
// Verify specific certificate details
AT+USECD="ca.pem"
// Remove expired certificates
AT+USECR=1,"expired_cert.pem"

9.5. TLS extensions security

Recommended TLS Extension Configuration:


// Enable Server Name Indication (SNI) - Required for modern TLS
AT+USETE0=1      // Enable SNI (default: enabled)
// Enable Handshake Fragmentation - Prevents MTU issues
AT+USETE1=1      // Enable fragmentation (default: enabled)
// Store TLS extension settings
AT&W             // Persist configuration
AT+CPWROFF       // Reset to apply stored settings safely

9.6. Application protocol security

9.6.1. MQTT security configuration

Comprehensive MQTT Security Setup:


// Secure connection with TLS 1.3
AT+UMQCP=0,"secure-mqtt-broker.com",8883
AT+UMQTLS=0,2,"ca.pem","client.pem","client.key"
// Strong authentication (set connection parameters with credentials)
AT+UMQCP=0,"mqtt.broker.com",8883,"device_id_12345","device_id_12345","complex_password_67890"
// Connect securely
AT+UMQC=0

MQTT Security Checklist:

  • Always use port 8883 (TLS) instead of 1883 (plain)
  • Implement client certificates for mutual authentication
  • Use unique client IDs to prevent conflicts
  • Avoid predictable topics (use device-specific prefixes)
  • Implement message encryption for sensitive data
  • Monitor connection events for security anomalies

9.7. HTTP/HTTPS security configuration

Secure HTTP Implementation:


// Always use HTTPS (port 443)
AT+UHTCCP=0,"api.secure-service.com",443
AT+UHTCTLS=0,2,"ca.pem"
// Add security headers
AT+UHTCRHAF=0,"Authorization","Bearer secure_token_here"
AT+UHTCRHAF=0,"User-Agent","NORA-W36/3.1.0"
AT+UHTCRHAF=0,"Content-Type","application/json"
// Make secure request
AT+UHTCRG=0,"/api/v1/secure-endpoint"

HTTP Security Checklist:

  • Always use HTTPS (never HTTP for sensitive data)
  • Validate SSL certificates
  • Use proper authentication (tokens, API keys)
  • Implement request timeouts
  • Validate response status codes
  • Sanitize response data

9.8. Operational security practices

9.8.1. Device configuration security

Secure Configuration Management:


// Change default settings
AT+UWAPCP="SecureIoTGateway_001",6           // Unique SSID
AT+UWAPSW="ComplexPassword#2024$"            // Strong password
// Enable extended error reporting (development only)
AT+USYEE=1       // Enable during development
AT+USYEE=0       // Disable in production (security through obscurity)
// Store secure configuration
AT&W             // Save to flash
AT+CPWROFF       // Reset to apply stored settings safely
// Test configuration
AT+UWSNST=0      // Verify network status
AT+UWSSC         // List available networks

9.9. Power management security

Secure Power Save Configuration:


// Balance security and power efficiency
AT+UPMPSL=1      // Enable moderate power save
AT+UPMPSTO=5000          // 5-second timeout (balance responsiveness/power)
AT&W             // Store settings
AT+CPWROFF       // Reset to apply stored settings safely
// Security consideration: Ensure power save doesn't impact security monitoring

9.10. Monitoring and diagnostics

Security Monitoring Commands:


// Regular security health checks
AT+UWSST=4       // Monitor signal strength (detect rogue APs)
AT+UWSNST=0      // Verify network connection status, only IPv4 Address
AT+USECL?        // Check certificate validity
AT+USYEC?        // Check for error conditions
AT+UWSNST?       // Verify network connection status, all parameters

9.11. Security incident response

9.11.1. Connection security issues

Rapid Response Commands:

Security EventImmediate ActionCommand
Suspicious connectionDisconnect immediatelyAT+UWSDC
Authentication failureCheck credentials, reset if neededAT+USYEC? → reconfigure
Certificate errorVerify and reload certificatesAT+USECL?AT+USECR → reload
Weak signalCheck for interference/rogue APAT+UWSST=4
Connection timeoutReset network configurationAT+UWSDC → reconfigure

9.11.2. Security audit checklist

Regular Security Review (Monthly):

  • [ ] Password strength audit - verify all passwords meet current standards
  • [ ] Certificate expiration check - ensure all certificates valid for next 30 days
  • [ ] TLS version compliance - confirm TLS 1.3 usage where possible
  • [ ] Access point security - verify WPA3 usage and strong passwords
  • [ ] Connection monitoring - review unusual connection patterns
  • [ ] Firmware currency - ensure latest security patches applied
  • [ ] Configuration backup - secure backup of device configurations

Security Configuration Validation:


// Complete security status check
AT+UWSCP=0       // Verify SSID configuration
AT+UWSS=0        // Check security configuration
AT+USECL?        // List all certificates and expiration
AT+USYEC?        // Check for any error conditions

This comprehensive security framework ensures NORA-W36 deployments maintain the highest security standards while remaining operationally efficient.

10. Wi-Fi Performance Optimization

This chapter provides comprehensive performance optimization guidance for NORA-W36 deployments, covering connection optimization, power efficiency, memory management, and throughput enhancement techniques for maximum system performance.

10.1. Connection performance optimization

10.1.1. Wi-Fi connection speed enhancement

Fast Connection Techniques:

OptimizationImplementationPerformance ImpactCommand Example
Pre-scan networksScan before connecting2-3 seconds fasterAT+UWSSC
Channel optimizationUse specific SSID only1-2 seconds fasterAT+UWSCP=0,"MyAP"
Aggressive power saveDisable during connection1-3 seconds fasterAT+UPMPSL=0 (temporarily)
DHCP timeout tuningReduce DHCP wait time2-5 seconds fasterSystem automatic

Optimal Connection Sequence:


// Disable power save during connection (faster scanning)
AT+UPMPSL=0
// Scan for target network (get channel info)
AT+UWSSC
// Connect with specific parameters
AT+UWSCP=0,"TargetNetwork"         // Set SSID (channel determined by AP)
// Verify connection quickly
AT+UWSNST=0
// Re-enable power save after connection
AT+UPMPSL=1

10.2. Socket performance tuning

TCP Socket Optimization:


// Enable TCP fast recovery
AT+USORS=0,1000          // Read available data (1kB chunks)
// Use larger receive operations for bulk data
AT+USORS=0,1000          // 1kB chunks for file transfers
// Monitor socket status for optimal timing
AT+USYEE=1       // Enable extended error reporting

UDP Performance Configuration:


// UDP is inherently faster - optimize for your use case
AT+USORS=0,1000          // Standard read operations

10.3. TLS performance enhancement

TLS Handshake Optimization:

TLS VersionHandshake TimeSecurity LevelRecommended Use
TLS 1.3~2-3 secondsHighestNew deployments
TLS 1.2~3-4 secondsHighLegacy compatibility
TLS 1.2/1.3 Auto~2-4 secondsHighMixed environments

TLS Performance Commands:


// Fastest: TLS 1.3 with session resumption
AT+USOTLS=0,2            // TLS 1.3 for new connections
AT+USETE1=1      // Enable handshake fragmentation (faster on slow networks)
AT+USETE0=1      // Enable SNI (required for many servers)
// Pre-load certificates for faster handshake
AT+USECL?        // Verify certificates are already loaded

10.4. Power vs performance trade-offs

10.5. Power save mode optimization

⚡ Power Management Decision Matrix:


    ┌─────────────    ┌─────────────    ┌─────────────
    │🚀 High Perf │ ── │⚖ Balanced  │ ── │🔋 Low Power │
    │ Mode 0      │    │  Mode 1     │    │  Mode 2     │
    └─────────────┘    └─────────────┘    └─────────────┘
           │                     │                     │
      Max Speed            Good Balance          Max Battery
    ⚡ Performance:         ⚖ Balanced:          🔋 Power Saving:
- • No delays            • Smart trade-offs    • Extended battery
- • Instant response     • Good responsiveness • Ideal for IoT
- • High throughput      • Moderate power      • Periodic updates

Power Save Performance Matrix:

Power ModePower ConsumptionResponse TimeThroughputBest Use Case
🚀 Disabled (0)HighInstantMaximumHigh-throughput streaming
⚖ Light (1)MediumMediumGoodReal-time communications
🔋 Moderate (2)LowLongReducedPeriodic data updates

Adaptive Power Management:

💡 Timeout Logic: High-performance mode uses longer timeouts to maintain sustained operation without frequent power state changes. IoT sensors use shorter timeouts for quick wake-up and responsiveness to events.


// High performance mode (data streaming)
AT+UPMPSL=0      // Disable power save
AT+UPMPSTO=30000         // Long timeout (30 seconds) for sustained performance
// Balanced mode (regular operations)
AT+UPMPSL=1      // Light power save
AT+UPMPSTO=5000          // 5-second timeout
// Power efficient mode (IoT sensors)
AT+UPMPSL=2      // Moderate power save
AT+UPMPSTO=1000          // Short timeout (1 second) for quick responsiveness
// Save configuration
AT&W
AT+CPWROFF       // Reset to apply stored settings safely

10.6. Dynamic power scaling

Context-Aware Power Management:


// During active data transfer - maximum performance
AT+UPMPSL=0      // Disable power save
// After transfer complete - enable power save
AT+UPMPSL=1      // Light power save for quick response
// During idle periods - deep power save
AT+UPMPSL=2      // Moderate power save
// Example: Automatic switching based on socket activity
// (implement in host application logic)

10.7. Memory management optimization

10.7.1. Efficient memory usage

Memory Allocation Best Practices:

ResourceOptimal SizePerformance ImpactCommand
Socket Operations1KB for bulk dataHigher throughputAT+USORS=0,1000
Certificate StorageMinimize certificatesFaster boot/connectionAT+USECL?
Connection ManagementRegular monitoringPrevents issuesAT+UWSNST=0

Memory Monitoring Commands:


// Check certificate usage
AT+USECL?        // List certificates and sizes
// Remove unused certificates
AT+USECL?        // List certificates
AT+USECR=0,"old_cert.pem"          // Remove unused certificates
// Remove unused certificates to free storage
AT+USECR=0,"unused.pem"            // Remove unused certificates

10.8. Data handling efficiency

Optimal Data Transfer Guidelines:


// For socket operations, use appropriate read/write sizes
// Socket commands will be covered in Wi-Fi Sockets section
// Focus on connection optimization and certificate management

10.9. Network performance optimization

10.9.1. Wi-Fi signal quality management

Signal Strength Optimization:

Signal Strength (RSSI)Performance LevelRecommended Action
-30 to -50 dBmExcellentMaintain current position
-50 to -70 dBmGoodMonitor for degradation
-70 to -85 dBmFairConsider repositioning
Below -85 dBmPoorReposition or use repeater

Signal Monitoring Commands:


// Check current signal strength
AT+UWSST=4       // Signal strength in dBm
// Monitor connection quality
AT+UWSNST=0      // Network status and quality
// Scan for alternative networks
AT+UWSSC         // Scan and compare signal levels

10.10. Network congestion management

Channel Optimization Strategy:


// Scan all channels to find optimal one
AT+UWSSC
// Example: Choose less congested channel
// If scan shows:
-                // Channel 1: Many APs (congested)
-                // Channel 6: Few APs (better choice)
-                // Channel 11: Few APs (best choice)
// Configure network (channel determined by AP)
AT+UWSCP=0,"MyNetwork"             // Set SSID

10.11. Application-level performance

10.11.1. Protocol selection guidelines

Performance Comparison by Protocol:

ProtocolLatencyThroughputOverheadBest Use Case
UDPLowestHighestMinimalReal-time data, streaming
TCPLowHighLowReliable data transfer
TLS/TCPMediumMediumMediumSecure communications
HTTP/HTTPSHighMediumHighAPI calls, web services
MQTTMediumMediumLowIoT messaging, pub/sub

10.11.2. Data format optimization

Efficient Data Formats:


// JSON (human readable, moderate efficiency)
{"temp":23.5,"hum":65,"time":1640995200}
// Compact JSON (remove spaces, shorter keys)
{"t":23.5,"h":65,"ts":1640995200}
// Binary format (highest efficiency)
// Custom binary protocol for maximum performance
// bytes: temperature (float)
// bytes: humidity (float)
// bytes: timestamp (uint32)
// Total: 12 bytes vs 45+ bytes JSON

10.12. Real-time performance monitoring

10.12.1. Performance metrics collection

Key Performance Indicators:


// Connection establishment time
// Measure time between AT+UWSC and +UEWLU event
// Data transfer throughput
// Measure bytes/second during AT+USOWS/AT+USORS operations
// Power consumption monitoring
// Use external current meter with different AT+UPMPSL settings
// Certificate usage tracking
AT+USECL?        // Check certificate storage regularly

10.13. Performance benchmarking

Standardized Performance Tests:

Test TypeMeasurementTarget PerformanceCommand Sequence
Connection SpeedTime to connect<10 secondsAT+UWSC=0 timing
TCP ThroughputBytes per second>100 KB/sLarge AT+USOWS transfers
TLS HandshakeHandshake time<5 secondsAT+USOTLS timing
Power EfficiencymA consumption<50mA averageCurrent measurement

Performance Test Sequence:


// Baseline connection test
AT+UWSC=0        // Time this command
// Target: <10 seconds to +UEWLU
// Throughput test
AT+USOCR=6       // Create TCP socket
AT+USOC=0,server,port              // Connect
AT+USOWS=0,"data"        // Write data (up to 1000 bytes per command)
// Measure: bytes/second throughput
// Power consumption test
AT+UPMPSL=1      // Enable power save
// Measure current draw over time
// Certificate storage test
AT+USECL?        // Check certificates before/after operations

10.14. Performance troubleshooting

10.14.1. Common performance issues

Performance IssueProbable CauseSolutionVerification
Slow connectionWeak signal, channel congestionReposition, change channelAT+UWSST=4
Low throughputPower save mode, small buffersDisable power save, larger buffersAT+UPMPSL=0
High latencyNetwork congestion, DNS delaysUse IP instead of hostnamesAT+USOC=0,"192.168.1.100",80
Memory errorsCertificate/file accumulationClean up unused certificatesAT+USECL?

10.14.2. Performance optimization checklist

Regular Performance Maintenance:

TaskFrequencyCommandTarget
Signal checkWeeklyAT+UWSST=4RSSI >-70 dBm
Certificate cleanupMonthlyAT+USECL?Remove expired certificates
Power mode verification--Confirm appropriate power save settings
Throughput validation--Test data transfer speeds match requirements
Certificate monitoringRegularAT+USECL?Check certificate status
Connection timing--Verify connection establishment <10 seconds
Error rate monitoringRegularAT+USYEC?Check for increased error rates

Optimal Configuration Summary:


// High-performance configuration
AT+UPMPSL=0      // Disable power save during operation
AT+USOTLS=0,2            // Use TLS 1.3 for fastest secure connections
AT+USORS=0,1000          // Optimize for 1000-byte MTU limit
AT+USYEE=1       // Enable extended error reporting
// Power-efficient configuration
AT+UPMPSL=1      // Light power save
AT+UPMPSTO=10000         // 10-second timeout
AT+USORS=0,512           // Smaller read operations for efficiency
AT&W             // Save configuration
AT+CPWROFF       // Reset to apply stored settings safely

This comprehensive performance framework ensures NORA-W36 implementations achieve optimal speed, efficiency, and reliability across all operating conditions.

11. Wi-Fi Sockets use cases

11.1. Wi-Fi TCP client

This use case configures NORA-W36 as a Wi-Fi TCP client device that initiates a TCP connection to a specified server (listener) over a Wi-Fi network. It actively seeks to establish communication by sending a connection request to the server's IP address and port number, which the server is listening on.

The Transmission Control Protocol (TCP) is bidirectional and one socket can both send and receive data:

  • ATE0 turns off the AT command echo to speed up the data transmission in AT mode. The written data is not echoed back to the host, which helps to make the parsing easier.
  • It is possible to connect using a host name like AT+USOC=0,"www.u-blox.com",80 or an IP address AT+USOC=0,"75.2.60.5",80
  • TCP can both send and receive data between the TCP client and server
NrInstructionsAT commandAT event
1Create a TCP socketAT+USOCR=6+USOCR:0
2Connect using TCP port 5003AT+USOC=0,"192.168.0.200",5003+UESOC:0
3It is now possible to send and receive data using String or Binary mode  
4Close TCP socketAT+USOCL=0+UESOCL:0

11.2. Wi-Fi TCP server (listener)

This use case configures NORA-W36 as a Wi-Fi TCP server (listener) that is configured to accept incoming TCP connections over a Wi-Fi network. It "listens" on a specific IP address and port number for connection requests.

NrInstructionsAT commandAT event
1Create a TCP socketAT+USOCR=6+USOCR:0
2Start TCP server (listener) on port 5003AT+USOL=0,5003+UESOC:0
3Incoming TCP connection, a new handle 1 to communicate with the connection +UESOIC:0,192.168.1.100,1
4It is now possible to send and receive data using String or Binary mode  
5TCP connection is closed from remote side +UESOCL:1
6Close TCP listenerAT+USOCL=0+UESOCL:0

11.3. Wi-Fi UDP client

Unlike TCP, the User Datagram Protocol (UDP) is not bi-directional. Both an outgoing and incoming socket, AT+USOCR, are needed to send and receive data over UDP.

It is possible to connect using the host name, like AT+USOC=0,"www.u-blox.com",80, or the IP address AT+USOC=0,"75.2.60.5",80

NrInstructionsAT commandAT event
1Create a UDP socketAT+USOCR=17+USOCR:0
2Connect using UDP port 5003AT+USOC=0,"192.168.0.200",5003+UESOC:0
3It is now possible to send data using String or Binary mode  
4Close UDP socketAT+USOCL=0+UESOCL:0

11.4. Wi-Fi UDP server (listener)

NrInstructionsAT commandAT event
1Create a UDP socketAT+USOCR=17+USOCR:0
2Start UDP server (listener) on port 5003AT+USOL=0,5003+UESOC:0
3It is now possible to receive data using String or Binary mode  
4Close UDP listenerAT+USOCL=0+UESOCL:0

11.5. Wi-Fi TCP using TLS without certificates

TLS Extensions are enabled by default but in some (mostly older) TLS servers they are not supported. See https://www.rfc-editor.org/rfc/rfc6066.html.

The extensions, Server Name, Indication and Maximum Fragment Length Negotiation, are disabled with:

  • AT+USETE0=0 Server Name Indication, 0: Disable - 1: Enable (default)
  • AT+USETE1=0 Maximum Fragment Length Negotiation, 0: Disable - 1: Enable (default)
  • All other Extension are disabled and not supported.
  • It is possible to use host name like AT+USOC=0,"www.u-blox.com",80 or using ip address AT+USOC=0,"75.2.60.5",80 for the connections.

TCP is bidirectional and one socket can both send and receive data.

NrInstructionsAT commandAT event
1Create a TCP socketAT+USOCR=6+USOCR:0
2Add a TLS 1.3 context to a socketAT+USOTLS=0,2 
3Connect using TCP port 433AT+USOC=0,"www.u-blox.com",433+UESOC:0
4It is now possible to send data using String or Binary mode  
5Close TCP socketAT+USOCL=0+UESOCL:0

11.6. Wi-Fi TCP using TLS with certificates

TCP is bidirectional and one socket can both send and receive data.

NrInstructionsAT commandAT event
1Write X.509 certificate and private key using Binary dataAT+USECUB=0,"ca.pem"{binary_content} + AT+USECUB=1,"client.pem"{binary_content} + AT+USECUB=2,"client.key"{binary_content} Note: Brackets { } should NOT be sentOK
2Create a TCP socketAT+USOCR=6+USOCR:0
3Add a TLS 1.3 context to a socket and certificatesAT+USOTLS=0,2,"ca.pem","client.pem","client.key" 
4Connect using TCP on port 433AT+USOC=0,"www.u-blox.com",433+UESOC:0
5It is now possible to send data using String or Binary mode  
6Close TCP socketAT+USOCL=0+UESOCL:0

11.7. Create own certificates using OpenSSL

This section provides examples for creating your own certificates using OpenSSL (https://www.openssl.org/).

The examples demonstrate how to use 2048-bit or 4096-bit key lengths for different security requirements.

Prerequisites:

11.7.1. Certificate authority (CA) creation

Step 1: Create the root CA private key

Generate 2048-bit key size (faster, suitable for most applications):


openssl genrsa -out ca.key 2048

Or generate 4096-bit key size (higher security, recommended for production):


openssl genrsa -out ca.key 4096

Step 2: Create the root CA certificate (valid for 1 year)


openssl req -x509 -sha256 -new -nodes -key ca.key -days 365 -out ca.pem

11.7.2. Server certificate creation

Step 3: Create server certificate signing request (CSR)

For 2048-bit key:


openssl req -newkey rsa:2048 -keyout server.key -out server.csr -nodes

Or for 4096-bit key:


openssl req -newkey rsa:4096 -keyout server.key -out server.csr -nodes

Step 4: Sign server certificate with CA (valid for 1 year)


openssl x509 -req -CA ca.pem -CAkey ca.key -in server.csr -out server.pem -days 365 -CAcreateserial

11.7.3. Client certificate creation

Step 5: Create client certificate signing request (CSR)

For 2048-bit key:


openssl req -newkey rsa:2048 -keyout client.key -out client.csr -nodes

Or for 4096-bit key:


openssl req -newkey rsa:4096 -keyout client.key -out client.csr -nodes

Step 6: Sign client certificate with CA (valid for 1 years)


openssl x509 -req -CA ca.pem -CAkey ca.key -in client.csr -out client.pem -days 365 -CAcreateserial

11.7.4. Testing certificates

Windows Git Bash Environment:

Note: winpty is required for interactive OpenSSL commands in Git Bash on Windows.

TLS 1.2 Testing:

Set up a local TLS 1.2 server:


winpty openssl s_server -CAfile ca.pem -key server.key -cert server.pem -accept 44330 -tls1_2 -state -Verify 1

Connect to the local TLS 1.2 server:


winpty openssl s_client -connect localhost:44330 -CAfile ca.pem -key client.key -cert client.pem -tls1_2

TLS 1.3 Testing:

Set up a local TLS 1.3 server:


winpty openssl s_server -CAfile ca.pem -key server.key -cert server.pem -accept 44331 -tls1_3 -state -Verify 1

Connect to the local TLS 1.3 server:


winpty openssl s_client -connect localhost:44331 -CAfile ca.pem -key client.key -cert client.pem -tls1_3

Linux Environment:

TLS 1.2 Testing:

Set up a local TLS 1.2 server:


openssl s_server -CAfile ca.pem -key server.key -cert server.pem -accept 44330 -tls1_2 -state -Verify 1

Connect to the local TLS 1.2 server:


openssl s_client -connect localhost:44330 -CAfile ca.pem -key client.key -cert client.pem -tls1_2

TLS 1.3 Testing:

Set up a local TLS 1.3 server:


openssl s_server -CAfile ca.pem -key server.key -cert server.pem -accept 44331 -tls1_3 -state -Verify 1

Connect to the local TLS 1.3 server:


openssl s_client -connect localhost:44331 -CAfile ca.pem -key client.key -cert client.pem -tls1_3

Testing Both TLS Versions (Flexible):

For testing compatibility with both TLS 1.2 and 1.3:


// Server that accepts both TLS 1.2 and 1.3 (Windows)
winpty openssl s_server -CAfile ca.pem -key server.key -cert server.pem -accept 44332 -state -Verify 1
// Server that accepts both TLS 1.2 and 1.3 (Linux)
openssl s_server -CAfile ca.pem -key server.key -cert server.pem -accept 44332 -state -Verify 1
// Client connecting with version negotiation (will use highest available)
winpty openssl s_client -connect localhost:44332 -CAfile ca.pem -key client.key -cert client.pem    // Windows
openssl s_client -connect localhost:44332 -CAfile ca.pem -key client.key -cert client.pem    // Linux

11.7.5. Certificate verification

Verify CA certificate key size:


openssl x509 -in ca.pem -text -noout | grep "Public-Key"

Expected output: RSA Public-Key: (4096 bit) or RSA Public-Key: (2048 bit)

Verify client certificate key size:


openssl x509 -in client.pem -text -noout | grep "Public-Key"

Expected output: RSA Public-Key: (4096 bit) or RSA Public-Key: (2048 bit)

Verify client private key size:


openssl rsa -in client.key -text -noout | grep "Private-Key"

Expected output: RSA Private-Key: (4096 bit, 2 primes) or RSA Private-Key: (2048 bit, 2 primes)

11.7.6. Security recommendations

Key Size Selection:

  • 2048-bit: Minimum recommended, faster processing, suitable for most IoT applications
  • 4096-bit: Higher security, recommended for production environments with sensitive data

Certificate Validity:

  • Production certificates should have shorter validity periods (1-2 years)
  • Test certificates can use longer periods for convenience

File Security:

  • Protect private key files (*.key) with appropriate file permissions
  • Store CA private key securely and offline in production environments
  • Consider using hardware security modules (HSM) for critical applications

11.7.7. Certificate management commands

NORA-W36 provides comprehensive certificate management capabilities for secure storage and administration of X.509 certificates and private keys.

Certificate Storage Capacity:

  • Maximum 8 certificates (or certificate chains) can be stored simultaneously
  • Maximum certificate size: 15,360 bytes per certificate
  • Support for PEM format certificates (DER format not supported)

Certificate Management Commands:

CommandPurposeExample
AT+USECL?List all stored certificatesShows all certificate names and types
AT+USECD=<name>Show certificate detailsAT+USECD="client.pem"
AT+USECR=<type>,<name>Remove specific certificateAT+USECR=1,"client.pem"
AT+USECRRemove all certificatesClears certificate storage

Certificate Types:

  • 0: Root/CA certificate
  • 1: Client certificate
  • 2: Client private key

Certificate Operations Examples:


// List all stored certificates
AT+USECL?
+USECL:0,"ca-root"
+USECL:1,"device-cert"
+USECL:2,"device-key"
// View certificate details (fingerprint, size, validity dates)
AT+USECD="device-cert"
+USECD:0,A1B2C3D4E5F6...           // Certificate fingerprint (hex)
+USECD:1,2048            // Certificate size in bytes (decimal)
+USECD:2,5F5E1000        // Not valid before: Unix epoch in hex (Jan 1, 2023)
+USECD:3,6586A400        // Not valid after: Unix epoch in hex (Dec 31, 2025)
// Remove specific certificate
AT+USECR=1,"old-client-cert"
// Remove all certificates (factory reset certificates)
AT+USECR

Understanding Certificate Fingerprint:

The fingerprint (+USECD:0) is a SHA-256 hash of the certificate, useful for verification and identification.

Calculate and Verify Fingerprint with OpenSSL:


# Calculate SHA-256 fingerprint using OpenSSL
openssl x509 -noout -fingerprint -sha256 -in ca.pem

Real Example:


# NORA-W36 output:
AT+USECD="ca.pem"
+USECD:0,025EF9A024DEF7FCBFD6E3717557C016BCB9C34E6BAA288111D53F9490E06CC2
# OpenSSL verification:
$ openssl x509 -noout -fingerprint -sha256 -in ca.pem
sha256 Fingerprint=02:5E:F9:A0:24:DE:F7:FC:BF:D6:E3:71:75:57:C0:16:BC:B9:C3:4E:6B:AA:28:81:11:D5:3F:94:90:E0:6C:C2

Note: NORA-W36 returns fingerprint as continuous hex string, while OpenSSL formats with colons.

Understanding Certificate Date Format:

  • Dates are returned as hexadecimal Unix epoch timestamps
  • Example: 6586A400 (hex) = 1,703,462,400 (decimal) = Dec 25, 2023 00:00:00 UTC
  • Conversion: Use online epoch converters or: date -d @$((0x6586A400)) (Linux/macOS)
  • PowerShell: [DateTimeOffset]::FromUnixTimeSeconds(0x6586A400).DateTime

Security Best Practices:

  1. Regular Certificate Audits: Use AT+USECL? to monitor stored certificates
  2. Certificate Rotation: Remove expired certificates with AT+USECR
  3. Storage Optimization: Remove unused certificates to free storage space
  4. Validity Monitoring: Check certificate expiration dates with AT+USECD
  5. Backup Strategy: Keep secure backups of certificates before removal operations

Certificate Date Format Reference:

When using AT+USECD to check certificate validity dates, the NORA-W36 returns timestamps in hexadecimal Unix epoch format:


AT+USECD="my-certificate"
+USECD:2,61F2D000        // Not valid before: Jan 27, 2022 12:00:00 UTC
+USECD:3,6586A400        // Not valid after:  Dec 25, 2023 00:00:00 UTC

Converting Hex Epoch Timestamps:

MethodCommand/CodeExample
Linux/macOSdate -d @$((0xHEXVALUE))date -d @$((0x6586A400))
PowerShell[DateTimeOffset]::FromUnixTimeSeconds(0xHEXVALUE)[DateTimeOffset]::FromUnixTimeSeconds(0x6586A400)
Pythondatetime.fromtimestamp(int('HEXVALUE', 16))datetime.fromtimestamp(int('6586A400', 16))
Online ToolsUse epoch timestamp convertersConvert 1703462400 to human date

Common Epoch Hex Values:

  • 0x61F2D000 = 1,643,289,600 = Jan 27, 2022 12:00:00 UTC
  • 0x6586A400 = 1,703,462,400 = Dec 25, 2023 00:00:00 UTC
  • 0x677B8000 = 1,736,207,360 = Jan 7, 2025 00:16:00 UTC

Password-Protected Private Keys:

NORA-W36 supports AES-encrypted PKCS8 private keys with password protection:


// Upload encrypted private key with password
AT+USECUB=2,"secure-key","mypassword123"{binary_data}

11.8. TLS version configuration

NORA-W36 v3.1.0 introduces comprehensive TLS 1.3 support across all protocols including EAP-TLS, TCP sockets, HTTP clients, and MQTT. This enhanced security capability provides improved encryption algorithms, forward secrecy, and reduced handshake latency.

TLS Version Parameters:

All TLS-enabled AT commands support the following version parameters:

  • 0: Disable TLS (not recommended for secure connections)
  • 1: TLS 1.2 only (legacy compatibility)
  • 2: TLS 1.3 only (recommended for new implementations)
  • 3: TLS 1.2 or 1.3 (negotiate highest available - flexible option)

Protocol-Specific TLS Support:

ProtocolAT CommandExample (TLS 1.3)Security Benefits
EAP-TLSAT+UWSSEAT+UWSSE=0,2,"ca.pem","client.pem","client.key"Enterprise Wi-Fi with latest security
PEAPAT+UWSSPAT+UWSSP=0,2,"username","password"Protected authentication tunnel
TCP SocketAT+USOTLSAT+USOTLS=0,2,"ca.pem","client.pem","client.key"Secure socket connections
MQTTAT+UMQTLSAT+UMQTLS=0,2,"ca.pem","client.pem","client.key"IoT messaging security
HTTPAT+UHTCTLSAT+UHTCTLS=0,2,"ca.pem","client.pem","client.key"Web API secure access

TLS 1.3 Security Enhancements:

  • Forward Secrecy: Each session uses unique encryption keys
  • Reduced Handshake: Faster connection establishment (1-RTT vs 2-RTT)
  • Improved Cipher Suites: Only secure AEAD algorithms supported
  • Certificate Privacy: Server certificate encrypted during handshake
  • Anti-Downgrade Protection: Prevents fallback to weaker TLS versions

Migration Recommendations:

  1. New Projects: Use TLS 1.3 (parameter 2) for maximum security
  2. Legacy Compatibility: Use flexible mode (parameter 3) during transition
  3. Testing: Verify server/broker TLS 1.3 support before deployment
  4. Performance: Monitor connection times - TLS 1.3 typically reduces latency

11.9. TLS extensions configuration

NORA-W36 supports advanced TLS extensions that enhance security and compatibility with modern TLS implementations.

Available TLS Extensions:

ExtensionAT CommandPurposeDefault State
Server Name Indication (SNI)AT+USETE0Identifies target server hostnameEnabled
Handshake FragmentationAT+USETE1Fragments large handshake messagesEnabled

Server Name Indication (SNI):

  • Enables TLS client to specify hostname during handshake
  • Essential for servers hosting multiple domains on same IP
  • Required for proper certificate validation in many deployments

// Enable SNI (recommended for most applications)
AT+USETE0=1
// Disable SNI (only for legacy servers)
AT+USETE0=0
// Check current SNI setting
AT+USETE0?

Handshake Fragmentation:

  • Splits large TLS handshake messages into smaller fragments
  • Prevents issues with MTU limitations and network constraints
  • Improves reliability in constrained network environments

// Enable handshake fragmentation (recommended)
AT+USETE1=1
// Disable handshake fragmentation
AT+USETE1=0
// Check current fragmentation setting
AT+USETE1?

Configuration Best Practices:

  1. Keep SNI Enabled: Required for most modern TLS servers
  2. Enable Fragmentation: Prevents handshake failures in constrained networks
  3. Store Settings: Use AT&W followed by AT+CPWROFF to persist extension settings across reboots
  4. Test Configuration: Verify TLS handshake success with target servers

12. MQTT use cases

📡 MQTT Communication Overview:


    ┌─────────────     ┌─────────────     ┌─────────────
    │📱 Publisher │────▶│ MQTT      │◄────│📱 Subscriber│
    │  (NORA-W36) │     │   Broker    │     │  (Device)   │
    │             │     │             │     │             │
    │ Sends data  │     │ Routes      │     │ Receives    │
    │ to topics   │     │ messages    │     │ from topics │
    └─────────────┘     └─────────────┘     └─────────────┘
           │                     │                     │
      Publish Msgs          Topic Routing         Subscribe
    🔧 Features:             Broker:             📊 Benefits:
- • Low bandwidth        • Topic management     • Decoupled comm.
- • Reliable delivery    • Message routing      • Scalable design
- • QoS levels (0,1,2)   • Client sessions      • IoT optimized
  • The MQTT client in NORA-W36 uses version MQTT v3.1.1
  • For more about the Message Queuing Telemetry Transport (MQTT), see the MQTT beginner's guide
  • TLS 1.3 Security: NORA-W36 v3.1.0 supports TLS 1.2 and TLS 1.3 for secure MQTT communications with enhanced encryption algorithms, forward secrecy, and reduced handshake latency

12.1. MQTT overview

MQTT (Message Queuing Telemetry Transport) is a lightweight, publish-subscribe messaging protocol designed for IoT applications with constrained networks and devices. It enables efficient communication between devices and cloud services with minimal bandwidth and power consumption.

Key MQTT characteristics:

  • Publish-Subscribe Model: Decoupled communication through topics
  • Lightweight Protocol: Minimal overhead for constrained devices
  • Reliable Delivery: Multiple Quality of Service levels
  • Persistent Sessions: Maintain connection state across disconnections
  • Last Will Testament: Automatic notification of unexpected disconnections

NORA-W36 MQTT Implementation:

  • Uses MQTT v3.1.1 protocol (MQTT v5.0 is not supported)
  • TLS 1.2 support for secure connections
  • Optimized for IoT device constraints

12.2. MQTT key concepts

12.2.1. Quality of service (qos) levels

MQTT provides three QoS levels to guarantee message delivery:

QoS 0 - At Most Once

  • Fire-and-forget delivery
  • No acknowledgment required
  • Fastest but least reliable
  • Use case: Sensor readings where occasional data loss is acceptable

AT+UMQPS=0,0,0,"temperature","25.5"          // QoS 0 publish

QoS 1 - At Least Once

  • Guaranteed delivery with possible duplicates
  • Requires PUBACK acknowledgment
  • Balanced reliability and performance
  • Use case: Important notifications that must be delivered

AT+UMQPS=0,1,0,"alert","Low battery warning"    // QoS 1 publish

QoS 2 - Exactly Once

  • Guaranteed single delivery
  • Requires PUBREC/PUBREL/PUBCOMP handshake
  • Highest reliability but slowest
  • Use case: Critical commands or financial transactions

AT+UMQPS=0,2,0,"command","device_reset"      // QoS 2 publish

12.2.2. Retained messages

Retained messages are stored by the broker and delivered to new subscribers immediately upon subscription:

Publishing a retained message:


AT+UMQPS=0,0,1,"device/status","online"      // Retain flag = 1

Use cases for retained messages:

  • Device status (online/offline)
  • Last known sensor values
  • Configuration settings
  • System announcements

12.2.3. Last will and testament (LWT)

LWT allows devices to specify a message that the broker publishes automatically if the device disconnects unexpectedly:

Configuration example:


// Configure LWT during connection setup
AT+UMQCP=0,"broker.example.com",1883,"device123","user","pass"

LWT use cases:

  • Device health monitoring
  • Automatic offline notifications
  • System fault detection
  • Connection status tracking

12.2.4. Connection management

Clean Session Flag:

  • Clean Session = 1: Fresh start, no stored state
  • Clean Session = 0: Resume previous session with stored subscriptions

Keep-Alive Timer:

  • Maintains connection during idle periods
  • Broker disconnects if no communication within keep-alive interval
  • Recommended: 30-300 seconds depending on application

12.3. Error handling and troubleshooting

Common MQTT Error Scenarios:

IssueSymptomsSolution
Connection timeoutAT+UMQC=0 returns ERRORCheck network connectivity and broker address
Authentication failureConnection rejectedVerify username/password credentials
Certificate errorsTLS connection failsValidate CA certificate and client certificates
Keep-alive timeoutUnexpected disconnectionAdjust keep-alive timer or check network stability
Invalid client IDConnection refusedUse unique, valid client identifier

MQTT Connection Status:

  • Successful connection: +UEMQC:0
  • Message received: +UEMQD:<handle>,<length>
  • Connection lost: Monitor connection events

Troubleshooting Steps:

StepCommandPurpose
1AT+UWSNST?Check connection status
2AT+UWSNST=0Verify Wi-Fi connectivity
3AT+UWSST=0Check network interface status
4AT+UWSSCCheck AP status
5-Check MQTT connection status
6-Validate certificates for TLS connections
7-Monitor keep-alive and adjust if needed
8-Review broker logs for additional error details

12.4. Performance optimization

Connection Parameters:

ParameterOptimal RangeImpact
Keep-Alive30-300 secondsNetwork efficiency vs responsiveness
Clean SessionContext-dependentMemory usage vs session persistence
QoS Level0-1 for most casesReliability vs performance
Message Size< 1KB preferredNetwork bandwidth and processing

Best Practices:

  • Use QoS 0 for frequent sensor data
  • Use QoS 1 for important events
  • Keep topic names short and hierarchical
  • Implement exponential backoff for reconnections
  • Monitor connection stability with keep-alive
  • Use retained messages sparingly

Network Considerations:

  • Choose appropriate keep-alive based on network reliability
  • Consider cellular vs Wi-Fi network characteristics
  • Implement proper error handling and retry logic
  • Monitor battery usage for power-constrained applications

12.5. MQTT client without TLS - Mosquitto

mqtt

This use case connects NORA-W36 as a Wi-Fi Station and a MQTT Broker on port 1883. In this scenario, the module connects to Mosquitto without a certificate.

Parameters and values

  • Host: test.mosquitto.org
  • Port: 1883 (no TLS connection)
  • Client ID: -
  • Username: -
  • Password: -
  • CA Root certificate: -
  • Client certificate: -
  • Client private key: -

Before connecting to MQTT, set up Wi-Fi Connection, as described in Wi-Fi station, steps 1-5.

NrInstructionsAT commandAT event
1Check MQTT connection parametersAT+UMQCP=0+UMQCP:0,<hostname>,<port>,<client_id>,<username>
2Configure MQTT host and portAT+UMQCP=0,"test.mosquitto.org",1883OK
3Connect to MQTT brokerAT+UMQC=0+UEMQC:0
4Publish Message on topic pubtopicAT+UMQPS=0,0,0,"pubtopic","Hello from NORA-W36"OK
5Subscribe on topic subtopicAT+UMQS=0,0,"subtopic"OK
6Post a Message to the MQTT Broker on subtopic the message should be Hello from remote device--
7Receive Message on subtopic +UEMQD:0,24
8Read String MessageAT+UMQRS=0+UMQRS:0,0,"subtopic",24,"Hello from remote device"
9Disconnect from MQTT brokerAT+UMQDC=0OK

Note: Use the wildcard "*" to receive messages for all topics. Note that this option may not be supported by all brokers, like Azure.

12.6. MQTT TLS client - Mosquitto

mqtt

mqtt

This use case connects NORA-W36 as a Wi-Fi Station and a MQTT Broker. In this scenario, the module connects to Mosquitto using certificates.

To generate client certificate and client key, follow the procedures described on the Mosquitto web page: https://test.mosquitto.org/ssl/

Parameters and values

  • Host: test.mosquitto.org
  • Port: 8884 (TLS)
  • Client ID: -
  • Username: -
  • Password: -
  • CA Root certificate: mosquitto.org.crt
  • Client certificate: client.crt
  • Client private key: client.key

Note: The parameters given in this scenario use the port 8884 for connections and encryption for security.

To authenticate the client and ensure the following:

  • Only authorized devices can establish a connection with the MQTT broker
  • Clients provide a valid certificate when making a connection
  • 1883 : MQTT, unencrypted, unauthenticated
  • 1884 : MQTT, unencrypted, authenticated
  • 8883 : MQTT, encrypted, unauthenticated
  • 8884 : MQTT, encrypted, client certificate required (used in this example)
  • 8885 : MQTT, encrypted, authenticated
  • 8886 : MQTT, encrypted, unauthenticated

Before connecting to MQTT, set up a Wi-Fi Connection like that described in Wi-Fi station, steps 1-5.

NrInstructionsAT commandAT event
1Configure MQTT host and portAT+UMQCP=0,"test.mosquitto.org",8884OK
2Write X.509 certificate and private key using Binary dataAT+USECUB=0,"mosquitto.org.crt"{binary_content} + AT+USECUB=1,"client.crt"{binary_content} + AT+USECUB=2,"client.key"{binary_content} Note: Brackets { } should NOT be sentOK
3Setup TLS 1.3 connection configAT+UMQTLS=0,2,"mosquitto.org.crt","client.crt","client.key"OK
4Connect to MQTT brokerAT+UMQC=0+UEMQC:0
5Publish Message on topic pubtopicAT+UMQPS=0,0,0,"pubtopic","Hello from NORA-W36"OK
6Subscribe on topic subtopicAT+UMQS=0,0,"subtopic"OK
7Post a Message to the MQTT Broker on subtopic. The message should say Hello from remote device--
8Receive Message on subtopic +UEMQD:0,24
9Read String MessageAT+UMQRS=0+UMQRS:0,0,"subtopic",24,"Hello from remote device"
10Disconnect from MQTT brokerAT+UMQDC=0OK

12.7. MQTT TLS client - thingstream

mqtt

mqtt

Thingstream is the u-blox service delivery platform for:

  • IoT Communication-as-a-Service
  • IoT Location-as-a-Service

This use case connects NORA-W36 as a Wi-Fi Station and a MQTT Broker. In this scenario NORA-W36 connects to Thingstream using a CA Root certificate, Client-ID, Username and Password.

Thingstream uses the AWS Root Certificate found here: https://www.amazontrust.com/repository/AmazonRootCA1.pem

Before connecting to MQTT, set up Wi-Fi Connection, like that described Wi-Fi station, steps 1-5.

The parameters and values necessary for the use case include:

Parameters and values

  • Host: mqtt.thingstream.io
  • Port: 8883 (TLS)
  • Client ID: device:78e3d356-876f-483b-872f-3485853fAAAA
  • Username: HMVK8C09FQP245O2BBBB
  • Password: ofYyBB/L3GkPvo060J6Dv+t+mfrh0XpGMcf7CCCC
  • CA Root certificate: AmazonRootCA1.pem
  • Client certificate: -
  • Client private key: -

Before connecting to MQTT, set up Wi-Fi Connection like in steps 1-5 in Wi-Fi station

NrInstructionsAT commandAT event
1Configure the MQTT host, port, client-ID, username and passwordAT+UMQCP=0,"mqtt.thingstream.io",8883,"device:78e3d356-876f-483b-872f-3485853fAAAA","HMVK8C09FQP245O2BBBB","ofYyBB/L3GkPvo060J6Dv+t+mfrh0XpGMcf7CCCC"OK
2Write X.509 CA Root certificate using Binary dataAT+USECUB=0,"AmazonRootCA1.pem"{binary_content} Note: Brackets { } should NOT be sentOK
3Set up TLS connection config. Thingstream doesn´t use a client certificate or key - only the root CA.AT+UMQTLS=0,1,"AmazonRootCA1.pem"OK
4Connect to MQTT brokerAT+UMQC=0+UEMQC:0
5Publish a message on pubtopicAT+UMQPS=0,0,0,"pubtopic","Hello from NORA-W36"OK
6Subscribe on topic subtopicAT+UMQS=0,0,"subtopic"OK
7Post a message to the MQTT broker on subtopic. The message should say Hello from remote device--
8Receive a message on subtopic +UEMQD:0,24
9Read String MessageAT+UMQRS=0+UMQRS:0,0,"subtopic",24,"Hello from remote device"
10Disconnect from MQTT brokerAT+UMQDC=0OK

12.8. MQTT TLS client - AWS IoT core

mqtt

Connect as a Wi-Fi Station and a MQTT Broker. In this scenario, NORA-W36 connects to Amazon AWS IoT Core using certificates.

Parameters and values

  • Host: a3loryode2aaaa-ats.iot.us-east-2.amazonaws.com
  • Port: 8883 (TLS)
  • Client ID: -
  • Username: -
  • Password: -
  • CA Root certificate: AmazonRootCA1.pem
  • Client certificate: aws_client.crt
  • Client private key: aws_priv_key.key

Before connecting to MQTT, set up Wi-Fi Connection like in steps 1-5 in Wi-Fi station

NrInstructionsAT commandAT event
1Configure MQTT host and portAT+UMQCP=0,"a3loryode2aaaa-ats.iot.us-east-2.amazonaws.com",8883OK
2Write X.509 certificate and private key using Binary dataAT+USECUB=0,"AmazonRootCA1.pem"{binary_content} + AT+USECUB=1,"aws_client.crt"{binary_content} + AT+USECUB=2,"aws_priv_key.key"{binary_content} Note: Brackets { } should NOT be sentOK
3Setup TLS connection configAT+UMQTLS=0,1,"AmazonRootCA1.pem","aws_client.crt","aws_priv_key.key"OK
4Connect to MQTT brokerAT+UMQC=0+UEMQC:0
5Publish Message on topic pubtopicAT+UMQPS=0,0,0,"pubtopic","Hello from NORA-W36"OK
6Subscribe on topic subtopicAT+UMQS=0,0,"subtopic"OK
7Post a Message to the MQTT Broker on subtopic the message should be Hello from remote device--
8Receive Message on subtopic +UEMQD:0,24
9Read String MessageAT+UMQRS=0+UMQRS:0,0,"subtopic",24,"Hello from remote device"
10Disconnect from MQTT brokerAT+UMQDC=0OK

12.9. MQTT TLS client - Azure IoT hub

Connect as a Wi-Fi Station and an Access Point and a MQTT Broker. In this scenario, NORA-W36 connects to Microsoft Azure using certificates.

mqtt

Important Note: Azure IoT Hub isn't a full-featured MQTT broker and doesn't support all the behaviors specified in the MQTT v3.1.1 standard.

Parameters and values

  • Host: iothub-test-sw.azure-devices
  • Port: 8883 (TLS)
  • Client ID: device1
  • Username: iothub-test-sw.azure-devices.net/device1/
  • Password: -
  • CA Root certificate: AzureCa.pem
  • Client certificate: azure_client.crt
  • Client private key: azure_priv_key.key

Before connecting to MQTT, set up Wi-Fi Connection like in steps 1-5 in Wi-Fi station

NrInstructionsAT commandAT event
1Configure MQTT Host, Port, Client ID and UsernameAT+UMQCP=0,"iothub-test-sw.azure-devices.net",8883,"device1","iothub-test-sw.azure-devices.net/device1/"OK
2Write X.509 certificate and private key using Binary dataAT+USECUB=0,"AzureCa.pem"{binary_content} + AT+USECUB=1,"azure_client.crt"{binary_content} + AT+USECUB=2,"azure_priv_key.key"{binary_content} Note: Brackets { } should NOT be sentOK
3Setup TLS connection configAT+UMQTLS=0,1,"AzureCa.pem","azure_client.crt","azure_priv_key.key"OK
4Connect to MQTT brokerAT+UMQC=0+UEMQC:0
5Publish Message on topic pubtopicAT+UMQPS=0,0,0,"pubtopic","Hello from NORA-W36"OK
6Subscribe on topic subtopicAT+UMQS=0,0,"subtopic"OK
7Post a Message to the MQTT Broker on subtopic the message should be Hello from remote device--
8Receive Message on subtopic +UEMQD:0,24
9Read String MessageAT+UMQRS=0+UMQRS:0,0,"subtopic",24,"Hello from remote device"
10Disconnect from MQTT brokerAT+UMQDC=0OK

13. HTTP and HTTPS use cases

NORA-W36 includes a comprehensive HTTP client supporting HTTP/1.1 protocol with features including GET, POST, PUT, DELETE operations. When combined with TLS, it provides secure HTTPS communication. The HTTP client simplifies web communication without requiring deep protocol knowledge.

Important Note: HTTP requests have a Maximum Transmission Unit (MTU) of 1000 bytes. This applies to both request data and response data. For larger data transfers, consider splitting the data into multiple requests or using chunked transfer encoding.

13.1. HTTP client features

  • HTTP Methods: GET, POST, PUT, DELETE, HEAD
  • TLS/SSL Support: HTTPS with server certificate validation
  • Authentication: Basic authentication, custom headers
  • Content Types: JSON, XML, binary data, form data
  • Connection Management: Keep-alive and connection reuse
  • Error Handling: HTTP status codes and error reporting

13.2. Available HTTP commands

CommandDescription
AT+UHTCCPHTTP Client Connection Parameters
AT+UHTCTLSHTTP Client TLS Configuration
AT+UHTCDCHTTP Client Disconnect
AT+UHTCGHHTTP Client Get Header
AT+UHTCGBBHTTP Client Get Body Binary
AT+UHTCGBSHTTP Client Get Body String
AT+UHTCRHAFHTTP Client Request Header Add Field
AT+UHTCRHCSHTTP Client Request Header Custom String
AT+UHTCRHCHTTP Client Request Header Clear
AT+UHTCRPHTTP Client Request Path
AT+UHTCRGHTTP Client Request GET
AT+UHTCRGHHTTP Client Request GET Header
AT+UHTCRDHTTP Client Request DELETE
AT+UHTCRDHHTTP Client Request DELETE Header
AT+UHTCRPOSHTTP Client Request POST String
AT+UHTCRPOBHTTP Client Request POST Binary
AT+UHTCRPOHHTTP Client Request POST Header
AT+UHTCRPUSHTTP Client Request PUT String
AT+UHTCRPUBHTTP Client Request PUT Binary
AT+UHTCRPUHHTTP Client Request PUT Header

13.3. Simple HTTP get request

This example demonstrates a basic HTTP GET request to retrieve data from a web server.

Target: http://httpbin.org/get (HTTP test service)

Before connecting, ensure Wi-Fi is connected as shown in Wi-Fi station.

NrInstructionsAT CommandAT Response
1Configure HTTP client for target serverAT+UHTCCP=0,"httpbin.org",80OK
2Set request path and methodAT+UHTCRP=0,"GET","/get"OK
3Send GET requestAT+UHTCRG=0OK
4Wait for response +UEHTCRS:0,200,"OK"
5Get response headersAT+UHTCGH=0+UHTCGH:0,1,"HTTP/1.1 200 OK..."
6Get response body (string)AT+UHTCGBS=0,1000+UHTCGBS:0,1000,"{"args":{}..."
7Disconnect clientAT+UHTCDC=0+UEHTCDC:0

13.4. HTTPS get with certificate validation

This example shows secure HTTPS communication with server certificate validation.

Target: https://api.github.com/repos/octocat/Hello-World (GitHub API)

NrInstructionsAT CommandAT Response
1Upload CA certificate for GitHubAT+USECUB=0,"github-ca.pem"{binary certificate data}OK
2Configure HTTPS clientAT+UHTCCP=0,"api.github.com",443OK
3Configure TLS 1.3 with certificate validationAT+UHTCTLS=0,2,"github-ca.pem"OK
4Set request pathAT+UHTCRP=0,"GET","/repos/octocat/Hello-World"OK
5Add User-Agent headerAT+UHTCRHAF=0,"User-Agent","NORA-W36/1.0"OK
6Send HTTPS GET requestAT+UHTCRG=0OK
7Wait for response +UEHTCRS:0,200,"OK"
8Get JSON response bodyAT+UHTCGBS=0,2000+UHTCGBS:0,2000,"{"id":123456..."
9Disconnect clientAT+UHTCDC=0+UEHTCDC:0

13.5. HTTP post with JSON data

This example demonstrates sending JSON data via HTTP POST request.

Target: https://httpbin.org/post (HTTP test service)

Payload: {"temperature": 25.6, "humidity": 60.2, "device": "NORA-W36"}

NrInstructionsAT CommandAT Response
1Configure HTTPS clientAT+UHTCCP=0,"httpbin.org",443OK
2Set POST request pathAT+UHTCRP=0,"POST","/post"OK
3Set Content-Type headerAT+UHTCRHAF=0,"Content-Type","application/json"OK
4Set Content-Length headerAT+UHTCRHAF=0,"Content-Length","62"OK
5Send POST request with JSON bodyAT+UHTCRPOS=0,"{"temperature": 25.6, "humidity": 60.2, "device": "NORA-W36"}"OK
6Wait for response +UEHTCRS:0,200,"OK"
7Get response bodyAT+UHTCGBS=0,1500+UHTCGBS:0,1500,"{"args":{}..."
8Disconnect clientAT+UHTCDC=0+UEHTCDC:0
9Disconnect clientAT+UHTCDC=0+UEHTCDC:0

13.6. HTTP post with binary file upload

This example shows how to upload binary files using HTTP POST with multipart/form-data.

Target: https://httpbin.org/post

File: sensor_data.bin (256 bytes)

NrInstructionsAT CommandAT Response
1Configure HTTPS clientAT+UHTCCP=0,"httpbin.org",443OK
2Set POST request pathAT+UHTCRP=0,"POST","/post"OK
3Set Content-Type for file uploadAT+UHTCRHAF=0,"Content-Type","application/octet-stream"OK
4Send POST request with binary dataAT+UHTCRPOB=0,{256 bytes of binary data}OK
5Wait for upload completion +UEHTCRS:0,200,"OK"
6Get server responseAT+UHTCGBS=0,1000+UHTCGBS:0,1000,"{"files":..."
7Disconnect clientAT+UHTCDC=0+UEHTCDC:0
9Disconnect clientAT+UHTCDC=0+UEHTCDC:0

13.7. HTTP post request for data updates

This example demonstrates updating data on a server using HTTP POST method.

Target: https://httpbin.org/post

Data: Configuration update JSON

NrInstructionsAT CommandAT Response
1Configure HTTPS clientAT+UHTCCP=0,"httpbin.org",443OK
2Set POST request pathAT+UHTCRP=0,"POST","/post"OK
3Add authorization headerAT+UHTCRHAF=0,"Authorization","Bearer xyz123"OK
4Set Content-TypeAT+UHTCRHAF=0,"Content-Type","application/json"OK
5Send POST request with dataAT+UHTCRPOS=0,"{"config":{"interval":30,"enabled":true}}"OK
6Wait for response +UEHTCRS:0,200,"OK"
7Get confirmation responseAT+UHTCGBS=0,800+UHTCGBS:0,800,"{"json":..."
9Disconnect clientAT+UHTCDC=0+UEHTCDC:0

13.8. HTTP delete request

This example shows how to delete resources using HTTP DELETE method.

Target: https://httpbin.org/delete

NrInstructionsAT CommandAT Response
1Configure HTTPS clientAT+UHTCCP=0,"httpbin.org",443OK
2Set DELETE request pathAT+UHTCRP=0,"DELETE","/delete"OK
3Add authentication headerAT+UHTCRHAF=0,"Authorization","ApiKey abc123"OK
4Send DELETE requestAT+UHTCRD=0OK
5Wait for deletion response +UEHTCRS:0,200,"OK"
6Get deletion confirmationAT+UHTCGBS=0,500+UHTCGBS:0,500,"{"url":"..."
7Disconnect clientAT+UHTCDC=0+UEHTCDC:0

13.9. Advanced TLS configuration

This example demonstrates advanced TLS settings including client certificates for mutual authentication.

Target: Secure API with mutual TLS authentication

Certificates: CA certificate, client certificate, and private key

NrInstructionsAT CommandAT Response
1Upload CA certificateAT+USECUB=0,"server-ca.pem"{binary data}OK
2Upload client certificateAT+USECUB=1,"client.crt"{binary data}OK
3Upload client private keyAT+USECUB=2,"client.key"{binary data}OK
4Configure HTTPS clientAT+UHTCCP=0,"secure-api.example.com",443OK
5Configure mutual TLS 1.3AT+UHTCTLS=0,2,"server-ca.pem","client.crt","client.key"OK
6Set request pathAT+UHTCRP=0,"GET","/api/secure-data"OK
7Send authenticated requestAT+UHTCRG=0OK
8Wait for response +UEHTCRS:0,200,"OK"
9Get secure dataAT+UHTCGBS=0,1000+UHTCGBS:0,1000,"{"secure"..."
10Disconnect clientAT+UHTCDC=0+UEHTCDC:0

13.10. HTTP response status codes

The HTTP client returns standard HTTP status codes to indicate request results:

Status CodeMeaningDescription
200OKRequest successful
201CreatedResource created successfully
400Bad RequestInvalid request format
401UnauthorizedAuthentication required
403ForbiddenAccess denied
404Not FoundResource not found
500Server ErrorInternal server error
503Service UnavailableServer temporarily unavailable

13.11. Troubleshooting HTTP requests

13.11.1. Common issues and solutions

IssuePossible CauseSolution
Connection timeoutNetwork unreachableCheck Wi-Fi connection and DNS resolution
Certificate errorInvalid/expired certificateUpdate CA certificate or disable validation
401 UnauthorizedMissing/invalid authenticationCheck API key, username/password, or tokens
413 Payload Too LargeRequest body too largeSplit large requests or use chunked transfer
SSL handshake failedTLS version mismatchUpdate TLS settings or certificate chain

13.11.2. Debugging steps

  1. Check connection status: AT+UWSNST? (connection info)
  2. Verify DNS resolution: Check if domain name resolves correctly
  3. Test without TLS: Try HTTP instead of HTTPS to isolate TLS issues
  4. Check certificate chain: Ensure complete certificate chain is uploaded
  5. Validate headers: Confirm Content-Type, Content-Length, and Authorization headers

13.12. HTTP client best practices

13.12.1. Performance optimization

  • Connection Reuse: Keep HTTP client connected for multiple requests to same server
  • Compression: Use Accept-Encoding: gzip header when supported
  • Chunked Transfer: For large uploads, consider chunked transfer encoding
  • Timeout Settings: Configure appropriate timeout values for your use case

13.12.2. Security recommendations

  • Always use HTTPS for sensitive data transmission
  • Validate server certificates using proper CA certificates
  • Use strong authentication (API keys, OAuth tokens) instead of basic auth
  • Implement rate limiting to avoid overwhelming servers
  • Sanitize response data before processing in your application

13.12.3. Memory management

  • Read response data incrementally using appropriate buffer sizes
  • Disconnect unused clients to free resources: AT+UHTCDC=0
  • Monitor memory usage with large file transfers
  • Use binary mode for non-text data to avoid encoding overhead

13.12.4. Example: complete IoT sensor data upload


// Connect to secure IoT platform
AT+UHTCCP=0,"iot.example.com",443
AT+UHTCTLS=0,1,"iot-ca.pem","device.crt","device.key"
AT+UHTCRP=0,"POST","/api/v1/sensors/data"
AT+UHTCRHAF=0,"Content-Type","application/json"
AT+UHTCRHAF=0,"Authorization","Bearer eyJhbGciOiJIUzI1..."
AT+UHTCRHAF=0,"X-Device-ID","NORA-W36-001"
// Send sensor reading
AT+UHTCRPOS=0,85
{"timestamp":"2025-09-25T10:30:00Z","temperature":23.5,"humidity":65,"pressure":1013}
// Expected response: HTTP 201 Created
+UEHTCRS:0,201,"Created"
AT+UHTCGBS=0,200
+UHTCGBS:0,0,45,"{"status":"success","id":"sensor_12345"}"
AT+UHTCDC=0

14. Network Time Protocol (NTP) use cases

wi-fi-ntp

NORA-W36 supports Network Time Protocol (NTP) client functionality to synchronize the system clock with time servers on the internet. This ensures accurate timekeeping for applications that require time-stamped data, secure communications, or scheduled operations.

14.1. Basic NTP configuration

Connect as a Wi-Fi station and configure NTP to synchronize system time automatically.

This use case demonstrates how to set up NTP with multiple time servers for redundancy and verify time synchronization.

Prerequisites:

  • Module must be connected to a Wi-Fi network with internet access
  • Network must allow UDP traffic on port 123 (NTP)
NrInstructionsAT commandAT event/Response
1Connect to Wi-Fi network firstSee Wi-Fi station example 
2Configure primary NTP serverAT+UNTSC=0,"pool.ntp.org"OK
3Configure secondary NTP serverAT+UNTSC=1,"time.google.com"OK
4Configure third NTP serverAT+UNTSC=2,"time.nist.gov"OK
5Check current system time (before sync)AT+USYTU?+USYTU:00000001
6Enable NTP clientAT+UNTE=1OK
7Wait for synchronization (5-30 seconds)  
8Verify NTP server statusAT+UNTSC?+UNTSC:0,"pool.ntp.org","185.255.55.20",1 + +UNTSC:1,"time.google.com","216.239.35.12",1 + +UNTSC:2,"time.nist.gov","129.6.15.28",1
9Check synchronized timeAT+USYTU?+USYTU:66E7B2A4
10Save NTP configurationAT&WOK
11Reset to apply stored settings safelyAT+CPWROFFOK

Note: The unix time 66E7B2A4 (hex) equals 1726468772 (decimal), which corresponds to a human-readable time like "Mon, 16 Sep 2024 10:12:52 GMT".

14.2. NTP with DHCP fallback

Configure NTP to use DHCP-provided time servers with manual fallback.

This configuration first attempts to use NTP servers provided by the network's DHCP server, falling back to manually configured servers if DHCP servers are unavailable.

NrInstructionsAT commandAT event/Response
1Connect to Wi-Fi network firstSee Wi-Fi station example 
2Configure fallback NTP serversAT+UNTSC=0,"time.google.com"OK
3Configure additional fallback serverAT+UNTSC=1,"pool.ntp.org"OK
4Enable NTP with DHCP + manual fallbackAT+UNTE=2OK
5Verify NTP configurationAT+UNTE?+UNTE:2
6Check which servers are being usedAT+UNTSC?Shows DHCP or manual servers depending on availability
7Save configurationAT&WOK
8Reset to apply stored settings safelyAT+CPWROFFOK

14.3. NTP server management

Manage and troubleshoot NTP server configuration.

NrInstructionsAT commandAT event/Response
1Check current NTP client statusAT+UNTE?+UNTE:1 (enabled) or +UNTE:0 (disabled)
2View all configured serversAT+UNTSC?Shows all 5 server slots (0-4) with status
3Remove a specific NTP serverAT+UNTSC=2,""Removes server from slot 2
4Add new NTP serverAT+UNTSC=2,"time.cloudflare.com"OK
5Disable NTP clientAT+UNTE=0OK
6Re-enable NTP clientAT+UNTE=1OK

Popular NTP Servers:

  • pool.ntp.org - Global NTP pool project
  • time.google.com - Google Public NTP
  • time.nist.gov - US National Institute of Standards
  • time.cloudflare.com - Cloudflare Public NTP
  • Regional pools: 0.europe.pool.ntp.org, 0.asia.pool.ntp.org, etc.

Troubleshooting Tips:

  • If servers show reachable=0, check network connectivity and firewall settings
  • NTP synchronization may take 30-60 seconds on first connection
  • Use multiple servers from different sources for redundancy
  • Regional NTP servers typically provide better performance than global ones

15. Roaming use cases

15.1. Wi-Fi roaming overview

Wi-Fi roaming allows devices to maintain seamless connectivity while moving between access points (APs) in the same network. This is essential for mobile applications, large coverage areas, and enterprise environments where multiple APs provide overlapping coverage using the same Service Set Identifier (SSID).

15.1.1. IEEE 802.11 roaming standards

Modern Wi-Fi networks implement several roaming standards to optimize the handoff process:

IEEE 802.11r (Fast BSS Transition - FT)

  • Reduces roaming time from ~1000ms to ~50ms
  • Pre-authenticates with target AP before handoff
  • Maintains security associations during transition
  • Critical for real-time applications like VoIP

IEEE 802.11k (Radio Resource Management - RRM)

  • Provides neighbor AP reports to clients
  • Enables intelligent roaming decisions
  • Reduces scanning time by providing AP candidate lists
  • Includes signal strength and load information

IEEE 802.11v (Wireless Network Management - WNM)

  • Allows network-assisted roaming decisions
  • APs can suggest better connection targets
  • Enables Band Steering (2.4GHz ↔ 5GHz)
  • Supports load balancing across APs

IEEE 802.11w (Protected Management Frames - PMF)

  • Secures management frames during roaming
  • Prevents deauthentication attacks
  • Required for WPA3 networks

15.2. NORA-W36 roaming implementation

NORA-W36 supports client-initiated roaming based on RSSI thresholds and scanning algorithms. Roaming is disabled by default and must be enabled before connecting to Wi-Fi.

15.2.1. Roaming process

  1. Monitoring Phase: Continuously monitors current AP's RSSI
  2. Trigger Phase: When RSSI drops below threshold, initiates background scanning
  3. Discovery Phase: Scans for APs with same SSID and better signal strength
  4. Decision Phase: Evaluates candidate APs based on configured criteria
  5. Handoff Phase: Disconnects from current AP and connects to target AP

15.2.2. Roaming configuration

NORA-W36 supports roaming, it is disabled by default and needs to be enabled before connecting Wi-Fi with AT+UWSROE=1

The most important settings are the following, see AT manual for more settings:

CommandDefaultValid valuesDescription
AT+UWSROE=<roaming>00: Disable roaming 1: Enable roamingMaster roaming enable/disable
AT+UWSROS0=<roaming_scanning_threshold>-70Valid values: -95..0RSSI threshold to trigger scanning (dBm)
AT+UWSROS1=<roaming_switch_limit>10Valid values: 1..50Minimum RSSI improvement needed (dB)
AT+UWSROS2=<roaming_scan_interval>5000Valid values: 100..3600000Background scan interval (ms)
AT+UWSROS3=<roaming_current_rssi>00: Disable current RSSI roaming 1: Enable current RSSI roamingRoaming calculation mode
AT+UWSROS4=<roaming_delay_time>0Valid values: 0..30000Handover delay time (ms)
AT+UWSROS5=<roaming_all_channels>10: Scan current channel only 1: Scan all channelsChannel scanning scope

15.2.3. Standard roaming mode (AT+uwsros3=0)

With the default configuration, roaming will start when RSSI drops to -70 dBm or below. A background scan will start to find a better AP with the same SSID. It will perform roaming if an Access Point with -70 + 10 = -60 dBm or better is found.

Example configuration:


AT+UWSROE=1      // Enable roaming
AT+UWSROS0=-70           // Start scanning at -70 dBm
AT+UWSROS1=10            // Require 10 dB improvement
AT+UWSROS3=0     // Use fixed threshold mode

15.2.4. Adaptive roaming mode (AT+uwsros3=1)

In some situations you want to roam based on your current RSSI instead of a fixed value. This "aggressive roaming" mode uses AT+UWSROS3=1 and typically requires lowering the switch limit to 3 dBm AT+UWSROS1=3.

Calculation: If current RSSI is -78 dBm, the target threshold becomes -78 + 3 = -75 dBm. Roaming will occur if an AP with -75 dBm or better signal is found.

Example configuration:


AT+UWSROE=1      // Enable roaming
AT+UWSROS0=-70           // Start scanning at -70 dBm
AT+UWSROS1=3     // Require only 3 dB improvement
AT+UWSROS3=1     // Use current RSSI mode

15.2.5. Roaming optimization guidelines

Roaming Configuration Strategies:

StrategyUse CaseConfigurationCommands
Stable connectionsMinimal roaming, consistent connectionHigher threshold, significant improvement requiredAT+UWSROS0=-80 + AT+UWSROS1=15 + AT+UWSROS3=0
Aggressive roamingMaximum signal qualityModerate threshold, lower improvement requirementAT+UWSROS0=-65 + AT+UWSROS1=3 + AT+UWSROS3=1
Enterprise environmentsHigh AP densityCustom based on deploymentTest and monitor for optimal settings

For enterprise environments:

  • Consider AP density and coverage overlap
  • Test roaming behavior in actual deployment
  • Monitor for excessive roaming (ping-ponging)

15.2.6. Current roaming capabilities and roadmap

Current implementation:

  • NORA-W36 performs client-initiated roaming only
  • Roaming decision based on RSSI only (no load balancing)
  • Brief connectivity interruption during AP handoff
  • Both APs must use identical security configuration

Future roadmap:

  • 802.11r (Fast BSS Transition) support planned for future releases
  • 802.11k (Radio Resource Management) support planned for future releases
  • 802.11v (Wireless Network Management) support planned for future releases
  • These standards will enable faster, more intelligent roaming with minimal service interruption

16. Power save use cases

16.1. Auto sleep

By default no lower power mode is enabled in NORA-W36 to have maximal performance and response time.

In some applications power consumption is important and data throughput and latency is not that important. By enabling the low power mode this will slightly change. More power save means more latency can be expected.

Power level 0 (default, no power save) and power level 1 (moderate power save) is supported, more levels may be added in future releases.

The low power level 1 is set using the command AT+UPMPSL=1 see NORA-W36 SIM and AT command manual for more details. There is a limitation that the first AT command after the timeout (default 1 second) can't be longer than 16 bytes.

Important Note: In power level 1 only 115200 baud rate or lower is allowed.

Power Management Commands:

CommandPurposeExampleDefault
AT+UPMPSL=<level>Set power save levelAT+UPMPSL=1Level 0 (no power save)
AT+UPMPSTO=<timeout_ms>Set active state timeoutAT+UPMPSTO=20001000ms (1 second)
AT+UPMPSL?Read current power levelShows current settingN/A
AT+UPMPSTO?Read current timeoutShows timeout in msN/A

Power Save Configuration Examples:


// Enable moderate power save with 2-second timeout
AT+UPMPSL=1
AT+UPMPSTO=2000
AT&W             // Store settings
AT+CPWROFF       // Reset to apply stored settings safely
// Check current power save configuration
AT+UPMPSL?
+UPMPSL:1        // Power save level 1 enabled
AT+UPMPSTO?
+UPMPSTO:2000            // 2000ms timeout
// Disable power save (maximum performance)
AT+UPMPSL=0

Power Save Behavior:

  • Level 0: No power save, maximum performance and responsiveness
  • Level 1: Moderate power save, slight increase in latency after timeout period
  • Module enters low-power state after specified timeout of inactivity
  • Any AT command or data activity resets the timeout timer

All low power modes save power automatically and will adjust this depending on the level.

When enabled, no further action is required by the host.

16.2. Deep sleep

The most efficient power level is Deep sleep which is almost like a power off, no radio communication is possible in this mode.

  • To initiate Deep sleep mode, the host uses the AT command AT+UPMDS
  • To wake up the module from Deep sleep mode, the host sets GPIO_J9 to GND
  • After wake up, the module assumes the same state as it does after a reset

17. Send and receive data

17.1. Quick mode selection guide

Not sure which mode to use? Answer these questions:

  1. What type of data are you sending?
  • Text/JSON → String Mode (human readable, easy debugging)
  • Images/Files → Binary Mode (preserves exact bytes)
  • Real-time streams → Transparent Mode (lowest latency)
  1. Do you need to process each message separately?
  • Yes → Buffered Mode (message boundaries preserved)
  • No → Direct Mode (stream of bytes)
  1. How important is speed vs reliability?
  • Speed critical → Direct Mode (faster)
  • Reliability critical → Buffered Mode (event-driven)

👉 Most Common Choice: String Buffered Mode - Perfect for most IoT applications

---

NORA-W36 provides multiple data transmission modes optimized for different use cases and performance requirements. Understanding when to use each mode is crucial for optimal application performance and reliability.

17.2. Data mode overview

17.2.1. Data format modes

ModeData TypesCharacter RangeBest ForPerformance
String ModeText, JSON, XML, HTMLASCII printable (0x21-0x7E, 0xA1-0xFF)Web APIs, sensor data, configurationGood
Binary ModeAll data typesFull byte range (0x00-0xFF)File transfers, certificates, imagesBetter
Transparent ModeAll data typesFull byte range (0x00-0xFF)Legacy applications, streamingBest

17.2.2. Receive buffer modes

ModeBehaviorEvent NotificationBest ForLatency
Buffered ModeData stored until read+UESODA event triggeredApplications with event-driven processingHigher
Direct ModeData delivered immediatelyImmediate data delivery eventsReal-time applications, streamingLower

17.3. When to use each data mode

17.3.1. String mode - text and structured data

✅ Use string mode when:

  • Sending/receiving JSON, XML, HTML, or plain text
  • Working with REST APIs and web services
  • Transmitting sensor readings in text format
  • Handling configuration data or commands
  • Data contains only printable ASCII characters

Avoid string mode when:

  • Working with binary files (images, certificates, executables)
  • Data contains null bytes (0x00) or control characters
  • Maximum performance is critical
  • Handling encrypted data or raw binary protocols

Example use cases:

  • IoT sensor data: {"temperature":25.6,"humidity":60.2}
  • HTTP responses: HTTP/1.1 200 OK\r\nContent-Type: application/json
  • MQTT messages with text payloads
  • Configuration files in JSON/XML format

17.3.2. Binary mode - all data types

✅ Use binary mode when:

  • Transferring files (images, documents, firmware)
  • Uploading TLS certificates and private keys
  • Working with binary protocols (custom, proprietary)
  • Data contains null bytes or control characters
  • Need full byte range support (0x00-0xFF)
  • Data integrity is critical

Avoid binary mode when:

  • Only working with simple text data
  • Ease of debugging is more important than functionality
  • Working with text-only protocols (HTTP headers, SMTP)

Example use cases:

  • Certificate uploads: AT+USECUB=0,"ca.pem"{binary certificate data}
  • File transfers: Images, PDFs, firmware updates
  • Encrypted data transmission
  • Custom binary protocols

17.3.3. Transparent mode - maximum performance

✅ Use transparent mode when:

  • Maximum throughput is required
  • Implementing legacy applications (similar to old data mode)
  • Streaming data continuously
  • Want direct UART-to-network bridge functionality
  • Minimal protocol overhead needed

Avoid transparent mode when:

  • Need multiple concurrent connections
  • Require AT command access during data transfer
  • Application needs flow control or data validation
  • Working with complex protocols requiring parsing

Example use cases:

  • Legacy terminal applications
  • High-speed data streaming
  • Simple bridge applications

---

17.4. Basic data mode configuration

NORA-W36 supports several modes for sending and receiving data:

  • String mode
  • All readable ASCII characters (0x21-0x7E, 0xA1-0xFF)
  • Use when sending data in plain text format. For example, when using JSON, HTML, or NMEA.
  • Binary mode
  • All types of characters (0x00-0xFF)
  • Use when all types of data is needed. For example, in binary content using file upload and download.
  • Transparent mode
  • All types of characters (0x00-0xFF)

Performance notes:

  • Transparent mode has best performance, due to no wait states
  • Direct mode is faster than Buffered mode
  • Binary mode is faster than String mode

To receive data without an event and read it out, the read mode can be changed to direct mode AT+USORM=1

17.5. String mode

Socket receive mode

Syntax

AT+USORM=<receive_mode>

  • 0: Buffered mode
  • +UESODA - Socket Data Available Event, default mode
  • 1: Direct string mode
  • +UESODS - Socket Data Binary Event: Incoming on TCP socket data represented as a string
  • +UESODSF - Socket Data Binary From Event: Incoming on UDP socket data represented as a string

SPS Receive data mode

Syntax

AT+USPSRM=<receive_mode>

  • 0: Buffered mode
  • +UESPSDA SPS Data Available event, default mode
  • 1: Direct string mode
  • +UESPSDS - SPS Data String event

17.5.1. Socket write string

Syntax

AT+USOWS=<socket_handle>,<string_data>

Example to write socket data

NrInstructionsAT commandAT event
1Write Socket data in string format sizeAT+USOWS=0,"Hello from NORA-W36"OK

17.5.2. Socket read string

Syntax

AT+USORS=<socket_handle>,<length>

+USORS:<socket_handle>,<length>,<string_data>

Example to read socket data

NrInstructionsAT commandAT event
1Incoming Socket data +UESODA:0,19
2Reads incoming Socket data in string formatAT+USORS=0,19+USORS:0,19,"Hello from NORA-W36"

17.5.3. SPS write string

Syntax

AT+USPSWS=<conn_handle>,<string_data>

Example to write SPS data

NrInstructionsAT commandAT event
1Write SPS data in string format sizeAT+USPSWS=0,"Hello from NORA-W36"OK

17.5.4. SPS read string

Syntax

AT+USPSRS=<socket_handle>,<length>

+USPSRS:<socket_handle>,<length>,<string_data>

Example to read SPS data

NrInstructionsAT commandAT event
1Incoming SPS data +UESPSDA:0,19
2Reads incoming SPS data in string formatAT+USPSRS=0,19+USPSRS:0,19,"Hello from NORA-W36"

17.6. Binary mode

The binary mode should be used when binary content is transmitted, like files and binary protocols.

See Binary data for more information about the format of the data.

Socket receive mode

Syntax

AT+USORM=<receive_mode>

  • 0: Buffered mode
  • +UESODA - Socket Data Available Event, default mode
  • 2: Direct binary mode
  • +UESODB - Socket Data Binary Event: Incoming on TCP socket data represented as binary data
  • +UESODBF - Socket Data Binary From: Incoming on UDP socket data represented as binary data

SPS receive mode

Syntax

AT+USPSRM=<receive_mode>

  • 0: Buffered mode
  • +UESPSDA SPS Data Available event, default mode
  • 2: Direct binary mode
  • +UESPSDB - SPS Data Binary event

See more information about Binary Data.

17.6.1. Socket write binary

AT+USOWB=<socket_handle>{binary_data}

Example to write socket data

NrInstructionsAT commandAT event
1Write Socket data in binary format sizeAT+USOWB=0\x01\x00\x13Hello from NORA-W36OK

17.6.2. Socket read binary

Syntax

AT+USORB=<socket_handle>,<length>

+USORS:<socket_handle>{binary_data}

Example to read socket data

NrInstructionsAT commandAT event
1Incoming Socket data +UESODA:0,19
2Reads incoming Socket data in binary formatAT+USORB=0,19+USORB:0\x01\x00\x13Hello from NORA-W36

17.6.3. SPS write binary

Syntax

AT+USPSWS=<conn_handle>{binary_data}

Example to write SPS data

NrInstructionsAT commandAT event
1Write SPS data in binary format sizeAT+USPSWB=0\x01\x00\x13Hello from NORA-W36OK

17.6.4. SPS read binary

Syntax

AT+USORB=<socket_handle>,<length>

+USORB:<socket_handle>{binary_data}

Example to read SPS data

NrInstructionsAT commandAT event
1Incoming SPS data +UESPSDA:0,19
2Reads incoming SPS data in binary formatAT+USPSRB=0,19+USPSRB:0\x01\x00\x13Hello from NORA-W36

17.7. Transparent mode overview

Transparent mode (TM) allows the NORA-W36 to act as a transparent bridge, forwarding all UART data directly to a remote device without AT command processing. This works similarly to Data mode in legacy u-blox short range products.

Key Features:

  • Direct UART-to-remote data forwarding
  • No AT command processing during transparent mode
  • Escape sequence +++ to return to AT command mode
  • Support for TCP, UDP (Wi-Fi), and SPS (Bluetooth LE) connections

Important Limitations:

  • Only one active connection allowed at a time
  • Must establish connection before entering transparent mode
  • All UART data is sent unmodified (no flow control indicators)

17.8. Basic transparent mode

The AT+UTM command enters transparent mode on an existing connection.

17.8.1. Command syntax


AT+UTM=<link_type>,<handle>

Parameters:

  • <link_type>: Connection type
  • 0 = SPS (Bluetooth LE Serial Port Service)
  • 1 = TCP socket
  • 2 = UDP socket
  • <handle>: Connection handle/socket ID (0-255)

Return Values:

  • OK = Transparent mode activated successfully
  • ERROR = Invalid parameters or no active connection

17.8.2. SPS (Bluetooth le) example


// Prerequisites: BLE connection established with SPS service
AT+UTM=0,0
OK
[Transparent mode started - all UART data forwarded to BLE device]
Hello from NORA-W36!
[Data sent transparently to remote BLE device]
+++
OK
[Back in AT command mode]

17.8.3. TCP socket example


// Prerequisites: Wi-Fi connected, TCP socket created and connected
AT+USOCR=6       // Create TCP socket
+USOCR:0         // Socket ID 0 created
AT+USOCO=0,"192.168.1.100",8080              // Connect to server
OK
AT+UTM=1,0       // Enter transparent mode on socket 0
OK
[Transparent mode started - all UART data sent to TCP server]
GET / HTTP/1.1\r\nHost: example.com\r\n\r\n
[HTTP request sent transparently]
+++
OK
[Back in AT command mode]

17.8.4. UDP socket example


// Prerequisites: Wi-Fi connected, UDP socket created
AT+USOCR=17      // Create UDP socket
+USOCR:1         // Socket ID 1 created
AT+USOST=1,"192.168.1.200",9000,4,"test"     // Send initial data to establish endpoint
+USOST:1,4       // 4 bytes sent
AT+UTM=2,1       // Enter transparent mode on UDP socket 1
OK
[Transparent mode started - all UART data sent as UDP packets]
Hello UDP Server!
[UDP packet sent transparently]
+++
OK
[Back in AT command mode]

17.8.5. UDP bidirectional transparent mode

This example demonstrates UDP transparent mode with bidirectional communication - sending and receiving data using a single UDP socket.

Use Case: Real-time data exchange where you need immediate transparent mode without persistence.


// Prerequisites: Wi-Fi connected
AT+USOCR=17      // Create UDP socket
+USOCR:1         // Socket ID 1 created
// Bind to local port for receiving data
AT+USOB=1,5005           // Bind socket 1 to local port 5005
OK
// Set remote endpoint for outgoing data
AT+USOP=1,"192.168.1.174",5003     // Configure remote server for outgoing data
OK
// Send test data to establish connection
AT+USOST=1,"192.168.1.174",5003,4,"test"     // Send initial packet
+USOST:1,4       // 4 bytes sent
// Enter transparent mode immediately
AT+UTM=2,1       // Enter transparent mode on UDP socket 1
OK
[Transparent mode active - bidirectional UDP communication]
Hello Server!            // UART data → UDP packet to 192.168.1.174:5003
[Any UDP data to port 5005 → forwarded to UART]
+++              // Exit transparent mode
OK
[Back in AT command mode]

Network Configuration:

  • Local Port: 5005 (receives UDP data from any source)
  • Remote Target: 192.168.1.174:5003 (receives outgoing data)
  • Mode: Transparent mode (not persistent)

Traffic Flow:

  • Outgoing: UART data → UDP packets to 192.168.1.174:5003
  • Incoming: Any UDP data to NORA-W36:5005 → UART output

17.8.6. Escape sequence timing

  • Send +++ with no line ending (no CR/LF)
  • Wait 1 second before and after sending +++
  • Module responds with OK when returning to AT mode

17.9. Persistent transparent mode

Persistent Transparent Mode (TMP) automatically enters transparent mode on startup after module reset. The connection configuration is stored in flash memory and restored on boot.

Key Differences from Basic Transparent Mode:

  • Configuration stored in flash memory (AT&W command)
  • Automatic connection and transparent mode entry on startup
  • Ideal for applications requiring immediate data forwarding after power-on
  • Same single-connection limitation applies

17.9.1. Command syntax


AT+UTMP=<link_type>,<config_id>

Parameters:

  • <link_type>: Connection type
  • 0 = BLE SPS Link
  • 1 = Socket (TCP or UDP)
  • <config_id>: Configuration ID
  • For SPS: config_id returned by AT+UBTP
  • For sockets: config_id returned by AT+USOP

⚠️ Important Note: AT+UTMP uses different link_type values than AT+UTM:

  • AT+UTM: 0=SPS, 1=TCP, 2=UDP (specific socket types)
  • AT+UTMP: 0=SPS, 1=Socket (covers both TCP and UDP)

17.9.2. SPS persistent mode setup

Prerequisites: Bluetooth LE must be enabled and target device address known.

StepDescriptionAT CommandExpected Response
1Configure remote BLE device addressAT+UBTP=BBBBBBBBBBBB,1+UBTP:200
2Enable persistent transparent modeAT+UTMP=0,200OK
3Store configuration to flashAT&WOK
4Reset moduleAT+CPWROFFOK
5Wait for startup(automatic)+STARTUP
6Persistent transparent mode active(automatic)(data forwarding starts)
7Exit to AT mode when needed+++OK

17.9.3. TCP persistent mode setup

Prerequisites: Wi-Fi credentials configured and target server accessible.

StepDescriptionAT CommandExpected Response
1Create persistent TCP socketAT+USOPCR=6+USOPCR:100
2Configure server IP and portAT+USOP=100,"192.168.0.26",5003OK
3Enable persistent transparent modeAT+UTMP=1,100OK
4Configure Wi-Fi connectionSee Wi-Fi Station SetupOK
5Store all settings to flashAT&WOK
6Reset moduleAT+CPWROFFOK
7Wait for startup and Wi-Fi connection(automatic)+STARTUP
8TCP connection and transparent mode active(automatic)(data forwarding starts)
9Exit to AT mode when needed+++OK

17.9.4. UDP persistent mode setup

Prerequisites: Wi-Fi credentials configured and target server accessible.

StepDescriptionAT CommandExpected Response
1Create persistent UDP socketAT+USOPCR=17+USOPCR:101
2Configure server IP and portAT+USOP=101,"192.168.0.50",8080OK
3Enable persistent transparent modeAT+UTMP=1,101OK
4Configure Wi-Fi connectionSee Wi-Fi Station SetupOK
5Store all settings to flashAT&WOK
6Reset moduleAT+CPWROFFOK
7Wait for startup and Wi-Fi connection(automatic)+STARTUP
8UDP socket and transparent mode active(automatic)(data forwarding starts)
9Exit to AT mode when needed+++OK

17.9.5. UDP bidirectional persistent transparent mode

This example demonstrates persistent UDP transparent mode with bidirectional communication - the NORA-W36 automatically establishes transparent mode on startup for both sending and receiving UDP data.

Use Case: IoT sensor that needs both telemetry data transmission and remote configuration commands with automatic reconnection after power cycles.


// Prerequisites: Wi-Fi credentials configured
AT+USOPCR=17     // Create persistent UDP socket
+USOPCR:100      // Persistent socket ID 100 created
// Configure local port for receiving data
AT+USOB=100,5005         // Bind to local port 5005 for incoming data
OK
// Configure remote server for outgoing data
AT+USOP=100,"192.168.1.174",5003             // Send data to server at 192.168.1.174:5003
OK
// Enable persistent transparent mode
AT+UTMP=1,100            // Socket persistent transparent mode on socket 100
OK
// Save configuration and restart
AT&W             // Save settings to flash
OK
AT+CPWROFF       // Power off and restart
OK
// After restart: NORA-W36 automatically enters transparent mode
// - All UART data is sent to 192.168.1.174:5003
// - All UDP data received on port 5005 is forwarded to UART
// - Bidirectional communication established automatically

Network Configuration:

  • Local Port: 5005 (receives data from any source)
  • Remote Server: 192.168.1.174:5003 (receives outgoing data)
  • Mode: Persistent transparent mode (survives power cycles)

Example Traffic Flow:

  1. Outgoing: UART → NORA-W36 → UDP packet to 192.168.1.174:5003
  2. Incoming: Any device → UDP packet to NORA-W36:5005 → UART

To Exit Transparent Mode:


+++              // Send escape sequence (no CR/LF)
OK               // Back in AT command mode

17.9.6. Important notes

Data Flow:

  • Until the escape sequence +++ is sent, all UART data is forwarded unmodified to the remote device
  • No AT command processing occurs during transparent mode
  • Binary data is supported (including null bytes)

Error Handling:

  • If connection fails during startup, module remains in AT command mode
  • Use AT+UMTMP? to query current persistent transparent mode status
  • Connection timeout errors will terminate transparent mode

Disabling Persistent Mode:


AT+UTMPC         // Clear persistent transparent mode configuration
AT&W             // Save to flash
AT+CPWROFF       // Reset to apply changes

18. Binary data

18.1. What is binary data?

Binary data allows you to send raw bytes (like images, certificates, or any non-text data) through AT commands. This is useful when you need to transfer files, certificates, or binary content that cannot be represented as regular text.

18.2. How binary data works

When sending binary data with NORA-W36, you need to follow a specific format that tells the module exactly how many bytes to expect.

18.2.1. Binary data structure

Every binary transmission consists of two parts:

  1. Binary Header (3 bytes total)
  2. Your actual data (the content you want to send)

18.2.2. The binary header (3 bytes)

The header always contains exactly 3 bytes in this order:

Byte PositionValueDescription
Byte 10x01Start marker (always 0x01)
Byte 2MSBMost Significant Byte of data length
Byte 3LSBLeast Significant Byte of data length

Example: If your data is 2 bytes long, the header would be: 0x01, 0x00, 0x02

18.2.3. Important rules

  • DO: Send binary data immediately after the AT command and parameters
  • DON'T: Add comma (,) before binary data
  • DON'T: Add carriage return (\r) before binary data
  • DON'T: Add any spaces or other characters before binary data

18.3. Simple binary data example

Let's send 2 bytes of data (0xFF, 0xEE) to socket 0.

18.3.1. Step-by-step breakdown:

  1. Your data: 0xFF, 0xEE (2 bytes)
  2. Calculate length: 2 bytes = 0x0002 in hexadecimal
  3. Create header: 0x01, 0x00, 0x02 (start marker + length)
  4. Complete command: AT+USOWB=0 + header + data

18.3.2. What you actually send:


AT+USOWB=0\x01\x00\x02\xFF\xEE

Explanation:

  • AT+USOWB=0 = Write to socket 0
  • \x01 = Start marker
  • \x00 = Length high byte (0)
  • \x02 = Length low byte (2)
  • \xFF\xEE = Your 2 bytes of actual data

Note: The curly braces { } in documentation are just for clarity - never include them in actual commands.

18.4. Text message example

Let's send the text Hello from NORA-W36 as binary data.

18.4.1. Step-by-step calculation:

  1. Count characters: Hello from NORA-W36 = 19 characters = 19 bytes
  2. Convert to hex: 19 = 0x0013 in hexadecimal
  3. Split into bytes: 0x00 (high byte) and 0x13 (low byte)
  4. Create header: 0x01, 0x00, 0x13

18.4.2. Complete command:


AT+USOWB=0\x01\x00\x13Hello from NORA-W36

When you receive data back, it includes the same header:


+USORB:0\x01\x00\x13Hello from NORA-W36

18.5. Certificate upload example

Uploading certificates is more complex but follows the same binary data principles.

18.5.1. Example scenario

You want to upload a certificate file named ca.pem that contains 1342 bytes of certificate data.

18.5.2. Step-by-step process

  1. Count the certificate bytes: Your certificate file = 1342 bytes
  2. Convert to hexadecimal: 1342 = 0x053E in hex
  3. Split into header bytes: 0x05 (high byte) and 0x3E (low byte)
  4. Create header: 0x01, 0x05, 0x3E

18.5.3. Length calculation helper

Decimal BytesHexadecimalHigh ByteLow Byte
2560x01000x010x00
5120x02000x020x00
10240x04000x040x00
13420x053E0x050x3E

18.5.4. Complete certificate command structure


AT+USECUB=0,"ca.pem"\x01\x05\x3E[certificate content here]

Breakdown:

  • AT+USECUB=0,"ca.pem" = Upload to slot 0, name it "ca.pem"
  • \x01 = Binary data start marker
  • \x05 = High byte of length (1342)
  • \x3E = Low byte of length (1342)
  • [certificate content] = The actual 1342 bytes of certificate data

18.5.5. Expected response


+USECUB:1342
OK

This confirms that 1342 bytes were successfully received and stored.


ABCDojCCAoqgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBkDELMAkGA1UEBhMCR0Ix\n
FzAVBgNVBAgMDlVuaXRlZCBLaW5nZG9tMQ4wDAYDVQQHDAVEZXJieTESMBAGA1UE\n
CgwJTW9zcXVpdHRvMQswCQYDVQQLDAJDQTEWMBQGA1UEAwwNbW9zcXVpdHRvLm9y\n
ZzEfMB0GCSqGSIb3DQEJARYQcm9nZXJAYXRjaG9vLm9yZzAeFw0yMzEwMDQxMDEw\n
MzJaFw0yNDAxMDIxMDEwMzJaMHwxCzAJBgNVBAYTAlNFMQ4wDAYDVQQIDAVNYWxt\n
bzEOMAwGA1UEBwwFTWFsbW8xDzANBgNVBAoMBnUtYmxveDEPMA0GA1UECwwGQUUt\n
U0hPMQ0wCwYDVQQDDARjbWFnMRwwGgYJKoZIhvcNAQkBFg10ZXN0QHRlc3Qub3Jn\n
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3PZc1E7uSBiB/Es1V0pU\n
XeSayY3f6vrIbnSGTb+/PERSPgPz6UoZumJjcOWbCMq7T+/dvvxox/ZU/t/XdGMq\n
MJRgN+aWRG6I4QmqYgkiAZGMuaMa+TLLEEPvL1IDKSxeVjHRNDx4yZM4zgvl6ZX7\n
oRaBqZBooNTHOtAGjlydyyz55HCZfLsE8Z3iaH7uW+/n9+2nWusfUXoJmI0STmEH\n
pJ+ZF7M+o53UilW2NKdv/R+wCzXxmKWX6PFVg4NdKspTDUOpPcxlphMQGi24E2uz\n
2k7raCQvGt32LxZc/vic4W6rNDGGNSSDVJTSx6egzfRrcCKw3T88TN87nasjc+KV\n
CQIDAQABoxowGDAJBgNVHRMEAjAAMAsGA1UdDwQEAwIF4DANBgkqhkiG9w0BAQsF\n
AAOCAQEAjRyNWHGtcwLT21IzJ2         // I8YL611iTUitRGkA0gF+7l0DuPtfSLPVhoyB\n
Te3FThYsn2OYfF+LrbSMlWO38Am2fqE8lTGe9EX/HZj95Wj+RnQApc9CkxGJkCb8\n
6aecuz8Vhyl2zWA5kqNrq978uMmsyX3FNRcS3mB7Vo+65R/XwThzHjSXyCyHzRMd\n
zOlrJZMuNWV2bI7vyIIp9/AdHNO6Hwnj+I5hBDvyV+T9RT2jLUTRZldGUJQBlDVj\n
QUKa8NSwzVrvoVTPAT6gcPCn4VQkwxLE/LWaNw2X8mxtyo3nXVoo291TzB8mKHUQ\n
ubOA1iBEcKtAFjqOlZSLanVNvrn5KwXY\n
-----END CERTIFICATE-----\n
+USECUB:1342
OK

18.6. Programming examples

Here are code examples showing how to implement binary data transmission in different programming languages.

18.6.1. Python example


def send_binary_data(at_command, binary_data):
-                // Start with the AT command (without \r)
- message = at_command.encode('ascii')
// Add binary header
    message += b'\x01'             // Start marker
    message += len(binary_data).to_bytes(2, 'big')    // Length (2 bytes, big-endian)
// Add the actual binary data
    message += binary_data
    // Send to NORA-W36
    serial_port.write(message)
// Example usage:
- certificate_data = open('ca.pem', 'rb').read()
- send_binary_data('AT+USECUB=0,"ca.pem"', certificate_data)

18.7. C# example


public void SendBinaryData(string atCommand, byte[] binaryData)
{
    // Convert AT command to bytes
    byte[] cmdBytes = System.Text.Encoding.ASCII.GetBytes(atCommand);
    // Create binary header (3 bytes)
    byte[] header = new byte[3];
    header[0] = 0x01;              // Start marker
    header[1] = (byte)(binaryData.Length >> 8);    // High byte of length
    header[2] = (byte)(binaryData.Length & 0xFF);    // Low byte of length
    // Combine all parts
    byte[] fullMessage = new byte[cmdBytes.Length + header.Length + binaryData.Length];
    Array.Copy(cmdBytes, 0, fullMessage, 0, cmdBytes.Length);
    Array.Copy(header, 0, fullMessage, cmdBytes.Length, header.Length);
    Array.Copy(binaryData, 0, fullMessage, cmdBytes.Length + header.Length, binaryData.Length);
    // Send to NORA-W36
    serialPort.Write(fullMessage, 0, fullMessage.Length);
}
// Example usage:
- byte[] certData = File.ReadAllBytes("ca.pem");
- SendBinaryData("AT+USECUB=0,\"ca.pem\"", certData);

18.8. Common use cases

Binary data is used in these NORA-W36 functions:

  • Socket Communication: AT+USOWB - Send binary data over network sockets
  • Certificate Upload: AT+USECUB - Upload SSL/TLS certificates and keys
  • Serial Port Service: Transfer binary data over Bluetooth SPS
  • File Transfer: Send images, documents, or any binary files

18.9. Troubleshooting tips

18.9.1. Common issues:

  1. Wrong Length: Make sure your length calculation matches the actual data size
  2. Missing Header: Always include the 3-byte header (0x01 + length)
  3. Extra Characters: Don't add commas, spaces, or \r before binary data
  4. Endianness: Length must be big-endian (MSB first, then LSB)

18.9.2. Length calculation check:


Your data size: _____ bytes
Convert to hex: 0x____
High byte (MSB): 0x__
Low byte (LSB): 0x__
Header: 0x01 0x__ 0x__

18.9.3. Quick reference:

Data SizeHexHeader Bytes
1 byte0x00010x01 0x00 0x01
10 bytes0x000A0x01 0x00 0x0A
256 bytes0x01000x01 0x01 0x00
1024 bytes0x04000x01 0x04 0x00

19. Diagnostic tools

Network diagnostic tools are essential for troubleshooting connectivity issues and optimizing network performance. NORA-W36 provides built-in diagnostic capabilities including network status monitoring, connectivity testing, and performance measurement tools.

19.1. Quick diagnostic checklist

Before diving into specific tools, run this quick health check:

StepCommandExpected ResultIssue Indicator
1ATOKNo response = UART/power issue
2ATIModule infoWrong info = firmware issue
3AT+UWSNST=0+UWSNST:0,<IP>No IP = connectivity issue
4AT+UWSST=4Signal strengthLow RSSI = signal issue

19.2. Network status and connectivity testing

19.2.1. Network status check

Purpose: Show current status of Wi-Fi station network interface.

Syntax:


AT+UWSNST=<status_id>              // Query specific status parameter
AT+UWSNST?       // Query all network parameters

Parameters:

  • status_id: Status parameter identifier (0-5)
  • 0: Station IP address
  • 1: Network subnet mask
  • 2: Default gateway address
  • 3: Primary DNS server
  • 4: Secondary DNS server
  • 5: IPv6 link-local address

Examples:

NrAT commandAT eventDescription
1AT+UWSNST=0+UWSNST:0,192.168.1.179Query station IP address
2AT+UWSNST=1+UWSNST:1,255.255.255.0Query subnet mask
3AT+UWSNST=2+UWSNST:2,192.168.1.1Query gateway address
4AT+UWSNST?Multiple responses (see below)Query all network parameters

Response Format for AT+UWSNST?:


+UWSNST:0,192.168.1.179            // Station IP address
+UWSNST:1,255.255.255.0            // Network subnet mask
+UWSNST:2,192.168.1.1              // Default gateway address
+UWSNST:3,192.168.1.1              // Primary DNS server
+UWSNST:4,0.0.0.0        // Secondary DNS server
+UWSNST:5,[fe80::56f8:2aff:fe13:6310]        // IPv6 link-local address

Parameter Descriptions:

  • +UWSNST:0,<ip_address> - Station IP address
  • +UWSNST:1,<subnet_mask> - Network subnet mask
  • +UWSNST:2,<gateway> - Default gateway address
  • +UWSNST:3,<dns_primary> - Primary DNS server
  • +UWSNST:4,<dns_secondary> - Secondary DNS server
  • +UWSNST:5,<ipv6_address> - IPv6 link-local address

Troubleshooting Network Status:

ResponseMeaningNext Steps
+UWSNST:0,192.168.1.179Connected with valid IPNetwork is working
ERRORInterface not availableCheck Wi-Fi connection with AT+UWSC=0
No responseCommand timeoutCheck AT command interface

19.2.2. Signal strength testing

Purpose: Measure Wi-Fi signal quality for connection optimization.

Signal Quality Assessment:

RSSI RangeQualityRecommendation
> -50 dBmExcellentOptimal performance
-50 to -60 dBmGoodStable connection expected
-60 to -70 dBmFairMay experience occasional drops
< -70 dBmPoorMove closer to access point

Example:


AT+UWSST=4
+UWSST:-45
OK
Signal strength: -45 dBm (Excellent)

19.3. Basic connectivity testing using TCP sockets

Purpose: Test internet connectivity using a simple TCP connection.

Basic Internet Connectivity Test:

NrAT commandAT eventDescription
1AT+USOCR=6+USOCR:0Create TCP socket
2AT+USOC=0,"8.8.8.8",53+UESOC:0Connect to Google DNS
3AT+USOCL=0OKClose socket

Result Interpretation:

  • Success: Internet connectivity is working
  • ERROR on step 2: Internet access blocked or DNS issues

19.3. Connectivity troubleshooting guide

Step-by-Step Diagnosis:

  1. Check Physical Connection

   AT+UWSNST=0
   Expected: +UWSNST:0,<IP_ADDRESS>
   If ERROR: Wi-Fi not connected
  1. Verify Signal Quality

   AT+UWSST=4
   Expected: Signal strength > -70 dBm
   If weaker: Move closer to access point
  1. Test Local Network Access

   AT+USOCR=6
   AT+USOC=0,"192.168.1.1",80      // Router IP
   Expected: +UESOC:0
   Tests local network connectivity
  1. Test Internet Access

   AT+USOC=0,"8.8.8.8",53          // Google DNS
   Expected: +UESOC:0
   Tests internet connectivity

19.4. Iperf performance testing

19.5. Overview

Iperf is a network performance measurement tool that can measure maximum TCP and UDP bandwidth performance. NORA-W36 supports Iperf version 2 protocol as both client and server.

Key Capabilities:

  • TCP Performance Testing: Measure maximum throughput
  • UDP Performance Testing: Test packet loss and jitter
  • Bidirectional Testing: Simultaneous upload/download measurement
  • Customizable Parameters: Port, duration, reporting intervals

Download Iperf 2:

Important Note: The Iperf implementation is experimental and may change between releases.

19.5. Iperf command syntax

Syntax: AT+UDGI=<iperf_action>,<protocol_type>[,<role>,<port>,<report_interval>[,<time_boundary>,<ip_addr>[,<bidirectional>]]]

Parameters:

ParameterTypeValuesDescription
iperf_actionInteger1 = Start, 0 = StopControl iperf operation
protocol_typeInteger1 = TCP, 2 = UDPProtocol selection
roleInteger1 = Server, 2 = ClientOperating mode
portInteger1-65535Port number (default: 5001)
report_intervalInteger1-60 secondsReporting frequency
time_boundaryInteger1-300 secondsTest duration
ip_addrStringIP addressTarget server IP (client mode only)
bidirectionalInteger0 = Off, 1 = OnSimultaneous bidirectional test

19.6. Iperf server mode

Purpose: Run NORA-W36 as an Iperf server to receive performance tests from external clients.

19.6.1. PC iperf client setup

19.6.1.1. Setting up PC iperf client

TCP Client:


From PC command line (iperf 2.0):
iperf -c <NORA-W36_IP> -p 5001 -t 10

UDP Client:


From PC command line:
iperf -c <NORA-W36_IP> -p 5001 -u -t 10 -b 10M

NORA-W36 server examples

TCP Server:

NrAT commandAT eventDescription
1AT+UDGI=1,1,1,5001,1 Start TCP server on port 5001
2+UEDGI:"TCP: Start TCP server!" Server started
3+UEDGI:"tcp_server_func: Create socket fd = 0" Socket created
4+UEDGI:"tcp_server_func: Bind socket successfully" Port bound
5+UEDGI:"tcp_server_func: Listen port 5001" Server listening

UDP Server:

NrAT commandAT eventDescription
1AT+UDGI=1,2,1,5002,1 Start UDP server on port 5002
2+UEDGI:"UDP: Start UDP server!" UDP server started

19.7. Iperf client mode

Purpose: Use NORA-W36 as an Iperf client to test performance against external servers.

19.7.1. PC iperf server setup

19.7.1.1. Setting up PC iperf server

TCP Server:


// From PC command line:
iperf -s -p 5001

UDP Server:


// From PC command line:
iperf -s -u -p 5001

NORA-W36 client examples

TCP Client Test:

NrAT commandAT eventDescription
1AT+UDGI=1,1,2,5001,1,20,"192.168.0.41" Connect to TCP server
2+UEDGI:"tcp_client_func: Create socket fd = 1" Socket created
3+UEDGI:"tcp_client_func: Connect to server successfully" Connected
4+UEDGI:"tcp_client_func: Send 1435 KBytes in 1000 ms, 11761 Kbits/sec" Throughput report
5+UEDGI:"tcp_client_func: Send 1418 KBytes in 1000 ms, 11621 Kbits/sec" Continued testing

UDP Client Test:

NrAT commandAT eventDescription
1AT+UDGI=1,2,2,5001,1,10,"192.168.0.41" UDP performance test
2+UEDGI:"udp_client_func: Create socket fd = 2" UDP socket created
3+UEDGI:"udp_client_func: Send 1024 KBytes in 1000 ms, 8388 Kbits/sec" UDP throughput

19.8. Performance interpretation

TCP Performance Benchmarks:

ThroughputQualityTypical Use Cases
> 10 MbpsExcellentVideo streaming, large file transfers
5-10 MbpsGoodWeb browsing, medium file transfers
1-5 MbpsFairIoT data, small file transfers
< 1 MbpsPoorSensor data only

UDP Performance Metrics:

  • Throughput: Data transfer rate
  • Packet Loss: Should be < 1% for good performance
  • Jitter: Should be < 10ms for real-time applications

19.9. Iperf troubleshooting

Common Issues and Solutions:

IssueSymptomsSolution
Connection Failed"Connect failed" errorCheck IP address and port; Verify server is running; Check firewall settings
Low Throughput< 1 Mbps performanceCheck Wi-Fi signal strength (AT+UWSST=4); Move closer to access point; Check for network congestion
Test TimeoutNo performance dataIncrease time_boundary parameter; Check network stability; Verify server response
Socket Creation Failed"Create socket failed"Close existing sockets; Check available memory; Restart if necessary

Debug Steps:

  1. Verify Network Connection:

   AT+UWSNST=0           // Check IP address
   AT+UWSST=4            // Check signal strength
  1. Test Basic Connectivity:

   AT+USOCR=6
   AT+USOC=0,"<server_ip>",<port>            // Test TCP connection
  1. Check Server Availability:
  • Ensure PC Iperf server is running
  • Verify firewall allows connections
  • Test with different ports if needed

19.10. Advanced iperf usage

Bidirectional Testing:


// Test both upload and download simultaneously
AT+UDGI=1,1,2,5001,1,30,"192.168.0.41",1

Custom Duration Testing:


// -second test with 5-second intervals
AT+UDGI=1,1,2,5001,5,60,"192.168.0.41"

Stopping Iperf Tests:


// Stop current iperf operation
AT+UDGI=0

19.11. Performance monitoring best practices

  1. Baseline Testing: Establish performance baselines under optimal conditions
  2. Regular Monitoring: Schedule periodic performance tests
  3. Environmental Factors: Consider time of day, network traffic, interference
  4. Documentation: Keep records of performance measurements for trend analysis

19.12. Integration with application monitoring

Automated Performance Checks:


// Quick performance validation script
AT+UWSNST=0      // Check connection
AT+UWSST=4       // Check signal
AT+UDGI=1,1,2,5001,1,10,"<server_ip>"        // Quick iperf test

This diagnostic approach ensures reliable network performance and helps quickly identify connectivity issues in production deployments.

19.13. Crash information

Purpose: Retrieve system crash information for troubleshooting hardware and firmware issues.

Syntax:


AT+USYCI?

Response:


+USYCI:"<crash_type>","<crash_reason>","<firmware_version>"

Parameters:

  • crash_type: Type of system fault (e.g., "HwFault", "SwFault", "WatchdogReset")
  • crash_reason: Specific reason for the crash (e.g., "timerEvent", "memoryError")
  • firmware_version: Firmware version when crash occurred

Example:


AT+USYCI?
+USYCI:"HwFault","timerEvent","3.1.0-150"
OK

Troubleshooting Steps:

  1. Record crash information for support analysis
  2. Check for pattern - does crash occur repeatedly?
  3. Verify power supply stability and voltage levels
  4. Update firmware to latest version if available
  5. Contact support if problem persists

Important: If crashes continue after firmware updates and power supply verification, contact support@u-blox.com with the complete crash information output for further analysis.

20. Error codes

The Extended error codes provide essential debugging information to understand the reason for errors received during AT command execution. This section provides comprehensive error code documentation for immediate troubleshooting without requiring external references.

Important Note: Error codes should only be used for information and might change between versions in the future.

20.1. Error code overview

NORA-W36 uses a structured error code system organized by functional categories:

CategoryCode RangeDescriptionCommon Scenarios
Common1-22General system errorsParameter validation, memory, timeouts
AT Command31-51AT command parsing errorsInvalid syntax, arguments, formatting
Wi-Fi60-71Wi-Fi specific errorsConnection issues, configuration problems
GATT/Bluetooth91-114Bluetooth GATT errorsAuthentication, permissions, resources
HTTP160+HTTP protocol errorsHeader issues, response problems
Socket180+Socket communication errorsBinding, connection state issues

20.2. Error code commands

20.2.1. Query last error code

Purpose: Retrieve the error code from the last failed AT command

Syntax:


AT+USYEC?

Response:


+USYEC:<error_code>
OK

Example:


AT+USYEC?
+USYEC:5
OK

The error code 5 indicates U_ERROR_COMMON_INVALID_PARAMETER - the parameter in the last AT command was invalid.

20.2.2. Enable extended error reporting

Purpose: Enable automatic error code reporting for all failed commands

Syntax:


AT+USYEE=<extended_errors>

Parameters:

  • extended_errors: 0 = disabled, 1 = enabled

Example:


AT+USYEE=1
OK
AT+UWSSC
ERROR:32

The error code 32 indicates U_AT_STATUS_INVALID_COMMAND - the AT command syntax is incorrect.

20.2.3. Socket error query

Purpose: Get the last error code for socket operations

Syntax:


AT+USOE?

Response:


+USOE:<error_code>
OK

Example:


AT+USOE?
+USOE:16
OK

The error code 16 indicates U_ERROR_COMMON_NOT_CONNECTED - the socket connection is not established.

20.3. Complete error code reference

20.3.1. Common error codes (1-22)

These are fundamental system errors that can occur across all functions:

CodeError NameDescriptionTroubleshooting
1U_ERROR_COMMON_BSD_ERRORBSD system errorCheck system resources and permissions
2U_ERROR_COMMON_NOT_INITIALISEDSystem not initializedEnsure proper module initialization
3U_ERROR_COMMON_NOT_IMPLEMENTEDFeature not implementedUse alternative commands or update firmware
4U_ERROR_COMMON_NOT_SUPPORTEDOperation not supportedCheck module capabilities and configuration
5U_ERROR_COMMON_INVALID_PARAMETERInvalid parameter valueVerify parameter values and ranges
6U_ERROR_COMMON_NO_MEMORYInsufficient memoryFree memory, reduce concurrent operations
7U_ERROR_COMMON_NOT_RESPONDINGModule not respondingCheck power supply, reset module
8U_ERROR_COMMON_PLATFORMPlatform-specific errorCheck hardware configuration
9U_ERROR_COMMON_TIMEOUTOperation timed outIncrease timeout, check network connectivity
10U_ERROR_COMMON_DEVICE_ERRORDevice hardware errorCheck hardware connections, reset device
11U_ERROR_COMMON_NOT_FOUNDResource not foundVerify resource existence and spelling
12U_ERROR_COMMON_INVALID_ADDRESSInvalid address formatCheck IP address, MAC address format
13U_ERROR_COMMON_TEMPORARY_FAILURETemporary operation failureRetry operation after delay
14U_ERROR_COMMON_AUTHENTICATION_FAILUREAuthentication failedCheck credentials, certificates
15U_ERROR_COMMON_OPERATION_IN_PROGRESSOperation already in progressWait for completion or cancel current operation
16U_ERROR_COMMON_NOT_CONNECTEDNot connected to network/serviceEstablish connection first
17U_ERROR_COMMON_LIMIT_REACHEDResource limit reachedCheck concurrent connections, memory usage
18U_ERROR_COMMON_ALREADY_CREATEDResource already existsUse existing resource or delete first
19U_ERROR_COMMON_END_OF_TRANSMISSIONEnd of data transmissionNormal completion indication
19U_ERROR_COMMON_REMOTE_CANCELLED_TRANSMISSIONRemote cancelled transmissionCheck remote peer status
20U_ERROR_COMMON_NOT_CONFIGUREDFeature not configuredConfigure feature before use
21U_ERROR_COMMON_INVALID_RESPONSEInvalid response receivedCheck protocol compliance, retry
22U_ERROR_COMMON_UNKNOWNUnknown error occurredEnable extended error reporting for details

20.3.2. AT command error codes (31-51)

These errors relate to AT command parsing and syntax validation:

CodeError NameDescriptionTroubleshooting
31U_AT_STATUS_NOT_IMPLEMENTEDAT command not implementedUse alternative command or update firmware
32U_AT_STATUS_INVALID_COMMANDInvalid AT command syntaxCheck command spelling and format
33U_AT_STATUS_INVALID_ARGUMENTSInvalid command argumentsVerify argument types and values
34U_AT_STATUS_INVALID_ARGUMENT_COUNTWrong number of argumentsCheck required vs provided parameters
35U_AT_STATUS_INVALID_INT_ARGInvalid integer argumentEnsure numeric values are integers
36U_AT_STATUS_INVALID_INT_RANGEInteger argument out of rangeCheck min/max parameter limits
37U_AT_STATUS_INVALID_STR_ARGInvalid string argumentCheck string format and encoding
38U_AT_STATUS_INVALID_STR_LENGTHString argument too long/shortVerify string length requirements
39U_AT_STATUS_INVALID_ENUM_ARGInvalid enumeration valueUse only supported enumeration values
40U_AT_STATUS_INVALID_IP_ADDR_ARGInvalid IP address formatUse proper IPv4 format (x.x.x.x)
41U_AT_STATUS_INVALID_MAC_ADDR_ARGInvalid MAC address formatUse proper MAC format (xx:xx:xx:xx:xx:xx)
42U_AT_STATUS_INVALID_BD_ADDR_ARGInvalid Bluetooth addressCheck Bluetooth address format
43U_AT_STATUS_INVALID_BYTE_ARRAY_ARGInvalid byte arrayCheck hexadecimal format
44U_AT_STATUS_INVALID_BYTE_ARRAY_LENGTHByte array length mismatchVerify expected vs actual data length
45U_AT_STATUS_UNMATCHED_QUOTEUnmatched quotation marksBalance opening and closing quotes
46U_AT_STATUS_TIMEOUTAT command timeoutIncrease timeout or check module response
47U_AT_STATUS_BIN_CMD_EXEC_AS_STD_CMDBinary command executed as standardUse proper binary command format
48U_AT_STATUS_INVALID_ESCAPE_CODEInvalid escape sequenceUse proper escape characters
49U_AT_STATUS_INVALID_CHARACTERInvalid character in commandRemove unsupported characters
50U_AT_STATUS_INVALID_INT_LIST_ARGInvalid integer list formatCheck list syntax and separators
51U_AT_STATUS_INVALID_INT_LIST_LENGTHInteger list length incorrectVerify expected vs actual list size

20.3.3. Wi-Fi error codes (60-71)

These errors are specific to Wi-Fi operations:

CodeError NameDescriptionTroubleshooting
60U_ERROR_WIFI_ATWi-Fi AT command errorCheck Wi-Fi specific command syntax
61U_ERROR_WIFI_NOT_CONFIGUREDWi-Fi not configuredConfigure Wi-Fi settings first with AT+UWSCP
62U_ERROR_WIFI_NOT_FOUNDWi-Fi network not foundCheck SSID, scan networks with AT+UWSSC
63U_ERROR_WIFI_INVALID_MODEInvalid Wi-Fi modeUse supported modes (station/AP)
64U_ERROR_WIFI_TEMPORARY_FAILURETemporary Wi-Fi failureRetry connection after delay
65U_ERROR_WIFI_ALREADY_CONNECTEDAlready connected to Wi-FiDisconnect first with AT+UWSDC if needed
66U_ERROR_WIFI_ALREADY_CONNECTED_TO_SSIDAlready connected to this SSIDConnection already established
67U_ERROR_WIFI_DISCONNECTEDWi-Fi disconnectedRe-establish connection with AT+UWSC=0
68U_ERROR_WIFI_ALREADY_UPWi-Fi interface already upInterface already active
69U_ERROR_WIFI_AP_NOT_STARTEDAccess Point not startedStart AP mode with AT+UWAPS
70U_ERROR_WIFI_IS_DOWNWi-Fi interface is downBring interface up first
71U_ERROR_WIFI_ALREADY_STARTEDWi-Fi service already startedService already running

20.3.4. Bluetooth GATT error codes (91-114)

These errors occur during Bluetooth GATT operations:

CodeError NameDescriptionTroubleshooting
91U_PORT_GATT_STATUS_INVALID_HANDLEInvalid GATT handleUse valid characteristic/service handles
92U_PORT_GATT_STATUS_READ_NOT_PERMITTEDRead operation not allowedCheck characteristic permissions
93U_PORT_GATT_STATUS_WRITE_NOT_PERMITTEDWrite operation not allowedCheck characteristic permissions
94U_PORT_GATT_STATUS_INVALID_PDUInvalid Protocol Data UnitCheck data format and length
95U_PORT_GATT_STATUS_AUTHENTICATIONAuthentication requiredComplete authentication process
96U_PORT_GATT_STATUS_NOT_SUPPORTEDOperation not supportedUse supported GATT operations
97U_PORT_GATT_STATUS_INVALID_OFFSETInvalid data offsetCheck read/write offset parameters
98U_PORT_GATT_STATUS_AUTHORIZATIONAuthorization requiredComplete authorization process
99U_PORT_GATT_STATUS_PREPARE_QUEUE_FULLPrepare write queue fullComplete pending writes first
100U_PORT_GATT_STATUS_ATTRIBUTE_NOT_FOUNDGATT attribute not foundUse valid attribute handles
101U_PORT_GATT_STATUS_ATTRIBUTE_NOT_LONGAttribute not long enoughCheck attribute length requirements
102U_PORT_GATT_STATUS_ENCRYPTION_KEY_SIZEInsufficient encryption key sizeUse stronger encryption
103U_PORT_GATT_STATUS_INVALID_ATTRIBUTE_LENInvalid attribute lengthCheck length constraints
104U_PORT_GATT_STATUS_UNLIKELYUnlikely error conditionRetry operation
105U_PORT_GATT_STATUS_INSUFFICIENT_ENCRYPTIONInsufficient encryption levelEnable proper encryption
106U_PORT_GATT_STATUS_UNSUPPORTED_GROUP_TYPEUnsupported group typeUse supported GATT group types
107U_PORT_GATT_STATUS_INSUFFICIENT_RESOURCESInsufficient system resourcesFree resources, reduce load
108U_PORT_GATT_STATUS_DB_OUT_OF_SYNCDatabase out of syncRefresh GATT database
109U_PORT_GATT_STATUS_VALUE_NOT_ALLOWEDValue not allowedUse permitted values only
110U_PORT_GATT_STATUS_WRITE_REQ_REJECTEDWrite request rejectedCheck write permissions and format
111U_PORT_GATT_STATUS_CCC_IMPROPER_CONFImproper CCC configurationConfigure Client Characteristic Config properly
112U_PORT_GATT_STATUS_PROCEDURE_IN_PROGRESSGATT procedure in progressWait for completion
113U_PORT_GATT_STATUS_OUT_OF_RANGEValue out of rangeUse values within permitted range
114U_PORT_GATT_STATUS_UNKNOWNUnknown GATT errorEnable extended debugging

20.3.5. HTTP error codes (160+)

These errors relate to HTTP protocol operations:

CodeError NameDescriptionTroubleshooting
160U_ERROR_HTTP_HEADER_NOT_READHTTP header not readEnsure headers are read before accessing body

Note: Additional HTTP error codes may be present. Use AT+USYEC? after HTTP operations for specific codes.

20.3.6. Socket error codes (180+)

These errors occur during socket operations:

CodeError NameDescriptionTroubleshooting
180U_ERROR_SOCKET_ALREADY_BOUNDSocket already boundClose socket first with AT+USOCL

Note: Additional socket error codes may be present. Use AT+USOE? for socket-specific error information.

20.4. Error code troubleshooting workflow

20.4.1. Basic error diagnosis

Step 1: Enable Extended Error Reporting


AT+USYEE=1
OK

Step 2: Execute Command and Observe Error


AT+UWSCP=0,"InvalidSSID"
ERROR:62

Step 3: Look Up Error Code

  • Error 62 = U_ERROR_WIFI_NOT_FOUND
  • Action: Check SSID spelling, scan networks

Step 4: Apply Solution


AT+UWSSC         // Scan for networks
AT+UWSCP=0,"CorrectSSID"
OK

20.4.2. Advanced error analysis

For Connection Issues:


// Check last error
AT+USYEC?
+USYEC:14
OK
// Error 14 = Authentication Failure
// Check credentials and security settings
AT+UWSCP=0       // Verify SSID
AT+UWSS=0        // Check security configuration
AT+UWSS?         // Verify security mode

For Socket Issues:


// Check socket-specific error
AT+USOE?
+USOE:16
OK
// Error 16 = Not Connected
// Re-establish connection
AT+UWSNST=0      // Check network status
AT+USOC=0,server,port              // Reconnect socket

20.5. Common error resolution patterns

Error PatternQuick ResolutionPrevention
Parameter Errors (5, 35-39)Check parameter format and rangesValidate inputs before sending commands
Connection Errors (16, 62, 67)Verify network status and reconnectMonitor connection status regularly
Memory Errors (6, 107)Free resources, reduce concurrent operationsImplement resource management
Authentication Errors (14, 95, 98)Verify credentials and certificatesUse secure credential storage
Timeout Errors (9, 46)Increase timeouts, check network conditionsMonitor signal strength and latency

20.6. Error code integration with monitoring

20.6.1. Automated error monitoring

Enable Comprehensive Error Reporting:


// Enable comprehensive error reporting for all commands
AT+USYEE=1
// Monitor connection events
AT+UWSNST=0      // Check connection status regularly
// Check errors periodically
AT+USYEC?        // Last general error
AT+USOE?         // Last socket error

20.7. Error code integration examples

Wi-Fi Connection with Error Handling:


AT+UWSC
ERROR:62
AT+USYEC?
+USYEC:62
// Error 62 = Network not found, scan first
AT+UWSSC
AT+UWSC
OK

Socket Operation with Error Handling:


AT+USOC=0,"192.168.1.100",80
ERROR
AT+USOE?
+USOE:180
// Error 180 = Socket already bound, close first
AT+USOCL=0
AT+USOC=0,"192.168.1.100",80
OK

This comprehensive error code reference provides immediate debugging support without requiring external documentation, significantly enhancing the troubleshooting experience for NORA-W36 users.

21. Software update

This use case shows what AT commands to send to start a software update.

There are two ways to start the software update:

  • See more about the XMODEM protocol here

firmware

21.1. Update software by AT command

  • Enter XMODEM mode for u-connect software update using serial port
  • XMODEM-1K and baud rate up to 3 Mbps is supported.
NrInstructionsAT commandAT event
1Start XMODEM protocol with AT commandAT+USYFWUS=3000000 
2Now NORA-W36 is ready to receive the software using the XMODEM or XMODEM-1K protocolCCCCCCCCCCC... 
3When the software has been downloaded the module will restart+STARTUP 
4Check the version of the softwareAT+GMR"4.0.0-041"

21.2. Update software by bootloader

Consider the following points when updating the software using the bootloader:

  • Enter the bootloader command line mode using serial port by AT command
  • Press SWITCH_1 and SWITCH_2 during startup (or after reset)
  • A command must be sent within 10 seconds when in bootloader command line mode. Otherwise, the device reboots in normal mode
  • For the complete list of available commands, enter ?
  • An XMODEM protocol timeout is invoked after 10 seconds if nothing is received
  • XMODEM-1K and baud rate up to 3 Mbps is supported
NrInstructionsAT commandEvent
1aEnter the bootloaderAT+USYBL=115200 
1bAlternatively, press SWITCH_1 and SWITCH_2 during startup or reset to enter the bootloader reset  
2Wait for the > prompt >
3Change baud rate to up to 3 Mbit/s (optional)r 3000000 
4Start XMODEM protocol with the command xx 
5Now NORA-W36 is ready to receive the software using the XMODEM or XMODEM-1K protocol CCCCCCCCCCC...
6Wait for the prompt to indicate that the software has been downloaded successfully >
7Enter the q command to restart the moduleq 
8Wait for the prompt to display that the module has restarted in AT mode+STARTUP 
9Check the version of the softwareAT+GMR"3.0.0-041"

21.3. XMODEM protocol deep dive

XMODEM is a file transfer protocol used for reliable data transmission over serial connections. NORA-W36 supports both standard XMODEM (128-byte blocks) and XMODEM-1K (1024-byte blocks) for firmware updates.

21.3.1. XMODEM protocol overview

XMODEM uses a simple acknowledgment-based protocol where the receiver controls the transfer by requesting blocks from the sender. Each block includes error detection to ensure data integrity.

Key Features:

  • Block-based transfer: Data sent in fixed-size blocks
  • Error detection: Checksum or CRC for data integrity
  • Flow control: Receiver controls transfer pace
  • Retry mechanism: Automatic retransmission on errors
  • Timeout handling: Built-in timeouts prevent hanging

21.3.2. Standard XMODEM (128-byte blocks)

Block Structure:


[SOH][Block#][~Block#][128 bytes data][Checksum]
  1     1        1         128            1     = 132 bytes total

Control Characters:

  • SOH (0x01): Start of Header - begins each block
  • EOT (0x04): End of Transmission - signals transfer complete
  • ACK (0x06): Acknowledge - receiver accepts block
  • NAK (0x15): Negative Acknowledge - receiver rejects block
  • CAN (0x18): Cancel - abort transfer
  • C (0x43): Request CRC mode instead of checksum

21.3.3. XMODEM-1k (1024-byte blocks)

Block Structure:


[STX][Block#][~Block#][1024 bytes data][CRC-16]
  1     1        1          1024            2    = 1029 bytes total

Key Differences from Standard XMODEM:

  • Uses STX (0x02) instead of SOH
  • 1024-byte data blocks instead of 128 bytes
  • Always uses CRC-16 instead of simple checksum
  • 8x faster transfer rate for large files

21.3.4. XMODEM transfer sequence

1. Handshake Phase:


Receiver → Sender: NAK or 'C' (requests transfer start)
Sender   → Receiver: First data block

2. Data Transfer Phase:


For each block:
  Sender   → Receiver: [Block data]
  Receiver → Sender:   ACK (good) or NAK (retry)

3. Completion Phase:


Sender   → Receiver: EOT (end of transmission)
Receiver → Sender:   ACK (confirms completion)

21.3.5. Error handling and recovery

Timeout Conditions:

  • 10 seconds: Initial handshake timeout
  • 10 seconds: Block transmission timeout
  • Maximum 10 retries: Before aborting transfer

Error Recovery:

  • Checksum/CRC mismatch: Receiver sends NAK, sender retransmits
  • Block number error: Receiver sends NAK for retransmission
  • Timeout: Receiver sends NAK to request retransmission
  • Too many errors: Either side sends CAN to abort

21.3.6. Implementation examples

Complete working XMODEM implementations for NORA-W36 firmware updates are provided in the appendices:

Key Features of Both Implementations:

  • Hardware Validated: Tested with real NORA-W36 modules for firmware updates
  • XMODEM-1K Protocol: 1024-byte blocks with CRC-16 error detection
  • Robust Error Handling: Automatic retries, timeout management, and recovery
  • Progress Tracking: Real-time feedback during file transfers
  • NORA-W36 Integration: Automated AT command sequence for firmware mode
  • High-Speed Support: Up to 3Mbps baud rate for fast transfers

Usage Examples:


# Python implementation
python xmodem.py COM3 NORA-W36X-SW-3.1.0-150.bin 115200
# C implementation
xmodem.exe COM3 NORA-W36X-SW-3.1.0-150.bin 115200

Both implementations use identical command-line interfaces and have been proven to work reliably with NORA-W36 hardware.

21.3.7. Performance comparison

Standard XMODEM vs XMODEM-1K:

ParameterXMODEMXMODEM-1K
Block Size128 bytes1024 bytes
Header Size3 bytes3 bytes
Error Check1 byte checksum2 bytes CRC-16
Total Overhead4 bytes (3.1%)5 bytes (0.5%)
Blocks per MB8,1921,024
ACK/NAK per MB8,1921,024
Efficiency96.9%99.5%

Transfer Time Example (1MB firmware at 3Mbps):

  • XMODEM: ~3.5 seconds
  • XMODEM-1K: ~2.8 seconds (20% faster)

21.3.8. NORA-W36 specific implementation

Firmware Update Process:

  1. AT Command Mode: Send AT+USYFWUS=3000000 to enter XMODEM mode
  2. Protocol Detection: NORA-W36 sends 'C' characters requesting CRC mode
  3. Auto-Detection: Module automatically detects XMODEM vs XMODEM-1K from first block
  4. High-Speed Transfer: Supports up to 3Mbps baud rate for fast updates
  5. Verification: Module verifies firmware integrity before activation
  6. Restart: Automatic restart with new firmware after successful update

Bootloader Mode Features:

  • Manual Entry: Press SWITCH_1 + SWITCH_2 during startup
  • Command Interface: Interactive commands (x for XMODEM, r for baud rate)
  • Recovery Mode: Always available even if firmware is corrupted
  • Safety Features: 10-second timeout prevents accidental activation

Documentation & resources

Complete product information, specifications, and ordering details

Configuration and development tool for u-blox modules

Comprehensive AT command reference and syntax guide

23. Contacts

u-blox AG

Address: Zürcherstrasse 68

8800 Thalwil

Switzerland

For further support and contact information, visit us at u-blox Support.

---

Appendix

A.1 Wi-Fi commands

A.1.1 Station connection commands

CommandPurposeSection
AT+UWSCPWi-Fi Station Connection Parameters (SSID)Section 8.1.4
AT+UWSSWWi-Fi Station Security/Password (WPA2/WPA3)Section 8.1.4
AT+UWSSOWi-Fi Station Security OpenSection 8.1
AT+UWSCWi-Fi Station ConnectSection 8.1.4
AT+UWSDCWi-Fi Station DisconnectSection 8.1.4
AT+UWSNSTWi-Fi Station Network StatusSection 8.1
AT+UWSSTWi-Fi Station Signal Strength (RSSI)Section 8.1

A.1.2. Station enterprise security commands

CommandPurposeSection
AT+UWSSPWi-Fi Station PEAP SecuritySection 8.2
AT+UWSSEWi-Fi Station Enterprise Security (EAP-TLS)Section 8.3

A.1.3. Station IP configuration commands

CommandPurposeSection
AT+UWSIPSWi-Fi Station IP Static ConfigurationSection 8.1
AT+UWSIPDWi-Fi Station IP DHCPSection 8.1

A.1.4. Access point commands

CommandPurposeSection
AT+UWAPCPWi-Fi Access Point Connection ParametersSection 8.4
AT+UWAPSWWi-Fi Access Point Security/PasswordSection 8.4
AT+UWAPAWi-Fi Access Point ActivateSection 8.4
AT+UWAPDWi-Fi Access Point DeactivateSection 8.4
AT+UWAPNSTWi-Fi Access Point Network StatusSection 8.4

A.1.5. Roaming commands

CommandPurposeSection
AT+UWSROS0Wi-Fi Roaming RSSI Threshold LowSection 13
AT+UWSROS1Wi-Fi Roaming RSSI Threshold HighSection 13
AT+UWSROS2Wi-Fi Roaming Scan IntervalSection 13
AT+UWSROS3Wi-Fi Roaming Scan DurationSection 13
AT+UWSROS4Wi-Fi Roaming Channel TimeSection 13
AT+UWSROS5Wi-Fi Roaming Home Channel TimeSection 13

A.2 Socket commands

A.2.1. Socket management

CommandPurposeSection
AT+USOCRCreate Socket (TCP/UDP)Section 11.1
AT+USOCSocket ConnectSection 11.1
AT+USOLSocket Listen (Server)Section 11.2
AT+USOCLSocket CloseSection 11.1

A.2.2. Socket data transfer

CommandPurposeSection
AT+USOWSSocket Write StringSection 17.5
AT+USOWBSocket Write BinarySection 17.6
AT+USORSSocket Read StringSection 17.5
AT+USORBSocket Read BinarySection 17.6

A.2.1. TLS/SSL commands

CommandPurposeSection
AT+USOTLSSocket TLS ConfigurationSection 11.5
AT+USETE0TLS Extension - Server Name IndicationSection 11.9
AT+USETE1TLS Extension - Handshake FragmentationSection 11.9

A.2.3 Certificate management commands

CommandPurposeSection
AT+USECUBCertificate Upload BinarySection 11.7
AT+USECLCertificate ListSection 6.7.7
AT+USECDCertificate Details/ShowSection 6.7.7
AT+USECRCertificate RemoveSection 6.7.7

A.4 MQTT commands

CommandPurposeSection
AT+UMQCPMQTT Client Parameters (Host/Port)Section 12.1
AT+UMQCMQTT Client ConnectSection 12.1
AT+UMQDCMQTT Client DisconnectSection 12.1
AT+UMQSMQTT SubscribeSection 12.1
AT+UMQSMQTT Unsubscribe (with action=1)Section 12.1
AT+UMQPSMQTT Publish StringSection 12.1
AT+UMQCPMQTT Connection Parameters (includes username/password)Section 12.8
AT+UMQTLSMQTT TLS ConfigurationSection 12.9

A.5 HTTP/HTTPS commands

CommandPurposeSection
AT+UHTCCPHTTP Client Connection ParametersSection 13.3
AT+UHTCTLSHTTP Client TLS ConfigurationSection 13.4
AT+UHTCRGHTTP Client Request GETSection 13.3
AT+UHTCRPHTTP Client Request POSTSection 13.5
AT+UHTCRPUSHTTP Client Request PUT StringSection 13.7
AT+UHTCRDHTTP Client Request DELETESection 13.8
AT+UHTCGBSHTTP Client Get Body StringSection 13.3
AT+UHTCGBBHTTP Client Get Body BinarySection 13.6
AT+UHTCRHAFHTTP Client Request Header Add FieldSection 13.5
AT+UHTCDCHTTP Client DisconnectSection 13.3

A.6 Bluetooth commands

A.6.1. BLE advertising commands

CommandPurposeSection
AT+UBTALSBLE Advertising ParametersSection 7.5
AT+UBTALBLE Advertising StartSection 7.5
AT+UBTALDBLE Advertising StopSection 7.5

A.6.2. BLE connection commands

CommandPurposeSection
AT+UBTCBLE Connect (Central)Section 7.1
AT+UBTDCBLE DisconnectSection 7.1
AT+UBTDBLE Discovery/Scan StartSection 7.1
AT+UBTSSBLE Scan SettingsSection 7.1

A.6.3. BLE SPS commands

CommandPurposeSection
AT+UBTPBluetooth PairingSection 7.3
AT+USPSWSSPS Write StringSection 17.5
AT+USPSWBSPS Write BinarySection 17.6
AT+USPSRSSPS Read StringSection 17.5
AT+USPSRBSPS Read BinarySection 17.6

A.6.4. BLE GATT commands

CommandPurposeSection
AT+UBTGWGATT Characteristic WriteSection 7.1
AT+UBTGRGATT Characteristic ReadSection 7.1
AT+UBTGCCWGATT Client Configuration Write (for notifications)Section 7.1

A.7 System and diagnostic commands

A.7.1. Power management

CommandPurposeSection
AT+UPMPSLPower Management Sleep LevelSection 16.1
AT+UPMPSTOPower Management Sleep TimeoutSection 16.1
AT+CPWROFFModule Reset/Power OffMultiple sections

A.7.2. Network time protocol (NTP)

CommandPurposeSection
AT+UNTENTP Enable/Disable and StatusSection 9.1
AT+UNTSCNTP Server ConfigurationSection 14.2

A.7.3. Diagnostic commands

CommandPurposeSection
AT+UWSNST?Check Connection StatusSection 19.2.1
AT+UDGIDiagnostic Iperf ClientSection 19.7

A.7.4. Error handling

CommandPurposeSection
AT+USYECSystem Extended Error CodeSection 20.2.1
AT+USYEESystem Extended Errors EnableSection 20.3.6
AT+USOESocket ErrorSection 20.2.3

A.7.5. Data mode commands

CommandPurposeSection
AT+UTMTransparent ModeSection 17.8
AT+UTMPTransparent Mode PersistentSection 17.9
ATE0/ATE1Command Echo ControlSection 11.1
AT&WStore Configuration (use with AT+CPWROFF)Multiple sections
+++Escape Sequence (Exit Transparent Mode)Section 17.8

A.8 Quick command lookup by use case

A.8.1. Quick getting started


AT+UWSCP=0,"YourSSID"              // Set network name
AT+UWSSW=0,"YourPass",0            // Set password
AT+UWSC=0        // Connect

A.8.2. Quick MQTT setup


AT+UMQCP=0,"broker.hivemq.com",1883          // Set broker
AT+UMQC=0        // Connect
AT+UMQS=0,"test/topic"             // Subscribe

A.8.3. Quick HTTP request


AT+UHTCCP=0,"httpbin.org",80       // Set server
AT+UHTCRG=0,"/"          // GET request
AT+UHTCGBS=0,500         // Read response

A.8.4. Debug commands chain


AT+USYEE=1       // Enable extended errors
AT+UWSST=4       // Check signal strength
AT+UWSSC         // List available networks
AT+USYEC?        // Check last error

// Appendix B: Enhanced Debugging and Visual Reference Guide

This appendix provides visual troubleshooting aids, standardized code examples, and enhanced debugging techniques for optimal NORA-W36 implementation and troubleshooting.

B.1 Visual status indicators and LED patterns

B.1.1 NORA-W36 LED status indicators

Official LED Patterns (from NORA-W36 Datasheet):

LED CombinationColorStateDescription
LED_BLUE = Low (0)🔵 BlueConnectedWi-Fi or Bluetooth connection established
LED_RED + LED_BLUE = Low (0)🟣 MagentaConnectingAttempting Wi-Fi or Bluetooth connection
LED_RED + LED_GREEN = Low (0)🟡 YellowNot ConnectedNo active connections
LED_RED = Low (0)🔴 RedNot usedReserved for future versions
LED_GREEN = Low (0)🟢 GreenNot usedReserved for future versions

Quick Status Reference:

  • 🔵 Blue: Connection successful - ready for data transfer
  • 🟣 Magenta: Connection in progress - wait for completion
  • 🟡 Yellow: No connection - initiate connection sequence

Note: LED behavior may change in future firmware versions. Refer to latest datasheet for updates.

B.1.2 Connection status workflow

Visual Connection Flow:


🟡 Yellow (Disconnected)
        ↓
   AT+UWSC=0 (Start connection)
        ↓
🟣 Magenta (Connecting)
        ↓
🔵 Blue (Connected)

Troubleshooting with LEDs:

  • Stuck in Magenta: Check signal strength, credentials, or network availability
  • Returns to Yellow: Connection failed - check error codes with AT+USYEC?
  • Blue achieved: Connection successful - proceed with data operations

B.2 Standardized code example format

B.2.1 Command documentation standard

Standardized AT Command Format Template:


### B.2.2. Command name
**Purpose:** Brief description of what the command does
**Syntax:**

AT+UWSCP=<interface_id>,<ssid>

Parameters:

  • interface_id: Wi-Fi interface (0 = station)
  • ssid: Network SSID name (quoted string)

Response:


OK

Examples:


// Basic usage
AT+UWSCP=0,"MyNetwork"
OK
// Error case
AT+UWSCP=0,invalid_ssid
ERROR:5          // U_ERROR_COMMON_INVALID_PARAMETER

Notes: SSID must be provided as quoted string for proper parsing

B.2.2 Standardized connection examples

Wi-Fi Connection Template:


// Step 1: Configure network
AT+UWSCP="NetworkName",<channel>
OK
// Step 2: Set security (WPA2/WPA3)
AT+UWSSW=0,"password",<wpa_mode>
OK
// Step 3: Connect
AT+UWSC
+UEWLU:0,123456789ABC,6            // Wi-Fi Link Up
OK
// Step 4: Verify Netork connection
+UEWSNU
AT+UWSNST=0
+UWSNST:0,"192.168.1.100"
OK

Socket Connection Template:


// Step 1: Create socket
AT+USOCR=<protocol>      // 6=TCP, 17=UDP
+USOCR:<socket_id>
OK
// Step 2: Connect to server
AT+USOC=<socket_id>,<server_ip>,<port>
+UESOC:<socket_id>
OK
// Step 3: Send/receive data
AT+USOWS=<socket_id>,"<data_payload>"
+USOWS:<socket_id>,<bytes_sent>
OK
// Step 4: Close socket
AT+USOCL=<socket_id>
OK

B.3 Enhanced debugging workflows

B.3.1 Progressive debugging approach

Level 1: Basic Status Check


// Quick health check (30 seconds)
AT               // Module responsiveness
AT+UWSNST=0      // Network status
AT+USYEC?        // Last error code

Level 2: Connection Diagnostics


// Connection analysis (2 minutes)
AT+UWSSC         // Network scan
AT+UWSST=4       // Signal strength
AT+UWSCP=0       // Current configuration
AT+UWSS=0        // Security settings
AT+UWSNST?       // Check connection status

Level 3: Advanced Troubleshooting


// Deep diagnostics (5 minutes)
AT+USYEE=1       // Enable extended errors
AT+UWSSC         // Detailed network scan
AT+USECL?        // Certificate validation
AT+UWSST=4       // Signal strength check
AT+USYEC?        // Check for system errors

B.3.2 Visual troubleshooting decision tree


                    ⚠  AT Command Fails?
                           │
                    ┌──────▼──────
                    │ AT+USYEC?   │
                    │ Check Error │
                    └──────┬──────┘
                           │
              ┌────────────▼────────────
              │     Error Code Range?   │
              └─┬─────────┬─────────┬───┘
                │         │         │
           ┌────▼─── ┌───▼─── ┌───▼────
           │ 1-22   │ │ 31-51 │ │ 60-71  │
           │Common  │ │AT Synt│ │ Wi-Fi  │
           │Errors  │ │ax Err │ │Errors  │
           └────┬───┘ └───┬───┘ └───┬────┘
                │         │         │
                ▼         ▼         ▼
         ┌───────────── ┌───────────── ┌─────────────
         │🔧 Check     │ │ Check     │ │📶 Check     │
         │System       │ │Command      │ │Wi-Fi        │
         │Resources    │ │Format &     │ │Connection   │
         │& Hardware   │ │Parameters   │ │& Settings   │
         └─────────────┘ └─────────────┘ └─────────────┘
                │         │         │
                ▼         ▼         ▼
         ┌───────────── ┌───────────── ┌─────────────
         │• Power      │ │• Syntax     │ │• Network    │
         │• Memory     │ │• Arguments  │ │• Auth       │
         │• Sensors    │ │• Quotes     │ │• Signal     │
         └─────────────┘ └─────────────┘ └─────────────┘
       │   │
       ▼   ▼
   ┌─────────────
   │AT+UWSSC   │
   │Check Networks│
   └─────────────┘

B.4 Performance monitoring visual dashboard

B.4.1 Automated health check script template

Health Check Sequence (Copy-paste ready):


=== NORA-W36 Health Check ===
echo "Starting health check..."
// Basic responsiveness
AT
// Network status
AT+UWSNST=0
echo "Network Status: Check response above"
// Signal quality
AT+UWSST=4
echo "Signal Strength: Check RSSI value above"
// Error status
AT+USYEC?
echo "Last Error: 0 = No errors"
// Certificate status
AT+USECL?
echo "Certificates: Check expiration dates"
echo "Health check complete!"

B.5 Quick reference cards

B.5.1 Emergency recovery commands

🆘 Module Not Responding:


// Hardware reset sequence
1. Power cycle module (3.3V off → on)
2. Wait 5 seconds
3. AT            // Test basic response
4. AT&F          // Factory reset
5. AT+CPWROFF            // Restart with factory default settings

🆘 Connection Issues:


// Connection recovery sequence
AT+UWSDC         // Disconnect from network
AT+USYEE=1       // Enable error reporting
AT+UWSSC         // Scan available networks
AT+UWSC          // Reconnect
AT+UWSNST=0      // Verify connection

B.5.2 Power user quick commands

⚡ Speed Test Commands:


// Connection speed test
AT+UWSNST?       // Check connection
AT+UWSSC         // List networks for signal strength
AT+UWSST=4       // Signal strength verification

⚡ Bulk Configuration:


// Fast setup sequence for development
AT+USYEE=1       // Extended errors
AT+UWSNST=0      // Connection status check
AT+UPMPSL=0      // Disable power save

⚡ Security Validation:


// Security health check
AT+UWSCP=0       // Network config
AT+UWSS=0        // Security configuration
AT+USECL?        // Certificate validity
AT+UWSST=4       // Signal strength (security)

This enhanced visual reference guide provides immediate troubleshooting support with visual indicators, standardized examples, and copy-paste ready command sequences for efficient NORA-W36 development and deployment.

C.1 Python XMODEM implementation

This Python XMODEM sender implementation has been tested with real NORA-W36 hardware for firmware updates:


#!/usr/bin/env python3
"""
XMODEM Sender for NORA-W36 Firmware Updates
===========================================
Simple and tested XMODEM-1K sender for NORA-W36 firmware updates.
Includes robust error handling and buffer management.
Usage: python xmodem.py COM3 NORA-W36X-SW-3.1.0-150.bin [115200]
"""
import serial
import time
import struct
import os
import sys
class XModemSender:
    # XMODEM Protocol Constants
    SOH = 0x01  # Start of Header (128-byte blocks)
    STX = 0x02  # Start of Text (1K blocks)
    EOT = 0x04  # End of Transmission
    ACK = 0x06  # Acknowledge
    NAK = 0x15  # Negative Acknowledge
    CAN = 0x18  # Cancel
    C   = 0x43  # Request CRC mode ('C')
    def __init__(self, port, baudrate=115200):
        self.serial = serial.Serial(port, baudrate, timeout=15)
        self.debug = True
    def send_file(self, filename):
        """Send file using XMODEM-1K protocol"""
        if not os.path.exists(filename):
            print(f"Error: File '{filename}' not found")
            return False
        file_size = os.path.getsize(filename)
        block_size = 1024  # Always use XMODEM-1K for firmware
        total_blocks = (file_size + block_size - 1)    // block_size
        print(f"Sending file: {filename}")
        print(f"File size: {file_size} bytes")
        print(f"Total blocks: {total_blocks}")
        print("Protocol: XMODEM-1K with CRC-16")
        # Wait for receiver ready signal
        if not self._wait_for_start():
            return False
        # Send all blocks
        with open(filename, 'rb') as f:
            block_number = 1
            for block_index in range(total_blocks):
                data = f.read(block_size)
                if len(data) < block_size:
                    data += b'\x1A' * (block_size - len(data))  # Pad with SUB
                if not self._send_block(block_number, data):
                    print(f"Error: Failed to send block {block_number}")
                    return False
                progress = (block_index + 1) * 100    // total_blocks
                print(f"Progress: {progress}% ({block_index + 1}/{total_blocks} blocks)")
                # Increment block number with natural 8-bit wraparound
                block_number = (block_number + 1) % 256
        # Send End of Transmission
        print("Sending end of transmission...")
        return self._send_eot()
    def _wait_for_start(self):
        """Wait for receiver ready signal"""
        print("Waiting for receiver ready signal...")
        # Clear buffers
        self.serial.reset_input_buffer()
        self.serial.reset_output_buffer()
        for attempt in range(60):  # 60 second timeout
            char = self.serial.read(1)
            if char == bytes([self.C]):
                print("Receiver ready (CRC mode)")
                return True
            elif char == bytes([self.NAK]):
                print("Receiver ready (checksum mode)")
                return True
            elif char == bytes([self.CAN]):
                print("Transfer cancelled by receiver")
                return False
            elif char:
                if self.debug:
                    print(f"Unexpected response: {char.hex()}")
                time.sleep(0.1)
                self.serial.reset_input_buffer()
            time.sleep(1)
        print("Timeout waiting for receiver")
        return False
    def _send_block(self, block_num, data):
        """Send a single XMODEM-1K block with retries"""
        block_complement = (~block_num) & 0xFF  # Bitwise complement for XMODEM protocol
        for retry in range(10):
            # Build block: STX + block_num + complement + data + CRC16
            block = bytes([self.STX, block_num, block_complement]) + data
            crc = self._calculate_crc16(data)
            block += struct.pack('>H', crc)
            # Send block
            self.serial.write(block)
            self.serial.flush()
            # Special timing for bootloader
            if block_num == 2:
                time.sleep(0.5)
            # Wait for response
            response = self.serial.read(1)
            if response == bytes([self.ACK]):
                if self.debug:
                    print(f"Block {block_num} acknowledged")
                return True
            elif response == bytes([self.NAK]):
                if self.debug:
                    print(f"Block {block_num} NAK, retrying...")
                time.sleep(0.1)
                self.serial.reset_input_buffer()
                continue
            elif response == bytes([self.CAN]):
                print("Transfer cancelled by receiver")
                return False
            else:
                if self.debug and response:
                    print(f"Unexpected response: {response.hex()}")
                time.sleep(0.1)
                self.serial.reset_input_buffer()
                continue
        print(f"Block {block_num} failed after 10 retries")
        return False
    def _send_eot(self):
        """Send End of Transmission"""
        for attempt in range(10):
            self.serial.write(bytes([self.EOT]))
            self.serial.flush()
            response = self.serial.read(1)
            if response == bytes([self.ACK]):
                print("Transfer completed successfully!")
                return True
            time.sleep(1)
        print("Failed to get EOT acknowledgment")
        return False
    def _calculate_crc16(self, data):
        """Calculate CRC-16 for XMODEM (CCITT polynomial 0x1021)"""
        crc = 0x0000
        for byte in data:
            crc ^= byte << 8
            for _ in range(8):
                if crc & 0x8000:
                    crc = (crc << 1) ^ 0x1021
                else:
                    crc <<= 1
                crc &= 0xFFFF
        return crc
def nora_firmware_update(port, firmware_file, baudrate=115200):
    """Update NORA-W36 firmware using XMODEM-1K"""
    print("NORA-W36 Firmware Update Tool")
    print("=" * 40)
    try:
        # Step 1: Send AT command to enter XMODEM mode
        print("Connecting to NORA-W36...")
        at_serial = serial.Serial(port, 115200, timeout=5)
        print(f"Entering XMODEM mode at {baudrate} baud...")
        at_serial.write(f"AT+USYFWUS={baudrate}\r".encode())
        response = at_serial.read(100)
        if b"OK" not in response:
            print(f"Warning: Unexpected response: {response}")
        time.sleep(2)
        at_serial.close()
        time.sleep(0.5)
        # Step 2: Transfer firmware using XMODEM-1K
        print(f"Starting XMODEM-1K transfer at {baudrate} baud...")
        xmodem = XModemSender(port, baudrate)
        if xmodem.send_file(firmware_file):
            print("\nFirmware update completed successfully!")
            # Step 3: Check new firmware version
            print("Checking firmware version...")
            time.sleep(5)
            for attempt in range(6):
                try:
                    check_serial = serial.Serial(port, 115200, timeout=5)
                    check_serial.write(b"AT+GMR\r")
                    time.sleep(1)
                    response = check_serial.read(200)
                    check_serial.close()
                    if response and b"OK" in response:
                        version_lines = response.decode('utf-8', errors='ignore').strip().split('\n')
                        for line in version_lines:
                            if line.strip() and line.strip() != 'OK' and not line.startswith('AT'):
                                print(f"Firmware version: {line.strip()}")
                                return True
                        break
                except Exception:
                    print(f"Module restarting (attempt {attempt + 1}/6)...")
                    if attempt < 5:
                        time.sleep(5)
            return True
        else:
            print("Firmware update failed!")
            return False
    except Exception as e:
        print(f"Error: {e}")
        return False
def main():
    if len(sys.argv) < 3:
        print("XMODEM Sender for NORA-W36 Firmware Updates")
        print("Usage: python xmodem.py <port> <firmware_file> [baud_rate]")
        print("")
        print("Examples:")
        print("  python xmodem.py COM3 NORA-W36X-SW-3.1.0-150.bin")
        print("  python xmodem.py COM3 NORA-W36X-SW-3.1.0-150.bin 115200")
        return 1
    port = sys.argv[1]
    firmware_file = sys.argv[2]
    baudrate = int(sys.argv[3]) if len(sys.argv) > 3 else 115200
    success = nora_firmware_update(port, firmware_file, baudrate)
    return 0 if success else 1
if __name__ == '__main__':
    sys.exit(main())

Usage:


python xmodem.py COM3 NORA-W36X-SW-3.1.0-150.bin 115200

---

C.2 C XMODEM implementation

This simplified C XMODEM sender provides the same functionality as the Python version with Windows-native serial port handling:


/**
 * @file xmodem.c
 * @brief XMODEM Sender for NORA-W36 Firmware Updates
 *
 * Simple XMODEM-1K sender tested with real NORA-W36 hardware.
 * Includes robust error handling and buffer management.
 *
 * Compilation:
 *   GCC/MinGW:  gcc -o xmodem xmodem.c -lkernel32
 *   Visual Studio: cl /Fe:xmodem.exe xmodem.c kernel32.lib
 *
 * Directory listing: ls (Linux/macOS) or dir (Windows)
 * Usage: xmodem.exe COM3 NORA-W36X-SW-3.1.0-150.bin [115200]
 */
#include <windows.h>
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include <stdlib.h>
// XMODEM Protocol Constants
#define SOH 0x01         // Start of Header (128-byte blocks)
#define STX 0x02         // Start of Text (1K blocks)
#define EOT 0x04         // End of Transmission
#define ACK 0x06         // Acknowledge
#define NAK 0x15         // Negative Acknowledge
#define CAN 0x18         // Cancel
#define SUB 0x1A         // Padding character
#define C_CHAR 0x43      // Request CRC mode ('C')
#define BLOCK_SIZE 1024
#define MAX_RETRIES 10
#define TIMEOUT_MS 3000
static uint16_t calculate_crc16(const uint8_t* data, size_t length) {
    uint16_t crc = 0x0000;
    for (size_t i = 0; i < length; i++) {
        crc ^= (uint16_t)data[i] << 8;
        for (int j = 0; j < 8; j++) {
            crc = (crc & 0x8000) ? (crc << 1) ^ 0x1021 : (crc << 1);
        }
    }
    return crc;
}
static bool serial_write(HANDLE hSerial, const uint8_t* data, size_t length) {
    DWORD bytesWritten;
    if (!WriteFile(hSerial, data, (DWORD)length, &bytesWritten, NULL)) {
        return false;
    }
    FlushFileBuffers(hSerial);
    return bytesWritten == length;
}
static bool serial_read_byte(HANDLE hSerial, uint8_t* byte, DWORD timeout_ms) {
    COMMTIMEOUTS timeouts = {0};
    timeouts.ReadIntervalTimeout = timeout_ms;
    timeouts.ReadTotalTimeoutConstant = timeout_ms;
    SetCommTimeouts(hSerial, &timeouts);
    DWORD bytesRead;
    return ReadFile(hSerial, byte, 1, &bytesRead, NULL) && bytesRead == 1;
}
static void serial_flush_input(HANDLE hSerial) {
    PurgeComm(hSerial, PURGE_RXCLEAR);
}
static char* format_port_name(const char* port_name) {
    static char formatted_name[256];
    // Check if already formatted or if it's a low COM port
    if (strncmp(port_name, "\\\\.\\", 4) == 0) {
        strcpy_s(formatted_name, sizeof(formatted_name), port_name);
        return formatted_name;
    }
    // For COM ports 1-9, use simple format
    if (strlen(port_name) == 4 && strncmp(port_name, "COM", 3) == 0 &&
        port_name[3] >= '1' && port_name[3] <= '9') {
        strcpy_s(formatted_name, sizeof(formatted_name), port_name);
        return formatted_name;
    }
    // For COM10 and higher, use Windows extended format
    if (strncmp(port_name, "COM", 3) == 0) {
        snprintf(formatted_name, sizeof(formatted_name), "\\\\.\\%s", port_name);
        return formatted_name;
    }
    // For other formats, assume it's correct
    strcpy_s(formatted_name, sizeof(formatted_name), port_name);
    return formatted_name;
}
static bool wait_for_start_signal(HANDLE hSerial) {
    printf("Waiting for receiver ready signal...\n");
    serial_flush_input(hSerial);
    uint8_t byte;
    DWORD start_time = GetTickCount();
    while ((GetTickCount() - start_time) < 60000) {    // 60 second timeout
        if (serial_read_byte(hSerial, &byte, 1000)) {
            if (byte == C_CHAR) {
                printf("Receiver ready (CRC mode)\n");
                return true;
            } else if (byte == NAK) {
                printf("Receiver ready (checksum mode)\n");
                return true;
            } else if (byte == CAN) {
                printf("Transfer cancelled by receiver\n");
                return false;
            } else {
                printf("Unexpected response: 0x%02X\n", byte);
                Sleep(100);
                serial_flush_input(hSerial);
            }
        }
    }
    printf("Timeout waiting for start signal\n");
    return false;
}
static bool send_block(HANDLE hSerial, uint8_t block_num, const uint8_t* data) {
    uint8_t block[3 + BLOCK_SIZE + 2];       // Header + data + CRC
    uint8_t block_complement = ~block_num;    // Bitwise complement for XMODEM protocol
    // Build block: STX + block_num + complement + data + CRC16
    block[0] = STX;
    block[1] = block_num;
    block[2] = block_complement;
    memcpy(&block[3], data, BLOCK_SIZE);
    uint16_t crc = calculate_crc16(data, BLOCK_SIZE);
    block[3 + BLOCK_SIZE] = (crc >> 8) & 0xFF;
    block[4 + BLOCK_SIZE] = crc & 0xFF;
    // Send block with retries
    for (int retry = 0; retry < MAX_RETRIES; retry++) {
        printf("[XMODEM] Sending block %u, try %d\n", block_num, retry + 1);
        if (!serial_write(hSerial, block, sizeof(block))) {
            printf("[XMODEM] Failed to write block %u\n", block_num);
            continue;
        }
        // Special timing for bootloader
        if (block_num == 2) {
            Sleep(500);
        }
        // Wait for response
        uint8_t response;
        if (serial_read_byte(hSerial, &response, TIMEOUT_MS)) {
            printf("[XMODEM] Received response: 0x%02X\n", response);
            if (response == ACK) {
                printf("[XMODEM] Block %u acknowledged\n", block_num);
                // Clear any additional bytes that might be in the buffer
                Sleep(50);
                serial_flush_input(hSerial);
                return true;
            } else if (response == NAK) {
                printf("[XMODEM] NAK received for block %u, retrying...\n", block_num);
                Sleep(100);
                serial_flush_input(hSerial);
                continue;
            } else if (response == CAN) {
                printf("[XMODEM] Cancelled by receiver\n");
                return false;
            } else {
                printf("[XMODEM] Unexpected response 0x%02X", response);
                // Read and display any additional bytes in buffer for debugging
                uint8_t extra_byte;
                int extra_count = 0;
                printf(" - Additional bytes: ");
                while (serial_read_byte(hSerial, &extra_byte, 100) && extra_count < 10) {
                    printf("0x%02X ", extra_byte);
                    extra_count++;
                }
                printf("\n");
                Sleep(200);
                serial_flush_input(hSerial);
                continue;
            }
        } else {
            printf("[XMODEM] Timeout waiting for response\n");
            Sleep(100);
            serial_flush_input(hSerial);
        }
    }
    printf("[XMODEM] Failed after %d retries for block %u\n", MAX_RETRIES, block_num);
    return false;
}
static bool send_eot(HANDLE hSerial) {
    printf("[XMODEM] Sending EOT\n");
    for (int attempt = 0; attempt < MAX_RETRIES; attempt++) {
        uint8_t eot = EOT;
        if (!serial_write(hSerial, &eot, 1)) {
            printf("[XMODEM] Failed to send EOT\n");
            continue;
        }
        uint8_t response;
        if (serial_read_byte(hSerial, &response, TIMEOUT_MS)) {
            if (response == ACK) {
                printf("[XMODEM] Transfer completed successfully\n");
                return true;
            } else {
                printf("[XMODEM] Unexpected EOT response: 0x%02X\n", response);
            }
        } else {
            printf("[XMODEM] Timeout waiting for EOT response\n");
        }
        Sleep(1000);
    }
    printf("[XMODEM] Failed to get EOT acknowledgment\n");
    return false;
}
static bool xmodem_send_file(HANDLE hSerial, const char* filename) {
    FILE* file = fopen(filename, "rb");
    if (!file) {
        printf("Error: Could not open file '%s'\n", filename);
        return false;
    }
    // Get file size
    fseek(file, 0, SEEK_END);
    long file_size = ftell(file);
    fseek(file, 0, SEEK_SET);
    size_t total_blocks = (file_size + BLOCK_SIZE - 1) / BLOCK_SIZE;
    printf("Sending file: %s\n", filename);
    printf("File size: %ld bytes\n", file_size);
    printf("Total blocks: %zu\n", total_blocks);
    printf("Protocol: XMODEM-1K with CRC-16\n");
    // Wait for receiver ready
    if (!wait_for_start_signal(hSerial)) {
        fclose(file);
        return false;
    }
    // Send all blocks
    uint8_t block_num = 1;
    uint8_t data_buffer[BLOCK_SIZE];
    for (size_t block_index = 0; block_index < total_blocks; block_index++) {
        // Read and pad block
        memset(data_buffer, SUB, BLOCK_SIZE);
        size_t bytes_read = fread(data_buffer, 1, BLOCK_SIZE, file);
        if (bytes_read == 0 && block_index < total_blocks - 1) {
            printf("Error: Unexpected end of file\n");
            fclose(file);
            return false;
        }
        // Send block
        if (!send_block(hSerial, block_num, data_buffer)) {
            printf("Error: Failed to send block %u\n", block_num);
            fclose(file);
            return false;
        }
        // Progress indicator
        printf("Progress: %zu%% (%zu/%zu blocks)\n",
               (block_index + 1) * 100 / total_blocks,
               block_index + 1, total_blocks);
        // Increment block number with natural 8-bit wraparound
        block_num = (block_num + 1) % 256;
    }
    fclose(file);
    return send_eot(hSerial);
}
static HANDLE init_serial_port(const char* port_name, DWORD baud_rate) {
    const char* formatted_port = format_port_name(port_name);
    printf("Opening serial port: %s\n", formatted_port);
    HANDLE hSerial = CreateFile(formatted_port, GENERIC_READ | GENERIC_WRITE, 0, NULL,
                               OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
    if (hSerial == INVALID_HANDLE_VALUE) {
        printf("Error: Could not open serial port %s (tried %s)\n", port_name, formatted_port);
        DWORD error = GetLastError();
        printf("Windows error code: %lu\n", error);
        return INVALID_HANDLE_VALUE;
    }
    // Configure serial port
    DCB dcbSerialParams = {0};
    dcbSerialParams.DCBlength = sizeof(dcbSerialParams);
    GetCommState(hSerial, &dcbSerialParams);
    dcbSerialParams.BaudRate = baud_rate;
    dcbSerialParams.ByteSize = 8;
    dcbSerialParams.StopBits = ONESTOPBIT;
    dcbSerialParams.Parity = NOPARITY;
    dcbSerialParams.fDtrControl = DTR_CONTROL_ENABLE;
    dcbSerialParams.fRtsControl = RTS_CONTROL_ENABLE;
    if (!SetCommState(hSerial, &dcbSerialParams)) {
        printf("Error: Could not configure serial port\n");
        CloseHandle(hSerial);
        return INVALID_HANDLE_VALUE;
    }
    return hSerial;
}
static bool nora_firmware_update(const char* port_name, const char* firmware_file, DWORD baud_rate) {
    printf("NORA-W36 Firmware Update Tool\n");
    printf("========================================\n");
    // Step 1: Send AT command to enter XMODEM mode
    printf("Connecting to NORA-W36...\n");
    HANDLE hSerial = init_serial_port(port_name, 115200);
    if (hSerial == INVALID_HANDLE_VALUE) {
        return false;
    }
    printf("Entering XMODEM mode at %lu baud...\n", baud_rate);
    char at_command[32];
    snprintf(at_command, sizeof(at_command), "AT+USYFWUS=%lu\r", baud_rate);
    if (!serial_write(hSerial, (uint8_t*)at_command, strlen(at_command))) {
        printf("Error: Failed to send AT command\n");
        CloseHandle(hSerial);
        return false;
    }
    uint8_t response[100];
    DWORD bytes_read = 0;
    Sleep(500);
    ReadFile(hSerial, response, sizeof(response) - 1, &bytes_read, NULL);
    response[bytes_read] = '\0';
    if (strstr((char*)response, "OK") == NULL) {
        printf("Warning: Unexpected response: %s\n", response);
    }
    Sleep(2000);
    CloseHandle(hSerial);
    Sleep(500);
    // Step 2: Transfer firmware using XMODEM-1K
    printf("Starting XMODEM-1K transfer at %lu baud...\n", baud_rate);
    hSerial = init_serial_port(port_name, baud_rate);
    if (hSerial == INVALID_HANDLE_VALUE) {
        return false;
    }
    bool success = xmodem_send_file(hSerial, firmware_file);
    CloseHandle(hSerial);
    if (success) {
        printf("\nFirmware update completed successfully!\n");
        // Step 3: Check firmware version
        printf("Checking firmware version...\n");
        Sleep(5000);
        for (int attempt = 0; attempt < 6; attempt++) {
            hSerial = init_serial_port(port_name, 115200);
            if (hSerial != INVALID_HANDLE_VALUE) {
                if (serial_write(hSerial, (uint8_t*)"AT+GMR\r", 7)) {
                    Sleep(1000);
                    if (ReadFile(hSerial, response, sizeof(response) - 1, &bytes_read, NULL) && bytes_read > 0) {
                        response[bytes_read] = '\0';
                        if (strstr((char*)response, "OK")) {
                            char* context = NULL;
                            char* lines = strtok_s((char*)response, "\n\r", &context);
                            while (lines != NULL) {
                                if (strlen(lines) > 0 && strcmp(lines, "OK") != 0 && strncmp(lines, "AT", 2) != 0) {
                                    printf("Firmware version: %s\n", lines);
                                    CloseHandle(hSerial);
                                    return true;
                                }
                                lines = strtok_s(NULL, "\n\r", &context);
                            }
                        }
                    }
                }
                CloseHandle(hSerial);
            }
            printf("Module restarting (attempt %d/6)...\n", attempt + 1);
            if (attempt < 5) Sleep(5000);
        }
    } else {
        printf("\nFirmware update failed!\n");
    }
    return success;
}
int main(int argc, char* argv[]) {
    if (argc < 3) {
        printf("XMODEM Sender for NORA-W36 Firmware Updates\n");
        printf("Usage: %s <port> <firmware_file> [baud_rate]\n", argv[0]);
        printf("\n");
        printf("Examples:\n");
        printf("  %s COM3 NORA-W36X-SW-3.1.0-150.bin\n", argv[0]);
        printf("  %s COM3 NORA-W36X-SW-3.1.0-150.bin 115200\n", argv[0]);
        return 1;
    }
    const char* port_name = argv[1];
    const char* firmware_file = argv[2];
    DWORD baud_rate = (argc > 3) ? atol(argv[3]) : 115200;
    bool success = nora_firmware_update(port_name, firmware_file, baud_rate);
    return success ? 0 : 1;
}

Compilation and Usage:


# Compile with GCC/MinGW
gcc -o xmodem xmodem.c -lkernel32
# Compile with Visual Studio
cl /Fe:xmodem.exe xmodem.c kernel32.lib
# Check directory contents
dir  // Windows
ls   // Linux/macOS
# Use with NORA-W36X-SW-3.1.0-150.bin firmware
xmodem.exe COM3 NORA-W36X-SW-3.1.0-150.bin

Key Features:

  • Same Interface: Uses identical arguments as Python version (port, firmware_file, baud_rate)
  • Focused Implementation: Supports NORA-W36 firmware updates
  • Windows API: Native Windows serial port handling with proper buffer management
  • Proven Protocol: XMODEM-1K with CRC-16 error detection
  • Real-World Tested: Successfully transferred 1.38MB firmware files
  • COM Port Support: Automatic handling of high-numbered COM ports (COM10+)