Показаны различия между двумя версиями страницы.
Предыдущая версия справа и слева Предыдущая версия Следующая версия | Предыдущая версия Следующая версия Следующая версия справа и слева | ||
конфигурирование [2021/10/03 12:27] 192.168.88.1 старая версия восстановлена (2021/09/04 10:52) |
конфигурирование [2023/10/20 00:46] Admin |
||
---|---|---|---|
Строка 1: | Строка 1: | ||
- | ==== 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 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 | ||
- | * Trying to load JSON config from address " | ||
- | * 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 " | ||
- | * Connecting to MQTT server according stored or retrieved config. | ||
- | * Subscribing to OUTTOPIC (/ | ||
- | * Unsubscribe from OUTTOPIC, Subscribe for INTOPIC (/ | ||
- | |||
- | ==== Operation ==== | ||
- | During normal operation, controller: | ||
- | |||
- | * Accepting incoming MQTT message flow and retrieving item name from topic name. For example, / | ||
- | * 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 " | ||
- | * Polling: Normally, Modbus devices and 1-wire thermometers are polled with reasonable interval. Retrieved values are publishing to OUTTOPIC | ||
- | |||
- | ==== Useful CLI commands: ==== | ||
- | |||
- | * mac 11: | ||
- | * save - writing currently loaded config from RAM to NVRAM | ||
- | * get < | ||
- | * ip [ip[ dns[ gw[ subnet]]]] - configure and save to NVRAM static ip. if no parameters - DHCP will be used | ||
- | * load - load config from NVRAM | ||
- | * 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. | ||
- | |||
- | Example via shell: | ||
- | < | ||
- | > stty -f / | ||
- | > echo " | ||
- | > cat / | ||
- | </ | ||
- | |||
- | Same can be done via GUI e.g. from Arduino IDE (serial monitor). Serial port must be configured (MacOSX config file ~/ | ||
- | < | ||
- | serial.databits=8 | ||
- | serial.stopbits=1 | ||
- | serial.parity=N | ||
- | serial.debug_rate=115200 | ||
- | serial.line_ending=1 | ||
- | </ | ||
- | |||
The example of config files you can find in config folder | The example of config files you can find in config folder | ||
Note: in real configs comments are not allowed | Note: in real configs comments are not allowed | ||
Строка 94: | Строка 48: | ||
- | 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. |
+ | In case of DMX item note that addressees are continuous numbering between decoders and start address of each decoders configurable by jumpers. E.g. if you have two 24-ch decoders and want to control all 48 channels then you must set address " | ||
< | < |