Version 2.0 Rewrite of raspberry pi digital battery logger
Log battery sign-outs with the battery number, time signed out/in, and battery stats (rint and state of charge) before and after use, all with mongodb running in a docker container and a packaged electron app running on X server.
- Installation and Dependencies
- Project Architecture
- Settings Overview
Works when building locally (win11)
npm run generate
npm run build:linux
Finally SCP
onto the pi (overwrite existing AppImage if needed)
This installation guide assumes that you are installing this software on the intended hardware platform: A raspberry Pi 4b and a 7" touch screen. Success may vary on other untested hardware.
- Download the Raspbian 64-bit image from the official Raspberry Pi website.
- Insert a microSD card into your computer and use a tool like Etcher to flash the Raspbian image onto the card.
- Eject the microSD card from your computer and insert it into your Raspberry Pi.
- Connect your Raspberry Pi to a The touch screen
- Power on your Raspberry Pi and wait for it to boot up. Follow the on-screen prompts to set up your Raspberry Pi, including setting a password.
Run the NVM install script
$ wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
Source .bashrc file
$ source ~/.bashrc
Install node with nvm
$ nvm install node
Follow the docker installation guide for raspbian
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/raspbian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
# Set up Docker's Apt repository:
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/raspbian \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
$ sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
TODO
TODO
TODO
- api:
- sheetLink: a string representing the link to the Google Sheets document used for syncing data
- syncTimeMinutes: an integer representing the sync time interval in minutes
- centralServerMode: a boolean indicating whether the app is in central server mode
- sheetsSync: a boolean indicating whether to sync data with Google Sheets
- centralServerAPIRoot: a string representing the root URL for the central server API
- database: an object containing the following properties:
- address: a string representing the address of the database
- port: an integer representing the port number of the database
- databaseName: a string representing the name of the database
- dev:
- devServerPort: an integer representing the port number for the development server
- logging:
- historyLengthHours: an integer representing the length of time to keep log history in hours
- batteryYearRangeLower: an integer representing the lower range of years for battery logging
- batteryYearRangeUpper: an integer representing the upper range of years for battery logging
- batteryNumberRangeLower: an integer representing the lower range of battery numbers
- batteryNumberRangeUpper: an integer representing the upper range of battery numbers
- batteryLength: an integer representing the length of battery numbers
- socRangeLower: an integer representing the lower range of state of charge (SOC) values
- socRangeUpper: an integer representing the upper range of SOC values
- socLengthUpper: an integer representing the length of SOC values for the upper range
- socLengthLower: an integer representing the length of SOC values for the lower range
- rintRangeLower: an integer representing the lower range of internal resistance (Rint) values
- rintRangeUpper: an integer representing the upper range of Rint values
- rintLength: an integer representing the length of Rint values
- colors:
- primary: a string representing the primary color of the app
- secondary: a string representing the secondary color of the app
- tertiary: a string representing the tertiary color of the app
- warning: a string representing the color for warning messages
- primaryText: a string representing the color of primary text in the app
- secondaryText: a string representing the color of secondary text in the app