diff --git a/pluginInfo.json b/pluginInfo.json index cf2a4f6..f770563 100755 --- a/pluginInfo.json +++ b/pluginInfo.json @@ -1,8 +1,8 @@ { "repoName": "fpp-vastfmt", - "name": "Vast V-FMT212R/Si4713", + "name": "Si4713/Vast V-FMT212R", "author": "Daniel Kulp", - "description": "Basic RDS/Audio support for the Vast Electronics V-FMT212R USB FM Transmitter and Si4713 I2C modules", + "description": "RDS/Audio support for the Vast Electronics V-FMT212R USB FM Transmitter and Si4713 I2C modules", "homeURL": "https://github.com/FalconChristmas/fpp-vastfmt", "srcURL": "https://github.com/FalconChristmas/fpp-vastfmt.git", "bugURL": "https://github.com/FalconChristmas/fpp-vastfmt/issues", @@ -30,10 +30,17 @@ }, { "minFPPVersion": "3.3", + "maxFPPVersion": "3.99", + "branch": "master", + "sha": "8d3589395ae7615148ce7a29311408e1533ea423", + "allowUpdates": 0 + }, + { + "minFPPVersion": "4.0", "maxFPPVersion": "0", "branch": "master", "sha": "", - "allowUpdates": 0 + "allowUpdates": 1 } ] } diff --git a/plugin_setup.php b/plugin_setup.php index 2c34c8e..3a5705a 100755 --- a/plugin_setup.php +++ b/plugin_setup.php @@ -1,30 +1,47 @@ \n"; + $data = file_get_contents('http://127.0.0.1:32322/gpio'); + $gpiojson = json_decode($data, true); + $gpioPins = Array(); + foreach($gpiojson as $gpio) { + $pn = $gpio['pin'] . ' (GPIO: ' . $gpio['gpio'] . ')'; + $gpioPins[$pn] = $gpio['gpio']; + + if ($curGpio == $gpio['pin']) { + $defaultGPIO = $gpio['gpio']; + $pluginSettings["ResetPin"] = $defaultGPIO; + WriteSettingToFile("ResetPin", $defaultGPIO, "fpp-vastfmt"); + } + } + echo "\n"; ?>
VAST-FMT/Si4713 Hardware -

Connection: "USB", "I2C"=>"I2C"), "fpp-vastfmt", ""); ?>

-

Reset GPIO:
-I2C connection requires a GPIO pin to reset the Si4713. Can either be a kernal GPIO number or a pin name like "P9-30". Setting is unused for USB connection.

+

Connection: "USB", "I2C"=>"I2C"), "fpp-vastfmt", "OnConnectionChanged"); ?>

+

Reset GPIO:
+I2C connection requires a GPIO pin to reset/enable the Si4713.

@@ -33,9 +50,9 @@ function toggle(id) {
VAST-FMT/Si4713 Plugin Settings -

Start at: "FPPDStart", "Playlist Start"=>"PlaylistStart", "Never - RDS Only"=>"RDSOnly", "Never"=>"Never"), "fpp-vastfmt", ""); ?>
+

Start at: "FPPDStart", "Playlist Start"=>"PlaylistStart", "Never - RDS Only"=>"RDSOnly", "Never"=>"Never"), "fpp-vastfmt", ""); ?>
At Start, the hardware is reset, FM settings initialized, will broadcast any audio played, and send static RDS messages (if enabled).

-

Stop at: "PlaylistStop", "Never (default)"=>"Never"), "fpp-vastfmt", ""); ?>
+

Stop at: "PlaylistStop", "Never (default)"=>"Never"), "fpp-vastfmt", ""); ?>
At Stop, the hardware is reset. Listeners will hear static.

@@ -45,11 +62,11 @@ function toggle(id) {
VAST-FMT/Si4713 FM Settings -

Frequency (76.00-108.00): MHz

-

Power (88-115, 116-120*): dBμV +

Frequency (76.00-108.00): MHz

+

Power (88-115, 116-120*): dBμV
*Can be set as high as 120dBμV, but voltage accuracy above 115dBμV is not guaranteed.

-

Preemphasis: "50us", "75μs (USA, default)"=>"75us"), "fpp-vastfmt", ""); ?>

-

Antenna Tuning Capacitor (0=Auto, 1-191): * 0.25pF

+

Preemphasis: "50us", "75μs (USA, default)"=>"75us"), "fpp-vastfmt", ""); ?>

+

Antenna Tuning Capacitor (0=Auto, 1-191): * 0.25pF

@@ -58,18 +75,18 @@ function toggle(id) {
VAST-FMT/Si4713 RDS Settings -

Enable RDS:

+

Enable RDS:

RDS Station - Sent 8 characters at a time. Max of 64 characters.
-Station Text: +Station Text:
-

RDS Text: +

RDS Text:

Place {Artist} or {Title} where the media artist/title should be placed. Area's wrapped in brackets ( [] ) will not be output unless media is present. -

Program Type (PTY North America / Europe): Program Type (PTY North America / Europe): 0, "1 - News / News"=>1, @@ -106,10 +123,6 @@ function toggle(id) {


- - - -
+ diff --git a/src/FPPVastFM.cpp b/src/FPPVastFM.cpp index 4f67816..f3d9826 100755 --- a/src/FPPVastFM.cpp +++ b/src/FPPVastFM.cpp @@ -37,6 +37,7 @@ static void padTo(std::string &s, int l) { class FPPVastFMPlugin : public FPPPlugin { public: bool enabled = true; + bool rdsEnabled = false; FPPVastFMPlugin() : FPPPlugin("fpp-vastfmt") { setDefaultSettings(); if (settings["Start"] == "FPPDStart") { @@ -109,7 +110,8 @@ class FPPVastFMPlugin : public FPPPlugin { std::string ts = si4713->getTuneStatus(); LogInfo(VB_PLUGIN, "VAST-FMT: %s\n", ts.c_str()); - if (settings["EnableRDS"] == "True") { + rdsEnabled = settings["EnableRDS"] == "True"; + if (rdsEnabled) { initRDS(); } } @@ -199,7 +201,7 @@ class FPPVastFMPlugin : public FPPPlugin { virtual void playlistCallback(const Json::Value &playlist, const std::string &action, const std::string §ion, int item) { - if (action == "stop") { + if (action == "stop" && rdsEnabled) { formatAndSendText(settings["StationText"], "", "", true); formatAndSendText(settings["RDSTextText"], "", "", false); } @@ -211,6 +213,9 @@ class FPPVastFMPlugin : public FPPPlugin { } virtual void mediaCallback(const Json::Value &playlist, const MediaDetails &mediaDetails) { + if (!rdsEnabled) { + return; + } std::string title = mediaDetails.title; std::string artist = mediaDetails.artist; std::string album = mediaDetails.album; @@ -252,6 +257,7 @@ class FPPVastFMPlugin : public FPPPlugin { } else if (!emptyAllowed && settings[s] == "") { settings[s] = v; } + LogDebug(VB_PLUGIN, "Setting \"%s\": \"%s\"\n", s.c_str(), settings[s].c_str()); } Si4713 *si4713 = nullptr;