TP-Link OnHub router with local Wyoming Voice Announcements and Media Player

TLDR: Got TP-Link OnHub TGR1900 router working with OpenWRT as dumb AP, Wyoming Voice announcements, and media player, using Media Player Daemon. Bought 3 for under $45 shipped from USA ebay. Work great.

History

Google dropped support of OnHub routers in January 2023, which meant they could not be reconfigured, making them useless to most users, and causing the used market price to plummet. Some very resourceful people managed to get OpenWRT running on the ASUS and TP-Link versions so I decided to buy one on eBay, $15 shipped, to see what I could do with it as the specs are very good.

The TP-Link TGR1900 version has:

  • 13 antennas, using 3 radios, with 3x3 AC 80Mhz
  • Quad-core Qualcomm IPQ8064 SoC
  • 1 GiB RAM
  • 4 GiB eMMC storage
  • Standard 12v barrel power jack (useful if power supply is missing)
  • ZigBee support (have not tested this in OpenWRT)

After two days of futzing with it I managed to get it running, with VLANs for Guest/HomeIOT, and most importantly making Voice announcements of household events and playing audio media (FLAC, AAC, MP3, OGG). I have since bought 2 more, also under $15 shipped (USA eBay), and now have announcements throughout my whole house.

Router Setup

First off you need to flash the OpenWRT firmware on the router which is covered well on the device info page for OpenWRT ASUS / TP-LINK TGR1900 (Google OnHub) page. I am using mine as dumb Access Points connected to a main router that serves DHCP on multiple VLANs.

I recommend using OpenWRT v23.05.5 and NOT v24.10.0 as the later is very new and may have stability issues.

Getting it to work for voice announcements and media player, took a while to figure out, but is simple to implement after the fact. You do need to know how to use a Linux terminal via SSH. OpenWRT by default exposes SSH access using user “root” and the password set on the router. So using a Linux terminal you can connect to router using IP or hostname. I have dumb APs set in hosts file as:

IP          : Host name
----------------------------------
192.168.1.1 : router-main (router)
192.168.1.2 : router-back (AP)
192.168.1.3 : router-front (AP)

This is my config. You must know the IP or hostname of your router. Do not blindly use my setting as it will not work. Replace your IP/Hostname in all instruction below.

So in Linux I can access “router-back” using terminal:

ssh root@router-back
OR
ssh [email protected]
and enter the password that is configured on the router.

So I connect using SSH to the router/AP and run:

  • opkg update (this should provide info on packages available, if there are error then router is not configured correctly)

  • opkg install mpd-mini (should install package)

  • service mpd stop (MPD default config doe not work so have to stop it)

  • mkdir -p /mpd/playlists && mkdir -p /mpd/music (create directories for MPD)

  • chown -R mpd:mpd /mpd (change ownership of directories)

  • vi /etc/mpd.conf (launches editor)

  • press INS keyboard key (Insert) to make changes

  • In the “Files and directory” section uncomment the first 4 so that you have:

    music_directory         "/mpd/music"
    playlist_directory      "/mpd/playlists"
    db_file                 "/mpd/database"
    log_file                "/mpd/log"
    
  • Scroll/Page Down to “Audio output” section and edit the text to be:

    audio_output {                                                                 
            type            "alsa"                                                 
            name            "My ALSA Device"                                       
            format          "44100:16:1" # IMPORTANT otherwise very quiet          
            # Software volume control see /etc/asound.conf                         
            device          "softvol"                                              
            mixer_type      "software"                                             
            mixer_device    "softvol-mixer"                                                              
    }
    
  • Press ‘ESC’ key and type :wq and hit Enter key (this will save and exit editor)

  • vi /etc/asound.conf (create new asound conf file in editor).

  • Press INS key to make changes

  • Paste in the following code:

    pcm.softvol {
      type softvol
      slave.pcm "default"
      control.name "Volume"
      control.card 0
    }
    
  • Press ‘ESC’ key and type :wq and hit Enter key (this will save and exit editor)

  • ls -la /dev/snd (To check who owns the sound device)
    For mpd-mini this should show:

crw-rw----    1 root     audio     116,   0 Dec 17 20:55 controlC0
crw-rw----    1 root     audio     116,  16 Dec 17 20:55 pcmC0D0p
crw-rw----    1 root     audio     116,  33 Dec 17 20:55 timer
  • vi /etc/group
  • Press INS key to make changes
  • Edit line that starts audio adding mpd to the end so it looks like
    audio:x:29:mpd (Allows MPD to use the sound device)
  • Press ‘ESC’ key and type :wq and hit Enter key (this will save and exit editor)
  • service mpd start (start MPD again)
  • cat /mpd/log (see if there are any messages in the log)
  • exit (close SSH connection to router)

Home Assistant Setup

  • Navigate to Settings → Devices
  • Click on Add Integration Button
  • Type mpd and select Music Player Daemon
  • Enter the host name or IP (e.g. 192:168.1.2)
  • Leave password blank and use default port 6600
  • Click submit button.

This should add the device. You can now go to Media and be able to select it in bottom right, find an MP3 file, and play it. Volume only works when something is playing. You can rename it in Settings → Devices → Music Player Daemon → three vertical dots button on right → Rename. e.g. OnHub Router Back

Voice Announcement Setup

You need to have ‘Wyoming Protocol’ configured. I am using Piper for text to speech. Again follow existing guides which cover this thoroughly.

Create an automation and add action `Text-to-speech (TTS) ‘Speak’ on piper. e.g.

action: tts.speak
metadata: {}
data:
  cache: true
  // use your entity name in the next line
  media_player_entity_id: media_player.onhub_router_back 
  message: A vehicle is on the driveway
target:
  entity_id: tts.piper
enabled: true

Run the action and you should hear it on the router!

Self signed SSL cert

If you are using a self signed SSL certificate for Home Assistant then you will need to add your certificate signing authority (caroot.pem) file to the router so it knows to trust the server. Otherwise you will get error in /mpd/log saying CURL failed.

CURL failed: Cert verify failed: BADCERT_NOT_TRUSTED

If you use a real SSL cert (LetsEncrypt etc) then you do not need to do this and things should just work.

  • SSH into router again ssh [email protected] and enter password
  • cd /etc/ssl/certs
  • cp ca-certificates.crt ca-certificates.crt.org
  • vi ca-certificates.crt
  • Scroll/Page Down to bottom, hit INS key to make changes
  • Paste your caroot.pem file into it making sure that there are empty lines before or after the certificate (IMPORTANT)
  • Press ‘ESC’ key and type :wq and hit Enter key (this will save and exit editor)
  • service uhttpd restart (load the new certs)
  • Try playing something to the router in Home Assistant again.
  • cat /mpd/log to see log errors

Conclusion

This is awesome for me because this is a very cheap way to get local voice announcement in many rooms that do not need additional powered speaker. The quality of sound for voice is very good and acceptable as a media player. I am an audiophile so have high standards for music. The speaker in the router has very little bass and sounds a bit like a tin can when playing music.

WiFi is very good; better than my previous TP-Link Archer A7s and Netgear WNDR4300s. I have gigabit internet and even when downloading massive data they barely register any CPU load. They also have tonnes of space to install additional OpenWRT packages.