Projekt IoT: Difference between revisions

From JoBaPedia
Jump to navigation Jump to search
Line 83: Line 83:
* For each tasmota device function (switch, temp/hum, ...) click on "virtual sensor" (on hardware page at dummy device entry)
* For each tasmota device function (switch, temp/hum, ...) click on "virtual sensor" (on hardware page at dummy device entry)
* On setup/devices page look at idx values for the virtual sensor devices and configure tasmota device with them.
* On setup/devices page look at idx values for the virtual sensor devices and configure tasmota device with them.
=== Cura Build ===
==== Prerequisites ====
git clone https://github.com/Ultimaker/Cura.git
git clone https://github.com/Ultimaker/cura-build
Follow instructions for CentOS in cura-build/README.md andf adapt for opensuse 42.3
sudo zypper in gcc-fortran python3 python3-pyserial python3-numpy python3-opengl python3-setuptools libstdc++-devel openssl openblas-devel gtk3-devel webkit2gtk3-devel gstreamer-devel python-wxWidgets-3_0 python-wxWidgets-3_0-devel
# pip3 install F2PY
F2PY not found -> build may fail
==== Installation ====
cmake fails because it needs python 3.5 while opensuse 42.2 only has 3.4 - end of story for now :(
Use app container for now (but how to use core functions directly?)

Revision as of 16:40, 10 April 2018

IoT - Internet of Things

some project ideas and notes regarding Arduino, ESP8266, ESP32 and other micro controllers

  • Arduino Nano with 433 MHz data transfer
  • ESP-01 for shutter control
  • ESP-12 for LED switch
  • ESP-12 for laundry room air control
  • SonOff with own firmware and tasmota devices
 https://github.com/arendst/Sonoff-Tasmota/wiki

Arduino IDE Inofficial Boards

look here for an overview:

ATTiny

Most ATTinys: https://github.com/SpenceKonde/ATTinyCore

Wiring

https://startingelectronics.org/tutorials/AVR-8-microcontrollers/ATtiny2313-tutorial/P8-TC0-polled-timer/ATTINY2313-TC0-polled.png

  • Vcc can also be 3.3V
  • C1 can have bigger capacity for unstable voltage
  • R1 can be higher values

Programmer

I have an USBasp. Program with avrdude. Works integrated in Arduino IDE. Ignore warning "avrdude: warning: cannot set sck period. please check for usbasp firmware update.".

Numbering of Connector is

1 3 5 7 9
2 4 6 8 10

Need to connect Vcc, Gnd, Miso(1), Mosi, Reset and Sck

New chip needed 0.5MHz for correct timing with delay()

Needed to add this udev rule

echo 'SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="05dc", GROUP="dialout", MODE="0660"' | sudo sh -c 'cat >/etc/udev/rules.d/50-USBasp.rules'

ESP8266

https://github.com/esp8266/Arduino

Domoticz

This is a home automation system that is natively supported by tasmota devices via mqtt

Installation

sudo /usr/sbin/useradd -U -g domoticz -m -r domoticz
  • Edit section Service in /usr/lib/systemd/system/domoticz.service (ports, logging, db)
[Service]
ExecStart=/opt/domoticz/domoticz -notimestamps -syslog -www 8888 -sslwww 4343 -dbase domoticz.db
WorkingDirectory=/home/domoticz
User=domoticz
Group=domoticz
Restart=always
  • Activate new service file, start domoticz and check status
sudo systemctl daemon-reload
sudo systemctl enable domoticz
sudo systemctl start domoticz
sudo systemctl status domoticz

Configuration

https://github.com/arendst/Sonoff-Tasmota/wiki/Domoticz

  • On setup/hardware page create mqtt connection (host job4, port 1883, option flat/out) and one Dummy device for virtual switches
  • For each tasmota device function (switch, temp/hum, ...) click on "virtual sensor" (on hardware page at dummy device entry)
  • On setup/devices page look at idx values for the virtual sensor devices and configure tasmota device with them.

Cura Build

Prerequisites

git clone https://github.com/Ultimaker/Cura.git
git clone https://github.com/Ultimaker/cura-build

Follow instructions for CentOS in cura-build/README.md andf adapt for opensuse 42.3

sudo zypper in gcc-fortran python3 python3-pyserial python3-numpy python3-opengl python3-setuptools libstdc++-devel openssl openblas-devel gtk3-devel webkit2gtk3-devel gstreamer-devel python-wxWidgets-3_0 python-wxWidgets-3_0-devel
# pip3 install F2PY

F2PY not found -> build may fail

Installation

cmake fails because it needs python 3.5 while opensuse 42.2 only has 3.4 - end of story for now :(

Use app container for now (but how to use core functions directly?)