How I installed Unifi Controller

Status
Not open for further replies.

travanx

Explorer
Joined
Jul 1, 2014
Messages
62
Created jail called unifi.

from shell command prompt
Install Java8JDK
freebsd-update fetch
pkg install openjdk8-jre
edit /etc/fstab
fdesc /dev/fd fdescfs rw 0 0
proc /proc procfs rw 0 0

Install MongoDB
pkg install mongodb
edit /etc/rc.conf
add to the bottom
mongod_enable="YES"

Install Unifi Controller
portsnap fetch
portsnap fetch extract
portsnap update
cd /usr/ports/net-mgmt/unifi4/
make install clean
edit /etc/rc.conf
add to the bottom
unifi_enable="YES"

go to https://localIP:8443

This is from memory, but are there any issues with this? Next step how to configure this to see my AP.
https://help.ubnt.com/hc/en-us/arti...yer-3-methods-for-UAP-adoption-and-management

Already had this managed on a Windows machine, so I filled out the info and when I got into the main screen I clicked device, and adopted to the freenas localIP address. That was easy.

I wanted to do this for a while because the Win controller kept losing connections and wanted to see some stats on this.
 
Last edited:

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Yes,

There is a problem with this. Cyberjock and I were just a few days ago working this issue. Turns out, the newer versions of MongoDB will not work with the unifi software. You can get as far as accessing the web page, etc., but when you go to actually add devices, there is a fatal error in the unifi software that dumps the newer versions of MongoDB. To our knowledge, the only workaround is to get an older version of mongodb for FreeBSD, but, that is proving surprisingly difficult. If you google around, you will see that everyone has this issue.

If you actually get it working (which I don't think you will), BY ALL MEANS let us know. It was so promising---everything up until the very end, when you add devices to the controller---worked great.
 

travanx

Explorer
Joined
Jul 1, 2014
Messages
62
It has been working fine since I posted this. Now I wished I copy and pasted exactly what I did.

I used this for MongoDB. But did pkg install instead of make.
http://petr.io/2014/04/13/mongodb-in-freenas-jail/

I am a newbie but I can run whatever commands you want to verify versions.
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Excellent! You may be our savior.

When, exactly, did you put this all together? Recently? Or a while ago?

I believe you can what the mongodb version is by typing:
Code:
mongod --version
(that's "mongod" not "mongodb") I might be wrong though.

@cyberjock woo hoo!
 

travanx

Explorer
Joined
Jul 1, 2014
Messages
62
Spent about 30 minutes on it before posting tonight. Was sick and tired of the Windows client not working right in Win10.

Code:
db version v2.6.7
2015-12-27T22:09:23.288-0800 git version: nogitversion
2015-12-27T22:09:23.288-0800 OpenSSL version: OpenSSL 0.9.8za-freebsd 5 Jun 2014


I will add that I had a Roku streaming stick in the other room running Netflix and during the provisioning and channel changes the Roku paused, found it, and started playing the media again. No issues yet.

Took the steps from here to insall JDK
https://www.atlantic.net/community/howto/install-java-jre-jdk-freebsd/
 

travanx

Explorer
Joined
Jul 1, 2014
Messages
62
@DrKK I generally get motivation to write tutorials when I am working hard on a project to get my mind off of things. Any clues how I can write the plugin for the unifi controller??, my current project is complicated. @cyberjock can you chime in on this as well? I would imagine a unifi jail is really useful to a lot of people. Might be interesting to others to see how to write a plugin as well. Just no idea how to go about it. I am still a newbie after all.
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
WHOOOOOOOPS!!!!!

I want to apologize. I have made this mistake before several times, just because the products are so similar and similarly named.

Unifi controller on a FreeNAS jail is a solved problem. The OP was talking about that.

Unfortunately, I had in my mind this confused with the mFi/mPower controller software, which is the same thing, but for their power strips, which several of us have. I want to apologize for confusing everyone. The mFi/mPower issue with mongodb is as I described above, but, with the unifi stuff, there is no problem, to my knowledge.

SORRY :(
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
I'm working on getting this to work with mfi. I should know today or tomorrow if this is possible, and if it is I'll have a guide.

I also own unifi stuff, so I do plan to try to get it to work as well. But that would be a project to work on after mfi. The mfi software being functional is needed for work while the unifi stuff is for home. ;)
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
I'm working on getting this to work with mfi. I should know today or tomorrow if this is possible, and if it is I'll have a guide.

I also own unifi stuff, so I do plan to try to get it to work as well. But that would be a project to work on after mfi. The mfi software being functional is needed for work while the unifi stuff is for home. ;)
I'm going to be setting up some mfi stuff pretty soon, looking forward to a guide. The parts arrive Tuesday so hurry up already!
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
So.. I got mFi working. I'll certainly have UniFi working soon enough. But what I did was extremely hacky and pretty delicate. I'm gonna post a guide very soon, I just need to make this a bit "less hacky".
 

vikingboy

Explorer
Joined
Aug 3, 2014
Messages
71
Unify works easily enough under 9.3.1 but needs a fix to the basic jail setup which will make life easier when running the unify install.

pkg install p5-Locale-gettext

Then all you need is to ....

#Install Unifi v4
cd /usr/ports/net-mgmt/unifi4/
make install clean

To Autostart on boot, add following to /etc/rc.conf
mongod_enable="YES"
unifi_enable="YES"

After install, to manually start:
/usr/sbin/service unifi start

http://whereveryourjailis:8080
create admin user and go....
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Yeah, that's how you use the unifi4 software if you aren't installing the download from Ubiquiti. I'd prefer to stick to the Ubiquiti download because it is almost certainly going to be updated before the ports version is. I also want the guides to be somewhat future proof and I doubt that Ubiquiti is going to take down their java download anytime soon (you never know with the pkg-ng repos).

Right now I have mfi and unifi running in the same jail, using mongodb 2.4.8. It took some serious hacky stuff to make it work and I plan to make it less hacky. I just don't know when I'll get around to it since the holidays are still around and we're short staffed at work and stuff. I am hopeful I'll get a guide out before the new year, but I can't make any promises. I was hoping to get this all figured out today, but today was just too busy with other things I didn't get done over the weekend.

Assuming all goes well, I'm going to try 2.4.10 since that was the last version of the 2.4.x branch from the ports tree.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Status
Not open for further replies.
Top