Intro: Media Server Using Raspberry Pi
Perhaps you've been on travels or trips and have thought: 'I wish I could carry this as well, oh.. and this as well.' Don't worry, I'm the same :). Travelling can often be time-, and memory-consuming (from taking pictures and videos) so to tackle that boredom and the lack of memory, the best solution I came across was a compact and portable cloud, which works offline. While most cloud-storage's are chunky, other online-clouds rely on a internet connection. Both don't seem like good solutions for traveling so I decided to go with a portable, offline-cloud. I renamed this as the ArOZ-Online system, since the original project was also called the same (see below).
Since the release of the pi zero w, portable and connected projects including the raspberry pi have become more popular and also more compact. What if you could make your offline-cloud with just a pi zero? The form factor of the pi zero as well as the low cost make it quite suitable for this project.
This offline-cloud works by providing a wifi-signal from the pi zero w's wifi adapter. By connecting to the wifi from the pi zero, your phone, tablet or laptop is able to access the memory from the pi zero's micro sd card through a offline-website provided by the pi zero w. Pictures, videos and music can be uploaded, downloaded and played from that website. The whole system works automatically by simply powering the pi zero w.
The original project (https://www.instructables.com/id/Simplest-Media-Ce...) belongs to tobychui from intructables (https://www.instructables.com/member/tobychui/), who put a lot of time and work into making this project a reality. I'd like to thank this good friend of mine for all his help and would like to request from you to take a look at his projects.
Step 1: What's Needed?
Access to a laptop or pc
A raspberry pi zero w
A mirco sd card (min 8GB) for the operating system (Sandisk Ultra and Samsung EVO+ are recommended due to their high writing and reading speeds)
Something to access the micro SD card from your laptop/ pc. I didn't need anything but you might need a micro SD to SD card adapter or a usb in which the micro SD card can be fitted and accessed from the pc/ laptop.
A micro USB cable to power the zero w
And maybe a case for protecting the pi zero w.
As for the the micro SD card, the operating system will take about 3,5 GB, the remaining memory can be used for the offline-cloud. I personally used a 64GB sandisk ultra and had about 59GB left to use for files. As far as I remember, the max. supported micro SD card size for the Raspberry Pi is 128GB, but not all cards are supported and some need to be formatted before they can be used.
Step 2: Getting Started
Instead of writing about 50 steps or more to set this project up on your Raspberry Pi zero w, I chose to simply publish the image file instead, which needs to be burnt on a blank micro SD card. The image file is 1,45 GB big and is compressed. You don't have to actually unzip the file if you follow the instruction below. Here's the link to the image file:
The image has be burnt on a blank SD card (min. 8GB). To do so, first format the micro SD card using the software 'SDFormatter' (can be downloaded from https://www.sdcard.org/downloads/formatter_4/index...). After plugging your micro SD card in, select options and activate 'Format-Size-Adjustment'. After formatting, the image can be burnt on the micro sd card. I personally prefer using Etcher to burn images, since it's simple to use and doesn't require you to unzip the image files. Etcher can be downloaded from here: https://etcher.io/ . After selecting the drive with your micro SD card on etcher, select to the ArOZ-Online image and click on flash. When the process is complete, the system is operational, but requires some modifications.
Step 3: Testing the System
Now that the micro SD card is set up, plug the micro SD card in the slot on the pi zero w. Power the raspberry with the micro USB cable. After about 2 minutes, you should be able to see 'ArOZ-Online' as a new network. Try connecting to it using another device. The default password is 'toby-chui'. You should be connected to be wifi from the raspberry pi, but there is no actual internet available. Navigate to your browser and type:
You should now be able to see the ArOZ-Online website if everything was done correctly. Now that it works, some files needs to edited. To edit the files, download VNC Viewer from here on your Laptop/PC (preferably) and connect to the ArOZ-Online system in the wifi settings.
Since it's a pain having to write the whole IP address every time you want to access the offline-cloud, I bookmarked the address of the ArOZ-Online website so I can access the cloud by clicking on one button.
Open VNC Viewer and type this address in the address field:
It will prompt for a username and password. The default username is 'pi' and the default password is 'raspberry'. If it doesn't let you login using that info, try 'root' as the username and 'password' as the password.
You should now see the desktop of the ArOZ-Online system.
After logging in, reboot the device by tying this in LXTerminal:
After the reboot, you'll be able to login using the user 'pi'
Step 4: Final Configuration
No matter what size your micro SD card has, the full extent of the memory cannot be simply used as-is. To use the full memory available by your mirco SD card, open up LX Terminal, then type in:
A menu should pop now. Select 'Advanced Options' from the menu, then hit enter. From here, select 'Expand-Filesystem'. Navigate to 'back' by using the right and left arrow keys, hit enter, then select 'Finish' in the same way and also hit enter. The system will prompt you to reboot (restart). Select 'yes' and wait. While the system is rebooting, you'll lose the wifi signals and VNC will be aborted. To reconnect, wait about 2 minutes, reconnect to ArOZ-Online in the wifi settings from your device and use VNC Viewer to display the desktop.
The next thing to do is changing the default password. This can be done by clicking the raspberry icon located at the bottom left corner, then selecting 'Preferences' and clicking on 'Raspberry Pi Configuration'. Click on 'Change password' and type in 'raspberry' as the current password. Type in a new password and retype it in the last field. Lastly, click on enter to apply the change. When connecting to VNC another time, use your specified password.
To change the wifi password from the ArOZ-Online system, a specific file has to be modified. Type this in the Terminal:
sudo leafpad /etc/hostapd/hostapd.conf
Find the line 'wpa_passphrase=toby-chui' and modify the password by replacing 'toby-chui' with your own password. Do make sure that the new password has at least 8 characters long and not easy to guess. Save the file by pressing 'Ctrl' and 's' and after saving, quit the editor by pressing 'Alt' and 'F4'. To apply the changes, reboot the raspberry pi by typing:
After a minute or two, when you can see the ArOZ-Online as a wifi-network, you'll realize that the password has been updated and no device is able to connect to it anymore. Either the device from which you're trying to connect to will tell you to retype the password or you might have to manually change the password for this network in the network settings. Once connected, type in 192.168.0.1 in your browser. The ArOZ-Online website should pop up. If it works, everything is fine.
Congrats, you've finished setting up your own portable offline-cloud.
I hope you've liked this project and wish to hear your opinion in the comments below :) Please don't forget to click on 'I made it!' when you've completed this system since this is my first instructables. I'd also be happy if you add this project to your favorites :))
Well then, thank you and see you again.
Step 5: Adding Security...
Security is important. Nobody would like it if some evil hacker is looking through someones data. At the moment, your zero w is pretty much secure since it's not actually connected to the internet but local hackers could still gain access to your data from your cloud. By 'local' I mean people who can see the SSID of your cloud. A few things can be done to improve the security of your cloud:
Forcing the 'sudo' user to enter your password:
On the Terminal, type 'sudo passwd'. It will ask you for a new password. Don't worry, the Terminal won't show you any characters you type but that's normal. Hit enter and retype your password. Now, the user 'sudo' has a password, but it won't ask for it so far. To force 'sudo' users to enter a password, type:
sudo nano /etc/sudoers.d/010_pi-nopasswd
and change 'nopasswd' to 'passwd' (just remove the 'no'). Press the Control button and the letter 'X' on your keyboard and hit enter. To save the file, simply press 'y' and hit enter, That's done!
Creating a password for the user 'root':
The user 'root' has more rights than any user. By default, the user 'root' will not ask for a password which is a security hole. Creating a password for the 'root' user will improve the security. To do so, enter 'sudo su' in the terminal to switch to the user 'root'. Once there, type 'passwd' and add a password. Hit enter and retype your password. Hit enter again to finish. Now your cloud is more secure against hackers.
Sorry hackers, nice try but no cigar ;)
Step 6: Optional: Debugging, Updating, Installing New Software...
As you've probably realized, after the last step, your pi's been cut off from the world wide web. On the desktop the Pi tells you that there is no wireless interface found. In case you might want to update or upgrade the system or install any additional software, there is a way to gain internet access without modifying anything at all. For this however, you'll need a linux-certified plug-n-play wifi dongle (basically a wifi-dongle that is supported on the Raspberry Pi eg. PiHut / Edimax / Pimoroni...) as well as a micro-USB to USB adapter. Plug in the micro USB adapter in the left micro usb slot on the Pi and connect the dongle to the adapter and power on the Pi. Connect to the Pi over VNC using 192.168.0.1 and search for wifi-networks by clicking the wifi-icon at the bottom left side. You'll be prompted to enter the password for the network. You should have a working internet connection now, which will last as long as the external wifi adapter is plugged in.
One big advantage of this system is that all functions of the Raspberry Pi Zero W can still be used. If you are on travel, you can even work on the raspberry pi's Desktop over VNC and access it whenever the Pi is powered. You won't even need a screen, a keyboard or mouse to access the desktop of the Pi Zero W.
Icesoldier made it!