I want to introduce you to my new project today. It only partly has to do with ESPEasy, but it plays an important role.
My Nextcloud server with integrated UPS
(An utilisation of electronics that I had lying around here uselessly)
Features:
- Modular design: You can also add another 2.5" hard drive instead of the UPS (9mm). So the maximum would be two SSDs with a dual PCIe M.2 Shield and two up to 9mm high 2.5" HDDs.
- Easy accessibility: All components are easily accessible. Hard drives can be removed from the bottom. The enclosure-cylinder can be pulled upwards, with the display serving as a fixing button.
- Cable management: The cables of the external hard drives can be stowed in the base through extra cut-outs. The cables leading to the outside are fixed by the snap-on foot.
- Active ventilation: It hardly ever starts unless the server is under full load and it is very warm outside. Otherwise, natural convection is sufficient.
- Display touch button and light sensor: In the normal state, the display shows a green bar that represents the fill level of the data partition. If you press the touch button, important information is displayed. The brightness of the display is regulated depending on the LDR.
- UPS: As soon as a power failure occurs, the Raspberry Pi shuts down. The Esp32 serves as a watchdog and wakes the RPi up again if necessary.
- ESPEasy: ESPEasy monitors the system. It regulates the UPS (the charge controller is activated or deactivated depending on the state of charge and temperature. There is no trickle charge). It takes care of the display and other sensors for touch, light, and temperature. It communicates with the RPi via a serial connection.
- Low consumption: 5 watts idle
- Daily backup via rsync from SDD to HDD (I don't need a RAID so it's much more energy efficient)
1. Display:
I use a 1.77" display with a resolution of 160x128 and the ST7735 as controller. It took me several hours to get this display to work. At some point I found the crucial clue on the Internet:
The CS pin, although specified as optional on ESPEasy, must then be connected to ground!!!
2. UPS:
I chose the cheapest UPS on Aliexpress I could find. It’s called LX-2BUPS.
It uses two parallel 18650 batteries and a boost converter.
Unfortunately, boost converters are terribly inefficient. When my system consumed 10 watts, the input power was 20 watts.
But energy efficiency is very important to me!
So I kept all the components of the UPS except for the MOSFETs for switching from external supply to battery operation and a few capacitors. I modified the board so that the batteries are connected in series. Then I added a 2S protection board (which has an integrated balancer) and an extra charging board controlled by ESPEasy.
At the output of the UPS is a very efficient buck converter that can supply up to 5 Amps. An INA216 monitors the voltage and power.
The system now consumes around 5 watts idle and 10–12 watts under load.
3. M.2 SSD on the Raspberry:
It took me a few days to install Nextcloud, as I/O errors occurred, especially when booting.
It turns out that SSD via PCIe port on the Raspberry is not the same as Plug'n'Play.
With my SSD (2TB WD Black 7100) in particular, I had to add
Code: Select all
dtparam=pciex1_gen=3
Fortunately, the server is now running without problems.
4. Audible Fan:
The fan I had lying around doesn’t have internal PWM control. In ESPEasy, I can use a specific frequency, but the fan still didn’t sound too happy about it, and the set frequency also got reset system-wide when using the backlight control of the display.
So, since it was already connected to Pin 25, I used the DAC plugin.
And it now works really well. You can barely hear the fan while it is running.
Existing problems:
- ESPEasy sometimes crashes. Or the individual cores. Sometimes the ESP is still connected via WLAN, but ESPEasy is no longer accessible. Or the ‘wifi’ core crashes and then only a manual reset helps. Not so good for a server that is not always within reach.
I think the serial server plugin is causing problems. I receive serial data from the Raspberry and then immediately send an acknowledge message to the Raspberry.
I have deactivated the Ack message and now it seems to work...
Here are some pictures (I didn’t put too much effort into cleaning up the 3D printed parts):