Инструменты пользователя

Инструменты сайта


конфигурирование

Различия

Показаны различия между двумя версиями страницы.

Ссылка на это сравнение

Предыдущая версия справа и слева Предыдущая версия
Следующая версия Следующая версия справа и слева
конфигурирование [2021/09/25 04:07]
176.31.125.95 старая версия восстановлена (2021/05/06 22:26)
конфигурирование [2021/10/03 12:27]
192.168.88.1 старая версия восстановлена (2021/09/04 10:52)
Строка 1: Строка 1:
-Boot sequence:+==== Boot sequence: ====
  
-* Trying to load JSON config from NVRAM. If config is valid JSON structure - start to operating (to avoid dependance from network and allow local control) +  * Trying to load JSON config from NVRAM. If config is valid JSON structure - start to operating (to avoid dependance from network and allow local control) 
-* Trying to retrieve MAC address, stored in NVRAM. If ok - using retrieved MAC. If not - using CUSTOM_FIRMWARE_MAC (see compilers directives). If not configured - using hardcoded DEFAULT_FIRMWARE_MAC = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0} +  * Trying to retrieve MAC address, stored in NVRAM. If ok - using retrieved MAC. If not - using CUSTOM_FIRMWARE_MAC (see compilers directives). If not configured - using hardcoded DEFAULT_FIRMWARE_MAC = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0} 
-* Starting LAN with DHCP or with static ip if configured +  * Starting LAN with DHCP or with static ip if configured 
-* Trying to load JSON config from  address "http://MY_CONFIG_SERVER/12-12-12-12-12-12.config.json", where "12-12....12" is controller's MAC address and MY_CONFIG_SERVER - compiler's directive. If not configured = lazyhome.ru used +  * Trying to load JSON config from  address "http://MY_CONFIG_SERVER/12-12-12-12-12-12.config.json", where "12-12....12" is controller's MAC address and MY_CONFIG_SERVER - compiler's directive. If not configured = lazyhome.ru used 
-* After parsing of loaded config, performing re-initialization of objects, except number of DMX channels. There is possible to store loaded config in NVRAM after some testing using "save" cli command. +  * After parsing of loaded config, performing re-initialization of objects, except number of DMX channels. There is possible to store loaded config in NVRAM after some testing using "save" cli command. 
-* Connecting to MQTT server according stored or retrieved config. +  * Connecting to MQTT server according stored or retrieved config. 
-* Subscribing to OUTTOPIC (/myhome/s_out/# by default) for 5 sec. Retrieving and executing all persistent topic (restore recent values) +  * Subscribing to OUTTOPIC (/myhome/s_out/# by default) for 5 sec. Retrieving and executing all persistent topic (restore recent values) 
-* Unsubscribe from OUTTOPIC, Subscribe for INTOPIC (/myhome/in/# by default) and start processing normal incoming event flow+  * Unsubscribe from OUTTOPIC, Subscribe for INTOPIC (/myhome/in/# by default) and start processing normal incoming event flow
  
-Operation+==== Operation ====
 During normal operation, controller: During normal operation, controller:
  
-* Accepting incoming MQTT message flow and retrieving item name from topic name. For example, /myhome/in/item1 will control "item1" +  * Accepting incoming MQTT message flow and retrieving item name from topic name. For example, /myhome/in/item1 will control "item1" 
-* Controlling items. +  * Controlling items. 
-* Most commands, accepted on INTOPIC passed throw to OUTTOPIC after interpretation. Interpretation is converting of high level commands like ON OFF HALT REST to low-level commands with real values. OUTTOPIC publishing uses "persistent" flag to allow retrieving recent status from MQTT broker after restart of controller +  * Most commands, accepted on INTOPIC passed throw to OUTTOPIC after interpretation. Interpretation is converting of high level commands like ON OFF HALT REST to low-level commands with real values. OUTTOPIC publishing uses "persistent" flag to allow retrieving recent status from MQTT broker after restart of controller 
-* Polling: Normally, Modbus devices and 1-wire thermometers are polled with reasonable interval. Retrieved values are publishing to OUTTOPIC+  * Polling: Normally, Modbus devices and 1-wire thermometers are polled with reasonable interval. Retrieved values are publishing to OUTTOPIC
  
-Useful CLI commands:+==== Useful CLI commands: ====
  
-* mac 11:22:33:44:55:66  - writing custom MAC address to NVRAM +  * mac 11:22:33:44:55:66  - writing custom MAC address to NVRAM 
-* save - writing currently loaded config from RAM to NVRAM +  * save - writing currently loaded config from RAM to NVRAM 
-* get <servername> - retrieve config from server and store servername to NVRAM (default servername: lazyhome.ru) +  * get <servername> - retrieve config from server and store servername to NVRAM (default servername: lazyhome.ru) 
-* ip [ip[ dns[ gw[ subnet]]]] - configure and save to NVRAM static ip. if no parameters - DHCP will be used +  * ip [ip[ dns[ gw[ subnet]]]] - configure and save to NVRAM static ip. if no parameters - DHCP will be used 
-* load - load config from NVRAM +  * load - load config from NVRAM 
-* kill - test watchdog timer (normally, causes reboot)+  * kill - test watchdog timer (normally, causes reboot)
  
 CLI commands must be send via serial port with 115200 baud rate / 8N1 params: 8 data bits, no parity bit, 1 stop bit. CLI commands must be send via serial port with 115200 baud rate / 8N1 params: 8 data bits, no parity bit, 1 stop bit.
  
 Example via shell: Example via shell:
-```+<code>
 > stty -f /dev/cu.usbmodem146101 ispeed 115200 ospeed 115200 -parenb cs8 cstopb > stty -f /dev/cu.usbmodem146101 ispeed 115200 ospeed 115200 -parenb cs8 cstopb
 > echo "ip" > /dev/cu.usbmodem146101 > echo "ip" > /dev/cu.usbmodem146101
 > cat /dev/cu.usbmodem146101 > cat /dev/cu.usbmodem146101
-```+</code>
  
 Same can be done via GUI e.g. from Arduino IDE (serial monitor). Serial port must be configured (MacOSX config file ~/Library/Arduino15/preferences.txt) Same can be done via GUI e.g. from Arduino IDE (serial monitor). Serial port must be configured (MacOSX config file ~/Library/Arduino15/preferences.txt)
-```+<code>
 serial.databits=8 serial.databits=8
 serial.stopbits=1 serial.stopbits=1
Строка 43: Строка 43:
 serial.debug_rate=115200 serial.debug_rate=115200
 serial.line_ending=1 serial.line_ending=1
-```+</code>
  
 The example of config files you can find in config folder The example of config files you can find in config folder
Строка 49: Строка 49:
 Below is brief explanation of basic configuration values: Below is brief explanation of basic configuration values:
  
-```+<code>
 { {
   "mqtt":["mqtt_id","host",port,"user","pass"], //ip address/name and client id of mqtt broker. Port, user, pass - are optional    "mqtt":["mqtt_id","host",port,"user","pass"], //ip address/name and client id of mqtt broker. Port, user, pass - are optional 
Строка 59: Строка 59:
         },         },
  
-``` +</code>
 // Every Lighthub's object are "item": lamp, dimmer, termostat, relay, led etc // Every Lighthub's object are "item": lamp, dimmer, termostat, relay, led etc
 // item is accessible via mqtt bus as /myhome/in/itemname // item is accessible via mqtt bus as /myhome/in/itemname
  
-```+<code>
 #define I_TYPE 0 //Type of item #define I_TYPE 0 //Type of item
 #define I_ARG  1 //Chanel-type depended argument or array of arguments (pin, address etc) #define I_ARG  1 //Chanel-type depended argument or array of arguments (pin, address etc)
Строка 70: Строка 69:
 #define I_CMD  3 //Latest CMD received #define I_CMD  3 //Latest CMD received
 #define I_EXT  4 //Chanell-depended extension - array #define I_EXT  4 //Chanell-depended extension - array
-```+</code>
 There are two mandatory elements in item's array: type and address There are two mandatory elements in item's array: type and address
 1-st element of array is item type 1-st element of array is item type
Строка 76: Строка 75:
 # Item types: # Item types:
 ^# of type ^ ID ^ Note ^ Parameters ^ ^# of type ^ ID ^ Note ^ Parameters ^
-|0| CH_DIMMER|DMX out 1 ch|| +|0| DIMMER|DMX out 1 ch|| 
-|1| CH_RGBW  |DMX out 4 ch|| +|1| RGBW  |DMX out 4 ch|| 
-|2| CH_RGB   |DMX out 3 ch|| +|2| RGB   |DMX out 3 ch|| 
-|3| CH_PWM   |PWM output directly to PIN|| +|3| PWM   |PWM output directly to PIN|| 
-|4| CH_MODBUS|Modbus AC Dimmer|| +|4| MODBUS|Modbus AC Dimmer|| 
-|5| CH_THERMO|Simple ON/OFF thermostat|| +|5| THERMO|Simple ON/OFF thermostat|| 
-|6| CH_RELAY |ON_OFF relay output|| +|6| RELAY |ON_OFF relay output|| 
-|7| CH_GROUP |Group pseudochannel|| +|7| GROUP |Group pseudochannel|| 
-|8| CH_VCTEMP|Vacom PID thermo - regulator (Ventilation set)|| +|8| VCTEMP|Vacom PID thermo - regulator (Ventilation set)|| 
-|9| CH_VC    |Vacom modbus motor regulator|| +|9| VC    |Vacom modbus motor regulator|| 
-|10| CH_AC 10|Air Conditioner Haier|| +|10|AC 10|Air Conditioner Haier|| 
-|11| CH_SPILED | SPI LED|| +|11|SPILED | SPI LED|| 
-|12| CH_MOTOR |Motorized air gateway|| +|12|MOTOR |Motorized air gateway|| 
-|13| CH_PID   |PID regulator|| +|13|PID   |PID regulator|| 
-|14| CH_MBUS  |Universal Modbus channel|| +|14|MBUS  |Universal Modbus channel|| 
-|18| CH_MULTIVENT |Multiroom ventilation set||+|18|MULTIVENT |Multiroom ventilation set||
  
  
Строка 97: Строка 96:
 Address is channel depended. Pin# for relay, DMX address for DMX-512 channel, array for Modbus channel Address is channel depended. Pin# for relay, DMX address for DMX-512 channel, array for Modbus channel
  
-``` +<code>  
- "items":{+"items":{
 // Example of array // Example of array
         "all":[7,["h_entr","h_bath1","h_bath2","h_balk1","h_balk2","h_boil1","h_boil2","h_polotenc","spots_en"]]         "all":[7,["h_entr","h_bath1","h_bath2","h_balk1","h_balk2","h_boil1","h_boil2","h_polotenc","spots_en"]]
Строка 116: Строка 115:
         "water":[6,36,1,1]         "water":[6,36,1,1]
          },          },
-```+</code>
  
-Inputs configuration chapter+===== Inputs configuration chapter =====
  
-```+<code>
 // "in" syntax // "in" syntax
 // "pin": { "T":type, "emit":"out_emit", item:"out_item", "scmd": "ON,OFF,TOGGLE,INCREASE,DECREASE", "rcmd": "ON,OFF,TO$ // "pin": { "T":type, "emit":"out_emit", item:"out_item", "scmd": "ON,OFF,TOGGLE,INCREASE,DECREASE", "rcmd": "ON,OFF,TO$
Строка 154: Строка 153:
          }          }
 } }
-```+</code>
  
-Modbus channel+==== Modbus channel ====
  
 Currently, Lighthub working with Vacom 10 frequency driver (from Danfos) via Modbus RTU and allows control frequency (item type = 9)  and  internal PID controller  (item type = 8 - used for Temperature control) Currently, Lighthub working with Vacom 10 frequency driver (from Danfos) via Modbus RTU and allows control frequency (item type = 9)  and  internal PID controller  (item type = 8 - used for Temperature control)
Строка 164: Строка 163:
  
 Config example (refer https://github.com/anklimov/lighthub/wiki/Configuring):    Config example (refer https://github.com/anklimov/lighthub/wiki/Configuring):   
-```+<code>
 { {
   "items": {   "items": {
Строка 171: Строка 170:
   "mqtt":["lighthub-07","m2m.eclipse.org"]   "mqtt":["lighthub-07","m2m.eclipse.org"]
   }   }
-```+</code>
  
 Note: this config example available at URL http://lazyhome.ru/de-ad-be-ef-fe-07.config.json - so just set mac address of device by command “mac de:ad:be:ef:fe:07” for test. Note: this config example available at URL http://lazyhome.ru/de-ad-be-ef-fe-07.config.json - so just set mac address of device by command “mac de:ad:be:ef:fe:07” for test.
Строка 177: Строка 176:
  
 Item notation:  Item notation: 
-* 4 - Modbus dimmer item type +  * 4 - Modbus dimmer item type 
- +  * Param1: = 96 - Decimal address of modbus device 
-* Param1: = 96 - Decimal address of modbus device +  * Param2: = 0 - Modbus register to write (and read while polling) 
-* Param2: = 0 - Modbus register to write (and read while polling) +  * Param3: = 0 - mask (optional. Default value “-1”  - see below for explanations) 
-* Param3: = 0 - mask (optional. Default value “-1”  - see below for explanations) +  * Param4:= 255 - Maximum Value for scaling MQTT input value = 100  to register value  (Optional. Default MaxValue 0x3f. It is equivalent of “100" on input.  If value == 0 - no scaling)
-* Param4:= 255 - Maximum Value for scaling MQTT input value = 100  to register value  (Optional. Default MaxValue 0x3f. It is equivalent of “100" on input.  If value == 0 - no scaling)+
  
 Mask: Mask:
конфигурирование.txt · Последнее изменение: 2023/10/22 01:27 — Admin