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.
| Item | Value |
|---|---|
| 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 |
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 (default) | Manual | |
|---|---|---|
| How it is set | Default after reset | AT+NCONFIG=AUTOCONNECT,FALSE, then reboot |
| Search starts | Automatically after local init | When the host raises WAKE and sends the join command |
| Who controls the timeout | The module (fixed) | The host, by pulling WAKE low |
| Query at runtime | AT+NCONFIG? returns +NCONFIG:AUTOCONNECT,TRUE | AT+NCONFIG? returns +NCONFIG:AUTOCONNECT,FALSE |
| Best for | Simple devices that only need to poll join state | Battery 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
OKAfter 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 | Behaviour | Detail | Fits |
|---|---|---|---|
| Default | No dedicated mode yet | After 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 A | Send first, then listen | Host 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 C | Periodic listen, air wake | The 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 D | Receive always on | The 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 |
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
+NNMIas 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 platformCommand 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.
| Code | Step | Exchange |
|---|---|---|
0x11 | Package available | +NFWUPD:11,<total>,<verlen>,[<ver>],[<crc>] → host answers AT+NFWUPD=11,0 (allow) or 1 (refuse) |
0x12 | Download complete | +NFWUPD:12,<total> → host answers AT+NFWUPD=12,0 (accepted) or 1 |
0x13 | Host pulls the image | AT+NFWUPD=13,<offset>,<len> → module returns +NFWUPD:13,<offset>,<len>,<data>,<crc> |
0x14 | Extract result | AT+NFWUPD=14,<result> → module returns +NFWUPD:14,0 (ok) or 1 |
- 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:
- 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.
- 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.
- 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:
| Version | Date | Change |
|---|---|---|
| V5.2 | 2022-03-11 | First release |
| V5.3 | 2022-03-18 | Added Type C and Type D flows |
| V5.4 | 2022-03-22 | Corrected the data-exchange flowcharts |
| V5.5 | 2022-03-23 | Added hardware design Q&A |
| V5.6 | 2022-08-15 | Reworked the manual join and Type A/C flowcharts |
| V5.7 | 2023-07-18 | Added 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.
