Building your kit software from scratch
This page describes installing and building the AstroPlant software manually.
Software preparation and installation
First we will install Raspberry Pi OS Bullseye Lite and install all needed software. Before continuing make sure you have the LCD screen, water temperature sensor, CO2 sensor and relative humidity/ambient sensor hooked up.
Step 1. Raspberry Pi OS Bullseye Lite installation
Download the Raspberry Pi OS Bullseye Lite image from the following URL:
In order to flash the operating system image image to the SD card, use any tool suitable for flashing, such as Etcher:
To flash using Etcher, make sure an SD card is inserted in your computer and start Etcher. Select the downloaded Rasbian image and flash it to the SD card.
Step 2. Enable SSH and Wireless internet through the SD-card
Once you've flashed the operating system image onto the SD card, (re-)insert the card and you'll see one of the partitions on the card being mounted as "boot". Ensure it is the partition boot, and not the directory boot on the SD system partition. If on Linux the SD partition is not mounted automatically, mount it manually. In the root of the filesystem on the SD boot partition, you need to create two new files.
Step 2.1: Create an empty file called
ssh
in the root of the filesystem on the SD boot partition. For example, you can use Notepad on Windows or TextEdit on MacOS to create a new file named simplyssh
, without any content. On Linuxtouch ssh
from the command line inside the SD boot partition.Step 2.2: Create a file named
wpa_supplicant.conf
. This time you need to write a few lines of text to this file, adjust the file below accordingly by changingcountry
to your ISO 3166 alpha-2 country code,ssid
to your network's name, andpsk
to your network's password:
See https://desertbot.io/blog/headless-raspberry-pi-4-ssh-wifi-setup for more information.
Step 3. Connect the Raspberry Pi to the extension board
Ensure the Raspberry Pi is connected to the extension board and the power supply is correctly connected. See the Electronics assembly guide.
The first boot of a fresh Raspberry Pi install will take some time. On a Raspberry Pi Zero W it may take a few minutes.
Step 4. Headless: Connecting to the Raspberry Pi via SSH
You may skip this section if you use a monitor and keyboard.
Once you have set up your internet connection and enabled SSH, you can connect to the Raspberry Pi over the network. The default username is pi
and password is raspberry
.
If your Raspberry Pi cannot be found, use a tool like Angry IP scanner to figure out the IP address of your Raspberry Pi. Alternatively, check your router's DHCP lease table. Then you can connect via ssh pi@<ip_address>
.
Step 5. Enabling sensors and changing the password via `raspi-config`
Run raspi-config
:
You'll see the following screen
Configure the Interfacing Options as follows:
Enable the camera
Enable the SPI interface
Enable I2C
Serial:
Disable the login shell
Enable serial port hardware
Enable 1-wire
Optionally change the password for the pi
user. If you wish you can also change the timezone in the localization options to your country's timezone.
Step 6. Installing software packages
Update the package lists:
Install the following packages:
For completeness, reboot the Raspberry Pi:
Step 7. Test sensors
This step is optional, but recommended.
Clone the test repository in the home directory (/home/pi
):
Change directory to the folder. Run the following commands one-by-one. Ensure you retrieve readings from each sensor.
For the humidity and temperature sensor, install the Adafruit_DHT library.
Run a test script provided in that library's repository:
Step 8. Install the AstroPlant Kit software
Install the Kit software:
Ensure the installation succeeded. The following command should output the kit software version:
Step 9. Register and configure your kit
Follow these steps to register and configure a kit if you haven't already done so:
Take special note of the kit serial and the kit password. The kit password can be regenerated if needed (the password will be shown only once, and if lost, a new password needs to be generated).
Step 10. Set up the connection details on the kit
Create a file named kit_config.toml
in the home directory (/home/pi
):
LCD not working? By default 0x27 is used as the I2C address. Most likely your LCD screen uses another address. There are two ways of finding the correct I2C address.
1) (recommended) Perform step 7 "ldci2c.py". By default this script uses the address 0x3f.
2) Use the RPi tool "i2cdetect" to find out the address. Detach the light and air/humidity sensor to make sure you find only the LCD address.
Add the following to the kit_config.toml in case you know you have an address other than 0x27.
Step 11. Run the kit
Run the kit, ensuring you are in the directory where you created kit_config.toml
(or specify a path to the configuration file as argument).
To run the kit without an SSH connection, you can set up a system task to launch it on boot, or e.g. launch it in the program screen
. Make sure pigpiod is activated.
Any issues? Please look at the FAQ or contact us
Last updated