Closed Gill-Bates closed 2 years ago
I would to bring this topic up again. Here comes the Steps to Install Unifi on Dietpi. To add this to the Software Catalouge should be not a big deal:
Install correct openJDK
sudo apt install openjdk-8-jdk-headless
Add Repo
echo 'deb http://www.ubnt.com/downloads/unifi/debian stable ubiquiti' | sudo tee /etc/apt/sources.list.d/100-ubnt-unifi.list
sudo wget -O /etc/apt/trusted.gpg.d/unifi-repo.gpg https://dl.ubnt.com/unifi/unifi-repo.gpg
Install Unifi
sudo apt update; sudo apt install unifi
Hi,
many thanks for your request. Just one comment from my side. I don't think it will be implemented if a dependency is openjdk-8
because openjdk-8
is not available on standard Debian repository for Debian Buster systems. Yes it's part of Raspbian Repository but than it would be dedicated to one set of SBC device. Even I'm not sure how it is on Raspberry OS 64bit, as the Foundation will switch to standard Debian repository with it. But it's up to @MichaIng to decide.
there is a work around for this. I am running the unifi controller on my dietpi raspberry pi 4, but it has to be done very early in the dietpi setup.
I found the reference to this install script on the Ubiqui forums here: https://community.ui.com/questions/UniFi-Installation-Scripts-or-UniFi-Easy-Update-Script-or-UniFi-Lets-Encrypt-or-UniFi-Easy-Encrypt-/ccbc7530-dd61-40a7-82ec-22b17f027776 The author's main website is here: https://glennr.nl/
perform a basic install of dietpi. I booted a fresh install of dietpi, ran dietpi-software to configure the basics, like network setting and such, but did not select any software to install
then do the following: (this will download and run an installation script that will download and configure everything needed to install and run the unifi controller.
wget "https://get.glennr.nl/unifi/install/unifi-6.0.27.sh" -O install-unifi-6.0.27.sh && chmod +x install-unifi-6.0.27.sh && ./install-unifi-6.0.27.sh
NOTE: if you run the script a second time, it will detect the installation and give you an option to update if there is a newer version available. When I did this a couple weeks ago, only the 6.0.27 version was available for download, but running the script a 2nd time upgraded me to 6.0.28. (there may be a newer version at this time)
after the script completes, then you can run dietpi-software to install other applications as needed. NOTE: I do not run any other java-based applications on my dietpi server, so I can not say whether this will cause any version compatibility issues.
@rhkean Thanks for sharing your Script. I would prefer to using the standard-way with Board-Instruments of Linux as desribed above. Then with this solution, an apt dist-upgrade
will also auto-upgrade the Unifi-Controller - without additional Scripts.
But I agree: without any additional customizings (like reducing theMax_Heap_Size=512M
down from 1024M), on older Raspberry Pi Models than 3+, the systemctl start Unifi.service
would fail.
well the script is still trying to install JAVA8. Not sure if this is an option for nonRPi systems
I would prefer that, too. Unfortunately, Ubiquiti's controller code requires java 8 and there are several other packages that I ran into problems with... This script worked, though.
To be clear, this is not my script. I found it on Ubiquiti's users forum.
-rob
On Tue, Nov 17, 2020, 12:36 PM Gill Bates notifications@github.com wrote:
@rhkean https://github.com/rhkean Thanks for sharing your Script. I would prefer to using the standard-way with Board-Instruments of Linux as desribed above. Then with this solution, an apt dist-upgrade will also auto-upgrade the Unifi-Controller - without additional Scripts.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MichaIng/DietPi/issues/3708#issuecomment-729086783, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADTEBBDKXKOKQ5DL643XF7TSQKYDFANCNFSM4PZJ7GOA .
I'm not certain about what boards are supported, tbh.
You would have to read the scripts to find out. I do recall from my quick glance a while back, that it does as much 'apt-get' as it can without breaking anything.
On Tue, Nov 17, 2020, 1:10 PM Joulinar notifications@github.com wrote:
well the script is still trying to install JAVA8. Not sure if this is an option for nonRPi systems
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MichaIng/DietPi/issues/3708#issuecomment-729107498, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADTEBBGYC2WR4SF2G6LF3BLSQK4A5ANCNFSM4PZJ7GOA .
To be clear, this is not my script. I found it on Ubiquiti's users forum.
I know. I just tried to highlight that the script will not change the requirement of JAVA8. And this limit the possible use case.
Currently I'm trying to run the script on one of my VM's but it seems to be stuck somewhere during all the apt install steps 🤔
EDIT: LOL the script will install openjdk-8-jre-headless from Stretch repository
root@DietPiVM1:/etc/apt/sources.list.d# cat glennr-install-script.list
deb http://ftp.nl.debian.org/debian stretch main
Good find. That is somehow an issue as we already dropped several other software titles from Buster on, which depend on Java 8. Yes Raspbian contains it, but with upcoming Raspberry Pi OS 64-bit (and my in production testing Debian-based ARMv7 image), there will be mostly only RPi 1 and Zero left (+existing systems of course) which use Raspbian. And using binaries from old-old-stable (from summer on) repositories is not something I'm keen to do, although we did in other cases (e.g. libssl1.0.0).
Would be interesting if there are any plans to make it Java 11 compatible?
Agreed.. for as popular as their devices are, I'm a bit dumbfounded that they haven't brought it current, especially since they've brought other dependencies current like mangodb.
On Wed, Nov 18, 2020, 9:06 AM MichaIng notifications@github.com wrote:
Good find. That is somehow an issue as we already dropped several other software titles from Buster on, which depend on Java 8. Yes Raspbian contains it, but with upcoming Raspberry Pi OS 64-bit (and my in production testing Debian-based ARMv7 image), there will be mostly only RPi 1 and Zero left (+existing systems of course) which use Raspbian. And using binaries from old-old-stable (from summer on) repositories is not something I'm keen to do, although we did in other cases (e.g. libssl1.0.0).
Would be interesting if there are any plans to make it Java 11 compatible?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MichaIng/DietPi/issues/3708#issuecomment-729699735, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADTEBBEK7HZVNKUTAAHOS5TSQPIHBANCNFSM4PZJ7GOA .
Or only applications that are compatible for the installed platform appear in the software catalog. :-)
Or only applications that are compatible for the installed platform appear in the software catalog. :-)
Jep, that is how it is currently. However, to implement software for a very limited set of platforms is less of a pleasure of course, specially when it's about outdated dependencies which will break them on even the small left platforms earlier or later 😄.
So for now it would be all Stretch platforms and Raspbian. Since it is famous for RPi which in combination which Raspbian still covers ~50% of our users, that should be worth enough to implement.
Does anyone know if the Unifi Controller has been resolved to work with the latest version of DietPi?
Also, would it be possible to run PiHole and PiVPN/WireGuard on the same unit (RPi 3 B+) with the Controller or should I keep the controller separate?
Thanks in advance!
Well if I'm not mistaken, issue was the requirement of JAVA8 which is quite old and outdated.
So if I install Openjdk8, I should be able to run all 3 on one device with DietPi? I'm a noob, so just trying to understand...
PiHole + WireGuard shouldn't have any influence on Unifi Controller software. Means for you to mange is the installation of Unifi Controller software 😉
Avoid using Pihole. I strongly recommended to use AdGuard!
wget https://static.adguard.com/adguardhome/release/AdGuardHome_linux_armv6.tar.gz
tar xfz AdGuardHome_linux_armv6.tar.gz
mv AdGuardHome /etc/
cd /etc/AdGuardHome; sudo ./AdGuardHome -s install
OR JUST USE THE SOFTWARE CATALOG:
dietpi-software
Here my installation steps for UniFi
Source: https://smarthome-training.com/de/unifi-controller-raspberry-pi/
Install correct openJDK
sudo apt install openjdk-8-jdk-headless
Add Repo
echo 'deb http://www.ubnt.com/downloads/unifi/debian stable ubiquiti' | sudo tee /etc/apt/sources.list.d/100-ubnt-unifi.list
sudo wget -O /etc/apt/trusted.gpg.d/unifi-repo.gpg https://dl.ubnt.com/unifi/unifi-repo.gpg
- Install Unifi
`sudo apt update; sudo apt install unifi`
- Change Max Heap (only Raspberry 3 and below)
nano /usr/lib/unifi/bin/unifi.init JVM_MAX_HEAP_SIZE=512M # Raspberry 3+
- restart the service
`systemctl restart unifi.service`
For VPN I‘m using WireGuard on a VPS, due to the fast Upstream. Check out vultr.com or netcup.de
AGH is available via DietPi software catalogue. There is no need to install it manually. As well why not using PiHole? What is the relation to Unifi??
AGH is available via DietPi software catalogue. There is no need to install it manually. As well why not using PiHole? What is the relation to Unifi??
AGH is much better than Pihole. Here is a comparison matrix: https://github.com/AdguardTeam/AdGuardHome
the Google Safe-Search enforcement and the parental control feature is a life-saver, especially with little kids in your house.
well there is no relation to Unifi so to say. You probably would need to make this clear. Otherwise it could confuse people. Next to this you are referring a comparison done by AGH themselves. I guess they never will come to a point where PiHole wins. Both AdBlocker have their pros and cons. It depends on your personal opinion at the end.
Of course AGH likes AGH more than Pi-hole. I had closer looks into both and clearly prefer Pi-hole for its use/inclusion of well maintained separate open software solutions and related higher customisation possibilities. AGH is an all-in-one single binary, which may be preferred by and looks more streamlined for less experienced users, but is means that more experienced users' or custom needs are more difficult to achieve. Also they partly need to re-invent the wheel, which means potentially higher risk of security issues related to that. The matrix mainly contains features which are extremely easy to add to Pi-hole, via well-known trusted long-existing software:
1.1.1.3
as upstream DNS (Cloudflare with adult + fishing blocking) or AdGuard itself (94.140.14.14
) or any other that fits better to the personal needs, to achieve the same in Pi-hole: https://en.wikipedia.org/wiki/Public_recursive_name_serverI can assure anyone who is reading this, that there is no objective/substantial preference possible, the core features are identical. It is finally a matter of taste, and whether you have specific network/webserver setup needs (then use Pi-hole) or not. And do not trust developers own comparison tables: They don't aim to lie of course, but naturally such tables are one-sided and not objective.
I guess we are moving away from original topic. Let's close the discussion on AGH and PiHole at this point.
I have PiHole set up currently, so migrating to another PiHole would be easier especially since I have Samsung TVs that were a nightmare to set up and get its TVplus working correctly.
My main goal is to get as few devices running on my network as possible (I'm currently running four Pi 3B+'s).
My main questions are is it possible to get all 3 on one device (which it appears it it) and is it SMART to have the Unifi Controller, Wireguard, and network-wide ad blocking on the same device...
yes that should be possible to run all on the same RPi.
Yes, they should not interfere at all and Pi-hole is extremely lightweight (AGH as well, for completeness, DNS generally is pretty light, compared to HTTP/PHP web applications e.g.), so does not add relevantly to system load, even on RPi Zero.
Btw, the Java runtime environment should be sufficient:
apt install openjdk-8-jre-headless
This works on RPi 32-bit/Raspbian images only, since Debian Buster and above ships only Java 11 and above. Would be interesting to test it with Java 11 btw, probably they shipped some update regarding this?
I guess the nagging question for me now is should I run all 3 on one device or should it be broken into multiple devices from a network stability/security standpoint.
I really appreciate everyone's assistance!!
@MichaIng Good point on the Java version as I was planning on using the new bullseye release from you when available, so if it only works on the 32bit version that might be a problem???
Bullseye will be available as 32bit version as well. The challenge is with the outdated JAVA8, since Debian Buster and above ships only Java 11 and above.
@Joulinar I figured they would release it in 32bit as well, I had just planned on using the 64bit version...
There isn't a real benefit using 64bit. Currently there are more downside as Raspberry OS 64bit has not jet been released as stable. But in case of PiHole/WireGuard, it doesn't matter much. Or do you have a specific reason to use 64bit?
If Java 8 is still required for Unifi Controller, then it can only work on a 32-bit ARMv6 Raspberry Pi image, also on Bullseye, as only Raspbian consequently ships Java 8 packages on all distro versions. New image is available (not yet published): https://dietpi.com/downloads/images/DietPi_RPi-ARMv6-Bullseye.7z
But I would first test it with Java 11 or Java 17 (when using the Bullseye image), as the info about Java 8 being required is from a pretty old guide:
# On Bullseye
apt install openjdk-17-jre-headless
# On Buster, or if Java 17 does not work:
apt install openjdk-11-jre-headless
# else
apt install openjdk-8-jre-headless
And another note on newer Java versions: The ARMv6 RPi models (RPi 1 and Zero) do not support Java 8, at least when using the Debian builds with the VM engine. We'll test 3rd party OpenJDK builds to hopefully find newer Java 11 and/or 17 builds running on ARMv6 as well.
@Joulinar Not really, just figured it would be better in the long term.
@MichaIng According to the website, Unifi Controller 6.2.25 requires Java 8, Java 9 and later are not yet supported.
I'm currently 2 debian versions behind, so I was going to upgrade to the latest once it is released (I was told release date is 08/14/2021). I may just migrate PiHole/Wireguard to a new DietPi once bullseye is released and upgrade the controller once they support java 9+. Maybe this will give me time to do a little more research.
I honestly thought 64bit was a better long term plan for the 64bit hardware, is that not correct?
I honestly thought 64bit was a better long term plan for the 64bit hardware, is that not correct?
Hard to say, currently it has overall more downsides than upsides, mainly because of still missing software and also (userland) firmware packages/maintenance from Raspberry Pi repository/maintainer side. AFAIK also from our software options, there are more which support armhf/32-bit while not supporting arm64/64-bit then the other way round. How things develop, especially how fast, towards better aarch64 support in general of for Raspberry Pi explicitly is a good question 🤔.
Do you like to perform an in-place upgrade or a new installation? Theoretically you could already install Bullseye as we are days before the official release. Usually there are no surprises anymore as Bullseye software catalogue is already frozen since a while.
It sounds like the 32bit is better for noobs like myself as there is more support for when things may go wrong...
As for the upgrade vs new install, I was just looking to clean up trial and error installs with a clean install for dedicated use, as well as moving from a microSD card to a USB flash drive for stability.
in this case, do a fresh install directly on the USB drive. If you like, you could use our brand new ARMv7 Bullseye image https://dietpi.com/downloads/images/DietPi_RPi-ARMv7-Bullseye.7z
Migrating WireGuard should be easy. Just do an installation on the new system and copy all config files from /etc/wireguard/
.
Can you point me to the instructions to install directly on a USB drive? I thought it had to be installed/configured on a microSD and then migrated to the USB...
on the tool you use to flash the image, simply select the USB drive as target. Usually Raspberry Pi 3B+ supports USB mass storage boot out of the box. https://www.raspberrypi.org/documentation/computers/raspberry-pi.html#usb-mass-storage-boot
Very nice. I will try to get this going this weekend! Thanks!!
So... I have installed the new version that you guys forwarded me to and I have bricked 2 USB thumb drives. Everything works as intended until it reboots. After rebooting, the drive is no longer recoverable as it is not seen as having any information on it. It's almost like the partition information is corrupt... Any ideas?
Thanks,
Dee McKeel @.***
On Fri, Aug 13, 2021 at 9:12 AM Joulinar @.***> wrote:
on the tool you use the flash the image, simply select the USB drive as target. Usually Raspberry Pi 3B+ supports USB mass storage boot out of the box. https://www.raspberrypi.org/documentation/computers/raspberry-pi.html#usb-mass-storage-boot
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/MichaIng/DietPi/issues/3708#issuecomment-898447886, or unsubscribe https://github.com/notifications/unsubscribe-auth/AT4AG7ECOJHHATSD5E3TXCDT4UK2BANCNFSM4PZJ7GOA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .
You mean our RPi Bullseye image? It does not come up on reboot? Is there any output on the screen? And what happens if you attach the drive to another Linux system and try to mount the partitions there?
This is quite unexpected since there is AFAIK currently only a single APT package upgraded. On very early boot stage, the root partition and filesystem are expanded, but that should not break anything, especially when bootup continues afterwards and first run setup goes through.
To check, on first boot session, whether everything went fine, the log files in /var/tmp/dietpi/logs
can be checked, which also includes the partition and filesystem expansion.
Yes. Installed it on a 32gb nand flash drive, used ssh to complete installation with Fail2Ban, PiVPN, and Pi-Hole. Had static IP set on device and on the router. I was able to reboot after the Pi-Hole install and continue with the rest of the apps, but after completing the install and the command prompt going back to root, if I reboot the drive is toast. Is not recognized if I boot from the microSD card and insert the flash drive.
I’m going to try to install to another microSD and test that, but I don’t want to keep bricking flash drives. It literally says that it’s a drive of 0b on a windows machine and doesn’t show at all on the rasbian device.
Thanks,
D L McKeel, Jr.
Sent from my iPhone
On Aug 14, 2021, at 3:09 PM, MichaIng @.***> wrote:
You mean our RPi Bullseye image? It does not come up on reboot? Is there any output on the screen? And what happens if you attach the drive to another Linux system and try to mount the partitions there?
This is quite unexpected since there is AFAIK currently only a single APT package upgraded. On very early boot stage, the root partition and filesystem are expanded, but that should not break anything, especially when bootup continues afterwards and first run setup goes through.
To check, on first boot session, whether everything went fine, the log files in /var/tmp/dietpi/logs can be checked, which also includes the partition and filesystem expansion.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.
Is not recognized if I boot from the microSD card and insert the flash drive.
What do you mean by not recognised? Is the drive itself recognised, i.e. shown by lsblk
, are the contained partitions recognised (same command), are the filesystems seen at least, so that you can run fsck
on them? And then of course are there any kernel errors shown?
dmesg -l emerg,alert,crit.err
If one reboot is possible, after installing Fail2Ban PiVPN and Pi-hole, then it obviously is one of the "rest of the apps" which causes the issue, or e.g. an issue with voltage when due to additional services the CPU load and disk writes raise.
Here is the result of lsblk
after booting from the microSD with the USB drive installed.
root@PiHole-2:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
mmcblk0 179:0 0 14.9G 0 disk
├─mmcblk0p1 179:1 0 41.8M 0 part /boot
└─mmcblk0p2 179:2 0 14.8G 0 part /
root@PiHole-2:~#
The USB is not listed, only the 16gb microSD.
Should we move the conversation to a different thread?
Thanks The USB drive is not listed, only the 16gb microSD.
Should we move the conversation to a different thread?
Thanks
Can you share dmesg
as well. It might be a longer output. Probably you could copy it into a file and attached it manually to the GitHub post.
And yes, it makes sense to open a new issue for this 👍.
Ok, I have tried installing the Unifi controller on a new Pi4 8gb with dietpi bullseye on a 32gb USB 3.1 SanDisk Ultra Fit drive. When trying to run:
apt install openjdk-8-jre-headless
I get this:
root@DietPi:~# apt install openjdk-8-jre-headless
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package openjdk-8-jre-headless
Any idea how to correct this? I get the same E: error when I try:
root@DietPi:~# echo 'deb http://www.ubnt.com/downloads/unifi/debian stable ubiquiti' | sudo tee /etc/apt/sources.list.d/100-ubnt-unifi.list
sudo wget -O /etc/apt/trusted.gpg.d/unifi-repo.gpg https://dl.ubnt.com/unifi/unifi-repo.gpg
deb http://www.ubnt.com/downloads/unifi/debian stable ubiquiti
--2021-08-29 00:15:50-- https://dl.ubnt.com/unifi/unifi-repo.gpg
Resolving dl.ubnt.com (dl.ubnt.com)... 99.86.224.96
Connecting to dl.ubnt.com (dl.ubnt.com)|99.86.224.96|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1196 (1.2K)
Saving to: ‘/etc/apt/trusted.gpg.d/unifi-repo.gpg’
/etc/apt/trusted.gpg.d/unif 100%[========================================>] 1.17K --.-KB/s in 0.003s
2021-08-29 00:15:50 (386 KB/s) - ‘/etc/apt/trusted.gpg.d/unifi-repo.gpg’ saved [1196/1196]
root@DietPi:~# sudo apt update; sudo apt install unifi
Hit:2 https://deb.debian.org/debian bullseye InRelease
Get:3 https://deb.debian.org/debian bullseye-updates InRelease [36.8 kB]
Get:4 https://deb.debian.org/debian-security bullseye-security InRelease [44.1 kB]
Get:5 https://deb.debian.org/debian bullseye-backports InRelease [39.3 kB]
Hit:6 https://archive.raspberrypi.org/debian bullseye InRelease
Get:1 https://dl.ubnt.com/unifi/debian stable InRelease [3023 B]
Get:7 https://dl.ubnt.com/unifi/debian stable/ubiquiti armhf Packages [712 B]
Fetched 124 kB in 3s (37.6 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
unifi : Depends: mongodb-server (>= 2.4.10) but it is not installable or
mongodb-10gen (>= 2.4.14) but it is not installable or
mongodb-org-server (>= 2.6.0) but it is not installable
Depends: mongodb-server (< 1:4.0.0) but it is not installable or
mongodb-10gen (< 4.0.0) but it is not installable or
mongodb-org-server (< 4.0.0) but it is not installable
E: Unable to correct problems, you have held broken packages.
Please help and thanks in advance!!
I guess MongoDB is not available on Debian at all and JAVA8 is not available on Debian Bullseye.
Ugh.... Does this mean that the Unifi Controller can't be installed on Bullseye?
Main issue is MongoDB as you are not able to install it on Raspberry Pi at all. Doesn't matter if it is Buster or Bullseye. Because the MongoDB repository does not support ARM platform.
The Unifi Controller is a very popular tool on the Raspberry. I found a guide on the net how to install it:
https://smarthome-training.com/de/unifi-controller-raspberry-pi/
Does anyone have the time and inclination to add the Unifi controller to the software archive so that it can be easily installed via
dietpi-software
?PS: Be aware of the missing JAVA_HOME-Bug: https://community.ui.com/questions/Java-Home-Directory-Fail-Issue-on-Ubuntu-RESOLVED/1faea5fd-6eda-4be9-a12f-676ef6be2529