# 06-28 Implementing RTC and time control

I spent a lot of time setting up accurate time control on the Raspberry Pi today with the real time clock and ntp. I also wrote a guide in the README.md file for which config files to edit etc. I also trimmed the jumper cables so that the RTC no longer hang off of the side of the RPi. Now the setup can also work without network with the backend on the localhost and still have accurate time. Using { while true ; do echo $(($(date +%s%N)/1000000)) ; sleep 0.1 ; done } | uniq I also checked the impact of the NTP server in LAN on time accuracy. The difference fluctuated a bit but was shown to be within ~40ms between both devices. The fluctuations probably stem from delays in the SSH connection and WSL. Both Raspberry Pis were left to run the whole night and the times were checked with the above command in the morning. The results were just as accurate.

I also worked on dockerizing the whole application even further.

# Problem

I cannot put the backend on the RPi0W since it uses the ARM32v6 processor architecture and not all software is built for ARM32v7. The computers that I have run my backend software on have all been based on x86_64 or AMD64, so there has been native support for the most docker images. Most images (Nginx, Redis, PHP, ...) support ARM32v7 for the other Raspberry Pis, but there is no official MariaDB release for ARM32v7.

# Solution

I think I will drop support for the backend on the RPi0W completely, which probably would be too underpowered for the job anyway. In order to make the software backwards compatible with older RPi versions such as the 3 Model b and upwards, I will stick to a 32 bit instruction set architecture. Otherwise I could have tried Ubuntu Server or the Raspbian 64 bit beta, both of which are 64 bit ARM based and thus would have had official package support. Instead I am using a MariaDB fork by the linuxserver group that seems fairly trustworthy (100M+ Pulls) and supports ARM32v7.

Last Updated: 11/23/2020, 8:10:00 AM