Git Product home page Git Product logo

bb-link's Introduction



πŸ‘‰ Check out the new ready-made version that plugs directly into USB-C!


B.B. Link, the BLE to Bluetooth Classic adapter for Kenwood TH-D74/5 Radios

Some devices, like the Kenwood TH-D74 radio only support Bluetooth Classic serial profile. iOS devices only support Bluetooth Low Energy (BLE). They are not compatible and as such, you can't pair those devices together. This code provides a way to create an adapter that can interface a device that exposes a serial profile over Bluetooth Classic, to an iOS device via BLE. Its main purpose is to enable iOS app that supports AX.25 packet like RadioMail or APRS.fi to use the TNC built in the radio as a modem.

For a detailed "how-to build" this adapter, watch this video: https://www.youtube.com/watch?v=xLze6qDOLww. After you're done, come back and follow the instructions here as they are continually updated.

Hardware

The adapter is based on the ESP32 microcontroller, which provides support for both Bluetooth Classic and Bluetooth Low Energy (BLE). There is specialized code tailored for the TinyPICO development board, which serves as the standard implementation. This code can be altered to work with other ESP32-based boards as needed.

Note: Compatibility is limited to ESP32 microcontroller. Boards like the TinyS3, which use the ESP32-S3 chip, do not support Bluetooth Classic. If you don't use the TinyPICO, make sure to choose a board that features the ESP32 microcontroller.

Material

  1. TinyPICO Buy
  2. 600 mAh LiPo Battery model 602248 (6x22x48mm) Buy
  3. 3D Printed case
  4. Brad fastener as touch button (8mm head)

Power Options

The adapter can be powered via USB, such as through a USB adapter or a portable power bank, or alternatively, it can be connected to a LiPo battery for use on the go. The TinyPICO will charge the battery when plugged into USB.

Capacitive Touch Button

The installation of a capacitive touch button is not required but recommended if you need an on/off switch while using a LiPo battery. To install, connect a wire to pin number 4 on the TinyPICO board; this will serve as the on/off control.

Cases

You can 3D print a case to house the battery and the board. Here are a couple of option that attach via the mounting holes for the belt clip.

  1. Horizontal

This is the orignal design from WH6AZ, functional but primitive. Can work as a stand alone box if you don't feel like attaching to the radio.

https://github.com/islandmagic/bb-link/tree/master/enclosure

  1. Vertical

This design is a beautiful contribution from F4LFJ. It features a slick design that allows the case to attach vertically. There is enough clearance to insert and remove the battery from the radio.

https://github.com/islandmagic/bb-link/tree/master/enclosure/contribs/F4LFJ

Software

  1. Install Arduino IDE 2.x https://www.arduino.cc
  2. Add additional library source in Arduino IDE. Settings > Additional board manager URLs: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
  3. Install the esp32 by Espressif Systems board library. This code has been tested with version 2.0.15.
  4. Install the TinyPICO helper library
  5. Install FreeRTOS library
  6. Install ArduinoQueue library
  7. Install ArduinoLog library
  8. Clone this repo
  9. Flash the code to the TinyPICO board
  10. Download B.B. Link Configurator app on your phone
  11. Download RadioMail on your phone https://radiomail.app

Rig Control

By default, the adapter will set the radio to KISS mode and automatically respond to RadioMail's instructions to switch frequencies, enabling seamless operation. If you prefer the adapter not to alter radio settings during use, toggle off the 'Control Frequency' option in the configurator app.

Operating Instructions

Powering On

  1. Wake the adapter by briefly pressing the touch button. An amber light will indicate that it is awake.

Pairing with a Radio (one time only)

  1. Turn on adapter
  2. Open B.B. Link Configurator app on your phone
  3. After a few seconds, B.B. Link appears in the list of nearby adapters. Select it.
  4. Set the radio in Bluetooth discovery mode. Navigate to 'Menu -> Bluetooth -> Pairing Mode' on the radio.
  5. Tap 'Paired Radio' on B.B. Link app
  6. Wait a few seconds, the name of your radio should appear in the list. Select it.
  7. After a few seconds a PIN prompt should appear on the radio. Press 'OK' to accept. This step is only necessary once; afterwards, the adapter will automatically try to reconnect with the radio.
  8. Successful pairing is indicated by a breathing blue LED on the adapter.

Pairing with iPhone or iPad

  1. Make sure B.B. Link Configurator app is fully closed
  2. Open the RadioMail app. Proceed to 'Settings -> KISS TNC Modem -> Default TNC'.
  3. B.B. Link should be visible in the discovery screen.
  4. Select B.B. Link and tap 'Done'.
  5. Navigate to the connection screen and choose a packet station.
  6. A solid blue LED on the adapter signals that RadioMail has connected. Red and green LEDs will flash to indicate data transmission and reception.

Powering Off

  • The adapter will shut off automatically after 5 minutes when not in use on battery power. It stays on indefinitely if USB power is detected.
  • To manually turn off the adapter, press and hold the touch button until the LED blinks amber, then release.

User Interface

Touch Button Functions

  • Short Press: Wake the adapter or check the battery status when idle.
  • Long Press: Turn off the adapter.

LED Indicator

The dotstar tri-color LED is used to indicate various states:

  • 🟠: Idle, adapter waiting to pair
  • πŸ”΅ (slow flash): Adapter scanning for radio
  • πŸ”΅ (breathing): Idle, paired with radio
  • πŸ”΅: Ready, radio and iOS device paired
  • 🟠 (fast blink): Shutting down

Data Activity:

  • 🟒: Rx (Receiving)
  • πŸ”΄: Tx (Transmitting)
  • 🟣: Rx/Tx (Both Receiving and Transmitting)

Error Conditions:

  • πŸ”΄ (fast blink): Low battery immediate shutdown
  • πŸ”΄ (slow flash): Fatal error, must reset

Battery Status Indicators:

  • 🟒: Battery full
  • 🟒 (fast blink): Battery low

Battery Indicator

The charge level of a LiPO battery can be difficult to determine without additional circuitry due to their non-linear discharge curve. A basic battery indicator is provided based on the battery voltage level:

  1. Upon waking up, the adapter displays the battery level for a few seconds. A solid green light indicates the battery is considered full, while a flashing green light suggests the battery needs charging.
  2. When the adapter is idle (indicated by an amber LED), a short tap will activate the battery level display.

Battery Saver

To save energy, the adapter automatically enters a low-power sleep mode after a certain period of not being used, for instance, when no phone is connected, during which it consumes approximately 40 Β΅A. While active, the adapter's power consumption is around 140 mA, allowing for continuous operation for up to 4 hours on a 600 mAh battery. In standby mode, with no active bluetooth connection, it uses about 80 mA. Additionally, the sleep feature is disabled when the adapter is connected to USB power, ensuring that the adapter can stay on for longer durations and can be used while it is being charged.

If the battery voltage falls to a critical level, the adapter will automatically shut down to prevent damage to the circuit.

Factory Reset

You can reset the adapter to its default configuration. This will clear the list of previously paired devices and restoring default settings. Simply tap 'Reset Adapter' in the configurator app.

Alternatively, you can reset the adapter by connecting it to a computer. Here's how to do it:

  1. Launch the Arduino IDE on your PC.
  2. Connect the adapter to your PC using a USB cable.
  3. Navigate to the Serial Monitor within the IDE.
  4. Type R into the Serial Monitor and send the command.
  5. Monitor the response in the Serial Monitor which will confirm the clearing of the previously paired devices.
  6. After the process is complete, disconnect the adapter from your PC.

Troubleshooting

  • If the adapter connects to the radio but the radio does not transmit, check the TNC settings. Go to Menu > Configuration > Interface > KISS (983) and set it to Bluetooth.

Known Issues

  1. The ESP32 library is limited to discovering Bluetooth Classic devices exclusively prior to establishing any connections. After connecting with a device, the discovery capability is no longer available. To initiate a new scan, the adapter must be rebooted. If you intend to pair with a different radio, ensure that the radio previously paired with is turned off before powering on the adapter. If not, the adapter will automatically re-establish a connection with the previously paired radio, preventing it from discovering new radios.

How to Contribute

This project is open source, so everyone's contribution is welcome. Here's a quick guide to get started:

  • Share: If you build your own adapter, share it online! Post photos, write a blog post, or create a tutorial video to show others how it's done.
  • Update Documentation: Help improve or correct the documentation. Fork the repo, make your updates, and submit a pull request.
  • Submit Change Requests: If you're developing a new feature or bug fix, fork the repository, create a new branch for your changes, and submit a pull request with a clear description of your modifications.
  • Write Good Issue Reports: If you encounter bugs or have feature suggestions, please submit an issue report with a clear title, a detailed description, and steps to reproduce the issue if it's a bug.

The source code for the Configurator app is available as well.

bb-link's People

Contributors

georges avatar

Stargazers

Gerad Munsch avatar Jason Howell avatar  avatar  avatar Joe Barbere avatar Ken van Wyk avatar Nick Hayes avatar  avatar Richard Stanley avatar Andie avatar  avatar  avatar BrianWGray avatar T.R. Fullhart avatar Thiyagaraj Krishna avatar Mark Cohen avatar VA3EMQ avatar  avatar Eduardo Fortes avatar  avatar Matt Fiscus avatar  avatar  avatar Lorenzo avatar Dominic Uliano avatar Heikki Hannikainen avatar Swift Raccoon avatar  avatar

Watchers

Gerad Munsch avatar Ken van Wyk avatar Mark Cohen avatar  avatar  avatar

Forkers

hessu f4lfj

bb-link's Issues

TinyPICO TP01 USB C

I flashed my TinyPICO with the Mac version of the Arduino IDE 2.3.3 and I got what looked like it downloaded to work.

Leaving...
Hard resetting via RTS pin...

Unfortunately, the amber LED never came on indicating the TinyPICO reset and rebooted. When I removed the USBC cable and reapplied it would not come out of the state it was stuck in. I tried two more times to flash the board with no change.

It did say Installed ArduinoQueue: 1.2.5
FreeRTOS:11.0.1-5
TinyPICO Helper Library:1.4.0
esp32.2.0.14

I am sure I missed something so please let me know what I can do to get this working.

If you need anything else please let me know to get this working.

Tim KM4ESU

Tinypico discontinued

Is there another board that this will work on? the TinyPico is now discontinued and hard to find.

Thanks

β€œnil” and SSI?

I got it all working. Went back to it later and the Configurator App no longer shows β€œBB Link” and SSI; it shows β€œnil” and SSI.

Re-flashed several times. Same. Not sure what caused it to go from working to β€œnil”

This is great; thank you for sharing this.

Thank you in advance for any help you can offer on this issue.

Constantly losing BLE connection

In the B.B.Link app as soon as i move away from the page that shows the paired device the app reports that it has lost BLE connection. I am sure it hasn't.

E.G i connect my iPhone and TH-D75 and go to aprs.fi to send a message when i return to B.B.Link app it reports that it has lost the BLE connection

Setup:
TinyPico with latest firmware built via Arduini IDE 2.3.2 and esp32 2.0.11
TH-D75
iPhone 14 Pro with IOS 17.4.1

TH-D75E doesn't transmit

Hello,

I've used the components described in this repository and have compiled the latest ino file.
On my phone the firmware version is described as v0.7.4

Radiomail/BB-link would switch the HT to the selected frequency and Kiss mode but the TH-D75 is not transmitting.
I can see the led on the Tinypico board blinking red but no tranmission on the HT.

Once the transmission request cancelled, BB-link restore the original frequency and mode.

TH-D75E
Tinypico USB-C
iPhone 11, iOS 17.3.1
Radiomail 1.3.1 (7)
BB-link 1.0.1 (2), firmware 0.7.4

73,
Claude, F4LFJ

B.B.Link Configurator Update Firmware Link

In B.B.LinkConfigurator app - it shows the Firmware Version as 0.7.3. The "Update Firmware" link is active below it.

When "Update Firmware" link is pressed, the dialog shows "Update Firmware to 0.7.2".

As it shows the adapter is on 0.7.3 the firmware update isn't needed so Update Firmware link should be disabled? Only adding this if that can cause a problem otherwise do not think it matters once a radio is paired.

BBL1
BBL2

bluetooth serial, 'setPin' error

I am a newbie with this.

I get this error when flashing:

exit status 1

Compilation error: 'class BluetoothSerial' has no member named 'setPin'

Thank you.

TinyPICO board sleeping even when USB-C powered

Hello,
I followed this YouTube video https://www.youtube.com/watch?v=xLze6qDOLww&t=1127s and the solution proposed works extremely well.
Since I did not want to bother with the internal battery, I decided just to power the board with the USB-C. All works well, until you power off your D75, close the RadioMail on your iPhone and you keep the TinyPICO board powered by a large PowerBank... after a while, the board will enter in some sort of sleep mode. If I power back on my D75, and open the RadioMail, try to connect using packet.... nothing... the connection times out. If I unplug the USB-C and plug it again, after a few seconds I can re-check my email using RadioMail and all works great again.
Is there any way to prevent the board from sleeping at all when powered by the USB-C? Thank you

Compilation error: ArduinoLog.h: No such file or directory

Hi Georges,

Not an issue anymore but here is what I have encountered at the first compilation:

During the first compilation I've got the following error:
Compilation error: ArduinoLog.h: No such file or directory

Line 15 of the ino file reference it: #include <ArduinoLog.h>

The installation of the ArduinoLog library is not mentioned in your video.
So I've installed the v1.1.1 by Thijs Elenbaas

I was able to compile and upload the file to the board.
The BB-link apps see the board, it works!
I just wait few days to receive my Th-D75.

Thanks for this great job!

73, Claude, F4LFJ

Feature Request: Convert Raw-Pakets to KISS-Pakets

Aloha from Singapore!

I have another use case where I want the TH-D74 to remain in APRS standalone mode. However, in this mode, you can still output the raw packets via Bluetooth. It would be great if we could convert them into KISS packets and send them to the aprs.fi iOS app to continue displaying the received stations on the map.

73 & 55 de Stephan 9V1LH / DG1BGS

can't get the TinyPICO to work

I have Arduino EDI 2.3.2 installed on the PC.

The sketch that is created is sketch_apr29a, but I don't know how it got that name.

I've got a paperclip connected to pin 4, but touching it long or short touch doesn't do anything.

I don't have a battery connected, but I do have the USB-C cable connecting the TinyPICO to the PC.

I figured that should power the board like the battery would.

I've got the following libraries installed but can't get the TinyPICO to work.
The amber light near the reset button and antenna, never comes on.
The blue light near the USB-C connector is bright and steady.
The amber light near the USB-C connector is dim and flashing (fast).

Here are the installed libraries:
esp32 by Espressif Systems 2.0.15
TinyPICO Helper Library by UnexpectedMaker 1.4.0
FreeRTOS by Richard Barry [email protected] 11.1.0.0
ArduinoQueue by Einar Amason by [email protected] 1.2.5
ArduinoLog by Thijs Elenbaas 1.1.1

I've compiled and uploaded to the TinyPICO and here is the log Output:

Sketch uses 257017 bytes (19%) of program storage space. Maximum is 1310720 bytes.
Global variables use 21168 bytes (6%) of dynamic memory, leaving 306512 bytes for local variables. Maximum is 327680 bytes.
esptool.py v4.5.1
Serial port COM3
Connecting....
Chip is ESP32-PICO-D4 (revision v1.1)
Features: WiFi, BT, Dual Core, 240MHz, Embedded Flash, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 64:b7:08:90:a3:14
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Erasing flash (this may take a while)...
Chip erase completed successfully in 1.7s
Compressed 18992 bytes to 13110...
Writing at 0x00001000... (100 %)
Wrote 18992 bytes (13110 compressed) at 0x00001000 in 0.3 seconds (effective 483.5 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 146...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (146 compressed) at 0x00008000 in 0.0 seconds (effective 837.9 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 1185.7 kbit/s)...
Hash of data verified.
Compressed 257376 bytes to 139364...
Writing at 0x00010000... (11 %)
Writing at 0x0001ddb1... (22 %)
Writing at 0x00024e5b... (33 %)
Writing at 0x0002a0d4... (44 %)
Writing at 0x0002f754... (55 %)
Writing at 0x000384cf... (66 %)
Writing at 0x000410ec... (77 %)
Writing at 0x000466ff... (88 %)
Writing at 0x0004bf37... (100 %)
Wrote 257376 bytes (139364 compressed) at 0x00010000 in 2.3 seconds (effective 905.9 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

ArduinoLog.h: No such file or directory

when I verify I get to following error

D:\downloads\bb-link-master\bb-link-master\src\bb-link\bb-link.ino:15:10: fatal error: ArduinoLog.h: No such file or directory
#include <ArduinoLog.h>
^~~~~~~~~~~~~~
compilation terminated.
exit status 1

Compilation error: ArduinoLog.h: No such file or directory

Radio Control Change Frequency

I had firmware 0.7.3 installed and radiomail would put into kiss mode and change the frequency. When finished it would restore the old frequency and then turn off kiss mode.

I upgraded firmware to 0.7.4 using bblink app. Now it will put into kiss mode, but does not change the frequency on the radio.

Tried with vfo a and b. I have reset the bblink 2x and repaired to the radio and iphone. Still will not change the frequency.

Do not see an option to downgrade firmware to 0.7.3 to retest.

When I manually change the frequency on the radio, the radio/radiomail will send the message.

iphone 15 pro max, IOS 17.3.1
B.B.link 1.0.1 (2)
Radiomail 1.3.1 (7)
Kenwood Th-D75a radio

IMG_1465

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.