Skip to content

About

Unofficial native macOS (Apple Silicon) programmer for the Baofeng AR-152 Pro 1000-channel radio - CHIRP-style, USB cable

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

AR152 Programmer

An unofficial, native macOS programmer for the Baofeng AR-152 Pro (the 1000-channel model with Bluetooth). It runs natively on Apple Silicon and works much like CHIRP: read the radio, edit channels in a table, import or export CHIRP CSV files, and write the radio back.

The vendor programming software is Windows-only, and CHIRP can't talk to this radio (see Why not CHIRP?). This app is a small, careful alternative written in Swift. It uses Apple frameworks only, with no third-party dependencies.

Not affiliated with Baofeng. Use at your own risk. Read the safety notes before writing to a radio.

Status

Feature State
Read the full radio image Protocol verified on real radios with the reference tool; Swift app tested against a simulated radio
Write the full image (all 526 blocks) Protocol verified on real radios with the reference tool; Swift app tested against a simulated radio
Verify (read back and compare) Protocol verified on real radios with the reference tool; Swift app tested against a simulated radio
Channel editing: 1000 channels, frequency, offset, CTCSS/DCS, power H/M/L, NFM/FM, scan add, name Done
CHIRP generic CSV import and export Done, byte-compatible with the reference tool
Settings, VFO, DTMF and power-on text Preserved unchanged, not editable yet

The Swift code is checked byte for byte against golden fixtures produced by the reference Python tool (tools/ar152pro.py). That tool was itself verified on hardware.

Requirements: an Apple Silicon Mac running macOS 14 Sonoma or later.

Install

  1. Download AR152-Programmer-<version>-macOS-arm64.zip from the Releases page.
  2. Unzip it and move AR152 Programmer.app to /Applications.
  3. The app is ad-hoc signed, not notarized, so Gatekeeper blocks a normal double-click the first time. Do one of the following:
    • On macOS 14 Sonoma: right-click (or Control-click) the app, choose Open, then confirm with Open.
    • On macOS 15 Sequoia and later, Control-click > Open no longer works for apps that are not notarized. Double-click the app once (it is blocked), then go to System Settings > Privacy & Security and click Open Anyway.
    • Or clear the quarantine flag in Terminal:
      xattr -dr com.apple.quarantine "/Applications/AR152 Programmer.app"

Build from source

You need Xcode (or the Swift toolchain) with Swift 6 on Apple Silicon.

git clone <this repository>
cd AR152Programmer
swift test                       # unit and golden-fixture tests; no radio needed
scripts/build_app.sh             # -> dist/AR152 Programmer.app and dist/AR152-Programmer-0.1.0-macOS-arm64.zip
VERSION=0.2.0 scripts/build_app.sh

To run directly without packaging, use swift run AR152Programmer. AR152Programmer --version prints the version and exits without opening a window or any port.

scripts/build_app.sh builds a release arm64 binary, assembles the .app bundle, generates an icon (scripts/make_icon.sh; set NO_ICON=1 to skip it), ad-hoc signs the bundle, and zips it with ditto.

CI (.github/workflows/build.yml) runs the tests and the build on every push and pull request to main. For v* tags it also attaches the zip to a GitHub Release.

Usage

Cable

Use a K1 2-pin (Kenwood-style) USB programming cable. A CH340-based cable has been tested, and macOS needs no extra driver for it. The port shows up as /dev/cu.usbserial-* (or /dev/cu.wchusbserial*). Choose it in the app's port menu.

Serial settings are fixed at 115200 baud, 8N1, DTR and RTS on. You don't need to configure them.

Read, edit, write

  1. Power-cycle the radio (turn it off, then on) so it shows the normal channel screen. Plug in the cable firmly. A half-seated K1 plug is the most common cause of failure.
  2. Click Read. The app reads all 526 blocks and saves a backup automatically.
  3. Edit channels in the table, or Import a CHIRP CSV file.
  4. Power-cycle the radio again, then click Write. The app writes the complete image.
  5. Optionally, power-cycle once more and choose Radio > Verify (Read Back)… (or click Verify on the Write Complete sheet) to read the radio back and compare. Verify is available after a write in the same session.
  6. Power-cycle the radio when you're done.

Power-cycle the radio before every read, write or verify. The radio accepts one programming session per power cycle.

Backups and logs

  • Every successful read is saved as an image file (.img, 0x8380 bytes, the same packed layout CHIRP uses) in ~/Library/Application Support/AR152Programmer/Backups/ (Radio > Show Backups Folder). Backups are saved read-only with a .sha256 checksum file next to them, and the app will not save edited images into that folder. If a backup cannot be written, the read is not loaded. Keep your first factory backup somewhere safe.
  • Every serial session writes a hex log of every byte sent and received to ~/Library/Application Support/AR152Programmer/Logs/ (Radio > Show Logs Folder). If something goes wrong, that log is what you'll need to diagnose it.
  • To restore a backup, open the .img file (File > Open Image…) and write it to the radio. Verify reads the radio back and lists any channels or settings blocks that differ from what was written.

Safety

This tool is deliberately conservative. Here's how it protects the radio:

  • Full-image writes only. The radio erases a whole flash sector the first time a write touches it, so writing a single block wipes the neighbouring channels. That has happened on real hardware. The app always writes all 526 blocks in order, just like the vendor software.
  • The ident is sent once per session, with no automatic retries. The ident string ends in 0x55, which means "enter boot mode" to a radio that is already in programming mode. If the radio doesn't answer, power-cycle it and try again.
  • It never sends the boot or flash commands. A strict transmit allowlist (the TX gate) permits only the exact handshake frames, the 526 read frames in order, the end-session command after a complete read, and write frames for the 526 known addresses in order. It never sends 0x55, 0x10–0x13, 0x03, or anything else. Any unexpected reply stops the session.
  • Nothing is sent after a write. Power-cycle the radio afterwards.
  • Back up before writing. The app saves a backup on every read. When you write, only the channel area changes. Settings, VFO, DTMF and power-on text are written back exactly as read from your radio.

Command-line reference tool

tools/ar152pro.py is the original command-line implementation. It needs Python 3 and pyserial. It was verified on hardware and is the reference the Swift code is tested against.

python3 tools/ar152pro.py read --port /dev/cu.usbserial-XXXX      # backup -> tools/captures/
python3 tools/ar152pro.py decode IMAGE.img                          # list channels
python3 tools/ar152pro.py export IMAGE.img -o channels.csv          # image -> CHIRP CSV
python3 tools/ar152pro.py build channels.csv --base IMAGE.img -o new.img
python3 tools/ar152pro.py diff a.img b.img
python3 tools/ar152pro.py write new.img --base IMAGE.img --port /dev/cu.usbserial-XXXX --confirm
python3 tools/ar152pro.py verify new.img --port /dev/cu.usbserial-XXXX

Protocol

PROTOCOL.md covers the serial protocol, the handshake, the data scrambling, the block order and the full memory map (channel layout, tone encoding, settings areas).

Why not CHIRP?

The AR-152 Pro is closely related to radios that CHIRP supports through its baofeng_uv17Pro driver (UV-17Pro / UV-17ProGPS), but CHIRP doesn't work with it:

  • Model reply length. After the M command the radio answers with the 5 bytes AR152. CHIRP's UV-17ProGPS profile expects a 7-byte reply, so the handshake fails.
  • Three power levels. The AR-152 Pro stores power as 0 = High, 1 = Low, 2 = Mid. The related CHIRP profiles assume two levels.
  • Memory layout. There are 1000 channels in a 526-block image, plus the radio's sector-erase behaviour, which needs full-image writes.

A CHIRP driver could probably be added. This app is a standalone alternative in the meantime, and it reads and writes CHIRP's generic CSV format so you can move channel lists between the two.

Disclaimer

This project is not affiliated with, endorsed by, or supported by Baofeng or any of its distributors. "Baofeng" and "AR-152" are used only to identify compatible hardware.

This software is provided as is, without warranty of any kind. Writing to a radio can make it misbehave until you restore a backup. You use this tool at your own risk.

Obey your local radio regulations. You are responsible for transmitting only on frequencies, at power levels and with the licences that apply to you. In the US, for example, GMRS requires an FCC licence and has per-channel power limits, MURS is limited to 2 W, and FRS channels must not be used with a radio like this one. The ability to program a frequency into a radio does not mean you may transmit on it.

License

Released under the GNU General Public License v3.0.

Credits

  • The CHIRP project, especially the baofeng_uv17Pro driver. Its research on the UV-17Pro family protocol (handshake, key selection and scrambling) was the starting point for this work.
  • The radio's vendor programming software, which was studied for interoperability to confirm the AR-152 Pro specifics.

About

Unofficial native macOS (Apple Silicon) programmer for the Baofeng AR-152 Pro 1000-channel radio - CHIRP-style, USB cable

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages