Technical reference

TPUNB module integration guide

How to bring a TPUNB module up on your own board: power-on and join, the three operating modes, UART data exchange, and FOTA from the host MCU. Written for the host controller — the MCU that drives the module over the AT port.

Applies to most TPUNB modules. Electrical limits, pinout and package dimensions are module-specific: take those from the product page or the module datasheet.

Host interface
UART, 115200 8N1 (AT port)
Wake from sleep
under 10 ms
AT command timeout
5 s
Uplink send timeout
72 s
Join timeout, no signal
15 min, then sleep
Join timeout, signal present
30 min, retry on next heartbeat
Sleep current, Type A
about 2 µA
Downlink latency, Type C
within 2 s

Before you power it up

  • Do not power a module with no antenna connected. The RF port must be terminated before power is applied.
  • For outdoor installations, protect the antenna connector, the power input and any Ethernet port against surge and water ingress.
  • Operate within local radio spectrum regulations — the band, the duty cycle and the output power are all governed locally.

On arrival, check the packaging for damage, inspect the housing, confirm the nameplate model matches the order, and check the packing list against what was delivered. Faults found at this stage are a shipping claim, not a support case.

Interface and timing

The host talks to the module over a single AT serial port. These are the numbers to design your state machine around.

Host interface and timeouts, as specified for current TPUNB modules
ItemValue
Host interfaceUART, 115200 8N1 (AT port)
Wake from sleepunder 10 ms
AT command timeout5 s
Uplink send timeout72 s
Join timeout, no signal15 min, then sleep
Join timeout, signal present30 min, retry on next heartbeat
Sleep current, Type Aabout 2 µA
Downlink latency, Type Cwithin 2 s

Your MCU must tolerate the 72 s uplink timeout without resetting. If your watchdog is set shorter than that, feed it while a send is in flight.

Power-on and join

A module joins the network in one of two ways, and the difference is who owns the timeout. In automatic mode the module searches on its own after local initialisation and the host only polls the result. In manual mode the host decides when the search happens.

Automatic versus manual join
Automatic (default)Manual
How it is setDefault after resetAT+NCONFIG=AUTOCONNECT,FALSE, then reboot
Search startsAutomatically after local initWhen the host raises WAKE and sends the join command
Who controls the timeoutThe module (fixed)The host, by pulling WAKE low
Query at runtimeAT+NCONFIG? returns +NCONFIG:AUTOCONNECT,TRUEAT+NCONFIG? returns +NCONFIG:AUTOCONNECT,FALSE
Best forSimple devices that only need to poll join stateBattery devices that must not burn current searching

Manual mode is set once and persists across reboots:

+++                              // enter AT mode
OK
AT+NCONFIG=AUTOCONNECT,FALSE     // manual join, effective after reboot
OK
AT+NCONFIG?                      // verify
+NCONFIG:AUTOCONNECT,FALSE
OK

After a reboot in manual mode the module initialises and goes to sleep. Raising WAKE and sending the join command starts the search; pulling WAKE low again stops it immediately and the module sleeps. That is the whole reason to choose manual mode: a failed search costs you milliamps for as long as you allow it, not for a fixed fifteen minutes.

Join timeouts are asymmetric. With no signal at all the module gives up after 15 minutes and sleeps; when a signal is present but the join does not complete, it waits 30 minutes and then retries on the next heartbeat cycle. If a send later fails, query the join state before retrying the payload — an offline module will keep failing otherwise.

Operating modes

Three modes cover the whole design space, and they differ in one thing: what the receiver is doing while the device is idle. Choose the mode from the downlink requirement, not from the uplink one.

Mode summary; after a successful join the platform assigns the mode
ModeBehaviourDetailFits
DefaultNo dedicated mode yetAfter power-on the module waits to join. On join timeout it sleeps. Once joined, the platform assigns the working mode.Every module, right after reset
Type ASend first, then listenHost wakes the module, the module transmits, then listens for 8 frame periods. Downlink is only possible inside that window. If data arrives, the window is extended.Water meters, buried pipe sensors — reporting once a month or less
Type CPeriodic listen, air wakeThe module wakes every T1 and listens for T2. A wake frame addressed to the node brings up the host MCU through the RING pin, then the steps are Type A's 2–5.Control terminals that need occasional downlink
Type DReceive always onThe receive window stays open; it only closes briefly while transmitting. Any frame can be sent at any time.Mains-powered control terminals, burst reports where latency matters
Type A duty cycle TYPE A · SEND FIRST, THEN LISTENSleep≈ 2 µA, radio offWakehost pulls WAKE highTransmitradio on, uplink sentListen: 8 frame periodsdownlink windowwakedoneSENTdata received → extend by N windowsno downlink in the window → radio off, back to sleepThe gateway can only reach the node inside that window; everything else waits for the next uplink.
Type A. The receiver opens only after an uplink, for eight frame periods. The gateway has that window to deliver a downlink; anything later waits for the next uplink.Swipe the diagram sideways to see all of it.
Type C air wake cycle TYPE C · PERIODIC LISTEN, AIR WAKESleep is interrupted every T1 to listen for T2; a wake frame addressed to this node brings the host up.Deep sleepradio offListen T2every T1 cycleWake frame?addressed to nodeRING wakes host MCUthen Type A steps 2–5T1matchno frame → sleepuplink / downlink done → back to deep sleepDownlink latency: within 2 s. Sleep current rises above Type A by the listening duty cycle.
Type C. The module wakes every T1 and listens for T2, so the gateway can reach an idle device by air. A matching wake frame brings the host MCU up through the RING pin.Swipe the diagram sideways to see all of it.
Type D always listening TYPE D · RECEIVE ALWAYS ONContinuous RXany frameTransmitRX window closed brieflyContinuous RXback in ~one framehost dataSENTNo sleep state. Mains-powered terminals, or devices that must react to a command within one frame.Typical users: control terminals, actuators, anything with unpredictable downlink traffic.
Type D. No sleep state: the receiver stays open and only closes while transmitting. Mains-powered control terminals use this mode.Swipe the diagram sideways to see all of it.

Sending and receiving

There are two ways to move payload through the module. In transparent mode whatever the host writes goes straight to the gateway with no header checks — which also means the host must leave AT mode first (AT+EXIT). In AT mode the host sends a framed command and reads framed events back. AT mode is the recommended path: you get a send result to log.

The downlink arrives as an ASCII event on the same port:

\r\n+NNMI:<length>,<hex>\r\n

// example: 11 bytes of payload
\r\n+NNMI:11,3A2F008105000001000087\r\n
  • Treat +NNMI as an interrupt, not a poll result — parse it out of the serial stream.
  • Retry interval for an unacknowledged payload: greater than 72 s, in both modes.
  • If the send fails, query the join state first, re-join if the module is offline, then send.
  • When many devices are powered the same day, stagger their reporting start from the moment each one joined. Otherwise the whole fleet reports on the same second and congests the channel.

An AT session

A typical bring-up, from entering AT mode to receiving a downlink. The module reportsjoined automatically after power-on; if the host misses that line,AT+JOIN? returns the current state.

+++                              // enter AT mode
OK
AT+JOIN?                         // query join state
joining
OK
AT+JOIN?
joined
OK

+++                              // enter AT mode
OK
AT+UNBSEND=13,03410800000000000000643C9A,1     // send 13 bytes
OK
1,SENT                                          // gateway confirms the uplink
OK
+NNMI:5,034108B056                              // downlink from the platform

Command names and the full parameter set change between firmware releases. This is a worked example, not the command reference — ask us for the current AT command manual before you freeze your host firmware.

Host MCU FOTA

The module can carry a firmware image for the host: it downloads and caches your upgrade file, then hands it to the host MCU over the same AT port. Four command codes drive the whole exchange.

FOTA command codes and the messages each one carries
CodeStepExchange
0x11Package available+NFWUPD:11,<total>,<verlen>,[<ver>],[<crc>] → host answers AT+NFWUPD=11,0 (allow) or 1 (refuse)
0x12Download complete+NFWUPD:12,<total> → host answers AT+NFWUPD=12,0 (accepted) or 1
0x13Host pulls the imageAT+NFWUPD=13,<offset>,<len> → module returns +NFWUPD:13,<offset>,<len>,<data>,<crc>
0x14Extract resultAT+NFWUPD=14,<result> → module returns +NFWUPD:14,0 (ok) or 1
Host MCU FOTA sequence HOST MCU FOTA · FOUR COMMAND CODESModuleHost MCUServer+NFWUPD:11,len,verlen,[ver],[crc] package availableAT+NFWUPD=11,0 allow (1 = refuse)download package+NFWUPD:12,len download complete5 s timeout · 3 retries · file held 10 minAT+NFWUPD=12,0 acceptedAT+NFWUPD=13,offset,len≤1024+NFWUPD:13,offset,len,data,crc16AT+NFWUPD=14,0 extract resultStep 13 repeats until the whole image is collected. CRC16 is modbus: poly 0xA001, init 0xFFFF, computed over the data field only.
FOTA exchange. The module pulls the image from the server, notifies the host, then serves it in slices of at most 1024 bytes, each with its own CRC.Swipe the diagram sideways to see all of it.
  • The download-complete notification times out after 5 s and is retried up to 3 times; the cached file is protected for at most 10 minutes.
  • Each pull returns at most 1024 bytes. Request by offset and length, and verify the CRC before writing flash.
  • CRC16 is modbus: polynomial 0xA001, initial value 0xFFFF, computed over the data field only.
  • An invalid command or parameter returns +NFWUPD:<code>,<ERROR>, <ERROR,1> for a bad command or <ERROR,2> for a bad parameter.
/* CRC16 modbus — the reference implementation from the module manual */
uint16_t crc16(uint8_t *data, uint16_t length)
{
    uint16_t crc = 0xFFFF;
    for (uint16_t i = 0; i < length; i++)
    {
        crc ^= data[i];
        for (uint16_t j = 0; j < 8; j++)
        {
            if (crc & 0x0001)
            {
                crc = (crc >> 1) ^ 0xA001;
            }
            else
            {
                crc = (crc >> 1);
            }
        }
    }
    return crc;
}

Power handling

In Type A sleep the module draws about 2 µA with the radio off: it is disconnected from the base station, receives nothing, and its cores are shut down. That is the trade — the lowest current in the family, and no way to be reached until the host wakes it.

Type C costs sleep current plus the listening duty cycle, because the receiver wakes every T1. Techphant measures that listening draw at under a third of an NB-IoT module's idle draw, which is why Type C is usually the right default for a battery device that also needs to be commanded.

Two practical points that come up in commissioning:

  • Shipping and storage. If the product cannot be switched off, cut module power from the host (an external trigger such as a magnet works), or set manual join so the module does not search on the shelf.
  • Shortening the listen window. You can ask the module to skip the remaining receive windows, but we do not recommend it: FOTA depends on that window, and the current saved is small. Keep the eight frame periods.

Replacing an NB-IoT module

A common question is whether a TPUNB module can drop into a board designed for an NB-IoT part such as the *C28 without touching the layout. Mechanically the footprint is close, electrically it is not a drop-in. Three changes matter:

  1. Voltage. The NB-IoT part runs at 3.6 V typical; TP1107 is 3.3 V typical with 3.6 V as the maximum. Check your rail under load.
  2. Footprint. Both are FCC-style packages with compatible edge pads, but TP1107 has no thermal pad underneath. If you keep the existing PCB, at minimum change the stencil: remove the centre pad opening, or paste will bridge under the module.
  3. SIM pins. TP1107 has no SIM interface; the pins that carried the SIM on the NB-IoT part become the SW download port. Remove the SIM-side components on those nets.

Where the layout allows it, design to the TP1107 specification rather than adapting an NB-IoT board. The adaptation above is for compatibility testing, not for a production release.

Questions that come back

Can a device roam between gateways?

Only between modules in the same gateway group. Roaming across unrelated gateways is not something the terminal can negotiate on its own.

Why does a stored device drain its battery?

Because it is still searching for a network. Either cut module power, or set manual join so the module stays asleep until a host or an installer wakes it.

How long does a join take to give up?

15 minutes with no signal, 30 minutes when a signal exists but the join does not complete. In manual mode the host owns that decision and can stop the search at any moment.

Is the AT port the only interface?

For host integration, yes — one UART at 115200 8N1 carries both commands and payload events. Pin-level details are in the module datasheet.

What this guide is based on

This page restates the technical content of the TPUNB module integration manual, version 5.7 (18 July 2023), in English and in the order an integrator needs it. The revision history of that document:

VersionDateChange
V5.22022-03-11First release
V5.32022-03-18Added Type C and Type D flows
V5.42022-03-22Corrected the data-exchange flowcharts
V5.52022-03-23Added hardware design Q&A
V5.62022-08-15Reworked the manual join and Type A/C flowcharts
V5.72023-07-18Added the FOTA chapter — the basis for this guide

Need the AT command reference, or a module to test against?

Send us the host MCU you are using, the band, and the downlink requirement. We will reply with the current AT command manual and, if the mode choice is not obvious from the above, a recommendation with the current budget worked out.