Raspberry Pi as server

Setup & config options

Apache 2.4+ LAMP server

»Windward« server

The game & not the islands
 Setup & config options

Some off-topics
Free weather app. Weather widget

Lat. 52.27, Long. 8.01

 

Meteorological service

Front desk clerk

🚫  No ads & tracking

Tag cloud
QRC bookmark

QR quick response code



Github social media VSCO social media Vimeo social media | Madeira | Madeirense Twitter | X Youtube social media

The prologue


Most of the articles, descriptions and instructions written here are applicable to the most common Debian-based Linux derivatives. Depending on the respective operating system, there may be minor or major discrepancies.
This website is for educational purposes only. Please do not deploy anything in manufacturing plants.
No warranty or compensation is given for loss of data or hardware.

It should be also mentioned that this modest web server is hosted on a Raspberry Pi type 4B at home.


The Raspberry Pi mini-computer board as multi-purpose server deployed
A competent allrounder for domestic purposes and micro-enterprises


Raspberry Pi : Apache as multiple web server. Print server, scan server, backup and NAS server. Raspberry Pi : Apache as multiple web server. Print server, scan server, backup and NAS Server.

Raspberry Pi is a series of small single-board computers (SBCs) developed in the United Kingdom by the Raspberry Pi Foundation in association with Broadcom. The mini-computer with its armv7l processor has quickly become the favourite of hobbyists. Projects can be started with suitable Linux distributions. Even an aged RasPi e.g. the models 2B and 2B+ can definitely serve to simple tasks quite well.


Raspberry Pi | 🔋 Basics of energy supply - power supply


Raspberry Pi power supply.

The power supply of the Raspberry Pi is one of the underestimated sources of error. Mini-computers, such as the Raspberry Pi, require a stable voltage and power supply.

With a poor power supply and unfavourable operating conditions, strange effects occur in combination with unstable system behaviour.

An effect known as a mystery usually manifests itself with LAN and WLAN connection break downs and other malfunctions of devices connected to the USB. For example, external WLAN adapters, USB sticks and hard drives.


The effect that occurs is called a mystery, because at first glance the malfunction that occurs has nothing to do with a defective power supply. However, there are an infinite number of problem descriptions in discussion forums. The victims of the mystery report about dropouts with keyboard, mouse, screen display and very often connection problems with LAN and WLAN. The resulting effects and problems are manifold. For troubleshooting, hours can pass without getting closer to the error. In some severe cases the error cannot always be reconstructed so easily.


The problems that arise are often related to the fact that the stability of the voltage regulation leaves something to be desired.


Power consumption | From official sources


TypeMainboardUSB devicesMaximum
Model A200 mA500 mA700 mA
Model B500 mA500 mA1200 mA
Model A+180 mA500 mA700 mA
Model B+330 mA600 mA (1200 mA activatable)1800 mA
Model 2B330 mA600 mA (1200 mA activatable)1800 mA
Model 3B330 mA600 mA (1200 mA activatable)1800 mA
Model 3B+no info yetno info yetno info yet
Model 4Bno info yetno info yetno info yet

🔋 If unsuitable plug-in power supplies are used,
strange effects can occur during operation


Why, why and why ?


What does this have to do with the power supply? If you observe the power consumption of the Raspberry Pi while using the keyboard, mouse and WLAN adapters with a measuring device, you will notice severe deflections. These USB devices are real power guzzlers. A mouse, when moved, can draw 50 mA or more current. The same applies to a keyboard or WLAN adapter. These devices are not exactly designed for low power consumption. That is also quite logical. With a conventional notebook or PC, there is a sufficiently dimensioned power supply. And actually this should be possible with a Raspberry Pi and any other mini-computer. But the user has to take care of it himself. And they use a conventional power supply unit. From his smartphone or another one that he still has in the drawer.


Many plug-in power supplies typically used to charge smartphones and tablets are not power supplies, but usually chargers for battery-powered devices. These chargers rely on the fact that the device they supply does not expect a stable voltage. Battery-powered devices are typically charged with electricity, but the stability of the voltage from the charger does not matter. Only the charging circuit in the device or battery ensures that the battery is charged correctly. This has the advantage that the device manufacturer can install individual batteries and the user can use almost any power supply unit.


The power supply of the Raspberry Pi is one of the underestimated sources of error. Mini-computers, such as the Raspberry Pi, require a stable voltage and power supply.Not so with a Raspberry Pi or any other mini-computer. They depend on a stabilised operating voltage of usually about 5 volts. If you use the Raspberry Pi with any mains adapter, then this can and will usually work. However, if the Raspberry Pi and connected USB devices cause an impulsive current drain, then it can happen that the mains power supply is overloaded, fails and the voltage drops. In other words, the voltage drops well below 5 volts.


What happens then? A device designed for 5 volts will then enter an unstable operating state. In addition, USB devices expect 5 volts on the USB port. According to the USB specification, a USB device should work between 4.45 and 5.5 volts. There is actually no danger from here.


But now the Raspberry Pi has a say in all this. In the event of undervoltage, the Raspberry Pi takes its USB ports out of service to restore the stability of the power supply by reducing the current drain. In doing so, all USB devices are shut down, at least for a short time. This leads to the aforementioned malfunctions of individual USB devices or the entire system and explains the dropouts in the USB devices. This concerns mouse, keyboard, WLAN and LAN connections, as well as USB memory devices.


Once the minimum voltage has been reached, the Raspberry Pi will start up the USB and any devices connected to it. While the keyboard and mouse log back on quite quickly and automatically, LAN and WLAN connections may remain disabled by the software and have to be activated manually. Unfortunately, in this situation you can no longer access the Raspberry Pi via SSH.


Some users find themselves forced to pull the micro-USB plug on the Raspberry Pi and thus hard switch off. However, this should be avoided, because hard power off can cause damage to the file system. If an important system file could not be written to completion at the time of powering off, not the hardware but the file system will be damaged. In such a case, an incomplete or faulty state may prevent a successful reboot. You may also have to complain about data loss.


Plug-in power supplies designed as chargers are
not suitable for supplying power to a Raspberry Pi.


Many power supplies used on the Raspberry Pi are not real power supplies at all, but chargers and therefore only conditionally suitable as power supplies. However, a power supply unit or adapter is fundamentally different from a charger.


A real power supply unit is a voltage source with electronically limited maximum current. A power supply unit attempts to keep the voltage stable up to its maximum current, even if the current draw is temporarily high.


A simple charger is a power source with electronically limited maximum voltage. The charger simply tries to supply the maximum current, regardless of the voltage.


This means that a charger is only suitable as a power supply unit if the limitation of the maximum voltage works precisely not only upwards but also downwards. In other words, how a power supply unit is electronically controlled and does not just consist of a cheap Zener diode.


Now, unfortunately, vendors and users ignore this. The reason is that both do not have the appropriate expertise and do not know the difference between a charger and a proper power supply.

The vendors are not entirely innocent of this. As a rule, they are not from the trade and are not in a position to judge what they get from the manufacturer or wholesaler and resell to the final customer. For example, the plug-in power supplies advertised as power supply units are usually just simple chargers. Users in particular suffer because they have to rely on the vendor not to sell them trash. Even if the retailer describes or advertises his plug-in power supplies as Raspberry Pi-compatible, this does not mean anything.


Raspberry Pi | The right power supply


Just because 5 volts come out of a black plastic part with a long tail and micro-USB plug does not mean that a Raspberry Pi can be reliably operated.


Basically, the Raspberry Pi is powered by a voltage of 5.0 volts (V) at the micro-USB input. Strictly speaking it is 5.1 V, which is what most USB plug-in power supplies also supply. It is 5.1 V because there are losses due to plug connections and cables. In addition, voltage stabilisation is always subject to specimen scatter and small fluctuations in stabilisation. A little overvoltage makes sense at this point.


Of course you can also operate a Raspberry Pi under 5.0 V. Up to a voltage of 4.75 V this should not be a problem. Below that, you should make sure that the operating voltage is stabilised, as otherwise considerable instability can occur. Basically you should not try to operate a Raspberry Pi with undervoltage if you are not familiar with it.


The second important value in energy supply is electricity consumption, which is expressed in amperes (A). Exactly how much electricity the Raspberry Pi needs depends on what is connected to it. As a rule, a power supply unit with 2 A (2,000 mA) is sufficient. But only if you do not connect any power-hungry USB devices. Then you need an external USB hub or a power supply with at least 2.5 A (2,500 mA). It is important to know that a Raspberry Pi cannot draw more than 2.5 A. If the whole system needs more current, this is limited by a fuse and can lead to instability.


The voltage (Volt, V) of a power supply unit is a nominal value that must be maintained. This means that the voltage of the power supply unit and the operating voltage of the device must match. The two values must not differ significantly from each other. The current (Ampere, A) and the power (Watt, W) of a power supply unit are nominal values which must not be exceeded. It should be noted that a 10 W or 2 A power supply unit (at 5 V) must not be operated at the nominal value and must not be operated beyond this value. If the 2 A is to be disconnected, the power supply unit is inevitably brought into an unstable state. This means that the voltage breaks down and the supplied device fails. So if you need 2 A, you never use a 2 A power supply, but a step above it. At least 20 % to 30 % more. So at least 2.5 A. Better more.


USB


In general, any USB device without its own power supply must be powered by the Raspberry Pi. The power consumption can vary greatly depending on the device. For example, the current consumption of a keyboard can vary between 0.1 A and 0.5 A (100 mA and 500 mA). To make matters worse, USB devices can draw current impulsively. This can make the Raspberry Pi or the power supply unit lose its footing. For safe continuous operation, the power consumption of USB devices must be checked individually. If the Raspberry Pi is unstable, an externally powered USB hub is a solution. It is better to use USB devices that do not consume as much power.


GPIO


What does the GPIO have to do with the energy supply of a Raspberry Pi ? If you wire the GPIO connector strip, then quite a lot. A single GPIO port can supply a maximum of 16 mA without being damaged. All GPIO pins together can deliver a maximum of 50 mA. If you assume 40 pins, but only 26 of them can be connected as GPIOs, the current you can draw from a GPIO port, if you use them all as outputs at the same time, is only 2 mA. Since you will not use all pins as output at the same time, the current draw per pin should not be higher than 3 to 5 mA. The less, the more pins you can use as output and the more stable the Raspberry Pi will run.


HDMI


What does HDMI have to do with the power supply of a Raspberry Pi ? If you want to connect a screen to the HDMI port, then quite a lot. On average, the HDMI connection consumes up to 50 mA current (measured).Starting with the Raspberry Pi B+, up to 400 mA can be drawn. This is important for HDMI devices without their own power supply. HDMI to VGA converters receive enough current from the HDMI port.


Ethernet port (RJ45)


What does the Ethernet port have to do with the power supply of a Raspberry Pi? If you want to connect the Raspberry Pi to the network via this port, then quite a lot. If you have connected a remote station to the Ethernet port with a cable, the current consumption is around 60 mA (measured).


Camera Connector Interface (CSI)


A camera module for the Camera Connector (CSI) requires around 0.25 A (250 mA). Unfortunately, it was not possible to find out whether this is true, because the data sheets of the relevant suppliers on the power consumption of your camera modules do not provide any information.


30-Oct 2020

dosboot.org 2024 | Design and layout handmade in Northwest Europe