Skip to content

Dynamic_RDS - Plugin for Falcon Player (FPP) to manage an FM transmitter and custom RDS (radio data system) messages similar to what is seen from typical FM stations. Reads multiple fields from media metadata and playlist. Runs on Raspberry Pi and BBB. Supports the QN8066 chip.

License

Notifications You must be signed in to change notification settings

ShadowLight8/Dynamic_RDS

Repository files navigation

Dynamic_RDS - FM Transmitter Plugin for Falcon Player

Created for Falcon Player 6.0+ (FPP) as a plugin to generate RDS (radio data system) messages similar to what is seen from typical FM stations. The RDS messages are fully customizable with static text, breaks, and grouping along with the supported file tag data fields of title, artist, album, genre, track number, and track length, as well as main playlist position and item count. Currently, the plugin supports the QN8066 chip and there are plans to add the Si4173 in the future. The chips are controlled via the I2C bus.

Recommended QN8066 transmitter board

Important

There are other similar looking boards, so double check for the QN8066 chip. For a detailed look at identifying QN8066 boards, check out Spectraman's video.

Aliexpress link to purchase QN8066 FM Transmitter

Radio Board with Screen Radio Board Radio Board Pinout

Antenna

The QN8066 transmitter board needs an antenna for safe operations.

(More detail to be added)

Cables, Connectors, and Shielding

Caution

Do not run the PWM wire along side the I2C wires. During testing this caused failures in the I2C commands as soon as PWM was enabled.

Connector info

  • The connection on the transmitter board is a 5-pin JST-XH type connector, 2.54mm.
  • The Raspberry Pis use a female Dupont connector and we recommended using a 2 x 6 block connector.
  • The BeagleBone Blacks (BBB) use a male Dupont connector (recommendation pending BBB support work in progress).

If you are comfortable with crimping and making connectors, here are examples of what to use

Pre-crimped wires are also an options

Cable for a Raspberry Pi

Raspberry Pi Connection Raspberry Pi to Radio Custom RPi to QN8066 Cable

The green PWM wire runs next to yellow 3.3V and orange GND wire until right before the end to eliminate issue with interference. Keeping the cable as short as possible helps to reduce interference.

Cable for a BeagleBone Black (BBB)

(Support for the BBB is still in progress)

Shielding and RF interference

Given the nature of an FM transmitter, interference is potential problem. This interference commonly shows up as I2C errors which become more frequent as transmitter power increases. Moving the antenna away from the RPi/BBB and the transmitter board can reduce this. A significantly more robust setup it to locate the RPi/BBB and transmitter board inside a grounded, metal case such as was done by @chrkov here: Grounded case setup Grounded case setup

Using Hardware PWM on Raspberry Pi

The recommended QN8066 transmitter board can take a PWM signal to increase its power output. Be sure to comply with all applicable laws related to FM broadcasts.

Caution

Do not run the PWM wire along side the I2C wires. During testing this caused failures in the I2C commands as soon as PWM was enabled.

On the Raspberry Pi, in order to use the hardware PWM, the built-in analog audio must be disabled and an external USB sound card or DAC is required. The built-in audio uses both hardware PWM channels to generate the audio, so PWM cannot be used for other purposes when enabled. Software PWM is also an option, but at an increased CPU cost and a decrease in duty cycle accuracy.

From the Dynamic RDS configuration page, under the Power Settings, enable PWM.

This will automatically modify the /boot/config.txt:

  1. Comment out all dtparm=audio=on lines with a #
  2. Add the line dtoverlay=pwm,pin=18,func=2 by default Under the Advanced Options at the bottom of the configuration page, the output pin can be selected. This is also where Software PWM can be selected on most other pins.

Tip

Don't forget to change the Audio Output Device in the FPP Settings to use the USB sound card or DAC

Integration with FPP After Hours Music Plugin

The Dynamic RDS plugin has the ability to work in conjunction with the FPP After Hours Music Plugin to provide RDS Data from an internet stream of music. The information from the stream is populated in the Title field.

Once the After Hours Music Plugin is installed, the integration can be enabled on the Dynamic RDS configuration pages in the MPC / After Hours Music section.

MPC-After-Hours

Scripting Plugin Changes

It is an option to use scripts to change Dynamic RDS option value. As an example, this could be used to change the PS and/or RT style text to be different during the show verses after. The following is a bash script that can update the style text and have the plugin start using it without restarting FPP.

#!/bin/bash
curl -d 'Merry|Christ-|  -mas!|{T}|{A}|[{N} of {C}]' -X POST https://localhost/api/plugin/Dynamic_RDS/settings/DynRDSPSStyle
curl -d 'Merry Christmas! {T}[ by {A}]|[Track {N} of {C}]' -X POST https://localhost/api/plugin/Dynamic_RDS/settings/DynRDSRTStyle
curl https://localhost/api/plugin/Dynamic_RDS/FastUpdate

The single quotes around the style text in the script are important so the Linux shell (bash) won't try to interpret what is in there. This example could be saved as a file in the media/scripts folder and then use it with the scheduler (via Command -> Run Script) or playlists.

Troubleshooting

Transmitter not working (for the recommended QN8066 board)

  • Verify transmitter is working on it's own

    • Connect the original screen, connect antenna, and 12v power
    • Connected to audio input near the screen connector
    • Check for transmission with a radio. If not, transmitter maybe bad and need to be replaced
    • Remove power, then disconnect screen
  • Verify transmitter is working with RPi/BBB

    • With everything powered off, connect the transmitter to the RPi/BBB for 3v3, GND, SDA, and SCL
    • Do NOT connect the PWM pin
    • Verify each wire is connected correctly 3v3, GND, SDA, and SCL
    • Power up the RPi/BBB
    • Transmitter will power up from power supplied by RPi/BBB (Do NOT connect 12v power yet)
    • Verify the transmitter shows up on the I2C bus at 0x21
      • Either from the Dynamic RDS config page OR
      • SSH into the RPi i2cdetect -y 1 and run or on BBB run i2cdetect -r -y 2
    • If transmitter does not show up
      • Double check each wire is connectioned correctly 3v3, GND, SDA, and SCL
      • No really, go double check! It can happen to anyone! :)
      • Check each wire's continuity to make sure there isn't a break

Transmitter's RDS not working well

  • Enable Debug logging for the Engine
  • Check for read and/or write errors in Dynamic_RDS_Engine.log
    • If too many errors happen, then I2C fails and the Engine exits
      • Reduce the Amp Power
      • Try using Software I2C
      • Enclose the RPi/BBB and transmitter in a grounded, metal box with the antenna outside of the box
      • Check connection and wire continuity between RPi/BBB
      • Disconnect transmitter 12v power if connected and check I2C bus with i2cdetect -y 1
    • If errors happen at random
      • Make sure the PWM wire does NOT run along side the I2C wires, interference can occur
      • Try to lower the Chip Power and Amp Power, RF interference can impact I2C
      • Move the antenna further away from the transmitter board and RPi/BBB

About

Dynamic_RDS - Plugin for Falcon Player (FPP) to manage an FM transmitter and custom RDS (radio data system) messages similar to what is seen from typical FM stations. Reads multiple fields from media metadata and playlist. Runs on Raspberry Pi and BBB. Supports the QN8066 chip.

Topics

Resources

License

Stars

Watchers

Forks