notes

Things I've written down that I might want to reference later.
Log | Files | Refs | README

commit c2e913c5096d6427d6de3b73d751dec572a87f70
parent 164dbc8a9555e7421fa2d6a813288bf285777d6b
Author: Robbie D <git@robertdherb.com>
Date:   Thu, 25 Apr 2019 11:03:08 -0500

Cleaned up some sections, added final thoughts.

Diffstat:
ubiquiti-unifi.md | 31+++++++++++++++++++++++++------
1 file changed, 25 insertions(+), 6 deletions(-)

diff --git a/ubiquiti-unifi.md b/ubiquiti-unifi.md @@ -5,23 +5,42 @@ Created 2019-03-28 This may sound crazy, but believe it or not, I am an IT professional. But my home network doesn't really show that. I have a Dlink can router/ap running dd-wrt. DNS is managed by a pi-hole (That is also my dhcp server) but otherwise, I have crappy wifi, and a router that overheats and bogs down my connection. -Well not anymore. I purchased a Ubiquiti EdgeRouter-X and Unifi acces point. Finally, I'll have some semi-professional gear. I've used Ubiquiti in the past and I must say it's very nice, and fairly easy to set up, espeically if you spring for the Cloud Key. In my home use case, I didn't really want to, so I wanted tory running it on my pi-hole, which just sits around doing nothing most of the day (and will still do nothing MOST of the day). +Well not anymore. I purchased a Ubiquiti EdgeRouter-X and Unifi acces point. Finally, I'll have some semi-professional gear. I've used Ubiquiti in the past and I must say it's very nice, and fairly easy to set up, espeically if you spring for the Cloud Key. In my home use case, I didn't really want to, so I wanted to try running it on my pi-hole, which just sits around doing nothing most of the day (and will still do nothing MOST of the day). + +# The EdgeRouter + +This is probably easiest part of the whole thing. For such a simple deployment as my home, there's not much configuration to do. Drop all packets coming in, allow all going out. Use the pihole as a DNS and DHCP server. Not much to it. If you were looking for a more in-depth walkthrough of how to do this, I'm sorry but it probably wouldn't be as useful as [Ubiquiti's Beginners Guide](https://help.ubnt.com/hc/en-us/articles/115002531728-EdgeRouter-Beginners-Guide-to-EdgeRouter). + +# Installing Unifi on a Raspberry Pi 3 + +## Setting it up + +Should be easy, right? Just follow the instructions for Debian, right? Well... Yeah, the first thing you need to do is install UniFi. I just grabbed the deb from Ubiquiti, because I don't much care for adding PPAs, &c. The install was fairly easy, `dpkg -i unifi.deb`, but that's where the trouble began. + +The service just would not start. And there were no error messages printed to the console. What to do? -TODO: Setting up the ER-X -Installing Unifi on pihole -Setting it up From [this post](https://loganmarchione.com/2016/11/ubiquiti-unifi-controller-setup-raspberry-pi-3/) I got the following: # apt install oracle-java8-jdk -y # update-alternatives --config java -As of right now, I absolutely cannot get the service to work properly. I have tried editing /usr/lib/unifi/bin/unifi.init and setting the JVM_MAX_HEAP_SIZE and JVM_INIT_HEAP_SIZE variables, I have tried setting unifi.xms in system.properties (By the way, I don't know if I believe that doing anything in that file has any effect if it doesn't already exist), and nothing. +Whether this helped or not in the end, I can't say. I continued using Oracle's Java instead of OpenJava, but I don't think it would matter. + +As of right now, I absolutely cannot get the service to work properly. I have tried editing `/usr/lib/unifi/bin/unifi.init` and setting the `JVM_MAX_HEAP_SIZE` and `JVM_INIT_HEAP_SIZE` variables, I have tried setting `unifi.xms` in system.properties (By the way, I don't know if I believe that doing anything in that file has any effect if it doesn't already exist), and nothing. BUT there is a light at the end of the tunnel. If I create the jvm myself, Iit will run. I can do the following: java -Xmx512M -jar /usr/lib/unifi/lib/ace.jar start -The controller starts, and all is well! Not sure why I can't just make the unifi service create a usable jvm, but I'll try opening a ticket with ubnt tomorrow. +The controller starts, and all is well! Not sure why I can't just make the unifi service create a usable jvm~~, but I'll try opening a ticket with ubnt tomorrow~~. Extra thanks to osunifi at the community.ubnt.com forums. It was their comment about Java using too much memory that lead me to that command to start the JVM manually. https://community.ubnt.com/t5/UniFi-Wireless/NOTICE-UniFi-Controller-Memory-Usage-5-6-20/m-p/2268804/highlight/true#M282524 + +# Final Thoughts + +I'd say don't do this... Even with my workaround above, the JVM crashes after a few hours (Maybe less? I actually don't check it frequently) so I'm currently living without a cloudkey. That's fine, since nothing changes in my environment, but I have no monitoring or insight into my WiFi. + +If you want a UniFi setup in your home, I'd say just buy the damn cloudkey or put it on a server with a minimum of 2GB of RAM. + +ubiquiti-unifi.md | Last Edited 2019-04-25 | Cleaned up some of the sections and added final thoughts.