I had to start over and re-install plexconnect as a jail, and ran into some issues. Once I figured it out again, I made some changes to the original process and documented it so if I ever had to do it again I could do it quickly. Thanks again for the guide. My changes below:
Install PlexConnect (with automatic boot) FreeNAS 11.2
You should be able to copy/paste any commands below the line:
Code:
Login to your FreeNAS server using the normal IP. Then go to the jails section in the navigation bar and then click add.
Name the jail plexconnect
For the release drop-down, select the release you are running (i.e.11.2)
Click Next
Select DHCP
Click Next
Now start the jail.
Next go ahead and open putty (or something similar) and connect directly to your FreeNAS’s IP. Username: root Password: [your password]
First we need to find the jail we just created. Run the following command:
Code:
jls
This will return a list of all your current jails:
Now you want to directly connect to the jail itself using the JID. From the list you look for the hostname PlexConnect (I will be using PlexConnect_test as I don’t want to change my current setup, you should use PlexConnect jail.)
To get into the jail run the following command
Code:
jexec <JID> csh
Where <
JID> is the JID of the PlexConnect jail. (Use the number, not the name – i.e. 1 or 4)
Install the required software:
First we are going to have to install all the extra packages PlexConnect requires to work.
1.Pkg manager.
Code:
pkg update
Enter Y for yes.
2.Python
Code:
pkg install python27
3.Nano – Text editing
Code:
pkg install nano
4.Bash
Code:
pkg install bash
5.Git
Code:
pkg install git
6.Pillow
Code:
pkg install py27-pillow
Part 1: Get PlexConnect and Configure it
Get PlexConnect
Now we have to fetch the newest PlexConnect from the git repo.
Code:
git clone
https://github.com/iBaa/PlexConnect.git
cd PlexConnect/
git pull
Generate the required SSL certificates
Next we need to create the communication certificates. Change directory to the certificates folder
Code:
cd /PlexConnect/assets/certificates
Generate the required SSL certificates
Code:
openssl req -new -nodes -newkey rsa:2048 -out trailers.pem -keyout trailers.key -x509 -days 7300 -subj "/C=US/CN=trailers.apple.com"
This will create 2 files trailers.key and trailers.pem. Next run this:
Code:
openssl x509 -in trailers.pem -outform der -out trailers.cer && cat trailers.key >> trailers.pem
Create the Settings.cfg file
Go back to the root directory:
Code:
cd /
Change Directory
Code:
cd PlexConnect/
**The following I had to do to get it to work in 11.2 with python2.7**
Code:
nano /PlexConnect/PlexConnect_daemon.bash
Edit the PYTHON line as follows (so that it references the python instance explicitly):
PYTHON=”/usr/local/bin/python2.7”
Start PlexConnect so it creates Settings.cfg
Code:
./PlexConnect.py
When it started Exit using CTRL + C
Code:
nano Settings.cfg
Change the 2 lines below
Code:
ip_pms = 10.0.0.30 # This one you have to change to your Jail IP address
enable_plexgdm = False # This one you have to change from True to False
Test that the basics work:
To start PlexConnect
Code:
bash /PlexConnect/PlexConnect_daemon.bash start
Make sure it starts up:
Code:
bash /PlexConnect/PlexConnect_daemon.bash status
It should return that it is running. Then you can stop the process:
Code:
bash /PlexConnect/PlexConnect_daemon.bash stop
Part 2: Creating Boot Script
Initial Setup:
Creat the boot script
Code:
nano /etc/rc.d/plexconnect
copy and paste the following code and then save and close the file.
Code:
#!/bin/sh
#
#PROVIDE: PlexConnect
#REQUIRE: DAEMON
#KEYWORD: shutdown
. /etc/rc.subr
name=plexconnect
rcvar=plexconnect_enable
start_cmd="${name}_start"
stop_cmd="${name}_stop"
status_cmd="${name}_status"
extra_commands="status"
PATH=/usr/local/bin:${PATH}
plexconnect_start()
{
/usr/local/bin/bash /PlexConnect/PlexConnect_daemon.bash start
}
plexconnect_stop()
{
/usr/local/bin/bash /PlexConnect/PlexConnect_daemon.bash stop
}
plexconnect_status()
{
/usr/local/bin/bash /PlexConnect/PlexConnect_daemon.bash status
}
load_rc_config $name
run_rc_command "$1"
NOTE:
if you installed PlexConnect in a different directory change the directory to the bash script.
Next make sure the permissions are the same as the other scripts, run the following script:
Code:
chmod 777 /etc/rc.d/plexconnect
Register the script:
Run the following command to open the rc.conf file:
Code:
nano /etc/rc.conf
and add the following line:
Code:
plexconnect_enable="Yes"
save and close the file.
Check that the script works:
so when you are in the root dir and you call:
Code:
/etc/rc.d/plexconnect start
and then calling:
Code:
/etc/rc.d/plexconnect status
and it returns:
Code:
PlexConnect is running
so great the script works.
Now just run:
Code:
/etc/rc.d/plexconnect stop
So we make sure plex is not running before we try to start it as a service.
Setup the plexconnect service:
FINALLY:
run the following command:
Code:
service plexconnect status
and it should return:
Code:
PlexConnect is not running
Okay great the service is now working. Thank god. Now just startup plexconnect:
Code:
service plexconnect start
So plexconnect is now running and it is a valid service. Yay.
You can then test if it is working by either rebooting your NAS or toggling the plugins on off switch.
Now set a DHCP address reservation in your router, for plex connect. Then go to your ATV, and configure there, remember to set the DNS server to the address that was assigned to plexconnect jail.