Skip to content
Patrick Itten edited this page Jul 12, 2024 · 16 revisions

If you successfully installed VWsFriend on a special platform (e.g. a Raspberry or a Synology NAS) I would be happy if you share a documentation.

HomeKit only Install on Synology Docker (Native Synology UI, no docker-compose) no Grafana

  • Launch docker on your NAS, go to Registry. Search for vwsfriend and select the container
  • Choose Tag latest
  • Go to Image, select the container, click Launch
  • Rename the container name if you want, then click Advanced Settings
  • Advanced tab : Check Enable auto-restart
  • Network tab : Check Use the same network as Docker Host
  • Environment tab : Enter your We Connect user name in WECONNECT_USER, your password in WECONNECT_PASSWORD, and to activate HomeKit, enter --with-homekit in ADDITIONAL_PARAMETERS
  • Click Apply to close the advanced settings window
  • Click Next check the summary, then click Apply. The container should start.
  • Go to http://your_nas_ip:4000, you should be able to see your car data

If you want to use HomeKit, click on HomeKit tab, then scan the QR code from the Home App. You can see a tutorial video (in french) of the full install here : https://youtu.be/ZYS58LdQ9mQ

Synology Docker with Grafana and Postgres (native Synology UI, no docker-compose)

  1. Install Docker from Synology Package Center
  2. Open Docker and install three containers from the registry:
    • postgres:latest
    • tillsteinbach/vwsfriend:latest
    • tillsteinbach/vwsfriend-grafana:latest
  3. Prepare credentials
    • Create a DB-Password and insert at every occurrence of [DB-Password]
    • Create a Login User and Password and insert at every occurrence of [VWsFriend-User] and [VWsFriend-Password]
    • Prepare your WeConnect authentication data [WeConnect-Email] and [WeConnect-Password].
    • Note the IP of your Synology in the local network and insert at every occurrence of [Synology-IP]
  4. Go to 'image' and launch each container. Add following advanced settings to the defaults:
    • postgres
      • General Settings: Enable auto-restart
      • Network: bridge
      • Port Settings: Local Port: 5433 / Container Port: 5432 / Type TCP
      • Environment:
        • POSTGRES_DB: vwsfriend
        • POSTGRES_PASSWORD: [DB-Password]
    • vwsfriend
      • General Settings: Enable auto-restart
      • Network: Use the same network as Docker Host
      • Environment:
        • DB_PASSWORD: [DB-Password]
        • DB_USER: postgres
        • VWSFRIEND_USERNAME: [VWsFriend-User]
        • VWSFRIEND_PASSWORD: [VWsFriend-Password]
        • VWSFRIEND_PORT: 4000
        • WECONNECT_USER: [WeConnect-Email]
        • WECONNECT_PASSWORD: [WeConnect-Password]
        • WECONNECT_INTERVAL: 120
        • ADDITIONAL_PARAMETERS: --with-homekit --with-database
        • DATABASE_URL: postgresql://postgres:[DB-Password]@[Synology-IP]:5433/vwsfriend
    • vwsfriend-grafana
      • General Settings: Enable auto-restart
      • Network: Use the same network as Docker Host
      • Port Settings: Local Port: Auto / Container Port: 3000 / Type TCP
      • Environment:
        • GF_SECURITY_ADMIN_USER: [VWsFriend-User]
        • GF_SECURITY_ADMIN_PASSWORD: [VWsFriend-Password]
        • DB_USER: postgres
        • DB_PASSWORD: [DB-Password]
        • VWSFRIEND_USERNAME: [VWsFriend-User]
        • VWSFRIEND_PASSWORD: [VWsFriend-Password]
        • VWSFRIEND_HOSTNAME: localhost
        • VWSFRIEND_PORT: 4000
        • DB_HOSTNAME: [Synology-IP]
        • DB_PORT: 5433
        • DB_NAME: vwsfriend
  5. Start all containers.
  6. Visit http://[Synology-IP]:4000 and log in using [VWsFriend-User] and [VWsFriend-Password]

Install without Docker

Tested with openSuse TW

  • You need:

    • python 3.8
    • grafana (best > 8.0)
    • postgresql
  • Install VWsFriend:

    • pip install vwsfriend
    • you might use pip3 or pip3.8 if you have multiple python versions
  • Test VWsFriend

    • vwsfriend -vv -u user -p password
    • open browser on http://127.0.0.1:4000
  • Configure postgresql

    • Start postgresql: systemctl start postgresql.service
    • Login to postgresql as admin: sudo -u postgres psql
    • create user vwsfriend with encrypted password '<password>';
    • create database vwsfriend;
    • grant all privileges on database vwsfriend to vwsfriend;
    • exit
    • Modify /var/lib/pgsql/data/pg_hba.conf (this is only quick and dirty)
    • comment out all access rules
    • add:
local   vwfriends       vwfriends                               md5
host    all             all             127.0.0.1/32            md5
host    all             all             ::1/128                 md5
  • restart pregresql: systemctl restart postgresql.service
  • test access: psql -h localhost -U vwsfriend vwsfriend as user
  • start VWsFriend: vwsfriend --with-database --with-abrp -vv --database-url postgresql://vwsfriend:<password>@127.0.0.1/vwsfriend
  • check if vwsfriend can connect to the database and create the corresponding tables
  • Configure Grafana:
    • Install required plugins
    • wget zip file and unzip it in /var/lib/grafana/plugins
    • You need:
      • pr0ps-trackmap-panel
      • panodata-map-panel
      • natel-plotly-panel
    • check user rights: chgrp -R grafana *, chown -R grafana *
    • copy from this repo ./config/grafana/provisioning/ to /etc/grafana/provisioning/
    • copy from this repo ./dashboards/ to /var/lib/grafana/dashboards/
    • check user rights
    • modify /etc/grafana/provisioning/datasources/vwsfriend.yml the fields database, user, password, url
    • check paths in /etc/grafana/provisioning/dashboards/vwsfriend.yml (e.g., grafana-static -> grafana for some distributions)
    • start grafana with systemctl start grafana-server.service
    • open browser on http://127.0.0.1:3000
    • login with admin/admin
  • Limitations for Grafana 7.5.x

    • state-timeline is not working (introduced with Grafana 8.X)
    • picture of the car is not working
  • When you upgrade you have to:

    • pip install vwsfriend --upgrade
    • copy again ./dashboards/ to /var/lib/grafana/dashboards/
    • check if new plugins are necessary

Simple Raspberry Pi Setup for VWsFriend

Example Hardware Config

This is an example of a config that will provide ample performance and reasonable storage volume for long term statistics:

  • Raspberry Pi 4 Model B 8Gb
  • 32 Gb SDHC or SDXC card (Go SDXC for decent boot times and overall performance)

Install the Operating System

  • Download the Raspberry Pi Imager app from https://www.raspberrypi.com/software/
  • On the main Imager screen, under Operating System, choose Raspberry Pi OS (other) > Raspberry Pi OS Lite (64 bit). Alternatively, if you have a Pi 3, go for the 32 bit variant.
  • On the main Imager screen, click Storage and select your SD card
  • On the main Imager screen, click the settings/"gear" button (lower right) and enter your desired hostname and login username/password, wifi setup etc., then save.
  • On the main Imager screen, click Write, then confirm.

When writing is done, eject the SD card, insert it into your Raspberry Pi and boot the system.

Log in

If you are logging in from a device that is on the same network as the Raspberry Pi, you will most likely be able to use the following command to ssh into the Pi:

ssh [email protected]

... where username and hostname are the settings you entered in the Raspberry Pi Imager application. If hostname.local doesn't work in your environment, you will need to use some other technique to find the IP address assigned to the Raspberry Pi.

Update and Configure

First, make sure that you have a completely up to date OS installation:

sudo apt-get update && sudo apt-get upgrade

Note that the apt-get commands above may output error messages like perl: warning: Setting locale failed. These errors are not fatal, but they are annoying. Here is a simple way to get rid of them, but do be aware that if you will be using this machine for other purposes than running VWsFriend, you may want to investigate less intrusive solutions. Google is your friend.

sudo nano /etc/ssh/sshd_config

Find the line that reads AcceptEnv LANG LC_* and change it to AcceptEnv no

Save and close the file. Then restart the ssh system as follows:

sudo systemctl restart sshd

Finally, log out and then in again.

Install Docker and Docker-compose

Next, install Docker. The VWsFriend project tends to require very recent Docker tooling, so we will get the latest versions directly from docker.com:

Get and run the install scripts from docker.com:

curl -fsSL test.docker.com -o get-docker.sh && sh get-docker.sh

Add docker permissions to your user:

sudo usermod -aG docker ${USER}

Log out and then in again for the group membership to take effect.

Install docker-compose with dependencies:

sudo apt-get install libffi-dev libssl-dev
sudo apt install python3-dev
sudo apt-get install -y python3 python3-pip
sudo pip3 install docker-compose

Go on to Install VWsFriend

Your system should now be ready for installation of VWsFriend. Please head over to the How to start section for instructions.