PDA

View Full Version : picoreplayer without network



steff
2017-09-17, 14:36
Hello
I was trying to use my Rpi3 without network, just playing from local USB stick.
My Rpi3 host everuthing on it and the LMS too.
The problem is that with network connection active (WiFi or wired Ethernet) everything works fine, but without network it can not play the local file on the USB stick.
It seems that if the network is not up, the player can not connect to the local LMS on the 127.0.0.1 local address, since the network is down.

I am running 3.21 version.

How to fix it?

paul-
2017-09-17, 15:33
It's not really intended to be a non-networked server. For sure you will need to setup LMS to use the nomysqueezebox option. You might also need to specify the server address for squeezelite to connect to.

Since pCP is expecting a network, it will take a minute or two to time out and finish the bootup. Otherwise should work fine.

Hook up a monitor and keyboard to watch the startup process and see what is going on.

steff
2017-09-18, 01:18
It's not really intended to be a non-networked server. For sure you will need to setup LMS to use the nomysqueezebox option. You might also need to specify the server address for squeezelite to connect to.

Since pCP is expecting a network, it will take a minute or two to time out and finish the bootup. Otherwise should work fine.

Hook up a monitor and keyboard to watch the startup process and see what is going on.


Sorry, I can not understand: why should I need a network to play files locally stored on the USB stick? Moreover everything is in the very same box: player, LMS, storage.
The LMS server address of course is specified and it is the 127.0.0.1 as suggested (if I leave it blank, it wont play even if networked) but seems that if network is not UP, then TCP\IP is not avaialble, so not way for the player to reach the LMS even if running in the same box.

I found the same question here

http://forums.slimdevices.com/showthread.php?101339-Using-the-Touch-without-Internet

but on my setup there is no way to get the option to go on without network.

DJanGo
2017-09-18, 01:38
Sorry, I can not understand: why should I need a network to play files locally stored on the USB stick? Moreover everything is in the very same box: player, LMS, storage.



If you look @ the startupscript from lms:


# Required-Start: $all
That means also "Network"
Since lms is a server for network attached players - you need a network.

Why didnt you just attach a simple wlan adapter into your pi ?

btw: The Touch and the rpi are two complete different things - you cant compare them in this case.

drmatt
2017-09-18, 01:59
It is normal for a UNIX system to require an operating 127.0.0.1 address and TCP/IP stack for normal running. Windows is the same, as are 90% of general use operating systems.


Transcoded from Matt's brain by Tapatalk

steff
2017-09-18, 02:10
If you look @ the startupscript from lms:

That means also "Network"
Since lms is a server for network attached players - you need a network.

Why didnt you just attach a simple wlan adapter into your pi ?

btw: The Touch and the rpi are two complete different things - you cant compare them in this case.

My Rpi3 has the built in WiFi... I can even attach a USB WiFi adapter, but if not registered on a network, it will not play.

Maybe linux works different from Windows: in Windows, if the the PC has a network adapter, even if not connected, the TCP\IP works!
In linux it seems not to be the same... TCP/ip is not up if the network adapter is not connected, so no way for the LMS to start (and for the player to reach it).

This is my case: I have this PiCorePlayer in a box with amplifier, speakers and batteries.
Wish to play my music even if I am, for example, at the sea, on the beach.

Jeff07971
2017-09-18, 02:51
Hello
I was trying to use my Rpi3 without network, just playing from local USB stick.
My Rpi3 host everuthing on it and the LMS too.
The problem is that with network connection active (WiFi or wired Ethernet) everything works fine, but without network it can not play the local file on the USB stick.
It seems that if the network is not up, the player can not connect to the local LMS on the 127.0.0.1 local address, since the network is down.

I am running 3.21 version.

How to fix it?

Out of interest, How are you controlling the player ?

bpa
2017-09-18, 03:11
LMS TCP/IP socket to communicate with players so it needs a network IIRC even if you use LocalPlayer plugin which bypasses nertwork for playing files.
I don't know pCP but if the network interface confgrued using DHCP and you have no network connection then none of the basic network parameters will be setup such as IP address of interface (even if not up), gateway/default Route and subnet mask. Can these not be setup manually on pCP ?

kidstypike
2017-09-18, 03:24
max2play has a plugin that uses your pi's built-in wifi to create it's own network, piCorePlayer doesn't offer this option.

I use this in my car, controlled with Squeeze Ctrl on my phone, it works great, see my sig.

https://www.max2play.com/en/portfolio/plugin-access-point-2/

23674

23675

steff
2017-09-18, 03:53
Out of interest, How are you controlling the player ?

I am using the official Raspberry LCD display and Jivelite.

steff
2017-09-18, 03:55
LMS TCP/IP socket to communicate with players so it needs a network IIRC even if you use LocalPlayer plugin which bypasses nertwork for playing files.
I don't know pCP but if the network interface confgrued using DHCP and you have no network connection then none of the basic network parameters will be setup such as IP address of interface (even if not up), gateway/default Route and subnet mask. Can these not be setup manually on pCP ?

I will try to set a static IP address on the wired Ethernet and see if the network will come up, but I suppose it will not.

Julf
2017-09-18, 04:16
This is my case: I have this PiCorePlayer in a box with amplifier, speakers and batteries.
Wish to play my music even if I am, for example, at the sea, on the beach.

So why don't you just use a local player program instead of a network player one?

DJanGo
2017-09-18, 04:43
30 secs using the external brain called g00gle...

http://forum.tinycorelinux.net/index.php?topic=16181.0

paul-
2017-09-18, 12:57
Seems alot want a non-networked, network streamer. I have it all working, but Integrating if for the non-linux person is where I fall short in the time needed to do it.

steff
2017-09-18, 14:58
SOLVED

I can not understand why so many wonder why the need to have a network streamer not networked...

Anyway it was more simple than what I could imagine... I just configured a static IP address and... problem solved.
I now have two "storage"... one is the local 256 GB USB stick for low resolution commercial music and the other one is the HP Proliant running as a NAS with TB of high resolution music.
If I am in my studio I can play both... if I move to the pool, I play from USB without reconfiguring anything.

Thanks to all.

edwin2006
2017-09-19, 01:10
Hm, perhaps providing decent wifi at the pool is also a solution?
I use my phone with a set bt speakers when I'm outside

JQW
2017-09-20, 13:12
I've a simple fix to this issue - I've created a hotspot on my phone that uses the same SID and passphrase as the usual wireless router, allowing piCorePlayer to startup normally when used remotely. I just need to remember to make sure I have my phone on me, and it's charged!

c3p0
2017-09-29, 21:58
I've a simple fix to this issue - I've created a hotspot on my phone that uses the same SID and passphrase as the usual wireless router, allowing piCorePlayer to startup normally when used remotely. I just need to remember to make sure I have my phone on me, and it's charged!

I'm trying to build a portable player that switches easily between my home network for samba transfer of music and the outside world, my solution is using an esp8266 in ap and station mode that mimics my home hub Sid and password. This allows picore wifi settings to remain the same but i can access the music easily by use of mobile phone linked to esp8266 hub for control.

slimhase
2017-09-30, 10:24
...
http://forum.tinycorelinux.net/index.php?topic=16181.0

Did anyone in this community try this?
It would be a s/w solution to moving a piCorePlayer between different WiFi environments!
Unfortunately, the thread stops before the s/w is fully funtional - WIFI and ad-hoc fallback seems to work, but generating web-page to enter the new credential and passing them to piCorePlayer is not done.
Also, unfortunately: This is beyond my current capabilities....

Jeff07971
2017-09-30, 10:30
Did anyone in this community try this?
It would be a s/w solution to moving a piCorePlayer between different WiFi environments!
Unfortunately, the thread stops before the s/w is fully funtional - WIFI and ad-hoc fallback seems to work, but generating web-page to enter the new credential and passing them to piCorePlayer is not done.
Also, unfortunately: This is beyond my current capabilities....

http://forums.slimdevices.com/showthread.php?107995-picoreplayer-without-network&p=895062&viewfull=1#post895062

slimhase
2017-09-30, 10:39
http://forums.slimdevices.com/showthread.php?107995-picoreplayer-without-network&p=895062&viewfull=1#post895062

Hm - I don't think this is the same topic. I am not talking about a non-network setup.
Maybe, I misunderstand something, though....

Jeff07971
2017-09-30, 10:45
Hm - I don't think this is the same topic. I am not talking about a non-network setup.
Maybe, I misunderstand something, though....

Yes maybe you're right.

Can you not just set a fixed ip address on the pi ? I believe you can then use LMS and SL/JL without a network

slimhase
2017-09-30, 10:51
Yes maybe you're right.
Can you not just set a fixed ip address on the pi ? I believe you can then use LMS and SL/JL without a network

maybe, I accidentally hijacked this thread....if so, I am sorry.
My use case is moving a piCorePlayer from one Wifi network to a different, so I don't have means to login to the new network.
The link from tiny core linux: http://forum.tinycorelinux.net/index.php?topic=16181.0
discusses just that, but the thread (from 2013) went silent before there was a funtional setup....

Therefor my question, if anyone followed that path and got anywhere..

Jeff07971
2017-09-30, 11:13
maybe, I accidentally hijacked this thread....if so, I am sorry.
My use case is moving a piCorePlayer from one Wifi network to a different, so I don't have means to login to the new network.
The link from tiny core linux: http://forum.tinycorelinux.net/index.php?topic=16181.0
discusses just that, but the thread (from 2013) went silent before there was a funtional setup....

Therefor my question, if anyone followed that path and got anywhere..

And I think Paul- responded to you he has it working but has not the time to integrate it that was the link I posted

slimhase
2017-09-30, 11:33
And I think Paul- responded to you he has it working but has not the time to integrate it that was the link I posted

Paul, can you shed some light here?

Seems alot want a non-networked, network streamer. I have it all working, but Integrating if for the non-linux person is where I fall short in the time needed to do it.
Were you referring to "WIFI or ad-hoc setup" here?

Jeff07971
2017-09-30, 11:45
Paul, can you shed some light here?

Were you referring to "WIFI or ad-hoc setup" here?

Both / Either if it cannot connect to an access point it creates an ad-hoc access point then you can connect and setup your "Other" wifi and reboot.

OR you can use the ad-hoc network to control the LMS/SL without connecting to the "Other" network

You need networking to connect to the Pcp "wifi" page to change the wifi settings

paul-
2017-09-30, 12:12
lol, that thread was both AD-Hoc and AP mode.

What I have partially setup is hostapd (Ap mode and Dnat routing if the ethernet is plugged in too)


You are moving between two different locations with different SSID's You could just use two different SD cards

slimhase
2017-09-30, 13:10
lol, that thread was both AD-Hoc and AP mode.
What I have partially setup is hostapd (Ap mode and Dnat routing if the ethernet is plugged in too)
You are moving between two different locations with different SSID's You could just use two different SD cards

It must be my 'german english' that I can not make myself clear....
With "WIFI or ad-hoc setup" I meant one solution which can do both.
Different SD cards won't work, as the Pi is inside the Tivoli PAL.....

So, if anyone has some leads on how to setup a system, which can go into adhoc mode, if it can not connect to a WiFi network - please let me know.

paul-
2017-10-01, 12:53
Setting up a simple ad-hoc network can be done......the biggest problem is that ad-hoc on the rpi does not support wpa encryption. All you can do is open or WEP.

if you edit the file /opt/bootlocal.sh. Add the following lines AFTER the #pCPstop------ line



ifconfig | grep -q Bcast
if [ $? -ne 0 ]; then
echo "Entering Wifi Ad-Hoc mode"
pkill udhcpd

[ ! -d /var/lib/misc ] && mkdir /var/lib/misc
touch /var/lib/misc/udhcpd.lease

cat << EOF > /etc/udhcpd.conf
interface wlan0
start 10.10.10.2
end 10.10.10.10
opt subnet 255.255.255.0
opt dns 10.10.10.1
opt router 10.10.10.1
EOF

ifconfig wlan0 down
iwconfig wlan0 mode ad-hoc
iwconfig wlan0 key 1234567ABC
iwconfig wlan0 channel 6 essid pCP
ifconfig wlan0 10.10.10.1 netmask 255.255.255.0 up

udhcpd

DONE=0
until [ $DONE -ne 0 ]; do
if [ "$(iwgetid -r)" != "pCP" ]; then
echo "New SSID Connected"
DONE=1
fi
ifconfig eth0 | grep -q Bcast
if [ $? -eq 0 ]; then
echo "eth0 is now up"
DONE=1
fi
sleep 5
done
pkill udhcpd
echo "Exiting"
fi


You can make the WEP key anything you want (as above its 1234567ABC)....... there is no DNS server so once the adhoc is up and your device connects to it.......the address of the pCP device will be 10.10.10.1. My iphone takes along time to accept its dhcp lease, perhaps setting that connection as a static would work faster. Again, this setup is just for configuration. Once you click on Save/Connect on the wifi page, wait for the backup to get done....you will see it try to connect, this obviously kills the ad-hoc network. Your device should come online just fine. If you are running LMS, then you probably need to power cycle your box. If you want to force a reboot after connecting, then put a line pcp rb after the echo "Exiting" statement.

slimhase
2017-10-02, 02:32
Setting up a simple ad-hoc network can be done......the biggest problem is that ad-hoc on the rpi does not support wpa encryption. All you can do is open or WEP.

if you edit the file /opt/bootlocal.sh. Add the following lines AFTER the #pCPstop------ line



ifconfig | grep -q Bcast
.............
echo "Exiting"
fi


You can make the WEP key anything you want (as above its 1234567ABC)....... there is no DNS server so once the adhoc is up and your device connects to it.......the address of the pCP device will be 10.10.10.1. My iphone takes along time to accept its dhcp lease, perhaps setting that connection as a static would work faster. Again, this setup is just for configuration. Once you click on Save/Connect on the wifi page, wait for the backup to get done....you will see it try to connect, this obviously kills the ad-hoc network. Your device should come online just fine. If you are running LMS, then you probably need to power cycle your box. If you want to force a reboot after connecting, then put a line pcp rb after the echo "Exiting" statement.

Great - thank you!
I will try that asap.
2 questions:
1) Where do I specify, if I use open or WEP? (I don't see that in the above script.)
2) The limitation "only open or WEP" applies only while in adhoc, correct? Once I am connected via adhoc, I can update the 'real' network credentials on the WiFi page w/o this limitation just as before, right?

This would be a great solution for my situation - thanks so much!

paul-
2017-10-02, 03:43
The line that has the key in it. Set it to off if you want it open. Or change it to a valid wep key. Yes it only applies to the ad hoc network. Normal WiFi is fully encrypted t whatever your WiFi router is set to.

slimhase
2017-10-04, 12:50
The line that has the key in it. Set it to off if you want it open. Or change it to a valid wep key. Yes it only applies to the ad hoc network. Normal WiFi is fully encrypted t whatever your WiFi router is set to.

This works like a charm - thanks, Paul!
Exactly what I was looking for!
(My Windows Tablet refuses to join the generated adhoc network - but my Iphone connects w/o issues)

cubii
2017-10-12, 11:51
Setting up a simple ad-hoc network can be done......


Hi paul,

I tried this code and got a wifi which can be found with my notebook, but i am not able to connect. Wit an old ipod touch i can connect, but cannot open the picore webpage (http:\\10.10.10.1) in your example.
My moto x play cannot find the network at all....

Are these problems driver/wifistick hardware related or can i try some other settings to get this running?

Using a pi zero with picore 3.22 and a cheap 1 euro wifi stick.

But will try it also with a pi 3 and a pizero w, but tomorrow or so...

cubii

paul-
2017-10-12, 13:09
I only tested the ZeroW and rpi3 wifi devices. I'm sure this is going to be very driver/device dependent.

shaunm
2018-07-29, 10:49
Great work on this project, I'm having the following issue with standard PiZeroW. Do you have a link so I can donate?


if you edit the file /opt/bootlocal.sh. Add the following lines AFTER the #pCPstop------ line



ifconfig | grep -q Bcast
if [ $? -ne 0 ]; then
echo "Entering Wifi Ad-Hoc mode"
pkill udhcpd

[ ! -d /var/lib/misc ] && mkdir /var/lib/misc
touch /var/lib/misc/udhcpd.lease

cat << EOF > /etc/udhcpd.conf
interface wlan0
start 10.10.10.2
end 10.10.10.10
opt subnet 255.255.255.0
opt dns 10.10.10.1
opt router 10.10.10.1
EOF

ifconfig wlan0 down
iwconfig wlan0 mode ad-hoc
iwconfig wlan0 key 1234567ABC
iwconfig wlan0 channel 6 essid pCP
ifconfig wlan0 10.10.10.1 netmask 255.255.255.0 up

udhcpd

DONE=0
until [ $DONE -ne 0 ]; do
if [ "$(iwgetid -r)" != "pCP" ]; then
echo "New SSID Connected"
DONE=1
fi
ifconfig eth0 | grep -q Bcast
if [ $? -eq 0 ]; then
echo "eth0 is now up"
DONE=1
fi
sleep 5
done
pkill udhcpd
echo "Exiting"
fi




I've tried this script with PiCorePlayer 3.22 and a standard PiZeroW, but it does the following:

On the terminal window, the adding the above code goes through the usual boot process...

***NOTE 1*** Allowing the wlan0 to fail 3 times, then
Loading pcp-lms-functions... Done.
Waiting for soundacrds to populate. Done (1).
Starting ALSO configuration... Done.
Waiting for network................................ No network found! Done (42).
Starting Openssh server... Done.
Mounting USB Drives....
***NOTE 2*** Starting LMS, this can take some time... No network interface is UP.....exiting
Done.
Starting httpd web server... Done.
Finished piCorePlayer setup.
crond syncing time...
Entering Wifi Ad-Hoc mode
ifconfig eth0: eth0 error fetching interface information device not found
ifconfig eth0: eth0 error fetching interface information device not found
ifconfig eth0: eth0 error fetching interface information device not found
ifconfig eth0: eth0 error fetching interface information device not found
...(this message repeated every 5 seconds forever)

1. On my Windows PC, I can then connect to network "pCP", can access "10.10.10.1" which gets me to the piCoreplayer screen and then I manually start LMS and everything is okay.

2.
***NOTE 1*** This wait is HUGE, and always of course fails when using the ad-hoc network, so I have to do the manual start of LMS in the sentence above. I tried turning off "Autostart LMS" in the settings
***Question 1*** I was looking for a config file to change the retries from 3 to 1 using a -t flag. Is there a config file and it this possible?

3.
***NOTE 2*** This wait is HUGE, and always of course fails when using the ad-hoc network, so I have to do the manual start of LMS in the sentence above. I tried turning off "Autostart LMS" in the settings to avoid this wait but it then breaks LMS totally, as when I try the manual start (when connected to a regular wifi or the ad-hoc one) it just hangs.

4.
***NOTE 2*** The ad-hoc network cannot be seen by all my android devices (I was hoping to use my phone to manually switch the LMS on.
***Question 2*** Is there a way to start LMS in the script above before it hits the "ifconfig eth0: eth0 error fetching interface information device not found" loop?

Thanks again for all your hard work on this, and it you have a donate link, let me know.

paul-
2018-07-29, 11:30
I would take a look at pCP 3.5.0 or the newly released 4.0.0 beta. That will do a full AP Mode setup now, and for sure will run LMS with just the AP running.

The only catch is the original setup on a zero. You really need to temporarily connect a USB ethernet device for initial configuration.

shaunm
2018-08-02, 10:40
I would take a look at pCP 3.5.0 or the newly released 4.0.0 beta. That will do a full AP Mode setup now, and for sure will run LMS with just the AP running.

The only catch is the original setup on a zero. You really need to temporarily connect a USB ethernet device for initial configuration.

Hi Paul,

I am using a Pi ZeroW, so no problem there.

Thanks for your reply about 3.5 (I started working with this back in February which is why I was still on 3.2)

I tried a fresh install of 3.5.0 and everything went to plan with the setup until the library media scan...which said it worked ok and I can see on the :9000 page "1824 albums with 23738 songs by 743 artists. However, the "My Music" folder is empty and when I connect with my Squeezebox Classic it says the music library is "empty". I've rebooted twice and also re scanned the library.

Then I went back to the SD card backup with version 3.2 and did the in-situ update to 3.5. This worked fine, media library all okay. When I switched AP Mode on, it froze. I rebooted the Pi Zero and it connected fine.

However, it drops the connection when playing a song, coming back to life 30 seconds later. Trying to navigate the menu kills the connection everytime. I'm going to now upgrade to version 4 and the kernel version to see if that fixes it. Is it that the PiZero just isn't powerful enough?

paul-
2018-08-02, 15:44
You also need to make sure the nomysqueezebox option is turned on.

shaunm
2018-08-06, 06:11
You also need to make sure the nomysqueezebox option is turned on.

Thanks Paul, in LMS Settings, I have selected don't download updates and don't search for updates and added 10.10.10.1 as safe IP addresses it now works flawlessly. I haven't tried the -nomysqueezebox tag it's taken me ages to get to this point and so I'm thinking "if it ain't broke don't fix it".

I now can play my WMAL music collection of just under 24,000 songs, converting to FLAC to my Squeezebox Classic, replacing
1. Wifi Router
2. Wifi Signal Booster (to get the wifi downstairs)
3. An old laptop running LMS
4. A 5.25" HDD
(total power 600W (according to my plugin meter)
1. Pi Zero W
2. 3.5" USB HDD
(total power 30W!!!!!!!!!!!!!!!!!)

Thanks to you and all involved for all your amazing work on this, and your fast and comprehensive replies and finally your patience with all our silly questions!

I'm now going to make a donation.

Jeff07971
2018-08-06, 06:16
Thanks Paul, in LMS Settings, I have selected don't download updates and don't search for updates and added 10.10.10.1 as safe IP addresses it now works flawlessly. I haven't tried the -nomysqueezebox tag it's taken me ages to get to this point and so I'm thinking "if it ain't broke don't fix it".

I now can play my WMAL music collection of just under 24,000 songs, converting to FLAC to my Squeezebox Classic, replacing
1. Wifi Router
2. Wifi Signal Booster (to get the wifi downstairs)
3. An old laptop running LMS
4. A 5.25" HDD
(total power 600W (according to my plugin meter)
1. Pi Zero W
2. 3.5" USB HDD
(total power 30W!!!!!!!!!!!!!!!!!)

Thanks to you and all involved for all your amazing work on this, and your fast and comprehensive replies and finally your patience with all our silly questions!

I'm now going to make a donation.

Glad you have a solution that works for you !

You need a new plugin meter though !!

Jeff

shaunm
2018-08-06, 07:51
Glad you have a solution that works for you !

You need a new plugin meter though !!

Jeff

Yeah, all sounds rather high doesn't it, there's a power-factor thing I don't understand, but it's good to have a relative figure rather than an absolute one! Ignorance (in this instance) for me is bliss!