Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Radio Stations and Images sync
#1
So I'm running 2 Moode raspberry pi's and I'm running into some inconvenient maintenance issue with Radio stations between the two units. I usually add radio stations on the one Moode unit and then with some difficulties copy the radio stations and images to the second unit.

I use WinSCP to copy these files because it gives me a windows explorer like feel and functionality.

And the problems I run into are that it's a real pain to copy images because we don't have access to root user. And pi user doesn't have permissions to copy or paste anything into the /var/www/images/radio-logos folder.
I do end up eventually with the right images in the right places but to get Images into that folder is a huge pain in the a$$ and very time consuming to bypass the permission issue.

So I was wondering if there is a possibility to implement a button that could sync Radio stations between units. Maybe the Master could have a table with IP addresses to which it would push and overwrite the content of there two folders. 
or
Keep images and Radio stations in the same folder for ease of manually coping
or
At the very least give pi user the permissions to copy and paste images manually into and from /var/www/images/radio-logos folder.

Or heck maybe I'm just doing something wrong and there is a better way.

PS I just ran into this issue, where I wasn't able to play any stations because of a DHCP to Static change.
http://moodeaudio.org/forum/showthread.php?tid=63
Was there ever a resolution?


Attached Files Thumbnail(s)
   
Reply
#2
@Im bored

Regarding DHCP vs static address, a quick check here on a moOde 5.3.1 player shows no difference in radio station playability. Suggest you make sure you entered correct info for gateway and DNS.

Regards,
Kent
Reply
#3
(08-06-2019, 11:31 AM)TheOldPresbyope Wrote: @Im bored

Regarding DHCP vs static address, a quick check here on a moOde 5.3.1 player shows no difference in radio station playability. Suggest you make sure you entered correct info for gateway and DNS.

Regards,
Kent

I'm on 5.3.1 and was setup with static with everything working, then I switched to DHCP saved it and used it for a while then I went back to static. When I clicked on static all the old info showed back up (IP, subnet, gateway) when I saved it and rebooted, I was able to play music from local network, and play a few radio stations worked but about 90% of the other radio stations didn't work. To fix the issue I set it back to DHCP saved and rebooted. Then back to Static and this time even though the fields were populated already I erased them and populated the by hand.

So to summarize
1. STATIC (all working)
switch to
2. DHCP (all working)
switch to
3. STATIC (local network, and few radio stations working) but most other radio stations giving errors

It definitely feels like a bug that has something to do with switching from STATIC (initially populate fields manually) to DHCP and back to STATIC this time DON'T manually populate fields just save the configuration that was initially setup.
Reply
#4
Why do you need to switch between the two addressing modes?
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#5
@Im bored

It would seem to be a problem with DNS.

A few of the predefined radio stations are referenced by their IP address. For example, the Audiophile stations  are referenced as different ports on 94.23.201.38. Most, however, are referenced by their fully qualified hostname. For example, 1.FM is referenced as 'stream112.1.fm'. These references must be resolved to IP addresses via DNS.

If you name some of the stations which play we can check this hypothesis against their definitions to see if it is correct.

Assuming it is, it'll take a code review understand what's happening with the DNS server addresses.

Having said that, I have to say I don't know whether manually entered static data is supposed to be preserved over the static->DHCP->static cycle or if it just accidental that some of it is. Like Tim, I'm wondering why this cycling is necessary.

Regards,
Kent
Reply
#6
Back to the main topic, I also would like at least a simple export/import function for manually added Radio Stations in Moode.

Every time I upgrade a major version or when I need to reinstall for whatever reason, I hate it to add my Radio stations manually again and again. With an export/import this would be much easier.
Bwt an export/import function of all other moOde configuration settings would also be fine  Big Grin

Maybe there are already such functions and I only did not find this?

The only reason, why I not already updated to 6.0 is that I currently don't have time to configure it from scratch  Undecided  

Kind regards
Georg
Reply
#7
@ghoeher

Hi, Georg.

If you can wait a couple more days I should have Python scripts ready for prime time which do the following:
  • in export mode, scan the moOde database for user-defined radio station entries; for each one extract the db info along with the corresponding .pls file, the station logo .jpg file and its thumbnail .jpg file (if the image files exist); save all to a tarball (e.g., a tar file).
  • in import mode, untar the tarball to a temp directory and, for each station, first check if it clashes with a station already present in the moOde database; if not, extract the station entry to the database and the corresponding files to their proper places.
These are just utility scripts (but I suppose they could be combined into one). I'm not tackling any kind of automated player-to-player transfer or any integration with the moOde UI. The user has to run the export script, transfer the tarball, run the import script, all from the command line. Further these scripts are all or none; I'm not tackling any kind of user selection of the stations to export or import.

I starting developing these scripts for my own use but they may be useful to others to:
  • Deal with upgrading to a new major release of moOde
  • Copy stations from one player to another player whether it's running the same release or a different release
  • Share favorites to another user
I'll have to spend some time reading Tim's release notes to see how far back in moOde releases these scripts will work. IIRC, radio logo thumbnails were introduced mid 4.x. Don't recall if the database schema for radio stations or the location of the file directories has changed since 4.0.

Regards,
Kent
Reply
#8
Hi Kent,

sounds perfect for me - this will make migrations much easier and faster. I don't have any problem with running some scripts manually for export/import. For me there is no need for complete automation or integration into the Moode UI (even if it would be a nice to have feature to have it directly integrated).

As I'm currently short on time, I don't have a problem waiting for some more days for your scripts.


Looking forward for your script(s) Big Grin

Regards
Georg
Reply
#9
(08-09-2019, 12:45 AM)Tim Curtis Wrote: Why do you need to switch between the two addressing modes?

At home when I don't change much on the network side I use STATIC, I wanted to use the speaker I built for a party that was taking place outside of the house and I switched it to DHCP just for the day so I can connect it to a different network.
After I got back to my own network I switched it back to STATIC and that's where the problem occurred.

I believe this radio station did work - http://54.173.171.80:8000/6forty
And for certain this radio station did nothttp://ic2.101.ru:8000/a260


And back to the main topic I also have not upgraded to v6 yet because of how much manual labor it requires. Since it's Saturday I might actually do it but upgrade would be a no brainier if there was a easier way to move setting and radio stations over. It may not seem like it's a lot of work, but think about if you have more then one MoOde unit...

It can feel like a chore. And trust me I like jumping on new software quickly.
Reply
#10
Actually, "bulk import/export for user added stations" has been on the TODO list for a long time but it's not a trivial amount of work and it's not getting developer priority because of other higher priority features being worked on plus the massive effort required to migrate moOde to Raspbian Buster. Keep in mind that features compete against one another for dev time and they compete with bug fixes and migration efforts.

moOde already contains code for importing files so at least that part can be reused but the rest of the feature has to be developed from scratch. Kent's Python scripts might be good bridge to a fully integrated feature but this feature would need to be written in PHP/JS. I know Kent is just dying to do some PHP/JS coding ;-)

-Tim
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply


Forum Jump: