Nabito.org project put on hold

To whomever this might concern,

The Nabito.org project has been put on hold. Low interest, technical difficulties and my time concerns are the main reason, why I’m putting it on hold. I might get back to it some time in the future, but very likely on a different technology stack.

The last documented version is here:
https://www.instructables.com/id/Nabito-Open-Socket-V2-Smart-Meter-for-EV-Charging/

The last WIP version had a different stack: Home Assistant, docker node.js plugin into HA, and Sonoff POW R2 as an IOT device.
This has been a very nice learning experience for me, I got exposed to many new cool IOT technologies and stacks (Arduino, ESP32, Home Assistant, AWS IOT cloud, Node.js, docker and building my own docker images, and many more), but I think now it’s time to sunset this project and move onto different topics. Send me an email if you would like to know anything about the project.

Have a nice day.
–Stefan

Move docker installation to a different /mount_point

Stop docker: systemctl docker stop.
Verify no docker process is running ps faux
Double check docker really isn’t running.

  1. Take a look at the current docker directory: ls /var/lib/docker/
  2. Make a backup – tar -zcC /var/lib docker > /mnt/pd0/var_lib_docker-backup-$(date +%s).tar.gz
  3. Move the /var/lib/docker directory to your new partition: mv /var/lib/docker /mnt/pd0/docker
  4. Make a symlink: ln -s /mnt/pd0/docker /var/lib/docker
  5. Take a peek at the directory structure to make sure it looks like it did before the mv: ls /var/lib/docker/ (note the trailing slash to resolve the symlink)
  6. Start docker back up: systemctl start docker
  7. restart your containers

Sequelize Sqlite3 cheat sheet

##Sequelize notes – ORM for Sqlite3, PostgreSql, MySQL and other

Install node packages:

npm install --save express body-parser sequelize sequelize-cli sqlite3 nodemon

Init dir structure:

node_modules/.bin/sequelize init

Create model and migration:

node_modules/.bin/sequelize model:generate --name Contact --attributes firstName:string,lastName:string,phone:string,email:string

Check the db:

$ sqlite3 database.sqlite3
SQLite version 3.20.1 2017-08-24 16:21:36
Enter ".help" for usage hints.
sqlite> .schema
CREATE TABLE `SequelizeMeta` (`name` VARCHAR(255) NOT NULL UNIQUE PRIMARY KEY);
CREATE TABLE `Contacts` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `firstName` VARCHAR(255), `lastName` VARCHAR(255), `phone` VARCHAR(255), `email` VARCHAR(255), `createdAt` DATETIME NOT NULL, `updatedAt` DATETIME NOT NULL);
CREATE TABLE sqlite_sequence(name,seq);

Seed the db:

node_modules/.bin/sequelize db:seed:all

PostgreSQL cheat sheet

Ubuntu install lastest Postgres:

sudo apt-get install postgresql postgresql-contrib

Create user with password, admin and echo:

createuser -P -s -e <user_name>`

Check connection under localhost:

psql -h localhost -U <user_name> --password --dbname=postgres

then input password

Docker install on Ubuntu

This is based on the official documentation found in:
https://docs.docker.com/install/linux/docker-ce/ubuntu/

Uninstall old versions of Docker

$ sudo apt-get remove docker docker-engine docker.io containerd runc

Setup the repository

$ sudo apt-get update

$ sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common

$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

$ sudo apt-key fingerprint 0EBFCD88

pub   rsa4096 2017-02-22 [SCEA]
      9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88
uid           [ unknown] Docker Release (CE deb) <docker@docker.com>
sub   rsa4096 2017-02-22 [S]

$ sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"

$ sudo apt-get update

$ sudo apt-get install docker-ce docker-ce-cli containerd.io

$ sudo docker run hello-world

Post-install steps: sudo

$ sudo groupadd docker
$ sudo usermod -aG docker $USER
$ docker run hello-world
$ sudo systemctl enable docker