B.B. Link Adapter DIY

Are you a Kenwood TH-D74 or TH-D75 owner frustrated by the lack of Bluetooth support for iOS? In this episode, WH6AZ takes a slight detour to introduce B.B. Link, a BLE-to-Bluetooth Classic bridge that finally lets you pair your Kenwood HT with your iPhone or iPad. Learn why Bluetooth Classic and BLE don’t play nice and how B.B. Link solves the problem using an ESP32 and a custom firmware. Follow along to flash the firmware, print a case, wire up the adapter, and see it in action with RadioMail and APRS.fi. Whether you’re into portable ops, APRS, or Winlink packet sessions, this is the Apple-Kenwood handshake you’ve been waiting for.


Song Credits

  • “ST Slide guitar blues riff” by juskiddink — Licensed under CC BY 4.0
  • “Fast And Cool Acoustic Blues Lick In E - Guitar Tag” by MarkMusicPictures — Licensed under Commercial use

TH-D75 pairing fail courtesy of Josh KI6NAZ @ HRCC. Watch the full review.

Transcript
Okay, let's see if my phone will find it. Hey! Oh no! Hello, how are you? I'm WH6 AZ, typically here to bring you high signal insights about radio mail, the win link application I created. Today we're taking a slight detour. We're going to explore the connection capabilities of a well-known HT, the Ken wood THD74. Although I'll be referencing the D74, discussion is relevant to its follow-up model, the THD75 as well. As we've seen in the live video from Josh, KI6 AZ from Harvard Radio Crash Course, it can be demonstrated that the D75 won't pair with an iPhone either. As an owner of one of these radio, the first thing I tried to do was to pair it with my iPhone. The idea being that the built-in TNC in the radio is basically a modern, and as such it should be easily accessible to applications we have Bluetooth. Unfortunately as some of you I'm sure I've experienced, it doesn't work that way. First, let's unpack a few facts about Bluetooth. This technology was created for sending a variety of data types over short distances. However, as we know, wireless radio communication necessitates a portable source of power as well. That's precisely why Bluetooth-learn energy, or BLE, was introduced. BLE was optimized for device that needs to run off a tiny battery for yours like fitness trackers and smart home sensors. What's problematic is that BLE isn't compatible with the older Bluetooth Classic Standard. It's turned this often used for its cellular port profile or SPP, which is intended for continuous high-speed data streaming, which is what the D74 is using. On the other hand, BLE is a different protocol optimized for periodic low-power communication. This means they can't talk to each other, it's like they speak different languages, even though they are both called Bluetooth. For some reason most likely power management concerns, Apple made a design choice to not allow iOS devices to connect via Bluetooth Classic, only BLE is supported. What does this mean for all of us? Picture this, we have a high-end radio price at a hefty $750. And then there is the iPhone, where typical recent model will cost you about 900 bucks. Once you throw in the chargers, cables, extra battery and bits and bobs, you get close to 2 grams of gear, and they don't work with each other, which is a maddening. I came to this crushing realization as I became a new ham in 2020. So as to not become a sour ham, I decided I would try to do something about this. I began thinking about the interfaces at our disposal. BLE, or Wi-Fi for the iPhone, and Bluetooth SPP, and USB for the radio. Because Apple doesn't expose the serial profile on USB OTG, even for iPhone with the USB-C connector, I concluded that crafting a BLE to Bluetooth bridge would likely be the most elegant solution. With that in mind, I looked through my pile of microcontrollers and started tinkering to see if I could engineer a workaround. After a couple of false thoughts, I finally narrowed down to the ESP32 as the chip that would be capable of handling both BLE and Bluetooth Classic at the same time. Luckily, thanks to the impressive efforts of HESU, OH7LZB from API rest of FI, and Rob, WX90 from Mobilink, a standardized method for discovering and accessing a keyst ion CVB library, has been established. It will allow me to create a device that would be compatible with existing applications like the APRS.FI. In May 2020, long before the advent of radio mail, I kicked off the discussion in the Google support group for that app. Back then, my focus was on using it for APRS. After a bit of trial and error, on a deep dive into the Bluetooth APIs, I managed to get a proof of concept up and running. I shared the code and posted a brief video to showcase it in action. After I managed to demonstrate that it could be done, my interest dwindled, this was in part because the THD74 became no longer valuable to do some supply chain issue, and its future was uncertain and there were even remorse that it was being discontinued. Fast forward to 2022, with the launch of radio mail, there was some renewed interest in using the built-in TNC for packet win link. I revived my initial proof of concept and long beyond, it worked for connection oriented session as well. You can see it here in action with the first generation, TinyPico board as the adapter. The setup proved functional and some of you reported back that you had successfully replicated it. Still the code was very much a proof of concept, big my initial foray into Bluetooth programming and one notable limitation was the necessity to search for the radio by its name. With the release of the new THD75, I saw an opportunity to refine the code when I dedicated some time to create a more robust solution. Today, I'm pleased to introduce BBLink, the adapter designed to handle the blues in your connection. Let's stick around and I will get you step by step so YouTube can build you all . Ok, before we jump in, let's take a look at the end result. Earlier this year, I posted a teaser video to showcase it in action and the video gathered quite a bit of interest. Let's play it. As you can see here, radio mail is able to control the radio and change the frequency put it in kiss mode before the session starts and it will restore it back when it's all done. Some of you may also have noticed a little something sticking in the back of the radio. That's the adapter, taped to the radio as I was experimenting with the best location to mount it. So let's dive in and see what we need to build one together. First we'll need to download the source from github. Just head over to github.com/islandmagic/bb-link and then you can git check out the code here or you can also download the zip file and this is what we're going to need to flash the firmware to the adapter. I also open here the readme that's on the repo so we can follow along, it has all the instruction about what we're going to talk about as well as the various link for the various components you're going to need to build your own. Next we'll need a board with the ESP32 controller. I chose to use a board called tiny Pico made by an expected maker and as it name suggests the tiny Pico is actually tiny and it has the ESP32 Pico version of the chip which is really what we want. You could use other ESP32 boards but this one is the most compact I found and if you do use others make sure it's the Pico version of the ESP32 nut or the variant like the S3 as they don't support Bluetooth classic so make sure you check this back and you get something that's going to work for you. While you're here on their site make sure you download the drivers for the CH9 102-URT chip. This is the chip that's going to allow the board to be recognized as a serial port so you can actually flash the firmware from your PC and you need to make sure you have that install already. To purchase the board the easiest is to buy directly from the maker so you just scroll down by your tiny Pico you have various sources you can get it from and then at the bottom you have the unexpected maker store just click on that and you can order it straight from them. It ships from Australia but usually it's there in the US usually within a week. Now this is really all you need to make the adapter. You could power it from a portable USB charging bank but if you want a more robust solution you'll need a few more things. You'll want to get a LiPo battery so the adapter can have its own power source and I've had reasonable success with AliExpress but you may find it from other vendor. The model I use is the 6.0.2.48 and what's particularly nice about this battery is it's about the same width as the tiny Pico board and it provides 600 mAh capacity and with that you get about 4 hours of continuous operation. We'll look at the power consumption in a little while in more detail but this is roughly what you get with this battery. The last thing is that you probably want to have some enclosure for your adapter and you'll need a case. So in the code repo I've included a couple of files for a case I designed that can be 3D printed and work reasonably well. Now I'm not a mechanical engineer so I would help for someone in the community to create an even better version for it but for now this actually works quite well. So the enclosure you get the bottom where you can place the battery and then it has two holes so that it can be mounted in the back of the radio where the belt holder usually goes and then you have a lid that goes on top of it. So if you don't have a 3D printer you can easily order this from one of the cloud provider. One place I like to get 3D print from is a place called CraftCloud and you can just easily get a quote from various vendors here. So you just click here, select the two STL files that are in the enclosure directory in the repo, upload them and then you'll get various quotes here as well as choices of material. Personally, I like Nylon better over PLA like the finish better. You don't have the little marks on the side and you can get it in various colors, you can get it polished. For me I like to get it in white and I'll just end up painting it afterwards. Last thing you're going to need is a small metal surface that can be used as a capacitive touch switch for turning the adapter on/off when it's in the enclosure. I use the Bradstad and you probably have some of those laying around in an art supply box. If not any small metal, a little round metal piece will also do the trick. Ok so our board has finally arrived and let's take a look at what's inside. You get a few things in there, if I can get it all in the package, there you go . So you get the board itself as well as a couple of header and connector for typically for the battery. We're not going to need those as we're going to solder everything on the board itself. Before we turn it on, let's head over to the Arduino IDE. Before we actually do that, let's make sure you remember to install the driver for the UR chip on the board itself, the CH9102. If not, please go back to the tiny Pico website and I'll be waiting here for you. Ok so before we can actually flash the firmware we need to install a few library. So you want to go into Arduino settings and we're going to specify a board manager URL so that we can actually install libraries straight from the maker of the ESP32. So if you go in the README, there is a URL you can just copy paste here in the settings, click ok. And then if you go here in the board manager, you can look for ESP32 and this way we've directly accessed to the ESP32 by Espressif instead of the Arduino version. And as you can see you get a more recent version here. The code has been tested with version 2, there is a version 3 out there that's in beta, it's not compatible with the code yet so please make sure you install only version 2. So I have it installed here already. Then next you're going to want to install a few libraries. First the tiny Pico comes with a helper library that you can install or that you should install. So go ahead and install that as well as the free RTO S library. Same deal, install it and then last you're going to need the Arduino Q which same thing you will install here. Ok so now we have all our library installed. We should be able to compile and flash the firmware before we do that. Let me plug in the board. You can see here it's flashing all sorts of color. The tiny Pico has a tricolor LED which we're going to use in the adapter to represent where you state. There you go. Ok so now you go in the drop down menu and it should actually show you the board that you've selected here. So we can select the Yuntiny Pico and then you have to pick the port. What's very important here is you'll see two serial ports showing up and you want to make sure you select the WCH USB one. For some reason if you select the other one the flashing will actually fail. So make sure you select the WCH. Click ok and now we can just click on the arrow here upload and this will go and compile the sketch and once everything is compiled it will actually upload it to the board itself. Ok so it's showing you progress here and then as soon as it's done compiling it will switch and you'll see here the progress of the upload. Ok so now it's done and it's uploading to the tiny Pico and it will restart the board automatically when it's done. Ok the board is restarting and if we go over to the serial port we can see a little bit of debug information here. So now you notice the LED is amber which is the idle color for the adapter and one thing we can take a look at here is there's a switch, capacitive switch that allows you to turn the board on and off. So I'm going to use this very sophisticated paperclip and I'm just going to put it in the pin number 4 here. There you go and this will act as my switch for now. If I press and hold it's also blinking and that will turn the adapter off. And then of course on USB so the other LED is still on but if you're on battery power the adapter goes into very deep sleep and with a very very small power consumption so it can run on battery for your or more. So to wake it up just briefly touch the switch, it turns on. You can also check the battery level which of course we don't have one but it will still show you so if you press briefly we'll show you green. If the battery is certain low voltage it will actually blink green and educate various studies. Ok so our board looks pretty good here, looks like the code is running and now let's take a look at a few other things we need to add to make a complete solution. Ok now we need to assemble a few things. First you want to solder the battery and a wire for the capacitive switch. So do the wire on pin 4 and run it on the side of the board and then carefully solder the battery one wire at a time and make sure to not shock the battery. You may want to use a little bit of tape to isolate it as you go. Then you need to prep the case. Here is the first revision of the case that had actually a mistake the board was sitting too far into the case. It's been corrected in this version and you just need to do some light sanding and then you can paint it. You also need to drill the hole for the button and for the LED and then fill the LED hole with a little bit of transparent silicone so it can act as a light pipe. Next put everything into the case and fish the wire out and now you're ready to solder the button. I glued it to the case with a little bit of hard glue. And with that you should be done. Now don't close the box quite yet. There are two options for the box. You can close it and use it to the standard one box or you can attach it to the radio like a backpack. Features the adoption, use the screws from the belt clip and screw the box in the back of the radio and then you can close the lid. Let's also take a quick look at power consumption. On standby the adapter grows around 70 milliamp and then when both Bluetooth connections are active it goes up to 140 milliamp. So on the 600 milliamp hour battery that gives you about 4 hours of continuous usage. One of the cool features of the ESP32 is that it goes into deep sleep so when the device is asleep you will only draw about 40 microamps which means your battery won't rain if you leave it off for an extended period of time. Now that we have the adapter on the radio let's see how it works. Okay first we'll need to pair the adapter with the radio and to do that we need to download the bb link configurator app. I created it as a standalone app so that radio mail is not required to configure the adapter in case someone wants to use it with other applications such as a PRS. ify. So go ahead let's head over to the App Store and then we can search for bb link and you'll see here bb link configurator and then I already have it installed so I can just open it here and when it starts it will look for the adapter. So let's make sure the adapter is turned on and yep the LED is amber it's on here it remembers the last one it already seen on the network so I can just tap bb link and connect. Now before we can pair we need to put the radio in discovery mode so to do that we hit menu and then go into the Bluetooth menu and then pairing mode. Once it's in pairing mode we can tap paired radio on the configurator and it will scan for the radio nearby and will show you the name of the radio that it finds. Take a few seconds and here it is it found my THD74 and now pairing is complete . So I can just go click OK and that's all there is to it. This is a one-time operation and from then on the adapter we'll remember the radio and pair with it automatically. If you ever need to pair with a different radio what you can do is scroll down and hit reset adapter it will just remove the radio pairing information from the adapter and then you can start the process all over again. What you can also configure here in the application is you can set whether or not you want the adapter to control the radio meaning that if it receives command from radio mail to change frequency the adapter can actually tell the radio to change mode, get into kiss mode, change the frequency and then restore it at the end. If you don't want the adapter to interact with the radio in that mode, in that fashion you can just turn it off here. Now that the adapter is paired let's head over to radio mail but before we do that let's make sure you quit completely from the application because only one application can be connected at the time. Now open radio mail go into settings and then scroll down to packet kiss TNC modem and then default TNC and it will go on scan for the TNC found b-b-link here. You can just select it click done and now let's make a connection. I'm going to look for my favorite packet station here little test station I have and so if you notice on the right side of the screen here it shows a little ht icon this is to indicate that radio mail can actually do cat control for the device you can change frequency which is which is nice. One of the neat feature is that the adapter will actually query the radio and determine what band you want the TNC to be on. I've mine set up for the b-band you can change that in radio settings but the adapter is not enough to know that. So if you look carefully here on the top I have my repeater that I'm monitoring on the bottom I have my frequency that is going to be set to know the 145.09 when I establish a connection. So let's try. I hit connect now the radio goes into kiss mode it's going to change the frequency did already and now it's doing the exchange. It's connecting and now it's done and if you notice at the end of the exchange it restored the frequency and because we started with the radio not in kiss mode it also takes that off. If the radio was already in kiss mode for example the adapter will actually respect that and leave it in the same state as it found. So it should be small enough that it basically allows you to establish a session, set up everything it's required and then basically restore everything to normal and get out of the way. Now let's have a little fun because b-b-link is exposing the TNC of the radio you can be used by other apps. The only app that I know that uses this is a PRS.fi so let's see how that works . Open the app and then I can just go into the settings here and look for the adapter as well. So it found it and I will just connect to it and as you can see here even though the PRS .fi doesn't know about b-b-link because it connected to it as a TNC the adapter automatically will put the radio in kiss mode so that it will basically be a pass through and make sure that all the command can be sent directly. So I set up my radio to the right PRS frequency and here I have my little Pico APRS so now I can go ahead and try to send a message. So this is WH6AZ7 and let's see if that works. This is a test, it's send, another radio sending and then on the right on the P ico you can see it received the message and if I can try to reply and I'm going to reply with a one so I don't have to type too much on the keyboard here and here's OK. Hit OK, there you go and now I can hit send and now it's being received by the Kenwood radio and displayed into the app. So there you go, even though those radio both the Kenwood and the Pico you could do the texting functionality from the device itself, you're forced to use the T9 key pad which is kind of hard for texting. So by be able to use your iPhone the utility has increased significantly and it 's a lot more fun. I hope this was useful and that you'll feel inspired to build an adapter. All the instructions on the GitHub repo for B-B-Link. I would love to hear your feedback so let me know in the comments and if you have any suggestions or run into problems please create an issue on GitHub. Until next time 73 and Aloha.

Download transcript

packet th-d75 February 03, 2024 · 27 min