PDA

View Full Version : Wireless access point on piCorePlayer?



rkrug
2017-12-03, 03:45
Hi

I would like to use my piCorePlayer with LMS and hdd with Music as a server to play the music e.g. on iPeng in my car.

Is it possible, and if yes how, to configure piCorePlayer as a wireless access point, so that my iPhone can connect to it?

Thanks,

Rainer

epoch1970
2017-12-03, 07:08
I've been thinking about that too, I have the iphone but not the car :)

I've found this thread (http://forums.slimdevices.com/showthread.php?107995-picoreplayer-without-network/page4) about ad-hoc mode which is not too old and might be useful.

Other than that, I haven't found a true AP recipe.
I think I'll boot a pCP 3.20.2 and see how it rolls.
I understand your use-case is the same as the linked thread, the Pi as an island, i.e. no network access at all.

Of course to set it up etc network is needed so that will be something of a routed setup that doesn't stall for ages when ethernet is not connected. A bridge would be neater though. I'll see what I can come up with.

EDIT. Also it might be worth pointing out that reversing responsibilities, with the iphone in AP mode ("personal hotspot") would work fine I think. This setup works with pCP out of the box, just set the wifi interface to the SSID and password of the iPhone's hostpot. iPeng will find the server and control the player. Bonus (?) you could use Internet streaming via the phone's 3G/4G radio link.

paul-
2017-12-03, 09:08
It can be done, the setup and configuration has to be done via ssh session. I've sent instructions to some via pm. The biggest problem is that not all wifi chips support it. I've tested it with a rpi3 a few versions ago.

drmatt
2017-12-03, 11:20
And of those that do they are not all that reliable.. I've had mixed experiences running generic consumer chipsets as APs.


Transcoded from Matt's brain by Tapatalk

Max2Play
2017-12-05, 04:29
Hi guys,

Just in case somebody might be looking for a solution without SSH sessions, we created a plugin that install the AP with one click.

We have successfully tested it with the RPi3 and RPi2 with Edimax and Logilink WiFi dongles.

Stoker
2017-12-05, 05:03
It can be done, the setup and configuration has to be done via ssh session. I've sent instructions to some via pm. The biggest problem is that not all wifi chips support it. I've tested it with a rpi3 a few versions ago.

Hi Paul

Would you be able to send instructions to me too please?

Cheers
--Ian

rkrug
2017-12-05, 05:54
It can be done, the setup and configuration has to be done via ssh session. I've sent instructions to some via pm. The biggest problem is that not all wifi chips support it. I've tested it with a rpi3 a few versions ago.

This sounds interesting. Could you either post the instructions here or send them to me directly?

moe
2017-12-06, 14:07
It can be done, the setup and configuration has to be done via ssh session. I've sent instructions to some via pm. The biggest problem is that not all wifi chips support it. I've tested it with a rpi3 a few versions ago.

Hi Paul,
I would like to test the AP configuration on my installation.
Would you be able to send the instructions to me too?
Thank You
moe

paul-
2017-12-06, 18:28
Seems this has become a hot topic again, let me make it a bit simpler to install. I should be able to do it this weekend.

epoch1970
2017-12-11, 10:48
I'm looking into this, progress isn't fast :)
I want to have bridging as an option.

After looking at the boot process and the various bits activating dhcp, static, wifi, I'm thinking what is needed first is a stable naming scheme for the interfaces.

The current PCP uses udev v.174, so something like "70-persistent-net.rules" should be working.
My rule is in a "netdevs.tcz" that is listed at the very end of onboot.lst.

It doesn't work; I've tried naming the file to "10-persistent-net.rules" but that doesn't help.
When the boot process ends, if I shut all interfaces down, reload rules and trigger them, this time I get my interfaces renamed.

With TCL/PCP as it is, do I stand a chance of getting a custom rule taken into account at boot, or shall I wait for "normal" boot to end, nuke all networking and rename/restart it? (this option would work, obviously, but I find it messy.)

paul-
2017-12-11, 11:49
I have the AP mode done, I have a couple of folks testing.

epoch, What are you bridging? two ethernet devices? Anyway to do what you want, you will need to remaster the initrd. I've heard of succuss just building CPIO initrd with just the one file you want to change, and then concatenating it to the end of the current initrd. But that seems to be a headache.

What I would do is set nodhcp bootcode on the command line, then setup your network in bootlocal.sh

I have also done layer2 and layer3 bridging with pCP wifi to ethernet.

epoch1970
2017-12-11, 12:35
I have the AP mode done, I have a couple of folks testing.

epoch, What are you bridging? two ethernet devices?
...
I have also done layer2 and layer3 bridging with pCP wifi to ethernet.
I will try that AP mode with pleasure when you release it.
Yes I was thinking of L3 bridging with the AP; either with eth0 or a USB adapter (or VLAN but I don't think that option would be too popular).

I don't know how I can interpret your last sentence; if you've done it in the AP that is being tested, then that's great. If you mean it is feasible and it works, I certainly concur with that.

Adding stuff to bootlocal.sh looks like a good option, it is flexible.

paul-
2017-12-11, 12:57
Layer 2 was possibly not the correct statement. I used a proxy arp bridge. The benefit of this is that the wifi adapter doesn't have to support monitor mode.

paul-
2017-12-16, 14:02
Alright,

I have something that is a bit easier to install....Depending on how testing goes, we should be able to integrate this into the web interface.

INSTALLATION

Go to the extension browser from the main menu.
Select piCorePlayer Sourceforge Repository
Find and Select pcp-apmode.tcz and the press the Load button
Run Backup from the main menu to backup setting changes that occurred during load.

That's it, after it loads successfully, goto the wifi page and make sure that you have not disabled the rpi3 wireless chip. Then reboot.

USE

Default IP address of the wifi interface is 10.10.10.1
Default SSID is pCP
Default passphrase is piCorePlayer
Default Channel is 7
If the ethernet cable is plugged in, then pCP will act as a DNAT router.


REMOVE

start an ssh session.
tce-audit builddb
tce-audit delete pcp-apmode
Would also be good to remove the line in /opt/bootlocal.sh that runs pcp-apmode


-------under the hood---------

When pcp-apmode.tcz loads, it will automatically load all of it's dependencies, including hostapd, dnsmasq, iptables. It will also inject a startup command into /opt/bootlocal.sh
config files are at /usr/local/etc/pcp/hostapd.conf and /usr/local/etc/pcp/dnsmasq.conf

thornton
2017-12-19, 23:49
Alright,

Find and Select pcp-apmode.tcz and the press the Load button
[/LIST]

Hi

i would really like to test this method.
The only thing for me is, that i can't find pcp-apmode.tcz in the options list.
I am running: piCorePlayer | piCorePlayer v3.22 | linux 4.9.50-pcpAudioCore | piCore v8.01 | Squeezelite v1.8.7-999 | Wed Dec 20 07:44:29 CET 2017
Do i have to update anyhow or is there any other hint for me?

Thank you in advance

Andreas

paul-
2017-12-20, 04:27
Currently only setup for a rpi3

ToddC
2017-12-23, 13:05
I, too, would love to access piCorePlayer directly on RPI3 WiFi as LMS is on different wired vLAN than main public WiFi, so would be great to access player directly with phone (Squeezer) for LMS control. Would this new project accomplish this?

I also could not find the SourceForge file...

Thanks for your work on this.

Todd

paul-
2017-12-23, 13:55
It's only located in sourceforge, you have to use the extension installer to access. But again only for rpi3.

24227

ToddC
2017-12-28, 10:53
It was there on Sourceforge this time.

Thanks for your response.

Cheers,

Todd

wtnh
2017-12-29, 11:40
Alright,

I have something that is a bit easier to install....Depending on how testing goes, we should be able to integrate this into the web interface.

INSTALLATION

Go to the extension browser from the main menu.
Select piCorePlayer Sourceforge Repository
Find and Select pcp-apmode.tcz and the press the Load button
Run Backup from the main menu to backup setting changes that occurred during load.

That's it, after it loads successfully, goto the wifi page and make sure that you have not disabled the rpi3 wireless chip. Then reboot.

USE

Default IP address of the wifi interface is 10.10.10.1
Default SSID is pCP
Default passphrase is piCorePlayer
Default Channel is 7
If the ethernet cable is plugged in, then pCP will act as a DNAT router.


REMOVE

start an ssh session.
tce-audit builddb
tce-audit delete pcp-apmode
Would also be good to remove the line in /opt/bootlocal.sh that runs pcp-apmode


-------under the hood---------

When pcp-apmode.tcz loads, it will automatically load all of it's dependencies, including hostapd, dnsmasq, iptables. It will also inject a startup command into /opt/bootlocal.sh
config files are at /usr/local/etc/pcp/hostapd.conf and /usr/local/etc/pcp/dnsmasq.conf


This is great. Have you had a chance to test on a pi Zero W? This would be the ideal portable solution.

paul-
2017-12-29, 13:23
Not yet. Too much to do, not enough time. :)

cubii
2018-01-30, 16:38
Hi paul-

I also would like to test and use it a raspberry zero.
Could you please make aversion for this one too if you find the time?

Thanks in advance!

Cubii

rmac321
2018-01-31, 17:28
Paul,
Thanks so much for making this available!!

For anyone who has it almost working, but seems like there is a disconnect between squeezelite and LMS, it could be that pCP is using the wired mac address while your squeezelite instance is on the wireless mac address. I manually set the squeezelite mac address to my wired mac address and now they are in sync.

(Greg - see I remembered about the diagnostics pages for a change.)

Thanks again Paul!!
As always, all you pCP guys rock!!

Greg Erskine
2018-01-31, 20:30
hi rmac321,

From my experience, I believe squeezelite will use wired Ethernet if it is given the choice of wired or wifi.

So the pCP web interface also does the same thing, ie given a choice of wired or wifi it will use the wired IP address. Although you can access the web interface via either IP address.

LMS seems to use the appropriate MAC address to create a player instance. So if you have a wired and a wifi connection you could have 2 tabs exist in pCP with the same squeezelite player name. LMS handles this situation and will clean out the unused one after a while.

Now when you add apmode to the equation, I am not sure what will happen. Seems like it adds another level of complication that we don't specifically handle.

Another complication is if you have 2 wifi connections. squeezelite will pick the one that sees LMS first. This can change from reboot to reboot.

regards
Greg

rmac321
2018-02-01, 15:40
Greg,
In my case rather than having 2 tabs, I had zero player tabs in pCP. The only tab showing was LMS. Looking at the LMS web interface info page I was able to determine that the LMS web interface was interacting with the wireless mac address. From the LMS interface I could start and stop the player that was outputting to my DAC. Eventually I figured out from the TFT/jivelite that there were two identically named players.

The key was on the diagnostics pages. On the Diagnostics->Raspberry Pi tab/page, I came across "Controls MAC" and it was set to the wired mac address. Based on that I tried manually setting the squeezelite mac address to that address. Hence the next Eureka! moment. After setting the mac address I then had 2 player tabs in pCP. More importantly, I could set my autostart properties so the player would start playing pretty quickly after power up.

Took the new experimental setup for a ride in the car last night. pCP in the car - woo hoo!

rmac321
2018-02-01, 15:42
Paul,
I thought I'd mention that I changed the default ssid, since I thought it might be inviting trouble driving around in a car broadcasting "pCP". I started to change it to "rolling-pCP" - but that seemed even more likely to invite attention...

paul-
2018-02-01, 17:28
The integrated version will make it easier to adjust the SSID and password. This is a WPA2 encryption, so I wouldn't worry about the SSID being "inviting"

Setting the addresses like you did is the best way to do it, there is some startup timing that confuses the auto detection. I might look into that down the road.

mroerup
2018-11-28, 03:40
Hi Paul.

I tried your extension package on a brand new piCorePlayer 4.1 installation on a Raspberry Pi 3+ using the build-in Wifi.
It doesn't seems to work and not much is happening. The Squeezeplayer doesn't start and the pCP SSID doesn't show up, when I start my Pi with the Ethernet cable disconnected.
If I reconnect the Ethernet cable everything seems to start up fine...but still no pCP SSID (which probably is fine in this situation).

Have you any idea why it doesn't work? Maybe it's not supported on a pCP 4.1 or on the Pi 3+ hardware?

Regards
Martin Roerup

Paul Webster
2018-11-28, 03:51
Maybe it's not supported on a pCP 4.1 or on the Pi 3+ hardware?

Correct - Paul- has said that there is an update coming to support it.
My guess - perhaps copying over the last firmware from Raspberry Pi Foundation might help.

paul-
2018-11-28, 08:20
Hi Paul.

I tried your extension package on a brand new piCorePlayer 4.1 installation on a Raspberry Pi 3+ using the build-in Wifi.
It doesn't seems to work and not much is happening. The Squeezeplayer doesn't start and the pCP SSID doesn't show up, when I start my Pi with the Ethernet cable disconnected.
If I reconnect the Ethernet cable everything seems to start up fine...but still no pCP SSID (which probably is fine in this situation).

Have you any idea why it doesn't work? Maybe it's not supported on a pCP 4.1 or on the Pi 3+ hardware?

Regards
Martin Roerup

Where is LMS running?

4.0.0 worked fine with the RPI 3B+, I didn't specifcally test this feature during the 4.1.0 release process, but it was pretty much unchanged. I'll test it tonight.

Paul Webster
2018-11-28, 09:15
4.0.0 worked fine with the RPI 3B+

Sorry - I was thinking of the new 3A+

mroerup
2018-11-28, 11:52
Where is LMS running?

On the same RPi 3B+. Is that a problem? I'm hoping to make a older pair of speakers become a selfcontained HiFi-system, with build-in amp, streamer and WiFi access point.

mroerup
2018-11-28, 14:34
I tried to remove pcp-apmode.tcz acording to instructions.

Then I found that I had to connect to a WiFi-net to remove the error "/usr/local/etc/pcp/wpa_supplicant.conf not found" on the WiFi tab. This creates the file.
Probably irrelevant in this case but now there are no errors here. Should I now disconnect the WiFi-connection again before reloading the pcp-apmode.tcz extension? I didn't...

After a reboot I loaded the pcp-apmode.tcz extension again...Same problem like still no pcP SSID.

I found no loaded pcp-apmode.tcz on the Extensions page which makes sense since there are no line about this in the /opt/bootlocal.sh file.
The /usr/local/etc/pcp/hostapd.conf and /usr/local/etc/pcp/dnsmasq.conf have been created though.

Seems the installation script does not inject the line in the /opt/bootlocal.sh for some reason.

Regards
Martin Roerup

paul-
2018-11-28, 15:12
This process is obsolete on 4.0.0 and beyond, it is installed and configured on the wifi web page.

I wish we could close threads.

paul-
2018-11-28, 17:57
Tested under 4.1.0, working fine. Be careful with 5G channels, as not all channels will work, and hostapd will not start.

26085
26084

mroerup
2018-11-29, 02:22
This process is obsolete on 4.0.0 and beyond, it is installed and configured on the wifi web page.

I wish we could close threads.

Hi Paul.

I read your message a few times and then went to the WiFi-tap (that was before your screendumps). Here I soon realized that it was available in the regular web-interface when I enabled the Beta feature-mode...
No longer any need for adding extensions and manually configuring textfiles or executing SSH-shell commands !!!

This wasn't really well documented anywhere on the piCorePlayer web-site and a Google search for "picoreplayer access point" sent me strait to this forum-thread.

Anyway, it works perfectly fine now on my RPi 3B+

Thank you very much for this fine feature :-)

Regards
Martin Roerup

Greg Erskine
2018-11-29, 03:17
This wasn't really well documented anywhere on the piCorePlayer web-site and a Google search for "picoreplayer access point" sent me strait to this forum-thread.

mroerup, we like adding features but not writing documentation...lol

mroerup
2018-11-29, 05:27
mroerup, we like adding features but not writing documentation...lol

...but don't feel disappointed if only few people or nobody at all uses your nice new features...coz we haven't heard about them :D

paul-
2018-11-29, 10:57
We accept donations of documentation.

Greg Erskine
2018-11-29, 13:03
...but don't feel disappointed if only few people or nobody at all uses your nice new features...coz we haven't heard about them :D

hi mroerup,

We do usually list major changes in "News". Looks like AP mode was added in piCorePlayer 3.5.0. :D

https://www.picoreplayer.org/main_news.shtml

regards
Greg

mroerup
2018-11-30, 02:26
hi mroerup,

We do usually list major changes in "News". Looks like AP mode was added in piCorePlayer 3.5.0. :D

https://www.picoreplayer.org/main_news.shtml

regards
Greg

So it is....Sorry for the unnecessary buzz !!! Guess I was looking/searching for "access point" and not "AP".