New user uncertain of what to do next with Raspberry Pi

Hi, I’m new to trying to do interesting stuff with computers but from watching LevelOneTechs and Linus Tech Tips I bought a NAS last year and this year have tried to learn a bit more of how to use linux and the Raspberry Pi 4b that I had gotten for a university project in Computer Systems Engineering.

After completing a vaultwarden instance that utilized portainer to deal with docker, as well as nginx reverse proxy on the Raspberry Pi I would like to do more with it but I don’t know what would be a good next task as well as if I should be using the QNAP TS-230 I bought last year for something other than solely storage.

Last year I had thought about trying to make a pantry/inventory management system that would maybe be a progressive web app or use the Pi to scan food that is bought after there was a problem in the house where we ran into issues of having food that went bad in 2018 found in 2020 and generally not knowing what food there was in the house. However, none of the courses I took in university at the time really was on web apps and after spending a few hours trying to learn JavaScript over a few weeks I had to focus on school.

Sorry if this is really rambly, I want to do more with my tech, but I just don’t know what my next step should be. I don’t live alone, so I don’t know if I should be doing too much that effects the router other than the basic opening of ports.

Thank you for your time,

Ultraforce.

Same problem here, I have quite a few Pi’s I don’t know what to do with. But, what I’ve learned is that uses come up over time. I have the following Pi’s

  • Genmon - Runs Genmon and plugs into my generator for advanced generator monitoring and control

  • ADS-B Flight Tracking - One has a USB RTL-SDR radio plugged in and then I do ADS-B flight tracking, feeding to ASBX, FlightAware, FlightRadar24

  • TinyPilot - One runs TinyPilot, which is a IP KVM solution, it has the hardware to take HDMI and remote control via a webUI

Past that, I’m out of ideas! Anything I want to run just goes in a VM

4 Likes

I luckily don’t really need to worry about the VM problem at the moment from tests I don’t think my current computer can handle VMs. I do actually want to try and build a PC for the first time. Though I don’t know if it should be rack mounted or a tower and would like to have it be set up ideally, so I can run some VMs and also have both Windows for playing my video games and a Linux distro open at the same time for learning and trying to do code. I got the idea from the LTT video about using unRAID to split operating systems.

1 Like

Have you heard of https://www.home-assistant.io/? It’s a home automation platform with integrations for many, many devices built by the community. You can link together your systems and do some cool stuff.

If you want to build your pantory / inventory management system, all you really need is a database, some kind of web server, and a web ui. If you know a bit of JS maybe look at node.js (javascript web server), and sqlite (a simple database). If you google for something like “nodejs inventory system tutorial”, you should find some tutorials that point you in the right direction. I’d recommend building small prototypes that do one thing, then building new prototypes that extend it, until you eventually reach the full functionality.

4 Likes

So setting up Home Assistant on the Pi to get that functionality might be a good idea?

Home Assistant was an idea of something you can do with your Raspberry Pi, unrelated. The second part was just talking about how you might build your inventory management system.

Ah, I was wondering if Home Assistant had an inventory management system that was designed by the community. I’ve not used node.js but I’ve used a bit of react.js so I think I could definitely learn. Though I wonder if I’ll run into issues with databases for the bar codes to have it be understandable to all users in the household.

So react.js let’s you build web apps that run on the users phone. Node.js let’s you build a web server on a server (like your rpi). Your web app can then talk to the web server using a REST api. This allows the web app to lookup and store information in an sqlite database on the server. This allows your web app to synchronise information between multiple phones.

In the database you can have a table that stores barcode, food type, and friendly name. From there you can use a javascript library on the users phone to scan barcodes, lookup the friendly name in the database, and show that to the user.

I think the best advice here is to just dive in and make something. You’ll find issues and challenges as you go along, but you’ll also find ways around them.

2 Likes

It wouldn’t surprise me. It’s a kitchen sink of household related stuff.

If it didn’t, maybe it’d be fun to add such a thing.

(web widget to scan barcodes, match against a database of products on the backend, quickly tap best before dates).

1 Like

Buy one of the electronic kits for the pi and play with driving stuff via the GPIO port.

The pi has software libraries to make this really easy and you can actually have the thing interact with the real world.

1 Like
1 Like

For setting up Home Assistant should it be in a seperate Docker environment from other local projects?

Maybe this is one of those cases where I should read more about Docker since I’ve been using it and Portainer just by following the guides line by line rather then understand what I’m doing exactly with the miniature virtual machines that are being created.

If you want to go into electronics tinkering side of PIs, you could get some LED Dot-Matrix units, some buttons and program a simple game (snake/pong/tetris/etc.)

1 Like

Not necessarily pi related, but it is a computer. You already know docker, go next level. Install LXD on it, make 4 containers of your choice, enable nested containers on the 3 containers, install k8s or k3s or microk8s or k0s on all 3, use one container as the master node, the rest as worker nodes and redeploy your vaultwarden and nginx and all that. Poweroff one of the containers and have k8s relaunch the containers on another one.

Although it is not as easy as using portainer.

As for the qnap, I’d only use it as a NAS.

Sorry, what is the main advantage of on the pi using LXD which from brief reading seems to be virtualizing an entire Linux instance which can then be used to monitor and control the containers. Is it a matter of centralization and it being more efficient for the machine?

I think one of my professors back in university might have mentioned LXD, but I don’t really remember it. So I’m unclear what is the advantage.

Oh and I’m not 100% sure if I’ll be using nginx since I heard about tunnelling and zero tier which since I don’t know much about networking the idea of having an alternative where port forwarding can be avoided completely seems like it might be a good idea.

1 Like

I have similar issues with my pi, not sure what to do with it.

My friend does this, it’s very cool if you’re into planes at all.

LXC is basically a container technology using cgroups, just like Docker originally used. LXD is just an orchestrator for LXC. And the LXC containers are basically pure linux operating systems. You can install the container version of Ubuntu, Debian, Fedora, CentOS, Rocky, Alma, Arch, Gentoo and so on. LXD gives you a lot of choice for container OS and versions.

LXC is more of a replacement for traditional VMs. It makes things more efficient, because you don’t have to emulate the CPU, allocate all the RAM at once and so on. You also get traditional networking with LXC by having the container’s virtual ethernet port bridged to any physical interface you want through technologies that already exist in the linux kernel.

Only disadvantage of LXC is that it can only run Linux containers. That is because the OS inside the container doesn’t have an OS of its own, it uses the host system’s kernel. Which means you gain even more lower resource consumption. But it’s also its weakness, because you may want access to some kernel features, which means you have to either run the container in privileged mode, or use a VM instead. K8s doesn’t need access to the kernel.


Kubernetes in itself has to be installed on multiple OS (VMs or baremetal). Most people build k8s clusters using 4x RPis at home, without being aware that they can have a test lab by leveraging LXD. Instead of buying 4 RPis and a switch, or even worse, trying to run full fledged VMs on the RPi (which it can run, there are aarch64 iso installer images for Debian and Arch), you can just use containers. A RPi with 2GB of RAM can easily run 4 containers, each container OS uses about 30-40MB of RAM, even the Ubuntu ones. So you add about +100MB for the k8s stack, so you should use about 1GB of RAM for the host OS, LXD and k8s and you are left with about 1GB of RAM for your programs that you launch in k8s.

Of course, the more RAM, the more things you can run. If you would run VMs on the Pi, you wouldn’t be able to squeeze all this on a 2GB RPi.

Also, k8s has a hard limit of around 200-250 pods that it can run on a single worker node. If you have a 32 core 512GB of RAM monster server, it’s going to be wasted. Using LXD on that and having more workers on the same hardware basically maximizes what you can do with k8s. And having more worker nodes doesn’t matter, because the master node takes care of the management and distribution. You can have some rules to order the launch of the pods on certain nodes before reaching others though.

1 Like

The Pi I have is a Pi 4 so I believe it’s about 8GB RPi so I imagine it would be able to handle it. For LXC what would be the decision for the OS since I don’t really know much command line should I just have the LXC container be debian so it’s very similar to the raspberry pi OS that I access via VNC? I think I don’t really plan to run traditional VM’s on the Pi I’d rather have a desktop or laptop do virtual machines that would be used outside just containers.
image

2 Likes

Yes, you can pick debian aarch64 for the container OS and find a Kubernetes guide for debian or for the raspberry pi, as the setup will be basically the same, just that you would use LXD instead of physical Pis.

They are CLI only though, it is a bit involved to get a desktop on them and then you would be using more of the limited resources the Pi has, although it can be done, although I don’t recommend it.

If you want a GUI, I think racher offers something for k3s. If I’m not mistaken, Portainer supports microk8s, so technically you can still make use of portainer if you deploy it in microk8s, just not the same instance that you currently have on your Pi.

Anyway, this was just an idea. If you are more familiar with electronics projects, there are plenty of ideas that use a Pi as the main component, mostly going around home automation with temperature sensors and stuff and using Home Assistant to integrate everything in it, or for more standalone projects, like motors that point towards the location of the ISS or things like that.