OP-BTS Python Script Usage Guide & Tool Reference


OP-BTS Python Script Usage Guide & Tool Reference

1. Script Execution Rules

OP-BTS devices only run compiled .py.o bytecode files. Raw .py source cannot be executed on the device. Always compile your scripts before deployment.

2. Uploading Scripts (OP Manager)

Tool Overview

OP Manager is a mobile management app for iOS and Android. Use it to connect to OP-BTS devices, upload compiled .py.o scripts, configure device parameters, manage Bluetooth connections, and view device information.

Download

Official download page: OP Manager

Tip: OP Manager is available on the App Store and Google Play. Search for the latest version in your app store.

Quick Workflow

  1. Open OP Manager and scan for the target OP-BTS device over Bluetooth, then connect.
  2. Open the device management screen and find Document Upload.
  3. Select a locally compiled .py.o script and upload it.
  4. After a successful upload, view and run the script on the device.

3. Compiling & Debugging Scripts (OP File Manager)

Tool Overview

For compiling, testing, and batch-managing Python source code, use the Windows-only OP-BT/BTS File Manager (MAUI edition). It supports source compilation, bidirectional file transfer, Python script execution and debugging, and communication monitoring—making it the core tool for script development and testing.

Download

User manual and software download: OP File Manager User Guide

Core Workflow

  1. Install and launch OP File Manager, then connect to the OP-BTS device via Serial or Bluetooth BLE.
  2. In the local file panel on the left, select a .py source file and use Compile to generate the corresponding .py.o bytecode file.
  3. Upload the compiled .py.o file to the device /py directory.
  4. Select the .py.o file on the device side and click Run to debug the script.
  5. Once debugging is complete, use OP Manager to distribute scripts to multiple devices in the field.

4. Full Script Development Reference

For OP-BTS-specific Python syntax, device APIs, standard libraries, interactive mode, troubleshooting, and other development details, see the official script manual:

OP-BTS Script Programming Guide

The manual covers environment setup, code examples, hardware interface calls, and fault diagnosis. We recommend reading it before you start development.

5. Example Scripts Download

We provide a sample script pack for common OP-BTS scenarios: IEC1107 meter reading, ANSI login, and device status checks. The archive includes both .py source files and compiled .py.o bytecode. Upload a .py.o file directly to the device /py directory, or open the .py source in OP File Manager to learn, modify, and recompile.

Download example scripts (scripts-examples.zip)

Script Description
e650-serial.py Read E650 meter serial number via IEC1107 (300 bps identify + ACK switch to 9600) and display on LCD
e650-date.py IEC1107 read: identify model, switch to 9600, parse 90()/11()/12() for serial, time, and date; LCD display
wasion.py WASION meter ANSI C12.18 login and model read; logs to /py/meter_read.txt
unlock.py Check device unlock status and show result on LCD

Each .py file includes a matching compiled .py.o file ready to use after extraction.

6. Tool Summary

Tool Platform Primary Use Best For
OP Manager iOS, Android Device connection, .py.o script upload, device configuration Deploying finished scripts, field maintenance, day-to-day device management
OP File Manager Windows Source compilation, script debugging, file management, communication monitoring Script development, code testing, batch compilation

Additional Notes

  1. All scripts uploaded to the device must be stored in the /py directory. Scripts in other locations will not run correctly.
  2. Compilation depends on op-py-compile.exe. If compilation fails, verify that the tool is in the software installation directory or on the system PATH.
  3. For Bluetooth connections, keep the device within 1–2 meters of the terminal. A signal strength better than -65 dBm helps ensure stable transfers.