PiCorePlayer and wifi Access Point in Bridge mode

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • epoch1970
    Senior Member
    • Apr 2008
    • 2280

    #16
    Originally posted by paul-
    I just tested, and it's working as designed (obviously with the updated kernel modules) It was intended to bridge eth0 to wlan0, where the eth0 is the upstream connection to your main network. I'm browsing the internet from my cell phone connected to the wifi AP created by pCP, and my phone has a DHCP address assigned by my primary network DHCP server.
    I updated (minor, patch) and rebooted. I'm running 7.0.1, regular kernel flavor.
    It doesn't work for me, the "bridged" access point does not deliver an IP address. Which I can understand if the same code as I've seen yesterday is running the show.
    To make the running AP actually work, I have to:
    - ssh in the machine (bridge with eth0 in it are ok)
    - sudo vi /usr/local/etc/pcp/hostapd.conf, add line "bridge=br0", save
    - Stop and start the AP from the GUI.

    It doesn't work because brctl show indicates the wireless interface is not bridged. This is because the option is missing from hostapd.conf as generated by the cgi script. (at least that was the cause yesterday)
    And it starts working as soon as the bridge option is added to hostapd, and the process restarted so that it re-reads the configuration.

    I stand by my guns.
    2 SB 3 • 1 PCP 7 • Libratone Loop, Zipp, Zipp Mini • iPeng (iPhone + iPad) • LMS 8.1 (docker) with plugins: CD Player, WaveInput by bpa • Material Skin by Craig Drummond • IRBlaster by Gwendesign (Felix) • Smart Mix, Music Walk With Me, What Was That Tune? by Michael Herger • PowerSave by Jason Holtzapple • Song Info, Song Lyrics by Erland Isaksson • BBC Sounds by Stuart McLean • AirPlay Bridge by philippe_44 • Auto Dim Display, SaverSwitcher, ContextMenu by Peter Watkins.

    Comment

    • paul-
      Senior Member
      • Jan 2013
      • 5778

      #17
      Brctl is creating the bridge. Hostapd does care or need to know it’s in a bridge, the kernel handles it.

      The cgi doesn’t do the work, it’s done in shell scripts.
      Code:
      brctl addbr br0
      brctl addif br0 eth0 wlan0
      So for some reason your system is failing during bridge creation. What rpi board are you using? What WiFi chip are you using?
      piCorePlayer a small player for the Raspberry Pi in RAM.
      Homepage: https://www.picoreplayer.org

      Please donate if you like the piCorePlayer

      Comment

      • epoch1970
        Senior Member
        • Apr 2008
        • 2280

        #18
        Originally posted by paul-
        Brctl is creating the bridge. Hostapd does care or need to know it's in a bridge, the kernel handles it.

        The cgi doesn't do the work, it's done in shell scripts.
        Code:
        brctl addbr br0
        brctl addif br0 eth0 wlan0
        So for some reason your system is failing during bridge creation. What rpi board are you using? What WiFi chip are you using?
        Brctl creates the bridge. This part is correct. That work on my machine, too.
        Hostapd does care or need to know it's in a bridge , the kernel handles it. This is wrong, twice.
        1 - The kernel has about nothing to do with all this.
        2 - Bridging a wireless interface in client mode is not possible as per WiFi specs. The default mode of a WiFi interface is client. Hostapd turns the interface to AP mode, and after that can take care of bridging it. It is the proper way of doing things.
        The cgi doesn't do the work, it's done in shell scripts. This is irrelevant, and hopefully untrue. My eyes tell me the cgi creates the hostapd config file, and that's where the beef is. If some code, in pcp-apmode I assume, did what you pretend, that would be unfortunate since the code would only work in case hostapd has finished turning the interface to AP mode; that code would be racy and brittle. But fortunately, that's not how pcp-apmode is written. It eschews bridging wlan0. And that job has to be done by hostapd.
        So for some reason your system is failing during bridge creation. It is not. The bridge is created and eth0 is in it. Only wlan0 is not in it. Hostapd runs but no IP is delivered to clients. For the third time, the solution is to handle hostapd option bridge= in the cgi.
        What rpi board are you using? What WiFi chip are you using? Pi 3B with built in wireless interface. Works fine once the interface is added to the bridge...
        Last edited by epoch1970; 2021-04-25, 13:51. Reason: Formatting
        2 SB 3 • 1 PCP 7 • Libratone Loop, Zipp, Zipp Mini • iPeng (iPhone + iPad) • LMS 8.1 (docker) with plugins: CD Player, WaveInput by bpa • Material Skin by Craig Drummond • IRBlaster by Gwendesign (Felix) • Smart Mix, Music Walk With Me, What Was That Tune? by Michael Herger • PowerSave by Jason Holtzapple • Song Info, Song Lyrics by Erland Isaksson • BBC Sounds by Stuart McLean • AirPlay Bridge by philippe_44 • Auto Dim Display, SaverSwitcher, ContextMenu by Peter Watkins.

        Comment

        • paul-
          Senior Member
          • Jan 2013
          • 5778

          #19
          I love the use of the word "wrong". I know you to tinker around with enough stuff to know that there are more than one way to tackle a task. The hostapd documentation clearly states that it "can" be used. That does not mean it has to be used, and it for sure does not mean that hostapd has to manage the bridge.

          But Looking a the scripting, I will agree that there could have been a race condition in the startup of hostapd and configuring the bridge. But I'm going to solve that with and easier update route for me. I've updated the extension. Just press the update button on the APMode web page.
          piCorePlayer a small player for the Raspberry Pi in RAM.
          Homepage: https://www.picoreplayer.org

          Please donate if you like the piCorePlayer

          Comment

          • epoch1970
            Senior Member
            • Apr 2008
            • 2280

            #20
            Well thank you for the update, indeed it works for me now. That's great.

            There is at least one advantage to bridging in the script, the AP could be run by wpa-supplicant and not hostapd. Wpa-supplicant doesn't bridge the interface for you, AFAIK.
            Code:
            network={
                mode=2
                ssid="TestAccessPoint"
                key_mgmt=WPA-PSK
                proto=RSN
                group=CCMP TKIP
                psk="password"
                frequency=2437
            }
            FYI, I had to reboot twice during the process:
            - After download/install: unable to configure a channel until rebooted. Wireless firmware not loaded, I guess.
            - After first config/start: the mDNS IP advertisement was, shall I say, not right. The machine advertised 10.10.10.1 (the AP's address in case it is not bridged). Looks benign but if you're like me and use "http://hostname.local" to reach the GUI, the GUI freezes at some point. A reboot fixes the advertisement to the correct address.

            I think I'll get rid of my hardware AP now. Thanks again.
            2 SB 3 • 1 PCP 7 • Libratone Loop, Zipp, Zipp Mini • iPeng (iPhone + iPad) • LMS 8.1 (docker) with plugins: CD Player, WaveInput by bpa • Material Skin by Craig Drummond • IRBlaster by Gwendesign (Felix) • Smart Mix, Music Walk With Me, What Was That Tune? by Michael Herger • PowerSave by Jason Holtzapple • Song Info, Song Lyrics by Erland Isaksson • BBC Sounds by Stuart McLean • AirPlay Bridge by philippe_44 • Auto Dim Display, SaverSwitcher, ContextMenu by Peter Watkins.

            Comment

            • oliverbg1
              Junior Member
              • Apr 2021
              • 19

              #21
              It works too on my configuration.

              I had to start with a new fresh install of pcp and after configuration it will work... I have now wifi and music in one device in my garden. Thanks for this really good job ! ;-)

              As far as this issue is resolve ap-mode should be a stable feature...

              Comment

              • Wirrunna
                Senior Member
                • Jan 2006
                • 1309

                #22
                Well, I can't get AP to work.
                New RPi 4b, new SD card with new download of pCP 7, 64 bit.

                After booting,
                1. Patch update and reboot
                2. Minor update, now 7.0.1 - pCP4b-113-HFD | piCorePlayer v7.0.1 | www v00015 | linux 5.4.83-pcpCore-v8 | piCore v12.0pCP | Squeezelite v1.9.8-1287-pCP

                click Beta bottom tab on Main page

                3. WiFi Settings, WAP Mode, Install, then Update which brings down a new readline.tcz , installs it and reboots.

                Message on the screen "To setup piCorePlayer, use ......
                - http://10.10.10.1

                That stuffs me, so, start again, reformat SD card etc and set Bridge Mode and AP IP Address of 192.168.1.1 ( my LAN is 192.168.2.1 ) and then Update AP Mode. Still doesn't work , but at least I can get in to the piCorePlayer.

                My understanding of Bridge Mode is that it will take the network range via the ethernet cable, so shouldn't the AP IP Address be greyed out if Bridge Mode is Yes ?

                Still can't get AP mode working.
                A camel is a racehorse designed by a committee.

                Seen sprayed on the outside wall of the local library -
                Three things I hate in life :
                1. Vandalism
                2. Irony
                3. Lists

                Comment

                • Paul Webster
                  Senior Member
                  • Apr 2005
                  • 10339

                  #23
                  Originally posted by Wirrunna

                  Message on the screen "To setup piCorePlayer, use ......
                  - http://10.10.10.1

                  That stuffs me
                  Did you connect to the new pCP WAP via WiFi at that point?
                  Paul Webster
                  Author of "Now Playing" plugins covering Radio France (FIP etc), PlanetRadio (Bauer - Kiss, Absolute, Scala, JazzFM etc), KCRW, ABC Australia and CBC/Radio-Canada
                  and, via the extra "Radio Now Playing" plugin lots more - see https://forums.slimdevices.com/showt...Playing-plugin

                  Comment

                  • Wirrunna
                    Senior Member
                    • Jan 2006
                    • 1309

                    #24
                    Originally posted by Paul Webster
                    Did you connect to the new pCP WAP via WiFi at that point?
                    No, it was connected with ethernet, WiFi Analyzer on my phone did not show any new network SSIDs and having an ip address of 10.10.10.1 I could not connect from my PC on 192.168.2.20 without stuffing about with sub net masks (which about 25 years ago in a former life I knew about, but now....)

                    Paul, this is a real first world problem of infinitely small significance, but would be handy if I could get it going.
                    A camel is a racehorse designed by a committee.

                    Seen sprayed on the outside wall of the local library -
                    Three things I hate in life :
                    1. Vandalism
                    2. Irony
                    3. Lists

                    Comment

                    • paul-
                      Senior Member
                      • Jan 2013
                      • 5778

                      #25
                      Make sure to update the APmode extension itself. Or did you just download the add on?
                      piCorePlayer a small player for the Raspberry Pi in RAM.
                      Homepage: https://www.picoreplayer.org

                      Please donate if you like the piCorePlayer

                      Comment

                      • Wirrunna
                        Senior Member
                        • Jan 2006
                        • 1309

                        #26
                        Originally posted by paul-
                        Make sure to update the APmode extension itself. Or did you just download the add on?
                        I clicked the update box. There is a 7" Official Touch screen attached but Jivelite is not installed so I can see the screen output and saw the line about Readline.tcz .
                        A camel is a racehorse designed by a committee.

                        Seen sprayed on the outside wall of the local library -
                        Three things I hate in life :
                        1. Vandalism
                        2. Irony
                        3. Lists

                        Comment

                        • Wirrunna
                          Senior Member
                          • Jan 2006
                          • 1309

                          #27
                          I tried a rPi 3b and was able to get that to work, sort of. My laptop could see the test network but not connect. WiFi Analyzer showed the SSID but the signal level seemed to drop after a few minutes. Had another go with the rPi 4b, still no luck.

                          Googled Raspberry Pi wifi Access Point and found https://www.raspberrypi.org/document...int-bridged.md , so downloaded the latest rPi OS (not called Raspbian anymore) flashed it to a spare card and set it up on the rPi 4b. Worked first go.

                          Now, where are the config files that are set up on piCorePlayer ?
                          A camel is a racehorse designed by a committee.

                          Seen sprayed on the outside wall of the local library -
                          Three things I hate in life :
                          1. Vandalism
                          2. Irony
                          3. Lists

                          Comment

                          • epoch1970
                            Senior Member
                            • Apr 2008
                            • 2280

                            #28
                            Originally posted by Wirrunna
                            Well, I can't get AP to work.
                            My understanding of Bridge Mode is that it will take the network range via the ethernet cable, so shouldn't the AP IP Address be greyed out if Bridge Mode is Yes ?
                            You're correct.

                            PCP 7.0.1 works indeed in bridged AP mode. Updating is mandatory, with 7.0 it cannot work.

                            There is still a glitch in the matrix, you should just disregard the "AP IP Address" field. The field is mandatory so set it to a random address on an unused network or leave it to its default value if possible.
                            Don't hesitate to reboot once or twice after having configured it via the GUI. There is no need to dive in the scripts or config files.

                            I'm running the bridged AP on a Pi3B, works reliably.
                            Last edited by epoch1970; 2021-06-21, 20:15.
                            2 SB 3 • 1 PCP 7 • Libratone Loop, Zipp, Zipp Mini • iPeng (iPhone + iPad) • LMS 8.1 (docker) with plugins: CD Player, WaveInput by bpa • Material Skin by Craig Drummond • IRBlaster by Gwendesign (Felix) • Smart Mix, Music Walk With Me, What Was That Tune? by Michael Herger • PowerSave by Jason Holtzapple • Song Info, Song Lyrics by Erland Isaksson • BBC Sounds by Stuart McLean • AirPlay Bridge by philippe_44 • Auto Dim Display, SaverSwitcher, ContextMenu by Peter Watkins.

                            Comment

                            • Wirrunna
                              Senior Member
                              • Jan 2006
                              • 1309

                              #29
                              epoch1970,
                              I reflashed the SD card to pCP 7, 32 bit, installed in a rP1 4b and went through the updates and setup and it works as you said.
                              Once more the 64 bit pCP 7 is not quite up to speed (my Allo Boss2 initially needed pCP 7 32 bit to work) no big deal.

                              From a former life in IT project management I would suggest that there is too much variation creeping in, stick with only one flavour of pCP.
                              The Raspberry OS is only in 32bit.

                              Very convenient to have a WAP on my bench that also plays music and can be powered off at the mains rather than having to SSH in and sudo shutdown.

                              Paul, again, thank you for getting this going and if you need testing , just ask.
                              A camel is a racehorse designed by a committee.

                              Seen sprayed on the outside wall of the local library -
                              Three things I hate in life :
                              1. Vandalism
                              2. Irony
                              3. Lists

                              Comment

                              Working...