KYDronePilot / hdfm

UI for live weather/traffic/meta data collected from HD Radio stations
Other
166 stars 12 forks source link

What is required to use this with the cygwin build of nrsc5? #11

Closed robman501a closed 5 years ago

robman501a commented 6 years ago

Hey gang, I am a Windows user and I would like to somehow use this script with the Windows flavor of the nrsc5 executable. So far, I got this 'nrsc5, developed by Theori' and I'm not too sure how to get the python libraries (pip install 'library'). Unless, there is a Windows version of Python and that 'pip' command will do the trick from the command prompt.

KYDronePilot commented 6 years ago

If you already have python installed, you should be able to install pip by:

If you don't have python installed yet, then just install the latest version from python.org and it should come with pip. Now you should be able to run the pip install ... commands to install packages. This program was originally developed to work just on Mac and Linux, but other users have had success running it on Windows. If you encounter any more issues, please post them; I'd like to eventually make this program fully compatible with Windows.

robman501a commented 6 years ago

Which version of Python would you recommend for this project? Python 2 or Python 3? I've seen some projects that will work with one but not the other. Same situation with running an x64 compiler on an x64 system, then the x86 compiler should be installed.

KYDronePilot commented 6 years ago

I know it works fine with Python 2 and I just confirmed that it also works with Python 3.6.4. Given that it works with both, I would definitely recommend 3.6 since it's the latest version and Python 2 is legacy.

robman501a commented 6 years ago

Now that I got Python 3 installed, it does come with pip but when I try 'pip install Tkinter' (or what ever) it says ..

pip install Tkinter File "", line 1 pip install Tkinter ^ SyntaxError: invalid syntax

KYDronePilot commented 6 years ago

Are you running it from the Python shell? If so, it just needs to be run from the Windows command prompt. You may have to run it as an Administrator though, I'm not sure...

robman501a commented 6 years ago

Okay, I figured it out by watching YouTube. I got this error however for ImageTk and Tkinter but Pillow installed. Could not find a version that satisfies the requirement ImageTk (from versions: ) No matching distribution found for ImageTk

KYDronePilot commented 6 years ago

You may not need ImageTk if you install Pillow via pip install Pillow. Sorry, I don't have a working Windows environment to test any of this in.

KYDronePilot commented 6 years ago

If that doesn't work, you could try downloading one of the Pillow wheel packages from this link https://www.lfd.uci.edu/~gohlke/pythonlibs/. Another user found that this worked.

robman501a commented 6 years ago

I got it to run with python ./hdfm.py -a -s ./Maps/ 104.5 and I got it do decode CHUM-FM. The weather and traffic map is working but the album art is not. Also, the Python windows are sluggish and keep saying 'not responding'. Well... the station/album art sort of works but most of the time it just displays the traffic map and the station logos for the other data streams (HD 2, HD 3.). capture Edit: Album art works with CKIS-FM but the maps don't.

KYDronePilot commented 6 years ago

I've had the same problems with the windows being sluggish. I probably should have used a different library for displaying items.

As for the album art, it's never really accurate. The iHeart Radio stations send a bunch of extra mini-images which can sometimes be artwork, the station logo, or something else entirely. Because of their extremely vague naming scheme, there's no way to differentiate between whether it's artwork or not or even what data stream it's related to. All the script does is look for those extra images and displays them.

robman501a commented 6 years ago

104.5 CHUM FM used to be owned by Bell Media, now I think it's iHeartRadio Canada. Not sure if their coding is the same as the US iHeartRadio. The pictures, do they come in over the air or is a command issued in the data stream to download the images over the internet? I'm wondering what the download speed can be compared to. So far, I've seen the CFRB 1010 and TSN 1050 logos along with the 104.5 logo. Say if I ran this on an Raspberry Pi 3 (Debian), would the windows still be sluggish?

KYDronePilot commented 6 years ago

All the data processed comes directly from the radio station, except for the map used for weather radar overlays. That is a large pdf Open Street Map file that is included with the program. So, it isn't dependent at all on the internet, it can function fully off the grid.

I assume the windows will still be sluggish on a Raspberry Pi, since the issue seems to be with the Tkinter libraries. It would be nice at some point to find a gui library that would allow for resizing of the windows for smaller screens, as well as to deal with the poor performance.

KYDronePilot commented 5 years ago

@robman501a Is there any way you could do me a favor? I have recently been in the process of rewriting all the code for the hdfm program. The issue of laggy windows has been fixed and a few new features have been added, such as resizable windows and a station/song information display. The program has been tested and functions normally on a Mac, but I haven't been able to get nrsc5 working on my Windows machine, and thus haven't been able to test the program in a Windows environment yet.

Would you be willing to test out the updated version on your Windows machine? I recall that you had success with the previous version in the past.

The updated version can be found under the refactor branch on this project, as I haven't yet merged it with master.

robman501a commented 5 years ago

Yeah, sure! I reinstalled Windows so I'll have to redo everything from scratch again and I'm not entirely sure if the data such as the station logos, weather and traffic maps are still being sent out.

KYDronePilot commented 5 years ago

You should need Python 3 (preferably 3.6), python3-tk (Tkinter package; might come with a full install of Python 3 for Windows), Pillow (pip3 install Pillow), and nrsc5. There should be installation instructions for nrsc5 on Windows on its github page.

As long as you have a station that is on this list, the weather, traffic, and album artwork should still work. I tried it less than a month ago and there were no issues.

robman501a commented 5 years ago

I have iHeart Radio Canada (or maybe it's Bell Media) up here. They do lots of iHeart Radio ads and events though. Not sure if that makes a difference or if that is the same as the iHeart Radio U.S.

KYDronePilot commented 5 years ago

Hmm, I don't see any listings for Canadian stations on that list.

I do remember you mentioning it worked with CHUM-FM.

I would just try it with all the local HD Radio channels and see which ones work. I can't imagine a station that used to work would stop broadcasting that data, since lots of cars and old-style GPSs still use that information.

robman501a commented 5 years ago

It did, yes but they deactivated their HD radio service. But since then. these guys have the IBOC service and are blasting through. http://www.iheartradio.ca/virginradio/toronto

KYDronePilot commented 5 years ago

Do you happen to know if they are transmitting the weather and traffic maps?

robman501a commented 5 years ago

Not a clue.

KYDronePilot commented 5 years ago

I say just test it out with the new version of hdfm and see what happens. If the extra data isn't being transmitted, you should only see the window that displays song/station information populated.

robman501a commented 5 years ago

So sorry for the delay! My antenna isn't working and it's way too cold to fix it. Also, my SDR computer got fried so I'm waiting for the new one to arrive.

KYDronePilot commented 5 years ago

No worries! I'm quite busy as well with school. Whenever you get the time is fine.

TillyGoat commented 5 years ago

Hi KYDronePilot,

Were you able to find a person to test on Windows 10? I grabbed the 'refactor' today and fired it up on Windows 10. I am able to receive audio from a local I Heart Radio station and there are new images (traffic tiles and radar images) being dropped into the Dump directory. The two windows titled "HDFM Traffic Map" and "HDFM Weather Map" are blank. It seems like I'm getting the data from the radio station but the images/tiles are not being loaded into the appropriate window. Is there any testing I can do for you that would help you narrow down the cause of this issue?

hdfm
KYDronePilot commented 5 years ago

I just created a new branch display-errors. If you could, please download it and run the program, this time without the -l argument. I added some debug statement to see if it is using the right directory.

Try clearing out the dump directory (except for the .gitignore) and running the program until a traffic tile is received. Then copy any of the program output and post it. Also, if possible, post the absolute path of the dump directory on your machine.

If you're worried about sharing absolute file paths, feel free to censor anything private.

KYDronePilot commented 5 years ago

I have decided to merge the refactor branch into master. If there are any further issues with Windows machines, please create a new issue.

I'll leave this issue open for another month with the hopes of resolving the issue @TillyGoat was having with Windows.

KYDronePilot commented 5 years ago

If any further issues arise with running hdfm on Windows, please open a new issue.