thomastech / PixelRadio

PixelRadio is a FM Radio Transmitter with RDS (Radio Data System) capabilities. It was developed for holiday "Pixel" displays and house projection installations.
GNU General Public License v3.0
33 stars 15 forks source link

URL Decode needed? #13

Open kylegrymonprez opened 2 days ago

kylegrymonprez commented 2 days ago

The FPP Plugin was failing in curl with malformed URLs. to make it suceed, the Content of the URLs needed to be url encoded so " " would travel across to the pixelradio device as "%20". This seems to work fine for Sont text, however, the station text is displaying at "%20" instead of being URL decoded. I coudlnt' figure out the correct plave to URL decode the strings correctly, so perhaps you could quickly update the correct line of code to properly URL Decode the strings and transmit them correctly.

thomastech commented 1 day ago

I don't use the FPP plugin that was created by Daniel Kulp. So I might not be able to solve this issue. Here's some ideas:

  1. Try replacing the space (or %20) with a plus (+) sign . That is an alternate for a URL space char.
  2. Perhaps an underscore ( _ ) instead of %20 will solve this for you. The underscore is fairly stealth looking.

BTW, it is not clear which RDS payload that is causing the grief. When you say "station text," is it the PSN (program station name) that is not working when you pad with %20. Or do you mean a different RDS payload?

Keep in mind that PSN is typically the station call letters, but can be a very short name. Maximum 8 chars, including any encoding characters.

kylegrymonprez commented 1 day ago

Yeah - I think the plugin is handling cycling the PSN payload - so to get the cURL to succeed to PixelRadio, the URL has to be url encoded.

The Plugin splits it into 8 characters that cycle on a timer. e.g. my show name is "Lights at Ardmore". I set that to the Station ID in the plugin where applicable.

Screenshot 2024-12-03 at 11 18 54 AM

The plugin splits that into chunks of 8 characters - I see another issue in my attempted fix that worked for the RDS text, but I'll double check the code again to see if there's a separate issue. Last time I checked it was taking the URL encoded payload for PSN and displaying it verbatim on the display. So "Lights At Ardmore" got split into 3 chunks of 8 characters including the url encoded chars. However I may have spotted an issue in my own code to fix that - just need an radio to verify the other side (because the PixelRadio webpage only displays the RDS love, not the station code..... and I dont have serial logging connected....)

thomastech commented 7 hours ago

It's probably best to check the plugin's code. It must handle any URL encoding before passing the text string to PixelRadio.

I don't have any experience with the FPP plugin. But thinking about what it should do, one issue is that only 8 chars can be sent to PixelRadio's PSN command at a time. So if %20 encoding is used, and it does not fit in a single 8 char payload, it won't be decoded as a space. What I mean is, splitting Lights%20At%20Ardmore would be broken into: Payload 1: Lights%2 Payload 2: 0At%20Ar Payload 3: dmore

Sending that won't work correctly. So as a workaround, it might be best to use a single character to represent a space. Such as hyphens, underscores, periods, etc.

Keep in mind that using the Station ID for messaging is not actually permitted in the RDS standards. It was intended for fixed station ID only.

kylegrymonprez commented 7 hours ago

Yeah - that's kind of representative of what I saw on the radio. I think there's 2 parts of it that are seperate but connected - the sending via curl and the displaying and they're intertwined and its escaping me to think it through the easy solution. There's a simple solution I'm sure - let me continue messing around with it.

Thanks Thomas! You've been helpful for sure.