fabaccess-docs/source/installation/install_steps_ubuntu.md
2021-12-11 18:35:43 +01:00

5.0 KiB

Install on Ubuntu for "Dummies"

This description is how to compile and set up Diflouroborane on Ubuntu 20.04.3 LTS clean install. Other releases or distros might work as well. The process is quite lengthy but at the end you will have a FabAccess running to you needs. ... as I said: for complete dummies, if someone finds a better solution, please post suggestions on: https://fabaccess.zulipchat.com/#narrow/stream/255963-General/topic/Demo

  1. Get your system up-to-date sudo apt-get update && sudo apt-get upgrade

  2. Get rustup sudo apt install curl curl --proto 'https' --tlsv1.2 -sSf https://sh.rustup.rs | sh restart the console

  3. Get capnproto, gsasl and git sudo apt-get install gsasl sudo apt-get install capnproto sudo apt install git

  4. Create a target directory for BFFH there might be better places compared to where I created it, but it works... mkdir BFFH cd BFFH

  5. Clone the Diflouroborane repository git clone https://gitlab.com/fabinfra/fabaccess/bffh

  6. For compiling some dependencies were missing on Ubuntu git submodule update —init sudo apt install libgsasl7-dev sudo apt install cmake sudo apt install libclang-dev sudo apt install libssl-dev

  7. Open the subdirectory and start compiling cd bffh cargo build --release if the compiler prompts somthing like "error: linker 'cc' not found": sudo apt install build-essential cargo build --release

  8. Copy the configuration files (best done with the GUI filemanager of Ubuntu) copy files from "bffh/examples" paste them into "bffh/target/release/examples"

  9. Install mosquitto MQTT broker Diflouroborane uses mosquitto MQTT broker to communicate with the Shellies. sudo apt-add-repository ppa:mosquitto-dev/mosquitto-ppa sudo apt-get update sudo apt-get install mosquitto sudo apt-get install mosquitto-clients sudo apt clean find out which linux release is installed (for Ubuntu -> google) uname -a sudo wget http://repo.mosquitto.org/debian/mosquitto-bullseye.list change "bullseye" according to your distro: bullseye, buster, stretch, jessie, ...

  10. Configuring mosquitto broker for some reason, starting with version 2.x mosquitto does not allow external communication via the broker per default. This needs to be changed via a config file:

  11. Stop mosquitto sudo service mosquitto stop

  12. Change into the "etc/mosquitto/" directory (lots of cd .. then cd etc, cd mosquitto)

  13. Create a configuration file: sudo touch file test.conf

  14. Edit the configuration fil: sudo nano -w test.conf add: listener 1883 allow_anonymous true Save (Strg-O) and close (Strg-X)

  15. Start mosquitto mosquitto -v -c /etc/mosquitto/test.conf

  16. Find the IP adress of your computer - new console ip a

  17. Configure your Shelly as long as your Shelly has not been given the credentials for a WLAN, it will create an access point (AP) for configuration. This AP will appear in your list of WLAN. Connect to this Shelly-AP and connect to 192.168.33.1 in your browser. A configuration page should appear. If your Shelly is already connected to your WLAN, you must find the assigned IP-Adress (e.g. by looking into your router). Enter this IP Adress in your browser and you will get the configuration page.

  18. MQTT Client setup goto "Internet & Security" -> "Advanced - Developer Settings" enable "MQTT" enter the IP-Adress from Step 16 in the field "IP-Adress" As we did not define MQTT credentials in mosquitto yet, no creadentials need to be filled in. To find the "ID" of your Shelly activate "Use custom MQTT prefix" (but do not change it!). This should be somthing like: shelly1-123456789ABC for a Shelly 1 shelly1pm-123456 for a Shelly 1PM note this ID for later - save - re-check the settings!

  19. WLAN Client setup goto "Internet & Security" -> "WIFI MODE - CLIENT" Set WLAN Credentials

  20. Configure Diflouroborane Open the file "bffh.dhall" in the GUI Editor (just by double-clicking it) Change Shelly_123 to your Shelly name, e.g. shelly1-123456789ABC (case sensitive!, dash sensitive!) in "Link up machines to actors" and in "actors". Change the third IP-adress under "listens" to the IP-adress of your computer. - save

  21. start Diflouroburane change to the directory in the console where you checked for the ip-address cd BFFH/bffh/target/release load settings to Diflouroborane: ./diflouroborane -c examples/bffh.dhall --load examples start Diflouroborane: ./diflouroborane -c examples/bffh.dhall

Important every time you change the bffh.dhal you need to reload the settings (otherwise the App will not connect to the server on restart): ./diflouroborane -c examples/bffh.dhall --load examples and restart start Diflouroborane: ./diflouroborane -c examples/bffh.dhall

Download the borepin APP as described previously

  • start the App
  • press: "Connect to new Server"
  • press: Enter the IP of your computer in the "Host"-Field
  • Enter your Username and Password.

To connect to the demo instance

  • start the App
  • press: "Connect to new Server"
  • press: "Demo Host Address"
  • User: "Testuser"
  • Passw: "secret"