Project "VanAssistant" - Setting up your RPI
By Rob Litjens
Lets make a first start of the VanAssistant today.
What are going to do? We are going to prepare a Raspberry Pi (4 or 5) to become a VanAssistant server. I call it VanAssistant now because we will adapt some settings on the hardware to make sure that we can control a lot of stuff in our CamperVan/Mobile home or RV or whatever we call them. This setup will also work in various other situations where your Home Assistant must run independent of where it is.
The VanAssistant will have, together with some additional hardware be able to:
- Know how much gas you have in your campervan
- The volume of water (Grey, Waist water or drinking water)
- Tyre pressure
- Router integration (for various reasons very handy)
- Heating
- Open Doors
- Battery
- Solar
But before we can automate stuff, we need to first know the statusses. So we need to measure the status before we can change the status.
So lets prepare the Raspberry Pi first.
Filling the Case
I bought this case to house the RPI4 with an NVME SSD. It is a litle a puzzle to get the boards in, but it works. I would suggest to first mount the cooling device and see how it fits. After that I add the cooling pasta sticker, mount the cooler to the bord by turning in the copper pilars through the PCB (Printed Circuit Board aka MotherBoard). After that I insert the NVME in the PCB and fix it. This screw is on the hat board. In the HAT there are again four holes. The other copper pilars fit in and mount to the RPI perfectly. That also connects three pilars on the board to the RPI. At this moment I would suggest to stop assembling the case.
Installing Raspbian
My first attempt was done using just a Raspberry Pi and an added SSD in an enclosure like on this picture.
I started the RPI with the Shift key pressed. This worked for a bit, it downloaded the Raspberry Pi installer, but it did not start up. No reason why this did not work.
I then added an MicroSD card to the system and started again pressing the shift key. It downloaded the installed, and it started! I could choose Raspbian 64 and installation to the SSD (M2. 2280 of 256GB in this case). Downloading went smooth and it seems that the installer started Raspian. I thought: time to remove the MicroSD card….. Wrong.. This meant that i Restarted the whole process again.
So.. Here is the most easy workorder for prepping your RPI to become a VanAssistant server:
- Install Raspberry Pi Imager on your computer (See Raspberry Pi OS – Raspberry Pi and press to download the versions you need for your computer)
- Attach a MicroSD card to your computer (using a cardreader and an adapter in most cases)
- Start the Raspberry Pi Imager a. Choose your Raspberry Pi version when you click on Choose Device b. Under OS choose Raspbian OS (!) c. Choose the MicroSD as a storage Device and press next
So.. Now you have a MicroSD card with Raspbian OS. But why do we need it?
Using Raspbian
For the Fan and some other cases I need to have the GPIO pens activated. That is the reason that i use this method. Well, to make sure your RPI can boot from an SSD or NVME or USB drive, it needs to have the latest boot loader. That is what we are going to do.
So follow the steps to get your RPI updated
- Make sure a keyboard and a monitor are connected to your
- Put the MicroSD card in your RPI and connect the power cable
- Put the settings for Keyboard, language and so in and let the RPI restart
- When the RPI is restarted, on the left top you will see a terminal icon. Press on it
- In the Terminal Window we need to type the following commands: a. Enable UART for Linbus ○ Sudo raspi-config - Interface options - I6 serial Port Configuration - No to the login shell - Serial hardware enabled b. Update the Firmware of the RPI ○ Sudo rpi-update ○ Sudo rpi-eepom-update -d -a
- Reboot the RPI
- The GeekPi manual has instructions on how to enable the Fan. Please follow these as well. Other brands will have similar instructions tbh.
Now the RPI is configured for most of the communications we do know at this moment
If you are done so far it is time to validate if the SSD is working. I would suggest now to put the double hooked USB connector in and wait. You could see a window about the file manager. But, with the terminal still open i would suggest to type
lsblk
This will show you that there is an sda device, also known as your SSD device.
Install HomeAssistant
So.. Now it is time to get Home Assistant installed. Remove the MicroSD card, reboot the RPI and keep the shift key pressed until you see the Boot manager. Select the Raspberry Pi4, I choosed to take the normal Home Assistant install and the SSD as the storage. I do not touch the USB drive. This installs in less than 3 minutes (!)
After this I have powered off the RPI and assembled the rest of the case. I also removed the MicroSD card and restarted. It works! Time to think about setting up my Teltonika RUTX50. The next blog…
Additional information and used products
Glosary
Shortcode | Meaning | Used for |
---|---|---|
PCB | Printed Circuit Bord | any (normal) green bord containing electronics that work together (Motherboard) |
RPI | Raspberry Pi | Small Computer |
SSD | Solid State Drive | Storage devices |
NVME | Non-Volatile Memory Express | Communication between RPI and the SSD is using this ‘Bus’ |
M2 | Interface type of SSD | Size of the SSD. The length of the SSD is behind the dot so an M2.2280 has a length of 80mm and 20 width |
Products used (no affiliate links!, just an idea of the products):
- RaspberryPi 4 from stock
- PowerSupply USB-C 5v-5a
- Spare MicroSD card (from stock )
- MicroHDMI to HDMI adapter
- GeeekPi Raspberry Pi 4 Aluminium NAS Case met ICE Tower Cooler en M.2 SATA SSD Adapter Board
More information:
- How to assemble the GeekPI case
- [Difference SATA and NVME Dutch] (https://www.a4tech.nl/verschil-tussen-sata-en-nvme/)