# You and Your Tytera MD-380 DMR

## Overview

Hey everyone! It's me, ladyada! I recently got my Amateur Radio License ('HAM ticket') and I wanted to start out with a radio that's both inexpensive, easy to use, and fun to hack! After seeing some videos from CCC about the MD-380, I thought this radio is the one for me to start with.

Not only does this radio do FM analog on the 400MHz band, but it can also do DMR - _digital_ encoded radio! This gives you the ability to use an Internet-backed voice network with no static and huge world-wide repeater reach.

I'm just getting started on my HAM-venture but I thought I'd take some notes on the hacking and programming I've done! Some of it, like updating the Firmware and flashing User DB, is optional - but it's also the most fun!

Info: 

https://www.youtube.com/watch?v=QSq_bVX2to8

# You and Your Tytera MD-380 DMR

## Get your DMR ID

OK so it's probably a good idea to apply for your DMR ID soonish since it may take a few days. Even though you have a call sign, that's not what is used for message routing on the DMR network. Instead, a unique identifier, granted by a central authority, lets you identify who is calling and who you want to call. It's a little like a phone number!

Visit [http://dmr-marc.net/](http://dmr-marc.net/) to apply for your ID. You'll likely want one for each of your DMR radios

Click on **Contact Us**

![](https://cdn-learn.adafruit.com/assets/assets/000/032/330/medium800/wireless_contact_dmr.png?1462664944)

Then select **I'd like a USER ID for my radio**

You'll get this lovely warning:

![](https://cdn-learn.adafruit.com/assets/assets/000/032/331/medium800/wireless_dmr_id2.png?1462664983)

Click on **User Registration** and enter in your amateur radio call sign

![](https://cdn-learn.adafruit.com/assets/assets/000/032/332/medium800/wireless_dmr_id3.png?1462665016)

Fill out the rest of the form

![](https://cdn-learn.adafruit.com/assets/assets/000/032/333/medium800/wireless_dmr_id4.png?1462665054)

When complete, click **Register** and you'll get a notice that registration completed

![](https://cdn-learn.adafruit.com/assets/assets/000/032/334/medium800/wireless_dmr_id5.png?1462665090)

A few days later (please be patient with the people running the registration, they're volunteers!) you'll get an email with your DMR ID

![](https://cdn-learn.adafruit.com/assets/assets/000/032/335/medium800/wireless_dmr_replyemail.png?1462665123)

Note that your name, call sign and ID number are not private - they are visible in the DMR user database registry!

# You and Your Tytera MD-380 DMR

## Updating MD-380 Firmware

# DFU Driver

The good news is that the DFU driver is automatically found by Windows update. When you first plug in the radio, your device manager will say it's a **Digital Radio in USB mode**

![](https://cdn-learn.adafruit.com/assets/assets/000/032/311/medium800/wireless_dmr_no_driver.png?1462585353)

And Windows update will search for the driver

![](https://cdn-learn.adafruit.com/assets/assets/000/032/312/medium800/wireless_stmdfu.png?1462585387)

Once complete, the radio will come up as an STM DFU device

![](https://cdn-learn.adafruit.com/assets/assets/000/032/313/medium800/wireless_stmdfudriver.png?1462585439)

# Download MD380 Tools

You'll need a bunch of tools and utilities to compile and upload the MD380 hacked firmware. For mac and linux, you probably have this already. [You can visit our Windows tools tutorial for information on how to install git and other command line tools](../../../../windows-tools-for-the-electrical-engineer)

Once you have things like git and cygwin installed, [download the latest **md380-tools** codebase from Github](https://github.com/travisgoodspeed/md380tools/)

![](https://cdn-learn.adafruit.com/assets/assets/000/032/314/medium800/wireless_github.png?1462585517)

I used git within cygwin to

**git clone https://github.com/travisgoodspeed/md380tools.git**

![](https://cdn-learn.adafruit.com/assets/assets/000/032/315/medium800/wireless_gitclone.png?1462585787)

and then **cd** into the new directory and make sure the list of files is similar to the above

# Downloading & Patching

You can run the tool for downloading and patching the firmware by running

**make clean dist**

(which will clean up the current setup and run the distribution procedure)

When you run it you should get something like this:

![](https://cdn-learn.adafruit.com/assets/assets/000/032/319/medium800/wireless_makedist1.png?1462662805)

![](https://cdn-learn.adafruit.com/assets/assets/000/032/320/medium800/wireless_makedist2.png?1462663031)

![](https://cdn-learn.adafruit.com/assets/assets/000/032/321/medium800/wireless_makedist4.png?1462663042)

If you are running cygwin and get an **md5sum error** like this

![](https://cdn-learn.adafruit.com/assets/assets/000/032/322/medium800/wireless_md5failed.png?1462663073)

Then you can edit the Makefile in **firmwares** and add `dos2unix D002.032.bin.md5` and `dos2unix D002.032.zip.md5` before the md5sum commands to clean up the dos line endings.

![](https://cdn-learn.adafruit.com/assets/assets/000/032/323/medium800/wireless_makedos2unix.png?1462663172)

# Uploading the Firmware

OK now you're ready to upload the firmware. Check for a newly created folder **md380tools-_yyyy-mm-dd_** with the current date

![](https://cdn-learn.adafruit.com/assets/assets/000/032/324/medium800/wireless_md380tools.png?1462663323)

Inside you'll find your freshly patched firmware

![](https://cdn-learn.adafruit.com/assets/assets/000/032/325/medium800/wireless_newfirm.png?1462663358)

And inside the **windows** directory you'll even get the **upgrade.exe** tool from Tytera

![](https://cdn-learn.adafruit.com/assets/assets/000/032/326/medium800/wireless_winupgrade.png?1462663399)

Run this program - it's in half Mandarin half English but that's OK. Click **Open Update File** and select that firmware from the upper directory

![](https://cdn-learn.adafruit.com/assets/assets/000/032/328/medium800/wireless_updatefile.png?1462663494)

# Put the Radio into DFU Mode

&nbsp;OK right before you actually download the firmware into your radio you'll need to put it into DFU mode - so that it accepts new firmware (not the same mode as for updating the _settings!_)

1. Turn the radio off (using the volume knob)
2. Connect the USB programming cable to your computer
3. Peel off the headphone/mic insert & plug in the other side of the cable (it can only go one way)
4. Hold down the PTT and top button
5. Turn on the radio while the buttons are held
6. You will see the LED blink red/green

https://www.youtube.com/watch?v=v6-pk2znk_c&amp;feature=youtu.be

Then click **Download Update File**

![](https://cdn-learn.adafruit.com/assets/assets/000/032/329/medium800/wireless_updating....png?1462663503)

Give it a few minutes, it will look like it 'hangs' but its working, it is just a little longer than you think it'll take!

On success you'll get this message, which means it worked

![](https://cdn-learn.adafruit.com/assets/assets/000/032/327/medium800/wireless_updated.png?1462663483)

You may have to turn off/on the radio to launch the new firmware

# You and Your Tytera MD-380 DMR

## FlashDB

Installing the Users CSV and otherwise talking to the radio is done with **md380-tools** which is a python script that sends and receives USB data from the radio. It does take a little squidging to get working nicely on Windows under cygwin but lucky for you I had every possible issue come up!

Try running **make flashdb** to download the latest user and repeater database and uploading it to your radio

# Install PyUSB

If your python install complains **No module named usb.core y** ou'll need to install[pyusb v1.0.0a2](http://walac.github.io/pyusb/)

![](https://cdn-learn.adafruit.com/assets/assets/000/032/583/medium800/wireless_nousbcore.png?1463961585)

Download it into your working directory, uncompress and run **python setup.py install** in the cygwin terminal to install it

![](https://cdn-learn.adafruit.com/assets/assets/000/032/580/medium800/wireless_pyusbinstall.png?1463953653)

# Install a pyusb backend in cygwin

If you run **make flashdb** you'll note that it may say **No backend available** - that's because you need to [install libusb 1.0.20 support in cygwin](../../../../windows-tools-for-the-electrical-engineer/cygwin).

![](https://cdn-learn.adafruit.com/assets/assets/000/032/579/medium800/wireless_nobackend.png?1463953613)

So go back to cygwin and do so

![](https://cdn-learn.adafruit.com/assets/assets/000/032/582/medium800/wireless_libusbcygwin.png?1463961315)

# Swapping Drivers

OK finally you'll get a complaint that

`[Errno 88] Operation not supported or unimplemented on this platform`

![](https://cdn-learn.adafruit.com/assets/assets/000/032/585/medium800/wireless_error88.png?1463962114)

This is actually good, it means libusb loaded fine, but it can't _talk_ to the radio. That's because the STM32 DFU driver has full control of the USB interface. What you need to do is replace that driver with a libUSB driver that we can poke at. Windows is funny that way.

The easiest way to do that is to [run Zadig](http://zadig.akeo.ie/), which is a tool that will let you flip from the STM driver (the 'official' driver) to a libusb-compatible driver that lets you poke at the device directly.

Download and install Zadig. Once you run it, select **List all Devices**

![](https://cdn-learn.adafruit.com/assets/assets/000/032/586/medium800/wireless_listall.png?1463962204)

Then from the collection of devices, find **Patched MD380** and select that

![](https://cdn-learn.adafruit.com/assets/assets/000/032/587/medium800/wireless_patchedmd380.png?1463962256)

On the left, you'll see the current driver, **STTub30** (the ST driver) and on the right hand side, change it to **libusbK**

![](https://cdn-learn.adafruit.com/assets/assets/000/032/589/medium800/wireless_libusbK.png?1463962323)

Then click **Replace Driver** and replace it

![](https://cdn-learn.adafruit.com/assets/assets/000/032/591/medium800/wireless_libusbkreplace.png?1463962428)

Now in the device driver, you'll see the driver is under **libusbK**!

![](https://cdn-learn.adafruit.com/assets/assets/000/032/592/medium800/wireless_devicepatched.png?1463962505)

# Finally!

Run **make flashdb** again, this time you will have success!

![](https://cdn-learn.adafruit.com/assets/assets/000/032/593/medium800/wireless_writing.png?1463962653)

![](https://cdn-learn.adafruit.com/assets/assets/000/032/594/medium800/wireless_reboot.png?1463962667)

If you get `[Errno 5] Input/output error`

Try restarting the radio (turn off/on) also check that you didn't accidentally install the libusb32 driver, you have to use libusbK!

![](https://cdn-learn.adafruit.com/assets/assets/000/032/584/medium800/wireless_inputoutputerror.png?1463961793)

# Removing the libusbK driver

Simply unisntall + delete the driver in the device manager, restart the radio and you'll get back to the STM DFU driver automatically

# You and Your Tytera MD-380 DMR

## Finding a DMR Repeater

# Finding your local DMR Repeater

OK so now you have your radio up and running, and you want to&nbsp;[contact/talk/QSO](https://en.wikipedia.org/wiki/Contact_%28amateur_radio%29) with other friendly neighbors!

While you can talk directly, the power of the DMR network is that you can reach much farther with a repeater. Unlike most(?) analog repeaters, where you can only chat with other people who are accessing the same repeater, digital repeaters can connect thru the Internet to each other to create a huge network. For example, I can talk to someone in Boston from New York (normally not something a repeater could reach) by connecting to my local NYC repeater which then tunnels data to and from a Boston repeater.

So the most important thing is to find a repeater or two in your location that you can use to contact and program that into your radio.

# Talk Groups

Since there's a huge network of hundreds of DMR repeater/routers and thousands of users, all essentially on one net, there's a desire to split off the groups so that when you send a message it goes to the smallest group necessary to still reach who you want. I think of it like a "chat room" channel

For example, if you want to talk to people in NYC only, you would talk on the NYC-local talk group. If you want to talk to people in New York state, join the NY talk group. Tri-state? yep. New England? sure! USA? North America...all the way up to worldwide. And of course each city and state and region has their own talk groups as well.

If you have a person in particular you want to chat with, you'll need to figure out _the minimal talk group you share in common with the repeaters you have available_

**Ideally, you would not have to use a "North America" talk group if you can avoid it since every repeater in the US+Canada would have to transmit your message.**

For example - Lets say I want to talk to my friendly neighbor in Philadelphia. Here's the repeater he can use:

![](https://cdn-learn.adafruit.com/assets/assets/000/032/564/medium800/wireless_philydmr.png?1463950610)

This repeater&nbsp; **WB3EHB** carries 4 TalkGroups:

- Group 1 (World wide)
- Group 3 (US + English)
- Group 3172 (North East)
- Group 2 (NY-NJ Metro)

Lets look at the repeater I have in my backyard, **K2MAK**

![](https://cdn-learn.adafruit.com/assets/assets/000/032/565/medium800/wireless_k2mak.png?1463950849)

This repeater carries even more talk groups:

- Group 1 (World wide)
- Group 13 (World wide English)
- Group 3 (US + English / North America)
- Group 3172 (North East)
- Group 2 (NY-NJ Metro)
- Two TAC groups (wont be covered here)

There's also a repeater near me in Brooklyn, **NY4Z**

![](https://cdn-learn.adafruit.com/assets/assets/000/032/566/medium800/wireless_ny4z.png?1463951657)

This repeater carries similar, but not identical talk groups to the NYC one in midtown:

- Group 1 (World wide)
- Group 3 (US + English / North America)
- Group 13 (World wide English)
- Group 14 (Latin America)
- Group 3172 (North East)
- Group 4444 (Bronx TRBO only)
- Two TAC groups (wont be covered here)

The difference between this repeater and the midtown one are that this one carries #4444 and #13 but does not carry #2.

Since my friendly neighbor is in Philly and the 'smallest group' we could both share is TG2 (NY-NJ Metro) I am best off going with the **K2MAK** repeater if I want to talk to him since its the closest repeater that shares that talk group

Next up we'll program that into our radio!

# You and Your Tytera MD-380 DMR

## Programming

OK so unlike many simpler & analog radios, you can't just type in the frequencies you want to use into the keypad and off you go. Instead, you must run communication software that will set the repeaters you will be using. You can assign various repeaters to up to 16 different channels. You can also program in analog frequencies (both simplex & duplex)

The good news is once you get your software file lined up, you can constantly tweak and re-program your radio until its just the way you like it.

# Install TYT software

You'll use the official TYT interface software to update the settings, download and install from http://www.tyt888.com/

![](https://cdn-learn.adafruit.com/assets/assets/000/032/568/medium800/wireless_tytdownload_md380soft.png?1463952872)

Uncompress and install

![](https://cdn-learn.adafruit.com/assets/assets/000/032/570/medium800/wireless_md380soft_typ.png?1463952958)

It's not signed, you may have to turn off program signing on your computer!

![](https://cdn-learn.adafruit.com/assets/assets/000/032/571/medium800/wireless_unknownpub.png?1463952969)

Once installed, run...

![](https://cdn-learn.adafruit.com/assets/assets/000/032/572/medium800/wireless_TYTsoft.png?1463952980)

You'll get a 'default' setup like so:

![](https://cdn-learn.adafruit.com/assets/assets/000/032/573/medium800/wireless_tyt1.png?1463953018)

# Read in Radio Setup

Turn off the radio, plug your radio into the programming cable, then turn on. Make sure it shows up as a USB device. Now select **Read Data**

![](https://cdn-learn.adafruit.com/assets/assets/000/032/574/medium800/wireless_readdata.png?1463953070)

![](https://cdn-learn.adafruit.com/assets/assets/000/032/575/medium800/wireless_readdata2.png?1463953083)

If you get something like:

![](https://cdn-learn.adafruit.com/assets/assets/000/032/595/medium800/wireless_wrong_driver.png?1463963499)

Check that you have the **STM DFU** driver, not the libusbK driver installed

# Fresh codeplug!

Now you have a 'blank slate' to work with, which is the default 'codeplug'

![](https://cdn-learn.adafruit.com/assets/assets/000/032/576/medium800/wireless_tyt2.png?1463953108)

If you by chance need to 'start over' with a blank original setup, this is the default codeplug file:

[fresh380rdt.zip](https://cdn-learn.adafruit.com/assets/assets/000/065/823/original/fresh380rdt.zip?1542211235)
# Program in DMR ID

Remember that ID number you got earlier? Now's the time to use it. Type it into the **General Settings** window under **Radio ID**

![](https://cdn-learn.adafruit.com/assets/assets/000/032/597/medium800/wireless_id.png?1463971400)

# Program in Contacts

As we determined, K2MAK is a good place to start so let's program in this repeater that covers all of Manhattan:

![](https://cdn-learn.adafruit.com/assets/assets/000/032/567/medium800/wireless_k2mak.png?1463952221)

This repeater carries

- Group 1 (World wide)
- Group 13 (World wide English)
- Group 3 (US + English / North America)
- Group 3172 (North East)
- Group 2 (NY-NJ Metro)
- Two TAC groups (wont be covered here)

We'll enter all of these in as optional ways for us to communicate with others.

Go to the **Digital Contacts** window, to start it will have only "Contact1" which is group call ID #1

![](https://cdn-learn.adafruit.com/assets/assets/000/032/598/medium800/wireless_digicont.png?1463971635)

Click **Add** at the bottom to add a bunch of empty slots, then fill each slot with the Talk group and TG ID #

![](https://cdn-learn.adafruit.com/assets/assets/000/032/599/medium800/wireless_filled_contacts.png?1463971758)

# Entering Channels

The blank/new codeplug has 17 Channel slots. Note that these aren't necessarily 'hardcoded' to the channel selector, you can change zones to change which channels are used. In fact you can have dozens of Channels, split between zones. For now, though, we'll only keep the first Zone and set up one channel per talk group.

In general:

- Each channel is for a specific repeater and talk group
- You can have a different repeater/TG per channel
- You can change out all of the channels when you switch zones. So, if you are often in both NY and Texas, you can have a fully different set of repeaters and channels you switch between!

However, we'll start with just once channel for talk group 2, on the K2MAK repeater.

## Set Name and Frequency

Let start by defining this to be the K2MAK NJNY Region channel:

![](https://cdn-learn.adafruit.com/assets/assets/000/032/600/medium800/wireless_name.png?1463972129)

The midtown Manhattan, NY repeater that is part of the Bronx-TRBO network. The Repeater Transmitting frequency is **448.2750 MHz** and the Repeater Receiving frequency is 448.2750 - 5 = **443.2750 MHz**

That means we should set our channel **RX** to 448.2750 and the channel **TX** to 443.2750

![](https://cdn-learn.adafruit.com/assets/assets/000/032/602/medium800/wireless_freq.png?1463972182)

You're not done! You next have to program in the Color Code for the repeater as well as the time slot. You'll get this info from the repeater as well:

![](https://cdn-learn.adafruit.com/assets/assets/000/032/604/medium800/wireless_k2mak.png?1463972631)

This goes on the right hand side, in partular m ake sure you have the right Color Code and Repeater Slot to match the Contact Name. The remaining you can set to None

![](https://cdn-learn.adafruit.com/assets/assets/000/032/603/medium800/wireless_remaining.png?1463972549)

Once you have the frequencies for your repeater set up you can speed things up by copying one channel:

![](https://cdn-learn.adafruit.com/assets/assets/000/032/605/medium800/wireless_copy.png?1463972962)

and _pasting_ it onto another. Note it will delete what was in the channel you're pasting into

![](https://cdn-learn.adafruit.com/assets/assets/000/032/606/medium800/wireless_paste.png?1463972984)

This time, I'll program in the NE Regional, which is on **Timeslot #1** so don't forget to change it!

![](https://cdn-learn.adafruit.com/assets/assets/000/032/608/medium800/wireless_neregion.png?1463973123)

I'll do the rest, ending with Worldwide. I set this to RX only so I dont accidentally TX on it!

![](https://cdn-learn.adafruit.com/assets/assets/000/032/609/medium800/wireless_ww.png?1463973265)

# Write Data

That's it! You're ready to upload the data to your radio. Don't forget you can always go back and mess with your codeplug and then re-upload it if you make a mistake or want to have more repeaters or contacts

![](https://cdn-learn.adafruit.com/assets/assets/000/032/610/medium800/wireless_writedata.png?1463973442)

![](https://cdn-learn.adafruit.com/assets/assets/000/032/611/medium800/wireless_writing.png?1463973449)

# You and Your Tytera MD-380 DMR

## Custom Bootscreen

![](https://cdn-learn.adafruit.com/assets/assets/000/032/678/medium800/wireless_ladyada.jpg?1464132232)

You can even make a custom bootscreen. Handy for looking 'leet and also for helping you identify your radio.

# Make a Bitmap

Start by making a 160 x 40 bitmap image of what you want displayed on the screen. I'm going classy monochrome but you can have multiple colors as well.

![](https://cdn-learn.adafruit.com/assets/assets/000/032/679/medium800/wireless_bitmap.png?1464132474)

# Save Bitmap

Save the bitmap to the **md380tools\patches\2.032** directory and name it **0x80f9ca8-_bitmapname_.bmp** where _bitmapname_ is whatever you like.

![](https://cdn-learn.adafruit.com/assets/assets/000/032/680/medium800/wireless_savebit.png?1464132579)

# Open bitmap in GIMP

Yeah we have to generate a ppm file and GIMP can do it, but GIMP is not happy about making bitmaps so its actually easier I think, to make the bitmap in **mspaint** and then open in GIMP. Then export as... and save as **0x80f9ca8-_bitmapname_.ppm**

![](https://cdn-learn.adafruit.com/assets/assets/000/032/681/medium800/wireless_exportppm.png?1464132723)

# Add checksum

You're not done quite yet! Edit the **pp**** m** file with your favorite text editor and add

`# MD380 address: 0x80f9ca8`  
`# MD380 checksum: -941681526`

after the first line (which will say **P6** ). Basically it should look like this:

![](https://cdn-learn.adafruit.com/assets/assets/000/032/682/medium800/wireless_savechek.png?1464132819)

# Edit Makefile

Edit the Makefile in md380tools\patches\2.032 and find the **Apply the logo** section, add a new line

`../../md380-gfx --firmware=patched.img --gfx=0x80f9ca8-bitmapname.ppm write`

and comment out the other lines

![](https://cdn-learn.adafruit.com/assets/assets/000/032/683/medium800/wireless_editmake.png?1464132953)

Whew that's it! Run **make clean dist** to upload your nice new firmware! You'll see your bitmap is detected and 'printed out' so you know it was chosen

![](https://cdn-learn.adafruit.com/assets/assets/000/032/684/medium800/wireless_distmake.png?1464133029)


## Related Guides

- [Garden Path Lights with WLED and a Sunset Timer](https://learn.adafruit.com/garden-path-lights-with-sunset-timer.md)
- [Laser-Cut Layered LED Art Panel (Wood + Acrylic) with WLED](https://learn.adafruit.com/laser-cut-layered-led-art-panel-wood-acrylic-with-wled.md)
- [FunHouse Motion Detecting Lights with LIFX Bulbs](https://learn.adafruit.com/funhouse-motion-detecting-lighting-for-lifx-bulbs.md)
- [Blurry Analog Clock](https://learn.adafruit.com/blurry-analog-clock.md)
- [No-Code Counters and Email Reports with Adafruit IO Actions](https://learn.adafruit.com/no-code-counters-and-email-reports-with-adafruit-io-actions.md)
- [Wireless Control Button for WLED Projects](https://learn.adafruit.com/wireless-control-button-for-wled-projects.md)
- [Generating Text with ChatGPT, Pico W & CircuitPython](https://learn.adafruit.com/generating-text-with-chatgpt-pico-w-circuitpython.md)
- [Manually bridging MQTT to Adafruit.IO](https://learn.adafruit.com/manually-bridging-mqtt-mosquitto-to-adafruit-io.md)
- [Magic Mirror with Glowing Secret Messages](https://learn.adafruit.com/magic-mirror-with-glowing-secret-messages.md)
- [Bendable Sound Reactive Lamp with WLED](https://learn.adafruit.com/bendable-sound-reactive-lamp-with-wled.md)
- [Mystery Box: Remote Chess Board Puzzle Lock](https://learn.adafruit.com/mystery-box-remote-chess-board-puzzle-lock.md)
- [Adafruit ESP32 Feather V2](https://learn.adafruit.com/adafruit-esp32-feather-v2.md)
- [Spell Jam App on Fruit Jam](https://learn.adafruit.com/spell-jam-app-on-fruit-jam.md)
- [PyPortal US Election Calendar](https://learn.adafruit.com/pyportal-electioncal-us.md)
- [eInk Literature Quotes Clock for MagTag](https://learn.adafruit.com/eink-literary-quotes-clock-for-magtag.md)
