eee123
Posts: 17
Joined: Tue May 29, 2018 9:50 pm

portable plex media server/router/access point problem

Tue Jun 05, 2018 12:52 am

i am trying to configure my raspberry pi 3B as a portable plex server, router and access point to act as a standalone wifi network and plex server to use in a holiday home where there is no access to internet

i have largely been following this guide:
https://us.v-cdn.net/6025034/uploads/ed ... wq8tj1.pdf

my workflow was as follows:

installed raspbian stretch

sudo raspi-config

expanded the file system

sudo reboot



sudo apt-get update

sudo apt-get upgrade -y



sudo apt-get install ntfs-3g -y

sudo fdisk -l

sudo nano /etc/fstab


add the line: /dev/sda1 /media/usbhdd1 ntfs-3g gid=pi,uid=pi,noatime 0 0
ctrl+x to save, then y, then return

sudo mkdir /media/usbhdd1



sudo apt-get update && sudo apt-get install apt-transport-https -y --force-yes

sudo wget -O - https://dev2day.de/pms/dev2day-pms.gpg.key | sudo apt-key add -

sudo echo "deb https://dev2day.de/pms/ stretch main" | sudo tee /etc/apt/sources.list.d/pms.list

sudo apt-get update

sudo apt-get install -t stretch plexmediaserver-installer

sudo apt-get install mkvtoolnix -y


sudo apt-get update && apt-get upgrade



sudo apt-get update

sudo apt-get install hostapd isc-dhcp-server -y

sudo nano /etc/dhcp/dhcpd.conf

comment out with #: option domain-name "example.org";
comment out with #: option domain-name-servers ns1.example.org, ns2.example.org;
uncomment line (by removing the #): #authoritative;

add the following lines at bottom:
subnet 192.168.10.0 netmask 255.255.255.0 {
range 192.168.10.10 192.168.10.50;
option broadcast-address 192.168.10.255;
option routers 192.168.10.1;
default-lease-time 600;
max-lease-time 7200;
option domain-name "local";
option domain-name-servers 8.8.8.8, 8.8.4.4;
}
ctrl+x to save, then y, then return

sudo nano /etc/default/isc-dhcp-server

find the line saying: INTERFACES=""
changed to: INTERFACES="wlan0"
ctrl+x to save, then y, then return

sudo ifdown wlan0

sudo nano /etc/network/interfaces

removed file contents and added the following:

auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.10.1
netmask 255.255.255.0
up iptables-restore < /etc/iptables.ipv4.nat
saved with ctrl+x, then y, then return

sudo ifconfig wlan0 192.168.10.1

sudo reboot

sudo nano /etc/hostapd/hostapd.conf

added the following:

interface=wlan0
driver=rtl871xdrv
ssid=PMSPi
channel=6
wmm_enabled=1
macaddr_acl=0
auth_algs=1
wpa=1
wpa_passphrase=raspberry
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

saved with ctrl+x, then y, then return

sudo nano /etc/default/hostapd


changed the line: #DAEMON_CONF=""
to be: DAEMON_CONF=“/etc/hostapd/hostapd.conf"

sudo nano /etc/sysctl.conf

added at the bottom: net.ipv4.ip_forward=1

sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"

sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT


sudo sh -c "iptables-save > /etc/iptables.ipv4.nat"

then when i run the following to test it:

sudo /usr/sbin/hostapd /etc/hostapd/hostapd.conf

it is discoverable and connects to external devices fine

then i cancel the test with crtl+c

sudo service hostapd start

then when i run:

sudo service isc-dhcp-server start

i get an error saying that :

job for isc-dhcp-server.service failed because the control process exited with an error code.
see "systemctl status isc-dhcp-server.service" and "journalctl -xe" fir details.

so there must be an error starting the isc-dhcp-server when the pi is booting, so i continue along with:

sudo update-rc.d hostapd enable

sudo update-rc.d isc-dhcp-server enable


to make sure everything starts on boot.

heres the problem,

i start up the pi, the network is discoverable and i can connect devices to it
however my pi internet taskbar icon shows "connection to dhcpcd lost"
and when i visit: localhost:32400/web in my pi browser it starts to load my server,
and then fails and gives a "plex is down for maintenance, dont worry it will be back soon" message
so i cant get into my server to arrange my media etc.

plus, when i connect the pi to my internet connection, it is supposed to still connect to internet via eth0
but it just doesnt connect to internet at all over ethernet

literally tried this for days now and cant seem to find a fix for the issue, must have re-imaged my SD card with a fresh raspbian install over 10 times already

please help?

eee123
Posts: 17
Joined: Tue May 29, 2018 9:50 pm

Re: portable plex media server/router/access point problem

Tue Jun 05, 2018 1:05 am

just to clarify,

i have just tried using the command:

sudo nano /etc/default/plexmediaserver.prev

and then changed the server name from "plex" to "pi"

no change though.

im stuck, the plan was to have this as a portable media server and access point, so i can link a second pi (connected to the tv) configured as a rasplex client and play media that way, whilst also being able to stream media to wifi connected devices (iphones/ipads etc).

:(

Return to “General discussion”