Documentation navigation

简体中文 · English

S30M-V1B network and serial installation

Start at Firmware & resources and choose the latest compatible release for your device with its matching checksums. Pinned versions below are reproducible examples; stated minimum versions, stock versions and migration-tool requirements still apply.

This guide covers the ORVIBO S30M-V1B, with a BL2028N module, BK7231N chip and HLW8032 meter. Network installation has been verified on stock 2M.1220. UART remains available for backups, installation and recovery. The default layout retains this unit’s original bootloader and factory MAC/RF; first installation starts with fresh community settings and requires Wi-Fi setup again. See S30M-V1B operation for use after installation.

On this page

Downloads

Select the latest compatible stable S30M-V1B release in Firmware & resources. If this model has no stable release, read the candidate notes before choosing a beta; another model's stable image is unsuitable. Obtain firmware and checksums from the same release:

Purpose Filename pattern
Stock network installation or community URL OTA BL2028N_OTA_<version>.rbl
UART installation preserving the stock bootloader; write at 0x11000 BL2028N_STOCK_UA_<version>.bin
Checksums SHA256SUMS or SHA256SUMS-S30 supplied for that release

Replace <version> with the downloaded release version and use the actual filename in Downloads. RC6 is not a fixed requirement. Compute the digest with sha256sum filename, macOS shasum -a 256 filename or PowerShell Get-FileHash filename -Algorithm SHA256, then compare the matching entry in that release's checksums.

The device version also includes a six-digit Git suffix. Community WebUI updates support URL download only: copy the selected RBL's actual direct URL from Downloads and follow URL OTA.

Choose an installation method

Current state Method File
Stock 2M.1220, already connected to the same reachable LAN Network installation below BL2028N_OTA_<version>.rbl
No network, damaged application, or a full backup is needed Open the enclosure and use UART BL2028N_STOCK_UA_<version>.bin at 0x11000

The web interface currently supports URL download only, not local file upload. Downloading a file to a computer does not make it available to the device. The default build does not emit QIO images containing another bootloader. A raw BL2028N_app_*.bin or UG package cannot replace the files above.

Network installation from stock firmware

Scope and prerequisites

Use this method for stock 2M.1220. The device must already be connected to Wi-Fi, reachable from the computer, and its factory MAC must be known. For other stock versions, use the UART procedure below.

The computer needs Python, paho-mqtt, a local HTTPS certificate and a dedicated temporary TLS MQTT broker. Plain MQTT did not complete connection on this stock version; mqtt:// is not a substitute for ssl://. Router DNS interception is unnecessary. Use temporary broker credentials and keep that broker off the public Internet.

The procedure redirects the stock device's CGW/cloud configuration to these test services. Community first boot uses fresh settings: stock accounts, Wi-Fi, MQTT, pairing and meter settings are not migrated. Record any settings that must be entered again.

Example local TLS MQTT service

On Linux/macOS, install Python, OpenSSL and Mosquitto. Work in a dedicated temporary directory. Replace 192.168.1.10 with the computer's reachable LAN address, not the device address.

python3 -m venv .venv
. .venv/bin/activate
python3 -m pip install paho-mqtt==2.1.0
OTA_HOST=192.168.1.10
openssl req -x509 -newkey rsa:2048 -nodes -days 1 \
  -keyout gateway-key.pem -out gateway-cert.pem \
  -subj "/CN=$OTA_HOST" -addext "subjectAltName=IP:$OTA_HOST"
mosquitto_passwd -c broker.passwd s30test
chmod 600 gateway-key.pem broker.passwd

Enter a dedicated test password when prompted. Create broker.conf, replacing each file path below with its absolute path:

listener 18892
allow_anonymous false
password_file /absolute/path/broker.passwd
certfile /absolute/path/gateway-cert.pem
keyfile /absolute/path/gateway-key.pem
persistence false

In another terminal run mosquitto -c broker.conf -v as the current user. Set mqtt.private.json to this computer's IP, port 18892, user s30test and the password you just created. Both --mqtt-ca and --cert may use gateway-cert.pem; --key uses gateway-key.pem. Keep the stock device connected to its existing Wi-Fi and allow the required device connections through the computer's firewall.

Run the local installation tool

Use s30_stock_ota.py, with corrected HTTP port handling and stock HTTPS response writes. The computer, stock device and broker IPv4 addresses must be mutually reachable. Allow TCP 15683 for HTTPS CGW, 80 for the firmware download, and the broker's selected port. Certificates must include their service IP; --mqtt-ca verifies the broker certificate on the computer.

The stock downloader requires ordinary HTTP port 80. Write the URL as http://computer-IP/s30.rbl, with no explicit :80 or other port. Port 80 must be available for the tool to listen on. HTTPS CGW and TLS MQTT keep their separate ports.

Prepare two private JSON files with mode 600; do not commit or publish them:

{"ssid":"Your 2.4 GHz Wi-Fi","password":"Wi-Fi password"}
{"host":"Temporary broker IPv4","port":18892,"username":"short-test-user","password":"short-test-password"}

MQTT usernames and passwords must each be 1–31 bytes. Use short addresses and dedicated test credentials.

On Linux, create a Python environment and run the tool with permission to bind port 80:

python3 -m venv .venv
.venv/bin/python -m pip install paho-mqtt==2.1.0

Download the matching RBL and SHA256SUMS-S30, verify them, replace <VERSION> with the version in the downloaded RBL filename, and replace the remaining placeholders:

mkdir -p tools
curl --fail --location https://raw.githubusercontent.com/phicomm-io/iotcloud-community-firmware/main/tools/s30_stock_ota.py -o tools/s30_stock_ota.py
chmod 600 wifi.private.json mqtt.private.json
grep "  BL2028N_OTA_<VERSION>.rbl$" SHA256SUMS-S30 | sha256sum -c -
sudo .venv/bin/python tools/s30_stock_ota.py \
  --device <stock-device-IP> --device-id <this-unit-12-digit-factory-MAC> \
  --host <computer-LAN-IP> \
  --wifi-file wifi.private.json --mqtt-file mqtt.private.json \
  --mqtt-ca gateway-cert.pem --cert gateway-cert.pem --key gateway-key.pem \
  --rbl 'BL2028N_OTA_<VERSION>.rbl' --sha256 <published-file-SHA256>

For an unconfigured stock unit, enter its CMQLINK-590513-XXXX AP. Reserve a target LAN IP for its factory STA MAC on the router and use that IP for --device. Connect the computer Wi-Fi to the stock AP while another interface keeps --host reachable on the target LAN; add --provision-address 192.168.188.1. The factory STA MAC differs from the AP BSSID. Set wifi.private.json to the 2.4 GHz network on this LAN.

The tool configures local HTTPS CGW using CoAP /qlink/netinfo. Stock firmware retrieves the temporary TLS MQTT connection over HTTPS, receives an AndLink file command, and downloads the RBL.

Confirm installation

  1. After complete HTTP delivery, keep power connected while the device installs and reboots.
  2. Join the community S30M_V1B_XXXXXX AP, open http://192.168.0.1, and configure Wi-Fi again.
  3. Open the assigned LAN IP. Confirm iotcloud · S30M-V1B, the selected version, outlet control and metering. An unset administration password must not trigger login.
  4. Stop the dedicated test broker and remove temporary certificates and credentials. Computer services are no longer needed; future upgrades use the community URL OTA interface.

If MQTT reports File but no HTTP request arrives, check that the firmware URL omits the port and port 80 is reachable. An invalid URL can leave this stock firmware busy for about 10 minutes; keep power connected and wait before trying again. If CoAP has no reply, check for HTTPS bootstrap, boot, dmReport and MQTT activity before provisioning again. If the stock provisioning interface has stopped responding, re-enter the stock AP before running the tool. Do not reset during firmware download or installation.

If the community AP is missing from a scan after startup, disconnect the computer Wi-Fi and scan again. If no download or community AP appears, retain the errors and follow the UART backup/recovery procedure below.

Disassembly and UART

Power and preparation

Unplug the socket from mains, disconnect the load and original power supply, and confirm power is off before opening it. Keep mains disconnected whenever the enclosure is open, the computer UART is connected, or flashing is in progress. Use a USB-to-TTL adapter with 3.3 V logic and a stable, separate, isolated 3.3 V DC supply. Do not apply 5 V to the module.

The adapter's 3.3 V output may not supply enough current when Wi-Fi starts, causing resets even after a successful flash. With a separate supply, leave the adapter's 3.3 V power wire disconnected. Retain TX, RX and GND, joining supply negative, adapter GND and device GND.

Obtain firmware and SHA256SUMS for this exact device and version, and verify the file first. Close serial applications such as minicom so that only the flashing tool owns the port. The examples use bk7231tools; replace /dev/ttyUSB0 with the actual port.

Contact locations and wiring

Look directly at the PCB on the plug side. At the outer upper-right edge, two contacts connect the power board to the MCU module: the left contact is GND and the right contact is 3V3. Use the board's VTX / VRX UART test points; some markings include a suffix, such as VTX1 / VRX1.

Device contact Connect to
VTX test point USB-to-TTL RXD
VRX test point USB-to-TTL TXD
Left contact of the pair at the outer upper-right, viewed from the plug side: GND Supply negative and USB-to-TTL GND
Right contact of the same pair: 3V3 Positive output of the separate isolated 3.3 V supply

Left and right apply only to that viewing direction. Check orientation and contacts before wiring; turning the PCB over reverses the view. VTX/VRX describe the device's signal direction, so cross TX and RX.

Make a full backup first

Start the tool and let it wait for a connection, then cycle the module's 3.3 V power, or briefly ground and release a positively identified CEN/RESET point. Keep the USB adapter connected. The socket's normal power button does not replace a chip reset.

The validated unit has 2 MiB of Flash, covering 0x000000 through 0x1fffff. Read it twice, resetting while each command waits, and keep the tool's default checksum verification enabled:

bk7231tools read_flash -d /dev/ttyUSB0 -b 115200 --timeout 60 -s 0 -l 0x200000 s30-stock-1.bin
bk7231tools read_flash -d /dev/ttyUSB0 -b 115200 --timeout 60 -s 0 -l 0x200000 s30-stock-2.bin
sha256sum s30-stock-1.bin s30-stock-2.bin
cmp s30-stock-1.bin s30-stock-2.bin

Both files must contain 2097152 bytes and have identical SHA-256 hashes. cmp must exit successfully with no output. Save both backups and hashes before writing. They contain this unit's MAC, RF parameters and possibly factory credentials; keep them private. Another unit's backup is not a substitute.

Select and write the image

The BL2028N unit validated here uses a zero-key bootloader. To retain that bootloader, use:

BL2028N_STOCK_UA_<version>.bin
Write start: 0x11000

STOCK_UA is the zero-key, CRC-framed application image for the stock layout. It ends at 0x132000 and includes the stock application footer, but contains no bootloader or unit-specific factory data. The chip remains BK7231N. Older BK7231M_UA packages use different partition/footer positions and are not interchangeable. If another bootloader was installed, restore and verify this unit’s backed-up boot area first: writing an application cannot replace it.

After verifying the firmware, replace the version placeholder below and run the command. Reset the module once the tool is waiting:

bk7231tools write_flash -d /dev/ttyUSB0 -b 115200 --timeout 60 -s 0x11000 -S 0 'BL2028N_STOCK_UA_<version>.bin'

Writing the UA application image at 0x11000 retains the unit's bootloader, factory RF/TLV and configuration tail. Do not erase the whole chip or substitute an .rbl, .UG.bin or another product's .ota.bin. QIO images include a bootloader and are not the default method in this section.

After the tool verifies the write, read the full Flash again and compare the written range with the UA file. Check that data outside that range, especially the bootloader and factory parameters, remains unchanged. On the validated unit, the RF/TLV sector is at 0x1e0000; preserve its valid factory MAC.

First boot and recovery

  1. After flashing, cycle the isolated 3.3 V supply and check for an AP named S30M_V1B_ followed by the last six MAC digits in uppercase hexadecimal.
  2. Connect and open http://192.168.0.1. Follow the operation guide, configure Wi-Fi, and confirm the model and version. Both the initial AP password and web administration password are empty.
  3. Power off, remove every UART and external supply wire, inspect the connection area, and restore the complete insulated enclosure before reconnecting the original power supply and load.

Test loads and metering after disconnecting the programmer, restoring full insulation and reassembly, and reconnecting the original power supply.

For handshake failures, check port ownership, crossed TX/RX, common ground, contact reliability, supply and reset timing. If the flashed unit will not boot, retain the backup and complete tool log, then check image, offset and bootloader key format. An interrupted previous OTA may require version-specific cleanup of pending upgrade data; do not try repeated whole-chip erases or another unit's RF/MAC data.

Subsequent community URL OTA

Subsequent updates are under common functions → updates. For first installation, choose stock network or UART above.