Skip to content

nlamirault/jarvis

Repository files navigation

Jarvis

License Apache 2 GitHub version

  • Master : Circle CI
  • Develop: Circle CI

Features :

  • Extract the energy consumption information from an EDF meter (ERDF Teleinfo)
  • Analyze the indoor / outdoor temperature (DHT22)
  • Measure air quality (MQ135)

Tools :

Requirements:

Architecture

Intallation

Raspberry PI

Install HypriotOS onto the SDCard:

$ sdcard/jarvis_os_2.sh jarvis myssid mywifipassword Linux

See ansible/README.md to setup the cluster using Ansible.

Install the dashboard :

$ kubectl apply -f k8s/dashboard --record
$ kubectl describe services kubernetes-dashboard --namespace=kube-system

After a few minutes, check the installation:

$ kubectl cluster-info
Kubernetes master is running at https://192.168.1.36:6443
Heapster is running at https://192.168.1.36:6443/api/v1/namespaces/kube-system/services/heapster/proxy
KubeDNS is running at https://192.168.1.36:6443/api/v1/namespaces/kube-system/services/kube-dns/proxy

$ kubectl get nodes
NAME            STATUS    ROLES     AGE       VERSION
jarvis-master   Ready     master    3h        v1.8.5
jarvis-node1    Ready     <none>    3h        v1.8.5
jarvis-node2    Ready     <none>    3h        v1.8.5

Install heapster :

$ kubectl apply -f k8s/heapster --record

Then, you've got metrics :

$ kubectl top  node
NAME            CPU(cores)   CPU%      MEMORY(bytes)   MEMORY%
jarvis-master   751m         18%       621Mi           81%
jarvis-node2    142m         3%        388Mi           50%
jarvis-node1    196m         4%        388Mi           50%

Install the Ingress default backend:

$ kubectl apply  -f ingress/ingress-controller-rbac.yaml --record
$ kubectl apply  -f ingress/ingress-default-backend.yaml --record
$ kubectl apply  -f ingress/nginx/ --record

Before to add a new node, generate a new machineid, see : hypriot/image-builder-rpi#167

Then add a new node :

$ sudo kubeadm join --token ${TOKEN} ${MASTER_IP}:6443

Cloud

You could use Packer to create cloud image with Kubernetes installed. See :

Provider Support Version
GCE [x] 1.6.5
EC2 [x] 1.6.5
DigitalOcean [x] 1.6.5
Azure [ ]

You could use Terraform to deploy some nodes.

Arduino

  • For arduino projects, we use PlatformIO, initialize it:

      $ make arduino-init
    
  • For project (here dht) setup arduino devices client configurations:

      $ cp arduino/dht/src/config.sample.h arduino/dht/src/config.h
      # edit config.h to customize your requirements
    
  • Build project (for example dht):

      $ make arduino-build project=arduino/dht
    
  • Connect an Arduino, then upload it :

      $ make arduino-upload project=arduino/dht
    

Synology

Configure the SNMP on the Synology NAS. Go to the Control Panel, choose Terminal & SNMP and make the configuration on the SNMP tab (Choose SNMP v1).

Development

See DEV

Contributing

See CONTRIBUTING.

License

See LICENSE for the complete license.

Changelog

A changelog is available

Contact

Nicolas Lamirault nicolas.lamirault@gmail.com