LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   SBC (R-Pi) in-car music server (from "backup") (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/sbc-r-pi-in-car-music-server-from-backup-4175735493/)

imWACC0 03-30-2024 10:45 AM

SBC (R-Pi) in-car music server (from "backup")
 
I know this can be done in two parts, but I'm looking for a "both-in-one". How do I get the Wi-Fi on the SBC to connect to two different networks? Do I need two Wi-Fi cards on the SBC? (and if "yes" HOW???)


What I need from the SBC:

1) Sync/back-up from the home server, over Wi-Fi, from folder "Music"


I don't know if I need to push or pull. If I put new songs on to my server, I want the same songs on the SBC.

2) Serve up that music over Wi-Fi (maybe Bluetooth) to the Android car radio


Ok, I've got the music on the SBC, how do I get it to switch to serving music to the radio?



I have the parts to make an auto-shut-down pi server in my car. I have a server (MX Linux) in my home. I'm able to put an access-point/repeater just for the car to use.

I don't have the Android radio yet. So, I can't give specs yet. Looking for a good system ATM

lvm_ 03-30-2024 12:38 PM

Am I correct in understanding, that you want to sync music from your home server to your car audio? Then why do you need a third entity? If your car is parked within the reach of your home wifi, install something like syncthing directly on the radio and it will keep the folders synced, if not - you'll have to carry your SBC in your pocket so why not carry an SD card instead?

michaelk 03-30-2024 02:08 PM

How to connect to the radio would depend on the radio's specifications and all seem to want to use either Apple car play or Android Auto apps. I do not know if it would be as simple as connecting over bluetooth and programming the Pi to be a music server using A2DP, AVCRP etc.

Assuming the Pi is headless, at moment I can only envision updates when the car is turned off. Some script that runs on shutdown to check if you are at home and connect to your wifi AP, for a flag that indicates an update is required and then sync the music files to the Pi.

imWACC0 03-30-2024 02:32 PM

Quote:

Originally Posted by lvm_ (Post 6492978)
Then why do you need a third entity?
you'll have to carry your SBC in your pocket so why not carry an SD card instead?

The built in storage is going to be small (I ass-u-me) I can make a 1Tb SBC, get lots of good music.
Why do I need to carry it? I install into the car, with a dedicated PSU (with auto off*). There's so many places to hide something that small in a car.









* I ass-u-me you know there's two pins on a SBC to short out that will run a shutdown -h now script? Also, they make small PSU that you hook into 12v AND Accessory, if the key is off it will tell the SBC to turn off.

imWACC0 03-30-2024 02:56 PM

Quote:

Originally Posted by michaelk (Post 6492993)
(1)want to use either Apple car play or Android Auto apps.
(2)I do not know if it would be as simple as connecting over bluetooth and programming the Pi to be a music server
(3)Assuming the Pi is headless
(4)Some script that runs on shutdown to check if you are at home and connect to your wifi AP, for a flag that indicates an update is required and then sync the music files to the Pi.

(1) That's why I'm getting a Droid system, I know how to do it with my phone, I hope it's the same on a Droid "radio"
(2) I've not done it with Bluetooth, but works with Wi-Fi
(3) Yes, headless
(4) Any hint on how to do that? I know where to find the turn-off script https://howchoo.com/pi/how-to-add-a-...-raspberry-pi/

michaelk 03-30-2024 05:18 PM

4) If you are running Pi OS bookworm then it uses Network Manager by default. You can use nmcli to control on/off, check connections etc via a shutdown service script that runs from systemd. There are various ways to create some sort of simple http server that outputs something when accessed by curl. If the output indicates updates then sync the Pi with the server.

2) A streaming server isn't quite the same as wifi. Without knowing anything about the radio it could connect to a phone over bluetooth like a speaker or headset and use commands to start/stop etc. or Android auto app and I have no idea how that works.

lvm_ 03-31-2024 01:08 AM

Quote:

Originally Posted by imWACC0 (Post 6492997)
The built in storage is going to be small (I ass-u-me) I can make a 1Tb SBC, get lots of good music.

Benny Hill reference is appropriate. A rare car audio won't have SD and/or USB ports, so you can expand its storage to anything you want without an in-car server (which will be using the same SD card as storage, by the way). And 1T is not a lot, it's way too much even for a uber driver. At insane preset it is a year of 24h uninterrupted mp3 music. Are you planning to live in you car? I am using a 16G card in my (stock) car audio and it takes months to play it once.

Excuse me for saying so, but aren't you just dying to do anything at all as long as SBC is involved? :)

imWACC0 03-31-2024 02:21 AM

Quote:

Originally Posted by michaelk (Post 6493033)
If you are running Pi OS bookworm

I've not used Pi OS much, not sure it's the best distro for this. I was thinking Debian, if I NEED a GUI, or Ubuntu Server. Maybe piCore (Tiny Core Linux)?

Gods I miss Damn Small Linux! Yeah, I know he's made a new one, but it doesn't work on Arm. DSL would be perfect for SBC.

imWACC0 03-31-2024 02:38 AM

Quote:

Originally Posted by lvm_ (Post 6493095)
(1) which will be using the same SD card as storage
(2) Excuse me for saying so, but aren't you just dying to do anything at all as long as SBC is involved? :)


(1) You do know that other storage can be added to SBC? And I don't mean just USB, have you looked at the specs for Pi 4 or 5?
(2) Don't kink shame, it's rude :rolleyes:


If I had a system that was 12v or less, that I knew would work, I'd use that.

lvm_ 03-31-2024 04:49 AM

Quote:

Originally Posted by imWACC0 (Post 6493106)
You do know that other storage can be added to SBC?

Yes, but for this task it would be pointless - SD card is more than sufficient. But then, this whole idea is pointless, so what am I talking about? Ok, for you it's means, not aims, so the reason is wasted, back to your original questions: one wifi interface can be connected only to one network at a time, so you will either need two or have to employ some intelligent switching or use bluetooth for audio, but bluetooth is not ideal either because A2DP requires player with UI to be run on SBC; I am not sure how you can use OBEX here and it is no good anyway because it pushes whole files, and while LAP (LAN access bluetooth profile) exists I never heard of android client. So introducing SBC will make this task way more complicated, expensive and interesting than solving it on android alone. Ockham is right again.

onebuck 03-31-2024 07:36 AM

Moderator Response
 
Moved: This thread is more suitable in <Linux - Embedded & Single-board computer> and has been moved accordingly to help your thread/question get the exposure it deserves.

business_kid 04-03-2024 07:34 AM

I have been involved in developing Electronics hardware for the automotive environment. It's a noisy place.
  • "Load dumps." These are significant rises in voltage. Starter motor release is one cause. Alternators cutting out is another. I had transistors blown out of a circuit that had one 55V load dump lasting nearly half a second. I had an oscilloscope on the line at the time.
  • If anything with brushes is in use, you can get brush wear which means there is a tiny break in contact between one commutator section and the next. That can be responsible for tiny spikes of several hundred volts.
  • Normal driving can produce situations where several things are simultaneously pushing voltages up or down.

I'd do what normal people do and use your mobile phone.


All times are GMT -5. The time now is 08:31 AM.