Experimenting with Nextcloud and A Raspberry Pi 4
Nextcloud is an open source file sharing solution that has iOS, MacOS, Android, Windows and Linux apps. You can install it via a docker container, natively or via a number of other solutions. For my experiment I installed via Docker on Windows but haven’t done anything with it, and with Nextcloudpi. The latter is an ISO image that you can download and install to an SD card using the Raspberry Pi Imager.
Use Case
It’s easy to take dozens, or even hundreds of pictures in a single day on the mobile phone but it’s a nuissance to download them all locally so you usually use iCloud, Google Photos or some other solution. This is great, for as long as you have enough space on your phone. The moment iOS or Android stops offloading your photos from your device you’re in an annoying situation. Uploading photos to cloud services is painless. Retrieving them is a nightmare, for two reasons. The first reason is that you need to have enough storage locally to download all those files. When you’re on a laptop storage is at a premium.
You could use an external hard drive but it may take days, or even weeks to download all of your files. This means that you need to keep your machine plugged in and downloading for as long as it takes to download those files. That’s where Nextcloud comes in. When it’s working correctly it will download files from your phone, either as you take them, or when you choose to upload them.
What it does
It allows you to store and share photos, including encoding and decoding of video files, as well as preparing preview files, reading RAW image files and more. It allows you to have contexts, calendar, time tracker, apps like GpxPod, Tasks and more. It also provides you with an RSS reader, video player, and audio player.
With the photo app you can use facial recognition and other AI tools. As images are added to the galleries it checks for their location and adds them to a map as you would with Google Photos and iCloud. It also gives you the option of adding an exif reader to get more info from your saved files. With the GpxPod app you can download walks, hikes, runs, bike rides and planned routes and view them on the screen. I have yet to play with it properly.
How to Break Things
- upload 19,000 images at once. It will overheat the device
- reboot the machine. Having a different ip will get nextcloudpi.local to fail.
- ensure that your machine is called nextcloudpi.local
- use “sudo nano /var/www/nextcloud/config/config.php” to enter the config file and ensure that the ip address is listed. It needs to see that the current IP is a trusted one.
- Go from one wifi access point to another. I found that if I go from the living room wifi to the bedroom wifi it loses sight of the server and fails.
- Allow the Pi to Overheat. If the Pi reaches above a certain temperature the Pi will begin to fail. You need a fan if you’re playing with Nextcloud on a pi, especially when synchronising tens of thousands of pictures.
Why This Solution is Interesting
The system is new to me so I’m micromanaging it as it tries to get through thousands of files. Once it’s up and running it will be invisible and that’s the beauty of such a system. Once the Pi has its own fan it will no longer overheat and if I provide it with WiFi and Lan it should be accessible locally whether on one wifi network or the other.
With some network storage solutions you have the disks and the LAN interface within the same box, and if one fails you might lose access to the drives. With this solution you can attach an SSD or other hard drive to the Pi. If the Pi fails you just replace it. Once everything is running smoothly I would have two drives. The primary drive would be in constant use, and the second drive would serve as a backup.
It’s also low cost. A raspberry pi is cheap, and so are micro SD cards. Mobile phones are usually 128, 256 or 500 gigabytes. With a single SD card you can backup your phone every time you get home, as it syncs the most recent files.
And Finally
If I was not synchronising a huge backlog of photographs this solution would be up and running. It’s because I’m trying to backup the images that are on my phone that there are teething problems. I edited the config file to recognise nextcloudpi4.local and the two ip addresses the device is currently on. I have it on wifi and lan because I want to see if I can access it from either wifi. If that is the case then I have succeeded and the last step will be to have the Pi in a case with a fan.