Giter Club home page Giter Club logo

anklimov / lighthub Goto Github PK

View Code? Open in Web Editor NEW
93.0 9.0 22.0 113.04 MB

Flexible, Arduino Mega/Due/ESP8266/ESP32/STM32 based SmartHome controller with DMX-512 in/out, 1-Wire, Modbus, MQTT interfaces. OpenHab/HomeAssistant/ioBroker compatible.

Home Page: https://lazyhome.ru

License: Apache License 2.0

C++ 90.79% C 5.26% Shell 1.31% Batchfile 2.07% Python 0.21% VBScript 0.05% HTML 0.26% NASL 0.05%
openhab modbus smarthome-controller iot 1-wire arduino dmx512 heating-control mqtt mqtt-client

lighthub's People

Contributors

anklimov avatar livello avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lighthub's Issues

develop - compilation error

UnicodeDecodeError: 'ascii' codec can't decode byte 0xad in position 7: ordinal not in range(12
8):
File "C:\Users\aklimov.platformio\penv\lib\site-packages\platformio\builder\main.py", line 169
:
env.SConscript("$BUILD_SCRIPT")
File "C:\Users\aklimov.platformio\packages\tool-scons\script..\engine\SCons\Script\SConscript

.py", line 541:
return _SConscript(self.fs, *files, **subst_kw)
File "C:\Users\aklimov.platformio\packages\tool-scons\script..\engine\SCons\Script\SConscript
.py", line 250:
exec file in call_stack[-1].globals
File "C:\Users\aklimov.platformio\platforms\atmelsam\builder\main.py", line 162:
target_elf = env.BuildProgram()
File "C:\Users\aklimov.platformio\packages\tool-scons\script..\engine\SCons\Environment.py",
line 224:
return self.method(*nargs, **kwargs)
File "C:\Users\aklimov.platformio\penv\lib\site-packages\platformio\builder\tools\platformio.p
y", line 104:
env.ProcessFlags(env.get("BUILD_FLAGS"))

Template for custom device

I want to have
"custom_device_type":{
"custom_device_name1":[param1,param2,param3],
"custom_device_name2":[param1,param2,param3]
}
In config file (DHT11,DHT22, BMP280, Analog sensors, Encoders). It will be much better to have well designed template to make support of new devices.
Associated build flag, config parsing, device initialization, send values using mqtt.

Strange behavior on restart if lan is not initialized

See log below. Controller stoped sending mqtt topics with temperatures, so i reboot him by connecting to com-port. But it couldn't init his LAN with DHCP, so it loaded it's config from EEPROM and old temperature somewhere. So it ignored real temperature and worked with old one.

login as: livello
[email protected]'s password:


/ _ \ _ __ __ _ _ __ __ _ ___ | _ () | _ \ / | _
| | | | '
/ | '_ \ / _ |/ _ \ | |) | | | |
) | | | |
| |
| | | | (| | | | | (| | / | /| | | /| | | _|
_
/|| _,|| ||_, |_| || || || _| ||
|
__/

Welcome to ARMBIAN 5.38 stable Ubuntu 16.04.3 LTS 3.4.113-sun8i
System load: 0.19 0.06 0.06 Up time: 2:48 hours
Memory usage: 16 % of 1000MB IP: 192.168.10.115
CPU temp: 20°C
Usage of /: 38% of 7.1G

[ 0 security updates available, 78 updates total: apt upgrade ]
Last check: 2018-05-31 17:17

Last login: Thu May 31 21:16:52 2018 from 10.8.0.30

livello@orangepipcplus:$ ping 192.168.10.113^C
livello@orangepipcplus:
$ pio device monitor -b 115200
--- Miniterm on /dev/ttyACM0 115200,8,N,1 ---
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
h_relay6 Set

free:3414 h_relay6 Set:23 Curtemp:26 cmd:0 OFF

free:3414
Lazyhome.ru LightHub controller 372fa0e
(-)WATCHDOG
Config server:192.168.10.115
Firmware MAC Address C4:3E:11:03:1B:1E
(+)FreeRam printing
(+)DS2482-100
(+)DMX
(+)MODBUS
(+)OWIRE
Invalid MAC: set firmware's MAC
Configured MAC:C4:3E:11:3:1B:1E:
loading Config

Loaded
DS2482_100_I2C_TO_1W_BRIDGE init
DS2482-100 present
Checking for 1-Wire devices...
Reset done
V11101010 comp_id!
dev#0 Addr:28FFADCE601705A3
dev#1 Addr:286164123FF96F55
dev#2 Addr:28FFEF6D60170335
Configured:
items on
inputs on
modbus off
mqtt on
1-wire on
Starting lan
Failed to configure Ethernet using DHCP
h_relay6 Set:23 Curtemp:26 cmd:0 OFF

free:3414 h_relay6 Set:23 Curtemp:26 cmd:0 OFF

free:3414 h_relay6 Set:23 Curtemp:26 cmd:0 OFF

free:3414
--- exit ---
livello@orangepipcplus:~$ pio device monitor -b 115200
--- Miniterm on /dev/ttyACM0 115200,8,N,1 ---
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
h_relay6 Set:23 Curtemp:26 cmd:0 OFF

free:3414
Lazyhome.ru LightHub controller 372fa0e
(-)WATCHDOG
Config server:192.168.10.115
Firmware MAC Address C4:3E:11:03:1B:1E
(+)FreeRam printing
(+)DS2482-100
(+)DMX
(+)MODBUS
(+)OWIRE
Invalid MAC: set firmware's MAC
Configured MAC:C4:3E:11:3:1B:1E:
loading Config

Loaded
DS2482_100_I2C_TO_1W_BRIDGE init
DS2482-100 present
Checking for 1-Wire devices...
Reset done
VVVdev#0 Addr:28FFADCE601705A3
dev#1 Addr:286164123FF96F55
dev#2 Addr:28FFEF6D60170335
Configured:
items on
inputs on
modbus off
mqtt on
1-wire on
Starting lan
My IP address: 192.168.10.111.
h_relay6 Set:23 Curtemp:26 cmd:0 OFF

free:3414 Config URI: http://192.168.10.115/c4-3e-11-03-1b-1e.config.json
got Config
dev#0 Addr:28FFADCE601705A3
dev#1 Addr:286164123FF96F55
dev#2 Addr:28FFEF6D60170335
Configured:
items on
inputs on
modbus off
mqtt on
1-wire on
t_soil1=85
In: 40/0
In: 41/0
In: 42/0
In: 43/0
In: 44/0
In: 45/0
In: 46/0
In: 47/0
Attempting MQTT connection to 192.168.10.115:1883 user:test ...connected as gard en
Awaiting for retained topics
t_soil2=85
3414 t_soil3=85
Accepting commands...
Searching
Node:286164123FF96F55 alive
Node:28FFADCE601705A3 alive
Node:28FFEF6D60170335 alive
1-wire count: 3
3414 3414 t_soil1=9
t_soil2=85
h_relay6 Set:25 Curtemp:9 cmd:0 ON

free:3414 t_soil3=13
Searching
Node:286164123FF96F55 alive
Node:28FFADCE601705A3 alive
Node:28FFEF6D60170335 alive
1-wire count: 3
h_relay6 Set:25 Curtemp:9 cmd:0 ON

free:3414 h_relay6 Set:25 Curtemp:9 cmd:0 ON

free:3414 t_soil1=9
t_soil2=85
h_relay6 Set:25 Curtemp:9 cmd:0 ON

free:3414 t_soil3=13
Searching
Node:286164123FF96F55 alive
Node:28FFADCE601705A3 alive
Node:28FFEF6D60170335 alive
1-wire count: 3
h_relay6 Set:25 Curtemp:9 cmd:0 ON

free:3414 h_relay6 Set:25 Curtemp:9 cmd:0 ON

free:3414 t_soil1=9
t_soil2=85
h_relay6 Set:25 Curtemp:9 cmd:0 ON

free:3414 40=1
t_soil3=13
Searching
Node:286164123FF96F55 alive
Node:28FFADCE601705A3 alive
Node:28FFEF6D60170335 alive
1-wire count: 3
h_relay6 Set:25 Curtemp:9 cmd:0 ON

free:3414 h_relay6 Set:25 Curtemp:9 cmd:0 ON

free:3414 t_soil1=9
h_relay6 Set:25 Curtemp:9 cmd:0 ON

free:3414 t_soil2=85
t_soil3=85
h_relay6 Set:25 Curtemp:9 cmd:0 ON

free:3414 Searching
Node:286164123FF96F55 alive
Node:28FFADCE601705A3 alive
Node:28FFEF6D60170335 alive
1-wire count: 3
h_relay6 Set:25 Curtemp:9 cmd:0 ON

free:3414 t_soil1=9
h_relay6 Set:25 Curtemp:9 cmd:0 ON

free:3414 t_soil2=10
t_soil3=13
h_relay6 Set:25 Curtemp:9 cmd:0 ON

free:3414 Searching
Node:286164123FF96F55 alive
Node:28FFADCE601705A3 alive
Node:28FFEF6D60170335 alive
1-wire count: 3
h_relay6 Set:25 Curtemp:9 cmd:0 ON

free:3414 t_soil1=9
h_relay6 Set:25 Curtemp:9 cmd:0 ON

free:3414 t_soil2=10
t_soil3=13
h_relay6 Set:25 Curtemp:9 cmd:0 ON

free:3414 Searching
Node:286164123FF96F55 alive
Node:28FFADCE601705A3 alive
Node:28FFEF6D60170335 alive
1-wire count: 3
h_relay6 Set:25 Curtemp:9 cmd:0 ON

free:3414 t_soil1=9
h_relay6 Set:25 Curtemp:9 cmd:0 ON

free:3414 t_soil2=10
t_soil3=13
h_relay6 Set:25 Curtemp:9 cmd:0 ON

free:3414 Searching
Node:286164123FF96F55 alive
Node:28FFADCE601705A3 alive
Node:28FFEF6D60170335 alive
1-wire count: 3
h_relay6 Set:25 Curtemp:9 cmd:0 ON

free:3414 t_soil1=9
h_relay6 Set:25 Curtemp:9 cmd:0 ON

free:3414 t_soil2=10
t_soil3=13
h_relay6 Set:25 Curtemp:9 cmd:0 ON

free:3414 Searching
Node:286164123FF96F55 alive
11101010 comp_id!
1-wire count: 3
h_relay6 Set:25 Curtemp:9 cmd:0 ON

free:3414 h_relay6 Set:25 Curtemp:9 cmd:0 ON

free:3414 t_soil1=9
t_soil2=10
h_relay6 Set:25 Curtemp:9 cmd:0 ON

free:3414 t_soil3=13
Searching
Node:286164123FF96F55 alive
Node:28FFADCE601705A3 alive
Node:28FFEF6D60170335 alive
1-wire count: 3
h_relay6 Set:25 Curtemp:9 cmd:0 ON

free:3414 h_relay6 Set:25 Curtemp:9 cmd:0 ON

free:3414 t_soil1=9
t_soil2=10
h_relay6 Set:25 Curtemp:9 cmd:0 ON

free:3414 t_soil3=13

Global code refactoring, code reformat

Now we can use powerful IDE for working on project. Thanks to platformio. It is easy to format code, rename bad-named variables, functions,definitions, constants and make code much more readable and understandable without any additional comments that hard to remember.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.