Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 5 of 5
  1. #1

    PicorePlayer 2 Static IP WIFI

    Hi Chaps

    Anyone know a way to acheive this? There is an option in the GUI for static IP but it states that its only applicable to the ETH0

    I need this to work on the inbuilt WIFI on a Pi3

    Any suggestions appreciated, any idea when if it will be offically supported?

    thanks

    Mark
    PiCorePlayer 3.11 with Hifiberry Digital + (Lounge)
    Joggler Squeezeplay as Remote (Lounge)
    PiCorePlayer 3.11 with pi official touchscreen and hifiberry DAC (Office)
    Joggler Squeezeplay as Remote (Office)
    Joggler Squeezeplay (Kitchen)
    Joggler Squeezeplay (Conservatory)
    Radio x 2 (Bedroom)
    Joggler Squeezeplay (Garage)


    LMS 7.9 on DIY Unraid 6 Server (i5)

    Squeeze user since the SB1

  2. #2
    Senior Member
    Join Date
    Jan 2011
    Location
    Staffordshire. UK
    Posts
    2,390
    Quote Originally Posted by markiii View Post
    Hi Chaps

    Anyone know a way to acheive this? There is an option in the GUI for static IP but it states that its only applicable to the ETH0

    I need this to work on the inbuilt WIFI on a Pi3

    Any suggestions appreciated, any idea when if it will be offically supported?

    thanks

    Mark
    Is it not possible to set this on your Router? I'm just guessing

  3. #3
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    1,500
    Quote Originally Posted by markiii View Post
    Hi Chaps

    Anyone know a way to acheive this? There is an option in the GUI for static IP but it states that its only applicable to the ETH0

    I need this to work on the inbuilt WIFI on a Pi3

    Any suggestions appreciated, any idea when if it will be offically supported?

    thanks

    Mark
    The easiest way right now is a dhcp assignment from you dhcp server.

    Working static wifi into our pCP interface is on our todo, but not very high priority right now. Static wifi can be done, but 100% manual configuration. Working with iwconfig, iwconfig and wpa_supplicant.

    If you cannot do a dhcp assignment, let me know....I can work with you.

  4. #4
    thanks chaps, unfortunately for the purpose in hand I'm using an IPhone hotspot as the router so there is no possibility to set a manual address via DHCP. It will need to be a proper static address.

    Any guidance on how to configure that would be much appreciated
    PiCorePlayer 3.11 with Hifiberry Digital + (Lounge)
    Joggler Squeezeplay as Remote (Lounge)
    PiCorePlayer 3.11 with pi official touchscreen and hifiberry DAC (Office)
    Joggler Squeezeplay as Remote (Office)
    Joggler Squeezeplay (Kitchen)
    Joggler Squeezeplay (Conservatory)
    Radio x 2 (Bedroom)
    Joggler Squeezeplay (Garage)


    LMS 7.9 on DIY Unraid 6 Server (i5)

    Squeeze user since the SB1

  5. #5
    Junior Member
    Join Date
    Jan 2018
    Posts
    1

    Script for static IP over Wi-Fi

    Newbie here on the forum, hopefully this thread is not considered too old to dig up

    I wanted to run a static IP on WiFi for a portable piCorePlayer setup that I could travel with and hook up to my car and thought I'd share my scripts

    WARNING: command line involved and very easy to mess things up, not for the faint-hearted.

    This is tested on to piCorePlayer version 3.20

    Prerequisites: you already have network setup and can get ssh access to piCorePlayer

    Step 1.
    Backup your SD Card and have a keyboard and monitor ready in case you mess things up and your SD card backup fails to restore

    Step 2.
    Check that the below modules are installed
    Code:
    wireless-4.9.50-pcpCore.tcz
    wireless_tools.tcz
    wpa_supplicant.tcz
    you can do so by checking the output of
    Code:
    ls /usr/local/tce.installed
    if not, install with

    Code:
    sudo -u tc tce-load -i wireless-4.9.50-pcpCore.tcz
    sudo -u tc tce-load -i wireless_tools.tcz
    sudo -u tc tce-load -i wpa_supplicant.tcz

    Step 3.
    create a file /home/tc/scripts/wpa.cfg

    Code:
    # uses WPA2 only
    network={
            ssid="my-network"
            proto=RSN
            key_mgmt=WPA-PSK
            pairwise=CCMP TKIP
            group=CCMP TKIP
            psk=
    }
    Now generate the encoded password value
    Code:
    sudo wpa_passphrase <your SSID here> <your password here>
    Copy the encoded output against the "psk=" in the file created above

    Step 4.

    Create another file /home/tc/scripts/wifi.sh

    Code:
    #!/bin/sh
    
    # Load WiFi drivers and modules
    sudo -u tc tce-load -i wireless-4.9.50-pcpCore.tcz >/dev/null 2>&1
    
    sudo -u tc tce-load -i firmware-atheros.tcz >/dev/null 2>&1
    sudo -u tc tce-load -i firmware-brcmwifi.tcz >/dev/null 2>&1
    sudo -u tc tce-load -i firmware-ralinkwifi.tcz >/dev/null 2>&1
    sudo -u tc tce-load -i firmware-rtlwifi.tcz >/dev/null 2>&1
    sudo -u tc tce-load -i firmware-rpi3-wireless.tcz >/dev/null 2>&1
    
    # load wifi tools and wpa_supplicant
    sudo -u tc tce-load -i wireless_tools.tcz >/dev/null 2>&1
    sudo -u tc tce-load -i wpa_supplicant.tcz >/dev/null 2>&1
    
    
    sudo /usr/local/sbin/wpa_supplicant -B -iwlan0 -c/home/tc/scripts/wpa.cfg >/home/tc/wpa.log 2>&1 &
    
    #note: configure your router to leave this IP out of the DHCP range to avoid collision 
    sudo /sbin/ifconfig wlan0 <YOUR STATIC IP> netmask 255.255.255.0 up
    # e.g, sudo /sbin/ifconfig wlan0 192.168.4.100  netmask 255.255.255.0 up
    
    # Add gateway IP
    sudo /sbin/route add default gw <USUALLY YOUR ROUTER IP>
    #e.g, /sbin/route add default gw 192.168.4.1
    
    sudo echo "nameserver <USUALLY YOUR ROUTER IP>" > /etc/resolv.conf
    #e.g, echo nameserver 192.168.4.1 >> /etc/resolv.conf
    Code:
    # give execute permission to all
    chmod a+x ~/scripts/wifi.sh
    Step 5.
    Configure this script to execute on boot
    its better to add this before the call to tce scripts

    edit /opt/bootlocal.sh

    insert the following lines above the section that starts with "#pCPstart------"

    Code:
    /home/tc/scripts/wifi.sh 2>&1 | tee -a /var/log/pcp_boot.log &
    Now in the piCorePlayer web interface in WiFi page turn off the WiFi if enabled ( we will use out custom script instead)

    Step 6. MOST IMPORTANT

    Don't forget to back up all the changes and files

    Navigate to "Main" page in the webinterface and hit "Backup" confirm "Yes" and then reboot.

    piCorePloayer should now come up with the static IP if all goes well.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •