mirror of https://github.com/arendst/Tasmota.git
Merge branch 'development' of https://github.com/arendst/Sonoff-Tasmota into development
This commit is contained in:
commit
8eab11f48a
|
@ -0,0 +1,6 @@
|
|||
Make sure these boxes are checked before submitting your issue - Thank you!
|
||||
|
||||
- [ ] What hardware you are using
|
||||
- [ ] Provide the output of command ``status 0``
|
||||
- [ ] If you have a stack dump decode it: https://github.com/esp8266/Arduino/blob/master/doc/Troubleshooting/stack_dump.rst
|
||||
- [ ] For better debug messages: https://github.com/esp8266/Arduino/blob/master/doc/Troubleshooting/debugging.rst
|
|
@ -0,0 +1,40 @@
|
|||
# Number of days of inactivity before an Issue or Pull Request becomes stale
|
||||
daysUntilStale: 120
|
||||
|
||||
# Number of days of inactivity before a stale Issue or Pull Request is closed.
|
||||
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
|
||||
daysUntilClose: 14
|
||||
|
||||
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
|
||||
exemptLabels:
|
||||
- pinned
|
||||
- security
|
||||
- enhancement
|
||||
- bug
|
||||
|
||||
# Set to true to ignore issues in a project (defaults to false)
|
||||
exemptProjects: false
|
||||
|
||||
# Set to true to ignore issues in a milestone (defaults to false)
|
||||
exemptMilestones: false
|
||||
|
||||
# Label to use when marking as stale
|
||||
staleLabel: stale
|
||||
|
||||
# Comment to post when marking as stale. Set to `false` to disable
|
||||
markComment: >
|
||||
This issue has been automatically marked as stale because it has not had
|
||||
recent activity. It will be closed if no further activity occurs. Thank you
|
||||
for your contributions.
|
||||
# Comment to post when removing the stale label.
|
||||
# unmarkComment: >
|
||||
# Your comment here.
|
||||
|
||||
# Comment to post when closing a stale Issue or Pull Request.
|
||||
closeComment: >
|
||||
This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem.
|
||||
# Limit the number of actions per hour, from 1-30. Default is 30
|
||||
limitPerRun: 30
|
||||
|
||||
# Limit to only `issues` or `pulls`
|
||||
only: issues
|
160
README.md
160
README.md
|
@ -1,28 +1,31 @@
|
|||
## Sonoff-Tasmota
|
||||
Provide ESP8266 based Sonoff by [iTead Studio](https://www.itead.cc/) and ElectroDragon IoT Relay with Serial, Web and MQTT control allowing 'Over the Air' or OTA firmware updates using Arduino IDE.
|
||||
|
||||
Current version is **5.12.0d** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information.
|
||||
Alternative firmware for _ESP8266 based devices_ like [iTead](https://www.itead.cc/) _**Sonoff**_ with **web**, **timers**, 'Over The Air' (**OTA**) firmware updates and **sensors support**, allowing control under **Serial**, **HTTP**, **MQTT** and **KNX**, so as to be used on **Smart Home Systems**. Written for Arduino IDE and PlatformIO.
|
||||
|
||||
### ATTENTION All versions
|
||||
[![GitHub version](https://img.shields.io/github/release/arendst/Sonoff-Tasmota.svg)](https://github.com/arendst/Sonoff-Tasmota/releases/latest)
|
||||
[![GitHub download](https://img.shields.io/github/downloads/arendst/Sonoff-Tasmota/total.svg)](https://github.com/arendst/Sonoff-Tasmota/releases/latest)
|
||||
[![License](https://img.shields.io/github/license/arendst/Sonoff-Tasmota.svg)](https://github.com/arendst/Sonoff-Tasmota/blob/development/LICENSE.txt)
|
||||
|
||||
Only Flash Mode DOUT is supported. Do not use Flash Mode DIO / QIO / QOUT as it might seem to brick your device.
|
||||
If you like **Sonoff-Tasmota**, give it a star, or fork it and contribute!
|
||||
[![GitHub stars](https://img.shields.io/github/stars/arendst/Sonoff-Tasmota.svg?style=social&label=Star)](https://github.com/arendst/Sonoff-Tasmota/stargazers)
|
||||
[![GitHub forks](https://img.shields.io/github/forks/arendst/Sonoff-Tasmota.svg?style=social&label=Fork)](https://github.com/arendst/Sonoff-Tasmota/network)
|
||||
|
||||
See [Wiki](https://github.com/arendst/Sonoff-Tasmota/wiki/Theo's-Tasmota-Tips) for background information.
|
||||
### Development
|
||||
[![Build Status](https://img.shields.io/travis/arendst/Sonoff-Tasmota.svg)](https://travis-ci.org/arendst/Sonoff-Tasmota)
|
||||
|
||||
### ATTENTION Version 5 and up
|
||||
Current version is **5.13.1a** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information.
|
||||
|
||||
These versions use a new linker script to free flash memory for future code additions. It moves the settings from Spiffs to Eeprom. If you compile your own firmware download the new linker to your IDE or Platformio base folder. See [Wiki > Prerequisite](https://github.com/arendst/Sonoff-Tasmota/wiki/Prerequisite).
|
||||
### Quick install
|
||||
Download one of the released binaries from https://github.com/arendst/Sonoff-Tasmota/releases and flash it to your hardware as documented in the wiki.
|
||||
|
||||
Best practice to implement is:
|
||||
- Open the webpage to your device
|
||||
- Perform option ``Backup Configuration``
|
||||
- Upgrade new firmware using ``Firmware upgrade``
|
||||
- If configuration conversion fails keep the webpage open and perform ``Restore Configuration``
|
||||
### Important User Compilation Information
|
||||
If you want to compile Sonoff-Tasmota yourself keep in mind the following:
|
||||
|
||||
You should now have a device with 32k more code memory to play with.
|
||||
- Only Flash Mode **DOUT** is supported. Do not use Flash Mode DIO / QIO / QOUT as it might seem to brick your device. See [Wiki](https://github.com/arendst/Sonoff-Tasmota/wiki/Theo's-Tasmota-Tips) for background information.
|
||||
- Sonoff-Tasmota uses a 1M linker script WITHOUT spiffs for optimal code space. If you compile using ESP/Arduino library 2.3.0 then download the provided new linker script to your Arduino IDE or Platformio base folder. Later version of ESP/Arduino library already contain the correct linker script. See [Wiki > Prerequisite](https://github.com/arendst/Sonoff-Tasmota/wiki/Prerequisite).
|
||||
- To make compile time changes to Sonoff-Tasmota it can use the ``user_config_override.h`` file. It assures keeping your settings when you download and compile a new version. To use ``user_config.override.h`` you will have to make a copy of the provided ``user_config.override_sample.h`` file and add your setting overrides. To enable the override file you will need to use a compile define as documented in the ``user_config_override_sample.h`` file.
|
||||
|
||||
### Version Information
|
||||
|
||||
- Sonoff-Tasmota provides all (Sonoff) modules in one file and starts with module Sonoff Basic.
|
||||
- Once uploaded select module using the configuration webpage or the commands ```Modules``` and ```Module```.
|
||||
- After reboot select config menu again or use commands ```GPIOs``` and ```GPIO``` to change GPIO with desired sensor.
|
||||
|
@ -38,9 +41,10 @@ The following devices are supported:
|
|||
- [iTead Sonoff SV](https://www.itead.cc/smart-home/sonoff-sv.html)<img src="https://github.com/arendst/arendst.github.io/blob/master/media/sonoff_th.jpg" width="250" align="right" />
|
||||
- [iTead Sonoff TH10/TH16 with temperature sensor](https://www.itead.cc/smart-home/sonoff-th.html)
|
||||
- [iTead Sonoff Dual (R2)](https://www.itead.cc/smart-home/sonoff-dual.html)
|
||||
- [iTead Sonoff Pow](https://www.itead.cc/smart-home/sonoff-pow.html)
|
||||
- [iTead Sonoff 4CH](https://www.itead.cc/smart-home/sonoff-4ch.html)
|
||||
- [iTead Sonoff 4CH Pro](https://www.itead.cc/smart-home/sonoff-4ch-pro.html)
|
||||
- [iTead Sonoff Pow with Energy Monitoring](https://www.itead.cc/smart-home/sonoff-pow.html)
|
||||
- [iTead Sonoff Pow R2 with Energy Monitoring](https://www.itead.cc/sonoff-pow-r2.html)
|
||||
- [iTead Sonoff 4CH (R2)](https://www.itead.cc/smart-home/sonoff-4ch.html)
|
||||
- [iTead Sonoff 4CH Pro (R2)](https://www.itead.cc/smart-home/sonoff-4ch-pro.html)
|
||||
- [iTead S20 Smart Socket](https://www.itead.cc/smart-socket.html)
|
||||
- [Sonoff S22 Smart Socket](https://github.com/arendst/Sonoff-Tasmota/issues/627)
|
||||
- [iTead Sonoff S31 Smart Socket with Energy Monitoring](https://www.itead.cc/sonoff-s31.html)
|
||||
|
@ -48,7 +52,7 @@ The following devices are supported:
|
|||
- [iTead Sonoff Touch](https://www.itead.cc/sonoff-touch.html)
|
||||
- [iTead Sonoff T1](https://www.itead.cc/sonoff-t1.html)
|
||||
- [iTead Sonoff SC](https://www.itead.cc/sonoff-sc.html)
|
||||
- [iTead Sonoff Led](https://www.itead.cc/sonoff-led.html)<img src="https://github.com/arendst/arendst.github.io/blob/master/media/sonoff4ch.jpg" height="250" align="right" />
|
||||
- [iTead Sonoff Led](https://www.itead.cc/sonoff-led.html)<img src="https://github.com/arendst/arendst.github.io/blob/master/media/sonoff4chpror2.jpg" height="250" align="right" />
|
||||
- [iTead Sonoff BN-SZ01 Ceiling Led](https://www.itead.cc/bn-sz01.html)
|
||||
- [iTead Sonoff B1](https://www.itead.cc/sonoff-b1.html)
|
||||
- [iTead Sonoff RF Bridge 433](https://www.itead.cc/sonoff-rf-bridge-433.html)
|
||||
|
@ -64,6 +68,124 @@ The following devices are supported:
|
|||
- [Luani HVIO board](https://luani.de/projekte/esp8266-hvio/)
|
||||
- Wemos D1 mini, NodeMcu and Ledunia
|
||||
|
||||
### Firmware release information
|
||||
Different firmware images are released based on Features and Sensors selection guided by code and memory usage.
|
||||
|
||||
- The Minimal version allows intermediate OTA uploads to support larger versions and does NOT change any persistent parameter.
|
||||
- The Classic version allows single OTA uploads as did the previous Sonoff-Tasmota versions.
|
||||
|
||||
#### Available Features and Sensors
|
||||
|
||||
| Feature or Sensor | sonoff | classic | minimal | knx | allsensors |
|
||||
|--------------------------------|--------|---------|---------|-----|------------|
|
||||
| MY_LANGUAGE en-GB | x | x | x | x | x |
|
||||
| MQTT_LIBRARY_TYPE PUBSUBCLIENT | x | x | x | x | x |
|
||||
| USE_DOMOTICZ | x | x | - | x | x |
|
||||
| USE_HOME_ASSISTANT | x | x | - | x | x |
|
||||
| USE_MQTT_TLS | - | - | - | - | - |
|
||||
| USE_KNX | - | - | - | x | - |
|
||||
| USE_WEBSERVER | x | x | x | x | x |
|
||||
| USE_EMULATION | x | x | - | - | x |
|
||||
| USE_DISCOVERY | x | x | - | x | x |
|
||||
| WEBSERVER_ADVERTISE | x | x | - | x | x |
|
||||
| MQTT_HOST_DISCOVERY | x | x | - | x | x |
|
||||
| USE_TIMERS | x | - | - | x | x |
|
||||
| USE_TIMERS_WEB | x | - | - | x | x |
|
||||
| USE_SUNRISE | x | - | - | x | x |
|
||||
| USE_RULES | x | - | - | x | x |
|
||||
| | | | | | |
|
||||
| USE_ADC_VCC | x | x | x | x | x |
|
||||
| USE_DS18B20 | x | x | - | x | - |
|
||||
| USE_DS18x20 | - | - | - | - | x |
|
||||
| USE_DS18x20_LEGACY | - | - | - | - | - |
|
||||
| USE_I2C | x | x | - | x | x |
|
||||
| USE_SHT | x | x | - | x | x |
|
||||
| USE_SHT3X | x | x | - | x | x |
|
||||
| USE_HTU | x | x | - | x | x |
|
||||
| USE_BMP | x | x | - | x | x |
|
||||
| USE_BME680 | - | - | - | - | x |
|
||||
| USE_SGP30 | x | - | - | x | x |
|
||||
| USE_BH1750 | x | x | - | x | x |
|
||||
| USE_VEML6070 | - | - | - | - | x |
|
||||
| USE_TSL2561 | - | - | - | - | x |
|
||||
| USE_ADS1115 | - | - | - | - | x |
|
||||
| USE_ADS1115_I2CDEV | - | - | - | - | - |
|
||||
| USE_INA219 | - | - | - | - | x |
|
||||
| USE_MGS | - | - | - | - | x |
|
||||
| USE_SPI | - | - | - | - | - |
|
||||
| USE_MHZ19 | x | x | - | x | x |
|
||||
| USE_SENSEAIR | x | x | - | x | x |
|
||||
| USE_PMS5003 | x | x | - | x | x |
|
||||
| USE_NOVA_SDS | x | - | - | x | x |
|
||||
| USE_PZEM004T | x | x | - | x | x |
|
||||
| USE_SERIAL_BRIDGE | x | - | - | x | x |
|
||||
| USE_IR_REMOTE | x | x | - | x | x |
|
||||
| USE_IR_HVAC | - | - | - | - | x |
|
||||
| USE_IR_RECEIVE | x | - | - | x | x |
|
||||
| USE_WS2812 | x | x | - | x | x |
|
||||
| USE_WS2812_DMA | - | - | - | - | - |
|
||||
| USE_ARILUX_RF | x | x | - | x | x |
|
||||
| USE_SR04 | x | - | - | x | x |
|
||||
|
||||
#### Typical file size
|
||||
|
||||
| ESP/Arduino library version | sonoff | classic | minimal | knx | allsensors |
|
||||
|--------------------------------|--------|---------|---------|------|------------|
|
||||
| ESP/Arduino lib v2.3.0 | 526k | 488k | 427k | 535k | 549k |
|
||||
| ESP/Arduino lib v2.4.0 | 531k | 496k | 435k | 540k | 552k |
|
||||
| ESP/Arduino lib v2.4.1 | 534k | 499k | 437k | 543k | 555k |
|
||||
|
||||
### Contribute
|
||||
You can contribute to Sonoff-Tasmota by
|
||||
- providing Pull Requests (Features, Proof of Concepts, Language files or Fixes)
|
||||
- testing new released features and report issues
|
||||
- donating to acquire hardware for testing and implementing or out of gratitude
|
||||
|
||||
[![donate](https://img.shields.io/badge/donate-PayPal-blue.svg)](https://paypal.me/tasmota)
|
||||
|
||||
### Credits
|
||||
|
||||
#### Libraries used
|
||||
Libraries used with Sonoff-Tasmota are:
|
||||
- [ESP8266 core for Arduino](https://github.com/esp8266/Arduino)
|
||||
- [Adafruit BME680](https://github.com/adafruit/Adafruit_BME680)
|
||||
- [Adafruit Sensor](https://github.com/adafruit/Adafruit_Sensor)
|
||||
- [Adafruit SGP30](https://github.com/adafruit/Adafruit_SGP30)
|
||||
- [ArduinoJson](https://arduinojson.org/)
|
||||
- [Esp8266MqttClient](https://github.com/tuanpmt/ESP8266MQTTClient)
|
||||
- [esp-knx-ip](https://github.com/envy/esp-knx-ip)
|
||||
- [esp-mqtt-arduino](https://github.com/i-n-g-o/esp-mqtt-arduino)
|
||||
- [I2Cdevlib](https://github.com/jrowberg/i2cdevlib)
|
||||
- [IRremoteEsp8266](https://github.com/markszabo/IRremoteESP8266)
|
||||
- [JobaTsl2561](https://github.com/joba-1/Joba_Tsl2561)
|
||||
- [MultiChannelGasSensor](http://wiki.seeedstudio.com/Grove-Multichannel_Gas_Sensor/)
|
||||
- [NeoPixelBus](https://github.com/Makuna/NeoPixelBus)
|
||||
- [OneWire](https://github.com/PaulStoffregen/OneWire)
|
||||
- [PubSubClient](https://github.com/knolleary/pubsubclient)
|
||||
|
||||
#### People inspiring me
|
||||
People helping to keep the show on the road:
|
||||
- David Lang providing initial issue resolution and code optimizations
|
||||
- Heiko Krupp for his IRSend, HTU21, SI70xx and Wemo/Hue emulation drivers
|
||||
- Wiktor Schmidt for Travis CI implementation
|
||||
- Thom Dietrich for PlatformIO optimizations
|
||||
- Marinus van den Broek for his EspEasy groundwork
|
||||
- Pete Ba for more user friendly energy monitor calibration
|
||||
- Lobradov providing compile optimization tips
|
||||
- Flexiti for his initial timer implementation
|
||||
- reloxx13 for his [SonWeb](https://github.com/reloxx13/SonWEB) management tool
|
||||
- Joachim Banzhaf for his TSL2561 library and driver
|
||||
- Gijs Noorlander for his MHZ19 and SenseAir drivers
|
||||
- Emontnemery for his HomeAssistant Discovery concept and many code tuning tips
|
||||
- Aidan Mountford for his HSB support
|
||||
- Daniel Ztolnai for his Serial Bridge implementation
|
||||
- Gerhard Mutz for his SGP30 and Sunrise/Sunset driver
|
||||
- Nuno Ferreira for his HC-SR04 driver
|
||||
- Adrian Scillato for his (security)fixes and implementing and maintaining KNX
|
||||
- Raymond Mouthaan for managing Wemos Wiki information
|
||||
- Norbert Richter, Frogmore42 and Jason2866 for providing many issue answers
|
||||
- Many more providing Tips, Pocs or PRs
|
||||
|
||||
### License
|
||||
|
||||
This program is licensed under GPL-3.0
|
||||
This program is licensed under GPL-3.0
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,137 @@
|
|||
|
||||
# ESP8266 platform
|
||||
# ------------------------------
|
||||
|
||||
# For more info:
|
||||
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification
|
||||
|
||||
name=ESP8266 Modules
|
||||
version=2.4.1
|
||||
|
||||
|
||||
|
||||
|
||||
compiler.warning_flags=-w
|
||||
compiler.warning_flags.none=-w
|
||||
compiler.warning_flags.default=
|
||||
compiler.warning_flags.more=-Wall
|
||||
compiler.warning_flags.all=-Wall -Wextra
|
||||
|
||||
build.lwip_lib=-llwip_gcc
|
||||
build.lwip_include=lwip/include
|
||||
build.lwip_flags=-DLWIP_OPEN_SRC
|
||||
|
||||
#build.float=-u _printf_float -u _scanf_float
|
||||
build.float=
|
||||
build.led=
|
||||
|
||||
compiler.path={runtime.tools.xtensa-lx106-elf-gcc.path}/bin/
|
||||
compiler.sdk.path={runtime.platform.path}/tools/sdk
|
||||
compiler.libc.path={runtime.platform.path}/tools/sdk/libc/xtensa-lx106-elf
|
||||
compiler.cpreprocessor.flags=-D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-I{compiler.sdk.path}/include" "-I{compiler.sdk.path}/{build.lwip_include}" "-I{compiler.libc.path}/include" "-I{build.path}/core"
|
||||
|
||||
compiler.c.cmd=xtensa-lx106-elf-gcc
|
||||
compiler.c.flags=-c {compiler.warning_flags} -Os -g -Wpointer-arith -Wno-implicit-function-declaration -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -falign-functions=4 -MMD -std=gnu99 -ffunction-sections -fdata-sections
|
||||
|
||||
compiler.S.cmd=xtensa-lx106-elf-gcc
|
||||
compiler.S.flags=-c -g -x assembler-with-cpp -MMD -mlongcalls
|
||||
|
||||
compiler.c.elf.flags=-g {compiler.warning_flags} -Os -nostdlib -Wl,--no-check-sections -u call_user_start {build.float} -Wl,-static "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" "-L{compiler.libc.path}/lib" "-T{build.flash_ld}" -Wl,--gc-sections -Wl,-wrap,system_restart_local -Wl,-wrap,spi_flash_read
|
||||
|
||||
compiler.c.elf.cmd=xtensa-lx106-elf-gcc
|
||||
compiler.c.elf.libs=-lhal -lphy -lpp -lnet80211 {build.lwip_lib} -lwpa -lcrypto -lmain -lwps -laxtls -lespnow -lsmartconfig -lairkiss -lwpa2 -lstdc++ -lm -lc -lgcc
|
||||
|
||||
compiler.cpp.cmd=xtensa-lx106-elf-g++
|
||||
compiler.cpp.flags=-c {compiler.warning_flags} -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -MMD -ffunction-sections -fdata-sections
|
||||
|
||||
compiler.as.cmd=xtensa-lx106-elf-as
|
||||
|
||||
compiler.ar.cmd=xtensa-lx106-elf-ar
|
||||
compiler.ar.flags=cru
|
||||
|
||||
compiler.elf2hex.cmd=esptool
|
||||
compiler.elf2hex.flags=
|
||||
|
||||
compiler.size.cmd=xtensa-lx106-elf-size
|
||||
|
||||
compiler.esptool.cmd=esptool
|
||||
compiler.esptool.cmd.windows=esptool.exe
|
||||
|
||||
# This can be overriden in boards.txt
|
||||
build.extra_flags=-DESP8266
|
||||
|
||||
# These can be overridden in platform.local.txt
|
||||
compiler.c.extra_flags=
|
||||
compiler.c.elf.extra_flags=
|
||||
compiler.S.extra_flags=
|
||||
compiler.cpp.extra_flags=
|
||||
compiler.ar.extra_flags=
|
||||
compiler.objcopy.eep.extra_flags=
|
||||
compiler.elf2hex.extra_flags=
|
||||
|
||||
## generate file with git version number
|
||||
## needs bash, git, and echo
|
||||
|
||||
|
||||
## windows-compatible version without git
|
||||
|
||||
|
||||
|
||||
## Compile c files
|
||||
recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.flags} {compiler.c.flags} -DF_CPU={build.f_cpu} {build.lwip_flags} {build.debug_port} {build.debug_level} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" {build.led} {compiler.c.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
|
||||
|
||||
## Compile c++ files
|
||||
recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpreprocessor.flags} {compiler.cpp.flags} -DF_CPU={build.f_cpu} {build.lwip_flags} {build.debug_port} {build.debug_level} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" {build.led} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
|
||||
|
||||
## Compile S files
|
||||
recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.flags} {compiler.S.flags} -DF_CPU={build.f_cpu} {build.lwip_flags} {build.debug_port} {build.debug_level} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" {build.led} {compiler.c.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
|
||||
|
||||
## Create archives
|
||||
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/arduino.ar" "{object_file}"
|
||||
|
||||
## Combine gc-sections, archives, and objects
|
||||
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" -Wl,--start-group {object_files} "{build.path}/arduino.ar" {compiler.c.elf.libs} -Wl,--end-group "-L{build.path}"
|
||||
|
||||
## Create eeprom
|
||||
recipe.objcopy.eep.pattern=
|
||||
|
||||
## Create hex
|
||||
#recipe.objcopy.hex.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.hex"
|
||||
|
||||
recipe.objcopy.hex.pattern="{runtime.tools.esptool.path}/{compiler.esptool.cmd}" -eo "{runtime.platform.path}/bootloaders/eboot/eboot.elf" -bo "{build.path}/{build.project_name}.bin" -bm {build.flash_mode} -bf {build.flash_freq} -bz {build.flash_size} -bs .text -bp 4096 -ec -eo "{build.path}/{build.project_name}.elf" -bs .irom0.text -bs .text -bs .data -bs .rodata -bc -ec
|
||||
|
||||
## Save hex
|
||||
recipe.output.tmp_file={build.project_name}.bin
|
||||
recipe.output.save_file={build.project_name}.{build.variant}.bin
|
||||
|
||||
## Compute size
|
||||
recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf"
|
||||
recipe.size.regex=^(?:\.irom0\.text|\.text|\.data|\.rodata|)\s+([0-9]+).*
|
||||
recipe.size.regex.data=^(?:\.data|\.rodata|\.bss)\s+([0-9]+).*
|
||||
#recipe.size.regex.eeprom=^(?:\.eeprom)\s+([0-9]+).*
|
||||
|
||||
# ------------------------------
|
||||
|
||||
tools.esptool.cmd=esptool
|
||||
tools.esptool.cmd.windows=esptool.exe
|
||||
tools.esptool.path={runtime.tools.esptool.path}
|
||||
tools.esptool.network_cmd=python
|
||||
tools.esptool.network_cmd.windows=python.exe
|
||||
|
||||
tools.esptool.upload.protocol=esp
|
||||
tools.esptool.upload.params.verbose=-vv
|
||||
tools.esptool.upload.params.quiet=
|
||||
tools.esptool.upload.pattern="{path}/{cmd}" {upload.verbose} -cd {upload.resetmethod} -cb {upload.speed} -cp "{serial.port}" {upload.erase_cmd} -ca 0x00000 -cf "{build.path}/{build.project_name}.bin"
|
||||
tools.esptool.upload.network_pattern="{network_cmd}" "{runtime.platform.path}/tools/espota.py" -i "{serial.port}" -p "{network.port}" "--auth={network.password}" -f "{build.path}/{build.project_name}.bin"
|
||||
|
||||
tools.mkspiffs.cmd=mkspiffs
|
||||
tools.mkspiffs.cmd.windows=mkspiffs.exe
|
||||
tools.mkspiffs.path={runtime.tools.mkspiffs.path}
|
||||
|
||||
tools.espupload.cmd=python
|
||||
tools.espupload.cmd.windows=python.exe
|
||||
tools.espupload.path={runtime.platform.path}/tools
|
||||
tools.espupload.upload.protocol=espupload
|
||||
tools.espupload.upload.params.verbose=
|
||||
tools.espupload.upload.params.quiet=
|
||||
tools.espupload.upload.pattern="{cmd}" "{path}/espupload.py" -f "{build.path}/{build.project_name}.bin"
|
|
@ -0,0 +1,46 @@
|
|||
Thank you for opening an issue on an Adafruit Arduino library repository. To
|
||||
improve the speed of resolution please review the following guidelines and
|
||||
common troubleshooting steps below before creating the issue:
|
||||
|
||||
- **Do not use GitHub issues for troubleshooting projects and issues.** Instead use
|
||||
the forums at http://forums.adafruit.com to ask questions and troubleshoot why
|
||||
something isn't working as expected. In many cases the problem is a common issue
|
||||
that you will more quickly receive help from the forum community. GitHub issues
|
||||
are meant for known defects in the code. If you don't know if there is a defect
|
||||
in the code then start with troubleshooting on the forum first.
|
||||
|
||||
- **If following a tutorial or guide be sure you didn't miss a step.** Carefully
|
||||
check all of the steps and commands to run have been followed. Consult the
|
||||
forum if you're unsure or have questions about steps in a guide/tutorial.
|
||||
|
||||
- **For Arduino projects check these very common issues to ensure they don't apply**:
|
||||
|
||||
- For uploading sketches or communicating with the board make sure you're using
|
||||
a **USB data cable** and **not** a **USB charge-only cable**. It is sometimes
|
||||
very hard to tell the difference between a data and charge cable! Try using the
|
||||
cable with other devices or swapping to another cable to confirm it is not
|
||||
the problem.
|
||||
|
||||
- **Be sure you are supplying adequate power to the board.** Check the specs of
|
||||
your board and plug in an external power supply. In many cases just
|
||||
plugging a board into your computer is not enough to power it and other
|
||||
peripherals.
|
||||
|
||||
- **Double check all soldering joints and connections.** Flakey connections
|
||||
cause many mysterious problems. See the [guide to excellent soldering](https://learn.adafruit.com/adafruit-guide-excellent-soldering/tools) for examples of good solder joints.
|
||||
|
||||
- **Ensure you are using an official Arduino or Adafruit board.** We can't
|
||||
guarantee a clone board will have the same functionality and work as expected
|
||||
with this code and don't support them.
|
||||
|
||||
If you're sure this issue is a defect in the code and checked the steps above
|
||||
please fill in the following fields to provide enough troubleshooting information.
|
||||
You may delete the guideline and text above to just leave the following details:
|
||||
|
||||
- Arduino board: **INSERT ARDUINO BOARD NAME/TYPE HERE**
|
||||
|
||||
- Arduino IDE version (found in Arduino -> About Arduino menu): **INSERT ARDUINO
|
||||
VERSION HERE**
|
||||
|
||||
- List the steps to reproduce the problem below (if possible attach a sketch or
|
||||
copy the sketch code in too): **LIST REPRO STEPS BELOW**
|
|
@ -0,0 +1,26 @@
|
|||
Thank you for creating a pull request to contribute to Adafruit's GitHub code!
|
||||
Before you open the request please review the following guidelines and tips to
|
||||
help it be more easily integrated:
|
||||
|
||||
- **Describe the scope of your change--i.e. what the change does and what parts
|
||||
of the code were modified.** This will help us understand any risks of integrating
|
||||
the code.
|
||||
|
||||
- **Describe any known limitations with your change.** For example if the change
|
||||
doesn't apply to a supported platform of the library please mention it.
|
||||
|
||||
- **Please run any tests or examples that can exercise your modified code.** We
|
||||
strive to not break users of the code and running tests/examples helps with this
|
||||
process.
|
||||
|
||||
Thank you again for contributing! We will try to test and integrate the change
|
||||
as soon as we can, but be aware we have many GitHub repositories to manage and
|
||||
can't immediately respond to every request. There is no need to bump or check in
|
||||
on a pull request (it will clutter the discussion of the request).
|
||||
|
||||
Also don't be worried if the request is closed or not integrated--sometimes the
|
||||
priorities of Adafruit's GitHub code (education, ease of use) might not match the
|
||||
priorities of the pull request. Don't fret, the open source community thrives on
|
||||
forks and GitHub makes it easy to keep your changes in a forked repo.
|
||||
|
||||
After reviewing the guidelines above you can delete this text from the pull request.
|
|
@ -0,0 +1,4 @@
|
|||
*~
|
||||
Doxyfile*
|
||||
doxygen_sqlite3.db
|
||||
html
|
|
@ -0,0 +1,27 @@
|
|||
language: c
|
||||
sudo: false
|
||||
|
||||
# Blacklist
|
||||
branches:
|
||||
except:
|
||||
- gh-pages
|
||||
|
||||
env:
|
||||
global:
|
||||
- PRETTYNAME="Adafruit SGP30 Arduino Library"
|
||||
# Optional, will default to "$TRAVIS_BUILD_DIR/Doxyfile"
|
||||
# - DOXYFILE: $TRAVIS_BUILD_DIR/Doxyfile
|
||||
|
||||
before_install:
|
||||
- source <(curl -SLs https://raw.githubusercontent.com/adafruit/travis-ci-arduino/master/install.sh)
|
||||
|
||||
#install:
|
||||
# - arduino --install-library "Adafruit ILI9341","Adafruit GFX Library"
|
||||
|
||||
script:
|
||||
- build_main_platforms
|
||||
|
||||
# Generate and deploy documentation
|
||||
after_success:
|
||||
- source <(curl -SLs https://raw.githubusercontent.com/adafruit/travis-ci-arduino/master/library_check.sh)
|
||||
- source <(curl -SLs https://raw.githubusercontent.com/adafruit/travis-ci-arduino/master/doxy_gen_and_deploy.sh)
|
|
@ -0,0 +1,243 @@
|
|||
/*!
|
||||
* @file Adafruit_SGP30.cpp
|
||||
*
|
||||
* @mainpage Adafruit SGP30 gas sensor driver
|
||||
*
|
||||
* @section intro_sec Introduction
|
||||
*
|
||||
* This is the documentation for Adafruit's SGP30 driver for the
|
||||
* Arduino platform. It is designed specifically to work with the
|
||||
* Adafruit SGP30 breakout: http://www.adafruit.com/products/3709
|
||||
*
|
||||
* These sensors use I2C to communicate, 2 pins (SCL+SDA) are required
|
||||
* to interface with the breakout.
|
||||
*
|
||||
* Adafruit invests time and resources providing this open source code,
|
||||
* please support Adafruit and open-source hardware by purchasing
|
||||
* products from Adafruit!
|
||||
*
|
||||
*
|
||||
* @section author Author
|
||||
* Written by Ladyada for Adafruit Industries.
|
||||
*
|
||||
* @section license License
|
||||
* BSD license, all text here must be included in any redistribution.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#if ARDUINO >= 100
|
||||
#include "Arduino.h"
|
||||
#else
|
||||
#include "WProgram.h"
|
||||
#endif
|
||||
|
||||
#include "Adafruit_SGP30.h"
|
||||
|
||||
//#define I2C_DEBUG
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Instantiates a new SGP30 class
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_SGP30::Adafruit_SGP30() {
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Setups the hardware and detects a valid SGP30. Initializes I2C
|
||||
then reads the serialnumber and checks that we are talking to an SGP30
|
||||
@param theWire Optional pointer to I2C interface, otherwise use Wire
|
||||
@returns True if SGP30 found on I2C, False if something went wrong!
|
||||
*/
|
||||
/**************************************************************************/
|
||||
boolean Adafruit_SGP30::begin(TwoWire *theWire) {
|
||||
_i2caddr = SGP30_I2CADDR_DEFAULT;
|
||||
if (theWire == NULL) {
|
||||
_i2c = &Wire;
|
||||
} else {
|
||||
_i2c = theWire;
|
||||
}
|
||||
|
||||
_i2c->begin();
|
||||
|
||||
|
||||
uint8_t command[2];
|
||||
command[0] = 0x36;
|
||||
command[1] = 0x82;
|
||||
if (! readWordFromCommand(command, 2, 10, serialnumber, 3))
|
||||
return false;
|
||||
|
||||
uint16_t featureset;
|
||||
command[0] = 0x20;
|
||||
command[1] = 0x2F;
|
||||
if (! readWordFromCommand(command, 2, 10, &featureset, 1))
|
||||
return false;
|
||||
//Serial.print("Featureset 0x"); Serial.println(featureset, HEX);
|
||||
if (featureset != SGP30_FEATURESET)
|
||||
return false;
|
||||
if (! IAQinit())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Commands the sensor to begin the IAQ algorithm. Must be called after startup.
|
||||
@returns True if command completed successfully, false if something went wrong!
|
||||
*/
|
||||
/**************************************************************************/
|
||||
boolean Adafruit_SGP30::IAQinit(void) {
|
||||
uint8_t command[2];
|
||||
command[0] = 0x20;
|
||||
command[1] = 0x03;
|
||||
return readWordFromCommand(command, 2, 10);
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Commands the sensor to take a single eCO2/VOC measurement. Places results in {@link TVOC} and {@link eCO2}
|
||||
@returns True if command completed successfully, false if something went wrong!
|
||||
*/
|
||||
/**************************************************************************/
|
||||
boolean Adafruit_SGP30::IAQmeasure(void) {
|
||||
uint8_t command[2];
|
||||
command[0] = 0x20;
|
||||
command[1] = 0x08;
|
||||
uint16_t reply[2];
|
||||
if (! readWordFromCommand(command, 2, 12, reply, 2))
|
||||
return false;
|
||||
TVOC = reply[1];
|
||||
eCO2 = reply[0];
|
||||
return true;
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Request baseline calibration values for both CO2 and TVOC IAQ calculations. Places results in parameter memory locaitons.
|
||||
@param eco2_base A pointer to a uint16_t which we will save the calibration value to
|
||||
@param tvoc_base A pointer to a uint16_t which we will save the calibration value to
|
||||
@returns True if command completed successfully, false if something went wrong!
|
||||
*/
|
||||
/**************************************************************************/
|
||||
boolean Adafruit_SGP30::getIAQBaseline(uint16_t *eco2_base, uint16_t *tvoc_base) {
|
||||
uint8_t command[2];
|
||||
command[0] = 0x20;
|
||||
command[1] = 0x15;
|
||||
uint16_t reply[2];
|
||||
if (! readWordFromCommand(command, 2, 10, reply, 2))
|
||||
return false;
|
||||
*eco2_base = reply[0];
|
||||
*tvoc_base = reply[1];
|
||||
return true;
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Assign baseline calibration values for both CO2 and TVOC IAQ calculations.
|
||||
@param eco2_base A uint16_t which we will save the calibration value from
|
||||
@param tvoc_base A uint16_t which we will save the calibration value from
|
||||
@returns True if command completed successfully, false if something went wrong!
|
||||
*/
|
||||
/**************************************************************************/
|
||||
boolean Adafruit_SGP30::setIAQBaseline(uint16_t eco2_base, uint16_t tvoc_base) {
|
||||
uint8_t command[8];
|
||||
command[0] = 0x20;
|
||||
command[1] = 0x1e;
|
||||
command[2] = tvoc_base >> 8;
|
||||
command[3] = tvoc_base & 0xFF;
|
||||
command[4] = generateCRC(command+2, 2);
|
||||
command[5] = eco2_base >> 8;
|
||||
command[6] = eco2_base & 0xFF;
|
||||
command[7] = generateCRC(command+5, 2);
|
||||
|
||||
return readWordFromCommand(command, 8, 10);
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief I2C low level interfacing
|
||||
*/
|
||||
/**************************************************************************/
|
||||
|
||||
|
||||
boolean Adafruit_SGP30::readWordFromCommand(uint8_t command[], uint8_t commandLength, uint16_t delayms, uint16_t *readdata, uint8_t readlen)
|
||||
{
|
||||
uint8_t data;
|
||||
|
||||
_i2c->beginTransmission(_i2caddr);
|
||||
|
||||
#ifdef I2C_DEBUG
|
||||
Serial.print("\t\t-> ");
|
||||
#endif
|
||||
|
||||
for (uint8_t i=0; i<commandLength; i++) {
|
||||
_i2c->write(command[i]);
|
||||
#ifdef I2C_DEBUG
|
||||
Serial.print("0x"); Serial.print(command[i], HEX); Serial.print(", ");
|
||||
#endif
|
||||
}
|
||||
#ifdef I2C_DEBUG
|
||||
Serial.println();
|
||||
#endif
|
||||
_i2c->endTransmission();
|
||||
|
||||
delay(delayms);
|
||||
|
||||
if (readlen == 0)
|
||||
return true;
|
||||
|
||||
uint8_t replylen = readlen * (SGP30_WORD_LEN +1);
|
||||
if (_i2c->requestFrom(_i2caddr, replylen) != replylen)
|
||||
return false;
|
||||
uint8_t replybuffer[replylen];
|
||||
#ifdef I2C_DEBUG
|
||||
Serial.print("\t\t<- ");
|
||||
#endif
|
||||
for (uint8_t i=0; i<replylen; i++) {
|
||||
replybuffer[i] = _i2c->read();
|
||||
#ifdef I2C_DEBUG
|
||||
Serial.print("0x"); Serial.print(replybuffer[i], HEX); Serial.print(", ");
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef I2C_DEBUG
|
||||
Serial.println();
|
||||
#endif
|
||||
|
||||
for (uint8_t i=0; i<readlen; i++) {
|
||||
uint8_t crc = generateCRC(replybuffer+i*3, 2);
|
||||
#ifdef I2C_DEBUG
|
||||
Serial.print("\t\tCRC calced: 0x"); Serial.print(crc, HEX);
|
||||
Serial.print(" vs. 0x"); Serial.println(replybuffer[i * 3 + 2], HEX);
|
||||
#endif
|
||||
if (crc != replybuffer[i * 3 + 2])
|
||||
return false;
|
||||
// success! store it
|
||||
readdata[i] = replybuffer[i*3];
|
||||
readdata[i] <<= 8;
|
||||
readdata[i] |= replybuffer[i*3 + 1];
|
||||
#ifdef I2C_DEBUG
|
||||
Serial.print("\t\tRead: 0x"); Serial.println(readdata[i], HEX);
|
||||
#endif
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
uint8_t Adafruit_SGP30::generateCRC(uint8_t *data, uint8_t datalen) {
|
||||
// calculates 8-Bit checksum with given polynomial
|
||||
uint8_t crc = SGP30_CRC8_INIT;
|
||||
|
||||
for (uint8_t i=0; i<datalen; i++) {
|
||||
crc ^= data[i];
|
||||
for (uint8_t b=0; b<8; b++) {
|
||||
if (crc & 0x80)
|
||||
crc = (crc << 1) ^ SGP30_CRC8_POLYNOMIAL;
|
||||
else
|
||||
crc <<= 1;
|
||||
}
|
||||
}
|
||||
return crc;
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
/*!
|
||||
* @file Adafruit_SGP30.h
|
||||
*
|
||||
* This is the documentation for Adafruit's SGP30 driver for the
|
||||
* Arduino platform. It is designed specifically to work with the
|
||||
* Adafruit SGP30 breakout: http://www.adafruit.com/products/3709
|
||||
*
|
||||
* These sensors use I2C to communicate, 2 pins (SCL+SDA) are required
|
||||
* to interface with the breakout.
|
||||
*
|
||||
* Adafruit invests time and resources providing this open source code,
|
||||
* please support Adafruit and open-source hardware by purchasing
|
||||
* products from Adafruit!
|
||||
*
|
||||
* Written by Ladyada for Adafruit Industries.
|
||||
*
|
||||
* BSD license, all text here must be included in any redistribution.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "Arduino.h"
|
||||
#include <Wire.h>
|
||||
|
||||
// the i2c address
|
||||
#define SGP30_I2CADDR_DEFAULT 0x58 ///< SGP30 has only one I2C address
|
||||
|
||||
// commands and constants
|
||||
#define SGP30_FEATURESET 0x0020 ///< The required set for this library
|
||||
#define SGP30_CRC8_POLYNOMIAL 0x31 ///< Seed for SGP30's CRC polynomial
|
||||
#define SGP30_CRC8_INIT 0xFF ///< Init value for CRC
|
||||
#define SGP30_WORD_LEN 2 ///< 2 bytes per word
|
||||
|
||||
/**************************************************************************/
|
||||
/*! Class that stores state and functions for interacting with SGP30 Gas Sensor */
|
||||
/**************************************************************************/
|
||||
class Adafruit_SGP30 {
|
||||
public:
|
||||
Adafruit_SGP30();
|
||||
boolean begin(TwoWire *theWire = NULL);
|
||||
boolean IAQinit(void);
|
||||
boolean IAQmeasure(void);
|
||||
|
||||
boolean getIAQBaseline(uint16_t *eco2_base, uint16_t *tvoc_base);
|
||||
boolean setIAQBaseline(uint16_t eco2_base, uint16_t tvoc_base);
|
||||
|
||||
/**
|
||||
* The last measurement of the IAQ-calculated Total Volatile Organic Compounds in ppb. This value is set when you call {@link IAQmeasure()}
|
||||
*/
|
||||
uint16_t TVOC;
|
||||
|
||||
/**
|
||||
* The last measurement of the IAQ-calculated equivalent CO2 in ppm. This value is set when you call {@link IAQmeasure()}
|
||||
*/
|
||||
uint16_t eCO2;
|
||||
|
||||
/**
|
||||
* The 48-bit serial number, this value is set when you call {@link begin()}
|
||||
*/
|
||||
uint16_t serialnumber[3];
|
||||
private:
|
||||
TwoWire *_i2c;
|
||||
uint8_t _i2caddr;
|
||||
|
||||
void write(uint8_t address, uint8_t *data, uint8_t n);
|
||||
void read(uint8_t address, uint8_t *data, uint8_t n);
|
||||
boolean readWordFromCommand(uint8_t command[], uint8_t commandLength, uint16_t delay, uint16_t *readdata = NULL, uint8_t readlen = 0);
|
||||
uint8_t generateCRC(uint8_t data[], uint8_t datalen);
|
||||
};
|
|
@ -0,0 +1,18 @@
|
|||
Adafruit_SGP30
|
||||
================
|
||||
|
||||
This is the Adafruit SGP30 Gas / Air Quality I2C sensor library
|
||||
|
||||
Tested and works great with the Aadafruit SGP30 Breakout Board
|
||||
* http://www.adafruit.com/products/3709
|
||||
|
||||
This chip uses I2C to communicate, 2 pins are required to interface
|
||||
|
||||
Adafruit invests time and resources providing this open source code,
|
||||
please support Adafruit and open-source hardware by purchasing
|
||||
products from Adafruit!
|
||||
|
||||
Written by Limor Fried for Adafruit Industries.
|
||||
BSD license, check license.txt for more information
|
||||
All text above must be included in any redistribution
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
#include <Wire.h>
|
||||
#include "Adafruit_SGP30.h"
|
||||
|
||||
Adafruit_SGP30 sgp;
|
||||
|
||||
void setup() {
|
||||
Serial.begin(9600);
|
||||
Serial.println("SGP30 test");
|
||||
|
||||
if (! sgp.begin()){
|
||||
Serial.println("Sensor not found :(");
|
||||
while (1);
|
||||
}
|
||||
Serial.print("Found SGP30 serial #");
|
||||
Serial.print(sgp.serialnumber[0], HEX);
|
||||
Serial.print(sgp.serialnumber[1], HEX);
|
||||
Serial.println(sgp.serialnumber[2], HEX);
|
||||
|
||||
// If you have a baseline measurement from before you can assign it to start, to 'self-calibrate'
|
||||
//sgp.setIAQBaseline(0x8E68, 0x8F41); // Will vary for each sensor!
|
||||
}
|
||||
|
||||
int counter = 0;
|
||||
void loop() {
|
||||
if (! sgp.IAQmeasure()) {
|
||||
Serial.println("Measurement failed");
|
||||
return;
|
||||
}
|
||||
Serial.print("TVOC "); Serial.print(sgp.TVOC); Serial.print(" ppb\t");
|
||||
Serial.print("eCO2 "); Serial.print(sgp.eCO2); Serial.println(" ppm");
|
||||
delay(1000);
|
||||
|
||||
counter++;
|
||||
if (counter == 30) {
|
||||
counter = 0;
|
||||
|
||||
uint16_t TVOC_base, eCO2_base;
|
||||
if (! sgp.getIAQBaseline(&eCO2_base, &TVOC_base)) {
|
||||
Serial.println("Failed to get baseline readings");
|
||||
return;
|
||||
}
|
||||
Serial.print("****Baseline values: eCO2: 0x"); Serial.print(eCO2_base, HEX);
|
||||
Serial.print(" & TVOC: 0x"); Serial.println(TVOC_base, HEX);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
name=Adafruit SGP30 Sensor
|
||||
version=1.0.2
|
||||
author=Adafruit
|
||||
maintainer=Adafruit <info@adafruit.com>
|
||||
sentence=This is an Arduino library for the Adafruit SGP30 Gas / Air Quality Sensor
|
||||
paragraph=This is an Arduino library for the Adafruit SGP30 Gas / Air Quality Sensor
|
||||
category=Sensors
|
||||
url=https://github.com/adafruit/Adafruit_SGP30
|
||||
architectures=*
|
|
@ -0,0 +1,26 @@
|
|||
Software License Agreement (BSD License)
|
||||
|
||||
Copyright (c) 2012, Adafruit Industries
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. Neither the name of the copyright holders nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@ -0,0 +1,28 @@
|
|||
# C++ objects and libs
|
||||
|
||||
*.slo
|
||||
*.lo
|
||||
*.o
|
||||
#*.a
|
||||
*.la
|
||||
*.lai
|
||||
*.so
|
||||
*.dll
|
||||
*.dylib
|
||||
|
||||
#Makefile
|
||||
*-build-*
|
||||
build-*
|
||||
*.autosave
|
||||
|
||||
# .log files (usually created by QtTest - thanks to VestniK)
|
||||
*.log
|
||||
|
||||
|
||||
# Editors temporary files
|
||||
*~
|
||||
|
||||
|
||||
#OSX
|
||||
.DS_Store
|
||||
._*
|
|
@ -0,0 +1,8 @@
|
|||
MQTT
|
||||
====
|
||||
|
||||
A Wrapper around mqtt for Arduino to be used with esp8266 modules.
|
||||
|
||||
It wraps a slightly modified version of mqtt for esp8266 ported by Tuan PM.
|
||||
Original code for esp: https://github.com/tuanpmt/esp_mqtt
|
||||
Original code for contiki: https://github.com/esar/contiki-mqtt
|
|
@ -0,0 +1,102 @@
|
|||
#include <ESP8266WiFi.h>
|
||||
#include <MQTT.h>
|
||||
|
||||
void myDataCb(String& topic, String& data);
|
||||
void myPublishedCb();
|
||||
void myDisconnectedCb();
|
||||
void myConnectedCb();
|
||||
|
||||
#define CLIENT_ID "client1"
|
||||
|
||||
// create MQTT object
|
||||
MQTT myMqtt(CLIENT_ID, "192.168.0.1", 1883);
|
||||
|
||||
//
|
||||
const char* ssid = "ssid";
|
||||
const char* password = "ssid_password";
|
||||
|
||||
|
||||
//
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
delay(1000);
|
||||
|
||||
Serial.println();
|
||||
Serial.println();
|
||||
Serial.print("Connecting to ");
|
||||
Serial.println(ssid);
|
||||
|
||||
WiFi.begin(ssid, password);
|
||||
|
||||
while (WiFi.status() != WL_CONNECTED) {
|
||||
delay(500);
|
||||
Serial.print(".");
|
||||
}
|
||||
|
||||
Serial.println("");
|
||||
Serial.println("WiFi connected");
|
||||
Serial.println("IP address: ");
|
||||
Serial.println(WiFi.localIP());
|
||||
|
||||
Serial.println("Connecting to MQTT server");
|
||||
|
||||
// setup callbacks
|
||||
myMqtt.onConnected(myConnectedCb);
|
||||
myMqtt.onDisconnected(myDisconnectedCb);
|
||||
myMqtt.onPublished(myPublishedCb);
|
||||
myMqtt.onData(myDataCb);
|
||||
|
||||
Serial.println("connect mqtt...");
|
||||
myMqtt.connect();
|
||||
|
||||
delay(10);
|
||||
}
|
||||
|
||||
//
|
||||
void loop() {
|
||||
|
||||
int value = analogRead(A0);
|
||||
|
||||
String topic("/");
|
||||
topic += CLIENT_ID;
|
||||
topic += "/value";
|
||||
|
||||
String valueStr(value);
|
||||
|
||||
// publish value to topic
|
||||
boolean result = myMqtt.publish(topic, valueStr);
|
||||
|
||||
delay(1000);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
void myConnectedCb()
|
||||
{
|
||||
Serial.println("connected to MQTT server");
|
||||
}
|
||||
|
||||
void myDisconnectedCb()
|
||||
{
|
||||
Serial.println("disconnected. try to reconnect...");
|
||||
delay(500);
|
||||
myMqtt.connect();
|
||||
}
|
||||
|
||||
void myPublishedCb()
|
||||
{
|
||||
//Serial.println("published.");
|
||||
}
|
||||
|
||||
void myDataCb(String& topic, String& data)
|
||||
{
|
||||
|
||||
Serial.print(topic);
|
||||
Serial.print(": ");
|
||||
Serial.println(data);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,97 @@
|
|||
#include <ESP8266WiFi.h>
|
||||
#include <TasmotaMqtt.h>
|
||||
|
||||
// This needs testing
|
||||
|
||||
void myDataCb(char* topic, uint8_t* data, unsigned int data_len);
|
||||
void myPublishedCb();
|
||||
void myDisconnectedCb();
|
||||
void myConnectedCb();
|
||||
|
||||
#define CLIENT_ID "client3"
|
||||
#define TOPIC "/client1/value"
|
||||
|
||||
// create MQTT
|
||||
TasmotaMqtt myMqtt();
|
||||
|
||||
const char* ssid = "ssid";
|
||||
const char* password = "ssid_password";
|
||||
|
||||
//
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
delay(1000);
|
||||
|
||||
Serial.println();
|
||||
Serial.println();
|
||||
Serial.print("Connecting to ");
|
||||
Serial.println(ssid);
|
||||
|
||||
WiFi.begin(ssid, password);
|
||||
|
||||
while (WiFi.status() != WL_CONNECTED) {
|
||||
delay(500);
|
||||
Serial.print(".");
|
||||
}
|
||||
|
||||
Serial.println("");
|
||||
Serial.println("WiFi connected");
|
||||
Serial.println("IP address: ");
|
||||
Serial.println(WiFi.localIP());
|
||||
|
||||
|
||||
Serial.println("Connecting to MQTT server");
|
||||
|
||||
myMqtt.InitConnection("192.168.0.1", 1883);
|
||||
myMqtt.InitClient(CLIENT_ID, "", "");
|
||||
myMqtt.InitLWT("/lwt", "offline");
|
||||
|
||||
// setup callbacks
|
||||
myMqtt.OnConnected(myConnectedCb);
|
||||
myMqtt.OnDisconnected(myDisconnectedCb);
|
||||
myMqtt.OnPublished(myPublishedCb);
|
||||
myMqtt.OnData(myDataCb);
|
||||
|
||||
Serial.println("connect mqtt...");
|
||||
myMqtt.Connect();
|
||||
|
||||
Serial.println("subscribe to topic...");
|
||||
myMqtt.Subscribe(TOPIC);
|
||||
|
||||
delay(10);
|
||||
}
|
||||
|
||||
//
|
||||
void loop() {
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
void myConnectedCb()
|
||||
{
|
||||
Serial.println("connected to MQTT server");
|
||||
}
|
||||
|
||||
void myDisconnectedCb()
|
||||
{
|
||||
Serial.println("disconnected. try to reconnect...");
|
||||
delay(500);
|
||||
myMqtt.Connect();
|
||||
}
|
||||
|
||||
void myPublishedCb()
|
||||
{
|
||||
//Serial.println("published.");
|
||||
}
|
||||
|
||||
void myDataCb(char* topic, uint8_t* data, unsigned int data_len)
|
||||
{
|
||||
Serial.print(topic);
|
||||
Serial.print(": ");
|
||||
Serial.println(data);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
#######################################
|
||||
# Syntax Coloring Map For Test
|
||||
#######################################
|
||||
|
||||
#######################################
|
||||
# Datatypes (KEYWORD1)
|
||||
#######################################
|
||||
|
||||
TasmotaMqtt.h KEYWORD1
|
||||
TasmotaMqtt KEYWORD1
|
||||
|
||||
#######################################
|
||||
# Methods and Functions (KEYWORD2)
|
||||
#######################################
|
||||
|
||||
InitConnection KEYWORD2
|
||||
InitClient KEYWORD2
|
||||
InitLWT KEYWORD2
|
||||
|
||||
Connect KEYWORD2
|
||||
Disconnect KEYWORD2
|
||||
Connected KEYWORD2
|
||||
|
||||
Publish KEYWORD2
|
||||
Subscribe KEYWORD2
|
||||
|
||||
#general
|
||||
OnConnected KEYWORD2
|
||||
OnDisconnected KEYWORD2
|
||||
OnData KEYWORD2
|
||||
|
||||
#######################################
|
||||
# Instances (KEYWORD2)
|
||||
#######################################
|
||||
|
||||
#######################################
|
||||
# Constants (LITERAL1)
|
||||
#######################################
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
name=TasmotaMqtt
|
||||
version=1.0.0
|
||||
author=Theo Arends
|
||||
maintainer=Theo Arends <theo@arends.com>
|
||||
sentence=A Wrapper around mqtt for Arduino to be used with esp8266 modules.
|
||||
paragraph=It wraps a slightly modified version of mqtt for esp8266 ported by Tuan PM. Original code for esp: https://github.com/tuanpmt/esp_mqtt Original code for contiki: https://github.com/esar/contiki-mqtt
|
||||
category=Communication
|
||||
url=
|
||||
architectures=esp8266
|
|
@ -0,0 +1,194 @@
|
|||
/*
|
||||
TasmotaMqtt.cpp - Wrapper for mqtt for esp8266 by Tuan PM for Tasmota
|
||||
|
||||
Copyright (C) 2018 Theo Arends and Ingo Randolf
|
||||
|
||||
This library is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "TasmotaMqtt.h"
|
||||
|
||||
#include "user_interface.h"
|
||||
#include "osapi.h"
|
||||
#include "os_type.h"
|
||||
|
||||
/*********************************************************************************************\
|
||||
* Prerequisite
|
||||
*
|
||||
* Copy .c and .h files from https://github.com/tuanpmt/esp_mqtt folder mqtt to folder mqtt
|
||||
* - Replace BOOL with bool
|
||||
* - Remove variables certificate and private_key from file mqtt.c
|
||||
* - Add file user_config.h with default defines for
|
||||
* MQTT_BUF_SIZE 256, MQTT_RECONNECT_TIMEOUT 5, QUEUE_BUFFER_SIZE 2048 and PROTOCOL_NAMEv311
|
||||
\*********************************************************************************************/
|
||||
|
||||
/*********************************************************************************************\
|
||||
* Mqtt internal callbacks
|
||||
\*********************************************************************************************/
|
||||
|
||||
static void mqttConnectedCb(uint32_t *args)
|
||||
{
|
||||
MQTT_Client* client = (MQTT_Client*)args;
|
||||
TasmotaMqtt* _this = (TasmotaMqtt*)client->user_data;
|
||||
if (_this && _this->onMqttConnectedCb) _this->onMqttConnectedCb();
|
||||
}
|
||||
|
||||
static void mqttDisconnectedCb(uint32_t *args)
|
||||
{
|
||||
MQTT_Client* client = (MQTT_Client*)args;
|
||||
TasmotaMqtt* _this = (TasmotaMqtt*)client->user_data;
|
||||
if (_this && _this->onMqttDisconnectedCb) _this->onMqttDisconnectedCb();
|
||||
}
|
||||
|
||||
static void mqttPublishedCb(uint32_t *args)
|
||||
{
|
||||
MQTT_Client* client = (MQTT_Client*)args;
|
||||
TasmotaMqtt* _this = (TasmotaMqtt*)client->user_data;
|
||||
if (_this && _this->onMqttPublishedCb) _this->onMqttPublishedCb();
|
||||
}
|
||||
|
||||
static void mqttTimeoutCb(uint32_t *args)
|
||||
{
|
||||
MQTT_Client* client = (MQTT_Client*)args;
|
||||
TasmotaMqtt* _this = (TasmotaMqtt*)client->user_data;
|
||||
if (_this && _this->onMqttTimeoutCb) _this->onMqttTimeoutCb();
|
||||
}
|
||||
|
||||
static void mqttDataCb(uint32_t *args, const char* topic, uint32_t topic_len, const char *data, uint32_t data_len)
|
||||
{
|
||||
MQTT_Client* client = (MQTT_Client*)args;
|
||||
TasmotaMqtt* _this = (TasmotaMqtt*)client->user_data;
|
||||
if (_this) _this->_onMqttDataCb(topic, topic_len, data, data_len);
|
||||
}
|
||||
|
||||
/*********************************************************************************************\
|
||||
* TasmotaMqtt class implementation
|
||||
\*********************************************************************************************/
|
||||
|
||||
TasmotaMqtt::TasmotaMqtt() :
|
||||
onMqttConnectedCb(0),
|
||||
onMqttDisconnectedCb(0),
|
||||
onMqttPublishedCb(0),
|
||||
onMqttTimeoutCb(0),
|
||||
onMqttDataCb(0)
|
||||
{
|
||||
}
|
||||
|
||||
TasmotaMqtt::~TasmotaMqtt()
|
||||
{
|
||||
MQTT_DeleteClient(&mqttClient);
|
||||
}
|
||||
|
||||
void TasmotaMqtt::InitConnection(const char* host, uint32_t port, uint8_t security)
|
||||
{
|
||||
MQTT_InitConnection(&mqttClient, (uint8_t*)host, port, security);
|
||||
|
||||
// set user data
|
||||
mqttClient.user_data = (void*)this;
|
||||
|
||||
MQTT_OnConnected(&mqttClient, mqttConnectedCb);
|
||||
MQTT_OnDisconnected(&mqttClient, mqttDisconnectedCb);
|
||||
MQTT_OnPublished(&mqttClient, mqttPublishedCb);
|
||||
MQTT_OnTimeout(&mqttClient, mqttTimeoutCb);
|
||||
MQTT_OnData(&mqttClient, mqttDataCb);
|
||||
}
|
||||
|
||||
void TasmotaMqtt::InitClient(const char* client_id, const char* client_user, const char* client_pass, uint32_t keep_alive_time, uint8_t clean_session)
|
||||
{
|
||||
MQTT_InitClient(&mqttClient, (uint8_t*)client_id, (uint8_t*)client_user, (uint8_t*)client_pass, keep_alive_time, clean_session);
|
||||
}
|
||||
|
||||
void TasmotaMqtt::DeleteClient()
|
||||
{
|
||||
MQTT_DeleteClient(&mqttClient);
|
||||
}
|
||||
|
||||
void TasmotaMqtt::InitLWT(const char* will_topic, const char* will_msg, uint8_t will_qos, bool will_retain)
|
||||
{
|
||||
MQTT_InitLWT(&mqttClient, (uint8_t*)will_topic, (uint8_t*)will_msg, will_qos, (uint8_t)will_retain);
|
||||
}
|
||||
|
||||
void TasmotaMqtt::OnConnected( void (*function)(void) )
|
||||
{
|
||||
onMqttConnectedCb = function;
|
||||
}
|
||||
|
||||
void TasmotaMqtt::OnDisconnected( void (*function)(void) )
|
||||
{
|
||||
onMqttDisconnectedCb = function;
|
||||
}
|
||||
|
||||
void TasmotaMqtt::OnPublished( void (*function)(void) )
|
||||
{
|
||||
onMqttPublishedCb = function;
|
||||
}
|
||||
|
||||
void TasmotaMqtt::OnTimeout( void (*function)(void) )
|
||||
{
|
||||
onMqttTimeoutCb = function;
|
||||
}
|
||||
|
||||
void TasmotaMqtt::OnData( void (*function)(char*, uint8_t*, unsigned int) )
|
||||
{
|
||||
onMqttDataCb = function;
|
||||
}
|
||||
|
||||
bool TasmotaMqtt::Subscribe(const char* topic, uint8_t qos)
|
||||
{
|
||||
return MQTT_Subscribe(&mqttClient, (char*)topic, qos);
|
||||
}
|
||||
|
||||
bool TasmotaMqtt::Unsubscribe(const char* topic)
|
||||
{
|
||||
return MQTT_UnSubscribe(&mqttClient, (char*)topic);
|
||||
}
|
||||
|
||||
void TasmotaMqtt::Connect()
|
||||
{
|
||||
MQTT_Connect(&mqttClient);
|
||||
}
|
||||
|
||||
void TasmotaMqtt::Connect(const char* client_id, const char* client_user, const char* client_pass, const char* will_topic, const char* will_msg, uint8_t will_qos, bool will_retain)
|
||||
{
|
||||
MQTT_InitClient(&mqttClient, (uint8_t*)client_id, (uint8_t*)client_user, (uint8_t*)client_pass, MQTT_KEEPALIVE, 1);
|
||||
MQTT_InitLWT(&mqttClient, (uint8_t*)will_topic, (uint8_t*)will_msg, will_qos, (uint8_t)will_retain);
|
||||
MQTT_Connect(&mqttClient);
|
||||
}
|
||||
|
||||
void TasmotaMqtt::Disconnect()
|
||||
{
|
||||
MQTT_Disconnect(&mqttClient);
|
||||
}
|
||||
|
||||
bool TasmotaMqtt::Publish(const char* topic, const char* data, int data_length, int qos, bool retain)
|
||||
{
|
||||
return MQTT_Publish(&mqttClient, topic, data, data_length, qos, (int)retain);
|
||||
}
|
||||
|
||||
bool TasmotaMqtt::Connected()
|
||||
{
|
||||
return (mqttClient.connState > TCP_CONNECTED);
|
||||
}
|
||||
|
||||
/*********************************************************************************************/
|
||||
|
||||
void TasmotaMqtt::_onMqttDataCb(const char* topic, uint32_t topic_len, const char* data, uint32_t data_len)
|
||||
{
|
||||
char topic_copy[topic_len +1];
|
||||
|
||||
memcpy(topic_copy, topic, topic_len);
|
||||
topic_copy[topic_len] = 0;
|
||||
if (0 == data_len) data = (const char*)&topic_copy + topic_len;
|
||||
onMqttDataCb((char*)topic_copy, (byte*)data, data_len);
|
||||
}
|
|
@ -0,0 +1,88 @@
|
|||
/*
|
||||
TasmotaMqtt.h - Wrapper for mqtt for esp8266 by Tuan PM for Tasmota
|
||||
|
||||
Copyright (C) 2018 Theo Arends and Ingo Randolf
|
||||
|
||||
This library is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef TasmotaMqtt_h
|
||||
#define TasmotaMqtt_h
|
||||
/*********************************************************************************************\
|
||||
* TasmotaMqtt supports currently only non-TLS MQTT
|
||||
*
|
||||
* Adapted from esp-mqtt-arduino by Ingo Randolf (https://github.com/i-n-g-o/esp-mqtt-arduino)
|
||||
\*********************************************************************************************/
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
|
||||
extern "C" {
|
||||
#include <stddef.h>
|
||||
#include "mqtt/mqtt.h"
|
||||
}
|
||||
|
||||
// MQTT_KEEPALIVE : keepAlive interval in Seconds
|
||||
#ifndef MQTT_KEEPALIVE
|
||||
#define MQTT_KEEPALIVE 15
|
||||
#endif
|
||||
|
||||
class TasmotaMqtt {
|
||||
public:
|
||||
TasmotaMqtt();
|
||||
~TasmotaMqtt();
|
||||
|
||||
void InitConnection(const char* host, uint32_t port, uint8_t security = 0);
|
||||
void InitClient(const char* client_id, const char* client_user, const char* client_pass, uint32_t keep_alive_time = MQTT_KEEPALIVE, uint8_t clean_session = 1);
|
||||
void DeleteClient();
|
||||
void InitLWT(const char* will_topic, const char* will_msg, uint8_t will_qos = 0, bool will_retain = false);
|
||||
|
||||
void OnConnected( void (*)(void) );
|
||||
void OnDisconnected( void (*)(void) );
|
||||
void OnPublished( void (*)(void) );
|
||||
void OnTimeout( void (*)(void) );
|
||||
void OnData( void (*)(char*, uint8_t*, unsigned int) );
|
||||
|
||||
bool Subscribe(const char* topic, uint8_t qos = 0);
|
||||
bool Unsubscribe(const char* topic);
|
||||
|
||||
void Connect();
|
||||
void Connect(const char* client_id, const char* client_user, const char* client_pass, const char* will_topic, const char* will_msg, uint8_t will_qos = 0, bool will_retain = false);
|
||||
void Disconnect();
|
||||
|
||||
bool Publish(const char* topic, const char* data, int data_length, int qos = 0, bool retain = false);
|
||||
|
||||
bool Connected();
|
||||
|
||||
int State() { return mqttClient.connState; };
|
||||
|
||||
void (*onMqttConnectedCb)(void);
|
||||
void (*onMqttDisconnectedCb)(void);
|
||||
void (*onMqttPublishedCb)(void);
|
||||
void (*onMqttTimeoutCb)(void);
|
||||
void (*onMqttDataCb) (char*, uint8_t*, unsigned int);
|
||||
|
||||
// internal callback
|
||||
void _onMqttDataCb(const char*, uint32_t, const char*, uint32_t);
|
||||
|
||||
private:
|
||||
MQTT_Client mqttClient;
|
||||
};
|
||||
|
||||
#endif // TasmotaMqtt_h
|
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* debug.h
|
||||
*
|
||||
* Created on: Dec 4, 2014
|
||||
* Author: Minh
|
||||
*/
|
||||
|
||||
#ifndef USER_DEBUG_H_
|
||||
#define USER_DEBUG_H_
|
||||
|
||||
|
||||
#if defined(MQTT_DEBUG_ON)
|
||||
#define MQTT_INFO( format, ... ) os_printf( format, ## __VA_ARGS__ )
|
||||
#else
|
||||
#define MQTT_INFO( format, ... )
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* USER_DEBUG_H_ */
|
|
@ -0,0 +1,997 @@
|
|||
/* mqtt.c
|
||||
* Protocol: http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html
|
||||
*
|
||||
* Copyright (c) 2014-2015, Tuan PM <tuanpm at live dot com>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of Redis nor the names of its contributors may be used
|
||||
* to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "user_interface.h"
|
||||
#include "osapi.h"
|
||||
#include "espconn.h"
|
||||
#include "os_type.h"
|
||||
#include "mem.h"
|
||||
#include "mqtt_msg.h"
|
||||
#include "debug.h"
|
||||
#include "user_config.h"
|
||||
#include "mqtt.h"
|
||||
#include "queue.h"
|
||||
|
||||
#define MQTT_TASK_PRIO 2
|
||||
#define MQTT_TASK_QUEUE_SIZE 1
|
||||
#define MQTT_SEND_TIMOUT 5
|
||||
|
||||
#ifndef MQTT_SSL_SIZE
|
||||
#define MQTT_SSL_SIZE 5120
|
||||
#endif
|
||||
|
||||
#ifndef QUEUE_BUFFER_SIZE
|
||||
#define QUEUE_BUFFER_SIZE 2048
|
||||
#endif
|
||||
|
||||
/*
|
||||
unsigned char *default_certificate;
|
||||
unsigned int default_certificate_len = 0;
|
||||
unsigned char *default_private_key;
|
||||
unsigned int default_private_key_len = 0;
|
||||
*/
|
||||
|
||||
os_event_t mqtt_procTaskQueue[MQTT_TASK_QUEUE_SIZE];
|
||||
|
||||
#ifdef PROTOCOL_NAMEv311
|
||||
LOCAL uint8_t zero_len_id[2] = { 0, 0 };
|
||||
#endif
|
||||
|
||||
LOCAL void ICACHE_FLASH_ATTR
|
||||
mqtt_dns_found(const char *name, ip_addr_t *ipaddr, void *arg)
|
||||
{
|
||||
struct espconn *pConn = (struct espconn *)arg;
|
||||
MQTT_Client* client = (MQTT_Client *)pConn->reverse;
|
||||
|
||||
|
||||
if (ipaddr == NULL)
|
||||
{
|
||||
MQTT_INFO("DNS: Found, but got no ip, try to reconnect\r\n");
|
||||
client->connState = TCP_RECONNECT_REQ;
|
||||
return;
|
||||
}
|
||||
|
||||
MQTT_INFO("DNS: found ip %d.%d.%d.%d\n",
|
||||
*((uint8 *) &ipaddr->addr),
|
||||
*((uint8 *) &ipaddr->addr + 1),
|
||||
*((uint8 *) &ipaddr->addr + 2),
|
||||
*((uint8 *) &ipaddr->addr + 3));
|
||||
|
||||
if (client->ip.addr == 0 && ipaddr->addr != 0)
|
||||
{
|
||||
os_memcpy(client->pCon->proto.tcp->remote_ip, &ipaddr->addr, 4);
|
||||
if (client->security) {
|
||||
#ifdef MQTT_SSL_ENABLE
|
||||
espconn_secure_set_size(ESPCONN_CLIENT, MQTT_SSL_SIZE);
|
||||
espconn_secure_connect(client->pCon);
|
||||
#else
|
||||
MQTT_INFO("TCP: Do not support SSL\r\n");
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
espconn_connect(client->pCon);
|
||||
}
|
||||
|
||||
client->connState = TCP_CONNECTING;
|
||||
MQTT_INFO("TCP: connecting...\r\n");
|
||||
}
|
||||
|
||||
system_os_post(MQTT_TASK_PRIO, 0, (os_param_t)client);
|
||||
}
|
||||
|
||||
|
||||
|
||||
LOCAL void ICACHE_FLASH_ATTR
|
||||
deliver_publish(MQTT_Client* client, uint8_t* message, int length)
|
||||
{
|
||||
mqtt_event_data_t event_data;
|
||||
|
||||
event_data.topic_length = length;
|
||||
event_data.topic = mqtt_get_publish_topic(message, &event_data.topic_length);
|
||||
event_data.data_length = length;
|
||||
event_data.data = mqtt_get_publish_data(message, &event_data.data_length);
|
||||
|
||||
if (client->dataCb)
|
||||
client->dataCb((uint32_t*)client, event_data.topic, event_data.topic_length, event_data.data, event_data.data_length);
|
||||
|
||||
}
|
||||
|
||||
void ICACHE_FLASH_ATTR
|
||||
mqtt_send_keepalive(MQTT_Client *client)
|
||||
{
|
||||
MQTT_INFO("\r\nMQTT: Send keepalive packet to %s:%d!\r\n", client->host, client->port);
|
||||
client->mqtt_state.outbound_message = mqtt_msg_pingreq(&client->mqtt_state.mqtt_connection);
|
||||
client->mqtt_state.pending_msg_type = MQTT_MSG_TYPE_PINGREQ;
|
||||
client->mqtt_state.pending_msg_type = mqtt_get_type(client->mqtt_state.outbound_message->data);
|
||||
client->mqtt_state.pending_msg_id = mqtt_get_id(client->mqtt_state.outbound_message->data, client->mqtt_state.outbound_message->length);
|
||||
|
||||
|
||||
client->sendTimeout = MQTT_SEND_TIMOUT;
|
||||
MQTT_INFO("MQTT: Sending, type: %d, id: %04X\r\n", client->mqtt_state.pending_msg_type, client->mqtt_state.pending_msg_id);
|
||||
err_t result = ESPCONN_OK;
|
||||
if (client->security) {
|
||||
#ifdef MQTT_SSL_ENABLE
|
||||
result = espconn_secure_send(client->pCon, client->mqtt_state.outbound_message->data, client->mqtt_state.outbound_message->length);
|
||||
#else
|
||||
MQTT_INFO("TCP: Do not support SSL\r\n");
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
result = espconn_send(client->pCon, client->mqtt_state.outbound_message->data, client->mqtt_state.outbound_message->length);
|
||||
}
|
||||
|
||||
client->mqtt_state.outbound_message = NULL;
|
||||
if (ESPCONN_OK == result) {
|
||||
client->keepAliveTick = 0;
|
||||
client->connState = MQTT_DATA;
|
||||
system_os_post(MQTT_TASK_PRIO, 0, (os_param_t)client);
|
||||
}
|
||||
else {
|
||||
client->connState = TCP_RECONNECT_DISCONNECTING;
|
||||
system_os_post(MQTT_TASK_PRIO, 0, (os_param_t)client);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Delete tcp client and free all memory
|
||||
* @param mqttClient: The mqtt client which contain TCP client
|
||||
* @retval None
|
||||
*/
|
||||
void ICACHE_FLASH_ATTR
|
||||
mqtt_tcpclient_delete(MQTT_Client *mqttClient)
|
||||
{
|
||||
if (mqttClient->pCon != NULL) {
|
||||
MQTT_INFO("TCP: Free memory\r\n");
|
||||
// Force abort connections
|
||||
espconn_abort(mqttClient->pCon);
|
||||
// Delete connections
|
||||
espconn_delete(mqttClient->pCon);
|
||||
|
||||
if (mqttClient->pCon->proto.tcp) {
|
||||
os_free(mqttClient->pCon->proto.tcp);
|
||||
mqttClient->pCon->proto.tcp = NULL;
|
||||
}
|
||||
os_free(mqttClient->pCon);
|
||||
mqttClient->pCon = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Delete MQTT client and free all memory
|
||||
* @param mqttClient: The mqtt client
|
||||
* @retval None
|
||||
*/
|
||||
void ICACHE_FLASH_ATTR
|
||||
mqtt_client_delete(MQTT_Client *mqttClient)
|
||||
{
|
||||
if (mqttClient == NULL)
|
||||
return;
|
||||
|
||||
if (mqttClient->pCon != NULL) {
|
||||
mqtt_tcpclient_delete(mqttClient);
|
||||
}
|
||||
|
||||
if (mqttClient->host != NULL) {
|
||||
os_free(mqttClient->host);
|
||||
mqttClient->host = NULL;
|
||||
}
|
||||
|
||||
if (mqttClient->user_data != NULL) {
|
||||
os_free(mqttClient->user_data);
|
||||
mqttClient->user_data = NULL;
|
||||
}
|
||||
|
||||
if (mqttClient->mqtt_state.in_buffer != NULL) {
|
||||
os_free(mqttClient->mqtt_state.in_buffer);
|
||||
mqttClient->mqtt_state.in_buffer = NULL;
|
||||
}
|
||||
|
||||
if (mqttClient->mqtt_state.out_buffer != NULL) {
|
||||
os_free(mqttClient->mqtt_state.out_buffer);
|
||||
mqttClient->mqtt_state.out_buffer = NULL;
|
||||
}
|
||||
|
||||
if (mqttClient->mqtt_state.outbound_message != NULL) {
|
||||
if (mqttClient->mqtt_state.outbound_message->data != NULL)
|
||||
{
|
||||
os_free(mqttClient->mqtt_state.outbound_message->data);
|
||||
mqttClient->mqtt_state.outbound_message->data = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (mqttClient->mqtt_state.mqtt_connection.buffer != NULL) {
|
||||
// Already freed but not NULL
|
||||
mqttClient->mqtt_state.mqtt_connection.buffer = NULL;
|
||||
}
|
||||
|
||||
if (mqttClient->connect_info.client_id != NULL) {
|
||||
#ifdef PROTOCOL_NAMEv311
|
||||
/* Don't attempt to free if it's the zero_len array */
|
||||
if ( ((uint8_t*)mqttClient->connect_info.client_id) != zero_len_id )
|
||||
os_free(mqttClient->connect_info.client_id);
|
||||
#else
|
||||
os_free(mqttClient->connect_info.client_id);
|
||||
#endif
|
||||
mqttClient->connect_info.client_id = NULL;
|
||||
}
|
||||
|
||||
if (mqttClient->connect_info.username != NULL) {
|
||||
os_free(mqttClient->connect_info.username);
|
||||
mqttClient->connect_info.username = NULL;
|
||||
}
|
||||
|
||||
if (mqttClient->connect_info.password != NULL) {
|
||||
os_free(mqttClient->connect_info.password);
|
||||
mqttClient->connect_info.password = NULL;
|
||||
}
|
||||
|
||||
if (mqttClient->connect_info.will_topic != NULL) {
|
||||
os_free(mqttClient->connect_info.will_topic);
|
||||
mqttClient->connect_info.will_topic = NULL;
|
||||
}
|
||||
|
||||
if (mqttClient->connect_info.will_message != NULL) {
|
||||
os_free(mqttClient->connect_info.will_message);
|
||||
mqttClient->connect_info.will_message = NULL;
|
||||
}
|
||||
|
||||
if (mqttClient->msgQueue.buf != NULL) {
|
||||
os_free(mqttClient->msgQueue.buf);
|
||||
mqttClient->msgQueue.buf = NULL;
|
||||
}
|
||||
|
||||
// Initialize state
|
||||
mqttClient->connState = WIFI_INIT;
|
||||
// Clear callback functions to avoid abnormal callback
|
||||
mqttClient->connectedCb = NULL;
|
||||
mqttClient->disconnectedCb = NULL;
|
||||
mqttClient->publishedCb = NULL;
|
||||
mqttClient->timeoutCb = NULL;
|
||||
mqttClient->dataCb = NULL;
|
||||
|
||||
MQTT_INFO("MQTT: client already deleted\r\n");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Client received callback function.
|
||||
* @param arg: contain the ip link information
|
||||
* @param pdata: received data
|
||||
* @param len: the lenght of received data
|
||||
* @retval None
|
||||
*/
|
||||
void ICACHE_FLASH_ATTR
|
||||
mqtt_tcpclient_recv(void *arg, char *pdata, unsigned short len)
|
||||
{
|
||||
uint8_t msg_type;
|
||||
uint8_t msg_qos;
|
||||
uint16_t msg_id;
|
||||
uint8_t msg_conn_ret;
|
||||
|
||||
struct espconn *pCon = (struct espconn*)arg;
|
||||
MQTT_Client *client = (MQTT_Client *)pCon->reverse;
|
||||
|
||||
READPACKET:
|
||||
MQTT_INFO("TCP: data received %d bytes\r\n", len);
|
||||
// MQTT_INFO("STATE: %d\r\n", client->connState);
|
||||
if (len < MQTT_BUF_SIZE && len > 0) {
|
||||
os_memcpy(client->mqtt_state.in_buffer, pdata, len);
|
||||
|
||||
msg_type = mqtt_get_type(client->mqtt_state.in_buffer);
|
||||
msg_qos = mqtt_get_qos(client->mqtt_state.in_buffer);
|
||||
msg_id = mqtt_get_id(client->mqtt_state.in_buffer, client->mqtt_state.in_buffer_length);
|
||||
switch (client->connState) {
|
||||
case MQTT_CONNECT_SENDING:
|
||||
if (msg_type == MQTT_MSG_TYPE_CONNACK) {
|
||||
if (client->mqtt_state.pending_msg_type != MQTT_MSG_TYPE_CONNECT) {
|
||||
MQTT_INFO("MQTT: Invalid packet\r\n");
|
||||
if (client->security) {
|
||||
#ifdef MQTT_SSL_ENABLE
|
||||
espconn_secure_disconnect(client->pCon);
|
||||
#else
|
||||
MQTT_INFO("TCP: Do not support SSL\r\n");
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
espconn_disconnect(client->pCon);
|
||||
}
|
||||
} else {
|
||||
msg_conn_ret = mqtt_get_connect_return_code(client->mqtt_state.in_buffer);
|
||||
switch (msg_conn_ret) {
|
||||
case CONNECTION_ACCEPTED:
|
||||
MQTT_INFO("MQTT: Connected to %s:%d\r\n", client->host, client->port);
|
||||
client->connState = MQTT_DATA;
|
||||
if (client->connectedCb)
|
||||
client->connectedCb((uint32_t*)client);
|
||||
break;
|
||||
case CONNECTION_REFUSE_PROTOCOL:
|
||||
case CONNECTION_REFUSE_SERVER_UNAVAILABLE:
|
||||
case CONNECTION_REFUSE_BAD_USERNAME:
|
||||
case CONNECTION_REFUSE_NOT_AUTHORIZED:
|
||||
MQTT_INFO("MQTT: Connection refuse, reason code: %d\r\n", msg_conn_ret);
|
||||
default:
|
||||
if (client->security) {
|
||||
#ifdef MQTT_SSL_ENABLE
|
||||
espconn_secure_disconnect(client->pCon);
|
||||
#else
|
||||
MQTT_INFO("TCP: Do not support SSL\r\n");
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
espconn_disconnect(client->pCon);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case MQTT_DATA:
|
||||
case MQTT_KEEPALIVE_SEND:
|
||||
client->mqtt_state.message_length_read = len;
|
||||
client->mqtt_state.message_length = mqtt_get_total_length(client->mqtt_state.in_buffer, client->mqtt_state.message_length_read);
|
||||
|
||||
|
||||
switch (msg_type)
|
||||
{
|
||||
|
||||
case MQTT_MSG_TYPE_SUBACK:
|
||||
if (client->mqtt_state.pending_msg_type == MQTT_MSG_TYPE_SUBSCRIBE && client->mqtt_state.pending_msg_id == msg_id)
|
||||
MQTT_INFO("MQTT: Subscribe successful\r\n");
|
||||
break;
|
||||
case MQTT_MSG_TYPE_UNSUBACK:
|
||||
if (client->mqtt_state.pending_msg_type == MQTT_MSG_TYPE_UNSUBSCRIBE && client->mqtt_state.pending_msg_id == msg_id)
|
||||
MQTT_INFO("MQTT: UnSubscribe successful\r\n");
|
||||
break;
|
||||
case MQTT_MSG_TYPE_PUBLISH:
|
||||
if (msg_qos == 1)
|
||||
client->mqtt_state.outbound_message = mqtt_msg_puback(&client->mqtt_state.mqtt_connection, msg_id);
|
||||
else if (msg_qos == 2)
|
||||
client->mqtt_state.outbound_message = mqtt_msg_pubrec(&client->mqtt_state.mqtt_connection, msg_id);
|
||||
if (msg_qos == 1 || msg_qos == 2) {
|
||||
MQTT_INFO("MQTT: Queue response QoS: %d\r\n", msg_qos);
|
||||
if (QUEUE_Puts(&client->msgQueue, client->mqtt_state.outbound_message->data, client->mqtt_state.outbound_message->length) == -1) {
|
||||
MQTT_INFO("MQTT: Queue full\r\n");
|
||||
}
|
||||
}
|
||||
|
||||
deliver_publish(client, client->mqtt_state.in_buffer, client->mqtt_state.message_length_read);
|
||||
break;
|
||||
case MQTT_MSG_TYPE_PUBACK:
|
||||
if (client->mqtt_state.pending_msg_type == MQTT_MSG_TYPE_PUBLISH && client->mqtt_state.pending_msg_id == msg_id) {
|
||||
MQTT_INFO("MQTT: received MQTT_MSG_TYPE_PUBACK, finish QoS1 publish\r\n");
|
||||
}
|
||||
|
||||
break;
|
||||
case MQTT_MSG_TYPE_PUBREC:
|
||||
client->mqtt_state.outbound_message = mqtt_msg_pubrel(&client->mqtt_state.mqtt_connection, msg_id);
|
||||
if (QUEUE_Puts(&client->msgQueue, client->mqtt_state.outbound_message->data, client->mqtt_state.outbound_message->length) == -1) {
|
||||
MQTT_INFO("MQTT: Queue full\r\n");
|
||||
}
|
||||
break;
|
||||
case MQTT_MSG_TYPE_PUBREL:
|
||||
client->mqtt_state.outbound_message = mqtt_msg_pubcomp(&client->mqtt_state.mqtt_connection, msg_id);
|
||||
if (QUEUE_Puts(&client->msgQueue, client->mqtt_state.outbound_message->data, client->mqtt_state.outbound_message->length) == -1) {
|
||||
MQTT_INFO("MQTT: Queue full\r\n");
|
||||
}
|
||||
break;
|
||||
case MQTT_MSG_TYPE_PUBCOMP:
|
||||
if (client->mqtt_state.pending_msg_type == MQTT_MSG_TYPE_PUBLISH && client->mqtt_state.pending_msg_id == msg_id) {
|
||||
MQTT_INFO("MQTT: receive MQTT_MSG_TYPE_PUBCOMP, finish QoS2 publish\r\n");
|
||||
}
|
||||
break;
|
||||
case MQTT_MSG_TYPE_PINGREQ:
|
||||
client->mqtt_state.outbound_message = mqtt_msg_pingresp(&client->mqtt_state.mqtt_connection);
|
||||
if (QUEUE_Puts(&client->msgQueue, client->mqtt_state.outbound_message->data, client->mqtt_state.outbound_message->length) == -1) {
|
||||
MQTT_INFO("MQTT: Queue full\r\n");
|
||||
}
|
||||
break;
|
||||
case MQTT_MSG_TYPE_PINGRESP:
|
||||
// Ignore
|
||||
break;
|
||||
}
|
||||
// NOTE: this is done down here and not in the switch case above
|
||||
// because the PSOCK_READBUF_LEN() won't work inside a switch
|
||||
// statement due to the way protothreads resume.
|
||||
if (msg_type == MQTT_MSG_TYPE_PUBLISH)
|
||||
{
|
||||
len = client->mqtt_state.message_length_read;
|
||||
|
||||
if (client->mqtt_state.message_length < client->mqtt_state.message_length_read)
|
||||
{
|
||||
//client->connState = MQTT_PUBLISH_RECV;
|
||||
//Not Implement yet
|
||||
len -= client->mqtt_state.message_length;
|
||||
pdata += client->mqtt_state.message_length;
|
||||
|
||||
MQTT_INFO("Get another published message\r\n");
|
||||
goto READPACKET;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
MQTT_INFO("ERROR: Message too long\r\n");
|
||||
}
|
||||
system_os_post(MQTT_TASK_PRIO, 0, (os_param_t)client);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Client send over callback function.
|
||||
* @param arg: contain the ip link information
|
||||
* @retval None
|
||||
*/
|
||||
void ICACHE_FLASH_ATTR
|
||||
mqtt_tcpclient_sent_cb(void *arg)
|
||||
{
|
||||
struct espconn *pCon = (struct espconn *)arg;
|
||||
MQTT_Client* client = (MQTT_Client *)pCon->reverse;
|
||||
MQTT_INFO("TCP: Sent\r\n");
|
||||
client->sendTimeout = 0;
|
||||
client->keepAliveTick = 0;
|
||||
|
||||
if ((client->connState == MQTT_DATA || client->connState == MQTT_KEEPALIVE_SEND)
|
||||
&& client->mqtt_state.pending_msg_type == MQTT_MSG_TYPE_PUBLISH) {
|
||||
if (client->publishedCb)
|
||||
client->publishedCb((uint32_t*)client);
|
||||
}
|
||||
system_os_post(MQTT_TASK_PRIO, 0, (os_param_t)client);
|
||||
}
|
||||
|
||||
void ICACHE_FLASH_ATTR mqtt_timer(void *arg)
|
||||
{
|
||||
MQTT_Client* client = (MQTT_Client*)arg;
|
||||
|
||||
if (client->connState == MQTT_DATA) {
|
||||
client->keepAliveTick ++;
|
||||
if (client->keepAliveTick > (client->mqtt_state.connect_info->keepalive / 2)) {
|
||||
client->connState = MQTT_KEEPALIVE_SEND;
|
||||
system_os_post(MQTT_TASK_PRIO, 0, (os_param_t)client);
|
||||
}
|
||||
|
||||
} else if (client->connState == TCP_RECONNECT_REQ) {
|
||||
client->reconnectTick ++;
|
||||
if (client->reconnectTick > MQTT_RECONNECT_TIMEOUT) {
|
||||
client->reconnectTick = 0;
|
||||
client->connState = TCP_RECONNECT;
|
||||
system_os_post(MQTT_TASK_PRIO, 0, (os_param_t)client);
|
||||
if (client->timeoutCb)
|
||||
client->timeoutCb((uint32_t*)client);
|
||||
}
|
||||
}
|
||||
if (client->sendTimeout > 0)
|
||||
client->sendTimeout --;
|
||||
}
|
||||
|
||||
void ICACHE_FLASH_ATTR
|
||||
mqtt_tcpclient_discon_cb(void *arg)
|
||||
{
|
||||
|
||||
struct espconn *pespconn = (struct espconn *)arg;
|
||||
MQTT_Client* client = (MQTT_Client *)pespconn->reverse;
|
||||
MQTT_INFO("TCP: Disconnected callback\r\n");
|
||||
if (TCP_DISCONNECTING == client->connState) {
|
||||
client->connState = TCP_DISCONNECTED;
|
||||
}
|
||||
else if (MQTT_DELETING == client->connState) {
|
||||
client->connState = MQTT_DELETED;
|
||||
}
|
||||
else {
|
||||
client->connState = TCP_RECONNECT_REQ;
|
||||
}
|
||||
if (client->disconnectedCb)
|
||||
client->disconnectedCb((uint32_t*)client);
|
||||
|
||||
system_os_post(MQTT_TASK_PRIO, 0, (os_param_t)client);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief Tcp client connect success callback function.
|
||||
* @param arg: contain the ip link information
|
||||
* @retval None
|
||||
*/
|
||||
void ICACHE_FLASH_ATTR
|
||||
mqtt_tcpclient_connect_cb(void *arg)
|
||||
{
|
||||
struct espconn *pCon = (struct espconn *)arg;
|
||||
MQTT_Client* client = (MQTT_Client *)pCon->reverse;
|
||||
|
||||
espconn_regist_disconcb(client->pCon, mqtt_tcpclient_discon_cb);
|
||||
espconn_regist_recvcb(client->pCon, mqtt_tcpclient_recv);////////
|
||||
espconn_regist_sentcb(client->pCon, mqtt_tcpclient_sent_cb);///////
|
||||
MQTT_INFO("MQTT: Connected to broker %s:%d\r\n", client->host, client->port);
|
||||
|
||||
mqtt_msg_init(&client->mqtt_state.mqtt_connection, client->mqtt_state.out_buffer, client->mqtt_state.out_buffer_length);
|
||||
client->mqtt_state.outbound_message = mqtt_msg_connect(&client->mqtt_state.mqtt_connection, client->mqtt_state.connect_info);
|
||||
client->mqtt_state.pending_msg_type = mqtt_get_type(client->mqtt_state.outbound_message->data);
|
||||
client->mqtt_state.pending_msg_id = mqtt_get_id(client->mqtt_state.outbound_message->data, client->mqtt_state.outbound_message->length);
|
||||
|
||||
|
||||
client->sendTimeout = MQTT_SEND_TIMOUT;
|
||||
MQTT_INFO("MQTT: Sending, type: %d, id: %04X\r\n", client->mqtt_state.pending_msg_type, client->mqtt_state.pending_msg_id);
|
||||
if (client->security) {
|
||||
#ifdef MQTT_SSL_ENABLE
|
||||
espconn_secure_send(client->pCon, client->mqtt_state.outbound_message->data, client->mqtt_state.outbound_message->length);
|
||||
#else
|
||||
MQTT_INFO("TCP: Do not support SSL\r\n");
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
espconn_send(client->pCon, client->mqtt_state.outbound_message->data, client->mqtt_state.outbound_message->length);
|
||||
}
|
||||
|
||||
client->mqtt_state.outbound_message = NULL;
|
||||
client->connState = MQTT_CONNECT_SENDING;
|
||||
system_os_post(MQTT_TASK_PRIO, 0, (os_param_t)client);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Tcp client connect repeat callback function.
|
||||
* @param arg: contain the ip link information
|
||||
* @retval None
|
||||
*/
|
||||
void ICACHE_FLASH_ATTR
|
||||
mqtt_tcpclient_recon_cb(void *arg, sint8 errType)
|
||||
{
|
||||
struct espconn *pCon = (struct espconn *)arg;
|
||||
MQTT_Client* client = (MQTT_Client *)pCon->reverse;
|
||||
|
||||
MQTT_INFO("TCP: Reconnect to %s:%d\r\n", client->host, client->port);
|
||||
|
||||
client->connState = TCP_RECONNECT_REQ;
|
||||
|
||||
system_os_post(MQTT_TASK_PRIO, 0, (os_param_t)client);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief MQTT publish function.
|
||||
* @param client: MQTT_Client reference
|
||||
* @param topic: string topic will publish to
|
||||
* @param data: buffer data send point to
|
||||
* @param data_length: length of data
|
||||
* @param qos: qos
|
||||
* @param retain: retain
|
||||
* @retval TRUE if success queue
|
||||
*/
|
||||
bool ICACHE_FLASH_ATTR
|
||||
MQTT_Publish(MQTT_Client *client, const char* topic, const char* data, int data_length, int qos, int retain)
|
||||
{
|
||||
uint8_t dataBuffer[MQTT_BUF_SIZE];
|
||||
uint16_t dataLen;
|
||||
client->mqtt_state.outbound_message = mqtt_msg_publish(&client->mqtt_state.mqtt_connection,
|
||||
topic, data, data_length,
|
||||
qos, retain,
|
||||
&client->mqtt_state.pending_msg_id);
|
||||
if (client->mqtt_state.outbound_message->length == 0) {
|
||||
MQTT_INFO("MQTT: Queuing publish failed\r\n");
|
||||
return FALSE;
|
||||
}
|
||||
MQTT_INFO("MQTT: queuing publish, length: %d, queue size(%d/%d)\r\n", client->mqtt_state.outbound_message->length, client->msgQueue.rb.fill_cnt, client->msgQueue.rb.size);
|
||||
while (QUEUE_Puts(&client->msgQueue, client->mqtt_state.outbound_message->data, client->mqtt_state.outbound_message->length) == -1) {
|
||||
MQTT_INFO("MQTT: Queue full\r\n");
|
||||
if (QUEUE_Gets(&client->msgQueue, dataBuffer, &dataLen, MQTT_BUF_SIZE) == -1) {
|
||||
MQTT_INFO("MQTT: Serious buffer error\r\n");
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
system_os_post(MQTT_TASK_PRIO, 0, (os_param_t)client);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief MQTT subscibe function.
|
||||
* @param client: MQTT_Client reference
|
||||
* @param topic: string topic will subscribe
|
||||
* @param qos: qos
|
||||
* @retval TRUE if success queue
|
||||
*/
|
||||
bool ICACHE_FLASH_ATTR
|
||||
MQTT_Subscribe(MQTT_Client *client, char* topic, uint8_t qos)
|
||||
{
|
||||
uint8_t dataBuffer[MQTT_BUF_SIZE];
|
||||
uint16_t dataLen;
|
||||
|
||||
client->mqtt_state.outbound_message = mqtt_msg_subscribe(&client->mqtt_state.mqtt_connection,
|
||||
topic, qos,
|
||||
&client->mqtt_state.pending_msg_id);
|
||||
MQTT_INFO("MQTT: queue subscribe, topic\"%s\", id: %d\r\n", topic, client->mqtt_state.pending_msg_id);
|
||||
while (QUEUE_Puts(&client->msgQueue, client->mqtt_state.outbound_message->data, client->mqtt_state.outbound_message->length) == -1) {
|
||||
MQTT_INFO("MQTT: Queue full\r\n");
|
||||
if (QUEUE_Gets(&client->msgQueue, dataBuffer, &dataLen, MQTT_BUF_SIZE) == -1) {
|
||||
MQTT_INFO("MQTT: Serious buffer error\r\n");
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
system_os_post(MQTT_TASK_PRIO, 0, (os_param_t)client);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief MQTT un-subscibe function.
|
||||
* @param client: MQTT_Client reference
|
||||
* @param topic: String topic will un-subscribe
|
||||
* @retval TRUE if success queue
|
||||
*/
|
||||
bool ICACHE_FLASH_ATTR
|
||||
MQTT_UnSubscribe(MQTT_Client *client, char* topic)
|
||||
{
|
||||
uint8_t dataBuffer[MQTT_BUF_SIZE];
|
||||
uint16_t dataLen;
|
||||
client->mqtt_state.outbound_message = mqtt_msg_unsubscribe(&client->mqtt_state.mqtt_connection,
|
||||
topic,
|
||||
&client->mqtt_state.pending_msg_id);
|
||||
MQTT_INFO("MQTT: queue un-subscribe, topic\"%s\", id: %d\r\n", topic, client->mqtt_state.pending_msg_id);
|
||||
while (QUEUE_Puts(&client->msgQueue, client->mqtt_state.outbound_message->data, client->mqtt_state.outbound_message->length) == -1) {
|
||||
MQTT_INFO("MQTT: Queue full\r\n");
|
||||
if (QUEUE_Gets(&client->msgQueue, dataBuffer, &dataLen, MQTT_BUF_SIZE) == -1) {
|
||||
MQTT_INFO("MQTT: Serious buffer error\r\n");
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
system_os_post(MQTT_TASK_PRIO, 0, (os_param_t)client);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief MQTT ping function.
|
||||
* @param client: MQTT_Client reference
|
||||
* @retval TRUE if success queue
|
||||
*/
|
||||
bool ICACHE_FLASH_ATTR
|
||||
MQTT_Ping(MQTT_Client *client)
|
||||
{
|
||||
uint8_t dataBuffer[MQTT_BUF_SIZE];
|
||||
uint16_t dataLen;
|
||||
client->mqtt_state.outbound_message = mqtt_msg_pingreq(&client->mqtt_state.mqtt_connection);
|
||||
if (client->mqtt_state.outbound_message->length == 0) {
|
||||
MQTT_INFO("MQTT: Queuing publish failed\r\n");
|
||||
return FALSE;
|
||||
}
|
||||
MQTT_INFO("MQTT: queuing publish, length: %d, queue size(%d/%d)\r\n", client->mqtt_state.outbound_message->length, client->msgQueue.rb.fill_cnt, client->msgQueue.rb.size);
|
||||
while (QUEUE_Puts(&client->msgQueue, client->mqtt_state.outbound_message->data, client->mqtt_state.outbound_message->length) == -1) {
|
||||
MQTT_INFO("MQTT: Queue full\r\n");
|
||||
if (QUEUE_Gets(&client->msgQueue, dataBuffer, &dataLen, MQTT_BUF_SIZE) == -1) {
|
||||
MQTT_INFO("MQTT: Serious buffer error\r\n");
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
system_os_post(MQTT_TASK_PRIO, 0, (os_param_t)client);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void ICACHE_FLASH_ATTR
|
||||
MQTT_Task(os_event_t *e)
|
||||
{
|
||||
MQTT_Client* client = (MQTT_Client*)e->par;
|
||||
uint8_t dataBuffer[MQTT_BUF_SIZE];
|
||||
uint16_t dataLen;
|
||||
if (e->par == 0)
|
||||
return;
|
||||
switch (client->connState) {
|
||||
|
||||
case TCP_RECONNECT_REQ:
|
||||
break;
|
||||
case TCP_RECONNECT:
|
||||
mqtt_tcpclient_delete(client);
|
||||
MQTT_Connect(client);
|
||||
MQTT_INFO("TCP: Reconnect to: %s:%d\r\n", client->host, client->port);
|
||||
client->connState = TCP_CONNECTING;
|
||||
break;
|
||||
case MQTT_DELETING:
|
||||
case TCP_DISCONNECTING:
|
||||
case TCP_RECONNECT_DISCONNECTING:
|
||||
if (client->security) {
|
||||
#ifdef MQTT_SSL_ENABLE
|
||||
espconn_secure_disconnect(client->pCon);
|
||||
#else
|
||||
MQTT_INFO("TCP: Do not support SSL\r\n");
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
espconn_disconnect(client->pCon);
|
||||
}
|
||||
break;
|
||||
case TCP_DISCONNECTED:
|
||||
MQTT_INFO("MQTT: Disconnected\r\n");
|
||||
mqtt_tcpclient_delete(client);
|
||||
break;
|
||||
case MQTT_DELETED:
|
||||
MQTT_INFO("MQTT: Deleted client\r\n");
|
||||
mqtt_client_delete(client);
|
||||
break;
|
||||
case MQTT_KEEPALIVE_SEND:
|
||||
mqtt_send_keepalive(client);
|
||||
break;
|
||||
case MQTT_DATA:
|
||||
if (QUEUE_IsEmpty(&client->msgQueue) || client->sendTimeout != 0) {
|
||||
break;
|
||||
}
|
||||
if (QUEUE_Gets(&client->msgQueue, dataBuffer, &dataLen, MQTT_BUF_SIZE) == 0) {
|
||||
client->mqtt_state.pending_msg_type = mqtt_get_type(dataBuffer);
|
||||
client->mqtt_state.pending_msg_id = mqtt_get_id(dataBuffer, dataLen);
|
||||
|
||||
|
||||
client->sendTimeout = MQTT_SEND_TIMOUT;
|
||||
MQTT_INFO("MQTT: Sending, type: %d, id: %04X\r\n", client->mqtt_state.pending_msg_type, client->mqtt_state.pending_msg_id);
|
||||
client->keepAliveTick = 0;
|
||||
if (client->security) {
|
||||
#ifdef MQTT_SSL_ENABLE
|
||||
espconn_secure_send(client->pCon, dataBuffer, dataLen);
|
||||
#else
|
||||
MQTT_INFO("TCP: Do not support SSL\r\n");
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
espconn_send(client->pCon, dataBuffer, dataLen);
|
||||
}
|
||||
|
||||
client->mqtt_state.outbound_message = NULL;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief MQTT initialization connection function
|
||||
* @param client: MQTT_Client reference
|
||||
* @param host: Domain or IP string
|
||||
* @param port: Port to connect
|
||||
* @param security: 1 for ssl, 0 for none
|
||||
* @retval None
|
||||
*/
|
||||
void ICACHE_FLASH_ATTR
|
||||
MQTT_InitConnection(MQTT_Client *mqttClient, uint8_t* host, uint32_t port, uint8_t security)
|
||||
{
|
||||
uint32_t temp;
|
||||
MQTT_INFO("MQTT:InitConnection\r\n");
|
||||
os_memset(mqttClient, 0, sizeof(MQTT_Client));
|
||||
temp = os_strlen(host);
|
||||
mqttClient->host = (uint8_t*)os_zalloc(temp + 1);
|
||||
os_strcpy(mqttClient->host, host);
|
||||
mqttClient->host[temp] = 0;
|
||||
mqttClient->port = port;
|
||||
mqttClient->security = security;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief MQTT initialization mqtt client function
|
||||
* @param client: MQTT_Client reference
|
||||
* @param clientid: MQTT client id
|
||||
* @param client_user:MQTT client user
|
||||
* @param client_pass:MQTT client password
|
||||
* @param client_pass:MQTT keep alive timer, in second
|
||||
* @retval None
|
||||
*/
|
||||
bool ICACHE_FLASH_ATTR
|
||||
MQTT_InitClient(MQTT_Client *mqttClient, uint8_t* client_id, uint8_t* client_user, uint8_t* client_pass, uint32_t keepAliveTime, uint8_t cleanSession)
|
||||
{
|
||||
uint32_t temp;
|
||||
MQTT_INFO("MQTT:InitClient\r\n");
|
||||
|
||||
os_memset(&mqttClient->connect_info, 0, sizeof(mqtt_connect_info_t));
|
||||
|
||||
if ( !client_id )
|
||||
{
|
||||
/* Should be allowed by broker, but clean session flag must be set. */
|
||||
#ifdef PROTOCOL_NAMEv311
|
||||
if (cleanSession)
|
||||
{
|
||||
mqttClient->connect_info.client_id = zero_len_id;
|
||||
} else {
|
||||
MQTT_INFO("cleanSession must be set to use 0 length client_id\r\n");
|
||||
return false;
|
||||
}
|
||||
/* Not supported. Return. */
|
||||
#else
|
||||
MQTT_INFO("Client ID required for MQTT < 3.1.1!\r\n");
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* If connect_info's client_id is still NULL and we get here, we can *
|
||||
* assume the passed client_id is non-NULL. */
|
||||
if ( !(mqttClient->connect_info.client_id) )
|
||||
{
|
||||
temp = os_strlen(client_id);
|
||||
mqttClient->connect_info.client_id = (uint8_t*)os_zalloc(temp + 1);
|
||||
os_strcpy(mqttClient->connect_info.client_id, client_id);
|
||||
mqttClient->connect_info.client_id[temp] = 0;
|
||||
}
|
||||
|
||||
if (client_user)
|
||||
{
|
||||
temp = os_strlen(client_user);
|
||||
mqttClient->connect_info.username = (uint8_t*)os_zalloc(temp + 1);
|
||||
os_strcpy(mqttClient->connect_info.username, client_user);
|
||||
mqttClient->connect_info.username[temp] = 0;
|
||||
}
|
||||
|
||||
if (client_pass)
|
||||
{
|
||||
temp = os_strlen(client_pass);
|
||||
mqttClient->connect_info.password = (uint8_t*)os_zalloc(temp + 1);
|
||||
os_strcpy(mqttClient->connect_info.password, client_pass);
|
||||
mqttClient->connect_info.password[temp] = 0;
|
||||
}
|
||||
|
||||
|
||||
mqttClient->connect_info.keepalive = keepAliveTime;
|
||||
mqttClient->connect_info.clean_session = cleanSession;
|
||||
|
||||
mqttClient->mqtt_state.in_buffer = (uint8_t *)os_zalloc(MQTT_BUF_SIZE);
|
||||
mqttClient->mqtt_state.in_buffer_length = MQTT_BUF_SIZE;
|
||||
mqttClient->mqtt_state.out_buffer = (uint8_t *)os_zalloc(MQTT_BUF_SIZE);
|
||||
mqttClient->mqtt_state.out_buffer_length = MQTT_BUF_SIZE;
|
||||
mqttClient->mqtt_state.connect_info = &mqttClient->connect_info;
|
||||
|
||||
mqtt_msg_init(&mqttClient->mqtt_state.mqtt_connection, mqttClient->mqtt_state.out_buffer, mqttClient->mqtt_state.out_buffer_length);
|
||||
|
||||
QUEUE_Init(&mqttClient->msgQueue, QUEUE_BUFFER_SIZE);
|
||||
|
||||
system_os_task(MQTT_Task, MQTT_TASK_PRIO, mqtt_procTaskQueue, MQTT_TASK_QUEUE_SIZE);
|
||||
system_os_post(MQTT_TASK_PRIO, 0, (os_param_t)mqttClient);
|
||||
return true;
|
||||
}
|
||||
void ICACHE_FLASH_ATTR
|
||||
MQTT_InitLWT(MQTT_Client *mqttClient, uint8_t* will_topic, uint8_t* will_msg, uint8_t will_qos, uint8_t will_retain)
|
||||
{
|
||||
uint32_t temp;
|
||||
temp = os_strlen(will_topic);
|
||||
mqttClient->connect_info.will_topic = (uint8_t*)os_zalloc(temp + 1);
|
||||
os_strcpy(mqttClient->connect_info.will_topic, will_topic);
|
||||
mqttClient->connect_info.will_topic[temp] = 0;
|
||||
|
||||
temp = os_strlen(will_msg);
|
||||
mqttClient->connect_info.will_message = (uint8_t*)os_zalloc(temp + 1);
|
||||
os_strcpy(mqttClient->connect_info.will_message, will_msg);
|
||||
mqttClient->connect_info.will_message[temp] = 0;
|
||||
|
||||
|
||||
mqttClient->connect_info.will_qos = will_qos;
|
||||
mqttClient->connect_info.will_retain = will_retain;
|
||||
}
|
||||
/**
|
||||
* @brief Begin connect to MQTT broker
|
||||
* @param client: MQTT_Client reference
|
||||
* @retval None
|
||||
*/
|
||||
void ICACHE_FLASH_ATTR
|
||||
MQTT_Connect(MQTT_Client *mqttClient)
|
||||
{
|
||||
if (mqttClient->pCon) {
|
||||
// Clean up the old connection forcefully - using MQTT_Disconnect
|
||||
// does not actually release the old connection until the
|
||||
// disconnection callback is invoked.
|
||||
mqtt_tcpclient_delete(mqttClient);
|
||||
}
|
||||
mqttClient->pCon = (struct espconn *)os_zalloc(sizeof(struct espconn));
|
||||
mqttClient->pCon->type = ESPCONN_TCP;
|
||||
mqttClient->pCon->state = ESPCONN_NONE;
|
||||
mqttClient->pCon->proto.tcp = (esp_tcp *)os_zalloc(sizeof(esp_tcp));
|
||||
mqttClient->pCon->proto.tcp->local_port = espconn_port();
|
||||
mqttClient->pCon->proto.tcp->remote_port = mqttClient->port;
|
||||
mqttClient->pCon->reverse = mqttClient;
|
||||
espconn_regist_connectcb(mqttClient->pCon, mqtt_tcpclient_connect_cb);
|
||||
espconn_regist_reconcb(mqttClient->pCon, mqtt_tcpclient_recon_cb);
|
||||
|
||||
mqttClient->keepAliveTick = 0;
|
||||
mqttClient->reconnectTick = 0;
|
||||
|
||||
|
||||
os_timer_disarm(&mqttClient->mqttTimer);
|
||||
os_timer_setfn(&mqttClient->mqttTimer, (os_timer_func_t *)mqtt_timer, mqttClient);
|
||||
os_timer_arm(&mqttClient->mqttTimer, 1000, 1);
|
||||
|
||||
if (UTILS_StrToIP(mqttClient->host, &mqttClient->pCon->proto.tcp->remote_ip)) {
|
||||
MQTT_INFO("TCP: Connect to ip %s:%d\r\n", mqttClient->host, mqttClient->port);
|
||||
if (mqttClient->security)
|
||||
{
|
||||
#ifdef MQTT_SSL_ENABLE
|
||||
espconn_secure_set_size(ESPCONN_CLIENT, MQTT_SSL_SIZE);
|
||||
espconn_secure_connect(mqttClient->pCon);
|
||||
#else
|
||||
MQTT_INFO("TCP: Do not support SSL\r\n");
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
espconn_connect(mqttClient->pCon);
|
||||
}
|
||||
}
|
||||
else {
|
||||
MQTT_INFO("TCP: Connect to domain %s:%d\r\n", mqttClient->host, mqttClient->port);
|
||||
espconn_gethostbyname(mqttClient->pCon, mqttClient->host, &mqttClient->ip, mqtt_dns_found);
|
||||
}
|
||||
mqttClient->connState = TCP_CONNECTING;
|
||||
}
|
||||
|
||||
void ICACHE_FLASH_ATTR
|
||||
MQTT_Disconnect(MQTT_Client *mqttClient)
|
||||
{
|
||||
mqttClient->connState = TCP_DISCONNECTING;
|
||||
system_os_post(MQTT_TASK_PRIO, 0, (os_param_t)mqttClient);
|
||||
os_timer_disarm(&mqttClient->mqttTimer);
|
||||
}
|
||||
|
||||
void ICACHE_FLASH_ATTR
|
||||
MQTT_DeleteClient(MQTT_Client *mqttClient)
|
||||
{
|
||||
if (NULL == mqttClient)
|
||||
return;
|
||||
|
||||
mqttClient->connState = MQTT_DELETED;
|
||||
// if(TCP_DISCONNECTED == mqttClient->connState) {
|
||||
// mqttClient->connState = MQTT_DELETED;
|
||||
// } else if(MQTT_DELETED != mqttClient->connState) {
|
||||
// mqttClient->connState = MQTT_DELETING;
|
||||
// }
|
||||
|
||||
system_os_post(MQTT_TASK_PRIO, 0, (os_param_t)mqttClient);
|
||||
os_timer_disarm(&mqttClient->mqttTimer);
|
||||
}
|
||||
|
||||
void ICACHE_FLASH_ATTR
|
||||
MQTT_OnConnected(MQTT_Client *mqttClient, MqttCallback connectedCb)
|
||||
{
|
||||
mqttClient->connectedCb = connectedCb;
|
||||
}
|
||||
|
||||
void ICACHE_FLASH_ATTR
|
||||
MQTT_OnDisconnected(MQTT_Client *mqttClient, MqttCallback disconnectedCb)
|
||||
{
|
||||
mqttClient->disconnectedCb = disconnectedCb;
|
||||
}
|
||||
|
||||
void ICACHE_FLASH_ATTR
|
||||
MQTT_OnData(MQTT_Client *mqttClient, MqttDataCallback dataCb)
|
||||
{
|
||||
mqttClient->dataCb = dataCb;
|
||||
}
|
||||
|
||||
void ICACHE_FLASH_ATTR
|
||||
MQTT_OnPublished(MQTT_Client *mqttClient, MqttCallback publishedCb)
|
||||
{
|
||||
mqttClient->publishedCb = publishedCb;
|
||||
}
|
||||
|
||||
void ICACHE_FLASH_ATTR
|
||||
MQTT_OnTimeout(MQTT_Client *mqttClient, MqttCallback timeoutCb)
|
||||
{
|
||||
mqttClient->timeoutCb = timeoutCb;
|
||||
}
|
|
@ -0,0 +1,148 @@
|
|||
/* mqtt.h
|
||||
*
|
||||
* Copyright (c) 2014-2015, Tuan PM <tuanpm at live dot com>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of Redis nor the names of its contributors may be used
|
||||
* to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#ifndef USER_AT_MQTT_H_
|
||||
#define USER_AT_MQTT_H_
|
||||
#include "user_config.h"
|
||||
#include "mqtt_msg.h"
|
||||
#include "user_interface.h"
|
||||
|
||||
#include "queue.h"
|
||||
typedef struct mqtt_event_data_t
|
||||
{
|
||||
uint8_t type;
|
||||
const char* topic;
|
||||
const char* data;
|
||||
uint16_t topic_length;
|
||||
uint16_t data_length;
|
||||
uint16_t data_offset;
|
||||
} mqtt_event_data_t;
|
||||
|
||||
typedef struct mqtt_state_t
|
||||
{
|
||||
uint16_t port;
|
||||
int auto_reconnect;
|
||||
mqtt_connect_info_t* connect_info;
|
||||
uint8_t* in_buffer;
|
||||
uint8_t* out_buffer;
|
||||
int in_buffer_length;
|
||||
int out_buffer_length;
|
||||
uint16_t message_length;
|
||||
uint16_t message_length_read;
|
||||
mqtt_message_t* outbound_message;
|
||||
mqtt_connection_t mqtt_connection;
|
||||
uint16_t pending_msg_id;
|
||||
int pending_msg_type;
|
||||
int pending_publish_qos;
|
||||
} mqtt_state_t;
|
||||
|
||||
typedef enum {
|
||||
WIFI_INIT,
|
||||
WIFI_CONNECTING,
|
||||
WIFI_CONNECTING_ERROR,
|
||||
WIFI_CONNECTED,
|
||||
DNS_RESOLVE,
|
||||
TCP_DISCONNECTING,
|
||||
TCP_DISCONNECTED,
|
||||
TCP_RECONNECT_DISCONNECTING,
|
||||
TCP_RECONNECT_REQ,
|
||||
TCP_RECONNECT,
|
||||
TCP_CONNECTING,
|
||||
TCP_CONNECTING_ERROR,
|
||||
TCP_CONNECTED,
|
||||
MQTT_CONNECT_SEND,
|
||||
MQTT_CONNECT_SENDING,
|
||||
MQTT_SUBSCIBE_SEND,
|
||||
MQTT_SUBSCIBE_SENDING,
|
||||
MQTT_DATA,
|
||||
MQTT_KEEPALIVE_SEND,
|
||||
MQTT_PUBLISH_RECV,
|
||||
MQTT_PUBLISHING,
|
||||
MQTT_DELETING,
|
||||
MQTT_DELETED,
|
||||
} tConnState;
|
||||
|
||||
typedef void (*MqttCallback)(uint32_t *args);
|
||||
typedef void (*MqttDataCallback)(uint32_t *args, const char* topic, uint32_t topic_len, const char *data, uint32_t lengh);
|
||||
|
||||
typedef struct {
|
||||
struct espconn *pCon;
|
||||
uint8_t security;
|
||||
uint8_t* host;
|
||||
uint32_t port;
|
||||
ip_addr_t ip;
|
||||
mqtt_state_t mqtt_state;
|
||||
mqtt_connect_info_t connect_info;
|
||||
MqttCallback connectedCb;
|
||||
MqttCallback disconnectedCb;
|
||||
MqttCallback publishedCb;
|
||||
MqttCallback timeoutCb;
|
||||
MqttDataCallback dataCb;
|
||||
ETSTimer mqttTimer;
|
||||
uint32_t keepAliveTick;
|
||||
uint32_t reconnectTick;
|
||||
uint32_t sendTimeout;
|
||||
tConnState connState;
|
||||
QUEUE msgQueue;
|
||||
void* user_data;
|
||||
} MQTT_Client;
|
||||
|
||||
#define SEC_NONSSL 0
|
||||
#define SEC_SSL 1
|
||||
|
||||
#define MQTT_FLAG_CONNECTED 1
|
||||
#define MQTT_FLAG_READY 2
|
||||
#define MQTT_FLAG_EXIT 4
|
||||
|
||||
#define MQTT_EVENT_TYPE_NONE 0
|
||||
#define MQTT_EVENT_TYPE_CONNECTED 1
|
||||
#define MQTT_EVENT_TYPE_DISCONNECTED 2
|
||||
#define MQTT_EVENT_TYPE_SUBSCRIBED 3
|
||||
#define MQTT_EVENT_TYPE_UNSUBSCRIBED 4
|
||||
#define MQTT_EVENT_TYPE_PUBLISH 5
|
||||
#define MQTT_EVENT_TYPE_PUBLISHED 6
|
||||
#define MQTT_EVENT_TYPE_EXITED 7
|
||||
#define MQTT_EVENT_TYPE_PUBLISH_CONTINUATION 8
|
||||
|
||||
void ICACHE_FLASH_ATTR MQTT_InitConnection(MQTT_Client *mqttClient, uint8_t* host, uint32_t port, uint8_t security);
|
||||
bool ICACHE_FLASH_ATTR MQTT_InitClient(MQTT_Client *mqttClient, uint8_t* client_id, uint8_t* client_user, uint8_t* client_pass, uint32_t keepAliveTime, uint8_t cleanSession);
|
||||
void ICACHE_FLASH_ATTR MQTT_DeleteClient(MQTT_Client *mqttClient);
|
||||
void ICACHE_FLASH_ATTR MQTT_InitLWT(MQTT_Client *mqttClient, uint8_t* will_topic, uint8_t* will_msg, uint8_t will_qos, uint8_t will_retain);
|
||||
void ICACHE_FLASH_ATTR MQTT_OnConnected(MQTT_Client *mqttClient, MqttCallback connectedCb);
|
||||
void ICACHE_FLASH_ATTR MQTT_OnDisconnected(MQTT_Client *mqttClient, MqttCallback disconnectedCb);
|
||||
void ICACHE_FLASH_ATTR MQTT_OnPublished(MQTT_Client *mqttClient, MqttCallback publishedCb);
|
||||
void ICACHE_FLASH_ATTR MQTT_OnTimeout(MQTT_Client *mqttClient, MqttCallback timeoutCb);
|
||||
void ICACHE_FLASH_ATTR MQTT_OnData(MQTT_Client *mqttClient, MqttDataCallback dataCb);
|
||||
bool ICACHE_FLASH_ATTR MQTT_Subscribe(MQTT_Client *client, char* topic, uint8_t qos);
|
||||
bool ICACHE_FLASH_ATTR MQTT_UnSubscribe(MQTT_Client *client, char* topic);
|
||||
void ICACHE_FLASH_ATTR MQTT_Connect(MQTT_Client *mqttClient);
|
||||
void ICACHE_FLASH_ATTR MQTT_Disconnect(MQTT_Client *mqttClient);
|
||||
bool ICACHE_FLASH_ATTR MQTT_Publish(MQTT_Client *client, const char* topic, const char* data, int data_length, int qos, int retain);
|
||||
|
||||
#endif /* USER_AT_MQTT_H_ */
|
|
@ -0,0 +1,487 @@
|
|||
/*
|
||||
* Copyright (c) 2014, Stephen Robinson
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include "mqtt_msg.h"
|
||||
#include "user_config.h"
|
||||
#define MQTT_MAX_FIXED_HEADER_SIZE 3
|
||||
|
||||
enum mqtt_connect_flag
|
||||
{
|
||||
MQTT_CONNECT_FLAG_USERNAME = 1 << 7,
|
||||
MQTT_CONNECT_FLAG_PASSWORD = 1 << 6,
|
||||
MQTT_CONNECT_FLAG_WILL_RETAIN = 1 << 5,
|
||||
MQTT_CONNECT_FLAG_WILL = 1 << 2,
|
||||
MQTT_CONNECT_FLAG_CLEAN_SESSION = 1 << 1
|
||||
};
|
||||
|
||||
struct __attribute((__packed__)) mqtt_connect_variable_header
|
||||
{
|
||||
uint8_t lengthMsb;
|
||||
uint8_t lengthLsb;
|
||||
#if defined(PROTOCOL_NAMEv31)
|
||||
uint8_t magic[6];
|
||||
#elif defined(PROTOCOL_NAMEv311)
|
||||
uint8_t magic[4];
|
||||
#else
|
||||
#error "Please define protocol name"
|
||||
#endif
|
||||
uint8_t version;
|
||||
uint8_t flags;
|
||||
uint8_t keepaliveMsb;
|
||||
uint8_t keepaliveLsb;
|
||||
};
|
||||
|
||||
static int ICACHE_FLASH_ATTR append_string(mqtt_connection_t* connection, const char* string, int len)
|
||||
{
|
||||
if (connection->message.length + len + 2 > connection->buffer_length)
|
||||
return -1;
|
||||
|
||||
connection->buffer[connection->message.length++] = len >> 8;
|
||||
connection->buffer[connection->message.length++] = len & 0xff;
|
||||
memcpy(connection->buffer + connection->message.length, string, len);
|
||||
connection->message.length += len;
|
||||
|
||||
return len + 2;
|
||||
}
|
||||
|
||||
static uint16_t ICACHE_FLASH_ATTR append_message_id(mqtt_connection_t* connection, uint16_t message_id)
|
||||
{
|
||||
// If message_id is zero then we should assign one, otherwise
|
||||
// we'll use the one supplied by the caller
|
||||
while (message_id == 0)
|
||||
message_id = ++connection->message_id;
|
||||
|
||||
if (connection->message.length + 2 > connection->buffer_length)
|
||||
return 0;
|
||||
|
||||
connection->buffer[connection->message.length++] = message_id >> 8;
|
||||
connection->buffer[connection->message.length++] = message_id & 0xff;
|
||||
|
||||
return message_id;
|
||||
}
|
||||
|
||||
static int ICACHE_FLASH_ATTR init_message(mqtt_connection_t* connection)
|
||||
{
|
||||
connection->message.length = MQTT_MAX_FIXED_HEADER_SIZE;
|
||||
return MQTT_MAX_FIXED_HEADER_SIZE;
|
||||
}
|
||||
|
||||
static mqtt_message_t* ICACHE_FLASH_ATTR fail_message(mqtt_connection_t* connection)
|
||||
{
|
||||
connection->message.data = connection->buffer;
|
||||
connection->message.length = 0;
|
||||
return &connection->message;
|
||||
}
|
||||
|
||||
static mqtt_message_t* ICACHE_FLASH_ATTR fini_message(mqtt_connection_t* connection, int type, int dup, int qos, int retain)
|
||||
{
|
||||
int remaining_length = connection->message.length - MQTT_MAX_FIXED_HEADER_SIZE;
|
||||
|
||||
if (remaining_length > 127)
|
||||
{
|
||||
connection->buffer[0] = ((type & 0x0f) << 4) | ((dup & 1) << 3) | ((qos & 3) << 1) | (retain & 1);
|
||||
connection->buffer[1] = 0x80 | (remaining_length % 128);
|
||||
connection->buffer[2] = remaining_length / 128;
|
||||
connection->message.length = remaining_length + 3;
|
||||
connection->message.data = connection->buffer;
|
||||
}
|
||||
else
|
||||
{
|
||||
connection->buffer[1] = ((type & 0x0f) << 4) | ((dup & 1) << 3) | ((qos & 3) << 1) | (retain & 1);
|
||||
connection->buffer[2] = remaining_length;
|
||||
connection->message.length = remaining_length + 2;
|
||||
connection->message.data = connection->buffer + 1;
|
||||
}
|
||||
|
||||
return &connection->message;
|
||||
}
|
||||
|
||||
void ICACHE_FLASH_ATTR mqtt_msg_init(mqtt_connection_t* connection, uint8_t* buffer, uint16_t buffer_length)
|
||||
{
|
||||
memset(connection, 0, sizeof(mqtt_connection_t));
|
||||
connection->buffer = buffer;
|
||||
connection->buffer_length = buffer_length;
|
||||
}
|
||||
|
||||
int ICACHE_FLASH_ATTR mqtt_get_total_length(uint8_t* buffer, uint16_t length)
|
||||
{
|
||||
int i;
|
||||
int totlen = 0;
|
||||
|
||||
for (i = 1; i < length; ++i)
|
||||
{
|
||||
totlen += (buffer[i] & 0x7f) << (7 * (i - 1));
|
||||
if ((buffer[i] & 0x80) == 0)
|
||||
{
|
||||
++i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
totlen += i;
|
||||
|
||||
return totlen;
|
||||
}
|
||||
|
||||
const char* ICACHE_FLASH_ATTR mqtt_get_publish_topic(uint8_t* buffer, uint16_t* length)
|
||||
{
|
||||
int i;
|
||||
int totlen = 0;
|
||||
int topiclen;
|
||||
|
||||
for (i = 1; i < *length; ++i)
|
||||
{
|
||||
totlen += (buffer[i] & 0x7f) << (7 * (i - 1));
|
||||
if ((buffer[i] & 0x80) == 0)
|
||||
{
|
||||
++i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
totlen += i;
|
||||
|
||||
if (i + 2 >= *length)
|
||||
return NULL;
|
||||
topiclen = buffer[i++] << 8;
|
||||
topiclen |= buffer[i++];
|
||||
|
||||
if (i + topiclen > *length)
|
||||
return NULL;
|
||||
|
||||
*length = topiclen;
|
||||
return (const char*)(buffer + i);
|
||||
}
|
||||
|
||||
const char* ICACHE_FLASH_ATTR mqtt_get_publish_data(uint8_t* buffer, uint16_t* length)
|
||||
{
|
||||
int i;
|
||||
int totlen = 0;
|
||||
int topiclen;
|
||||
int blength = *length;
|
||||
*length = 0;
|
||||
|
||||
for (i = 1; i < blength; ++i)
|
||||
{
|
||||
totlen += (buffer[i] & 0x7f) << (7 * (i - 1));
|
||||
if ((buffer[i] & 0x80) == 0)
|
||||
{
|
||||
++i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
totlen += i;
|
||||
|
||||
if (i + 2 >= blength)
|
||||
return NULL;
|
||||
topiclen = buffer[i++] << 8;
|
||||
topiclen |= buffer[i++];
|
||||
|
||||
if (i + topiclen >= blength)
|
||||
return NULL;
|
||||
|
||||
i += topiclen;
|
||||
|
||||
if (mqtt_get_qos(buffer) > 0)
|
||||
{
|
||||
if (i + 2 >= blength)
|
||||
return NULL;
|
||||
i += 2;
|
||||
}
|
||||
|
||||
if (totlen < i)
|
||||
return NULL;
|
||||
|
||||
if (totlen <= blength)
|
||||
*length = totlen - i;
|
||||
else
|
||||
*length = blength - i;
|
||||
return (const char*)(buffer + i);
|
||||
}
|
||||
|
||||
uint16_t ICACHE_FLASH_ATTR mqtt_get_id(uint8_t* buffer, uint16_t length)
|
||||
{
|
||||
if (length < 1)
|
||||
return 0;
|
||||
|
||||
switch (mqtt_get_type(buffer))
|
||||
{
|
||||
case MQTT_MSG_TYPE_PUBLISH:
|
||||
{
|
||||
int i;
|
||||
int topiclen;
|
||||
|
||||
for (i = 1; i < length; ++i)
|
||||
{
|
||||
if ((buffer[i] & 0x80) == 0)
|
||||
{
|
||||
++i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i + 2 >= length)
|
||||
return 0;
|
||||
topiclen = buffer[i++] << 8;
|
||||
topiclen |= buffer[i++];
|
||||
|
||||
if (i + topiclen >= length)
|
||||
return 0;
|
||||
i += topiclen;
|
||||
|
||||
if (mqtt_get_qos(buffer) > 0)
|
||||
{
|
||||
if (i + 2 >= length)
|
||||
return 0;
|
||||
//i += 2;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return (buffer[i] << 8) | buffer[i + 1];
|
||||
}
|
||||
case MQTT_MSG_TYPE_PUBACK:
|
||||
case MQTT_MSG_TYPE_PUBREC:
|
||||
case MQTT_MSG_TYPE_PUBREL:
|
||||
case MQTT_MSG_TYPE_PUBCOMP:
|
||||
case MQTT_MSG_TYPE_SUBACK:
|
||||
case MQTT_MSG_TYPE_UNSUBACK:
|
||||
case MQTT_MSG_TYPE_SUBSCRIBE:
|
||||
{
|
||||
// This requires the remaining length to be encoded in 1 byte,
|
||||
// which it should be.
|
||||
if (length >= 4 && (buffer[1] & 0x80) == 0)
|
||||
return (buffer[2] << 8) | buffer[3];
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_connect(mqtt_connection_t* connection, mqtt_connect_info_t* info)
|
||||
{
|
||||
struct mqtt_connect_variable_header* variable_header;
|
||||
|
||||
init_message(connection);
|
||||
|
||||
if (connection->message.length + sizeof(*variable_header) > connection->buffer_length)
|
||||
return fail_message(connection);
|
||||
variable_header = (void*)(connection->buffer + connection->message.length);
|
||||
connection->message.length += sizeof(*variable_header);
|
||||
|
||||
variable_header->lengthMsb = 0;
|
||||
#if defined(PROTOCOL_NAMEv31)
|
||||
variable_header->lengthLsb = 6;
|
||||
memcpy(variable_header->magic, "MQIsdp", 6);
|
||||
variable_header->version = 3;
|
||||
#elif defined(PROTOCOL_NAMEv311)
|
||||
variable_header->lengthLsb = 4;
|
||||
memcpy(variable_header->magic, "MQTT", 4);
|
||||
variable_header->version = 4;
|
||||
#else
|
||||
#error "Please define protocol name"
|
||||
#endif
|
||||
|
||||
variable_header->flags = 0;
|
||||
variable_header->keepaliveMsb = info->keepalive >> 8;
|
||||
variable_header->keepaliveLsb = info->keepalive & 0xff;
|
||||
|
||||
if (info->clean_session)
|
||||
variable_header->flags |= MQTT_CONNECT_FLAG_CLEAN_SESSION;
|
||||
|
||||
if (info->client_id == NULL)
|
||||
{
|
||||
/* Never allowed */
|
||||
return fail_message(connection);
|
||||
}
|
||||
else if (info->client_id[0] == '\0')
|
||||
{
|
||||
#ifdef PROTOCOL_NAMEv311
|
||||
/* Allowed. Format 0 Length ID */
|
||||
append_string(connection, info->client_id, 2) ;
|
||||
#else
|
||||
/* 0 Length not allowed */
|
||||
return fail_message(connection);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
/* No 0 data and at least 1 long. Good to go. */
|
||||
if(append_string(connection, info->client_id, strlen(info->client_id)) < 0)
|
||||
return fail_message(connection);
|
||||
}
|
||||
|
||||
if (info->will_topic != NULL && info->will_topic[0] != '\0')
|
||||
{
|
||||
if (append_string(connection, info->will_topic, strlen(info->will_topic)) < 0)
|
||||
return fail_message(connection);
|
||||
|
||||
if (append_string(connection, info->will_message, strlen(info->will_message)) < 0)
|
||||
return fail_message(connection);
|
||||
|
||||
variable_header->flags |= MQTT_CONNECT_FLAG_WILL;
|
||||
if (info->will_retain)
|
||||
variable_header->flags |= MQTT_CONNECT_FLAG_WILL_RETAIN;
|
||||
variable_header->flags |= (info->will_qos & 3) << 3;
|
||||
}
|
||||
|
||||
if (info->username != NULL && info->username[0] != '\0')
|
||||
{
|
||||
if (append_string(connection, info->username, strlen(info->username)) < 0)
|
||||
return fail_message(connection);
|
||||
|
||||
variable_header->flags |= MQTT_CONNECT_FLAG_USERNAME;
|
||||
}
|
||||
|
||||
if (info->password != NULL && info->password[0] != '\0')
|
||||
{
|
||||
if (append_string(connection, info->password, strlen(info->password)) < 0)
|
||||
return fail_message(connection);
|
||||
|
||||
variable_header->flags |= MQTT_CONNECT_FLAG_PASSWORD;
|
||||
}
|
||||
|
||||
return fini_message(connection, MQTT_MSG_TYPE_CONNECT, 0, 0, 0);
|
||||
}
|
||||
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_publish(mqtt_connection_t* connection, const char* topic, const char* data, int data_length, int qos, int retain, uint16_t* message_id)
|
||||
{
|
||||
init_message(connection);
|
||||
|
||||
if (topic == NULL || topic[0] == '\0')
|
||||
return fail_message(connection);
|
||||
|
||||
if (append_string(connection, topic, strlen(topic)) < 0)
|
||||
return fail_message(connection);
|
||||
|
||||
if (qos > 0)
|
||||
{
|
||||
if ((*message_id = append_message_id(connection, 0)) == 0)
|
||||
return fail_message(connection);
|
||||
}
|
||||
else
|
||||
*message_id = 0;
|
||||
|
||||
if (connection->message.length + data_length > connection->buffer_length)
|
||||
return fail_message(connection);
|
||||
memcpy(connection->buffer + connection->message.length, data, data_length);
|
||||
connection->message.length += data_length;
|
||||
|
||||
return fini_message(connection, MQTT_MSG_TYPE_PUBLISH, 0, qos, retain);
|
||||
}
|
||||
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_puback(mqtt_connection_t* connection, uint16_t message_id)
|
||||
{
|
||||
init_message(connection);
|
||||
if (append_message_id(connection, message_id) == 0)
|
||||
return fail_message(connection);
|
||||
return fini_message(connection, MQTT_MSG_TYPE_PUBACK, 0, 0, 0);
|
||||
}
|
||||
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_pubrec(mqtt_connection_t* connection, uint16_t message_id)
|
||||
{
|
||||
init_message(connection);
|
||||
if (append_message_id(connection, message_id) == 0)
|
||||
return fail_message(connection);
|
||||
return fini_message(connection, MQTT_MSG_TYPE_PUBREC, 0, 0, 0);
|
||||
}
|
||||
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_pubrel(mqtt_connection_t* connection, uint16_t message_id)
|
||||
{
|
||||
init_message(connection);
|
||||
if (append_message_id(connection, message_id) == 0)
|
||||
return fail_message(connection);
|
||||
return fini_message(connection, MQTT_MSG_TYPE_PUBREL, 0, 1, 0);
|
||||
}
|
||||
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_pubcomp(mqtt_connection_t* connection, uint16_t message_id)
|
||||
{
|
||||
init_message(connection);
|
||||
if (append_message_id(connection, message_id) == 0)
|
||||
return fail_message(connection);
|
||||
return fini_message(connection, MQTT_MSG_TYPE_PUBCOMP, 0, 0, 0);
|
||||
}
|
||||
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_subscribe(mqtt_connection_t* connection, const char* topic, int qos, uint16_t* message_id)
|
||||
{
|
||||
init_message(connection);
|
||||
|
||||
if (topic == NULL || topic[0] == '\0')
|
||||
return fail_message(connection);
|
||||
|
||||
if ((*message_id = append_message_id(connection, 0)) == 0)
|
||||
return fail_message(connection);
|
||||
|
||||
if (append_string(connection, topic, strlen(topic)) < 0)
|
||||
return fail_message(connection);
|
||||
|
||||
if (connection->message.length + 1 > connection->buffer_length)
|
||||
return fail_message(connection);
|
||||
connection->buffer[connection->message.length++] = qos;
|
||||
|
||||
return fini_message(connection, MQTT_MSG_TYPE_SUBSCRIBE, 0, 1, 0);
|
||||
}
|
||||
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_unsubscribe(mqtt_connection_t* connection, const char* topic, uint16_t* message_id)
|
||||
{
|
||||
init_message(connection);
|
||||
|
||||
if (topic == NULL || topic[0] == '\0')
|
||||
return fail_message(connection);
|
||||
|
||||
if ((*message_id = append_message_id(connection, 0)) == 0)
|
||||
return fail_message(connection);
|
||||
|
||||
if (append_string(connection, topic, strlen(topic)) < 0)
|
||||
return fail_message(connection);
|
||||
|
||||
return fini_message(connection, MQTT_MSG_TYPE_UNSUBSCRIBE, 0, 1, 0);
|
||||
}
|
||||
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_pingreq(mqtt_connection_t* connection)
|
||||
{
|
||||
init_message(connection);
|
||||
return fini_message(connection, MQTT_MSG_TYPE_PINGREQ, 0, 0, 0);
|
||||
}
|
||||
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_pingresp(mqtt_connection_t* connection)
|
||||
{
|
||||
init_message(connection);
|
||||
return fini_message(connection, MQTT_MSG_TYPE_PINGRESP, 0, 0, 0);
|
||||
}
|
||||
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_disconnect(mqtt_connection_t* connection)
|
||||
{
|
||||
init_message(connection);
|
||||
return fini_message(connection, MQTT_MSG_TYPE_DISCONNECT, 0, 0, 0);
|
||||
}
|
|
@ -0,0 +1,141 @@
|
|||
/*
|
||||
* File: mqtt_msg.h
|
||||
* Author: Minh Tuan
|
||||
*
|
||||
* Created on July 12, 2014, 1:05 PM
|
||||
*/
|
||||
|
||||
#ifndef MQTT_MSG_H
|
||||
#define MQTT_MSG_H
|
||||
#include "user_config.h"
|
||||
#include "c_types.h"
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Copyright (c) 2014, Stephen Robinson
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
/* 7 6 5 4 3 2 1 0*/
|
||||
/*| --- Message Type---- | DUP Flag | QoS Level | Retain |
|
||||
/* Remaining Length */
|
||||
|
||||
|
||||
enum mqtt_message_type
|
||||
{
|
||||
MQTT_MSG_TYPE_CONNECT = 1,
|
||||
MQTT_MSG_TYPE_CONNACK = 2,
|
||||
MQTT_MSG_TYPE_PUBLISH = 3,
|
||||
MQTT_MSG_TYPE_PUBACK = 4,
|
||||
MQTT_MSG_TYPE_PUBREC = 5,
|
||||
MQTT_MSG_TYPE_PUBREL = 6,
|
||||
MQTT_MSG_TYPE_PUBCOMP = 7,
|
||||
MQTT_MSG_TYPE_SUBSCRIBE = 8,
|
||||
MQTT_MSG_TYPE_SUBACK = 9,
|
||||
MQTT_MSG_TYPE_UNSUBSCRIBE = 10,
|
||||
MQTT_MSG_TYPE_UNSUBACK = 11,
|
||||
MQTT_MSG_TYPE_PINGREQ = 12,
|
||||
MQTT_MSG_TYPE_PINGRESP = 13,
|
||||
MQTT_MSG_TYPE_DISCONNECT = 14
|
||||
};
|
||||
|
||||
enum mqtt_connect_return_code
|
||||
{
|
||||
CONNECTION_ACCEPTED = 0,
|
||||
CONNECTION_REFUSE_PROTOCOL,
|
||||
CONNECTION_REFUSE_ID_REJECTED,
|
||||
CONNECTION_REFUSE_SERVER_UNAVAILABLE,
|
||||
CONNECTION_REFUSE_BAD_USERNAME,
|
||||
CONNECTION_REFUSE_NOT_AUTHORIZED
|
||||
};
|
||||
|
||||
typedef struct mqtt_message
|
||||
{
|
||||
uint8_t* data;
|
||||
uint16_t length;
|
||||
|
||||
} mqtt_message_t;
|
||||
|
||||
typedef struct mqtt_connection
|
||||
{
|
||||
mqtt_message_t message;
|
||||
|
||||
uint16_t message_id;
|
||||
uint8_t* buffer;
|
||||
uint16_t buffer_length;
|
||||
|
||||
} mqtt_connection_t;
|
||||
|
||||
typedef struct mqtt_connect_info
|
||||
{
|
||||
char* client_id;
|
||||
char* username;
|
||||
char* password;
|
||||
char* will_topic;
|
||||
char* will_message;
|
||||
uint32_t keepalive;
|
||||
int will_qos;
|
||||
int will_retain;
|
||||
int clean_session;
|
||||
|
||||
} mqtt_connect_info_t;
|
||||
|
||||
|
||||
static inline int ICACHE_FLASH_ATTR mqtt_get_type(uint8_t* buffer) { return (buffer[0] & 0xf0) >> 4; }
|
||||
static inline int ICACHE_FLASH_ATTR mqtt_get_connect_return_code(uint8_t* buffer) { return buffer[3]; }
|
||||
static inline int ICACHE_FLASH_ATTR mqtt_get_dup(uint8_t* buffer) { return (buffer[0] & 0x08) >> 3; }
|
||||
static inline int ICACHE_FLASH_ATTR mqtt_get_qos(uint8_t* buffer) { return (buffer[0] & 0x06) >> 1; }
|
||||
static inline int ICACHE_FLASH_ATTR mqtt_get_retain(uint8_t* buffer) { return (buffer[0] & 0x01); }
|
||||
|
||||
void ICACHE_FLASH_ATTR mqtt_msg_init(mqtt_connection_t* connection, uint8_t* buffer, uint16_t buffer_length);
|
||||
int ICACHE_FLASH_ATTR mqtt_get_total_length(uint8_t* buffer, uint16_t length);
|
||||
const char* ICACHE_FLASH_ATTR mqtt_get_publish_topic(uint8_t* buffer, uint16_t* length);
|
||||
const char* ICACHE_FLASH_ATTR mqtt_get_publish_data(uint8_t* buffer, uint16_t* length);
|
||||
uint16_t ICACHE_FLASH_ATTR mqtt_get_id(uint8_t* buffer, uint16_t length);
|
||||
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_connect(mqtt_connection_t* connection, mqtt_connect_info_t* info);
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_publish(mqtt_connection_t* connection, const char* topic, const char* data, int data_length, int qos, int retain, uint16_t* message_id);
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_puback(mqtt_connection_t* connection, uint16_t message_id);
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_pubrec(mqtt_connection_t* connection, uint16_t message_id);
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_pubrel(mqtt_connection_t* connection, uint16_t message_id);
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_pubcomp(mqtt_connection_t* connection, uint16_t message_id);
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_subscribe(mqtt_connection_t* connection, const char* topic, int qos, uint16_t* message_id);
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_unsubscribe(mqtt_connection_t* connection, const char* topic, uint16_t* message_id);
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_pingreq(mqtt_connection_t* connection);
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_pingresp(mqtt_connection_t* connection);
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_disconnect(mqtt_connection_t* connection);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MQTT_MSG_H */
|
||||
|
|
@ -0,0 +1,129 @@
|
|||
#include "proto.h"
|
||||
#include "ringbuf.h"
|
||||
I8 ICACHE_FLASH_ATTR PROTO_Init(PROTO_PARSER *parser, PROTO_PARSE_CALLBACK *completeCallback, U8 *buf, U16 bufSize)
|
||||
{
|
||||
parser->buf = buf;
|
||||
parser->bufSize = bufSize;
|
||||
parser->dataLen = 0;
|
||||
parser->callback = completeCallback;
|
||||
parser->isEsc = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
I8 ICACHE_FLASH_ATTR PROTO_ParseByte(PROTO_PARSER *parser, U8 value)
|
||||
{
|
||||
switch (value) {
|
||||
case 0x7D:
|
||||
parser->isEsc = 1;
|
||||
break;
|
||||
|
||||
case 0x7E:
|
||||
parser->dataLen = 0;
|
||||
parser->isEsc = 0;
|
||||
parser->isBegin = 1;
|
||||
break;
|
||||
|
||||
case 0x7F:
|
||||
if (parser->callback != NULL)
|
||||
parser->callback();
|
||||
parser->isBegin = 0;
|
||||
return 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (parser->isBegin == 0) break;
|
||||
|
||||
if (parser->isEsc) {
|
||||
value ^= 0x20;
|
||||
parser->isEsc = 0;
|
||||
}
|
||||
|
||||
if (parser->dataLen < parser->bufSize)
|
||||
parser->buf[parser->dataLen++] = value;
|
||||
|
||||
break;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
I8 ICACHE_FLASH_ATTR PROTO_Parse(PROTO_PARSER *parser, U8 *buf, U16 len)
|
||||
{
|
||||
while (len--)
|
||||
PROTO_ParseByte(parser, *buf++);
|
||||
|
||||
return 0;
|
||||
}
|
||||
I16 ICACHE_FLASH_ATTR PROTO_ParseRb(RINGBUF* rb, U8 *bufOut, U16* len, U16 maxBufLen)
|
||||
{
|
||||
U8 c;
|
||||
|
||||
PROTO_PARSER proto;
|
||||
PROTO_Init(&proto, NULL, bufOut, maxBufLen);
|
||||
while (RINGBUF_Get(rb, &c) == 0) {
|
||||
if (PROTO_ParseByte(&proto, c) == 0) {
|
||||
*len = proto.dataLen;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
I16 ICACHE_FLASH_ATTR PROTO_Add(U8 *buf, const U8 *packet, I16 bufSize)
|
||||
{
|
||||
U16 i = 2;
|
||||
U16 len = *(U16*) packet;
|
||||
|
||||
if (bufSize < 1) return -1;
|
||||
|
||||
*buf++ = 0x7E;
|
||||
bufSize--;
|
||||
|
||||
while (len--) {
|
||||
switch (*packet) {
|
||||
case 0x7D:
|
||||
case 0x7E:
|
||||
case 0x7F:
|
||||
if (bufSize < 2) return -1;
|
||||
*buf++ = 0x7D;
|
||||
*buf++ = *packet++ ^ 0x20;
|
||||
i += 2;
|
||||
bufSize -= 2;
|
||||
break;
|
||||
default:
|
||||
if (bufSize < 1) return -1;
|
||||
*buf++ = *packet++;
|
||||
i++;
|
||||
bufSize--;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (bufSize < 1) return -1;
|
||||
*buf++ = 0x7F;
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
I16 ICACHE_FLASH_ATTR PROTO_AddRb(RINGBUF *rb, const U8 *packet, I16 len)
|
||||
{
|
||||
U16 i = 2;
|
||||
if (RINGBUF_Put(rb, 0x7E) == -1) return -1;
|
||||
while (len--) {
|
||||
switch (*packet) {
|
||||
case 0x7D:
|
||||
case 0x7E:
|
||||
case 0x7F:
|
||||
if (RINGBUF_Put(rb, 0x7D) == -1) return -1;
|
||||
if (RINGBUF_Put(rb, *packet++ ^ 0x20) == -1) return -1;
|
||||
i += 2;
|
||||
break;
|
||||
default:
|
||||
if (RINGBUF_Put(rb, *packet++) == -1) return -1;
|
||||
i++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (RINGBUF_Put(rb, 0x7F) == -1) return -1;
|
||||
|
||||
return i;
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* File: proto.h
|
||||
* Author: ThuHien
|
||||
*
|
||||
* Created on November 23, 2012, 8:57 AM
|
||||
*/
|
||||
|
||||
#ifndef _PROTO_H_
|
||||
#define _PROTO_H_
|
||||
#include <stdlib.h>
|
||||
#include "typedef.h"
|
||||
#include "ringbuf.h"
|
||||
|
||||
typedef void(PROTO_PARSE_CALLBACK)();
|
||||
|
||||
typedef struct {
|
||||
U8 *buf;
|
||||
U16 bufSize;
|
||||
U16 dataLen;
|
||||
U8 isEsc;
|
||||
U8 isBegin;
|
||||
PROTO_PARSE_CALLBACK* callback;
|
||||
} PROTO_PARSER;
|
||||
|
||||
I8 ICACHE_FLASH_ATTR PROTO_Init(PROTO_PARSER *parser, PROTO_PARSE_CALLBACK *completeCallback, U8 *buf, U16 bufSize);
|
||||
I8 ICACHE_FLASH_ATTR PROTO_Parse(PROTO_PARSER *parser, U8 *buf, U16 len);
|
||||
I16 ICACHE_FLASH_ATTR PROTO_Add(U8 *buf, const U8 *packet, I16 bufSize);
|
||||
I16 ICACHE_FLASH_ATTR PROTO_AddRb(RINGBUF *rb, const U8 *packet, I16 len);
|
||||
I8 ICACHE_FLASH_ATTR PROTO_ParseByte(PROTO_PARSER *parser, U8 value);
|
||||
I16 ICACHE_FLASH_ATTR PROTO_ParseRb(RINGBUF *rb, U8 *bufOut, U16* len, U16 maxBufLen);
|
||||
#endif
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
/* str_queue.c
|
||||
*
|
||||
* Copyright (c) 2014-2015, Tuan PM <tuanpm at live dot com>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of Redis nor the names of its contributors may be used
|
||||
* to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include "queue.h"
|
||||
|
||||
#include "user_interface.h"
|
||||
#include "osapi.h"
|
||||
#include "os_type.h"
|
||||
#include "mem.h"
|
||||
#include "proto.h"
|
||||
|
||||
uint8_t *last_rb_p_r;
|
||||
uint8_t *last_rb_p_w;
|
||||
uint32_t last_fill_cnt;
|
||||
|
||||
void ICACHE_FLASH_ATTR QUEUE_Init(QUEUE *queue, int bufferSize)
|
||||
{
|
||||
queue->buf = (uint8_t*)os_zalloc(bufferSize);
|
||||
RINGBUF_Init(&queue->rb, queue->buf, bufferSize);
|
||||
}
|
||||
int32_t ICACHE_FLASH_ATTR QUEUE_Puts(QUEUE *queue, uint8_t* buffer, uint16_t len)
|
||||
{
|
||||
uint32_t ret;
|
||||
|
||||
last_rb_p_r = queue->rb.p_r;
|
||||
last_rb_p_w = queue->rb.p_w;
|
||||
last_fill_cnt = queue->rb.fill_cnt;
|
||||
|
||||
ret = PROTO_AddRb(&queue->rb, buffer, len);
|
||||
if (ret == -1) {
|
||||
// rolling ring buffer back
|
||||
queue->rb.p_r = last_rb_p_r;
|
||||
queue->rb.p_w = last_rb_p_w;
|
||||
queue->rb.fill_cnt = last_fill_cnt;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
int32_t ICACHE_FLASH_ATTR QUEUE_Gets(QUEUE *queue, uint8_t* buffer, uint16_t* len, uint16_t maxLen)
|
||||
{
|
||||
|
||||
return PROTO_ParseRb(&queue->rb, buffer, len, maxLen);
|
||||
}
|
||||
|
||||
bool ICACHE_FLASH_ATTR QUEUE_IsEmpty(QUEUE *queue)
|
||||
{
|
||||
if (queue->rb.fill_cnt <= 0)
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
/* str_queue.h --
|
||||
*
|
||||
* Copyright (c) 2014-2015, Tuan PM <tuanpm at live dot com>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of Redis nor the names of its contributors may be used
|
||||
* to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef USER_QUEUE_H_
|
||||
#define USER_QUEUE_H_
|
||||
#include "os_type.h"
|
||||
#include "ringbuf.h"
|
||||
typedef struct {
|
||||
uint8_t *buf;
|
||||
RINGBUF rb;
|
||||
} QUEUE;
|
||||
|
||||
void ICACHE_FLASH_ATTR QUEUE_Init(QUEUE *queue, int bufferSize);
|
||||
int32_t ICACHE_FLASH_ATTR QUEUE_Puts(QUEUE *queue, uint8_t* buffer, uint16_t len);
|
||||
int32_t ICACHE_FLASH_ATTR QUEUE_Gets(QUEUE *queue, uint8_t* buffer, uint16_t* len, uint16_t maxLen);
|
||||
bool ICACHE_FLASH_ATTR QUEUE_IsEmpty(QUEUE *queue);
|
||||
#endif /* USER_QUEUE_H_ */
|
|
@ -0,0 +1,67 @@
|
|||
/**
|
||||
* \file
|
||||
* Ring Buffer library
|
||||
*/
|
||||
|
||||
#include "ringbuf.h"
|
||||
|
||||
|
||||
/**
|
||||
* \brief init a RINGBUF object
|
||||
* \param r pointer to a RINGBUF object
|
||||
* \param buf pointer to a byte array
|
||||
* \param size size of buf
|
||||
* \return 0 if successfull, otherwise failed
|
||||
*/
|
||||
I16 ICACHE_FLASH_ATTR RINGBUF_Init(RINGBUF *r, U8* buf, I32 size)
|
||||
{
|
||||
if (r == NULL || buf == NULL || size < 2) return -1;
|
||||
|
||||
r->p_o = r->p_r = r->p_w = buf;
|
||||
r->fill_cnt = 0;
|
||||
r->size = size;
|
||||
|
||||
return 0;
|
||||
}
|
||||
/**
|
||||
* \brief put a character into ring buffer
|
||||
* \param r pointer to a ringbuf object
|
||||
* \param c character to be put
|
||||
* \return 0 if successfull, otherwise failed
|
||||
*/
|
||||
I16 ICACHE_FLASH_ATTR RINGBUF_Put(RINGBUF *r, U8 c)
|
||||
{
|
||||
if (r->fill_cnt >= r->size)return -1; // ring buffer is full, this should be atomic operation
|
||||
|
||||
|
||||
r->fill_cnt++; // increase filled slots count, this should be atomic operation
|
||||
|
||||
|
||||
*r->p_w++ = c; // put character into buffer
|
||||
|
||||
if (r->p_w >= r->p_o + r->size) // rollback if write pointer go pass
|
||||
r->p_w = r->p_o; // the physical boundary
|
||||
|
||||
return 0;
|
||||
}
|
||||
/**
|
||||
* \brief get a character from ring buffer
|
||||
* \param r pointer to a ringbuf object
|
||||
* \param c read character
|
||||
* \return 0 if successfull, otherwise failed
|
||||
*/
|
||||
I16 ICACHE_FLASH_ATTR RINGBUF_Get(RINGBUF *r, U8* c)
|
||||
{
|
||||
if (r->fill_cnt <= 0)return -1; // ring buffer is empty, this should be atomic operation
|
||||
|
||||
|
||||
r->fill_cnt--; // decrease filled slots count
|
||||
|
||||
|
||||
*c = *r->p_r++; // get the character out
|
||||
|
||||
if (r->p_r >= r->p_o + r->size) // rollback if write pointer go pass
|
||||
r->p_r = r->p_o; // the physical boundary
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
#ifndef _RING_BUF_H_
|
||||
#define _RING_BUF_H_
|
||||
|
||||
#include <os_type.h>
|
||||
#include <stdlib.h>
|
||||
#include "typedef.h"
|
||||
|
||||
typedef struct {
|
||||
U8* p_o; /**< Original pointer */
|
||||
U8* volatile p_r; /**< Read pointer */
|
||||
U8* volatile p_w; /**< Write pointer */
|
||||
volatile I32 fill_cnt; /**< Number of filled slots */
|
||||
I32 size; /**< Buffer size */
|
||||
} RINGBUF;
|
||||
|
||||
I16 ICACHE_FLASH_ATTR RINGBUF_Init(RINGBUF *r, U8* buf, I32 size);
|
||||
I16 ICACHE_FLASH_ATTR RINGBUF_Put(RINGBUF *r, U8 c);
|
||||
I16 ICACHE_FLASH_ATTR RINGBUF_Get(RINGBUF *r, U8* c);
|
||||
#endif
|
|
@ -0,0 +1,17 @@
|
|||
/**
|
||||
* \file
|
||||
* Standard Types definition
|
||||
*/
|
||||
|
||||
#ifndef _TYPE_DEF_H_
|
||||
#define _TYPE_DEF_H_
|
||||
|
||||
typedef char I8;
|
||||
typedef unsigned char U8;
|
||||
typedef short I16;
|
||||
typedef unsigned short U16;
|
||||
typedef long I32;
|
||||
typedef unsigned long U32;
|
||||
typedef unsigned long long U64;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,15 @@
|
|||
#ifndef __MQTT_CONFIG_H__
|
||||
#define __MQTT_CONFIG_H__
|
||||
|
||||
//#define MQTT_SSL_ENABLE
|
||||
|
||||
#define MQTT_RECONNECT_TIMEOUT 5 /*second*/
|
||||
|
||||
//#define MQTT_BUF_SIZE 1024
|
||||
#define MQTT_BUF_SIZE 512
|
||||
#define QUEUE_BUFFER_SIZE 2048
|
||||
|
||||
//#define PROTOCOL_NAMEv31 /*MQTT version 3.1 compatible with Mosquitto v0.15*/
|
||||
#define PROTOCOL_NAMEv311 /*MQTT version 3.11 compatible with https://eclipse.org/paho/clients/testing/*/
|
||||
|
||||
#endif // __MQTT_CONFIG_H__
|
|
@ -0,0 +1,149 @@
|
|||
/*
|
||||
* Copyright (c) 2014, Tuan PM
|
||||
* Email: tuanpm@live.com
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <math.h>
|
||||
#include <stddef.h>
|
||||
#include "utils.h"
|
||||
|
||||
|
||||
uint8_t ICACHE_FLASH_ATTR UTILS_IsIPV4 (int8_t *str)
|
||||
{
|
||||
uint8_t segs = 0; /* Segment count. */
|
||||
uint8_t chcnt = 0; /* Character count within segment. */
|
||||
uint8_t accum = 0; /* Accumulator for segment. */
|
||||
/* Catch NULL pointer. */
|
||||
if (str == 0)
|
||||
return 0;
|
||||
/* Process every character in string. */
|
||||
|
||||
while (*str != '\0') {
|
||||
/* Segment changeover. */
|
||||
|
||||
if (*str == '.') {
|
||||
/* Must have some digits in segment. */
|
||||
if (chcnt == 0)
|
||||
return 0;
|
||||
/* Limit number of segments. */
|
||||
if (++segs == 4)
|
||||
return 0;
|
||||
/* Reset segment values and restart loop. */
|
||||
chcnt = accum = 0;
|
||||
str++;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Check numeric. */
|
||||
if ((*str < '0') || (*str > '9'))
|
||||
return 0;
|
||||
|
||||
/* Accumulate and check segment. */
|
||||
|
||||
if ((accum = accum * 10 + *str - '0') > 255)
|
||||
return 0;
|
||||
/* Advance other segment specific stuff and continue loop. */
|
||||
|
||||
chcnt++;
|
||||
str++;
|
||||
}
|
||||
|
||||
/* Check enough segments and enough characters in last segment. */
|
||||
|
||||
if (segs != 3)
|
||||
return 0;
|
||||
if (chcnt == 0)
|
||||
return 0;
|
||||
/* Address okay. */
|
||||
|
||||
return 1;
|
||||
}
|
||||
uint8_t ICACHE_FLASH_ATTR UTILS_StrToIP(const int8_t* str, void *ip)
|
||||
{
|
||||
|
||||
/* The count of the number of bytes processed. */
|
||||
int i;
|
||||
/* A pointer to the next digit to process. */
|
||||
const char * start;
|
||||
|
||||
start = str;
|
||||
for (i = 0; i < 4; i++) {
|
||||
/* The digit being processed. */
|
||||
char c;
|
||||
/* The value of this byte. */
|
||||
int n = 0;
|
||||
while (1) {
|
||||
c = * start;
|
||||
start++;
|
||||
if (c >= '0' && c <= '9') {
|
||||
n *= 10;
|
||||
n += c - '0';
|
||||
}
|
||||
/* We insist on stopping at "." if we are still parsing
|
||||
the first, second, or third numbers. If we have reached
|
||||
the end of the numbers, we will allow any character. */
|
||||
else if ((i < 3 && c == '.') || i == 3) {
|
||||
break;
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (n >= 256) {
|
||||
return 0;
|
||||
}
|
||||
((uint8_t*)ip)[i] = n;
|
||||
}
|
||||
return 1;
|
||||
|
||||
}
|
||||
uint32_t ICACHE_FLASH_ATTR UTILS_Atoh(const int8_t *s)
|
||||
{
|
||||
uint32_t value = 0, digit;
|
||||
int8_t c;
|
||||
|
||||
while ((c = *s++)) {
|
||||
if ('0' <= c && c <= '9')
|
||||
digit = c - '0';
|
||||
else if ('A' <= c && c <= 'F')
|
||||
digit = c - 'A' + 10;
|
||||
else if ('a' <= c && c <= 'f')
|
||||
digit = c - 'a' + 10;
|
||||
else break;
|
||||
|
||||
value = (value << 4) | digit;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
#ifndef _UTILS_H_
|
||||
#define _UTILS_H_
|
||||
|
||||
#include "c_types.h"
|
||||
|
||||
uint32_t ICACHE_FLASH_ATTR UTILS_Atoh(const int8_t *s);
|
||||
uint8_t ICACHE_FLASH_ATTR UTILS_StrToIP(const int8_t* str, void *ip);
|
||||
uint8_t ICACHE_FLASH_ATTR UTILS_IsIPV4 (int8_t *str);
|
||||
#endif
|
|
@ -1,6 +1,6 @@
|
|||
# TasmotaSerial
|
||||
|
||||
Implementation of software serial library for the ESP8266 at 9600 baud
|
||||
Implementation of software serial library for the ESP8266
|
||||
|
||||
Allows for several instances to be active at the same time.
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
"name": "TasmotaSerial",
|
||||
"version": "1.0.0",
|
||||
"version": "1.2.0",
|
||||
"keywords": [
|
||||
"serial", "io", "TasmotaSerial"
|
||||
],
|
||||
"description": "Implementation of software serial for ESP8266 at 9600 baud.",
|
||||
"description": "Implementation of software serial for ESP8266.",
|
||||
"repository":
|
||||
{
|
||||
"type": "git",
|
|
@ -1,8 +1,8 @@
|
|||
name=TasmotaSerial
|
||||
version=1.0
|
||||
version=1.2.0
|
||||
author=Theo Arends
|
||||
maintainer=Theo Arends <theo@arends.com>
|
||||
sentence=Implementation of software serial for ESP8266 at 9600 baud.
|
||||
sentence=Implementation of software serial for ESP8266.
|
||||
paragraph=
|
||||
category=Signal Input/Output
|
||||
url=
|
|
@ -87,9 +87,7 @@ TasmotaSerial::TasmotaSerial(int receive_pin, int transmit_pin)
|
|||
m_in_pos = m_out_pos = 0;
|
||||
if (m_rx_pin > -1) {
|
||||
m_buffer = (uint8_t*)malloc(TM_SERIAL_BUFFER_SIZE);
|
||||
if (m_buffer == NULL) {
|
||||
return;
|
||||
}
|
||||
if (m_buffer == NULL) return;
|
||||
// Use getCycleCount() loop to get as exact timing as possible
|
||||
m_bit_time = ESP.getCpuFreqMHz() *1000000 /TM_SERIAL_BAUDRATE;
|
||||
pinMode(m_rx_pin, INPUT);
|
||||
|
@ -111,7 +109,8 @@ bool TasmotaSerial::isValidGPIOpin(int pin)
|
|||
bool TasmotaSerial::begin(long speed) {
|
||||
// Use getCycleCount() loop to get as exact timing as possible
|
||||
m_bit_time = ESP.getCpuFreqMHz() *1000000 /speed;
|
||||
return m_valid && (speed <= TM_SERIAL_BAUDRATE);
|
||||
m_high_speed = (speed > 9600);
|
||||
return m_valid;
|
||||
}
|
||||
|
||||
bool TasmotaSerial::begin() {
|
||||
|
@ -123,17 +122,13 @@ void TasmotaSerial::flush() {
|
|||
}
|
||||
|
||||
int TasmotaSerial::peek() {
|
||||
if ((-1 == m_rx_pin) || (m_in_pos == m_out_pos)) {
|
||||
return -1;
|
||||
}
|
||||
if ((-1 == m_rx_pin) || (m_in_pos == m_out_pos)) return -1;
|
||||
return m_buffer[m_out_pos];
|
||||
}
|
||||
|
||||
int TasmotaSerial::read()
|
||||
{
|
||||
if ((-1 == m_rx_pin) || (m_in_pos == m_out_pos)) {
|
||||
return -1;
|
||||
}
|
||||
if ((-1 == m_rx_pin) || (m_in_pos == m_out_pos)) return -1;
|
||||
uint8_t ch = m_buffer[m_out_pos];
|
||||
m_out_pos = (m_out_pos +1) % TM_SERIAL_BUFFER_SIZE;
|
||||
return ch;
|
||||
|
@ -142,23 +137,20 @@ int TasmotaSerial::read()
|
|||
int TasmotaSerial::available()
|
||||
{
|
||||
int avail = m_in_pos - m_out_pos;
|
||||
if (avail < 0) {
|
||||
avail += TM_SERIAL_BUFFER_SIZE;
|
||||
}
|
||||
if (avail < 0) avail += TM_SERIAL_BUFFER_SIZE;
|
||||
return avail;
|
||||
}
|
||||
|
||||
#ifdef TM_SERIAL_USE_IRAM
|
||||
#define TM_SERIAL_WAIT { while (ESP.getCycleCount()-start < wait) optimistic_yield(1); wait += m_bit_time; } // Watchdog timeouts
|
||||
#define TM_SERIAL_WAIT { while (ESP.getCycleCount()-start < wait) if (!m_high_speed) optimistic_yield(1); wait += m_bit_time; } // Watchdog timeouts
|
||||
#else
|
||||
#define TM_SERIAL_WAIT { while (ESP.getCycleCount()-start < wait); wait += m_bit_time; }
|
||||
#endif
|
||||
|
||||
size_t TasmotaSerial::write(uint8_t b)
|
||||
{
|
||||
if (-1 == m_tx_pin) {
|
||||
return 0;
|
||||
}
|
||||
if (-1 == m_tx_pin) return 0;
|
||||
if (m_high_speed) cli(); // Disable interrupts in order to get a clean transmit
|
||||
unsigned long wait = m_bit_time;
|
||||
digitalWrite(m_tx_pin, HIGH);
|
||||
unsigned long start = ESP.getCycleCount();
|
||||
|
@ -173,6 +165,7 @@ size_t TasmotaSerial::write(uint8_t b)
|
|||
// Stop bit
|
||||
digitalWrite(m_tx_pin, HIGH);
|
||||
TM_SERIAL_WAIT;
|
||||
if (m_high_speed) sei();
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -191,9 +184,7 @@ void TasmotaSerial::rxRead()
|
|||
for (int i = 0; i < 8; i++) {
|
||||
TM_SERIAL_WAIT;
|
||||
rec >>= 1;
|
||||
if (digitalRead(m_rx_pin)) {
|
||||
rec |= 0x80;
|
||||
}
|
||||
if (digitalRead(m_rx_pin)) rec |= 0x80;
|
||||
}
|
||||
// Stop bit
|
||||
TM_SERIAL_WAIT;
|
|
@ -20,12 +20,12 @@
|
|||
#ifndef TasmotaSerial_h
|
||||
#define TasmotaSerial_h
|
||||
/*********************************************************************************************\
|
||||
* TasmotaSerial supports up to 9600 baud with fixed buffer size of 64 bytes using optional no iram
|
||||
* TasmotaSerial supports up to 115200 baud with fixed buffer size of 64 bytes using optional no iram
|
||||
*
|
||||
* Based on EspSoftwareSerial v3.3.1 by Peter Lerup (https://github.com/plerup/espsoftwareserial)
|
||||
\*********************************************************************************************/
|
||||
|
||||
#define TM_SERIAL_BAUDRATE 9600 // Max supported baudrate
|
||||
#define TM_SERIAL_BAUDRATE 9600 // Default baudrate
|
||||
#define TM_SERIAL_BUFFER_SIZE 64 // Receive buffer size
|
||||
|
||||
#include <core_version.h> // Arduino_Esp8266 version information (ARDUINO_ESP8266_RELEASE and ARDUINO_ESP8266_RELEASE_2_3_0)
|
||||
|
@ -57,6 +57,7 @@ class TasmotaSerial : public Stream {
|
|||
|
||||
// Member variables
|
||||
bool m_valid;
|
||||
bool m_high_speed;
|
||||
int m_rx_pin;
|
||||
int m_tx_pin;
|
||||
unsigned long m_bit_time;
|
|
@ -0,0 +1,72 @@
|
|||
/**
|
||||
* esp-knx-ip library for KNX/IP communication on an ESP8266
|
||||
* Author: Nico Weichbrodt <envy>
|
||||
* License: MIT
|
||||
*/
|
||||
|
||||
typedef enum __dpt_1_001
|
||||
{
|
||||
DPT_1_001_OFF = 0x00,
|
||||
DPT_1_001_ON = 0x01,
|
||||
} dpt_1_001_t;
|
||||
|
||||
typedef enum __dpt_2_001
|
||||
{
|
||||
DPT_2_001_NO_OFF = 0b00,
|
||||
DPT_2_001_NO_ON = 0b01,
|
||||
DPT_2_001_YES_OFF = 0b10,
|
||||
DPT_2_001_YES_ON = 0b11,
|
||||
} dpt_2_001_t;
|
||||
|
||||
typedef enum __dpt_3_007
|
||||
{
|
||||
DPT_3_007_DECREASE_STOP = 0x00,
|
||||
DPT_3_007_DECREASE_100 = 0x01,
|
||||
DPT_3_007_DECREASE_50 = 0x02,
|
||||
DPT_3_007_DECREASE_25 = 0x03,
|
||||
DPT_3_007_DECREASE_12 = 0x04,
|
||||
DPT_3_007_DECREASE_6 = 0x05,
|
||||
DPT_3_007_DECREASE_3 = 0x06,
|
||||
DPT_3_007_DECREASE_1 = 0x07,
|
||||
DPT_3_007_INCREASE_STOP = 0x08,
|
||||
DPT_3_007_INCREASE_100 = 0x09,
|
||||
DPT_3_007_INCREASE_50 = 0x0A,
|
||||
DPT_3_007_INCREASE_25 = 0x0B,
|
||||
DPT_3_007_INCREASE_12 = 0x0C,
|
||||
DPT_3_007_INCREASE_6 = 0x0D,
|
||||
DPT_3_007_INCREASE_3 = 0x0E,
|
||||
DPT_3_007_INCREASE_1 = 0x0F,
|
||||
} dpt_3_007_t;
|
||||
|
||||
typedef enum __weekday
|
||||
{
|
||||
DPT_10_001_WEEKDAY_MONDAY = 1,
|
||||
DPT_10_001_WEEKDAY_TUESDAY = 2,
|
||||
DPT_10_001_WEEKDAY_WEDNESDAY = 3,
|
||||
DPT_10_001_WEEKDAY_THURSDAY = 4,
|
||||
DPT_10_001_WEEKDAY_FRIDAY = 5,
|
||||
DPT_10_001_WEEKDAY_SATURDAY = 6,
|
||||
DPT_10_001_WEEKDAY_SUNDAY = 8,
|
||||
} weekday_t;
|
||||
|
||||
typedef struct __time_of_day
|
||||
{
|
||||
weekday_t weekday;
|
||||
uint8_t hours;
|
||||
uint8_t minutes;
|
||||
uint8_t seconds;
|
||||
} time_of_day_t;
|
||||
|
||||
typedef struct __date
|
||||
{
|
||||
uint8_t day;
|
||||
uint8_t month;
|
||||
uint8_t year;
|
||||
} date_t;
|
||||
|
||||
typedef struct __color
|
||||
{
|
||||
uint8_t red;
|
||||
uint8_t green;
|
||||
uint8_t blue;
|
||||
} color_t;
|
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2018 Nico Weichbrodt <nico@weichbrodt.me>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
|
@ -0,0 +1,94 @@
|
|||
# ESP-KNX-IP #
|
||||
|
||||
This is a library for the ESP8266 to enable KNXnet/IP communication. It uses UDP multicast on 224.0.23.12:3671.
|
||||
It is intended to be used with the Arduino platform for the ESP8266.
|
||||
|
||||
## How to use ##
|
||||
|
||||
The library is under development. API may change multiple times in the future.
|
||||
|
||||
API documentation is available [here](https://github.com/envy/esp-knx-ip/wiki/API)
|
||||
|
||||
A simple example:
|
||||
|
||||
```c++
|
||||
#include <esp-knx-ip.h>
|
||||
|
||||
const char* ssid = "my-ssid"; // your network SSID (name)
|
||||
const char* pass = "my-pw"; // your network password
|
||||
|
||||
config_id_t my_GA;
|
||||
config_id_t param_id;
|
||||
|
||||
int8_t some_var = 0;
|
||||
|
||||
void setup()
|
||||
{
|
||||
// Register a callback that is called when a configurable group address is receiving a telegram
|
||||
knx.register_callback("Set/Get callback", my_callback);
|
||||
knx.register_callback("Write callback", my_other_callback);
|
||||
|
||||
int default_val = 21;
|
||||
param_id = knx.config_register_int("My Parameter", default_val);
|
||||
|
||||
// Register a configurable group address for sending out answers
|
||||
my_GA = knx.config_register_ga("Answer GA");
|
||||
|
||||
knx.load(); // Try to load a config from EEPROM
|
||||
|
||||
WiFi.begin(ssid, pass);
|
||||
while (WiFi.status() != WL_CONNECTED) {
|
||||
delay(500);
|
||||
}
|
||||
|
||||
knx.start(); // Start everything. Must be called after WiFi connection has been established
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
knx.loop();
|
||||
}
|
||||
|
||||
|
||||
void my_callback(message_t const &msg, void *arg)
|
||||
{
|
||||
switch (msg.ct)
|
||||
{
|
||||
case KNX_CT_WRITE:
|
||||
// Save received data
|
||||
some_var = knx.data_to_1byte_int(msg.data);
|
||||
break;
|
||||
case KNX_CT_READ:
|
||||
// Answer with saved data
|
||||
knx.answer1ByteInt(msg.received_on, some_var);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void my_other_callback(message_t const &msg, void *arg)
|
||||
{
|
||||
switch (msg.ct)
|
||||
{
|
||||
case KNX_CT_WRITE:
|
||||
// Write an answer somewhere else
|
||||
int value = knx.config_get_int(param_id);
|
||||
address_t ga = knx.config_get_ga(my_GA);
|
||||
knx.answer1ByteInt(ga, (int8_t)value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## How to configure (buildtime) ##
|
||||
|
||||
Open the `esp-knx-ip.h` and take a look at the config options at the top inside the block marked `CONFIG`
|
||||
|
||||
## How to configure (runtime) ##
|
||||
|
||||
Simply visit the IP of your ESP with a webbrowser. You can configure the following:
|
||||
* KNX physical address
|
||||
* Which group address should trigger which callback
|
||||
* Which group address are to be used by the program (e.g. for status replies)
|
||||
|
||||
The configuration is dynamically generated from the code.
|
|
@ -0,0 +1,358 @@
|
|||
/**
|
||||
* esp-knx-ip library for KNX/IP communication on an ESP8266
|
||||
* Author: Nico Weichbrodt <envy>
|
||||
* License: MIT
|
||||
*/
|
||||
|
||||
#include "esp-knx-ip.h"
|
||||
|
||||
/**
|
||||
* Physical address functions
|
||||
*/
|
||||
|
||||
void ESPKNXIP::physical_address_set(address_t const &addr)
|
||||
{
|
||||
physaddr = addr;
|
||||
}
|
||||
|
||||
address_t ESPKNXIP::physical_address_get()
|
||||
{
|
||||
return physaddr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Configuration functions start here
|
||||
*/
|
||||
config_id_t ESPKNXIP::config_register_string(String name, uint8_t len, String _default, enable_condition_t cond)
|
||||
{
|
||||
if (registered_configs >= MAX_CONFIGS)
|
||||
return -1;
|
||||
|
||||
if (_default.length() >= len)
|
||||
return -1;
|
||||
|
||||
config_id_t id = registered_configs;
|
||||
|
||||
custom_configs[id].name = name;
|
||||
custom_configs[id].type = CONFIG_TYPE_STRING;
|
||||
custom_configs[id].len = sizeof(uint8_t) + len;
|
||||
custom_configs[id].cond = cond;
|
||||
if (id == 0)
|
||||
custom_configs[id].offset = 0;
|
||||
else
|
||||
custom_configs[id].offset = custom_configs[id - 1].offset + custom_configs[id - 1].len;
|
||||
|
||||
__config_set_string(id, _default);
|
||||
|
||||
registered_configs++;
|
||||
|
||||
DEBUG_PRINT("Registered config >");
|
||||
DEBUG_PRINT(name);
|
||||
DEBUG_PRINT("< @ ");
|
||||
DEBUG_PRINT(id);
|
||||
DEBUG_PRINT("/string[");
|
||||
DEBUG_PRINT(custom_configs[id].offset);
|
||||
DEBUG_PRINT("+");
|
||||
DEBUG_PRINT(custom_configs[id].len);
|
||||
DEBUG_PRINTLN("]");
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
config_id_t ESPKNXIP::config_register_int(String name, int32_t _default, enable_condition_t cond)
|
||||
{
|
||||
if (registered_configs >= MAX_CONFIGS)
|
||||
return -1;
|
||||
|
||||
config_id_t id = registered_configs;
|
||||
|
||||
custom_configs[id].name = name;
|
||||
custom_configs[id].type = CONFIG_TYPE_INT;
|
||||
custom_configs[id].len = sizeof(uint8_t) + sizeof(int32_t);
|
||||
custom_configs[id].cond = cond;
|
||||
if (id == 0)
|
||||
custom_configs[id].offset = 0;
|
||||
else
|
||||
custom_configs[id].offset = custom_configs[id - 1].offset + custom_configs[id - 1].len;
|
||||
|
||||
__config_set_int(id, _default);
|
||||
|
||||
registered_configs++;
|
||||
|
||||
DEBUG_PRINT("Registered config >");
|
||||
DEBUG_PRINT(name);
|
||||
DEBUG_PRINT("< @ ");
|
||||
DEBUG_PRINT(id);
|
||||
DEBUG_PRINT("/int[");
|
||||
DEBUG_PRINT(custom_configs[id].offset);
|
||||
DEBUG_PRINT("+");
|
||||
DEBUG_PRINT(custom_configs[id].len);
|
||||
DEBUG_PRINTLN("]");
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
config_id_t ESPKNXIP::config_register_bool(String name, bool _default, enable_condition_t cond)
|
||||
{
|
||||
if (registered_configs >= MAX_CONFIGS)
|
||||
return -1;
|
||||
|
||||
config_id_t id = registered_configs;
|
||||
|
||||
custom_configs[id].name = name;
|
||||
custom_configs[id].type = CONFIG_TYPE_BOOL;
|
||||
custom_configs[id].len = sizeof(uint8_t) + sizeof(uint8_t);
|
||||
custom_configs[id].cond = cond;
|
||||
if (id == 0)
|
||||
custom_configs[id].offset = 0;
|
||||
else
|
||||
custom_configs[id].offset = custom_configs[id - 1].offset + custom_configs[id - 1].len;
|
||||
|
||||
__config_set_bool(id, _default);
|
||||
|
||||
registered_configs++;
|
||||
|
||||
DEBUG_PRINT("Registered config >");
|
||||
DEBUG_PRINT(name);
|
||||
DEBUG_PRINT("< @ ");
|
||||
DEBUG_PRINT(id);
|
||||
DEBUG_PRINT("/bool[");
|
||||
DEBUG_PRINT(custom_configs[id].offset);
|
||||
DEBUG_PRINT("+");
|
||||
DEBUG_PRINT(custom_configs[id].len);
|
||||
DEBUG_PRINTLN("]");
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
config_id_t ESPKNXIP::config_register_options(String name, option_entry_t *options, uint8_t _default, enable_condition_t cond)
|
||||
{
|
||||
if (registered_configs >= MAX_CONFIGS)
|
||||
return -1;
|
||||
|
||||
if (options == nullptr || options->name == nullptr)
|
||||
return -1;
|
||||
|
||||
config_id_t id = registered_configs;
|
||||
|
||||
custom_configs[id].name = name;
|
||||
custom_configs[id].type = CONFIG_TYPE_OPTIONS;
|
||||
custom_configs[id].len = sizeof(uint8_t) + sizeof(uint8_t);
|
||||
custom_configs[id].cond = cond;
|
||||
if (id == 0)
|
||||
custom_configs[id].offset = 0;
|
||||
else
|
||||
custom_configs[id].offset = custom_configs[id - 1].offset + custom_configs[id - 1].len;
|
||||
|
||||
custom_configs[id].data.options = options;
|
||||
|
||||
__config_set_options(id, _default);
|
||||
|
||||
registered_configs++;
|
||||
|
||||
DEBUG_PRINT("Registered config >");
|
||||
DEBUG_PRINT(name);
|
||||
DEBUG_PRINT("< @ ");
|
||||
DEBUG_PRINT(id);
|
||||
DEBUG_PRINT("/opt[");
|
||||
DEBUG_PRINT(custom_configs[id].offset);
|
||||
DEBUG_PRINT("+");
|
||||
DEBUG_PRINT(custom_configs[id].len);
|
||||
DEBUG_PRINTLN("]");
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
config_id_t ESPKNXIP::config_register_ga(String name, enable_condition_t cond)
|
||||
{
|
||||
if (registered_configs >= MAX_CONFIGS)
|
||||
return -1;
|
||||
|
||||
config_id_t id = registered_configs;
|
||||
|
||||
custom_configs[id].name = name;
|
||||
custom_configs[id].type = CONFIG_TYPE_GA;
|
||||
custom_configs[id].len = sizeof(uint8_t) + sizeof(address_t);
|
||||
custom_configs[id].cond = cond;
|
||||
if (id == 0)
|
||||
custom_configs[id].offset = 0;
|
||||
else
|
||||
custom_configs[id].offset = custom_configs[id - 1].offset + custom_configs[id - 1].len;
|
||||
|
||||
address_t t;
|
||||
t.value = 0;
|
||||
__config_set_ga(id, t);
|
||||
|
||||
registered_configs++;
|
||||
|
||||
DEBUG_PRINT("Registered config >");
|
||||
DEBUG_PRINT(name);
|
||||
DEBUG_PRINT("< @ ");
|
||||
DEBUG_PRINT(id);
|
||||
DEBUG_PRINT("/ga[");
|
||||
DEBUG_PRINT(custom_configs[id].offset);
|
||||
DEBUG_PRINT("+");
|
||||
DEBUG_PRINT(custom_configs[id].len);
|
||||
DEBUG_PRINTLN("]");
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
void ESPKNXIP::__config_set_flags(config_id_t id, config_flags_t flags)
|
||||
{
|
||||
DEBUG_PRINT("Setting flag @ ");
|
||||
DEBUG_PRINT(custom_configs[id].offset);
|
||||
DEBUG_PRINT(" to ");
|
||||
DEBUG_PRINT(custom_config_data[custom_configs[id].offset], BIN);
|
||||
DEBUG_PRINT(" | ");
|
||||
DEBUG_PRINT(flags, BIN);
|
||||
custom_config_data[custom_configs[id].offset] |= (uint8_t)flags;
|
||||
DEBUG_PRINT(" = ");
|
||||
DEBUG_PRINTLN(custom_config_data[custom_configs[id].offset], BIN);
|
||||
}
|
||||
|
||||
void ESPKNXIP::config_set_string(config_id_t id, String val)
|
||||
{
|
||||
if (id >= registered_configs)
|
||||
return;
|
||||
if (custom_configs[id].type != CONFIG_TYPE_STRING)
|
||||
return;
|
||||
if (val.length() >= custom_configs[id].len)
|
||||
return;
|
||||
__config_set_flags(id, CONFIG_FLAGS_VALUE_SET);
|
||||
__config_set_string(id, val);
|
||||
}
|
||||
|
||||
void ESPKNXIP::__config_set_string(config_id_t id, String &val)
|
||||
{
|
||||
memcpy(&custom_config_data[custom_configs[id].offset + sizeof(uint8_t)], val.c_str(), val.length()+1);
|
||||
}
|
||||
|
||||
void ESPKNXIP::config_set_int(config_id_t id, int32_t val)
|
||||
{
|
||||
if (id >= registered_configs)
|
||||
return;
|
||||
if (custom_configs[id].type != CONFIG_TYPE_INT)
|
||||
return;
|
||||
__config_set_flags(id, CONFIG_FLAGS_VALUE_SET);
|
||||
__config_set_int(id, val);
|
||||
}
|
||||
|
||||
void ESPKNXIP::__config_set_int(config_id_t id, int32_t val)
|
||||
{
|
||||
// This does not work for some reason:
|
||||
// Could be due to pointer alignment
|
||||
//int32_t *v = (int32_t *)(custom_config_data + custom_configs[id].offset);
|
||||
//*v = val;
|
||||
custom_config_data[custom_configs[id].offset + sizeof(uint8_t) + 0] = (uint8_t)((val & 0xFF000000) >> 24);
|
||||
custom_config_data[custom_configs[id].offset + sizeof(uint8_t) + 1] = (uint8_t)((val & 0x00FF0000) >> 16);
|
||||
custom_config_data[custom_configs[id].offset + sizeof(uint8_t) + 2] = (uint8_t)((val & 0x0000FF00) >> 8);
|
||||
custom_config_data[custom_configs[id].offset + sizeof(uint8_t) + 3] = (uint8_t)((val & 0x000000FF) >> 0);
|
||||
}
|
||||
|
||||
void ESPKNXIP::config_set_bool(config_id_t id, bool val)
|
||||
{
|
||||
if (id >= registered_configs)
|
||||
return;
|
||||
if (custom_configs[id].type != CONFIG_TYPE_BOOL)
|
||||
return;
|
||||
__config_set_flags(id, CONFIG_FLAGS_VALUE_SET);
|
||||
__config_set_bool(id, val);
|
||||
}
|
||||
|
||||
void ESPKNXIP::__config_set_bool(config_id_t id, bool val)
|
||||
{
|
||||
custom_config_data[custom_configs[id].offset + sizeof(uint8_t)] = val ? 1 : 0;
|
||||
}
|
||||
|
||||
void ESPKNXIP::config_set_options(config_id_t id, uint8_t val)
|
||||
{
|
||||
if (id >= registered_configs)
|
||||
return;
|
||||
if (custom_configs[id].type != CONFIG_TYPE_OPTIONS)
|
||||
return;
|
||||
|
||||
option_entry_t *cur = custom_configs[id].data.options;
|
||||
while (cur->name != nullptr)
|
||||
{
|
||||
if (cur->value == val)
|
||||
{
|
||||
__config_set_flags(id, CONFIG_FLAGS_VALUE_SET);
|
||||
__config_set_options(id, val);
|
||||
break;
|
||||
}
|
||||
cur++;
|
||||
}
|
||||
}
|
||||
|
||||
void ESPKNXIP::__config_set_options(config_id_t id, uint8_t val)
|
||||
{
|
||||
custom_config_data[custom_configs[id].offset + sizeof(uint8_t)] = val;
|
||||
}
|
||||
|
||||
void ESPKNXIP::config_set_ga(config_id_t id, address_t const &val)
|
||||
{
|
||||
if (id >= registered_configs)
|
||||
return;
|
||||
if (custom_configs[id].type != CONFIG_TYPE_GA)
|
||||
return;
|
||||
__config_set_flags(id, CONFIG_FLAGS_VALUE_SET);
|
||||
__config_set_ga(id, val);
|
||||
}
|
||||
|
||||
void ESPKNXIP::__config_set_ga(config_id_t id, address_t const &val)
|
||||
{
|
||||
custom_config_data[custom_configs[id].offset + sizeof(uint8_t) + 0] = val.bytes.high;
|
||||
custom_config_data[custom_configs[id].offset + sizeof(uint8_t) + 1] = val.bytes.low;
|
||||
}
|
||||
|
||||
String ESPKNXIP::config_get_string(config_id_t id)
|
||||
{
|
||||
if (id >= registered_configs)
|
||||
return String("");
|
||||
|
||||
return String((char *)&custom_config_data[custom_configs[id].offset + sizeof(uint8_t)]);
|
||||
}
|
||||
|
||||
int32_t ESPKNXIP::config_get_int(config_id_t id)
|
||||
{
|
||||
if (id >= registered_configs)
|
||||
return 0;
|
||||
|
||||
int32_t v = (custom_config_data[custom_configs[id].offset + sizeof(uint8_t) + 0] << 24) +
|
||||
(custom_config_data[custom_configs[id].offset + sizeof(uint8_t) + 1] << 16) +
|
||||
(custom_config_data[custom_configs[id].offset + sizeof(uint8_t) + 2] << 8) +
|
||||
(custom_config_data[custom_configs[id].offset + sizeof(uint8_t) + 3] << 0);
|
||||
return v;
|
||||
}
|
||||
|
||||
bool ESPKNXIP::config_get_bool(config_id_t id)
|
||||
{
|
||||
if (id >= registered_configs)
|
||||
return false;
|
||||
|
||||
return custom_config_data[custom_configs[id].offset + sizeof(uint8_t)] != 0;
|
||||
}
|
||||
|
||||
uint8_t ESPKNXIP::config_get_options(config_id_t id)
|
||||
{
|
||||
if (id >= registered_configs)
|
||||
return false;
|
||||
|
||||
return custom_config_data[custom_configs[id].offset + sizeof(uint8_t)];
|
||||
}
|
||||
|
||||
address_t ESPKNXIP::config_get_ga(config_id_t id)
|
||||
{
|
||||
address_t t;
|
||||
if (id >= registered_configs)
|
||||
{
|
||||
t.value = 0;
|
||||
return t;
|
||||
}
|
||||
|
||||
t.bytes.high = custom_config_data[custom_configs[id].offset + sizeof(uint8_t) + 0];
|
||||
t.bytes.low = custom_config_data[custom_configs[id].offset + sizeof(uint8_t) + 1];
|
||||
|
||||
return t;
|
||||
}
|
|
@ -0,0 +1,87 @@
|
|||
/**
|
||||
* esp-knx-ip library for KNX/IP communication on an ESP8266
|
||||
* Author: Nico Weichbrodt <envy>
|
||||
* License: MIT
|
||||
*/
|
||||
|
||||
#include "esp-knx-ip.h"
|
||||
|
||||
/**
|
||||
* Conversion functions
|
||||
*/
|
||||
|
||||
bool ESPKNXIP::data_to_bool(uint8_t *data)
|
||||
{
|
||||
return (data[0] & 0x01) == 1 ? true : false;
|
||||
}
|
||||
|
||||
int8_t ESPKNXIP::data_to_1byte_int(uint8_t *data)
|
||||
{
|
||||
return (int8_t)data[1];
|
||||
}
|
||||
|
||||
uint8_t ESPKNXIP::data_to_1byte_uint(uint8_t *data)
|
||||
{
|
||||
return data[1];
|
||||
}
|
||||
|
||||
int16_t ESPKNXIP::data_to_2byte_int(uint8_t *data)
|
||||
{
|
||||
return (int16_t)((data[1] << 8) | data[2]);
|
||||
}
|
||||
|
||||
uint16_t ESPKNXIP::data_to_2byte_uint(uint8_t *data)
|
||||
{
|
||||
return (uint16_t)((data[1] << 8) | data[2]);
|
||||
}
|
||||
|
||||
float ESPKNXIP::data_to_2byte_float(uint8_t *data)
|
||||
{
|
||||
//uint8_t sign = (data[1] & 0b10000000) >> 7;
|
||||
uint8_t expo = (data[1] & 0b01111000) >> 3;
|
||||
int16_t mant = ((data[1] & 0b10000111) << 8) | data[2];
|
||||
return 0.01f * mant * pow(2, expo);
|
||||
}
|
||||
|
||||
time_of_day_t ESPKNXIP::data_to_3byte_time(uint8_t *data)
|
||||
{
|
||||
time_of_day_t time;
|
||||
time.weekday = (weekday_t)((data[1] & 0b11100000) >> 5);
|
||||
time.hours = (data[1] & 0b00011111);
|
||||
time.minutes = (data[2] & 0b00111111);
|
||||
time.seconds = (data[3] & 0b00111111);
|
||||
return time;
|
||||
}
|
||||
|
||||
date_t ESPKNXIP::data_to_3byte_data(uint8_t *data)
|
||||
{
|
||||
date_t date;
|
||||
date.day = (data[1] & 0b00011111);
|
||||
date.month = (data[2] & 0b00001111);
|
||||
date.year = (data[3] & 0b01111111);
|
||||
return date;
|
||||
}
|
||||
|
||||
color_t ESPKNXIP::data_to_3byte_color(uint8_t *data)
|
||||
{
|
||||
color_t color;
|
||||
color.red = data[1];
|
||||
color.green = data[2];
|
||||
color.blue = data[3];
|
||||
return color;
|
||||
}
|
||||
|
||||
int32_t ESPKNXIP::data_to_4byte_int(uint8_t *data)
|
||||
{
|
||||
return (int32_t)((data[1] << 24) | (data[2] << 16) | (data[3] << 8) | (data[4] << 0));
|
||||
}
|
||||
|
||||
uint32_t ESPKNXIP::data_to_4byte_uint(uint8_t *data)
|
||||
{
|
||||
return (uint32_t)((data[1] << 24) | (data[2] << 16) | (data[3] << 8) | (data[4] << 0));
|
||||
}
|
||||
|
||||
float ESPKNXIP::data_to_4byte_float(uint8_t *data)
|
||||
{
|
||||
return (float)((data[1] << 24) | (data[2] << 16) | (data[3] << 8) |data[4]);
|
||||
}
|
|
@ -0,0 +1,182 @@
|
|||
/**
|
||||
* esp-knx-ip library for KNX/IP communication on an ESP8266
|
||||
* Author: Nico Weichbrodt <envy>
|
||||
* License: MIT
|
||||
*/
|
||||
|
||||
#include "esp-knx-ip.h"
|
||||
|
||||
/**
|
||||
* Send functions
|
||||
*/
|
||||
|
||||
void ESPKNXIP::send(address_t const &receiver, knx_command_type_t ct, uint8_t data_len, uint8_t *data)
|
||||
{
|
||||
if (receiver.value == 0)
|
||||
return;
|
||||
|
||||
#if SEND_CHECKSUM
|
||||
uint32_t len = 6 + 2 + 8 + data_len + 1; // knx_pkt + cemi_msg + cemi_service + data + checksum
|
||||
#else
|
||||
uint32_t len = 6 + 2 + 8 + data_len; // knx_pkt + cemi_msg + cemi_service + data
|
||||
#endif
|
||||
DEBUG_PRINT(F("Creating packet with len "));
|
||||
DEBUG_PRINTLN(len)
|
||||
uint8_t buf[len];
|
||||
knx_ip_pkt_t *knx_pkt = (knx_ip_pkt_t *)buf;
|
||||
knx_pkt->header_len = 0x06;
|
||||
knx_pkt->protocol_version = 0x10;
|
||||
knx_pkt->service_type = __ntohs(KNX_ST_ROUTING_INDICATION);
|
||||
knx_pkt->total_len.len = __ntohs(len);
|
||||
cemi_msg_t *cemi_msg = (cemi_msg_t *)knx_pkt->pkt_data;
|
||||
cemi_msg->message_code = KNX_MT_L_DATA_IND;
|
||||
cemi_msg->additional_info_len = 0;
|
||||
cemi_service_t *cemi_data = &cemi_msg->data.service_information;
|
||||
cemi_data->control_1.bits.confirm = 0;
|
||||
cemi_data->control_1.bits.ack = 0;
|
||||
cemi_data->control_1.bits.priority = B11;
|
||||
cemi_data->control_1.bits.system_broadcast = 0x01;
|
||||
cemi_data->control_1.bits.repeat = 0x01;
|
||||
cemi_data->control_1.bits.reserved = 0;
|
||||
cemi_data->control_1.bits.frame_type = 0x01;
|
||||
cemi_data->control_2.bits.extended_frame_format = 0x00;
|
||||
cemi_data->control_2.bits.hop_count = 0x06;
|
||||
cemi_data->control_2.bits.dest_addr_type = 0x01;
|
||||
cemi_data->source = physaddr;
|
||||
cemi_data->destination = receiver;
|
||||
//cemi_data->destination.bytes.high = (area << 3) | line;
|
||||
//cemi_data->destination.bytes.low = member;
|
||||
cemi_data->data_len = data_len;
|
||||
cemi_data->pci.apci = (ct & 0x0C) >> 2;
|
||||
cemi_data->pci.tpci_seq_number = 0x00; // ???
|
||||
cemi_data->pci.tpci_comm_type = KNX_COT_UDP; // ???
|
||||
memcpy(cemi_data->data, data, data_len);
|
||||
cemi_data->data[0] = (cemi_data->data[0] & 0x3F) | ((ct & 0x03) << 6);
|
||||
|
||||
#if SEND_CHECKSUM
|
||||
// Calculate checksum, which is just XOR of all bytes
|
||||
uint8_t cs = buf[0] ^ buf[1];
|
||||
for (uint32_t i = 2; i < len - 1; ++i)
|
||||
{
|
||||
cs ^= buf[i];
|
||||
}
|
||||
buf[len - 1] = cs;
|
||||
#endif
|
||||
|
||||
#ifdef ESP_KNX_DEBUG
|
||||
DEBUG_PRINT(F("Sending packet:"));
|
||||
for (int i = 0; i < len; ++i)
|
||||
{
|
||||
DEBUG_PRINT(F(" 0x"));
|
||||
DEBUG_PRINT(buf[i], 16);
|
||||
}
|
||||
DEBUG_PRINTLN(F(""));
|
||||
#endif
|
||||
|
||||
udp.beginPacketMulticast(MULTICAST_IP, MULTICAST_PORT, WiFi.localIP());
|
||||
udp.write(buf, len);
|
||||
udp.endPacket();
|
||||
}
|
||||
|
||||
void ESPKNXIP::send_1bit(address_t const &receiver, knx_command_type_t ct, uint8_t bit)
|
||||
{
|
||||
uint8_t buf[] = {(uint8_t)(bit & 0b00000001)};
|
||||
send(receiver, ct, 1, buf);
|
||||
}
|
||||
|
||||
void ESPKNXIP::send_2bit(address_t const &receiver, knx_command_type_t ct, uint8_t twobit)
|
||||
{
|
||||
uint8_t buf[] = {(uint8_t)(twobit & 0b00000011)};
|
||||
send(receiver, ct, 1, buf);
|
||||
}
|
||||
|
||||
void ESPKNXIP::send_4bit(address_t const &receiver, knx_command_type_t ct, uint8_t fourbit)
|
||||
{
|
||||
uint8_t buf[] = {(uint8_t)(fourbit & 0b00001111)};
|
||||
send(receiver, ct, 1, buf);
|
||||
}
|
||||
|
||||
void ESPKNXIP::send_1byte_int(address_t const &receiver, knx_command_type_t ct, int8_t val)
|
||||
{
|
||||
uint8_t buf[] = {0x00, (uint8_t)val};
|
||||
send(receiver, ct, 2, buf);
|
||||
}
|
||||
|
||||
void ESPKNXIP::send_1byte_uint(address_t const &receiver, knx_command_type_t ct, uint8_t val)
|
||||
{
|
||||
uint8_t buf[] = {0x00, val};
|
||||
send(receiver, ct, 2, buf);
|
||||
}
|
||||
|
||||
void ESPKNXIP::send_2byte_int(address_t const &receiver, knx_command_type_t ct, int16_t val)
|
||||
{
|
||||
uint8_t buf[] = {0x00, (uint8_t)(val >> 8), (uint8_t)(val & 0x00FF)};
|
||||
send(receiver, ct, 3, buf);
|
||||
}
|
||||
|
||||
void ESPKNXIP::send_2byte_uint(address_t const &receiver, knx_command_type_t ct, uint16_t val)
|
||||
{
|
||||
uint8_t buf[] = {0x00, (uint8_t)(val >> 8), (uint8_t)(val & 0x00FF)};
|
||||
send(receiver, ct, 3, buf);
|
||||
}
|
||||
|
||||
void ESPKNXIP::send_2byte_float(address_t const &receiver, knx_command_type_t ct, float val)
|
||||
{
|
||||
float v = val * 100.0f;
|
||||
int e = 0;
|
||||
for (; v < -2048.0f; v /= 2)
|
||||
++e;
|
||||
for (; v > 2047.0f; v /= 2)
|
||||
++e;
|
||||
long m = round(v) & 0x7FF;
|
||||
short msb = (short) (e << 3 | m >> 8);
|
||||
if (val < 0.0f)
|
||||
msb |= 0x80;
|
||||
uint8_t buf[] = {0x00, (uint8_t)msb, (uint8_t)m};
|
||||
send(receiver, ct, 3, buf);
|
||||
}
|
||||
|
||||
void ESPKNXIP::send_3byte_time(address_t const &receiver, knx_command_type_t ct, uint8_t weekday, uint8_t hours, uint8_t minutes, uint8_t seconds)
|
||||
{
|
||||
weekday <<= 5;
|
||||
uint8_t buf[] = {0x00, (uint8_t)(((weekday << 5) & 0xE0) | (hours & 0x1F)), (uint8_t)(minutes & 0x3F), (uint8_t)(seconds & 0x3F)};
|
||||
send(receiver, ct, 4, buf);
|
||||
}
|
||||
|
||||
void ESPKNXIP::send_3byte_date(address_t const &receiver, knx_command_type_t ct, uint8_t day, uint8_t month, uint8_t year)
|
||||
{
|
||||
uint8_t buf[] = {0x00, (uint8_t)(day & 0x1F), (uint8_t)(month & 0x0F), year};
|
||||
send(receiver, ct, 4, buf);
|
||||
}
|
||||
|
||||
void ESPKNXIP::send_3byte_color(address_t const &receiver, knx_command_type_t ct, uint8_t red, uint8_t green, uint8_t blue)
|
||||
{
|
||||
uint8_t buf[] = {0x00, red, green, blue};
|
||||
send(receiver, ct, 4, buf);
|
||||
}
|
||||
|
||||
void ESPKNXIP::send_4byte_int(address_t const &receiver, knx_command_type_t ct, int32_t val)
|
||||
{
|
||||
uint8_t buf[] = {0x00,
|
||||
(uint8_t)((val & 0xFF000000) >> 24),
|
||||
(uint8_t)((val & 0x00FF0000) >> 16),
|
||||
(uint8_t)((val & 0x0000FF00) >> 8),
|
||||
(uint8_t)((val & 0x000000FF) >> 0)};
|
||||
send(receiver, ct, 5, buf);
|
||||
}
|
||||
|
||||
void ESPKNXIP::send_4byte_uint(address_t const &receiver, knx_command_type_t ct, uint32_t val)
|
||||
{
|
||||
uint8_t buf[] = {0x00,
|
||||
(uint8_t)((val & 0xFF000000) >> 24),
|
||||
(uint8_t)((val & 0x00FF0000) >> 16),
|
||||
(uint8_t)((val & 0x0000FF00) >> 8),
|
||||
(uint8_t)((val & 0x000000FF) >> 0)};
|
||||
send(receiver, ct, 5, buf);
|
||||
}
|
||||
|
||||
void ESPKNXIP::send_4byte_float(address_t const &receiver, knx_command_type_t ct, float val)
|
||||
{
|
||||
uint8_t buf[] = {0x00, ((uint8_t *)&val)[3], ((uint8_t *)&val)[2], ((uint8_t *)&val)[1], ((uint8_t *)&val)[0]};
|
||||
send(receiver, ct, 5, buf);
|
||||
}
|
|
@ -0,0 +1,540 @@
|
|||
/**
|
||||
* esp-knx-ip library for KNX/IP communication on an ESP8266
|
||||
* Author: Nico Weichbrodt <envy>
|
||||
* License: MIT
|
||||
*/
|
||||
|
||||
#include "esp-knx-ip.h"
|
||||
|
||||
void ESPKNXIP::__handle_root()
|
||||
{
|
||||
String m = F("<html><head><meta charset='utf-8'><meta name='viewport' content='width=device-width, initial-scale=1, shrink-to-fit=no'>");
|
||||
#if USE_BOOTSTRAP
|
||||
m += F("<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css' integrity='sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm' crossorigin='anonymous'>");
|
||||
m += F("<style>.input-group-insert > .input-group-text { border-radius: 0; }</style>");
|
||||
#endif
|
||||
m += F("</head><body><div class='container-fluid'>");
|
||||
m += F("<h2>ESP KNX</h2>");
|
||||
|
||||
// Feedback
|
||||
|
||||
if (registered_feedbacks > 0)
|
||||
{
|
||||
m += F("<h4>Feedback</h4>");
|
||||
for (feedback_id_t i = 0; i < registered_feedbacks; ++i)
|
||||
{
|
||||
if (feedbacks[i].cond && !feedbacks[i].cond())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
m += F("<form action='" __FEEDBACK_PATH "' method='POST'>");
|
||||
m += F("<div class='row'><div class='col-auto'><div class='input-group'>");
|
||||
m += F("<div class='input-group-prepend'><span class='input-group-text'>");
|
||||
m += feedbacks[i].name;
|
||||
m += F("</span></div>");
|
||||
switch (feedbacks[i].type)
|
||||
{
|
||||
case FEEDBACK_TYPE_INT:
|
||||
m += F("<span class='input-group-text'>");
|
||||
m += String(*(int32_t *)feedbacks[i].data);
|
||||
m += F("</span>");
|
||||
break;
|
||||
case FEEDBACK_TYPE_FLOAT:
|
||||
m += F("<span class='input-group-text'>");
|
||||
m += feedbacks[i].options.float_options.prefix;
|
||||
m += String(*(float *)feedbacks[i].data, feedbacks[i].options.float_options.precision);
|
||||
m += feedbacks[i].options.float_options.suffix;
|
||||
m += F("</span>");
|
||||
break;
|
||||
case FEEDBACK_TYPE_BOOL:
|
||||
m += F("<span class='input-group-text'>");
|
||||
m += (*(bool *)feedbacks[i].data) ? F("True") : F("False");
|
||||
m += F("</span>");
|
||||
break;
|
||||
case FEEDBACK_TYPE_ACTION:
|
||||
m += F("<input class='form-control' type='hidden' name='id' value='");
|
||||
m += i;
|
||||
m += F("' /><div class='input-group-append'><button type='submit' class='btn btn-primary'>");
|
||||
m += feedbacks[i].options.action_options.btn_text;
|
||||
m += F("</button></div>");
|
||||
break;
|
||||
}
|
||||
m += F("</div></div></div>");
|
||||
m += F("</form>");
|
||||
}
|
||||
}
|
||||
|
||||
if (registered_callbacks > 0)
|
||||
m += F("<h4>Callbacks</h4>");
|
||||
|
||||
if (registered_callback_assignments > 0)
|
||||
{
|
||||
for (uint8_t i = 0; i < registered_callback_assignments; ++i)
|
||||
{
|
||||
// Skip empty slots
|
||||
if ((callback_assignments[i].slot_flags & SLOT_FLAGS_USED) == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
// Skip disabled callbacks
|
||||
if (callbacks[callback_assignments[i].callback_id].cond && !callbacks[callback_assignments[i].callback_id].cond())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
address_t &addr = callback_assignments[i].address;
|
||||
m += F("<form action='" __DELETE_PATH "' method='POST'>");
|
||||
m += F("<div class='row'><div class='col-auto'><div class='input-group'>");
|
||||
m += F("<div class='input-group-prepend'><span class='input-group-text'>");
|
||||
m += addr.ga.area;
|
||||
m += F("/");
|
||||
m += addr.ga.line;
|
||||
m += F("/");
|
||||
m += addr.ga.member;
|
||||
m += F("</span>");
|
||||
m += F("<span class='input-group-text'>");
|
||||
m += callbacks[callback_assignments[i].callback_id].name;
|
||||
m += F("</span></div>");
|
||||
m += F("<input class='form-control' type='hidden' name='id' value='");
|
||||
m += i;
|
||||
m += F("' /><div class='input-group-append'><button type='submit' class='btn btn-danger'>Delete</button></div>");
|
||||
m += F("</div></div></div>");
|
||||
m += F("</form>");
|
||||
}
|
||||
}
|
||||
|
||||
if (registered_callbacks > 0)
|
||||
{
|
||||
m += F("<form action='" __REGISTER_PATH "' method='POST'>");
|
||||
m += F("<div class='row'><div class='col-auto'><div class='input-group'>");
|
||||
m += F("<input class='form-control' type='number' name='area' min='0' max='31'/>");
|
||||
m += F("<div class='input-group-insert'><span class='input-group-text'>/</span></div>");
|
||||
m += F("<input class='form-control' type='number' name='line' min='0' max='7'/>");
|
||||
m += F("<div class='input-group-insert'><span class='input-group-text'>/</span></div>");
|
||||
m += F("<input class='form-control' type='number' name='member' min='0' max='255'/>");
|
||||
m += F("<div class='input-group-insert'><span class='input-group-text'>-></span></div>");
|
||||
m += F("<select class='form-control' name='cb'>");
|
||||
for (callback_id_t i = 0; i < registered_callbacks; ++i)
|
||||
{
|
||||
// Skip empty slots
|
||||
if ((callbacks[i].slot_flags & SLOT_FLAGS_USED) == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
// Skip disabled callbacks
|
||||
if (callbacks[i].cond && !callbacks[i].cond())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
m += F("<option value=\"");
|
||||
m += i;
|
||||
m += F("\">");
|
||||
m += callbacks[i].name;
|
||||
m += F("</option>");
|
||||
}
|
||||
m += F("</select>");
|
||||
m += F("<div class='input-group-append'><button type='submit' class='btn btn-primary'>Set</button></div>");
|
||||
m += F("</div></div></div>");
|
||||
m += F("</form>");
|
||||
}
|
||||
|
||||
m += F("<h4>Configuration</h4>");
|
||||
|
||||
// Physical address
|
||||
m += F("<form action='" __PHYS_PATH "' method='POST'>");
|
||||
m += F("<div class='row'><div class='col-auto'><div class='input-group'>");
|
||||
m += F("<div class='input-group-prepend'><span class='input-group-text'>Physical address</span></div>");
|
||||
m += F("<input class='form-control' type='number' name='area' min='0' max='15' value='");
|
||||
m += physaddr.pa.area;
|
||||
m += F("'/>");
|
||||
m += F("<div class='input-group-insert'><span class='input-group-text'>.</span></div>");
|
||||
m += F("<input class='form-control' type='number' name='line' min='0' max='15' value='");
|
||||
m += physaddr.pa.line;
|
||||
m += F("'/>");
|
||||
m += F("<div class='input-group-insert'><span class='input-group-text'>.</span></div>");
|
||||
m += F("<input class='form-control' type='number' name='member' min='0' max='255' value='");
|
||||
m += physaddr.pa.member;
|
||||
m += F("'/>");
|
||||
m += F("<div class='input-group-append'><button type='submit' class='btn btn-primary'>Set</button></div>");
|
||||
m += F("</div></div></div>");
|
||||
m += F("</form>");
|
||||
|
||||
if (registered_configs > 0)
|
||||
{
|
||||
for (config_id_t i = 0; i < registered_configs; ++i)
|
||||
{
|
||||
// Check if this config option has a enable condition and if so check that condition
|
||||
if (custom_configs[i].cond && !custom_configs[i].cond())
|
||||
continue;
|
||||
|
||||
m += F("<form action='" __CONFIG_PATH "' method='POST'>");
|
||||
m += F("<div class='row'><div class='col-auto'><div class='input-group'>");
|
||||
m += F("<div class='input-group-prepend'><span class='input-group-text'>");
|
||||
m += custom_configs[i].name;
|
||||
m += F("</span></div>");
|
||||
|
||||
switch (custom_configs[i].type)
|
||||
{
|
||||
case CONFIG_TYPE_STRING:
|
||||
m += F("<input class='form-control' type='text' name='value' value='");
|
||||
m += config_get_string(i);
|
||||
m += F("' maxlength='");
|
||||
m += custom_configs[i].len - 1; // Subtract \0 byte
|
||||
m += F("'/>");
|
||||
break;
|
||||
case CONFIG_TYPE_INT:
|
||||
m += F("<input class='form-control' type='number' name='value' value='");
|
||||
m += config_get_int(i);
|
||||
m += F("'/>");
|
||||
break;
|
||||
case CONFIG_TYPE_BOOL:
|
||||
m += F("<div class='input-group-insert'><span class='input-group-text'>");
|
||||
m += F("<input type='checkbox' name='value' ");
|
||||
if (config_get_bool(i))
|
||||
m += F("checked ");
|
||||
m += F("/>");
|
||||
m += F("</span></div>");
|
||||
break;
|
||||
case CONFIG_TYPE_OPTIONS:
|
||||
{
|
||||
m += F("<select class='custom-select' name='value'>");
|
||||
option_entry_t *cur = custom_configs[i].data.options;
|
||||
while (cur->name != nullptr)
|
||||
{
|
||||
if (config_get_options(i) == cur->value)
|
||||
{
|
||||
m += F("<option selected value='");
|
||||
}
|
||||
else
|
||||
{
|
||||
m += F("<option value='");
|
||||
}
|
||||
m += cur->value;
|
||||
m += F("'>");
|
||||
m += String(cur->name);
|
||||
m += F("</option>");
|
||||
cur++;
|
||||
}
|
||||
m += F("");
|
||||
m += F("</select>");
|
||||
break;
|
||||
}
|
||||
case CONFIG_TYPE_GA:
|
||||
address_t a = config_get_ga(i);
|
||||
m += F("<input class='form-control' type='number' name='area' min='0' max='31' value='");
|
||||
m += a.ga.area;
|
||||
m += F("'/>");
|
||||
m += F("<div class='input-group-insert'><span class='input-group-text'>/</span></div>");
|
||||
m += F("<input class='form-control' type='number' name='line' min='0' max='7' value='");
|
||||
m += a.ga.line;
|
||||
m += F("'/>");
|
||||
m += F("<div class='input-group-insert'><span class='input-group-text'>/</span></div>");
|
||||
m += F("<input class='form-control' type='number' name='member' min='0' max='255' value='");
|
||||
m += a.ga.member;
|
||||
m += F("'/>");
|
||||
break;
|
||||
}
|
||||
m += F("<input type='hidden' name='id' value='");
|
||||
m += i;
|
||||
m += F("'/>");
|
||||
m += F("<div class='input-group-append'><button type='submit' class='btn btn-primary'>Set</button></div>");
|
||||
m += F("</div></div></div>");
|
||||
m += F("</form>");
|
||||
}
|
||||
}
|
||||
|
||||
#if !(DISABLE_EEPROM_BUTTONS && DISABLE_RESTORE_BUTTON && DISABLE_REBOOT_BUTTON)
|
||||
// EEPROM save and restore
|
||||
m += F("<div class='row'>");
|
||||
// Save to EEPROM
|
||||
#if !DISABLE_EEPROM_BUTTONS
|
||||
m += F("<div class='col-auto'>");
|
||||
m += F("<form action='" __EEPROM_PATH "' method='POST'>");
|
||||
m += F("<input type='hidden' name='mode' value='1'>");
|
||||
m += F("<button type='submit' class='btn btn-success'>Save to EEPROM</button>");
|
||||
m += F("</form>");
|
||||
m += F("</div>");
|
||||
// Restore from EEPROM
|
||||
m += F("<div class='col-auto'>");
|
||||
m += F("<form action='" __EEPROM_PATH "' method='POST'>");
|
||||
m += F("<input type='hidden' name='mode' value='2'>");
|
||||
m += F("<button type='submit' class='btn btn-info'>Restore from EEPROM</button>");
|
||||
m += F("</form>");
|
||||
m += F("</div>");
|
||||
#endif
|
||||
#if !DISABLE_RESTORE_BUTTON
|
||||
// Load Defaults
|
||||
m += F("<div class='col-auto'>");
|
||||
m += F("<form action='" __RESTORE_PATH "' method='POST'>");
|
||||
m += F("<button type='submit' class='btn btn-warning'>Restore defaults</button>");
|
||||
m += F("</form>");
|
||||
m += F("</div>");
|
||||
#endif
|
||||
#if !DISABLE_REBOOT_BUTTON
|
||||
// Reboot
|
||||
m += F("<div class='col-auto'>");
|
||||
m += F("<form action='" __REBOOT_PATH "' method='POST'>");
|
||||
m += F("<button type='submit' class='btn btn-danger'>Reboot</button>");
|
||||
m += F("</form>");
|
||||
m += F("</div>");
|
||||
#endif
|
||||
m += F("</div>"); // row
|
||||
#endif
|
||||
|
||||
// End of page
|
||||
m += F("</div></body></html>");
|
||||
server->send(200, F("text/html"), m);
|
||||
}
|
||||
|
||||
void ESPKNXIP::__handle_register()
|
||||
{
|
||||
DEBUG_PRINTLN(F("Register called"));
|
||||
if (server->hasArg(F("area")) && server->hasArg(F("line")) && server->hasArg(F("member")) && server->hasArg(F("cb")))
|
||||
{
|
||||
uint8_t area = server->arg(F("area")).toInt();
|
||||
uint8_t line = server->arg(F("line")).toInt();
|
||||
uint8_t member = server->arg(F("member")).toInt();
|
||||
callback_id_t cb = (callback_id_t)server->arg(F("cb")).toInt();
|
||||
|
||||
DEBUG_PRINT(F("Got args: "));
|
||||
DEBUG_PRINT(area);
|
||||
DEBUG_PRINT(F("/"));
|
||||
DEBUG_PRINT(line);
|
||||
DEBUG_PRINT(F("/"));
|
||||
DEBUG_PRINT(member);
|
||||
DEBUG_PRINT(F("/"));
|
||||
DEBUG_PRINT(cb);
|
||||
DEBUG_PRINTLN(F(""));
|
||||
|
||||
if (area > 31 || line > 7)
|
||||
{
|
||||
DEBUG_PRINTLN(F("Area or Line wrong"));
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (!__callback_is_id_valid(cb))
|
||||
{
|
||||
DEBUG_PRINTLN(F("Invalid callback id"));
|
||||
goto end;
|
||||
}
|
||||
address_t ga = {.ga={line, area, member}};
|
||||
__callback_register_assignment(ga, cb);
|
||||
}
|
||||
end:
|
||||
server->sendHeader(F("Location"),F(__ROOT_PATH));
|
||||
server->send(302);
|
||||
}
|
||||
|
||||
void ESPKNXIP::__handle_delete()
|
||||
{
|
||||
DEBUG_PRINTLN(F("Delete called"));
|
||||
if (server->hasArg(F("id")))
|
||||
{
|
||||
callback_assignment_id_t id = (callback_assignment_id_t)server->arg(F("id")).toInt();
|
||||
|
||||
DEBUG_PRINT(F("Got args: "));
|
||||
DEBUG_PRINT(id);
|
||||
DEBUG_PRINTLN(F(""));
|
||||
|
||||
if (id >= registered_callback_assignments || (callback_assignments[id].slot_flags & SLOT_FLAGS_USED) == 0)
|
||||
{
|
||||
DEBUG_PRINTLN(F("ID wrong"));
|
||||
goto end;
|
||||
}
|
||||
|
||||
__callback_delete_assignment(id);
|
||||
}
|
||||
end:
|
||||
server->sendHeader(F("Location"),F(__ROOT_PATH));
|
||||
server->send(302);
|
||||
}
|
||||
|
||||
void ESPKNXIP::__handle_set()
|
||||
{
|
||||
DEBUG_PRINTLN(F("Set called"));
|
||||
if (server->hasArg(F("area")) && server->hasArg(F("line")) && server->hasArg(F("member")))
|
||||
{
|
||||
uint8_t area = server->arg(F("area")).toInt();
|
||||
uint8_t line = server->arg(F("line")).toInt();
|
||||
uint8_t member = server->arg(F("member")).toInt();
|
||||
|
||||
DEBUG_PRINT(F("Got args: "));
|
||||
DEBUG_PRINT(area);
|
||||
DEBUG_PRINT(F("."));
|
||||
DEBUG_PRINT(line);
|
||||
DEBUG_PRINT(F("."));
|
||||
DEBUG_PRINT(member);
|
||||
DEBUG_PRINTLN(F(""));
|
||||
|
||||
if (area > 31 || line > 7)
|
||||
{
|
||||
DEBUG_PRINTLN(F("Area or Line wrong"));
|
||||
goto end;
|
||||
}
|
||||
|
||||
physaddr.bytes.high = (area << 4) | line;
|
||||
physaddr.bytes.low = member;
|
||||
}
|
||||
end:
|
||||
server->sendHeader(F("Location"),F(__ROOT_PATH));
|
||||
server->send(302);
|
||||
}
|
||||
|
||||
void ESPKNXIP::__handle_config()
|
||||
{
|
||||
DEBUG_PRINTLN(F("Config called"));
|
||||
if (server->hasArg(F("id")))
|
||||
{
|
||||
config_id_t id = server->arg(F("id")).toInt();
|
||||
|
||||
DEBUG_PRINT(F("Got args: "));
|
||||
DEBUG_PRINT(id);
|
||||
DEBUG_PRINTLN(F(""));
|
||||
|
||||
if (id < 0 || id >= registered_configs)
|
||||
{
|
||||
DEBUG_PRINTLN(F("ID wrong"));
|
||||
goto end;
|
||||
}
|
||||
|
||||
switch (custom_configs[id].type)
|
||||
{
|
||||
case CONFIG_TYPE_STRING:
|
||||
{
|
||||
String v = server->arg(F("value"));
|
||||
if (v.length() >= custom_configs[id].len)
|
||||
goto end;
|
||||
__config_set_flags(id, CONFIG_FLAGS_VALUE_SET);
|
||||
__config_set_string(id, v);
|
||||
break;
|
||||
}
|
||||
case CONFIG_TYPE_INT:
|
||||
{
|
||||
__config_set_flags(id, CONFIG_FLAGS_VALUE_SET);
|
||||
__config_set_int(id, server->arg(F("value")).toInt());
|
||||
break;
|
||||
}
|
||||
case CONFIG_TYPE_BOOL:
|
||||
{
|
||||
__config_set_flags(id, CONFIG_FLAGS_VALUE_SET);
|
||||
__config_set_bool(id, server->arg(F("value")).compareTo(F("on")) == 0);
|
||||
break;
|
||||
}
|
||||
case CONFIG_TYPE_OPTIONS:
|
||||
{
|
||||
uint8_t val = (uint8_t)server->arg(F("value")).toInt();
|
||||
DEBUG_PRINT(F("Value: "));
|
||||
DEBUG_PRINTLN(val);
|
||||
config_set_options(id, val);
|
||||
break;
|
||||
}
|
||||
case CONFIG_TYPE_GA:
|
||||
{
|
||||
uint8_t area = server->arg(F("area")).toInt();
|
||||
uint8_t line = server->arg(F("line")).toInt();
|
||||
uint8_t member = server->arg(F("member")).toInt();
|
||||
if (area > 31 || line > 7)
|
||||
{
|
||||
DEBUG_PRINTLN(F("Area or Line wrong"));
|
||||
goto end;
|
||||
}
|
||||
address_t tmp;
|
||||
tmp.bytes.high = (area << 3) | line;
|
||||
tmp.bytes.low = member;
|
||||
__config_set_flags(id, CONFIG_FLAGS_VALUE_SET);
|
||||
__config_set_ga(id, tmp);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
end:
|
||||
server->sendHeader(F("Location"),F(__ROOT_PATH));
|
||||
server->send(302);
|
||||
}
|
||||
|
||||
void ESPKNXIP::__handle_feedback()
|
||||
{
|
||||
DEBUG_PRINTLN(F("Feedback called"));
|
||||
if (server->hasArg(F("id")))
|
||||
{
|
||||
config_id_t id = server->arg(F("id")).toInt();
|
||||
|
||||
DEBUG_PRINT(F("Got args: "));
|
||||
DEBUG_PRINT(id);
|
||||
DEBUG_PRINTLN(F(""));
|
||||
|
||||
if (id < 0 || id >= registered_feedbacks)
|
||||
{
|
||||
DEBUG_PRINTLN(F("ID wrong"));
|
||||
goto end;
|
||||
}
|
||||
|
||||
switch (feedbacks[id].type)
|
||||
{
|
||||
case FEEDBACK_TYPE_ACTION:
|
||||
{
|
||||
feedback_action_fptr_t func = (feedback_action_fptr_t)feedbacks[id].data;
|
||||
void *arg = feedbacks[id].options.action_options.arg;
|
||||
func(arg);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
DEBUG_PRINTLN(F("Feedback has no action"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
end:
|
||||
server->sendHeader(F("Location"),F(__ROOT_PATH));
|
||||
server->send(302);
|
||||
}
|
||||
|
||||
#if !DISABLE_RESTORE_BUTTONS
|
||||
void ESPKNXIP::__handle_restore()
|
||||
{
|
||||
DEBUG_PRINTLN(F("Restore called"));
|
||||
memcpy(custom_config_data, custom_config_default_data, MAX_CONFIG_SPACE);
|
||||
end:
|
||||
server->sendHeader(F("Location"),F(__ROOT_PATH));
|
||||
server->send(302);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !DISABLE_REBOOT_BUTTONS
|
||||
void ESPKNXIP::__handle_reboot()
|
||||
{
|
||||
DEBUG_PRINTLN(F("Rebooting!"));
|
||||
server->sendHeader(F("Location"),F(__ROOT_PATH));
|
||||
server->send(302);
|
||||
delay(1000);
|
||||
ESP.restart();
|
||||
//while(1);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !DISABLE_EEPROM_BUTTONS
|
||||
void ESPKNXIP::__handle_eeprom()
|
||||
{
|
||||
DEBUG_PRINTLN(F("EEPROM called"));
|
||||
if (server->hasArg(F("mode")))
|
||||
{
|
||||
uint8_t mode = server->arg(F("mode")).toInt();
|
||||
|
||||
DEBUG_PRINT(F("Got args: "));
|
||||
DEBUG_PRINT(mode);
|
||||
DEBUG_PRINTLN(F(""));
|
||||
|
||||
if (mode == 1)
|
||||
{
|
||||
// save
|
||||
save_to_eeprom();
|
||||
}
|
||||
else if (mode == 2)
|
||||
{
|
||||
// restore
|
||||
restore_from_eeprom();
|
||||
}
|
||||
}
|
||||
end:
|
||||
server->sendHeader(F("Location"),F(__ROOT_PATH));
|
||||
server->send(302);
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,659 @@
|
|||
/**
|
||||
* esp-knx-ip library for KNX/IP communication on an ESP8266
|
||||
* Author: Nico Weichbrodt <envy>
|
||||
* License: MIT
|
||||
*/
|
||||
|
||||
#include "esp-knx-ip.h"
|
||||
|
||||
char const *string_defaults[] =
|
||||
{
|
||||
"Do this",
|
||||
"True",
|
||||
"False",
|
||||
""
|
||||
};
|
||||
|
||||
ESPKNXIP::ESPKNXIP() : server(nullptr),
|
||||
registered_callback_assignments(0),
|
||||
free_callback_assignment_slots(0),
|
||||
registered_callbacks(0),
|
||||
free_callback_slots(0),
|
||||
registered_configs(0),
|
||||
registered_feedbacks(0)
|
||||
{
|
||||
DEBUG_PRINTLN();
|
||||
DEBUG_PRINTLN("ESPKNXIP starting up");
|
||||
// Default physical address is 1.1.0
|
||||
physaddr.bytes.high = (/*area*/1 << 4) | /*line*/1;
|
||||
physaddr.bytes.low = /*member*/0;
|
||||
memset(callback_assignments, 0, MAX_CALLBACK_ASSIGNMENTS * sizeof(callback_assignment_t));
|
||||
memset(callbacks, 0, MAX_CALLBACKS * sizeof(callback_fptr_t));
|
||||
memset(custom_config_data, 0, MAX_CONFIG_SPACE * sizeof(uint8_t));
|
||||
memset(custom_config_default_data, 0, MAX_CONFIG_SPACE * sizeof(uint8_t));
|
||||
memset(custom_configs, 0, MAX_CONFIGS * sizeof(config_t));
|
||||
}
|
||||
|
||||
void ESPKNXIP::load()
|
||||
{
|
||||
memcpy(custom_config_default_data, custom_config_data, MAX_CONFIG_SPACE);
|
||||
EEPROM.begin(EEPROM_SIZE);
|
||||
restore_from_eeprom();
|
||||
}
|
||||
|
||||
void ESPKNXIP::start(ESP8266WebServer *srv)
|
||||
{
|
||||
server = srv;
|
||||
__start();
|
||||
}
|
||||
|
||||
void ESPKNXIP::start()
|
||||
{
|
||||
server = new ESP8266WebServer(80);
|
||||
__start();
|
||||
}
|
||||
|
||||
void ESPKNXIP::__start()
|
||||
{
|
||||
if (server != nullptr)
|
||||
{
|
||||
server->on(ROOT_PREFIX, [this](){
|
||||
__handle_root();
|
||||
});
|
||||
server->on(__ROOT_PATH, [this](){
|
||||
__handle_root();
|
||||
});
|
||||
server->on(__REGISTER_PATH, [this](){
|
||||
__handle_register();
|
||||
});
|
||||
server->on(__DELETE_PATH, [this](){
|
||||
__handle_delete();
|
||||
});
|
||||
server->on(__PHYS_PATH, [this](){
|
||||
__handle_set();
|
||||
});
|
||||
#if !DISABLE_EEPROM_BUTTONS
|
||||
server->on(__EEPROM_PATH, [this](){
|
||||
__handle_eeprom();
|
||||
});
|
||||
#endif
|
||||
server->on(__CONFIG_PATH, [this](){
|
||||
__handle_config();
|
||||
});
|
||||
server->on(__FEEDBACK_PATH, [this](){
|
||||
__handle_feedback();
|
||||
});
|
||||
#if !DISABLE_RESTORE_BUTTON
|
||||
server->on(__RESTORE_PATH, [this](){
|
||||
__handle_restore();
|
||||
});
|
||||
#endif
|
||||
#if !DISABLE_REBOOT_BUTTON
|
||||
server->on(__REBOOT_PATH, [this](){
|
||||
__handle_reboot();
|
||||
});
|
||||
#endif
|
||||
server->begin();
|
||||
}
|
||||
|
||||
udp.beginMulticast(WiFi.localIP(), MULTICAST_IP, MULTICAST_PORT);
|
||||
}
|
||||
|
||||
void ESPKNXIP::save_to_eeprom()
|
||||
{
|
||||
uint32_t address = 0;
|
||||
uint64_t magic = EEPROM_MAGIC;
|
||||
EEPROM.put(address, magic);
|
||||
address += sizeof(uint64_t);
|
||||
EEPROM.put(address++, registered_callback_assignments);
|
||||
for (uint8_t i = 0; i < MAX_CALLBACK_ASSIGNMENTS; ++i)
|
||||
{
|
||||
EEPROM.put(address, callback_assignments[i].address);
|
||||
address += sizeof(address_t);
|
||||
}
|
||||
for (uint8_t i = 0; i < MAX_CALLBACK_ASSIGNMENTS; ++i)
|
||||
{
|
||||
EEPROM.put(address, callback_assignments[i].callback_id);
|
||||
address += sizeof(callback_id_t);
|
||||
}
|
||||
EEPROM.put(address, physaddr);
|
||||
address += sizeof(address_t);
|
||||
|
||||
EEPROM.put(address, custom_config_data);
|
||||
address += sizeof(custom_config_data);
|
||||
|
||||
EEPROM.commit();
|
||||
DEBUG_PRINT("Wrote to EEPROM: 0x");
|
||||
DEBUG_PRINTLN(address, HEX);
|
||||
}
|
||||
|
||||
void ESPKNXIP::restore_from_eeprom()
|
||||
{
|
||||
uint32_t address = 0;
|
||||
uint64_t magic = 0;
|
||||
EEPROM.get(address, magic);
|
||||
if (magic != EEPROM_MAGIC)
|
||||
{
|
||||
DEBUG_PRINTLN("No valid magic in EEPROM, aborting restore.");
|
||||
DEBUG_PRINT("Expected 0x");
|
||||
DEBUG_PRINT((unsigned long)(EEPROM_MAGIC >> 32), HEX);
|
||||
DEBUG_PRINT(" 0x");
|
||||
DEBUG_PRINT((unsigned long)(EEPROM_MAGIC), HEX);
|
||||
DEBUG_PRINT(" got 0x");
|
||||
DEBUG_PRINT((unsigned long)(magic >> 32), HEX);
|
||||
DEBUG_PRINT(" 0x");
|
||||
DEBUG_PRINTLN((unsigned long)magic, HEX);
|
||||
return;
|
||||
}
|
||||
address += sizeof(uint64_t);
|
||||
EEPROM.get(address++, registered_callback_assignments);
|
||||
for (uint8_t i = 0; i < MAX_CALLBACK_ASSIGNMENTS; ++i)
|
||||
{
|
||||
EEPROM.get(address, callback_assignments[i].address);
|
||||
if (callback_assignments[i].address.value != 0)
|
||||
{
|
||||
// if address is not 0/0/0 then mark slot as used
|
||||
callback_assignments[i].slot_flags |= SLOT_FLAGS_USED;
|
||||
DEBUG_PRINTLN("used slot");
|
||||
}
|
||||
else
|
||||
{
|
||||
// if address is 0/0/0, then we found a free slot, yay!
|
||||
// however, only count those slots, if we have not reached registered_callback_assignments yet
|
||||
if (i < registered_callback_assignments)
|
||||
{
|
||||
DEBUG_PRINTLN("free slot before reaching registered_callback_assignments");
|
||||
free_callback_assignment_slots++;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_PRINTLN("free slot");
|
||||
}
|
||||
}
|
||||
address += sizeof(address_t);
|
||||
}
|
||||
for (uint8_t i = 0; i < MAX_CALLBACK_ASSIGNMENTS; ++i)
|
||||
{
|
||||
EEPROM.get(address, callback_assignments[i].callback_id);
|
||||
address += sizeof(callback_id_t);
|
||||
}
|
||||
EEPROM.get(address, physaddr);
|
||||
address += sizeof(address_t);
|
||||
|
||||
//EEPROM.get(address, custom_config_data);
|
||||
//address += sizeof(custom_config_data);
|
||||
uint32_t conf_offset = address;
|
||||
for (uint8_t i = 0; i < registered_configs; ++i)
|
||||
{
|
||||
// First byte is flags.
|
||||
config_flags_t flags = CONFIG_FLAGS_NO_FLAGS;
|
||||
flags = (config_flags_t)EEPROM.read(address);
|
||||
DEBUG_PRINT("Flag in EEPROM @ ");
|
||||
DEBUG_PRINT(address - conf_offset);
|
||||
DEBUG_PRINT(": ");
|
||||
DEBUG_PRINTLN(flags, BIN);
|
||||
custom_config_data[custom_configs[i].offset] = flags;
|
||||
if (flags & CONFIG_FLAGS_VALUE_SET)
|
||||
{
|
||||
DEBUG_PRINTLN("Non-default value");
|
||||
for (int j = 0; j < custom_configs[i].len - sizeof(uint8_t); ++j)
|
||||
{
|
||||
custom_config_data[custom_configs[i].offset + sizeof(uint8_t) + j] = EEPROM.read(address + sizeof(uint8_t) + j);
|
||||
}
|
||||
}
|
||||
|
||||
address += custom_configs[i].len;
|
||||
}
|
||||
|
||||
DEBUG_PRINT("Restored from EEPROM: 0x");
|
||||
DEBUG_PRINTLN(address, HEX);
|
||||
}
|
||||
|
||||
uint16_t ESPKNXIP::__ntohs(uint16_t n)
|
||||
{
|
||||
return (uint16_t)((((uint8_t*)&n)[0] << 8) | (((uint8_t*)&n)[1]));
|
||||
}
|
||||
|
||||
callback_assignment_id_t ESPKNXIP::__callback_register_assignment(address_t address, callback_id_t id)
|
||||
{
|
||||
if (registered_callback_assignments >= MAX_CALLBACK_ASSIGNMENTS)
|
||||
return -1;
|
||||
|
||||
if (free_callback_assignment_slots == 0)
|
||||
{
|
||||
callback_assignment_id_t aid = registered_callback_assignments;
|
||||
|
||||
callback_assignments[aid].slot_flags |= SLOT_FLAGS_USED;
|
||||
callback_assignments[aid].address = address;
|
||||
callback_assignments[aid].callback_id = id;
|
||||
registered_callback_assignments++;
|
||||
return aid;
|
||||
}
|
||||
else
|
||||
{
|
||||
// find the free slot
|
||||
for (callback_assignment_id_t aid = 0; aid < registered_callback_assignments; ++aid)
|
||||
{
|
||||
if (callback_assignments[aid].slot_flags & SLOT_FLAGS_USED)
|
||||
{
|
||||
// found a used slot
|
||||
continue;
|
||||
}
|
||||
// and now an empty one
|
||||
callback_assignments[aid].slot_flags |= SLOT_FLAGS_USED;
|
||||
callback_assignments[aid].address = address;
|
||||
callback_assignments[aid].callback_id = id;
|
||||
|
||||
free_callback_assignment_slots--;
|
||||
return id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ESPKNXIP::__callback_delete_assignment(callback_assignment_id_t id)
|
||||
{
|
||||
// TODO this can be optimized if we are deleting the last element
|
||||
// as then we can decrement registered_callback_assignments
|
||||
|
||||
// clear slot and mark it as empty
|
||||
callback_assignments[id].slot_flags = SLOT_FLAGS_EMPTY;
|
||||
callback_assignments[id].address.value = 0;
|
||||
callback_assignments[id].callback_id = 0;
|
||||
|
||||
if (id == registered_callback_assignments - 1)
|
||||
{
|
||||
DEBUG_PRINTLN("last cba deleted");
|
||||
// If this is the last callback, we can delete it by decrementing registered_callbacks.
|
||||
registered_callback_assignments--;
|
||||
|
||||
// However, if the assignment before this slot are also empty, we can decrement even further
|
||||
// First check if this was also the first element
|
||||
if (id == 0)
|
||||
{
|
||||
DEBUG_PRINTLN("really last cba");
|
||||
// If this was the last, then we are done.
|
||||
return;
|
||||
}
|
||||
|
||||
id--;
|
||||
while(true)
|
||||
{
|
||||
DEBUG_PRINT("checking ");
|
||||
DEBUG_PRINTLN((int32_t)id);
|
||||
if ((callback_assignments[id].slot_flags & SLOT_FLAGS_USED) == 0)
|
||||
{
|
||||
DEBUG_PRINTLN("merged free slot");
|
||||
// Slot before is empty
|
||||
free_callback_assignment_slots--;
|
||||
registered_callback_assignments--;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_PRINTLN("aborted on used slot");
|
||||
// Slot is used, abort
|
||||
return;
|
||||
}
|
||||
id--;
|
||||
if (id == CALLBACK_ASSIGNMENT_ID_MAX)
|
||||
{
|
||||
DEBUG_PRINTLN("abort on wrap");
|
||||
// Wrap around, abort
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_PRINTLN("free slot created");
|
||||
// there is now one more free slot
|
||||
free_callback_assignment_slots++;
|
||||
}
|
||||
}
|
||||
|
||||
bool ESPKNXIP::__callback_is_id_valid(callback_id_t id)
|
||||
{
|
||||
if (id < registered_callbacks)
|
||||
return true;
|
||||
|
||||
if (callbacks[id].slot_flags & SLOT_FLAGS_USED)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
callback_id_t ESPKNXIP::callback_register(String name, callback_fptr_t cb, void *arg, enable_condition_t cond)
|
||||
{
|
||||
if (registered_callbacks >= MAX_CALLBACKS)
|
||||
return -1;
|
||||
|
||||
if (free_callback_slots == 0)
|
||||
{
|
||||
callback_id_t id = registered_callbacks;
|
||||
|
||||
callbacks[id].slot_flags |= SLOT_FLAGS_USED;
|
||||
callbacks[id].name = name;
|
||||
callbacks[id].fkt = cb;
|
||||
callbacks[id].cond = cond;
|
||||
callbacks[id].arg = arg;
|
||||
registered_callbacks++;
|
||||
return id;
|
||||
}
|
||||
else
|
||||
{
|
||||
// find the free slot
|
||||
for (callback_id_t id = 0; id < registered_callbacks; ++id)
|
||||
{
|
||||
if (callbacks[id].slot_flags & SLOT_FLAGS_USED)
|
||||
{
|
||||
// found a used slot
|
||||
continue;
|
||||
}
|
||||
// and now an empty one
|
||||
callbacks[id].slot_flags |= SLOT_FLAGS_USED;
|
||||
callbacks[id].name = name;
|
||||
callbacks[id].fkt = cb;
|
||||
callbacks[id].cond = cond;
|
||||
callbacks[id].arg = arg;
|
||||
|
||||
free_callback_slots--;
|
||||
return id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ESPKNXIP::callback_deregister(callback_id_t id)
|
||||
{
|
||||
if (!__callback_is_id_valid(id))
|
||||
return;
|
||||
|
||||
// clear slot and mark it as empty
|
||||
callbacks[id].slot_flags = SLOT_FLAGS_EMPTY;
|
||||
callbacks[id].fkt = nullptr;
|
||||
callbacks[id].cond = nullptr;
|
||||
callbacks[id].arg = nullptr;
|
||||
|
||||
if (id == registered_callbacks - 1)
|
||||
{
|
||||
// If this is the last callback, we can delete it by decrementing registered_callbacks.
|
||||
registered_callbacks--;
|
||||
|
||||
// However, if the callbacks before this slot are also empty, we can decrement even further
|
||||
// First check if this was also the first element
|
||||
if (id == 0)
|
||||
{
|
||||
// If this was the last, then we are done.
|
||||
return;
|
||||
}
|
||||
|
||||
id--;
|
||||
while(true)
|
||||
{
|
||||
if ((callbacks[id].slot_flags & SLOT_FLAGS_USED) == 0)
|
||||
{
|
||||
// Slot is empty
|
||||
free_callback_slots--;
|
||||
registered_callbacks--;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Slot is used, abort
|
||||
return;
|
||||
}
|
||||
id--;
|
||||
if (id == CALLBACK_ASSIGNMENT_ID_MAX)
|
||||
{
|
||||
// Wrap around, abort
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// there is now one more free slot
|
||||
free_callback_slots++;
|
||||
}
|
||||
}
|
||||
|
||||
callback_assignment_id_t ESPKNXIP::callback_assign(callback_id_t id, address_t val)
|
||||
{
|
||||
if (!__callback_is_id_valid(id))
|
||||
return -1;
|
||||
|
||||
return __callback_register_assignment(val, id);
|
||||
}
|
||||
|
||||
void ESPKNXIP::callback_unassign(callback_assignment_id_t id)
|
||||
{
|
||||
if (!__callback_is_id_valid(id))
|
||||
return;
|
||||
|
||||
__callback_delete_assignment(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Feedback functions start here
|
||||
*/
|
||||
|
||||
feedback_id_t ESPKNXIP::feedback_register_int(String name, int32_t *value, enable_condition_t cond)
|
||||
{
|
||||
if (registered_feedbacks >= MAX_FEEDBACKS)
|
||||
return -1;
|
||||
|
||||
feedback_id_t id = registered_feedbacks;
|
||||
|
||||
feedbacks[id].type = FEEDBACK_TYPE_INT;
|
||||
feedbacks[id].name = name;
|
||||
feedbacks[id].cond = cond;
|
||||
feedbacks[id].data = (void *)value;
|
||||
|
||||
registered_feedbacks++;
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
feedback_id_t ESPKNXIP::feedback_register_float(String name, float *value, uint8_t precision, char const *prefix, char const *suffix, enable_condition_t cond)
|
||||
{
|
||||
if (registered_feedbacks >= MAX_FEEDBACKS)
|
||||
return -1;
|
||||
|
||||
feedback_id_t id = registered_feedbacks;
|
||||
|
||||
feedbacks[id].type = FEEDBACK_TYPE_FLOAT;
|
||||
feedbacks[id].name = name;
|
||||
feedbacks[id].cond = cond;
|
||||
feedbacks[id].data = (void *)value;
|
||||
feedbacks[id].options.float_options.precision = precision;
|
||||
feedbacks[id].options.float_options.prefix = prefix ? strdup(prefix) : STRING_DEFAULT_EMPTY;
|
||||
feedbacks[id].options.float_options.suffix = suffix ? strdup(suffix) : STRING_DEFAULT_EMPTY;
|
||||
|
||||
registered_feedbacks++;
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
feedback_id_t ESPKNXIP::feedback_register_bool(String name, bool *value, char const *true_text, char const *false_text, enable_condition_t cond)
|
||||
{
|
||||
if (registered_feedbacks >= MAX_FEEDBACKS)
|
||||
return -1;
|
||||
|
||||
feedback_id_t id = registered_feedbacks;
|
||||
|
||||
feedbacks[id].type = FEEDBACK_TYPE_BOOL;
|
||||
feedbacks[id].name = name;
|
||||
feedbacks[id].cond = cond;
|
||||
feedbacks[id].data = (void *)value;
|
||||
feedbacks[id].options.bool_options.true_text = true_text ? strdup(true_text) : STRING_DEFAULT_TRUE;
|
||||
feedbacks[id].options.bool_options.false_text = false_text ? strdup(false_text) : STRING_DEFAULT_FALSE;
|
||||
|
||||
registered_feedbacks++;
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
feedback_id_t ESPKNXIP::feedback_register_action(String name, feedback_action_fptr_t value, const char *btn_text, void *arg, enable_condition_t cond)
|
||||
{
|
||||
if (registered_feedbacks >= MAX_FEEDBACKS)
|
||||
return -1;
|
||||
|
||||
feedback_id_t id = registered_feedbacks;
|
||||
|
||||
feedbacks[id].type = FEEDBACK_TYPE_ACTION;
|
||||
feedbacks[id].name = name;
|
||||
feedbacks[id].cond = cond;
|
||||
feedbacks[id].data = (void *)value;
|
||||
feedbacks[id].options.action_options.arg = arg;
|
||||
feedbacks[id].options.action_options.btn_text = btn_text ? strdup(btn_text) : STRING_DEFAULT_DO_THIS;
|
||||
|
||||
registered_feedbacks++;
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
void ESPKNXIP::loop()
|
||||
{
|
||||
__loop_knx();
|
||||
if (server != nullptr)
|
||||
{
|
||||
__loop_webserver();
|
||||
}
|
||||
}
|
||||
|
||||
void ESPKNXIP::__loop_webserver()
|
||||
{
|
||||
server->handleClient();
|
||||
}
|
||||
|
||||
void ESPKNXIP::__loop_knx()
|
||||
{
|
||||
int read = udp.parsePacket();
|
||||
if (!read)
|
||||
{
|
||||
return;
|
||||
}
|
||||
DEBUG_PRINTLN(F(""));
|
||||
DEBUG_PRINT(F("LEN: "));
|
||||
DEBUG_PRINTLN(read);
|
||||
|
||||
uint8_t buf[read];
|
||||
|
||||
udp.read(buf, read);
|
||||
udp.flush();
|
||||
|
||||
DEBUG_PRINT(F("Got packet:"));
|
||||
#ifdef ESP_KNX_DEBUG
|
||||
for (int i = 0; i < read; ++i)
|
||||
{
|
||||
DEBUG_PRINT(F(" 0x"));
|
||||
DEBUG_PRINT(buf[i], 16);
|
||||
}
|
||||
#endif
|
||||
DEBUG_PRINTLN(F(""));
|
||||
|
||||
knx_ip_pkt_t *knx_pkt = (knx_ip_pkt_t *)buf;
|
||||
|
||||
DEBUG_PRINT(F("ST: 0x"));
|
||||
DEBUG_PRINTLN(__ntohs(knx_pkt->service_type), 16);
|
||||
|
||||
if (knx_pkt->header_len != 0x06 && knx_pkt->protocol_version != 0x10 && knx_pkt->service_type != KNX_ST_ROUTING_INDICATION)
|
||||
return;
|
||||
|
||||
cemi_msg_t *cemi_msg = (cemi_msg_t *)knx_pkt->pkt_data;
|
||||
|
||||
DEBUG_PRINT(F("MT: 0x"));
|
||||
DEBUG_PRINTLN(cemi_msg->message_code, 16);
|
||||
|
||||
if (cemi_msg->message_code != KNX_MT_L_DATA_IND)
|
||||
return;
|
||||
|
||||
DEBUG_PRINT(F("ADDI: 0x"));
|
||||
DEBUG_PRINTLN(cemi_msg->additional_info_len, 16);
|
||||
|
||||
cemi_service_t *cemi_data = &cemi_msg->data.service_information;
|
||||
|
||||
if (cemi_msg->additional_info_len > 0)
|
||||
cemi_data = (cemi_service_t *)(((uint8_t *)cemi_data) + cemi_msg->additional_info_len);
|
||||
|
||||
DEBUG_PRINT(F("C1: 0x"));
|
||||
DEBUG_PRINTLN(cemi_data->control_1.byte, 16);
|
||||
|
||||
DEBUG_PRINT(F("C2: 0x"));
|
||||
DEBUG_PRINTLN(cemi_data->control_2.byte, 16);
|
||||
|
||||
DEBUG_PRINT(F("DT: 0x"));
|
||||
DEBUG_PRINTLN(cemi_data->control_2.bits.dest_addr_type, 16);
|
||||
|
||||
if (cemi_data->control_2.bits.dest_addr_type != 0x01)
|
||||
return;
|
||||
|
||||
DEBUG_PRINT(F("HC: 0x"));
|
||||
DEBUG_PRINTLN(cemi_data->control_2.bits.hop_count, 16);
|
||||
|
||||
DEBUG_PRINT(F("EFF: 0x"));
|
||||
DEBUG_PRINTLN(cemi_data->control_2.bits.extended_frame_format, 16);
|
||||
|
||||
DEBUG_PRINT(F("Source: 0x"));
|
||||
DEBUG_PRINT(cemi_data->source.bytes.high, 16);
|
||||
DEBUG_PRINT(F(" 0x"));
|
||||
DEBUG_PRINTLN(cemi_data->source.bytes.low, 16);
|
||||
|
||||
DEBUG_PRINT(F("Dest: 0x"));
|
||||
DEBUG_PRINT(cemi_data->destination.bytes.high, 16);
|
||||
DEBUG_PRINT(F(" 0x"));
|
||||
DEBUG_PRINTLN(cemi_data->destination.bytes.low, 16);
|
||||
|
||||
knx_command_type_t ct = (knx_command_type_t)(((cemi_data->data[0] & 0xC0) >> 6) | ((cemi_data->pci.apci & 0x03) << 2));
|
||||
|
||||
DEBUG_PRINT(F("CT: 0x"));
|
||||
DEBUG_PRINTLN(ct, 16);
|
||||
|
||||
#ifdef ESP_KNX_DEBUG
|
||||
for (int i = 0; i < cemi_data->data_len; ++i)
|
||||
{
|
||||
DEBUG_PRINT(F(" 0x"));
|
||||
DEBUG_PRINT(cemi_data->data[i], 16);
|
||||
}
|
||||
#endif
|
||||
|
||||
DEBUG_PRINTLN(F("=="));
|
||||
|
||||
// Call callbacks
|
||||
for (int i = 0; i < registered_callback_assignments; ++i)
|
||||
{
|
||||
DEBUG_PRINT(F("Testing: 0x"));
|
||||
DEBUG_PRINT(callback_assignments[i].address.bytes.high, 16);
|
||||
DEBUG_PRINT(F(" 0x"));
|
||||
DEBUG_PRINTLN(callback_assignments[i].address.bytes.low, 16);
|
||||
if (cemi_data->destination.value == callback_assignments[i].address.value)
|
||||
{
|
||||
DEBUG_PRINTLN(F("Found match"));
|
||||
if (callbacks[callback_assignments[i].callback_id].cond && !callbacks[callback_assignments[i].callback_id].cond())
|
||||
{
|
||||
DEBUG_PRINTLN(F("But it's disabled"));
|
||||
#if ALLOW_MULTIPLE_CALLBACKS_PER_ADDRESS
|
||||
continue;
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
uint8_t data[cemi_data->data_len];
|
||||
memcpy(data, cemi_data->data, cemi_data->data_len);
|
||||
data[0] = data[0] & 0x3F;
|
||||
message_t msg = {};
|
||||
msg.ct = ct;
|
||||
msg.received_on = cemi_data->destination;
|
||||
msg.data_len = cemi_data->data_len;
|
||||
msg.data = data;
|
||||
callbacks[callback_assignments[i].callback_id].fkt(msg, callbacks[callback_assignments[i].callback_id].arg);
|
||||
#if ALLOW_MULTIPLE_CALLBACKS_PER_ADDRESS
|
||||
continue;
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Global "singleton" object
|
||||
ESPKNXIP knx;
|
|
@ -0,0 +1,571 @@
|
|||
/**
|
||||
* esp-knx-ip library for KNX/IP communication on an ESP8266
|
||||
* Author: Nico Weichbrodt <envy>
|
||||
* License: MIT
|
||||
*/
|
||||
|
||||
#ifndef ESP_KNX_IP_H
|
||||
#define ESP_KNX_IP_H
|
||||
|
||||
/**
|
||||
* CONFIG
|
||||
* All MAX_ values must not exceed 255 (1 byte, except MAC_CONFIG_SPACE which can go up to 2 bytes, so 0xffff in theory) and must not be negative!
|
||||
* Config space is restriced by EEPROM_SIZE (default 1024).
|
||||
* Required EEPROM size is 8 + MAX_GA_CALLBACKS * 3 + 2 + MAX_CONFIG_SPACE which is 552 by default
|
||||
*/
|
||||
#define EEPROM_SIZE 1024 // [Default 1024]
|
||||
#define MAX_CALLBACK_ASSIGNMENTS 10 // [Default 10] Maximum number of group address callbacks that can be stored
|
||||
#define MAX_CALLBACKS 10 // [Default 10] Maximum number of callbacks that can be stored
|
||||
#define MAX_CONFIGS 20 // [Default 20] Maximum number of config items that can be stored
|
||||
#define MAX_CONFIG_SPACE 0x0200 // [Default 0x0200] Maximum number of bytes that can be stored for custom config
|
||||
|
||||
#define MAX_FEEDBACKS 20 // [Default 20] Maximum number of feedbacks that can be shown
|
||||
|
||||
// Callbacks
|
||||
#define ALLOW_MULTIPLE_CALLBACKS_PER_ADDRESS 1 // [Default 0] Set to 1 to always test all assigned callbacks. This allows for multiple callbacks being assigned to the same address. If disabled, only the first assigned will be called.
|
||||
|
||||
// Webserver related
|
||||
#define USE_BOOTSTRAP 1 // [Default 1] Set to 1 to enable use of bootstrap CSS for nicer webconfig. CSS is loaded from bootstrapcdn.com. Set to 0 to disable
|
||||
#define ROOT_PREFIX "" // [Default ""] This gets prepended to all webserver paths, default is empty string "". Set this to "/knx" if you want the config to be available on http://<ip>/knx
|
||||
#define DISABLE_EEPROM_BUTTONS 1 // [Default 0] Set to 1 to disable the EEPROM buttons in the web ui.
|
||||
#define DISABLE_REBOOT_BUTTON 1 // [Default 0] Set to 1 to disable the reboot button in the web ui.
|
||||
#define DISABLE_RESTORE_BUTTON 1 // [Default 0] Set to 1 to disable the "restore defaults" button in the web ui.
|
||||
|
||||
// These values normally don't need adjustment
|
||||
#define MULTICAST_PORT 3671 // [Default 3671]
|
||||
#define MULTICAST_IP IPAddress(224, 0, 23, 12) // [Default IPAddress(224, 0, 23, 12)]
|
||||
#define SEND_CHECKSUM 0
|
||||
|
||||
// Uncomment to enable printing out debug messages.
|
||||
//#define ESP_KNX_DEBUG
|
||||
/**
|
||||
* END CONFIG
|
||||
*/
|
||||
|
||||
#include "Arduino.h"
|
||||
#include <EEPROM.h>
|
||||
#include <ESP8266WiFi.h>
|
||||
#include <WiFiUdp.h>
|
||||
#include <ESP8266WebServer.h>
|
||||
|
||||
#include "DPT.h"
|
||||
|
||||
#define EEPROM_MAGIC (0xDEADBEEF00000000 + (MAX_CONFIG_SPACE) + (MAX_CALLBACK_ASSIGNMENTS << 16) + (MAX_CALLBACKS << 8))
|
||||
|
||||
// Define where debug output will be printed.
|
||||
#ifndef DEBUG_PRINTER
|
||||
#define DEBUG_PRINTER Serial
|
||||
#endif
|
||||
|
||||
// Setup debug printing macros.
|
||||
#ifdef ESP_KNX_DEBUG
|
||||
#define DEBUG_PRINT(...) { DEBUG_PRINTER.print(__VA_ARGS__); }
|
||||
#define DEBUG_PRINTLN(...) { DEBUG_PRINTER.println(__VA_ARGS__); }
|
||||
#else
|
||||
#define DEBUG_PRINT(...) {}
|
||||
#define DEBUG_PRINTLN(...) {}
|
||||
#endif
|
||||
|
||||
#define __ROOT_PATH ROOT_PREFIX"/"
|
||||
#define __REGISTER_PATH ROOT_PREFIX"/register"
|
||||
#define __DELETE_PATH ROOT_PREFIX"/delete"
|
||||
#define __PHYS_PATH ROOT_PREFIX"/phys"
|
||||
#define __EEPROM_PATH ROOT_PREFIX"/eeprom"
|
||||
#define __CONFIG_PATH ROOT_PREFIX"/config"
|
||||
#define __FEEDBACK_PATH ROOT_PREFIX"/feedback"
|
||||
#define __RESTORE_PATH ROOT_PREFIX"/restore"
|
||||
#define __REBOOT_PATH ROOT_PREFIX"/reboot"
|
||||
|
||||
/**
|
||||
* Different service types, we are mainly interested in KNX_ST_ROUTING_INDICATION
|
||||
*/
|
||||
typedef enum __knx_service_type
|
||||
{
|
||||
KNX_ST_SEARCH_REQUEST = 0x0201,
|
||||
KNX_ST_SEARCH_RESPONSE = 0x0202,
|
||||
KNX_ST_DESCRIPTION_REQUEST = 0x0203,
|
||||
KNX_ST_DESCRIPTION_RESPONSE = 0x0204,
|
||||
KNX_ST_CONNECT_REQUEST = 0x0205,
|
||||
KNX_ST_CONNECT_RESPONSE = 0x0206,
|
||||
KNX_ST_CONNECTIONSTATE_REQUEST = 0x0207,
|
||||
KNX_ST_CONNECTIONSTATE_RESPONSE = 0x0208,
|
||||
KNX_ST_DISCONNECT_REQUEST = 0x0209,
|
||||
KNX_ST_DISCONNECT_RESPONSE = 0x020A,
|
||||
|
||||
KNX_ST_DEVICE_CONFIGURATION_REQUEST = 0x0310,
|
||||
KNX_ST_DEVICE_CONFIGURATION_ACK = 0x0311,
|
||||
|
||||
KNX_ST_TUNNELING_REQUEST = 0x0420,
|
||||
KNX_ST_TUNNELING_ACK = 0x0421,
|
||||
|
||||
KNX_ST_ROUTING_INDICATION = 0x0530,
|
||||
KNX_ST_ROUTING_LOST_MESSAGE = 0x0531,
|
||||
KNX_ST_ROUTING_BUSY = 0x0532,
|
||||
|
||||
// KNX_ST_RLOG_START = 0x0600,
|
||||
// KNX_ST_RLOG_END = 0x06FF,
|
||||
|
||||
KNX_ST_REMOTE_DIAGNOSTIC_REQUEST = 0x0740,
|
||||
KNX_ST_REMOTE_DIAGNOSTIC_RESPONSE = 0x0741,
|
||||
KNX_ST_REMOTE_BASIC_CONFIGURATION_REQUEST = 0x0742,
|
||||
KNX_ST_REMOTE_RESET_REQUEST = 0x0743,
|
||||
|
||||
// KNX_ST_OBJSRV_START = 0x0800,
|
||||
// KNX_ST_OBJSRV_END = 0x08FF,
|
||||
} knx_service_type_t;
|
||||
|
||||
/**
|
||||
* Differnt command types, first three are of main interest
|
||||
*/
|
||||
typedef enum __knx_command_type
|
||||
{
|
||||
KNX_CT_READ = 0x00,
|
||||
KNX_CT_ANSWER = 0x01,
|
||||
KNX_CT_WRITE = 0x02,
|
||||
KNX_CT_INDIVIDUAL_ADDR_WRITE = 0x03,
|
||||
KNX_CT_INDIVIDUAL_ADDR_REQUEST = 0x04,
|
||||
KNX_CT_INDIVIDUAL_ADDR_RESPONSE = 0x05,
|
||||
KNX_CT_ADC_READ = 0x06,
|
||||
KNX_CT_ADC_ANSWER = 0x07,
|
||||
KNX_CT_MEM_READ = 0x08,
|
||||
KNX_CT_MEM_ANSWER = 0x09,
|
||||
KNX_CT_MEM_WRITE = 0x0A,
|
||||
//KNX_CT_UNKNOWN = 0x0B,
|
||||
KNX_CT_MASK_VERSION_READ = 0x0C,
|
||||
KNX_CT_MASK_VERSION_RESPONSE = 0x0D,
|
||||
KNX_CT_RESTART = 0x0E,
|
||||
KNX_CT_ESCAPE = 0x0F,
|
||||
} knx_command_type_t;
|
||||
|
||||
/**
|
||||
* cEMI message types, mainly KNX_MT_L_DATA_IND is interesting
|
||||
*/
|
||||
typedef enum __knx_cemi_msg_type
|
||||
{
|
||||
KNX_MT_L_DATA_REQ = 0x11,
|
||||
KNX_MT_L_DATA_IND = 0x29,
|
||||
KNX_MT_L_DATA_CON = 0x2E,
|
||||
} knx_cemi_msg_type_t;
|
||||
|
||||
/**
|
||||
* TCPI communication type
|
||||
*/
|
||||
typedef enum __knx_communication_type {
|
||||
KNX_COT_UDP = 0x00, // Unnumbered Data Packet
|
||||
KNX_COT_NDP = 0x01, // Numbered Data Packet
|
||||
KNX_COT_UCD = 0x02, // Unnumbered Control Data
|
||||
KNX_COT_NCD = 0x03, // Numbered Control Data
|
||||
} knx_communication_type_t;
|
||||
|
||||
/**
|
||||
* KNX/IP header
|
||||
*/
|
||||
typedef struct __knx_ip_pkt
|
||||
{
|
||||
uint8_t header_len; // Should always be 0x06
|
||||
uint8_t protocol_version; // Should be version 1.0, transmitted as 0x10
|
||||
uint16_t service_type; // See knx_service_type_t
|
||||
union
|
||||
{
|
||||
struct {
|
||||
uint8_t first_byte;
|
||||
uint8_t second_byte;
|
||||
} bytes;
|
||||
uint16_t len;
|
||||
} total_len; // header_len + rest of pkt. This is a bit weird as the spec says this: If the total number of bytes transmitted is greater than 252 bytes, the first “Total Length” byte is set to FF (255). Only in this case the second byte includes additional length information
|
||||
uint8_t pkt_data[]; // This is of type cemi_msg_t
|
||||
} knx_ip_pkt_t;
|
||||
|
||||
typedef struct __cemi_addi
|
||||
{
|
||||
uint8_t type_id;
|
||||
uint8_t len;
|
||||
uint8_t data[];
|
||||
} cemi_addi_t;
|
||||
|
||||
typedef union __address
|
||||
{
|
||||
uint16_t value;
|
||||
struct
|
||||
{
|
||||
uint8_t high;
|
||||
uint8_t low;
|
||||
} bytes;
|
||||
struct __attribute__((packed))
|
||||
{
|
||||
uint8_t line:3;
|
||||
uint8_t area:5;
|
||||
uint8_t member;
|
||||
} ga;
|
||||
struct __attribute__((packed))
|
||||
{
|
||||
uint8_t line:4;
|
||||
uint8_t area:4;
|
||||
uint8_t member;
|
||||
} pa;
|
||||
uint8_t array[2];
|
||||
} address_t;
|
||||
|
||||
typedef struct __cemi_service
|
||||
{
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
// Struct is reversed due to bit order
|
||||
uint8_t confirm:1; // 0 = no error, 1 = error
|
||||
uint8_t ack:1; // 0 = no ack, 1 = ack
|
||||
uint8_t priority:2; // 0 = system, 1 = high, 2 = urgent/alarm, 3 = normal
|
||||
uint8_t system_broadcast:1; // 0 = system broadcast, 1 = broadcast
|
||||
uint8_t repeat:1; // 0 = repeat on error, 1 = do not repeat
|
||||
uint8_t reserved:1; // always zero
|
||||
uint8_t frame_type:1; // 0 = extended, 1 = standard
|
||||
} bits;
|
||||
uint8_t byte;
|
||||
} control_1;
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
// Struct is reversed due to bit order
|
||||
uint8_t extended_frame_format:4;
|
||||
uint8_t hop_count:3;
|
||||
uint8_t dest_addr_type:1; // 0 = individual, 1 = group
|
||||
} bits;
|
||||
uint8_t byte;
|
||||
} control_2;
|
||||
address_t source;
|
||||
address_t destination;
|
||||
uint8_t data_len; // length of data, excluding the tpci byte
|
||||
struct
|
||||
{
|
||||
uint8_t apci:2; // If tpci.comm_type == KNX_COT_UCD or KNX_COT_NCD, then this is apparently control data?
|
||||
uint8_t tpci_seq_number:4;
|
||||
uint8_t tpci_comm_type:2; // See knx_communication_type_t
|
||||
} pci;
|
||||
uint8_t data[];
|
||||
} cemi_service_t;
|
||||
|
||||
typedef struct __cemi_msg
|
||||
{
|
||||
uint8_t message_code;
|
||||
uint8_t additional_info_len;
|
||||
union
|
||||
{
|
||||
cemi_addi_t additional_info[];
|
||||
cemi_service_t service_information;
|
||||
} data;
|
||||
} cemi_msg_t;
|
||||
|
||||
typedef enum __config_type
|
||||
{
|
||||
CONFIG_TYPE_UNKNOWN,
|
||||
CONFIG_TYPE_INT,
|
||||
CONFIG_TYPE_BOOL,
|
||||
CONFIG_TYPE_STRING,
|
||||
CONFIG_TYPE_OPTIONS,
|
||||
CONFIG_TYPE_GA,
|
||||
} config_type_t;
|
||||
|
||||
typedef enum __feedback_type
|
||||
{
|
||||
FEEDBACK_TYPE_UNKNOWN,
|
||||
FEEDBACK_TYPE_INT,
|
||||
FEEDBACK_TYPE_FLOAT,
|
||||
FEEDBACK_TYPE_BOOL,
|
||||
FEEDBACK_TYPE_ACTION,
|
||||
} feedback_type_t;
|
||||
|
||||
typedef enum __config_flags
|
||||
{
|
||||
CONFIG_FLAGS_NO_FLAGS = 0,
|
||||
CONFIG_FLAGS_VALUE_SET = 1,
|
||||
} config_flags_t;
|
||||
|
||||
typedef enum __slot_flags
|
||||
{
|
||||
SLOT_FLAGS_EMPTY = 0, // Empty slots have no flags
|
||||
SLOT_FLAGS_USED = 1,
|
||||
} slot_flags_t;
|
||||
|
||||
typedef struct __message
|
||||
{
|
||||
knx_command_type_t ct;
|
||||
address_t received_on;
|
||||
uint8_t data_len;
|
||||
uint8_t *data;
|
||||
} message_t;
|
||||
|
||||
typedef bool (*enable_condition_t)(void);
|
||||
typedef void (*callback_fptr_t)(message_t const &msg, void *arg);
|
||||
typedef void (*feedback_action_fptr_t)(void *arg);
|
||||
|
||||
typedef uint8_t callback_id_t;
|
||||
#define CALLBACK_ID_MAX UINT8_MAX
|
||||
typedef uint8_t callback_assignment_id_t;
|
||||
#define CALLBACK_ASSIGNMENT_ID_MAX UINT8_MAX
|
||||
typedef uint8_t config_id_t;
|
||||
typedef uint8_t feedback_id_t;
|
||||
|
||||
typedef struct __option_entry
|
||||
{
|
||||
char const *name;
|
||||
uint8_t value;
|
||||
} option_entry_t;
|
||||
|
||||
typedef struct __config
|
||||
{
|
||||
config_type_t type;
|
||||
String name;
|
||||
uint8_t offset;
|
||||
uint8_t len;
|
||||
enable_condition_t cond;
|
||||
union {
|
||||
option_entry_t *options;
|
||||
} data;
|
||||
} config_t;
|
||||
|
||||
extern char const *string_defaults[];
|
||||
#define STRING_DEFAULT_DO_THIS (string_defaults[0])
|
||||
#define STRING_DEFAULT_TRUE (string_defaults[1])
|
||||
#define STRING_DEFAULT_FALSE (string_defaults[2])
|
||||
#define STRING_DEFAULT_EMPTY (string_defaults[3])
|
||||
|
||||
typedef struct __feedback_float_options
|
||||
{
|
||||
uint8_t precision;
|
||||
char const *prefix;
|
||||
char const *suffix;
|
||||
} feedback_float_options_t;
|
||||
|
||||
typedef struct __feedback_bool_options
|
||||
{
|
||||
char const *true_text;
|
||||
char const *false_text;
|
||||
} feedback_bool_options_t;
|
||||
|
||||
typedef struct __feedback_action_options
|
||||
{
|
||||
void *arg;
|
||||
char const *btn_text;
|
||||
} feedback_action_options_t;
|
||||
|
||||
typedef struct __feedback
|
||||
{
|
||||
feedback_type_t type;
|
||||
String name;
|
||||
enable_condition_t cond;
|
||||
void *data;
|
||||
union {
|
||||
feedback_bool_options_t bool_options;
|
||||
feedback_float_options_t float_options;
|
||||
feedback_action_options_t action_options;
|
||||
} options;
|
||||
} feedback_t;
|
||||
|
||||
typedef struct __callback
|
||||
{
|
||||
uint8_t slot_flags;
|
||||
callback_fptr_t fkt;
|
||||
enable_condition_t cond;
|
||||
void *arg;
|
||||
String name;
|
||||
} callback_t;
|
||||
|
||||
typedef struct __callback_assignment
|
||||
{
|
||||
uint8_t slot_flags;
|
||||
address_t address;
|
||||
callback_id_t callback_id;
|
||||
} callback_assignment_t;
|
||||
|
||||
class ESPKNXIP {
|
||||
public:
|
||||
ESPKNXIP();
|
||||
void load();
|
||||
void start();
|
||||
void start(ESP8266WebServer *srv);
|
||||
void loop();
|
||||
|
||||
void save_to_eeprom();
|
||||
void restore_from_eeprom();
|
||||
|
||||
callback_id_t callback_register(String name, callback_fptr_t cb, void *arg = nullptr, enable_condition_t cond = nullptr);
|
||||
callback_assignment_id_t callback_assign(callback_id_t id, address_t val);
|
||||
void callback_deregister(callback_id_t id);
|
||||
void callback_unassign(callback_assignment_id_t id);
|
||||
|
||||
void physical_address_set(address_t const &addr);
|
||||
address_t physical_address_get();
|
||||
|
||||
// Configuration functions
|
||||
config_id_t config_register_string(String name, uint8_t len, String _default, enable_condition_t cond = nullptr);
|
||||
config_id_t config_register_int(String name, int32_t _default, enable_condition_t cond = nullptr);
|
||||
config_id_t config_register_bool(String name, bool _default, enable_condition_t cond = nullptr);
|
||||
config_id_t config_register_options(String name, option_entry_t *options, uint8_t _default, enable_condition_t cond = nullptr);
|
||||
config_id_t config_register_ga(String name, enable_condition_t cond = nullptr);
|
||||
|
||||
String config_get_string(config_id_t id);
|
||||
int32_t config_get_int(config_id_t id);
|
||||
bool config_get_bool(config_id_t id);
|
||||
uint8_t config_get_options(config_id_t id);
|
||||
address_t config_get_ga(config_id_t id);
|
||||
|
||||
void config_set_string(config_id_t id, String val);
|
||||
void config_set_int(config_id_t id, int32_t val);
|
||||
void config_set_bool(config_id_t, bool val);
|
||||
void config_set_options(config_id_t id, uint8_t val);
|
||||
void config_set_ga(config_id_t id, address_t const &val);
|
||||
|
||||
// Feedback functions
|
||||
feedback_id_t feedback_register_int(String name, int32_t *value, enable_condition_t cond = nullptr);
|
||||
feedback_id_t feedback_register_float(String name, float *value, uint8_t precision = 2, char const *prefix = nullptr, char const *suffix = nullptr, enable_condition_t cond = nullptr);
|
||||
feedback_id_t feedback_register_bool(String name, bool *value, char const *true_text = nullptr, char const *false_text = nullptr, enable_condition_t cond = nullptr);
|
||||
feedback_id_t feedback_register_action(String name, feedback_action_fptr_t value, char const *btn_text = nullptr, void *arg = nullptr, enable_condition_t = nullptr);
|
||||
|
||||
// Send functions
|
||||
void send(address_t const &receiver, knx_command_type_t ct, uint8_t data_len, uint8_t *data);
|
||||
|
||||
void send_1bit(address_t const &receiver, knx_command_type_t ct, uint8_t bit);
|
||||
void send_2bit(address_t const &receiver, knx_command_type_t ct, uint8_t twobit);
|
||||
void send_4bit(address_t const &receiver, knx_command_type_t ct, uint8_t fourbit);
|
||||
void send_1byte_int(address_t const &receiver, knx_command_type_t ct, int8_t val);
|
||||
void send_1byte_uint(address_t const &receiver, knx_command_type_t ct, uint8_t val);
|
||||
void send_2byte_int(address_t const &receiver, knx_command_type_t ct, int16_t val);
|
||||
void send_2byte_uint(address_t const &receiver, knx_command_type_t ct, uint16_t val);
|
||||
void send_2byte_float(address_t const &receiver, knx_command_type_t ct, float val);
|
||||
void send_3byte_time(address_t const &receiver, knx_command_type_t ct, uint8_t weekday, uint8_t hours, uint8_t minutes, uint8_t seconds);
|
||||
void send_3byte_time(address_t const &receiver, knx_command_type_t ct, time_of_day_t const &time) { send_3byte_time(receiver, ct, time.weekday, time.hours, time.minutes, time.seconds); }
|
||||
void send_3byte_date(address_t const &receiver, knx_command_type_t ct, uint8_t day, uint8_t month, uint8_t year);
|
||||
void send_3byte_date(address_t const &receiver, knx_command_type_t ct, date_t const &date) { send_3byte_date(receiver, ct, date.day, date.month, date.year); }
|
||||
void send_3byte_color(address_t const &receiver, knx_command_type_t ct, uint8_t red, uint8_t green, uint8_t blue);
|
||||
void send_3byte_color(address_t const &receiver, knx_command_type_t ct, color_t const &color) { send_3byte_color(receiver, ct, color.red, color.green, color.blue); }
|
||||
void send_4byte_int(address_t const &receiver, knx_command_type_t ct, int32_t val);
|
||||
void send_4byte_uint(address_t const &receiver, knx_command_type_t ct, uint32_t val);
|
||||
void send_4byte_float(address_t const &receiver, knx_command_type_t ct, float val);
|
||||
|
||||
void write_1bit(address_t const &receiver, uint8_t bit) { send_1bit(receiver, KNX_CT_WRITE, bit); }
|
||||
void write_2bit(address_t const &receiver, uint8_t twobit) { send_2bit(receiver, KNX_CT_WRITE, twobit); }
|
||||
void write_4bit(address_t const &receiver, uint8_t fourbit) { send_4bit(receiver, KNX_CT_WRITE, fourbit); }
|
||||
void write_1byte_int(address_t const &receiver, int8_t val) { send_1byte_int(receiver, KNX_CT_WRITE, val); }
|
||||
void write_1byte_uint(address_t const &receiver, uint8_t val) { send_1byte_uint(receiver, KNX_CT_WRITE, val); }
|
||||
void write_2byte_int(address_t const &receiver, int16_t val) { send_2byte_int(receiver, KNX_CT_WRITE, val); }
|
||||
void write_2byte_uint(address_t const &receiver, uint16_t val) { send_2byte_uint(receiver, KNX_CT_WRITE, val); }
|
||||
void write_2byte_float(address_t const &receiver, float val) { send_2byte_float(receiver, KNX_CT_WRITE, val); }
|
||||
void write_3byte_time(address_t const &receiver, uint8_t weekday, uint8_t hours, uint8_t minutes, uint8_t seconds) { send_3byte_time(receiver, KNX_CT_WRITE, weekday, hours, minutes, seconds); }
|
||||
void write_3byte_time(address_t const &receiver, time_of_day_t const &time) { send_3byte_time(receiver, KNX_CT_WRITE, time.weekday, time.hours, time.minutes, time.seconds); }
|
||||
void write_3byte_date(address_t const &receiver, uint8_t day, uint8_t month, uint8_t year) { send_3byte_date(receiver, KNX_CT_WRITE, day, month, year); }
|
||||
void write_3byte_date(address_t const &receiver, date_t const &date) { send_3byte_date(receiver, KNX_CT_WRITE, date.day, date.month, date.year); }
|
||||
void write_3byte_color(address_t const &receiver, uint8_t red, uint8_t green, uint8_t blue) { send_3byte_color(receiver, KNX_CT_WRITE, red, green, blue); }
|
||||
void write_3byte_color(address_t const &receiver, color_t const &color) { send_3byte_color(receiver, KNX_CT_WRITE, color); }
|
||||
void write_4byte_int(address_t const &receiver, int32_t val) { send_4byte_int(receiver, KNX_CT_WRITE, val); }
|
||||
void write_4byte_uint(address_t const &receiver, uint32_t val) { send_4byte_uint(receiver, KNX_CT_WRITE, val); }
|
||||
void write_4byte_float(address_t const &receiver, float val) { send_4byte_float(receiver, KNX_CT_WRITE, val);}
|
||||
|
||||
void answer_1bit(address_t const &receiver, uint8_t bit) { send_1bit(receiver, KNX_CT_ANSWER, bit); }
|
||||
void answer_2bit(address_t const &receiver, uint8_t twobit) { send_2bit(receiver, KNX_CT_ANSWER, twobit); }
|
||||
void answer_4bit(address_t const &receiver, uint8_t fourbit) { send_4bit(receiver, KNX_CT_ANSWER, fourbit); }
|
||||
void answer_1byte_int(address_t const &receiver, int8_t val) { send_1byte_int(receiver, KNX_CT_ANSWER, val); }
|
||||
void answer_1byte_uint(address_t const &receiver, uint8_t val) { send_1byte_uint(receiver, KNX_CT_ANSWER, val); }
|
||||
void answer_2byte_int(address_t const &receiver, int16_t val) { send_2byte_int(receiver, KNX_CT_ANSWER, val); }
|
||||
void answer_2byte_uint(address_t const &receiver, uint16_t val) { send_2byte_uint(receiver, KNX_CT_ANSWER, val); }
|
||||
void answer_2byte_float(address_t const &receiver, float val) { send_2byte_float(receiver, KNX_CT_ANSWER, val); }
|
||||
void answer_3byte_time(address_t const &receiver, uint8_t weekday, uint8_t hours, uint8_t minutes, uint8_t seconds) { send_3byte_time(receiver, KNX_CT_ANSWER, weekday, hours, minutes, seconds); }
|
||||
void answer_3byte_time(address_t const &receiver, time_of_day_t const &time) { send_3byte_time(receiver, KNX_CT_ANSWER, time.weekday, time.hours, time.minutes, time.seconds); }
|
||||
void answer_3byte_date(address_t const &receiver, uint8_t day, uint8_t month, uint8_t year) { send_3byte_date(receiver, KNX_CT_ANSWER, day, month, year); }
|
||||
void answer_3byte_date(address_t const &receiver, date_t const &date) { send_3byte_date(receiver, KNX_CT_ANSWER, date.day, date.month, date.year); }
|
||||
void answer_3byte_color(address_t const &receiver, uint8_t red, uint8_t green, uint8_t blue) { send_3byte_color(receiver, KNX_CT_ANSWER, red, green, blue); }
|
||||
void answer_3byte_color(address_t const &receiver, color_t const &color) { send_3byte_color(receiver, KNX_CT_ANSWER, color); }
|
||||
void answer_4byte_int(address_t const &receiver, int32_t val) { send_4byte_int(receiver, KNX_CT_ANSWER, val); }
|
||||
void answer_4byte_uint(address_t const &receiver, uint32_t val) { send_4byte_uint(receiver, KNX_CT_ANSWER, val); }
|
||||
void answer_4byte_float(address_t const &receiver, float val) { send_4byte_float(receiver, KNX_CT_ANSWER, val);}
|
||||
|
||||
bool data_to_bool(uint8_t *data);
|
||||
int8_t data_to_1byte_int(uint8_t *data);
|
||||
uint8_t data_to_1byte_uint(uint8_t *data);
|
||||
int16_t data_to_2byte_int(uint8_t *data);
|
||||
uint16_t data_to_2byte_uint(uint8_t *data);
|
||||
float data_to_2byte_float(uint8_t *data);
|
||||
color_t data_to_3byte_color(uint8_t *data);
|
||||
time_of_day_t data_to_3byte_time(uint8_t *data);
|
||||
date_t data_to_3byte_data(uint8_t *data);
|
||||
int32_t data_to_4byte_int(uint8_t *data);
|
||||
uint32_t data_to_4byte_uint(uint8_t *data);
|
||||
float data_to_4byte_float(uint8_t *data);
|
||||
|
||||
static address_t GA_to_address(uint8_t area, uint8_t line, uint8_t member)
|
||||
{
|
||||
// Yes, the order is correct, see the struct definition above
|
||||
address_t tmp = {.ga={line, area, member}};
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static address_t PA_to_address(uint8_t area, uint8_t line, uint8_t member)
|
||||
{
|
||||
// Yes, the order is correct, see the struct definition above
|
||||
address_t tmp = {.pa={line, area, member}};
|
||||
return tmp;
|
||||
}
|
||||
|
||||
private:
|
||||
void __start();
|
||||
void __loop_knx();
|
||||
|
||||
// Webserver functions
|
||||
void __loop_webserver();
|
||||
void __handle_root();
|
||||
void __handle_register();
|
||||
void __handle_delete();
|
||||
void __handle_set();
|
||||
#if !DISABLE_EEPROM_BUTTONS
|
||||
void __handle_eeprom();
|
||||
#endif
|
||||
void __handle_config();
|
||||
void __handle_feedback();
|
||||
#if !DISABLE_RESTORE_BUTTONS
|
||||
void __handle_restore();
|
||||
#endif
|
||||
#if !DISABLE_REBOOT_BUTTONS
|
||||
void __handle_reboot();
|
||||
#endif
|
||||
|
||||
void __config_set_flags(config_id_t id, config_flags_t flags);
|
||||
|
||||
void __config_set_string(config_id_t id, String &val);
|
||||
void __config_set_int(config_id_t id, int32_t val);
|
||||
void __config_set_bool(config_id_t id, bool val);
|
||||
void __config_set_options(config_id_t id, uint8_t val);
|
||||
void __config_set_ga(config_id_t id, address_t const &val);
|
||||
|
||||
bool __callback_is_id_valid(callback_id_t id);
|
||||
|
||||
callback_assignment_id_t __callback_register_assignment(address_t address, callback_id_t id);
|
||||
void __callback_delete_assignment(callback_assignment_id_t id);
|
||||
|
||||
ESP8266WebServer *server;
|
||||
address_t physaddr;
|
||||
WiFiUDP udp;
|
||||
|
||||
callback_assignment_id_t registered_callback_assignments;
|
||||
callback_assignment_id_t free_callback_assignment_slots;
|
||||
callback_assignment_t callback_assignments[MAX_CALLBACK_ASSIGNMENTS];
|
||||
|
||||
callback_id_t registered_callbacks;
|
||||
callback_id_t free_callback_slots;
|
||||
callback_t callbacks[MAX_CALLBACKS];
|
||||
|
||||
config_id_t registered_configs;
|
||||
uint8_t custom_config_data[MAX_CONFIG_SPACE];
|
||||
uint8_t custom_config_default_data[MAX_CONFIG_SPACE];
|
||||
config_t custom_configs[MAX_CONFIGS];
|
||||
|
||||
feedback_id_t registered_feedbacks;
|
||||
feedback_t feedbacks[MAX_FEEDBACKS];
|
||||
|
||||
uint16_t __ntohs(uint16_t);
|
||||
};
|
||||
|
||||
// Global "singleton" object
|
||||
extern ESPKNXIP knx;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,159 @@
|
|||
/*
|
||||
* This is an example showing a simple environment sensor based on a BME280 attached via I2C.
|
||||
* This sketch was tested on a WeMos D1 mini
|
||||
*/
|
||||
|
||||
#include <Adafruit_BME280.h>
|
||||
#include <esp-knx-ip.h>
|
||||
|
||||
// WiFi config here
|
||||
const char* ssid = "myssid";
|
||||
const char* pass = "mypassword";
|
||||
|
||||
#define LED_PIN D4
|
||||
#define UPDATE_INTERVAL 10000
|
||||
|
||||
unsigned long next_change = 0;
|
||||
|
||||
float last_temp = 0.0;
|
||||
float last_hum = 0.0;
|
||||
float last_pres = 0.0;
|
||||
|
||||
config_id_t temp_ga, hum_ga, pres_ga;
|
||||
config_id_t hostname_id;
|
||||
config_id_t update_rate_id, send_rate_id;
|
||||
config_id_t enable_sending_id;
|
||||
config_id_t enable_reading_id;
|
||||
|
||||
Adafruit_BME280 bme;
|
||||
|
||||
void setup() {
|
||||
pinMode(LED_PIN, OUTPUT);
|
||||
Serial.begin(115200);
|
||||
|
||||
hostname_id = knx.config_register_string("Hostname", 20, String("env"));
|
||||
enable_sending_id = knx.config_register_bool("Send on update", true);
|
||||
update_rate_id = knx.config_register_int("Update rate (ms)", UPDATE_INTERVAL);
|
||||
temp_ga = knx.config_register_ga("Temperature", show_periodic_options);
|
||||
hum_ga = knx.config_register_ga("Humidity", show_periodic_options);
|
||||
pres_ga = knx.config_register_ga("Pressure", show_periodic_options);
|
||||
|
||||
knx.callback_register("Read Temperature", temp_cb);
|
||||
knx.callback_register("Read Humidity", hum_cb);
|
||||
knx.callback_register("Read Pressure", pres_cb);
|
||||
|
||||
knx.feedback_register_float("Temperature (°C)", &last_temp);
|
||||
knx.feedback_register_float("Humidity (%)", &last_hum);
|
||||
knx.feedback_register_float("Pressure (hPa)", &last_pres, 0);
|
||||
|
||||
// Load previous config from EEPROM
|
||||
knx.load();
|
||||
|
||||
// Init sensor
|
||||
if (!bme.begin(0x76)) {
|
||||
Serial.println("Could not find a valid BME280 sensor, check wiring!");
|
||||
}
|
||||
|
||||
// Init WiFi
|
||||
WiFi.hostname(knx.config_get_string(hostname_id));
|
||||
WiFi.begin(ssid, pass);
|
||||
|
||||
Serial.println("");
|
||||
Serial.print("[Connecting]");
|
||||
Serial.print(ssid);
|
||||
|
||||
digitalWrite(LED_PIN, LOW);
|
||||
while (WiFi.status() != WL_CONNECTED) {
|
||||
digitalWrite(LED_PIN, HIGH);
|
||||
delay(250);
|
||||
Serial.print(".");
|
||||
digitalWrite(LED_PIN, LOW);
|
||||
delay(250);
|
||||
}
|
||||
digitalWrite(LED_PIN, HIGH);
|
||||
|
||||
// Start knx
|
||||
knx.start();
|
||||
|
||||
Serial.println();
|
||||
Serial.println("Connected to wifi");
|
||||
Serial.println(WiFi.localIP());
|
||||
}
|
||||
|
||||
void loop() {
|
||||
knx.loop();
|
||||
|
||||
unsigned long now = millis();
|
||||
|
||||
if (next_change < now)
|
||||
{
|
||||
next_change = now + knx.config_get_int(update_rate_id);
|
||||
|
||||
last_temp = bme.readTemperature();
|
||||
last_hum = bme.readHumidity();
|
||||
last_pres = bme.readPressure()/100.0f;
|
||||
|
||||
Serial.print("T: ");
|
||||
Serial.print(last_temp);
|
||||
Serial.print("°C H: ");
|
||||
Serial.print(last_hum);
|
||||
Serial.print("% P: ");
|
||||
Serial.print(last_pres);
|
||||
Serial.println("hPa");
|
||||
|
||||
if (knx.config_get_bool(enable_sending_id))
|
||||
{
|
||||
knx.write_2byte_float(knx.config_get_ga(temp_ga), last_temp);
|
||||
knx.write_2byte_float(knx.config_get_ga(hum_ga), last_hum);
|
||||
knx.write_2byte_float(knx.config_get_ga(pres_ga), last_pres);
|
||||
}
|
||||
}
|
||||
|
||||
delay(50);
|
||||
}
|
||||
|
||||
bool show_periodic_options()
|
||||
{
|
||||
return knx.config_get_bool(enable_sending_id);
|
||||
}
|
||||
|
||||
bool enable_reading_callback()
|
||||
{
|
||||
return knx.config_get_bool(enable_reading_id);
|
||||
}
|
||||
|
||||
void temp_cb(message_t const &msg, void *arg)
|
||||
{
|
||||
switch (msg.ct)
|
||||
{
|
||||
case KNX_CT_READ:
|
||||
{
|
||||
knx.answer_2byte_float(msg.received_on, last_temp);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void hum_cb(message_t const &msg, void *arg)
|
||||
{
|
||||
switch (msg.ct)
|
||||
{
|
||||
case KNX_CT_READ:
|
||||
{
|
||||
knx.answer_2byte_float(msg.received_on, last_hum);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void pres_cb(message_t const &msg, void *arg)
|
||||
{
|
||||
switch (msg.ct)
|
||||
{
|
||||
case KNX_CT_READ:
|
||||
{
|
||||
knx.answer_2byte_float(msg.received_on, last_pres);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,183 @@
|
|||
#include <esp-knx-ip.h>
|
||||
|
||||
// WiFi config here
|
||||
const char* ssid = "ssid";
|
||||
const char* pass = "pass";
|
||||
|
||||
// Common
|
||||
#define LED_PIN 13
|
||||
|
||||
// For Basic and S20
|
||||
#define BTN1_PIN 0
|
||||
#define CH1_PIN 12
|
||||
|
||||
// For 4CH
|
||||
#define BTN2_PIN 9
|
||||
#define CH2_PIN 5
|
||||
#define BTN3_PIN 10
|
||||
#define CH3_PIN 4
|
||||
#define BTN4_PIN 14
|
||||
#define CH4_PIN 15
|
||||
|
||||
typedef enum __type_option
|
||||
{
|
||||
SONOFF_TYPE_NONE = 0,
|
||||
SONOFF_TYPE_BASIC = 1,
|
||||
SONOFF_TYPE_S20 = 2,
|
||||
SONOFF_TYPE_4CH = 3,
|
||||
SONOFF_TYPE_4CH_PRO = 4,
|
||||
} type_option_t;
|
||||
|
||||
option_entry_t type_options[] = {
|
||||
{"Sonoff Basic", SONOFF_TYPE_BASIC},
|
||||
{"Sonoff S20", SONOFF_TYPE_S20},
|
||||
{"Sonoff 4CH", SONOFF_TYPE_4CH},
|
||||
{"Sonoff 4CH Pro", SONOFF_TYPE_4CH_PRO},
|
||||
{nullptr, 0}
|
||||
};
|
||||
|
||||
config_id_t hostname_id;
|
||||
config_id_t type_id;
|
||||
|
||||
typedef struct __sonoff_channel
|
||||
{
|
||||
int pin;
|
||||
int btn_pin;
|
||||
config_id_t status_ga_id;
|
||||
bool state;
|
||||
bool last_btn_state;
|
||||
} sonoff_channel_t;
|
||||
|
||||
sonoff_channel_t channels[] = {
|
||||
{CH1_PIN, BTN1_PIN, 0, false, false},
|
||||
{CH2_PIN, BTN2_PIN, 0, false, false},
|
||||
{CH3_PIN, BTN3_PIN, 0, false, false},
|
||||
{CH4_PIN, BTN4_PIN, 0, false, false},
|
||||
};
|
||||
|
||||
void setup()
|
||||
{
|
||||
pinMode(LED_PIN, OUTPUT);
|
||||
pinMode(BTN1_PIN, INPUT_PULLUP);
|
||||
pinMode(BTN2_PIN, INPUT_PULLUP);
|
||||
pinMode(BTN3_PIN, INPUT_PULLUP);
|
||||
pinMode(BTN4_PIN, INPUT_PULLUP);
|
||||
pinMode(CH1_PIN, OUTPUT);
|
||||
pinMode(CH2_PIN, OUTPUT);
|
||||
pinMode(CH3_PIN, OUTPUT);
|
||||
pinMode(CH4_PIN, OUTPUT);
|
||||
Serial.begin(115200);
|
||||
|
||||
// Register the config options
|
||||
hostname_id = knx.config_register_string("Hostname", 20, String("sonoff"));
|
||||
type_id = knx.config_register_options("Type", type_options, SONOFF_TYPE_BASIC);
|
||||
|
||||
channels[0].status_ga_id = knx.config_register_ga("Channel 1 Status GA");
|
||||
channels[1].status_ga_id = knx.config_register_ga("Channel 2 Status GA", is_4ch_or_4ch_pro);
|
||||
channels[2].status_ga_id = knx.config_register_ga("Channel 3 Status GA", is_4ch_or_4ch_pro);
|
||||
channels[3].status_ga_id = knx.config_register_ga("Channel 4 Status GA", is_4ch_or_4ch_pro);
|
||||
|
||||
knx.callback_register("Channel 1", channel_cb, &channels[0]);
|
||||
knx.callback_register("Channel 2", channel_cb, &channels[1], is_4ch_or_4ch_pro);
|
||||
knx.callback_register("Channel 3", channel_cb, &channels[2], is_4ch_or_4ch_pro);
|
||||
knx.callback_register("Channel 4", channel_cb, &channels[3], is_4ch_or_4ch_pro);
|
||||
|
||||
knx.feedback_register_bool("Channel 1 is on", &(channels[0].state));
|
||||
knx.feedback_register_action("Toogle channel 1", toggle_chan, &channels[0]);
|
||||
knx.feedback_register_bool("Channel 2 is on", &(channels[1].state), is_4ch_or_4ch_pro);
|
||||
knx.feedback_register_action("Toogle channel 2", toggle_chan, &channels[1], is_4ch_or_4ch_pro);
|
||||
knx.feedback_register_bool("Channel 3 is on", &(channels[2].state), is_4ch_or_4ch_pro);
|
||||
knx.feedback_register_action("Toogle channel 3", toggle_chan, &channels[2], is_4ch_or_4ch_pro);
|
||||
knx.feedback_register_bool("Channel 4 is on", &(channels[3].state), is_4ch_or_4ch_pro);
|
||||
knx.feedback_register_action("Toogle channel 4", toggle_chan, &channels[3], is_4ch_or_4ch_pro);
|
||||
|
||||
knx.load();
|
||||
|
||||
// Init WiFi
|
||||
WiFi.hostname(knx.config_get_string(hostname_id));
|
||||
WiFi.begin(ssid, pass);
|
||||
|
||||
Serial.println("");
|
||||
Serial.print("[Connecting]");
|
||||
Serial.print(ssid);
|
||||
|
||||
digitalWrite(LED_PIN, LOW);
|
||||
while (WiFi.status() != WL_CONNECTED) {
|
||||
digitalWrite(LED_PIN, HIGH);
|
||||
delay(500);
|
||||
Serial.print(".");
|
||||
digitalWrite(LED_PIN, LOW);
|
||||
}
|
||||
digitalWrite(LED_PIN, HIGH);
|
||||
|
||||
// Start knx
|
||||
knx.start();
|
||||
|
||||
Serial.println();
|
||||
Serial.println("Connected to wifi");
|
||||
Serial.println(WiFi.localIP());
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
knx.loop();
|
||||
|
||||
// Check local buttons
|
||||
check_button(&channels[0]);
|
||||
if (is_4ch_or_4ch_pro())
|
||||
{
|
||||
check_button(&channels[1]);
|
||||
check_button(&channels[2]);
|
||||
check_button(&channels[3]);
|
||||
}
|
||||
|
||||
delay(50);
|
||||
}
|
||||
|
||||
bool is_basic_or_s20()
|
||||
{
|
||||
uint8_t type = knx.config_get_options(type_id);
|
||||
return type == SONOFF_TYPE_BASIC || type == SONOFF_TYPE_S20;
|
||||
}
|
||||
|
||||
bool is_4ch_or_4ch_pro()
|
||||
{
|
||||
uint8_t type = knx.config_get_options(type_id);
|
||||
return type == SONOFF_TYPE_4CH ||type == SONOFF_TYPE_4CH_PRO;
|
||||
}
|
||||
|
||||
void check_button(sonoff_channel_t *chan)
|
||||
{
|
||||
bool state_now = digitalRead(chan->btn_pin) == HIGH ? true : false;
|
||||
if (state_now != chan->last_btn_state && state_now == LOW)
|
||||
{
|
||||
chan->state = !chan->state;
|
||||
digitalWrite(chan->pin, chan->state ? HIGH : LOW);
|
||||
knx.write_1bit(knx.config_get_ga(chan->status_ga_id), chan->state);
|
||||
}
|
||||
chan->last_btn_state = state_now;
|
||||
}
|
||||
|
||||
void toggle_chan(void *arg)
|
||||
{
|
||||
sonoff_channel_t *chan = (sonoff_channel_t *)arg;
|
||||
chan->state = !chan->state;
|
||||
digitalWrite(chan->pin, chan->state ? HIGH : LOW);
|
||||
knx.write_1bit(knx.config_get_ga(chan->status_ga_id), chan->state);
|
||||
}
|
||||
|
||||
void channel_cb(message_t const &msg, void *arg)
|
||||
{
|
||||
sonoff_channel_t *chan = (sonoff_channel_t *)arg;
|
||||
switch (msg.ct)
|
||||
{
|
||||
case KNX_CT_WRITE:
|
||||
chan->state = msg.data[0];
|
||||
Serial.println(chan->state ? "Toggle on" : "Toggle off");
|
||||
digitalWrite(chan->pin, chan->state ? HIGH : LOW);
|
||||
knx.write_1bit(knx.config_get_ga(chan->status_ga_id), chan->state);
|
||||
break;
|
||||
case KNX_CT_READ:
|
||||
knx.answer_1bit(msg.received_on, chan->state);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,142 @@
|
|||
/*
|
||||
* This is an example showing a simple environment sensor based on a BME280 attached via I2C.
|
||||
* It shows, how the library can used to statically configure a device without a webserver for config.
|
||||
* This sketch was tested on a WeMos D1 mini
|
||||
*/
|
||||
|
||||
#include <Adafruit_BME280.h>
|
||||
#include <esp-knx-ip.h>
|
||||
|
||||
// WiFi config here
|
||||
const char* ssid = "myssid";
|
||||
const char* pass = "mypassword";
|
||||
|
||||
#define LED_PIN D4
|
||||
#define UPDATE_INTERVAL 10000
|
||||
|
||||
unsigned long next_change = 0;
|
||||
|
||||
float last_temp = 0.0;
|
||||
float last_hum = 0.0;
|
||||
float last_pres = 0.0;
|
||||
|
||||
Adafruit_BME280 bme;
|
||||
|
||||
// Group addresses to send to (1/1/1, 1/1/2 and 1/1/3)
|
||||
address_t temp_ga = knx.GA_to_address(1, 1, 1);
|
||||
address_t hum_ga = knx.GA_to_address(1, 1, 2);
|
||||
address_t pres_ga = knx.GA_to_address(1, 1, 3);
|
||||
|
||||
void setup() {
|
||||
pinMode(LED_PIN, OUTPUT);
|
||||
Serial.begin(115200);
|
||||
|
||||
callback_id_t temp_cb = knx.callback_register("Read Temperature", temp_cb);
|
||||
callback_id_t hum_cb =knx.callback_register("Read Humidity", hum_cb);
|
||||
callback_id_t pres_cb =knx.callback_register("Read Pressure", pres_cb);
|
||||
|
||||
// Assign callbacks to group addresses (2/1/1, 2/1/2, 2/1/3)
|
||||
knx.callback_assign(temp_cb, knx.GA_to_address(2, 1, 1));
|
||||
knx.callback_assign(hum_cb, knx.GA_to_address(2, 1, 2));
|
||||
knx.callback_assign(pres_cb, knx.GA_to_address(2, 1, 3));
|
||||
|
||||
// Set physical address (1.1.1)
|
||||
knx.physical_address_set(knx.PA_to_address(1, 1, 1));
|
||||
|
||||
// Do not call knx.load() for static config, it will try to load config from EEPROM which we don't have here
|
||||
|
||||
// Init sensor
|
||||
if (!bme.begin(0x76)) {
|
||||
Serial.println("Could not find a valid BME280 sensor, check wiring!");
|
||||
}
|
||||
|
||||
// Init WiFi
|
||||
WiFi.hostname("env");
|
||||
WiFi.begin(ssid, pass);
|
||||
|
||||
Serial.println("");
|
||||
Serial.print("[Connecting]");
|
||||
Serial.print(ssid);
|
||||
|
||||
digitalWrite(LED_PIN, LOW);
|
||||
while (WiFi.status() != WL_CONNECTED) {
|
||||
digitalWrite(LED_PIN, HIGH);
|
||||
delay(250);
|
||||
Serial.print(".");
|
||||
digitalWrite(LED_PIN, LOW);
|
||||
delay(250);
|
||||
}
|
||||
digitalWrite(LED_PIN, HIGH);
|
||||
|
||||
// Start knx, disable webserver by passing nullptr
|
||||
knx.start(nullptr);
|
||||
|
||||
Serial.println();
|
||||
Serial.println("Connected to wifi");
|
||||
Serial.println(WiFi.localIP());
|
||||
}
|
||||
|
||||
void loop() {
|
||||
knx.loop();
|
||||
|
||||
unsigned long now = millis();
|
||||
|
||||
if (next_change < now)
|
||||
{
|
||||
next_change = now + UPDATE_INTERVAL;
|
||||
|
||||
last_temp = bme.readTemperature();
|
||||
last_hum = bme.readHumidity();
|
||||
last_pres = bme.readPressure()/100.0f;
|
||||
|
||||
Serial.print("T: ");
|
||||
Serial.print(last_temp);
|
||||
Serial.print("°C H: ");
|
||||
Serial.print(last_hum);
|
||||
Serial.print("% P: ");
|
||||
Serial.print(last_pres);
|
||||
Serial.println("hPa");
|
||||
|
||||
knx.write_2byte_float(temp_ga, last_temp);
|
||||
knx.write_2byte_float(hum_ga, last_hum);
|
||||
knx.write_2byte_float(pres_ga, last_pres);
|
||||
}
|
||||
|
||||
delay(50);
|
||||
}
|
||||
|
||||
void temp_cb(message_t const &msg, void *arg)
|
||||
{
|
||||
switch (msg.ct)
|
||||
{
|
||||
case KNX_CT_READ:
|
||||
{
|
||||
knx.answer_2byte_float(msg.received_on, last_temp);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void hum_cb(message_t const &msg, void *arg)
|
||||
{
|
||||
switch (msg.ct)
|
||||
{
|
||||
case KNX_CT_READ:
|
||||
{
|
||||
knx.answer_2byte_float(msg.received_on, last_hum);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void pres_cb(message_t const &msg, void *arg)
|
||||
{
|
||||
switch (msg.ct)
|
||||
{
|
||||
case KNX_CT_READ:
|
||||
{
|
||||
knx.answer_2byte_float(msg.received_on, last_pres);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,104 @@
|
|||
# datatypes
|
||||
address_t DATA_TYPE
|
||||
message_t DATA_TYPE
|
||||
callback_id_t DATA_TYPE
|
||||
callback_assignment_id_t DATA_TYPE
|
||||
option_entry_t DATA_TYPE
|
||||
config_id_t DATA_TYPE
|
||||
enable_condition_t DATA_TYPE
|
||||
callback_fptr_t DATA_TYPE
|
||||
feedback_action_fptr_t DATA_TYPE
|
||||
knx_command_type_t DATA_TYPE
|
||||
|
||||
# methods
|
||||
setup KEYWORD2
|
||||
loop KEYWORD2
|
||||
GA_to_address KEYWORD2
|
||||
PA_to_address KEYWORD2
|
||||
callback_register KEYWORD2
|
||||
callback_assign KEYWORD2
|
||||
callback_deregister KEYWORD2
|
||||
callback_unassign KEYWORD2
|
||||
physical_address_set KEYWORD2
|
||||
physical_address_get KEYWORD2
|
||||
config_register_string KEYWORD2
|
||||
config_register_int KEYWORD2
|
||||
config_register_bool KEYWORD2
|
||||
config_register_options KEYWORD2
|
||||
config_register_ga KEYWORD2
|
||||
config_get_string KEYWORD2
|
||||
config_get_int KEYWORD2
|
||||
config_get_bool KEYWORD2
|
||||
config_get_options KEYWORD2
|
||||
config_get_ga KEYWORD2
|
||||
config_set_string KEYWORD2
|
||||
config_set_int KEYWORD2
|
||||
config_set_bool KEYWORD2
|
||||
config_set_options KEYWORD2
|
||||
config_set_ga KEYWORD2
|
||||
feedback_register_int KEYWORD2
|
||||
feedback_register_float KEYWORD2
|
||||
feedback_register_bool KEYWORD2
|
||||
feedback_register_action KEYWORD2
|
||||
send_1bit KEYWORD2
|
||||
send_2bit KEYWORD2
|
||||
send_4bit KEYWORD2
|
||||
send_1byte_int KEYWORD2
|
||||
send_1byte_uint KEYWORD2
|
||||
send_2byte_int KEYWORD2
|
||||
send_2byte_uint KEYWORD2
|
||||
send_2byte_float KEYWORD2
|
||||
send_3byte_time KEYWORD2
|
||||
send_3byte_time KEYWORD2
|
||||
send_3byte_date KEYWORD2
|
||||
send_3byte_date KEYWORD2
|
||||
send_3byte_color KEYWORD2
|
||||
send_3byte_color KEYWORD2
|
||||
send_4byte_int KEYWORD2
|
||||
send_4byte_uint KEYWORD2
|
||||
send_4byte_float KEYWORD2
|
||||
write_1bit KEYWORD2
|
||||
write_2bit KEYWORD2
|
||||
write_4bit KEYWORD2
|
||||
write_1byte_int KEYWORD2
|
||||
write_1byte_uint KEYWORD2
|
||||
write_2byte_int KEYWORD2
|
||||
write_2byte_uint KEYWORD2
|
||||
write_2byte_float KEYWORD2
|
||||
write_3byte_time KEYWORD2
|
||||
write_3byte_time KEYWORD2
|
||||
write_3byte_date KEYWORD2
|
||||
write_3byte_date KEYWORD2
|
||||
write_3byte_color KEYWORD2
|
||||
write_3byte_color KEYWORD2
|
||||
write_4byte_int KEYWORD2
|
||||
write_4byte_uint KEYWORD2
|
||||
write_4byte_float KEYWORD2
|
||||
answer_1bit KEYWORD2
|
||||
answer_2bit KEYWORD2
|
||||
answer_4bit KEYWORD2
|
||||
answer_1byte_int KEYWORD2
|
||||
answer_1byte_uint KEYWORD2
|
||||
answer_2byte_int KEYWORD2
|
||||
answer_2byte_uint KEYWORD2
|
||||
answer_2byte_float KEYWORD2
|
||||
answer_3byte_time KEYWORD2
|
||||
answer_3byte_time KEYWORD2
|
||||
answer_3byte_date KEYWORD2
|
||||
answer_3byte_date KEYWORD2
|
||||
answer_3byte_color KEYWORD2
|
||||
answer_3byte_color KEYWORD2
|
||||
answer_4byte_int KEYWORD2
|
||||
answer_4byte_uint KEYWORD2
|
||||
answer_4byte_float KEYWORD2
|
||||
|
||||
data_to_1byte_int KEYWORD 2
|
||||
data_to_2byte_int KEYWORD 2
|
||||
data_to_2byte_float KEYWORD 2
|
||||
data_to_4byte_float KEYWORD 2
|
||||
data_to_3byte_color KEYWORD 2
|
||||
data_to_3byte_time KEYWORD 2
|
||||
data_to_3byte_data KEYWORD 2
|
||||
|
||||
# constants
|
||||
knx LITERAL1
|
|
@ -0,0 +1,10 @@
|
|||
name=ESP KNX IP Library
|
||||
version=0.5
|
||||
author=Nico Weichbrodt <envy>
|
||||
maintainer=Nico Weichbrodt <envy>
|
||||
sentence=ESP8266 library for KNX/IP communication.
|
||||
paragraph=Build your own IoT devices with KNX/IP connectivity!
|
||||
category=Communication
|
||||
url=https://github.com/envy/esp-knx-ip
|
||||
architectures=esp8266
|
||||
includes=esp-knx-ip.h
|
|
@ -0,0 +1,28 @@
|
|||
# C++ objects and libs
|
||||
|
||||
*.slo
|
||||
*.lo
|
||||
*.o
|
||||
#*.a
|
||||
*.la
|
||||
*.lai
|
||||
*.so
|
||||
*.dll
|
||||
*.dylib
|
||||
|
||||
#Makefile
|
||||
*-build-*
|
||||
build-*
|
||||
*.autosave
|
||||
|
||||
# .log files (usually created by QtTest - thanks to VestniK)
|
||||
*.log
|
||||
|
||||
|
||||
# Editors temporary files
|
||||
*~
|
||||
|
||||
|
||||
#OSX
|
||||
.DS_Store
|
||||
._*
|
|
@ -0,0 +1,15 @@
|
|||
MQTT
|
||||
====
|
||||
|
||||
A Wrapper around mqtt for Arduino to be used with esp8266 modules.
|
||||
|
||||
It wraps a slightly modified version of mqtt for esp8266 ported by Tuan PM.
|
||||
Original code for esp: https://github.com/tuanpmt/esp_mqtt
|
||||
Original code for contiki: https://github.com/esar/contiki-mqtt
|
||||
|
||||
|
||||
====
|
||||
|
||||
**secure libssl:**
|
||||
|
||||
If you want to use secure communication, please use the `secure`-branch!
|
|
@ -0,0 +1,102 @@
|
|||
#include <ESP8266WiFi.h>
|
||||
#include <MQTT.h>
|
||||
|
||||
void myDataCb(String& topic, String& data);
|
||||
void myPublishedCb();
|
||||
void myDisconnectedCb();
|
||||
void myConnectedCb();
|
||||
|
||||
#define CLIENT_ID "client1"
|
||||
|
||||
// create MQTT object
|
||||
MQTT myMqtt(CLIENT_ID, "192.168.0.1", 1883);
|
||||
|
||||
//
|
||||
const char* ssid = "ssid";
|
||||
const char* password = "ssid_password";
|
||||
|
||||
|
||||
//
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
delay(1000);
|
||||
|
||||
Serial.println();
|
||||
Serial.println();
|
||||
Serial.print("Connecting to ");
|
||||
Serial.println(ssid);
|
||||
|
||||
WiFi.begin(ssid, password);
|
||||
|
||||
while (WiFi.status() != WL_CONNECTED) {
|
||||
delay(500);
|
||||
Serial.print(".");
|
||||
}
|
||||
|
||||
Serial.println("");
|
||||
Serial.println("WiFi connected");
|
||||
Serial.println("IP address: ");
|
||||
Serial.println(WiFi.localIP());
|
||||
|
||||
Serial.println("Connecting to MQTT server");
|
||||
|
||||
// setup callbacks
|
||||
myMqtt.onConnected(myConnectedCb);
|
||||
myMqtt.onDisconnected(myDisconnectedCb);
|
||||
myMqtt.onPublished(myPublishedCb);
|
||||
myMqtt.onData(myDataCb);
|
||||
|
||||
Serial.println("connect mqtt...");
|
||||
myMqtt.connect();
|
||||
|
||||
delay(10);
|
||||
}
|
||||
|
||||
//
|
||||
void loop() {
|
||||
|
||||
int value = analogRead(A0);
|
||||
|
||||
String topic("/");
|
||||
topic += CLIENT_ID;
|
||||
topic += "/value";
|
||||
|
||||
String valueStr(value);
|
||||
|
||||
// publish value to topic
|
||||
boolean result = myMqtt.publish(topic, valueStr);
|
||||
|
||||
delay(1000);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
void myConnectedCb()
|
||||
{
|
||||
Serial.println("connected to MQTT server");
|
||||
}
|
||||
|
||||
void myDisconnectedCb()
|
||||
{
|
||||
Serial.println("disconnected. try to reconnect...");
|
||||
delay(500);
|
||||
myMqtt.connect();
|
||||
}
|
||||
|
||||
void myPublishedCb()
|
||||
{
|
||||
//Serial.println("published.");
|
||||
}
|
||||
|
||||
void myDataCb(String& topic, String& data)
|
||||
{
|
||||
|
||||
Serial.print(topic);
|
||||
Serial.print(": ");
|
||||
Serial.println(data);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
#include <ESP8266WiFi.h>
|
||||
#include <MQTT.h>
|
||||
|
||||
void myDataCb(String& topic, String& data);
|
||||
void myPublishedCb();
|
||||
void myDisconnectedCb();
|
||||
void myConnectedCb();
|
||||
|
||||
#define CLIENT_ID "client3"
|
||||
#define TOPIC "/client1/value"
|
||||
|
||||
|
||||
// create MQTT
|
||||
MQTT myMqtt(CLIENT_ID, "192.168.0.1", 1883);
|
||||
|
||||
|
||||
const char* ssid = "ssid";
|
||||
const char* password = "ssid_password";
|
||||
|
||||
|
||||
//
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
delay(1000);
|
||||
|
||||
Serial.println();
|
||||
Serial.println();
|
||||
Serial.print("Connecting to ");
|
||||
Serial.println(ssid);
|
||||
|
||||
WiFi.begin(ssid, password);
|
||||
|
||||
while (WiFi.status() != WL_CONNECTED) {
|
||||
delay(500);
|
||||
Serial.print(".");
|
||||
}
|
||||
|
||||
Serial.println("");
|
||||
Serial.println("WiFi connected");
|
||||
Serial.println("IP address: ");
|
||||
Serial.println(WiFi.localIP());
|
||||
|
||||
|
||||
Serial.println("Connecting to MQTT server");
|
||||
|
||||
// setup callbacks
|
||||
myMqtt.onConnected(myConnectedCb);
|
||||
myMqtt.onDisconnected(myDisconnectedCb);
|
||||
myMqtt.onPublished(myPublishedCb);
|
||||
myMqtt.onData(myDataCb);
|
||||
|
||||
Serial.println("connect mqtt...");
|
||||
myMqtt.connect();
|
||||
|
||||
Serial.println("subscribe to topic...");
|
||||
myMqtt.subscribe(TOPIC);
|
||||
|
||||
delay(10);
|
||||
}
|
||||
|
||||
//
|
||||
void loop() {
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
void myConnectedCb()
|
||||
{
|
||||
Serial.println("connected to MQTT server");
|
||||
}
|
||||
|
||||
void myDisconnectedCb()
|
||||
{
|
||||
Serial.println("disconnected. try to reconnect...");
|
||||
delay(500);
|
||||
myMqtt.connect();
|
||||
}
|
||||
|
||||
void myPublishedCb()
|
||||
{
|
||||
//Serial.println("published.");
|
||||
}
|
||||
|
||||
void myDataCb(String& topic, String& data)
|
||||
{
|
||||
|
||||
Serial.print(topic);
|
||||
Serial.print(": ");
|
||||
Serial.println(data);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
#######################################
|
||||
# Syntax Coloring Map For Test
|
||||
#######################################
|
||||
|
||||
#######################################
|
||||
# Datatypes (KEYWORD1)
|
||||
#######################################
|
||||
|
||||
MQTT.h KEYWORD1
|
||||
|
||||
MQTT KEYWORD1
|
||||
|
||||
|
||||
#######################################
|
||||
# Methods and Functions (KEYWORD2)
|
||||
#######################################
|
||||
|
||||
setClientId KEYWORD2
|
||||
setUserPwd KEYWORD2
|
||||
|
||||
connect KEYWORD2
|
||||
disconnect KEYWORD2
|
||||
isConnected KEYWORD2
|
||||
|
||||
publish KEYWORD2
|
||||
subscribe KEYWORD2
|
||||
|
||||
getState KEYWORD2
|
||||
|
||||
#general
|
||||
onConnected KEYWORD2
|
||||
onDisconnected KEYWORD2
|
||||
onPublished KEYWORD2
|
||||
onData KEYWORD2
|
||||
|
||||
#######################################
|
||||
# Instances (KEYWORD2)
|
||||
#######################################
|
||||
|
||||
#######################################
|
||||
# Constants (LITERAL1)
|
||||
#######################################
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
name=ESP MQTT
|
||||
version=1.0.1
|
||||
author=Ingo Randolf
|
||||
maintainer=Ingo Randolf
|
||||
sentence=A Wrapper around mqtt for Arduino to be used with esp8266 modules.
|
||||
paragraph=It wraps a slightly modified version of mqtt for esp8266 ported by Tuan PM. Original code for esp: https://github.com/tuanpmt/esp_mqtt (7ec2ef8e1df0422b77348fe1da7885568e0c9d01) Original code for contiki: https://github.com/esar/contiki-mqtt
|
||||
category=Communication
|
||||
url=https://github.com/i-n-g-o/esp-mqtt-arduino
|
||||
architectures=esp8266
|
|
@ -0,0 +1,269 @@
|
|||
/*//-------------------------------------------------------------------------------
|
||||
* MQTT.cpp
|
||||
*
|
||||
* Implementation file for MQTT Wrapper
|
||||
*
|
||||
* Wrapper for Arduino written by Ingo Randolf during
|
||||
* eTextiles Summercamp 2015.
|
||||
*
|
||||
* This library is intended to be used with esp8266 modules.
|
||||
*
|
||||
*
|
||||
* This class wraps a slightly modified version of mqtt
|
||||
* for esp8266 written by Tuan PM.
|
||||
* Original code: https://github.com/tuanpmt/esp_mqtt
|
||||
*
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
//-------------------------------------------------------------------------------*/
|
||||
#include "MQTT.h"
|
||||
|
||||
#include "user_interface.h"
|
||||
#include "osapi.h"
|
||||
#include "os_type.h"
|
||||
#include "mqtt/debug.h"
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// mqtt internal callbacks
|
||||
//------------------------------------------------------------------------------------
|
||||
static void mqttConnectedCb(uint32_t *args)
|
||||
{
|
||||
MQTT_Client* client = (MQTT_Client*)args;
|
||||
|
||||
MQTT* _this = (MQTT*)client->user_data;
|
||||
|
||||
if (_this && _this->onMqttConnectedCb) {
|
||||
_this->onMqttConnectedCb();
|
||||
}
|
||||
}
|
||||
|
||||
static void mqttDisconnectedCb(uint32_t *args)
|
||||
{
|
||||
MQTT_Client* client = (MQTT_Client*)args;
|
||||
|
||||
MQTT* _this = (MQTT*)client->user_data;
|
||||
|
||||
if (_this && _this->onMqttDisconnectedCb) {
|
||||
_this->onMqttDisconnectedCb();
|
||||
}
|
||||
}
|
||||
|
||||
static void mqttPublishedCb(uint32_t *args)
|
||||
{
|
||||
MQTT_Client* client = (MQTT_Client*)args;
|
||||
|
||||
MQTT* _this = (MQTT*)client->user_data;
|
||||
|
||||
if (_this && _this->onMqttPublishedCb) {
|
||||
_this->onMqttPublishedCb();
|
||||
}
|
||||
}
|
||||
|
||||
static void mqttDataCb(uint32_t *args, const char* topic, uint32_t topic_len, const char *data, uint32_t data_len)
|
||||
{
|
||||
MQTT_Client* client = (MQTT_Client*)args;
|
||||
|
||||
MQTT* _this = (MQTT*)client->user_data;
|
||||
|
||||
if (_this) {
|
||||
|
||||
_this->_onMqttDataCb(topic, topic_len, data, data_len);
|
||||
}
|
||||
}
|
||||
|
||||
static void mqttTimeoutCb(uint32_t *args)
|
||||
{
|
||||
MQTT_Client* client = (MQTT_Client*)args;
|
||||
|
||||
MQTT* _this = (MQTT*)client->user_data;
|
||||
|
||||
// if (_this && _this->onMqttTimeoutCb) {
|
||||
// _this->onMqttTimeoutCb();
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// MQTT class implementation
|
||||
//------------------------------------------------------------------------------------
|
||||
|
||||
//MQTT::MQTT(const char* client_id, const char* host, uint32_t port) :
|
||||
MQTT::MQTT(const char* client_id, const char* host, uint32_t port, const char* willTopic, uint8_t willQos, boolean willRetain, const char* willMessage) :
|
||||
onMqttConnectedCb(0)
|
||||
,onMqttDisconnectedCb(0)
|
||||
,onMqttPublishedCb(0)
|
||||
,onMqttDataCb(0)
|
||||
,onMqttDataRawCb(0)
|
||||
{
|
||||
// init connections
|
||||
MQTT_InitConnection(&mqttClient, (uint8_t*)host, port, 0);
|
||||
|
||||
// init client
|
||||
if ( !MQTT_InitClient(&mqttClient, (uint8_t*)client_id, (uint8_t*)"", (uint8_t*)"", 15, 1) ) {
|
||||
MQTT_INFO("Failed to initialize properly. Check MQTT version.\r\n");
|
||||
}
|
||||
|
||||
// init LWT
|
||||
// MQTT_InitLWT(&mqttClient, (uint8_t*)"/lwt", (uint8_t*)"offline", 0, 0);
|
||||
MQTT_InitLWT(&mqttClient, (uint8_t*)willTopic, (uint8_t*)willMessage, willQos, (uint8_t)willRetain);
|
||||
|
||||
// set user data
|
||||
mqttClient.user_data = (void*)this;
|
||||
|
||||
// setup callbacks
|
||||
MQTT_OnConnected(&mqttClient, mqttConnectedCb);
|
||||
MQTT_OnDisconnected(&mqttClient, mqttDisconnectedCb);
|
||||
MQTT_OnPublished(&mqttClient, mqttPublishedCb);
|
||||
MQTT_OnData(&mqttClient, mqttDataCb);
|
||||
|
||||
MQTT_OnTimeout(&mqttClient, mqttTimeoutCb);
|
||||
}
|
||||
|
||||
|
||||
MQTT::~MQTT()
|
||||
{
|
||||
MQTT_DeleteClient(&mqttClient);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*/
|
||||
void MQTT::setClientId(const char* client_id)
|
||||
{
|
||||
MQTT_SetUserId(&mqttClient, client_id);
|
||||
}
|
||||
|
||||
void MQTT::setUserPwd(const char* user, const char* pwd)
|
||||
{
|
||||
MQTT_SetUserPwd(&mqttClient, user, pwd);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*/
|
||||
void MQTT::connect()
|
||||
{
|
||||
MQTT_Connect(&mqttClient);
|
||||
}
|
||||
|
||||
void MQTT::disconnect()
|
||||
{
|
||||
MQTT_Disconnect(&mqttClient);
|
||||
}
|
||||
|
||||
bool MQTT::isConnected()
|
||||
{
|
||||
return (mqttClient.connState >= TCP_CONNECTED);
|
||||
}
|
||||
|
||||
/*
|
||||
*/
|
||||
bool MQTT::publish(const char* topic, const char* buf, uint32_t buf_len, int qos, int retain)
|
||||
{
|
||||
return MQTT_Publish(&mqttClient, topic, buf, buf_len, qos, retain);
|
||||
}
|
||||
|
||||
bool MQTT::publish(String& topic, String& data, int qos, int retain)
|
||||
{
|
||||
return publish(topic.c_str(), data.c_str(), data.length(), qos, retain);
|
||||
}
|
||||
|
||||
bool MQTT::publish(String& topic, const char* buf, uint32_t buf_len, int qos, int retain)
|
||||
{
|
||||
return publish(topic.c_str(), buf, buf_len, qos, retain);
|
||||
}
|
||||
|
||||
bool MQTT::publish(const char* topic, String& data, int qos, int retain)
|
||||
{
|
||||
return publish(topic, data.c_str(), data.length(), qos, retain);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*/
|
||||
bool MQTT::subscribe(const char* topic, uint8_t qos)
|
||||
{
|
||||
return MQTT_Subscribe(&mqttClient, (char*)topic, qos);
|
||||
}
|
||||
|
||||
bool MQTT::subscribe(const String& topic, uint8_t qos)
|
||||
{
|
||||
return MQTT_Subscribe(&mqttClient, (char*)topic.c_str(), qos);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
// set user callback functions
|
||||
//-------------------------------------------------------------------------------
|
||||
void MQTT::onConnected( void (*function)(void) )
|
||||
{
|
||||
onMqttConnectedCb = function;
|
||||
}
|
||||
|
||||
void MQTT::onDisconnected( void (*function)(void) )
|
||||
{
|
||||
onMqttDisconnectedCb = function;
|
||||
}
|
||||
|
||||
void MQTT::onPublished( void (*function)(void) )
|
||||
{
|
||||
onMqttPublishedCb = function;
|
||||
}
|
||||
|
||||
void MQTT::onData( void (*function)(String&, String&) )
|
||||
{
|
||||
onMqttDataCb = function;
|
||||
}
|
||||
|
||||
void MQTT::onData( void (*function)(const char*, uint32_t, const char*, uint32_t) )
|
||||
{
|
||||
onMqttDataRawCb = function;
|
||||
}
|
||||
|
||||
|
||||
// internal callback, calling user CB
|
||||
void MQTT::_onMqttDataCb(const char* topic, uint32_t topic_len, const char* buf, uint32_t buf_len)
|
||||
{
|
||||
if (onMqttDataRawCb) {
|
||||
onMqttDataRawCb(topic, topic_len, buf, buf_len);
|
||||
}
|
||||
|
||||
if (onMqttDataCb) {
|
||||
|
||||
char* topicCpy = (char*)malloc(topic_len+1);
|
||||
memcpy(topicCpy, topic, topic_len);
|
||||
topicCpy[topic_len] = 0;
|
||||
// string it
|
||||
String topicStr(topicCpy);
|
||||
|
||||
char* bufCpy = (char*)malloc(buf_len+1);
|
||||
memcpy(bufCpy, buf, buf_len);
|
||||
bufCpy[buf_len] = 0;
|
||||
// string it
|
||||
String bufStr(bufCpy);
|
||||
|
||||
onMqttDataCb(topicStr, bufStr);
|
||||
|
||||
free(topicCpy);
|
||||
free(bufCpy);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,93 @@
|
|||
/*//-------------------------------------------------------------------------------
|
||||
* MQTT.h
|
||||
*
|
||||
* Header file for MQTT Wrapper
|
||||
*
|
||||
* Wrapper for Arduino written by Ingo Randolf during
|
||||
* eTextiles Summercamp 2015.
|
||||
*
|
||||
* This library is intended to be used with esp8266 modules.
|
||||
*
|
||||
*
|
||||
* This class wraps a slightly modified version of mqtt
|
||||
* for esp8266 written by Tuan PM.
|
||||
* Original code: https://github.com/tuanpmt/esp_mqtt
|
||||
*
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
//-------------------------------------------------------------------------------*/
|
||||
#ifndef MQTT_WRAPPER_H
|
||||
#define MQTT_WRAPPER_H
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
|
||||
extern "C" {
|
||||
#include <stddef.h>
|
||||
#include "mqtt/mqtt.h"
|
||||
}
|
||||
|
||||
class MQTT
|
||||
{
|
||||
public:
|
||||
// MQTT(const char* client_id, const char* host, uint32_t port);
|
||||
MQTT(const char* client_id, const char* host, uint32_t port, const char* willTopic, uint8_t willQos, boolean willRetain, const char* willMessage);
|
||||
|
||||
~MQTT();
|
||||
|
||||
void setClientId(const char* client_id);
|
||||
void setUserPwd(const char* user, const char* pwd);
|
||||
|
||||
void connect();
|
||||
void disconnect();
|
||||
bool isConnected();
|
||||
|
||||
bool publish(const char* topic, const char* buf, uint32_t buf_len, int qos = 0, int retain = 0);
|
||||
bool publish(String& topic, String& data, int qos = 0, int retain = 0);
|
||||
bool publish(String& topic, const char* buf, uint32_t buf_len, int qos = 0, int retain = 0);
|
||||
bool publish(const char* topic, String& data, int qos = 0, int retain = 0);
|
||||
|
||||
bool subscribe(const char* topic, uint8_t qos = 0);
|
||||
bool subscribe(const String& topic, uint8_t qos = 0);
|
||||
|
||||
int getState() { return mqttClient.connState; };
|
||||
|
||||
// set callbacks
|
||||
void onConnected( void (*)(void) );
|
||||
void onDisconnected( void (*)(void) );
|
||||
void onPublished( void (*)(void) );
|
||||
void onData( void (*)(String&, String&) );
|
||||
void onData( void (*)(const char*, uint32_t, const char*, uint32_t) );
|
||||
|
||||
// user callbacks
|
||||
void (*onMqttConnectedCb)(void);
|
||||
void (*onMqttDisconnectedCb)(void);
|
||||
void (*onMqttPublishedCb)(void);
|
||||
void (*onMqttDataCb) (String&, String&);
|
||||
void (*onMqttDataRawCb) (const char*, uint32_t, const char*, uint32_t);
|
||||
|
||||
// internal callback
|
||||
void _onMqttDataCb(const char*, uint32_t, const char*, uint32_t);
|
||||
|
||||
private:
|
||||
MQTT_Client mqttClient;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* debug.h
|
||||
*
|
||||
* Created on: Dec 4, 2014
|
||||
* Author: Minh
|
||||
*/
|
||||
|
||||
#ifndef USER_DEBUG_H_
|
||||
#define USER_DEBUG_H_
|
||||
|
||||
|
||||
#if defined(MQTT_DEBUG_ON)
|
||||
#define MQTT_INFO( format, ... ) os_printf( format, ## __VA_ARGS__ )
|
||||
#else
|
||||
#define MQTT_INFO( format, ... )
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* USER_DEBUG_H_ */
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,152 @@
|
|||
/* mqtt.h
|
||||
*
|
||||
* Copyright (c) 2014-2015, Tuan PM <tuanpm at live dot com>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of Redis nor the names of its contributors may be used
|
||||
* to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#ifndef USER_AT_MQTT_H_
|
||||
#define USER_AT_MQTT_H_
|
||||
#include "mqtt_config.h"
|
||||
#include "mqtt_msg.h"
|
||||
#include "user_interface.h"
|
||||
|
||||
#include "queue.h"
|
||||
typedef struct mqtt_event_data_t
|
||||
{
|
||||
uint8_t type;
|
||||
const char* topic;
|
||||
const char* data;
|
||||
uint16_t topic_length;
|
||||
uint16_t data_length;
|
||||
uint16_t data_offset;
|
||||
} mqtt_event_data_t;
|
||||
|
||||
typedef struct mqtt_state_t
|
||||
{
|
||||
uint16_t port;
|
||||
int auto_reconnect;
|
||||
mqtt_connect_info_t* connect_info;
|
||||
uint8_t* in_buffer;
|
||||
uint8_t* out_buffer;
|
||||
int in_buffer_length;
|
||||
int out_buffer_length;
|
||||
uint16_t message_length;
|
||||
uint16_t message_length_read;
|
||||
mqtt_message_t* outbound_message;
|
||||
mqtt_connection_t mqtt_connection;
|
||||
uint16_t pending_msg_id;
|
||||
int pending_msg_type;
|
||||
int pending_publish_qos;
|
||||
} mqtt_state_t;
|
||||
|
||||
typedef enum {
|
||||
WIFI_INIT,
|
||||
WIFI_CONNECTING,
|
||||
WIFI_CONNECTING_ERROR,
|
||||
WIFI_CONNECTED,
|
||||
DNS_RESOLVE,
|
||||
TCP_DISCONNECTING,
|
||||
TCP_DISCONNECTED,
|
||||
TCP_RECONNECT_DISCONNECTING,
|
||||
TCP_RECONNECT_REQ,
|
||||
TCP_RECONNECT,
|
||||
TCP_CONNECTING,
|
||||
TCP_CONNECTING_ERROR,
|
||||
TCP_CONNECTED,
|
||||
MQTT_CONNECT_SEND,
|
||||
MQTT_CONNECT_SENDING,
|
||||
MQTT_SUBSCIBE_SEND,
|
||||
MQTT_SUBSCIBE_SENDING,
|
||||
MQTT_DATA,
|
||||
MQTT_KEEPALIVE_SEND,
|
||||
MQTT_PUBLISH_RECV,
|
||||
MQTT_PUBLISHING,
|
||||
MQTT_DELETING,
|
||||
MQTT_DELETED,
|
||||
} tConnState;
|
||||
|
||||
typedef void (*MqttCallback)(uint32_t *args);
|
||||
typedef void (*MqttDataCallback)(uint32_t *args, const char* topic, uint32_t topic_len, const char *data, uint32_t lengh);
|
||||
|
||||
typedef struct {
|
||||
struct espconn *pCon;
|
||||
uint8_t security;
|
||||
uint8_t* host;
|
||||
uint32_t port;
|
||||
ip_addr_t ip;
|
||||
mqtt_state_t mqtt_state;
|
||||
mqtt_connect_info_t connect_info;
|
||||
MqttCallback connectedCb;
|
||||
MqttCallback disconnectedCb;
|
||||
MqttCallback publishedCb;
|
||||
MqttCallback timeoutCb;
|
||||
MqttDataCallback dataCb;
|
||||
ETSTimer mqttTimer;
|
||||
uint32_t keepAliveTick;
|
||||
uint32_t reconnectTick;
|
||||
uint32_t sendTimeout;
|
||||
tConnState connState;
|
||||
QUEUE msgQueue;
|
||||
void* user_data;
|
||||
} MQTT_Client;
|
||||
|
||||
#define SEC_NONSSL 0
|
||||
#define SEC_SSL 1
|
||||
|
||||
#define MQTT_FLAG_CONNECTED 1
|
||||
#define MQTT_FLAG_READY 2
|
||||
#define MQTT_FLAG_EXIT 4
|
||||
|
||||
#define MQTT_EVENT_TYPE_NONE 0
|
||||
#define MQTT_EVENT_TYPE_CONNECTED 1
|
||||
#define MQTT_EVENT_TYPE_DISCONNECTED 2
|
||||
#define MQTT_EVENT_TYPE_SUBSCRIBED 3
|
||||
#define MQTT_EVENT_TYPE_UNSUBSCRIBED 4
|
||||
#define MQTT_EVENT_TYPE_PUBLISH 5
|
||||
#define MQTT_EVENT_TYPE_PUBLISHED 6
|
||||
#define MQTT_EVENT_TYPE_EXITED 7
|
||||
#define MQTT_EVENT_TYPE_PUBLISH_CONTINUATION 8
|
||||
|
||||
void ICACHE_FLASH_ATTR MQTT_InitConnection(MQTT_Client *mqttClient, uint8_t* host, uint32_t port, uint8_t security);
|
||||
bool ICACHE_FLASH_ATTR MQTT_InitClient(MQTT_Client *mqttClient, uint8_t* client_id, uint8_t* client_user, uint8_t* client_pass, uint32_t keepAliveTime, uint8_t cleanSession);
|
||||
void ICACHE_FLASH_ATTR MQTT_DeleteClient(MQTT_Client *mqttClient);
|
||||
void ICACHE_FLASH_ATTR MQTT_InitLWT(MQTT_Client *mqttClient, uint8_t* will_topic, uint8_t* will_msg, uint8_t will_qos, uint8_t will_retain);
|
||||
|
||||
void ICACHE_FLASH_ATTR MQTT_SetUserId(MQTT_Client *mqttClient, const char* client_id);
|
||||
void ICACHE_FLASH_ATTR MQTT_SetUserPwd(MQTT_Client *mqttClient, const char* user_id, const char* pwd);
|
||||
|
||||
void ICACHE_FLASH_ATTR MQTT_OnConnected(MQTT_Client *mqttClient, MqttCallback connectedCb);
|
||||
void ICACHE_FLASH_ATTR MQTT_OnDisconnected(MQTT_Client *mqttClient, MqttCallback disconnectedCb);
|
||||
void ICACHE_FLASH_ATTR MQTT_OnPublished(MQTT_Client *mqttClient, MqttCallback publishedCb);
|
||||
void ICACHE_FLASH_ATTR MQTT_OnTimeout(MQTT_Client *mqttClient, MqttCallback timeoutCb);
|
||||
void ICACHE_FLASH_ATTR MQTT_OnData(MQTT_Client *mqttClient, MqttDataCallback dataCb);
|
||||
bool ICACHE_FLASH_ATTR MQTT_Subscribe(MQTT_Client *client, char* topic, uint8_t qos);
|
||||
bool ICACHE_FLASH_ATTR MQTT_UnSubscribe(MQTT_Client *client, char* topic);
|
||||
void ICACHE_FLASH_ATTR MQTT_Connect(MQTT_Client *mqttClient);
|
||||
void ICACHE_FLASH_ATTR MQTT_Disconnect(MQTT_Client *mqttClient);
|
||||
bool ICACHE_FLASH_ATTR MQTT_Publish(MQTT_Client *client, const char* topic, const char* data, int data_length, int qos, int retain);
|
||||
|
||||
#endif /* USER_AT_MQTT_H_ */
|
|
@ -0,0 +1,19 @@
|
|||
#ifndef __MQTT_CONFIG_H__
|
||||
#define __MQTT_CONFIG_H__
|
||||
|
||||
//#define MQTT_SSL_ENABLE
|
||||
|
||||
/*DEFAULT CONFIGURATIONS*/
|
||||
|
||||
#define MQTT_BUF_SIZE 1024
|
||||
//#define MQTT_KEEPALIVE 120 /*second*/
|
||||
#define MQTT_KEEPALIVE 15 /*second*/
|
||||
|
||||
#define MQTT_RECONNECT_TIMEOUT 5 /*second*/
|
||||
|
||||
#define QUEUE_BUFFER_SIZE 2048
|
||||
|
||||
//#define PROTOCOL_NAMEv31 /*MQTT version 3.1 compatible with Mosquitto v0.15*/
|
||||
#define PROTOCOL_NAMEv311 /*MQTT version 3.11 compatible with https://eclipse.org/paho/clients/testing/*/
|
||||
|
||||
#endif // __MQTT_CONFIG_H__
|
|
@ -0,0 +1,487 @@
|
|||
/*
|
||||
* Copyright (c) 2014, Stephen Robinson
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include "mqtt_msg.h"
|
||||
#include "mqtt_config.h"
|
||||
#define MQTT_MAX_FIXED_HEADER_SIZE 3
|
||||
|
||||
enum mqtt_connect_flag
|
||||
{
|
||||
MQTT_CONNECT_FLAG_USERNAME = 1 << 7,
|
||||
MQTT_CONNECT_FLAG_PASSWORD = 1 << 6,
|
||||
MQTT_CONNECT_FLAG_WILL_RETAIN = 1 << 5,
|
||||
MQTT_CONNECT_FLAG_WILL = 1 << 2,
|
||||
MQTT_CONNECT_FLAG_CLEAN_SESSION = 1 << 1
|
||||
};
|
||||
|
||||
struct __attribute((__packed__)) mqtt_connect_variable_header
|
||||
{
|
||||
uint8_t lengthMsb;
|
||||
uint8_t lengthLsb;
|
||||
#if defined(PROTOCOL_NAMEv31)
|
||||
uint8_t magic[6];
|
||||
#elif defined(PROTOCOL_NAMEv311)
|
||||
uint8_t magic[4];
|
||||
#else
|
||||
#error "Please define protocol name"
|
||||
#endif
|
||||
uint8_t version;
|
||||
uint8_t flags;
|
||||
uint8_t keepaliveMsb;
|
||||
uint8_t keepaliveLsb;
|
||||
};
|
||||
|
||||
static int ICACHE_FLASH_ATTR append_string(mqtt_connection_t* connection, const char* string, int len)
|
||||
{
|
||||
if (connection->message.length + len + 2 > connection->buffer_length)
|
||||
return -1;
|
||||
|
||||
connection->buffer[connection->message.length++] = len >> 8;
|
||||
connection->buffer[connection->message.length++] = len & 0xff;
|
||||
memcpy(connection->buffer + connection->message.length, string, len);
|
||||
connection->message.length += len;
|
||||
|
||||
return len + 2;
|
||||
}
|
||||
|
||||
static uint16_t ICACHE_FLASH_ATTR append_message_id(mqtt_connection_t* connection, uint16_t message_id)
|
||||
{
|
||||
// If message_id is zero then we should assign one, otherwise
|
||||
// we'll use the one supplied by the caller
|
||||
while (message_id == 0)
|
||||
message_id = ++connection->message_id;
|
||||
|
||||
if (connection->message.length + 2 > connection->buffer_length)
|
||||
return 0;
|
||||
|
||||
connection->buffer[connection->message.length++] = message_id >> 8;
|
||||
connection->buffer[connection->message.length++] = message_id & 0xff;
|
||||
|
||||
return message_id;
|
||||
}
|
||||
|
||||
static int ICACHE_FLASH_ATTR init_message(mqtt_connection_t* connection)
|
||||
{
|
||||
connection->message.length = MQTT_MAX_FIXED_HEADER_SIZE;
|
||||
return MQTT_MAX_FIXED_HEADER_SIZE;
|
||||
}
|
||||
|
||||
static mqtt_message_t* ICACHE_FLASH_ATTR fail_message(mqtt_connection_t* connection)
|
||||
{
|
||||
connection->message.data = connection->buffer;
|
||||
connection->message.length = 0;
|
||||
return &connection->message;
|
||||
}
|
||||
|
||||
static mqtt_message_t* ICACHE_FLASH_ATTR fini_message(mqtt_connection_t* connection, int type, int dup, int qos, int retain)
|
||||
{
|
||||
int remaining_length = connection->message.length - MQTT_MAX_FIXED_HEADER_SIZE;
|
||||
|
||||
if (remaining_length > 127)
|
||||
{
|
||||
connection->buffer[0] = ((type & 0x0f) << 4) | ((dup & 1) << 3) | ((qos & 3) << 1) | (retain & 1);
|
||||
connection->buffer[1] = 0x80 | (remaining_length % 128);
|
||||
connection->buffer[2] = remaining_length / 128;
|
||||
connection->message.length = remaining_length + 3;
|
||||
connection->message.data = connection->buffer;
|
||||
}
|
||||
else
|
||||
{
|
||||
connection->buffer[1] = ((type & 0x0f) << 4) | ((dup & 1) << 3) | ((qos & 3) << 1) | (retain & 1);
|
||||
connection->buffer[2] = remaining_length;
|
||||
connection->message.length = remaining_length + 2;
|
||||
connection->message.data = connection->buffer + 1;
|
||||
}
|
||||
|
||||
return &connection->message;
|
||||
}
|
||||
|
||||
void ICACHE_FLASH_ATTR mqtt_msg_init(mqtt_connection_t* connection, uint8_t* buffer, uint16_t buffer_length)
|
||||
{
|
||||
memset(connection, 0, sizeof(mqtt_connection_t));
|
||||
connection->buffer = buffer;
|
||||
connection->buffer_length = buffer_length;
|
||||
}
|
||||
|
||||
int ICACHE_FLASH_ATTR mqtt_get_total_length(uint8_t* buffer, uint16_t length)
|
||||
{
|
||||
int i;
|
||||
int totlen = 0;
|
||||
|
||||
for (i = 1; i < length; ++i)
|
||||
{
|
||||
totlen += (buffer[i] & 0x7f) << (7 * (i - 1));
|
||||
if ((buffer[i] & 0x80) == 0)
|
||||
{
|
||||
++i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
totlen += i;
|
||||
|
||||
return totlen;
|
||||
}
|
||||
|
||||
const char* ICACHE_FLASH_ATTR mqtt_get_publish_topic(uint8_t* buffer, uint16_t* length)
|
||||
{
|
||||
int i;
|
||||
int totlen = 0;
|
||||
int topiclen;
|
||||
|
||||
for (i = 1; i < *length; ++i)
|
||||
{
|
||||
totlen += (buffer[i] & 0x7f) << (7 * (i - 1));
|
||||
if ((buffer[i] & 0x80) == 0)
|
||||
{
|
||||
++i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
totlen += i;
|
||||
|
||||
if (i + 2 >= *length)
|
||||
return NULL;
|
||||
topiclen = buffer[i++] << 8;
|
||||
topiclen |= buffer[i++];
|
||||
|
||||
if (i + topiclen > *length)
|
||||
return NULL;
|
||||
|
||||
*length = topiclen;
|
||||
return (const char*)(buffer + i);
|
||||
}
|
||||
|
||||
const char* ICACHE_FLASH_ATTR mqtt_get_publish_data(uint8_t* buffer, uint16_t* length)
|
||||
{
|
||||
int i;
|
||||
int totlen = 0;
|
||||
int topiclen;
|
||||
int blength = *length;
|
||||
*length = 0;
|
||||
|
||||
for (i = 1; i < blength; ++i)
|
||||
{
|
||||
totlen += (buffer[i] & 0x7f) << (7 * (i - 1));
|
||||
if ((buffer[i] & 0x80) == 0)
|
||||
{
|
||||
++i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
totlen += i;
|
||||
|
||||
if (i + 2 >= blength)
|
||||
return NULL;
|
||||
topiclen = buffer[i++] << 8;
|
||||
topiclen |= buffer[i++];
|
||||
|
||||
if (i + topiclen >= blength)
|
||||
return NULL;
|
||||
|
||||
i += topiclen;
|
||||
|
||||
if (mqtt_get_qos(buffer) > 0)
|
||||
{
|
||||
if (i + 2 >= blength)
|
||||
return NULL;
|
||||
i += 2;
|
||||
}
|
||||
|
||||
if (totlen < i)
|
||||
return NULL;
|
||||
|
||||
if (totlen <= blength)
|
||||
*length = totlen - i;
|
||||
else
|
||||
*length = blength - i;
|
||||
return (const char*)(buffer + i);
|
||||
}
|
||||
|
||||
uint16_t ICACHE_FLASH_ATTR mqtt_get_id(uint8_t* buffer, uint16_t length)
|
||||
{
|
||||
if (length < 1)
|
||||
return 0;
|
||||
|
||||
switch (mqtt_get_type(buffer))
|
||||
{
|
||||
case MQTT_MSG_TYPE_PUBLISH:
|
||||
{
|
||||
int i;
|
||||
int topiclen;
|
||||
|
||||
for (i = 1; i < length; ++i)
|
||||
{
|
||||
if ((buffer[i] & 0x80) == 0)
|
||||
{
|
||||
++i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i + 2 >= length)
|
||||
return 0;
|
||||
topiclen = buffer[i++] << 8;
|
||||
topiclen |= buffer[i++];
|
||||
|
||||
if (i + topiclen >= length)
|
||||
return 0;
|
||||
i += topiclen;
|
||||
|
||||
if (mqtt_get_qos(buffer) > 0)
|
||||
{
|
||||
if (i + 2 >= length)
|
||||
return 0;
|
||||
//i += 2;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return (buffer[i] << 8) | buffer[i + 1];
|
||||
}
|
||||
case MQTT_MSG_TYPE_PUBACK:
|
||||
case MQTT_MSG_TYPE_PUBREC:
|
||||
case MQTT_MSG_TYPE_PUBREL:
|
||||
case MQTT_MSG_TYPE_PUBCOMP:
|
||||
case MQTT_MSG_TYPE_SUBACK:
|
||||
case MQTT_MSG_TYPE_UNSUBACK:
|
||||
case MQTT_MSG_TYPE_SUBSCRIBE:
|
||||
{
|
||||
// This requires the remaining length to be encoded in 1 byte,
|
||||
// which it should be.
|
||||
if (length >= 4 && (buffer[1] & 0x80) == 0)
|
||||
return (buffer[2] << 8) | buffer[3];
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_connect(mqtt_connection_t* connection, mqtt_connect_info_t* info)
|
||||
{
|
||||
struct mqtt_connect_variable_header* variable_header;
|
||||
|
||||
init_message(connection);
|
||||
|
||||
if (connection->message.length + sizeof(*variable_header) > connection->buffer_length)
|
||||
return fail_message(connection);
|
||||
variable_header = (void*)(connection->buffer + connection->message.length);
|
||||
connection->message.length += sizeof(*variable_header);
|
||||
|
||||
variable_header->lengthMsb = 0;
|
||||
#if defined(PROTOCOL_NAMEv31)
|
||||
variable_header->lengthLsb = 6;
|
||||
memcpy(variable_header->magic, "MQIsdp", 6);
|
||||
variable_header->version = 3;
|
||||
#elif defined(PROTOCOL_NAMEv311)
|
||||
variable_header->lengthLsb = 4;
|
||||
memcpy(variable_header->magic, "MQTT", 4);
|
||||
variable_header->version = 4;
|
||||
#else
|
||||
#error "Please define protocol name"
|
||||
#endif
|
||||
|
||||
variable_header->flags = 0;
|
||||
variable_header->keepaliveMsb = info->keepalive >> 8;
|
||||
variable_header->keepaliveLsb = info->keepalive & 0xff;
|
||||
|
||||
if (info->clean_session)
|
||||
variable_header->flags |= MQTT_CONNECT_FLAG_CLEAN_SESSION;
|
||||
|
||||
if (info->client_id == NULL)
|
||||
{
|
||||
/* Never allowed */
|
||||
return fail_message(connection);
|
||||
}
|
||||
else if (info->client_id[0] == '\0')
|
||||
{
|
||||
#ifdef PROTOCOL_NAMEv311
|
||||
/* Allowed. Format 0 Length ID */
|
||||
append_string(connection, info->client_id, 2) ;
|
||||
#else
|
||||
/* 0 Length not allowed */
|
||||
return fail_message(connection);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
/* No 0 data and at least 1 long. Good to go. */
|
||||
if(append_string(connection, info->client_id, strlen(info->client_id)) < 0)
|
||||
return fail_message(connection);
|
||||
}
|
||||
|
||||
if (info->will_topic != NULL && info->will_topic[0] != '\0')
|
||||
{
|
||||
if (append_string(connection, info->will_topic, strlen(info->will_topic)) < 0)
|
||||
return fail_message(connection);
|
||||
|
||||
if (append_string(connection, info->will_message, strlen(info->will_message)) < 0)
|
||||
return fail_message(connection);
|
||||
|
||||
variable_header->flags |= MQTT_CONNECT_FLAG_WILL;
|
||||
if (info->will_retain)
|
||||
variable_header->flags |= MQTT_CONNECT_FLAG_WILL_RETAIN;
|
||||
variable_header->flags |= (info->will_qos & 3) << 3;
|
||||
}
|
||||
|
||||
if (info->username != NULL && info->username[0] != '\0')
|
||||
{
|
||||
if (append_string(connection, info->username, strlen(info->username)) < 0)
|
||||
return fail_message(connection);
|
||||
|
||||
variable_header->flags |= MQTT_CONNECT_FLAG_USERNAME;
|
||||
}
|
||||
|
||||
if (info->password != NULL && info->password[0] != '\0')
|
||||
{
|
||||
if (append_string(connection, info->password, strlen(info->password)) < 0)
|
||||
return fail_message(connection);
|
||||
|
||||
variable_header->flags |= MQTT_CONNECT_FLAG_PASSWORD;
|
||||
}
|
||||
|
||||
return fini_message(connection, MQTT_MSG_TYPE_CONNECT, 0, 0, 0);
|
||||
}
|
||||
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_publish(mqtt_connection_t* connection, const char* topic, const char* data, int data_length, int qos, int retain, uint16_t* message_id)
|
||||
{
|
||||
init_message(connection);
|
||||
|
||||
if (topic == NULL || topic[0] == '\0')
|
||||
return fail_message(connection);
|
||||
|
||||
if (append_string(connection, topic, strlen(topic)) < 0)
|
||||
return fail_message(connection);
|
||||
|
||||
if (qos > 0)
|
||||
{
|
||||
if ((*message_id = append_message_id(connection, 0)) == 0)
|
||||
return fail_message(connection);
|
||||
}
|
||||
else
|
||||
*message_id = 0;
|
||||
|
||||
if (connection->message.length + data_length > connection->buffer_length)
|
||||
return fail_message(connection);
|
||||
memcpy(connection->buffer + connection->message.length, data, data_length);
|
||||
connection->message.length += data_length;
|
||||
|
||||
return fini_message(connection, MQTT_MSG_TYPE_PUBLISH, 0, qos, retain);
|
||||
}
|
||||
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_puback(mqtt_connection_t* connection, uint16_t message_id)
|
||||
{
|
||||
init_message(connection);
|
||||
if (append_message_id(connection, message_id) == 0)
|
||||
return fail_message(connection);
|
||||
return fini_message(connection, MQTT_MSG_TYPE_PUBACK, 0, 0, 0);
|
||||
}
|
||||
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_pubrec(mqtt_connection_t* connection, uint16_t message_id)
|
||||
{
|
||||
init_message(connection);
|
||||
if (append_message_id(connection, message_id) == 0)
|
||||
return fail_message(connection);
|
||||
return fini_message(connection, MQTT_MSG_TYPE_PUBREC, 0, 0, 0);
|
||||
}
|
||||
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_pubrel(mqtt_connection_t* connection, uint16_t message_id)
|
||||
{
|
||||
init_message(connection);
|
||||
if (append_message_id(connection, message_id) == 0)
|
||||
return fail_message(connection);
|
||||
return fini_message(connection, MQTT_MSG_TYPE_PUBREL, 0, 1, 0);
|
||||
}
|
||||
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_pubcomp(mqtt_connection_t* connection, uint16_t message_id)
|
||||
{
|
||||
init_message(connection);
|
||||
if (append_message_id(connection, message_id) == 0)
|
||||
return fail_message(connection);
|
||||
return fini_message(connection, MQTT_MSG_TYPE_PUBCOMP, 0, 0, 0);
|
||||
}
|
||||
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_subscribe(mqtt_connection_t* connection, const char* topic, int qos, uint16_t* message_id)
|
||||
{
|
||||
init_message(connection);
|
||||
|
||||
if (topic == NULL || topic[0] == '\0')
|
||||
return fail_message(connection);
|
||||
|
||||
if ((*message_id = append_message_id(connection, 0)) == 0)
|
||||
return fail_message(connection);
|
||||
|
||||
if (append_string(connection, topic, strlen(topic)) < 0)
|
||||
return fail_message(connection);
|
||||
|
||||
if (connection->message.length + 1 > connection->buffer_length)
|
||||
return fail_message(connection);
|
||||
connection->buffer[connection->message.length++] = qos;
|
||||
|
||||
return fini_message(connection, MQTT_MSG_TYPE_SUBSCRIBE, 0, 1, 0);
|
||||
}
|
||||
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_unsubscribe(mqtt_connection_t* connection, const char* topic, uint16_t* message_id)
|
||||
{
|
||||
init_message(connection);
|
||||
|
||||
if (topic == NULL || topic[0] == '\0')
|
||||
return fail_message(connection);
|
||||
|
||||
if ((*message_id = append_message_id(connection, 0)) == 0)
|
||||
return fail_message(connection);
|
||||
|
||||
if (append_string(connection, topic, strlen(topic)) < 0)
|
||||
return fail_message(connection);
|
||||
|
||||
return fini_message(connection, MQTT_MSG_TYPE_UNSUBSCRIBE, 0, 1, 0);
|
||||
}
|
||||
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_pingreq(mqtt_connection_t* connection)
|
||||
{
|
||||
init_message(connection);
|
||||
return fini_message(connection, MQTT_MSG_TYPE_PINGREQ, 0, 0, 0);
|
||||
}
|
||||
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_pingresp(mqtt_connection_t* connection)
|
||||
{
|
||||
init_message(connection);
|
||||
return fini_message(connection, MQTT_MSG_TYPE_PINGRESP, 0, 0, 0);
|
||||
}
|
||||
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_disconnect(mqtt_connection_t* connection)
|
||||
{
|
||||
init_message(connection);
|
||||
return fini_message(connection, MQTT_MSG_TYPE_DISCONNECT, 0, 0, 0);
|
||||
}
|
|
@ -0,0 +1,141 @@
|
|||
/*
|
||||
* File: mqtt_msg.h
|
||||
* Author: Minh Tuan
|
||||
*
|
||||
* Created on July 12, 2014, 1:05 PM
|
||||
*/
|
||||
|
||||
#ifndef MQTT_MSG_H
|
||||
#define MQTT_MSG_H
|
||||
#include "user_config.h"
|
||||
#include "c_types.h"
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Copyright (c) 2014, Stephen Robinson
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
/* 7 6 5 4 3 2 1 0*/
|
||||
/*| --- Message Type---- | DUP Flag | QoS Level | Retain |
|
||||
/* Remaining Length */
|
||||
|
||||
|
||||
enum mqtt_message_type
|
||||
{
|
||||
MQTT_MSG_TYPE_CONNECT = 1,
|
||||
MQTT_MSG_TYPE_CONNACK = 2,
|
||||
MQTT_MSG_TYPE_PUBLISH = 3,
|
||||
MQTT_MSG_TYPE_PUBACK = 4,
|
||||
MQTT_MSG_TYPE_PUBREC = 5,
|
||||
MQTT_MSG_TYPE_PUBREL = 6,
|
||||
MQTT_MSG_TYPE_PUBCOMP = 7,
|
||||
MQTT_MSG_TYPE_SUBSCRIBE = 8,
|
||||
MQTT_MSG_TYPE_SUBACK = 9,
|
||||
MQTT_MSG_TYPE_UNSUBSCRIBE = 10,
|
||||
MQTT_MSG_TYPE_UNSUBACK = 11,
|
||||
MQTT_MSG_TYPE_PINGREQ = 12,
|
||||
MQTT_MSG_TYPE_PINGRESP = 13,
|
||||
MQTT_MSG_TYPE_DISCONNECT = 14
|
||||
};
|
||||
|
||||
enum mqtt_connect_return_code
|
||||
{
|
||||
CONNECTION_ACCEPTED = 0,
|
||||
CONNECTION_REFUSE_PROTOCOL,
|
||||
CONNECTION_REFUSE_ID_REJECTED,
|
||||
CONNECTION_REFUSE_SERVER_UNAVAILABLE,
|
||||
CONNECTION_REFUSE_BAD_USERNAME,
|
||||
CONNECTION_REFUSE_NOT_AUTHORIZED
|
||||
};
|
||||
|
||||
typedef struct mqtt_message
|
||||
{
|
||||
uint8_t* data;
|
||||
uint16_t length;
|
||||
|
||||
} mqtt_message_t;
|
||||
|
||||
typedef struct mqtt_connection
|
||||
{
|
||||
mqtt_message_t message;
|
||||
|
||||
uint16_t message_id;
|
||||
uint8_t* buffer;
|
||||
uint16_t buffer_length;
|
||||
|
||||
} mqtt_connection_t;
|
||||
|
||||
typedef struct mqtt_connect_info
|
||||
{
|
||||
char* client_id;
|
||||
char* username;
|
||||
char* password;
|
||||
char* will_topic;
|
||||
char* will_message;
|
||||
uint32_t keepalive;
|
||||
int will_qos;
|
||||
int will_retain;
|
||||
int clean_session;
|
||||
|
||||
} mqtt_connect_info_t;
|
||||
|
||||
|
||||
static inline int ICACHE_FLASH_ATTR mqtt_get_type(uint8_t* buffer) { return (buffer[0] & 0xf0) >> 4; }
|
||||
static inline int ICACHE_FLASH_ATTR mqtt_get_connect_return_code(uint8_t* buffer) { return buffer[3]; }
|
||||
static inline int ICACHE_FLASH_ATTR mqtt_get_dup(uint8_t* buffer) { return (buffer[0] & 0x08) >> 3; }
|
||||
static inline int ICACHE_FLASH_ATTR mqtt_get_qos(uint8_t* buffer) { return (buffer[0] & 0x06) >> 1; }
|
||||
static inline int ICACHE_FLASH_ATTR mqtt_get_retain(uint8_t* buffer) { return (buffer[0] & 0x01); }
|
||||
|
||||
void ICACHE_FLASH_ATTR mqtt_msg_init(mqtt_connection_t* connection, uint8_t* buffer, uint16_t buffer_length);
|
||||
int ICACHE_FLASH_ATTR mqtt_get_total_length(uint8_t* buffer, uint16_t length);
|
||||
const char* ICACHE_FLASH_ATTR mqtt_get_publish_topic(uint8_t* buffer, uint16_t* length);
|
||||
const char* ICACHE_FLASH_ATTR mqtt_get_publish_data(uint8_t* buffer, uint16_t* length);
|
||||
uint16_t ICACHE_FLASH_ATTR mqtt_get_id(uint8_t* buffer, uint16_t length);
|
||||
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_connect(mqtt_connection_t* connection, mqtt_connect_info_t* info);
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_publish(mqtt_connection_t* connection, const char* topic, const char* data, int data_length, int qos, int retain, uint16_t* message_id);
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_puback(mqtt_connection_t* connection, uint16_t message_id);
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_pubrec(mqtt_connection_t* connection, uint16_t message_id);
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_pubrel(mqtt_connection_t* connection, uint16_t message_id);
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_pubcomp(mqtt_connection_t* connection, uint16_t message_id);
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_subscribe(mqtt_connection_t* connection, const char* topic, int qos, uint16_t* message_id);
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_unsubscribe(mqtt_connection_t* connection, const char* topic, uint16_t* message_id);
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_pingreq(mqtt_connection_t* connection);
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_pingresp(mqtt_connection_t* connection);
|
||||
mqtt_message_t* ICACHE_FLASH_ATTR mqtt_msg_disconnect(mqtt_connection_t* connection);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MQTT_MSG_H */
|
||||
|
|
@ -0,0 +1,129 @@
|
|||
#include "proto.h"
|
||||
#include "ringbuf.h"
|
||||
I8 ICACHE_FLASH_ATTR PROTO_Init(PROTO_PARSER *parser, PROTO_PARSE_CALLBACK *completeCallback, U8 *buf, U16 bufSize)
|
||||
{
|
||||
parser->buf = buf;
|
||||
parser->bufSize = bufSize;
|
||||
parser->dataLen = 0;
|
||||
parser->callback = completeCallback;
|
||||
parser->isEsc = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
I8 ICACHE_FLASH_ATTR PROTO_ParseByte(PROTO_PARSER *parser, U8 value)
|
||||
{
|
||||
switch (value) {
|
||||
case 0x7D:
|
||||
parser->isEsc = 1;
|
||||
break;
|
||||
|
||||
case 0x7E:
|
||||
parser->dataLen = 0;
|
||||
parser->isEsc = 0;
|
||||
parser->isBegin = 1;
|
||||
break;
|
||||
|
||||
case 0x7F:
|
||||
if (parser->callback != NULL)
|
||||
parser->callback();
|
||||
parser->isBegin = 0;
|
||||
return 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (parser->isBegin == 0) break;
|
||||
|
||||
if (parser->isEsc) {
|
||||
value ^= 0x20;
|
||||
parser->isEsc = 0;
|
||||
}
|
||||
|
||||
if (parser->dataLen < parser->bufSize)
|
||||
parser->buf[parser->dataLen++] = value;
|
||||
|
||||
break;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
I8 ICACHE_FLASH_ATTR PROTO_Parse(PROTO_PARSER *parser, U8 *buf, U16 len)
|
||||
{
|
||||
while (len--)
|
||||
PROTO_ParseByte(parser, *buf++);
|
||||
|
||||
return 0;
|
||||
}
|
||||
I16 ICACHE_FLASH_ATTR PROTO_ParseRb(RINGBUF* rb, U8 *bufOut, U16* len, U16 maxBufLen)
|
||||
{
|
||||
U8 c;
|
||||
|
||||
PROTO_PARSER proto;
|
||||
PROTO_Init(&proto, NULL, bufOut, maxBufLen);
|
||||
while (RINGBUF_Get(rb, &c) == 0) {
|
||||
if (PROTO_ParseByte(&proto, c) == 0) {
|
||||
*len = proto.dataLen;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
I16 ICACHE_FLASH_ATTR PROTO_Add(U8 *buf, const U8 *packet, I16 bufSize)
|
||||
{
|
||||
U16 i = 2;
|
||||
U16 len = *(U16*) packet;
|
||||
|
||||
if (bufSize < 1) return -1;
|
||||
|
||||
*buf++ = 0x7E;
|
||||
bufSize--;
|
||||
|
||||
while (len--) {
|
||||
switch (*packet) {
|
||||
case 0x7D:
|
||||
case 0x7E:
|
||||
case 0x7F:
|
||||
if (bufSize < 2) return -1;
|
||||
*buf++ = 0x7D;
|
||||
*buf++ = *packet++ ^ 0x20;
|
||||
i += 2;
|
||||
bufSize -= 2;
|
||||
break;
|
||||
default:
|
||||
if (bufSize < 1) return -1;
|
||||
*buf++ = *packet++;
|
||||
i++;
|
||||
bufSize--;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (bufSize < 1) return -1;
|
||||
*buf++ = 0x7F;
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
I16 ICACHE_FLASH_ATTR PROTO_AddRb(RINGBUF *rb, const U8 *packet, I16 len)
|
||||
{
|
||||
U16 i = 2;
|
||||
if (RINGBUF_Put(rb, 0x7E) == -1) return -1;
|
||||
while (len--) {
|
||||
switch (*packet) {
|
||||
case 0x7D:
|
||||
case 0x7E:
|
||||
case 0x7F:
|
||||
if (RINGBUF_Put(rb, 0x7D) == -1) return -1;
|
||||
if (RINGBUF_Put(rb, *packet++ ^ 0x20) == -1) return -1;
|
||||
i += 2;
|
||||
break;
|
||||
default:
|
||||
if (RINGBUF_Put(rb, *packet++) == -1) return -1;
|
||||
i++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (RINGBUF_Put(rb, 0x7F) == -1) return -1;
|
||||
|
||||
return i;
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* File: proto.h
|
||||
* Author: ThuHien
|
||||
*
|
||||
* Created on November 23, 2012, 8:57 AM
|
||||
*/
|
||||
|
||||
#ifndef _PROTO_H_
|
||||
#define _PROTO_H_
|
||||
#include <stdlib.h>
|
||||
#include "typedef.h"
|
||||
#include "ringbuf.h"
|
||||
|
||||
typedef void(PROTO_PARSE_CALLBACK)();
|
||||
|
||||
typedef struct {
|
||||
U8 *buf;
|
||||
U16 bufSize;
|
||||
U16 dataLen;
|
||||
U8 isEsc;
|
||||
U8 isBegin;
|
||||
PROTO_PARSE_CALLBACK* callback;
|
||||
} PROTO_PARSER;
|
||||
|
||||
I8 ICACHE_FLASH_ATTR PROTO_Init(PROTO_PARSER *parser, PROTO_PARSE_CALLBACK *completeCallback, U8 *buf, U16 bufSize);
|
||||
I8 ICACHE_FLASH_ATTR PROTO_Parse(PROTO_PARSER *parser, U8 *buf, U16 len);
|
||||
I16 ICACHE_FLASH_ATTR PROTO_Add(U8 *buf, const U8 *packet, I16 bufSize);
|
||||
I16 ICACHE_FLASH_ATTR PROTO_AddRb(RINGBUF *rb, const U8 *packet, I16 len);
|
||||
I8 ICACHE_FLASH_ATTR PROTO_ParseByte(PROTO_PARSER *parser, U8 value);
|
||||
I16 ICACHE_FLASH_ATTR PROTO_ParseRb(RINGBUF *rb, U8 *bufOut, U16* len, U16 maxBufLen);
|
||||
#endif
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
/* str_queue.c
|
||||
*
|
||||
* Copyright (c) 2014-2015, Tuan PM <tuanpm at live dot com>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of Redis nor the names of its contributors may be used
|
||||
* to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include "queue.h"
|
||||
|
||||
#include "user_interface.h"
|
||||
#include "osapi.h"
|
||||
#include "os_type.h"
|
||||
#include "mem.h"
|
||||
#include "proto.h"
|
||||
|
||||
uint8_t *last_rb_p_r;
|
||||
uint8_t *last_rb_p_w;
|
||||
uint32_t last_fill_cnt;
|
||||
|
||||
void ICACHE_FLASH_ATTR QUEUE_Init(QUEUE *queue, int bufferSize)
|
||||
{
|
||||
queue->buf = (uint8_t*)os_zalloc(bufferSize);
|
||||
RINGBUF_Init(&queue->rb, queue->buf, bufferSize);
|
||||
}
|
||||
int32_t ICACHE_FLASH_ATTR QUEUE_Puts(QUEUE *queue, uint8_t* buffer, uint16_t len)
|
||||
{
|
||||
uint32_t ret;
|
||||
|
||||
last_rb_p_r = queue->rb.p_r;
|
||||
last_rb_p_w = queue->rb.p_w;
|
||||
last_fill_cnt = queue->rb.fill_cnt;
|
||||
|
||||
ret = PROTO_AddRb(&queue->rb, buffer, len);
|
||||
if (ret == -1) {
|
||||
// rolling ring buffer back
|
||||
queue->rb.p_r = last_rb_p_r;
|
||||
queue->rb.p_w = last_rb_p_w;
|
||||
queue->rb.fill_cnt = last_fill_cnt;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
int32_t ICACHE_FLASH_ATTR QUEUE_Gets(QUEUE *queue, uint8_t* buffer, uint16_t* len, uint16_t maxLen)
|
||||
{
|
||||
|
||||
return PROTO_ParseRb(&queue->rb, buffer, len, maxLen);
|
||||
}
|
||||
|
||||
BOOL ICACHE_FLASH_ATTR QUEUE_IsEmpty(QUEUE *queue)
|
||||
{
|
||||
if (queue->rb.fill_cnt <= 0)
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
/* str_queue.h --
|
||||
*
|
||||
* Copyright (c) 2014-2015, Tuan PM <tuanpm at live dot com>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of Redis nor the names of its contributors may be used
|
||||
* to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef USER_QUEUE_H_
|
||||
#define USER_QUEUE_H_
|
||||
#include "os_type.h"
|
||||
#include "ringbuf.h"
|
||||
typedef struct {
|
||||
uint8_t *buf;
|
||||
RINGBUF rb;
|
||||
} QUEUE;
|
||||
|
||||
void ICACHE_FLASH_ATTR QUEUE_Init(QUEUE *queue, int bufferSize);
|
||||
int32_t ICACHE_FLASH_ATTR QUEUE_Puts(QUEUE *queue, uint8_t* buffer, uint16_t len);
|
||||
int32_t ICACHE_FLASH_ATTR QUEUE_Gets(QUEUE *queue, uint8_t* buffer, uint16_t* len, uint16_t maxLen);
|
||||
bool ICACHE_FLASH_ATTR QUEUE_IsEmpty(QUEUE *queue);
|
||||
#endif /* USER_QUEUE_H_ */
|
|
@ -0,0 +1,67 @@
|
|||
/**
|
||||
* \file
|
||||
* Ring Buffer library
|
||||
*/
|
||||
|
||||
#include "ringbuf.h"
|
||||
|
||||
|
||||
/**
|
||||
* \brief init a RINGBUF object
|
||||
* \param r pointer to a RINGBUF object
|
||||
* \param buf pointer to a byte array
|
||||
* \param size size of buf
|
||||
* \return 0 if successfull, otherwise failed
|
||||
*/
|
||||
I16 ICACHE_FLASH_ATTR RINGBUF_Init(RINGBUF *r, U8* buf, I32 size)
|
||||
{
|
||||
if (r == NULL || buf == NULL || size < 2) return -1;
|
||||
|
||||
r->p_o = r->p_r = r->p_w = buf;
|
||||
r->fill_cnt = 0;
|
||||
r->size = size;
|
||||
|
||||
return 0;
|
||||
}
|
||||
/**
|
||||
* \brief put a character into ring buffer
|
||||
* \param r pointer to a ringbuf object
|
||||
* \param c character to be put
|
||||
* \return 0 if successfull, otherwise failed
|
||||
*/
|
||||
I16 ICACHE_FLASH_ATTR RINGBUF_Put(RINGBUF *r, U8 c)
|
||||
{
|
||||
if (r->fill_cnt >= r->size)return -1; // ring buffer is full, this should be atomic operation
|
||||
|
||||
|
||||
r->fill_cnt++; // increase filled slots count, this should be atomic operation
|
||||
|
||||
|
||||
*r->p_w++ = c; // put character into buffer
|
||||
|
||||
if (r->p_w >= r->p_o + r->size) // rollback if write pointer go pass
|
||||
r->p_w = r->p_o; // the physical boundary
|
||||
|
||||
return 0;
|
||||
}
|
||||
/**
|
||||
* \brief get a character from ring buffer
|
||||
* \param r pointer to a ringbuf object
|
||||
* \param c read character
|
||||
* \return 0 if successfull, otherwise failed
|
||||
*/
|
||||
I16 ICACHE_FLASH_ATTR RINGBUF_Get(RINGBUF *r, U8* c)
|
||||
{
|
||||
if (r->fill_cnt <= 0)return -1; // ring buffer is empty, this should be atomic operation
|
||||
|
||||
|
||||
r->fill_cnt--; // decrease filled slots count
|
||||
|
||||
|
||||
*c = *r->p_r++; // get the character out
|
||||
|
||||
if (r->p_r >= r->p_o + r->size) // rollback if write pointer go pass
|
||||
r->p_r = r->p_o; // the physical boundary
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
#ifndef _RING_BUF_H_
|
||||
#define _RING_BUF_H_
|
||||
|
||||
#include <os_type.h>
|
||||
#include <stdlib.h>
|
||||
#include "typedef.h"
|
||||
|
||||
typedef struct {
|
||||
U8* p_o; /**< Original pointer */
|
||||
U8* volatile p_r; /**< Read pointer */
|
||||
U8* volatile p_w; /**< Write pointer */
|
||||
volatile I32 fill_cnt; /**< Number of filled slots */
|
||||
I32 size; /**< Buffer size */
|
||||
} RINGBUF;
|
||||
|
||||
I16 ICACHE_FLASH_ATTR RINGBUF_Init(RINGBUF *r, U8* buf, I32 size);
|
||||
I16 ICACHE_FLASH_ATTR RINGBUF_Put(RINGBUF *r, U8 c);
|
||||
I16 ICACHE_FLASH_ATTR RINGBUF_Get(RINGBUF *r, U8* c);
|
||||
#endif
|
|
@ -0,0 +1,17 @@
|
|||
/**
|
||||
* \file
|
||||
* Standard Types definition
|
||||
*/
|
||||
|
||||
#ifndef _TYPE_DEF_H_
|
||||
#define _TYPE_DEF_H_
|
||||
|
||||
typedef char I8;
|
||||
typedef unsigned char U8;
|
||||
typedef short I16;
|
||||
typedef unsigned short U16;
|
||||
typedef long I32;
|
||||
typedef unsigned long U32;
|
||||
typedef unsigned long long U64;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,149 @@
|
|||
/*
|
||||
* Copyright (c) 2014, Tuan PM
|
||||
* Email: tuanpm@live.com
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <math.h>
|
||||
#include <stddef.h>
|
||||
#include "utils.h"
|
||||
|
||||
|
||||
uint8_t ICACHE_FLASH_ATTR UTILS_IsIPV4 (int8_t *str)
|
||||
{
|
||||
uint8_t segs = 0; /* Segment count. */
|
||||
uint8_t chcnt = 0; /* Character count within segment. */
|
||||
uint8_t accum = 0; /* Accumulator for segment. */
|
||||
/* Catch NULL pointer. */
|
||||
if (str == 0)
|
||||
return 0;
|
||||
/* Process every character in string. */
|
||||
|
||||
while (*str != '\0') {
|
||||
/* Segment changeover. */
|
||||
|
||||
if (*str == '.') {
|
||||
/* Must have some digits in segment. */
|
||||
if (chcnt == 0)
|
||||
return 0;
|
||||
/* Limit number of segments. */
|
||||
if (++segs == 4)
|
||||
return 0;
|
||||
/* Reset segment values and restart loop. */
|
||||
chcnt = accum = 0;
|
||||
str++;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Check numeric. */
|
||||
if ((*str < '0') || (*str > '9'))
|
||||
return 0;
|
||||
|
||||
/* Accumulate and check segment. */
|
||||
|
||||
if ((accum = accum * 10 + *str - '0') > 255)
|
||||
return 0;
|
||||
/* Advance other segment specific stuff and continue loop. */
|
||||
|
||||
chcnt++;
|
||||
str++;
|
||||
}
|
||||
|
||||
/* Check enough segments and enough characters in last segment. */
|
||||
|
||||
if (segs != 3)
|
||||
return 0;
|
||||
if (chcnt == 0)
|
||||
return 0;
|
||||
/* Address okay. */
|
||||
|
||||
return 1;
|
||||
}
|
||||
uint8_t ICACHE_FLASH_ATTR UTILS_StrToIP(const int8_t* str, void *ip)
|
||||
{
|
||||
|
||||
/* The count of the number of bytes processed. */
|
||||
int i;
|
||||
/* A pointer to the next digit to process. */
|
||||
const char * start;
|
||||
|
||||
start = str;
|
||||
for (i = 0; i < 4; i++) {
|
||||
/* The digit being processed. */
|
||||
char c;
|
||||
/* The value of this byte. */
|
||||
int n = 0;
|
||||
while (1) {
|
||||
c = * start;
|
||||
start++;
|
||||
if (c >= '0' && c <= '9') {
|
||||
n *= 10;
|
||||
n += c - '0';
|
||||
}
|
||||
/* We insist on stopping at "." if we are still parsing
|
||||
the first, second, or third numbers. If we have reached
|
||||
the end of the numbers, we will allow any character. */
|
||||
else if ((i < 3 && c == '.') || i == 3) {
|
||||
break;
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (n >= 256) {
|
||||
return 0;
|
||||
}
|
||||
((uint8_t*)ip)[i] = n;
|
||||
}
|
||||
return 1;
|
||||
|
||||
}
|
||||
uint32_t ICACHE_FLASH_ATTR UTILS_Atoh(const int8_t *s)
|
||||
{
|
||||
uint32_t value = 0, digit;
|
||||
int8_t c;
|
||||
|
||||
while ((c = *s++)) {
|
||||
if ('0' <= c && c <= '9')
|
||||
digit = c - '0';
|
||||
else if ('A' <= c && c <= 'F')
|
||||
digit = c - 'A' + 10;
|
||||
else if ('a' <= c && c <= 'f')
|
||||
digit = c - 'a' + 10;
|
||||
else break;
|
||||
|
||||
value = (value << 4) | digit;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
#ifndef _UTILS_H_
|
||||
#define _UTILS_H_
|
||||
|
||||
#include "c_types.h"
|
||||
|
||||
uint32_t ICACHE_FLASH_ATTR UTILS_Atoh(const int8_t *s);
|
||||
uint8_t ICACHE_FLASH_ATTR UTILS_StrToIP(const int8_t* str, void *ip);
|
||||
uint8_t ICACHE_FLASH_ATTR UTILS_IsIPV4 (int8_t *str);
|
||||
#endif
|
417
platformio.ini
417
platformio.ini
|
@ -13,209 +13,292 @@ src_dir = sonoff
|
|||
; *** Uncomment one of the lines below to build/upload only one environment
|
||||
;env_default = sonoff
|
||||
;env_default = sonoff-minimal
|
||||
;env_default = sonoff-xxl
|
||||
;env_default = sonoff-classic
|
||||
;env_default = sonoff-knx
|
||||
;env_default = sonoff-allsensors
|
||||
;env_default = sonoff-BG
|
||||
;env_default = sonoff-CN
|
||||
;env_default = sonoff-CZ
|
||||
;env_default = sonoff-DE
|
||||
;env_default = sonoff-ES
|
||||
;env_default = sonoff-FR
|
||||
;env_default = sonoff-GR
|
||||
;env_default = sonoff-HU
|
||||
;env_default = sonoff-IT
|
||||
;env_default = sonoff-NL
|
||||
;env_default = sonoff-PL
|
||||
;env_default = sonoff-PT
|
||||
;env_default = sonoff-RU
|
||||
;env_default = sonoff-CN
|
||||
;env_default = sonoff-TW
|
||||
|
||||
[env:sonoff]
|
||||
[common] ; ************************************************************
|
||||
; *** Esp8266 core for Arduino version
|
||||
;platform = espressif8266@1.5.0 ; v2.3.0
|
||||
;platform = espressif8266@1.6.0 ; v2.4.0
|
||||
;platform = espressif8266@1.7.0 ; v2.4.1
|
||||
;platform = https://github.com/platformio/platform-espressif8266.git#feature/stage
|
||||
platform = espressif8266
|
||||
|
||||
framework = arduino
|
||||
board = esp01_1m
|
||||
board_flash_mode = dout
|
||||
build_flags = -Wl,-Tesp8266.flash.1m0.ld
|
||||
lib_deps = PubSubClient, NeoPixelBus, IRremoteESP8266, ArduinoJSON
|
||||
|
||||
; *** Fix espressif8266@1.7.0 induced undesired all warnings
|
||||
build_unflags = -Wall
|
||||
|
||||
build_flags =
|
||||
-Wl,-Tesp8266.flash.1m0.ld
|
||||
-DVTABLES_IN_FLASH
|
||||
-DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY
|
||||
; -DUSE_CONFIG_OVERRIDE
|
||||
|
||||
; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes
|
||||
extra_scripts = pio/strip-floats.py
|
||||
|
||||
; *** Serial Monitor options
|
||||
monitor_baud = 115200
|
||||
|
||||
; *** Upload Serial reset method for Wemos and NodeMCU
|
||||
;upload_port = COM5
|
||||
;upload_speed = 115200
|
||||
;upload_resetmethod = nodemcu
|
||||
upload_speed = 512000
|
||||
upload_resetmethod = nodemcu
|
||||
upload_port = COM5
|
||||
|
||||
; *** Upload file to OTA server using SCP
|
||||
;upload_port = user@host:/path
|
||||
;extra_scripts = pio/sftp-uploader.py
|
||||
;extra_scripts = pio/strip-floats.py, pio/sftp-uploader.py
|
||||
|
||||
; *** Upload file to OTA server using HTTP
|
||||
;upload_port = domus1:80/api/upload-arduino.php
|
||||
;extra_scripts = pio/strip-floats.py, pio/http-uploader.py
|
||||
|
||||
; *********************************************************************
|
||||
|
||||
[env:sonoff]
|
||||
platform = ${common.platform}
|
||||
framework = ${common.framework}
|
||||
board = ${common.board}
|
||||
board_flash_mode = ${common.board_flash_mode}
|
||||
build_unflags = ${common.build_unflags}
|
||||
build_flags = ${common.build_flags}
|
||||
monitor_baud = ${common.monitor_baud}
|
||||
upload_speed = ${common.upload_speed}
|
||||
upload_resetmethod = ${common.upload_resetmethod}
|
||||
upload_port = ${common.upload_port}
|
||||
extra_scripts = ${common.extra_scripts}
|
||||
|
||||
[env:sonoff-minimal]
|
||||
;platform = espressif8266@1.5.0 ; v2.3.0
|
||||
;platform = espressif8266@1.6.0 ; v2.4.0
|
||||
platform = espressif8266
|
||||
framework = arduino
|
||||
board = esp01_1m
|
||||
board_flash_mode = dout
|
||||
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DBE_MINIMAL
|
||||
lib_deps = PubSubClient, NeoPixelBus, IRremoteESP8266, ArduinoJSON
|
||||
extra_scripts = pio/strip-floats.py
|
||||
platform = ${common.platform}
|
||||
framework = ${common.framework}
|
||||
board = ${common.board}
|
||||
board_flash_mode = ${common.board_flash_mode}
|
||||
build_unflags = ${common.build_unflags}
|
||||
build_flags = ${common.build_flags} -DBE_MINIMAL
|
||||
monitor_baud = ${common.monitor_baud}
|
||||
upload_speed = ${common.upload_speed}
|
||||
upload_port = ${common.upload_port}
|
||||
extra_scripts = ${common.extra_scripts}
|
||||
|
||||
; Serial Monitor options
|
||||
monitor_baud = 115200
|
||||
[env:sonoff-classic]
|
||||
platform = ${common.platform}
|
||||
framework = ${common.framework}
|
||||
board = ${common.board}
|
||||
board_flash_mode = ${common.board_flash_mode}
|
||||
build_unflags = ${common.build_unflags}
|
||||
build_flags = ${common.build_flags} -DUSE_CLASSIC
|
||||
monitor_baud = ${common.monitor_baud}
|
||||
upload_speed = ${common.upload_speed}
|
||||
upload_port = ${common.upload_port}
|
||||
extra_scripts = ${common.extra_scripts}
|
||||
|
||||
[env:sonoff-xxl]
|
||||
;platform = espressif8266@1.5.0 ; v2.3.0
|
||||
;platform = espressif8266@1.6.0 ; v2.4.0
|
||||
platform = espressif8266
|
||||
framework = arduino
|
||||
board = esp01_1m
|
||||
board_flash_mode = dout
|
||||
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DUSE_ALL_SENSORS
|
||||
lib_deps = PubSubClient, NeoPixelBus, IRremoteESP8266, ArduinoJSON
|
||||
extra_scripts = pio/strip-floats.py
|
||||
[env:sonoff-knx]
|
||||
platform = ${common.platform}
|
||||
framework = ${common.framework}
|
||||
board = ${common.board}
|
||||
board_flash_mode = ${common.board_flash_mode}
|
||||
build_unflags = ${common.build_unflags}
|
||||
build_flags = ${common.build_flags} -DUSE_KNX_NO_EMULATION
|
||||
monitor_baud = ${common.monitor_baud}
|
||||
upload_speed = ${common.upload_speed}
|
||||
upload_port = ${common.upload_port}
|
||||
extra_scripts = ${common.extra_scripts}
|
||||
|
||||
; Serial Monitor options
|
||||
monitor_baud = 115200
|
||||
[env:sonoff-allsensors]
|
||||
platform = ${common.platform}
|
||||
framework = ${common.framework}
|
||||
board = ${common.board}
|
||||
board_flash_mode = ${common.board_flash_mode}
|
||||
build_unflags = ${common.build_unflags}
|
||||
build_flags = ${common.build_flags} -DUSE_ALL_SENSORS
|
||||
monitor_baud = ${common.monitor_baud}
|
||||
upload_speed = ${common.upload_speed}
|
||||
upload_port = ${common.upload_port}
|
||||
extra_scripts = ${common.extra_scripts}
|
||||
|
||||
[env:sonoff-DE]
|
||||
;platform = espressif8266@1.5.0 ; v2.3.0
|
||||
;platform = espressif8266@1.6.0 ; v2.4.0
|
||||
platform = espressif8266
|
||||
framework = arduino
|
||||
board = esp01_1m
|
||||
board_flash_mode = dout
|
||||
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=de-DE
|
||||
lib_deps = PubSubClient, NeoPixelBus, IRremoteESP8266, ArduinoJSON
|
||||
extra_scripts = pio/strip-floats.py
|
||||
|
||||
; *** Serial Monitor options
|
||||
monitor_baud = 115200
|
||||
|
||||
[env:sonoff-ES]
|
||||
;platform = espressif8266@1.5.0 ; v2.3.0
|
||||
;platform = espressif8266@1.6.0 ; v2.4.0
|
||||
platform = espressif8266
|
||||
framework = arduino
|
||||
board = esp01_1m
|
||||
board_flash_mode = dout
|
||||
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=es-AR
|
||||
lib_deps = PubSubClient, NeoPixelBus, IRremoteESP8266, ArduinoJSON
|
||||
extra_scripts = pio/strip-floats.py
|
||||
|
||||
; *** Serial Monitor options
|
||||
monitor_baud = 115200
|
||||
|
||||
[env:sonoff-FR]
|
||||
;platform = espressif8266@1.5.0 ; v2.3.0
|
||||
;platform = espressif8266@1.6.0 ; v2.4.0
|
||||
platform = espressif8266
|
||||
framework = arduino
|
||||
board = esp01_1m
|
||||
board_flash_mode = dout
|
||||
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=fr-FR
|
||||
lib_deps = PubSubClient, NeoPixelBus, IRremoteESP8266, ArduinoJSON
|
||||
extra_scripts = pio/strip-floats.py
|
||||
|
||||
; *** Serial Monitor options
|
||||
monitor_baud = 115200
|
||||
|
||||
[env:sonoff-HU]
|
||||
;platform = espressif8266@1.5.0 ; v2.3.0
|
||||
;platform = espressif8266@1.6.0 ; v2.4.0
|
||||
platform = espressif8266
|
||||
framework = arduino
|
||||
board = esp01_1m
|
||||
board_flash_mode = dout
|
||||
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=hu-HU
|
||||
lib_deps = PubSubClient, NeoPixelBus, IRremoteESP8266, ArduinoJSON
|
||||
extra_scripts = pio/strip-floats.py
|
||||
|
||||
; *** Serial Monitor options
|
||||
monitor_baud = 115200
|
||||
|
||||
[env:sonoff-IT]
|
||||
;platform = espressif8266@1.5.0 ; v2.3.0
|
||||
;platform = espressif8266@1.6.0 ; v2.4.0
|
||||
platform = espressif8266
|
||||
framework = arduino
|
||||
board = esp01_1m
|
||||
board_flash_mode = dout
|
||||
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=it-IT
|
||||
lib_deps = PubSubClient, NeoPixelBus, IRremoteESP8266, ArduinoJSON
|
||||
extra_scripts = pio/strip-floats.py
|
||||
|
||||
; *** Serial Monitor options
|
||||
monitor_baud = 115200
|
||||
|
||||
[env:sonoff-NL]
|
||||
;platform = espressif8266@1.5.0 ; v2.3.0
|
||||
;platform = espressif8266@1.6.0 ; v2.4.0
|
||||
platform = espressif8266
|
||||
framework = arduino
|
||||
board = esp01_1m
|
||||
board_flash_mode = dout
|
||||
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=nl-NL
|
||||
lib_deps = PubSubClient, NeoPixelBus, IRremoteESP8266, ArduinoJSON
|
||||
extra_scripts = pio/strip-floats.py
|
||||
|
||||
; *** Serial Monitor options
|
||||
monitor_baud = 115200
|
||||
|
||||
[env:sonoff-PL]
|
||||
;platform = espressif8266@1.5.0 ; v2.3.0
|
||||
;platform = espressif8266@1.6.0 ; v2.4.0
|
||||
platform = espressif8266
|
||||
framework = arduino
|
||||
board = esp01_1m
|
||||
board_flash_mode = dout
|
||||
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=pl-PL
|
||||
lib_deps = PubSubClient, NeoPixelBus, IRremoteESP8266, ArduinoJSON
|
||||
extra_scripts = pio/strip-floats.py
|
||||
|
||||
; *** Serial Monitor options
|
||||
monitor_baud = 115200
|
||||
|
||||
[env:sonoff-PT]
|
||||
;platform = espressif8266@1.5.0 ; v2.3.0
|
||||
;platform = espressif8266@1.6.0 ; v2.4.0
|
||||
platform = espressif8266
|
||||
framework = arduino
|
||||
board = esp01_1m
|
||||
board_flash_mode = dout
|
||||
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=pt-PT
|
||||
lib_deps = PubSubClient, NeoPixelBus, IRremoteESP8266, ArduinoJSON
|
||||
extra_scripts = pio/strip-floats.py
|
||||
|
||||
; *** Serial Monitor options
|
||||
monitor_baud = 115200
|
||||
|
||||
[env:sonoff-RU]
|
||||
;platform = espressif8266@1.5.0 ; v2.3.0
|
||||
;platform = espressif8266@1.6.0 ; v2.4.0
|
||||
platform = espressif8266
|
||||
framework = arduino
|
||||
board = esp01_1m
|
||||
board_flash_mode = dout
|
||||
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=ru-RU
|
||||
lib_deps = PubSubClient, NeoPixelBus, IRremoteESP8266, ArduinoJSON
|
||||
extra_scripts = pio/strip-floats.py
|
||||
|
||||
; *** Serial Monitor options
|
||||
monitor_baud = 115200
|
||||
[env:sonoff-BG]
|
||||
platform = ${common.platform}
|
||||
framework = ${common.framework}
|
||||
board = ${common.board}
|
||||
board_flash_mode = ${common.board_flash_mode}
|
||||
build_unflags = ${common.build_unflags}
|
||||
build_flags = ${common.build_flags} -DMY_LANGUAGE=bg-BG
|
||||
monitor_baud = ${common.monitor_baud}
|
||||
upload_speed = ${common.upload_speed}
|
||||
upload_port = ${common.upload_port}
|
||||
extra_scripts = ${common.extra_scripts}
|
||||
|
||||
[env:sonoff-CN]
|
||||
;platform = espressif8266@1.5.0 ; v2.3.0
|
||||
;platform = espressif8266@1.6.0 ; v2.4.0
|
||||
platform = espressif8266
|
||||
framework = arduino
|
||||
board = esp01_1m
|
||||
board_flash_mode = dout
|
||||
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=zh-CN
|
||||
lib_deps = PubSubClient, NeoPixelBus, IRremoteESP8266, ArduinoJSON
|
||||
extra_scripts = pio/strip-floats.py
|
||||
platform = ${common.platform}
|
||||
framework = ${common.framework}
|
||||
board = ${common.board}
|
||||
board_flash_mode = ${common.board_flash_mode}
|
||||
build_unflags = ${common.build_unflags}
|
||||
build_flags = ${common.build_flags} -DMY_LANGUAGE=zh-CN
|
||||
monitor_baud = ${common.monitor_baud}
|
||||
upload_speed = ${common.upload_speed}
|
||||
upload_port = ${common.upload_port}
|
||||
extra_scripts = ${common.extra_scripts}
|
||||
|
||||
; *** Serial Monitor options
|
||||
monitor_baud = 115200
|
||||
[env:sonoff-CZ]
|
||||
platform = ${common.platform}
|
||||
framework = ${common.framework}
|
||||
board = ${common.board}
|
||||
board_flash_mode = ${common.board_flash_mode}
|
||||
build_unflags = ${common.build_unflags}
|
||||
build_flags = ${common.build_flags} -DMY_LANGUAGE=cs-CZ
|
||||
monitor_baud = ${common.monitor_baud}
|
||||
upload_speed = ${common.upload_speed}
|
||||
upload_port = ${common.upload_port}
|
||||
extra_scripts = ${common.extra_scripts}
|
||||
|
||||
[env:sonoff-DE]
|
||||
platform = ${common.platform}
|
||||
framework = ${common.framework}
|
||||
board = ${common.board}
|
||||
board_flash_mode = ${common.board_flash_mode}
|
||||
build_unflags = ${common.build_unflags}
|
||||
build_flags = ${common.build_flags} -DMY_LANGUAGE=de-DE
|
||||
monitor_baud = ${common.monitor_baud}
|
||||
upload_speed = ${common.upload_speed}
|
||||
upload_port = ${common.upload_port}
|
||||
extra_scripts = ${common.extra_scripts}
|
||||
|
||||
[env:sonoff-ES]
|
||||
platform = ${common.platform}
|
||||
framework = ${common.framework}
|
||||
board = ${common.board}
|
||||
board_flash_mode = ${common.board_flash_mode}
|
||||
build_unflags = ${common.build_unflags}
|
||||
build_flags = ${common.build_flags} -DMY_LANGUAGE=es-AR
|
||||
monitor_baud = ${common.monitor_baud}
|
||||
upload_speed = ${common.upload_speed}
|
||||
upload_port = ${common.upload_port}
|
||||
extra_scripts = ${common.extra_scripts}
|
||||
|
||||
[env:sonoff-FR]
|
||||
platform = ${common.platform}
|
||||
framework = ${common.framework}
|
||||
board = ${common.board}
|
||||
board_flash_mode = ${common.board_flash_mode}
|
||||
build_unflags = ${common.build_unflags}
|
||||
build_flags = ${common.build_flags} -DMY_LANGUAGE=fr-FR
|
||||
monitor_baud = ${common.monitor_baud}
|
||||
upload_speed = ${common.upload_speed}
|
||||
upload_port = ${common.upload_port}
|
||||
extra_scripts = ${common.extra_scripts}
|
||||
|
||||
[env:sonoff-GR]
|
||||
platform = ${common.platform}
|
||||
framework = ${common.framework}
|
||||
board = ${common.board}
|
||||
board_flash_mode = ${common.board_flash_mode}
|
||||
build_unflags = ${common.build_unflags}
|
||||
build_flags = ${common.build_flags} -DMY_LANGUAGE=el-GR
|
||||
monitor_baud = ${common.monitor_baud}
|
||||
upload_speed = ${common.upload_speed}
|
||||
upload_port = ${common.upload_port}
|
||||
extra_scripts = ${common.extra_scripts}
|
||||
|
||||
[env:sonoff-HU]
|
||||
platform = ${common.platform}
|
||||
framework = ${common.framework}
|
||||
board = ${common.board}
|
||||
board_flash_mode = ${common.board_flash_mode}
|
||||
build_unflags = ${common.build_unflags}
|
||||
build_flags = ${common.build_flags} -DMY_LANGUAGE=hu-HU
|
||||
monitor_baud = ${common.monitor_baud}
|
||||
upload_speed = ${common.upload_speed}
|
||||
upload_port = ${common.upload_port}
|
||||
extra_scripts = ${common.extra_scripts}
|
||||
|
||||
[env:sonoff-IT]
|
||||
platform = ${common.platform}
|
||||
framework = ${common.framework}
|
||||
board = ${common.board}
|
||||
board_flash_mode = ${common.board_flash_mode}
|
||||
build_unflags = ${common.build_unflags}
|
||||
build_flags = ${common.build_flags} -DMY_LANGUAGE=it-IT
|
||||
monitor_baud = ${common.monitor_baud}
|
||||
upload_speed = ${common.upload_speed}
|
||||
upload_port = ${common.upload_port}
|
||||
extra_scripts = ${common.extra_scripts}
|
||||
|
||||
[env:sonoff-NL]
|
||||
platform = ${common.platform}
|
||||
framework = ${common.framework}
|
||||
board = ${common.board}
|
||||
board_flash_mode = ${common.board_flash_mode}
|
||||
build_unflags = ${common.build_unflags}
|
||||
build_flags = ${common.build_flags} -DMY_LANGUAGE=nl-NL
|
||||
monitor_baud = ${common.monitor_baud}
|
||||
upload_speed = ${common.upload_speed}
|
||||
upload_port = ${common.upload_port}
|
||||
extra_scripts = ${common.extra_scripts}
|
||||
|
||||
[env:sonoff-PL]
|
||||
platform = ${common.platform}
|
||||
framework = ${common.framework}
|
||||
board = ${common.board}
|
||||
board_flash_mode = ${common.board_flash_mode}
|
||||
build_unflags = ${common.build_unflags}
|
||||
build_flags = ${common.build_flags} -DMY_LANGUAGE=pl-PL
|
||||
monitor_baud = ${common.monitor_baud}
|
||||
upload_speed = ${common.upload_speed}
|
||||
upload_port = ${common.upload_port}
|
||||
extra_scripts = ${common.extra_scripts}
|
||||
|
||||
[env:sonoff-PT]
|
||||
platform = ${common.platform}
|
||||
framework = ${common.framework}
|
||||
board = ${common.board}
|
||||
board_flash_mode = ${common.board_flash_mode}
|
||||
build_unflags = ${common.build_unflags}
|
||||
build_flags = ${common.build_flags} -DMY_LANGUAGE=pt-PT
|
||||
monitor_baud = ${common.monitor_baud}
|
||||
upload_speed = ${common.upload_speed}
|
||||
upload_port = ${common.upload_port}
|
||||
extra_scripts = ${common.extra_scripts}
|
||||
|
||||
[env:sonoff-RU]
|
||||
platform = ${common.platform}
|
||||
framework = ${common.framework}
|
||||
board = ${common.board}
|
||||
board_flash_mode = ${common.board_flash_mode}
|
||||
build_unflags = ${common.build_unflags}
|
||||
build_flags = ${common.build_flags} -DMY_LANGUAGE=ru-RU
|
||||
monitor_baud = ${common.monitor_baud}
|
||||
upload_speed = ${common.upload_speed}
|
||||
upload_port = ${common.upload_port}
|
||||
extra_scripts = ${common.extra_scripts}
|
||||
|
||||
[env:sonoff-TW]
|
||||
platform = ${common.platform}
|
||||
framework = ${common.framework}
|
||||
board = ${common.board}
|
||||
board_flash_mode = ${common.board_flash_mode}
|
||||
build_unflags = ${common.build_unflags}
|
||||
build_flags = ${common.build_flags} -DMY_LANGUAGE=zh-TW
|
||||
monitor_baud = ${common.monitor_baud}
|
||||
upload_speed = ${common.upload_speed}
|
||||
upload_port = ${common.upload_port}
|
||||
extra_scripts = ${common.extra_scripts}
|
||||
|
|
|
@ -1,20 +1,62 @@
|
|||
/* 5.12.0d
|
||||
* Prep for optional MQTT drivers by separating mqtt code from sonoff.ino to file xdrv_00_mqtt.ino
|
||||
* Add Portuguese language file
|
||||
* Add compiler check for stable lwIP version v1.4 (#1940)
|
||||
* Add diacritics to Polish language file (#2005)
|
||||
* Add Hungarian language file (#2024)
|
||||
* Fix MQTT TLS fingerprint validation (#2033)
|
||||
/* 5.13.1a
|
||||
* Change user_config.h otaurl to http://sonoff.maddox.co.uk/tasmota/sonoff.bin (#2588, #2602)
|
||||
* Fix compile error when ADC is enabled and Rules are disabled (#2608)
|
||||
* Fix several timer data input and output errors (#2597, #2620)
|
||||
* Fix KNX config error (#2628)
|
||||
* Add Portuguese in Brazil language file
|
||||
* Updated Italian language file (#2618)
|
||||
*
|
||||
* 5.12.0c
|
||||
* 5.13.1 20180501
|
||||
* Fix JSON buffers size too small for execution in some situations (#2580)
|
||||
* Add define MODULE for user selecting default model although it preferably should not be changed (#569, #2589)
|
||||
* Fix configuration restore (#2591)
|
||||
*
|
||||
* 5.13.0 20180430
|
||||
* Change platformio option sonoff-ds18x20 to sonoff-allsensors enabling ds18x20 and all other sensors in one image
|
||||
* Change status display of Ssid and SetOption
|
||||
* Change default option SetOption15 from 0 to 1 providing better initial PWM experience
|
||||
* Change webpage parameter communication
|
||||
* Change max number of commands in Backlog from 15 to 30 and ignore commands overflowing
|
||||
* Change TSL2561 driver to joba library and delete Adafruit library (#1644)
|
||||
* Change default parameters in user_config.h to undefined for easy installation (#1851)
|
||||
* Change max user configurable hold time from 10 to 25 seconds (#1851)
|
||||
* Change Sonoff SC JSON format (#1939)
|
||||
* Change Polish language to using Diacritics (#2005)
|
||||
* Change user_config_override usage by providing user_config_override_sample.h (#2228)
|
||||
* Change MQTT response topic for Energy changes from ENERGY to SENSOR (#2229, #2251)
|
||||
* Change default Reset configuration time from 4 seconds to 40 seconds on Button hold (#2268)
|
||||
* Change ESP8266 Analog JSON message from {"Analog0:123"} to {"ANALOG":{"A0:123"}} to accomodate rules (#2560)
|
||||
* Change Counter JSON message from {"Counter1":0,"Counter3":0} to {"COUNTER":{"C1":0,"C3":0}} to accomodate rules
|
||||
* Change ADS1115 JSON message from {"ADS1115":{"Analog0":123,"Analog1":123}} to {"ADS1115":{"A0":123,"A1":123}}
|
||||
* Fix intermittent exception when dns lookup is used while sleep is enabled
|
||||
* Fix 5.4.0 regression turning off single press after button hold during 4x hold time
|
||||
* Fix possible wifi connection problem by erasing sdk configuration parameters
|
||||
* Change Polish language to using Diacritics (#2005)
|
||||
*
|
||||
* 5.12.0b
|
||||
* Fix NTP sync to Thu Jan 01 08:00:10 1970 results in uptime 17651+ days (core2.4.1/sdk2.2.1)
|
||||
* Fix MAX31850 higher temperatures (#1269)
|
||||
* Fix freeing more code space when emulation is disabled (#1592)
|
||||
* Fix providing web page configuratin option for Friendly Name when no device (relay or light) is configured (#1850)
|
||||
* Fix compile error when define HOME_ASSISTANT_DISCOVERY_ENABLE is not set (#1937)
|
||||
* Fix MQTT TLS fingerprint validation (#2033)
|
||||
* Fix update temperature on DS18x20 drivers (#2328)
|
||||
* Fix compile error when not defined USE_TIMERS (#2400)
|
||||
* Fix configuration filename truncation when it contains spaces (#2484, #2490)
|
||||
* Fix Energy Today and Yesterday overflow (#2543)
|
||||
* Add serial debug info
|
||||
* Add Portuguese language file
|
||||
* Add Czech language file
|
||||
* Add Bulgarian language file
|
||||
* Add Domoticz dust (custom) sensors to PMS5003 and NovaFitness SDS drivers as PM1, PM2.5 and PM10
|
||||
* Add commands Publish, Rule, RuleTimer and Event. See Wiki about Rule restriction, usage and examples
|
||||
* Add sonoff-classic, sonoff-allsensors and sonoff-knx
|
||||
* Add some coloring to important web buttons
|
||||
* Add support for sensor HC-SR04 ultrasonic (#113, #1964, #2444)
|
||||
* Add define MQTT_TELE_RETAIN compile option default set to 0 (#1071)
|
||||
* Add 16 timers using commands Timer and Timers (#1091)
|
||||
* Add optional Timer configuration webpage to be enabled in user_config.h with define USE_TIMERS_WEB
|
||||
* Add Multichannel Gas sensor using MultiChannel_Gas_Sensor library (#1245)
|
||||
* Add Domoticz Battery and RSSI Quality (#1604)
|
||||
* Add command HSBColor Hue,Sat,Bri (#1642, #2203)
|
||||
* Add compile time support for WS2812 BRG and RBG led configurations to be defined in user_config.h (#1690)
|
||||
* Add optional usage of %d or %X suffices in MQTT client to append chipid (#1871)
|
||||
* Add optional usage of %d or %X suffices in MQTT topic to append chipid (#1871)
|
||||
* Add optional usage of %d or %04d in ota url to be replaced with chipid (#1871)
|
||||
|
@ -24,17 +66,46 @@
|
|||
* Add Webserver upload preflight request support (#1927)
|
||||
* Add Home Assistant clear other device (#1931)
|
||||
* Add Restart time to Status 1 (#1938)
|
||||
* Change TSL2561 driver to joba library and delete Adafruit library (#1644)
|
||||
* Change Sonoff SC JSON format (#1939)
|
||||
* Fix compile error when define HOME_ASSISTANT_DISCOVERY_ENABLE is not set (#1937)
|
||||
* Add optional TSL2561 driver using library Joba_Tsl2561 to be enabled in user_config.h with define USE_TSL2561_JOBA (#1951)
|
||||
* Add support for sensor SHTC3 (#1967)
|
||||
*
|
||||
* 5.12.0a
|
||||
* Change platformio option sonoff-ds18x20 to sonoff-xxl enabling ds18x20 and all other sensors in one image
|
||||
* Fix providing web page configuratin option for Friendly Name when no device (relay or light) is configured (#1850)
|
||||
* Change default parameters in user_config.h to undefined for easy installation (#1851)
|
||||
* Change max user configurable hold time from 10 to 25 seconds (#1851)
|
||||
* Add compiler check for stable lwIP version v1.4 (#1940)
|
||||
* Add support for multiple SHT3X sensors (#1949, #2110)
|
||||
* Add always suffix with device number in Mqtt discovery topic (#1962)
|
||||
* Add support for optional MQTT drivers to be selected in user_config.h (#1992)
|
||||
* Add optional Arduino OTA support to be enabled in user_config.h (#1998)
|
||||
* Add diacritics to Polish language file (#2005)
|
||||
* Add Hungarian language file (#2024)
|
||||
* Add support for Nova Fitness SDS011 and possibly SDS021 particle concentration sensor (#2070)
|
||||
* Add single decimal precision to Nova Fitness SDS0x1 sensor values (#2093)
|
||||
* Add Chinese (Traditional) in Taiwan language file (#2108)
|
||||
* Add Sonoff SC domoticz support for Sound level as Counter and Air quality (#2118)
|
||||
* Add a second TLS fingerprint to allow switching keys in TLS mode (#2033, #2102)
|
||||
* Add display of remaining pulse time to command PulseTime (#2085)
|
||||
* Add additional time offset to Wifi Retry based on device mac address (#2089)
|
||||
* Add command Color6 RRGGBB for Clock hour marker color and command Rotation pixels for Clock rotation (#2092)
|
||||
* Add HTML language header in local language (#2123)
|
||||
* Add command PowerDelta 0..100 (percentage) to Energy monitoring devices to report on active power load change (#2157)
|
||||
* Add Restart Reason to Status 1 report (#2161)
|
||||
* Add command Channel 0..100 to control dimmer value for individual color channels (#2111, #2203)
|
||||
* Add support for Hardware Serial bridge using commands SerialDelimiter, Baudrate and SerialSend. Supports 8N1 and text only (#2182)
|
||||
* Add support for Software Serial bridge using commands SerialDelimiter, SBaudrate and SSerialSend. Supports 8N1 and text only (#2190)
|
||||
* Add support for Zengge WF017 PWM Led strip controller (#2202)
|
||||
* Add PWM status to command State if PWM enabled (#2203)
|
||||
* Add all FriendlyNames to Status information (#2208)
|
||||
* Add Channel status information (#2211)
|
||||
* Add hexadecimal Data entry to command IrSend using 0x notation (#1290, #2314)
|
||||
* Add Home Assistant MQTT Discovery for Buttons and change SetOption19 response (#2277)
|
||||
* Add multiple color entry support for command Led like Led2 120000 001200 000012 setting led2 as Red, Led3 as Green and Led4 as Blue (#2303)
|
||||
* Add hexadecimal RGB color entry on RGBCW leds (#2304)
|
||||
* Add support for SGP30 gas and air quality sensor (#2307)
|
||||
* Add optional Sunrise and Sunset timers with commands Latitide and Longitude to be enabled with define USE_SUNRISE in user_config.h (#2317)
|
||||
* Add timer sunrise and sunset offset (#2378)
|
||||
* Add user selectable defines for Sunrise/set Dawn option (#2378)
|
||||
* Add optional KNX IP Protocol Support (#2402)
|
||||
* Add random window to timers (#2447)
|
||||
* Add Greek language file (#2491)
|
||||
* Add support for Sonoff Pow R2 (#2340)
|
||||
* Add GPIO_User to GPIO02 for all Sonoff T1 (#2524)
|
||||
*
|
||||
* 5.12.0 20180209
|
||||
* Change library PubSubClient.h define MQTT_MAX_PACKET_SIZE from 512 to 1000 for Home Assistant support
|
||||
|
|
102
sonoff/i18n.h
102
sonoff/i18n.h
|
@ -46,8 +46,10 @@
|
|||
#define D_JSON_COUNTER "Counter"
|
||||
#define D_JSON_CURRENT "Current" // As in Voltage and Current
|
||||
#define D_JSON_DATA "Data"
|
||||
#define D_JSON_DISTANCE "Distance"
|
||||
#define D_JSON_DNSSERVER "DNSServer"
|
||||
#define D_JSON_DONE "Done"
|
||||
#define D_JSON_ECO2 "eCO2"
|
||||
#define D_JSON_EMPTY "Empty"
|
||||
#define D_JSON_ENDDST "EndDST" // End Daylight Savings Time
|
||||
#define D_JSON_ERASE "Erase"
|
||||
|
@ -63,6 +65,7 @@
|
|||
#define D_JSON_GATEWAY "Gateway"
|
||||
#define D_JSON_HEAPSIZE "Heap"
|
||||
#define D_JSON_HIGH "High"
|
||||
#define D_JSON_HSBCOLOR "HSBColor"
|
||||
#define D_JSON_HUMIDITY "Humidity"
|
||||
#define D_JSON_I2CSCAN_DEVICES_FOUND_AT "Device(s) found at"
|
||||
#define D_JSON_I2CSCAN_UNKNOWN_ERROR_AT "Unknown error at"
|
||||
|
@ -96,12 +99,15 @@
|
|||
#define D_JSON_SAVESTATE "SaveState"
|
||||
#define D_JSON_SDKVERSION "SDK"
|
||||
#define D_JSON_SELECTED "selected"
|
||||
#define D_JSON_SERIALRECEIVED "SerialReceived"
|
||||
#define D_JSON_SSID "SSId"
|
||||
#define D_JSON_STARTDST "StartDST" // Start Daylight Savings Time
|
||||
#define D_JSON_STARTED "Started"
|
||||
#define D_JSON_STARTUPUTC "StartupUTC"
|
||||
#define D_JSON_SUBNETMASK "Subnetmask"
|
||||
#define D_JSON_SUCCESSFUL "Successful"
|
||||
#define D_JSON_SUNRISE "Sunrise"
|
||||
#define D_JSON_SUNSET "Sunset"
|
||||
#define D_JSON_SWITCH "Switch"
|
||||
#define D_JSON_SYNC "Sync"
|
||||
#define D_JSON_TEMPERATURE "Temperature"
|
||||
|
@ -109,6 +115,7 @@
|
|||
#define D_JSON_TIME "Time"
|
||||
#define D_JSON_TODAY "Today"
|
||||
#define D_JSON_TOTAL "Total"
|
||||
#define D_JSON_TVOC "TVOC"
|
||||
#define D_JSON_TYPE "Type"
|
||||
#define D_JSON_UPTIME "Uptime"
|
||||
#define D_JSON_UTC_TIME "UTC"
|
||||
|
@ -132,28 +139,6 @@
|
|||
#define D_RSLT_WARNING "WARNING"
|
||||
|
||||
// Commands sonoff.ino
|
||||
#define D_CMND_MQTTHOST "MqttHost"
|
||||
#define D_CMND_MQTTPORT "MqttPort"
|
||||
#define D_CMND_MQTTRETRY "MqttRetry"
|
||||
#define D_CMND_STATETEXT "StateText"
|
||||
#define D_CMND_MQTTFINGERPRINT "MqttFingerprint"
|
||||
#define D_CMND_MQTTCLIENT "MqttClient"
|
||||
#define D_CMND_MQTTUSER "MqttUser"
|
||||
#define D_CMND_MQTTPASSWORD "MqttPassword"
|
||||
#define D_CMND_FULLTOPIC "FullTopic"
|
||||
#define D_CMND_PREFIX "Prefix"
|
||||
#define PRFX_MAX_STRING_LENGTH 5
|
||||
#define D_CMND "cmnd"
|
||||
#define D_STAT "stat"
|
||||
#define D_TELE "tele"
|
||||
#define D_CMND_GROUPTOPIC "GroupTopic"
|
||||
#define D_CMND_TOPIC "Topic"
|
||||
#define D_CMND_BUTTONTOPIC "ButtonTopic"
|
||||
#define D_CMND_SWITCHTOPIC "SwitchTopic"
|
||||
#define D_CMND_BUTTONRETAIN "ButtonRetain"
|
||||
#define D_CMND_SWITCHRETAIN "SwitchRetain"
|
||||
#define D_CMND_POWERRETAIN "PowerRetain"
|
||||
#define D_CMND_SENSORRETAIN "SensorRetain"
|
||||
#define D_CMND_BACKLOG "Backlog"
|
||||
#define D_CMND_DELAY "Delay"
|
||||
#define D_CMND_STATUS "Status"
|
||||
|
@ -238,18 +223,47 @@
|
|||
#define D_CMND_ALTITUDE "Altitude"
|
||||
#define D_CMND_LEDPOWER "LedPower"
|
||||
#define D_CMND_LEDSTATE "LedState"
|
||||
#define D_CMND_CFGDUMP "CfgDump"
|
||||
#define D_CMND_I2CSCAN "I2CScan"
|
||||
#define D_CMND_EXCEPTION "Exception"
|
||||
#define D_CMND_SERIALSEND "SerialSend"
|
||||
#define D_CMND_SERIALDELIMITER "SerialDelimiter"
|
||||
#define D_CMND_BAUDRATE "Baudrate"
|
||||
|
||||
// Commands xdrv_00_mqtt.ino
|
||||
#define D_CMND_MQTTHOST "MqttHost"
|
||||
#define D_CMND_MQTTPORT "MqttPort"
|
||||
#define D_CMND_MQTTRETRY "MqttRetry"
|
||||
#define D_CMND_STATETEXT "StateText"
|
||||
#define D_CMND_MQTTFINGERPRINT "MqttFingerprint"
|
||||
#define D_CMND_MQTTCLIENT "MqttClient"
|
||||
#define D_CMND_MQTTUSER "MqttUser"
|
||||
#define D_CMND_MQTTPASSWORD "MqttPassword"
|
||||
#define D_CMND_FULLTOPIC "FullTopic"
|
||||
#define D_CMND_PREFIX "Prefix"
|
||||
#define PRFX_MAX_STRING_LENGTH 5
|
||||
#define D_CMND "cmnd"
|
||||
#define D_STAT "stat"
|
||||
#define D_TELE "tele"
|
||||
#define D_CMND_GROUPTOPIC "GroupTopic"
|
||||
#define D_CMND_TOPIC "Topic"
|
||||
#define D_CMND_BUTTONTOPIC "ButtonTopic"
|
||||
#define D_CMND_SWITCHTOPIC "SwitchTopic"
|
||||
#define D_CMND_BUTTONRETAIN "ButtonRetain"
|
||||
#define D_CMND_SWITCHRETAIN "SwitchRetain"
|
||||
#define D_CMND_POWERRETAIN "PowerRetain"
|
||||
#define D_CMND_SENSORRETAIN "SensorRetain"
|
||||
#define D_CMND_PUBLISH "Publish"
|
||||
|
||||
// Commands xdrv_01_light.ino
|
||||
#define D_CMND_CHANNEL "Channel"
|
||||
#define D_CMND_COLOR "Color"
|
||||
#define D_CMND_COLORTEMPERATURE "CT"
|
||||
#define D_CMND_DIMMER "Dimmer"
|
||||
#define D_CMND_HSBCOLOR "HSBColor"
|
||||
#define D_CMND_LED "Led"
|
||||
#define D_CMND_LEDTABLE "LedTable"
|
||||
#define D_CMND_FADE "Fade"
|
||||
#define D_CMND_PIXELS "Pixels"
|
||||
#define D_CMND_ROTATION "Rotation"
|
||||
#define D_CMND_SCHEME "Scheme"
|
||||
#define D_CMND_SPEED "Speed"
|
||||
#define D_CMND_WAKEUP "Wakeup"
|
||||
|
@ -260,9 +274,9 @@
|
|||
#define D_CMND_IRSEND "IRSend"
|
||||
#define D_JSON_INVALID_JSON "Invalid JSON"
|
||||
#define D_JSON_PROTOCOL_NOT_SUPPORTED "Protocol not supported"
|
||||
#define D_JSON_IR_PROTOCOL "PROTOCOL"
|
||||
#define D_JSON_IR_BITS "BITS"
|
||||
#define D_JSON_IR_DATA "DATA"
|
||||
#define D_JSON_IR_PROTOCOL "Protocol"
|
||||
#define D_JSON_IR_BITS "Bits"
|
||||
#define D_JSON_IR_DATA "Data"
|
||||
#define D_CMND_IRHVAC "IRHVAC"
|
||||
#define D_JSON_IRHVAC_VENDOR "VENDOR"
|
||||
#define D_JSON_IRHVAC_POWER "POWER"
|
||||
|
@ -274,6 +288,7 @@
|
|||
// Commands xdrv_03_energy.ino
|
||||
#define D_CMND_POWERLOW "PowerLow"
|
||||
#define D_CMND_POWERHIGH "PowerHigh"
|
||||
#define D_CMND_POWERDELTA "PowerDelta"
|
||||
#define D_CMND_VOLTAGELOW "VoltageLow"
|
||||
#define D_CMND_VOLTAGEHIGH "VoltageHigh"
|
||||
#define D_CMND_CURRENTLOW "CurrentLow"
|
||||
|
@ -335,8 +350,30 @@
|
|||
#define D_CMND_DISP_SIZE "Size"
|
||||
#define D_CMND_DISP_TEXT "Text"
|
||||
|
||||
// Commands xdrv_08_serial_bridge.ino
|
||||
#define D_CMND_SSERIALSEND "SSerialSend"
|
||||
#define D_CMND_SBAUDRATE "SBaudrate"
|
||||
#define D_JSON_SSERIALRECEIVED "SSerialReceived"
|
||||
|
||||
// Commands xdrv_09_timers.ino
|
||||
#define D_CMND_TIMER "Timer"
|
||||
#define D_JSON_TIMER_ARM "Arm"
|
||||
#define D_JSON_TIMER_MODE "Mode"
|
||||
#define D_JSON_TIMER_TIME "Time"
|
||||
#define D_JSON_TIMER_WINDOW "Window"
|
||||
#define D_JSON_TIMER_DAYS "Days"
|
||||
#define D_JSON_TIMER_REPEAT "Repeat"
|
||||
#define D_JSON_TIMER_OUTPUT "Output"
|
||||
#define D_JSON_TIMER_ACTION "Action"
|
||||
#define D_JSON_TIMER_NO_DEVICE "No GPIO as output configured"
|
||||
#define D_CMND_TIMERS "Timers"
|
||||
#define D_CMND_LATITUDE "Latitude"
|
||||
#define D_CMND_LONGITUDE "Longitude"
|
||||
|
||||
/********************************************************************************************/
|
||||
|
||||
#define D_ASTERIX "********"
|
||||
|
||||
#ifndef MY_LANGUAGE
|
||||
#include "language/en-GB.h"
|
||||
#else
|
||||
|
@ -357,7 +394,10 @@ enum UnitNames {
|
|||
UNIT_MILLIAMPERE,
|
||||
UNIT_MILLISECOND,
|
||||
UNIT_MINUTE,
|
||||
UNIT_PPB,
|
||||
UNIT_PPD,
|
||||
UNIT_PPM,
|
||||
UNIT_PERCENTAGE,
|
||||
UNIT_PRESSURE,
|
||||
UNIT_SECOND,
|
||||
UNIT_SECTORS,
|
||||
|
@ -374,7 +414,10 @@ const char kUnitNames[] PROGMEM =
|
|||
D_UNIT_MILLIAMPERE "|"
|
||||
D_UNIT_MILLISECOND "|"
|
||||
D_UNIT_MINUTE "|"
|
||||
D_UNIT_PARTS_PER_BILLION "|"
|
||||
D_UNIT_PARTS_PER_DECILITER "|"
|
||||
D_UNIT_PARTS_PER_MILLION "|"
|
||||
"%|"
|
||||
D_UNIT_PRESSURE "|"
|
||||
D_UNIT_SECOND "|"
|
||||
D_UNIT_SECTORS "|"
|
||||
|
@ -394,12 +437,15 @@ const char S_JSON_COMMAND_NVALUE_ACTIVE_NVALUE[] PROGMEM = "{\"%s\":\"%d (" D
|
|||
const char S_JSON_COMMAND_NVALUE[] PROGMEM = "{\"%s\":%d}";
|
||||
const char S_JSON_COMMAND_LVALUE[] PROGMEM = "{\"%s\":%lu}";
|
||||
const char S_JSON_COMMAND_SVALUE[] PROGMEM = "{\"%s\":\"%s\"}";
|
||||
const char S_JSON_COMMAND_ASTERIX[] PROGMEM = "{\"%s\":\"" D_ASTERIX "\"}";
|
||||
const char S_JSON_COMMAND_XVALUE[] PROGMEM = "{\"%s\":%s}"; // %s must provide quotes on non-number
|
||||
|
||||
const char S_JSON_COMMAND_INDEX_NVALUE[] PROGMEM = "{\"%s%d\":%d}";
|
||||
const char S_JSON_COMMAND_INDEX_LVALUE[] PROGMEM = "{\"%s%d\":%lu}";
|
||||
const char S_JSON_COMMAND_INDEX_SVALUE[] PROGMEM = "{\"%s%d\":\"%s\"}";
|
||||
const char S_JSON_COMMAND_INDEX_ASTERIX[] PROGMEM = "{\"%s%d\":\"" D_ASTERIX "\"}";
|
||||
const char S_JSON_COMMAND_INDEX_SVALUE_SVALUE[] PROGMEM = "{\"%s%d\":\"%s%s\"}";
|
||||
const char S_JSON_COMMAND_INDEX_NVALUE_ACTIVE_NVALUE[] PROGMEM = "{\"%s%d\":\"%d (" D_JSON_ACTIVE " %d)\"}";
|
||||
|
||||
const char S_JSON_SENSOR_INDEX_NVALUE[] PROGMEM = "{\"" D_CMND_SENSOR "%d\":%d}";
|
||||
const char S_JSON_SENSOR_INDEX_SVALUE[] PROGMEM = "{\"" D_CMND_SENSOR "%d\":\"%s\"}";
|
||||
|
@ -469,4 +515,4 @@ const char S_INFORMATION[] PROGMEM = D_INFORMATION;
|
|||
const char S_RESTART[] PROGMEM = D_RESTART;
|
||||
#endif // USE_WEBSERVER
|
||||
|
||||
#endif // _I18N_H_
|
||||
#endif // _I18N_H_
|
||||
|
|
|
@ -0,0 +1,505 @@
|
|||
/*
|
||||
bg-BG.h - localization for Bulgaria - Bulgarian for Sonoff-Tasmota
|
||||
|
||||
Copyright (C) 2018 Theo Arends
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _LANGUAGE_BG_BG_H_
|
||||
#define _LANGUAGE_BG_BG_H_
|
||||
|
||||
/*************************** ATTENTION *******************************\
|
||||
*
|
||||
* Due to memory constraints only UTF-8 is supported.
|
||||
* To save code space keep text as short as possible.
|
||||
* Time and Date provided by SDK can not be localized (yet).
|
||||
* Use online command StateText to translate ON, OFF, HOLD and TOGGLE.
|
||||
* Use online command Prefix to translate cmnd, stat and tele.
|
||||
*
|
||||
* Updated until v5.12.0m
|
||||
\*********************************************************************/
|
||||
|
||||
//#define LANGUAGE_MODULE_NAME // Enable to display "Module Generic" (ie Spanish), Disable to display "Generic Module" (ie English)
|
||||
|
||||
// HTML (ISO 639-1) Language Code
|
||||
#define D_HTML_LANGUAGE "bg"
|
||||
|
||||
// "2017-03-07T11:08:02" - ISO8601:2004
|
||||
#define D_YEAR_MONTH_SEPARATOR "-"
|
||||
#define D_MONTH_DAY_SEPARATOR "-"
|
||||
#define D_DATE_TIME_SEPARATOR "T"
|
||||
#define D_HOUR_MINUTE_SEPARATOR ":"
|
||||
#define D_MINUTE_SECOND_SEPARATOR ":"
|
||||
|
||||
#define D_DAY3LIST "НедПонВтрСрдЧетПетСъб"
|
||||
#define D_MONTH3LIST "ЯнуФевМарАпрМайЮниЮлиАвгСепОктНоеДек"
|
||||
|
||||
// Non JSON decimal separator
|
||||
#define D_DECIMAL_SEPARATOR ","
|
||||
|
||||
// Common
|
||||
#define D_ADMIN "Admin"
|
||||
#define D_AIR_QUALITY "Качество на въздуха"
|
||||
#define D_AP "Точка за достъп" // Access Point
|
||||
#define D_AS "като"
|
||||
#define D_AUTO "АВТОМАТИЧНО"
|
||||
#define D_BLINK "Мигане вкл."
|
||||
#define D_BLINKOFF "Мигане изкл."
|
||||
#define D_BOOT_COUNT "Брой на стартиранията"
|
||||
#define D_BRIGHTLIGHT "Яркост"
|
||||
#define D_BUTTON "Бутон"
|
||||
#define D_BY "от" // Written by me
|
||||
#define D_BYTES "Байт"
|
||||
#define D_CELSIUS "Целзий"
|
||||
#define D_CO2 "Въглероден диоксид"
|
||||
#define D_CODE "код" // Button code
|
||||
#define D_COLDLIGHT "Хладна"
|
||||
#define D_COMMAND "Команда"
|
||||
#define D_CONNECTED "Свързан"
|
||||
#define D_COUNT "Брой"
|
||||
#define D_COUNTER "Брояч"
|
||||
#define D_CURRENT "Ток" // As in Voltage and Current
|
||||
#define D_DATA "Данни"
|
||||
#define D_DARKLIGHT "Тъмна"
|
||||
#define D_DEBUG "Дебъгване"
|
||||
#define D_DISABLED "Деактивиран"
|
||||
#define D_DISTANCE "Distance"
|
||||
#define D_DNS_SERVER "DNS Сървър"
|
||||
#define D_DONE "Изпълнено"
|
||||
#define D_DST_TIME "DST"
|
||||
#define D_ECO2 "eCO2"
|
||||
#define D_EMULATION "Емулация"
|
||||
#define D_ENABLED "Активиран"
|
||||
#define D_ERASE "Изтриване"
|
||||
#define D_ERROR "Грешка"
|
||||
#define D_FAHRENHEIT "Фаренхайт"
|
||||
#define D_FAILED "Неуспешно"
|
||||
#define D_FALLBACK "Обратна връзка"
|
||||
#define D_FALLBACK_TOPIC "Топик на обратната връзка"
|
||||
#define D_FALSE "Невярно"
|
||||
#define D_FILE "Файл"
|
||||
#define D_FREE_MEMORY "Свободна памет"
|
||||
#define D_GAS "Газ"
|
||||
#define D_GATEWAY "Шлюз"
|
||||
#define D_GROUP "Група"
|
||||
#define D_HOST "Хост"
|
||||
#define D_HOSTNAME "Име на хоста"
|
||||
#define D_HUMIDITY "Влажност"
|
||||
#define D_ILLUMINANCE "Осветеност"
|
||||
#define D_IMMEDIATE "моментален" // Button immediate
|
||||
#define D_INDEX "Индекс"
|
||||
#define D_INFO "Информация"
|
||||
#define D_INITIALIZED "Инициализирано"
|
||||
#define D_IP_ADDRESS "IP адрес"
|
||||
#define D_LIGHT "Светлина"
|
||||
#define D_LWT "LWT"
|
||||
#define D_MODULE "Модул"
|
||||
#define D_MQTT "MQTT"
|
||||
#define D_MULTI_PRESS "многократно натискане"
|
||||
#define D_NOISE "Шум"
|
||||
#define D_NONE "Няма"
|
||||
#define D_OFF "Изкл."
|
||||
#define D_OFFLINE "Офлайн"
|
||||
#define D_OK "Ок"
|
||||
#define D_ON "Вкл."
|
||||
#define D_ONLINE "Онлайн"
|
||||
#define D_PASSWORD "Парола"
|
||||
#define D_PORT "Порт"
|
||||
#define D_POWER_FACTOR "Фактор на мощността"
|
||||
#define D_POWERUSAGE "Мощност"
|
||||
#define D_PRESSURE "Налягане"
|
||||
#define D_PRESSUREATSEALEVEL "Налягане на морското ниво"
|
||||
#define D_PROGRAM_FLASH_SIZE "Размер на флаш паметта за програми"
|
||||
#define D_PROGRAM_SIZE "Размер на програмата"
|
||||
#define D_PROJECT "Проект"
|
||||
#define D_RECEIVED "Получено"
|
||||
#define D_RESTART "Рестарт"
|
||||
#define D_RESTARTING "Рестартиране"
|
||||
#define D_RESTART_REASON "Причина за рестарта"
|
||||
#define D_RESTORE "възстановяване"
|
||||
#define D_RETAINED "запазено"
|
||||
#define D_RULE "Правило"
|
||||
#define D_SAVE "Запис"
|
||||
#define D_SENSOR "Датчик"
|
||||
#define D_SSID "SSId"
|
||||
#define D_START "Старт"
|
||||
#define D_STD_TIME "STD"
|
||||
#define D_STOP "Стоп"
|
||||
#define D_SUBNET_MASK "Маска на подмрежата"
|
||||
#define D_SUBSCRIBE_TO "Записване за"
|
||||
#define D_SUCCESSFUL "Успешно"
|
||||
#define D_SUNRISE "Изгрев"
|
||||
#define D_SUNSET "Залез"
|
||||
#define D_TEMPERATURE "Температура"
|
||||
#define D_TO "към"
|
||||
#define D_TOGGLE "Превключване"
|
||||
#define D_TOPIC "Топик"
|
||||
#define D_TRANSMIT "Предаване"
|
||||
#define D_TRUE "Вярно"
|
||||
#define D_TVOC "TVOC"
|
||||
#define D_UPGRADE "Обновяване"
|
||||
#define D_UPLOAD "Зареждане"
|
||||
#define D_UPTIME "Време от стартирането"
|
||||
#define D_USER "Потребител"
|
||||
#define D_UTC_TIME "UTC"
|
||||
#define D_UV_LEVEL "Ниво на ултравиолетово излъчване"
|
||||
#define D_VERSION "Версия"
|
||||
#define D_VOLTAGE "Напрежение"
|
||||
#define D_WARMLIGHT "Топла"
|
||||
#define D_WEB_SERVER "Уеб сървър"
|
||||
|
||||
// sonoff.ino
|
||||
#define D_WARNING_MINIMAL_VERSION "ПРЕДУПРЕЖДЕНИЕ Тази версия не поддържа постоянни настройки"
|
||||
#define D_LEVEL_10 "ниво 1-0"
|
||||
#define D_LEVEL_01 "ниво 0-1"
|
||||
#define D_SERIAL_LOGGING_DISABLED "Серийния логинг изключен"
|
||||
#define D_SYSLOG_LOGGING_REENABLED "Системния логинг активиран"
|
||||
|
||||
#define D_SET_BAUDRATE_TO "Задаване скорост на предаване (Baudrate)"
|
||||
#define D_RECEIVED_TOPIC "Получен топик"
|
||||
#define D_DATA_SIZE "Размер на данните"
|
||||
#define D_ANALOG_INPUT "Аналогов вход"
|
||||
|
||||
// support.ino
|
||||
#define D_OSWATCH "osWatch"
|
||||
#define D_BLOCKED_LOOP "Блокиран цикъл"
|
||||
#define D_WPS_FAILED_WITH_STATUS "WPS конфигурацията е НЕУСПЕШНА със статус"
|
||||
#define D_ACTIVE_FOR_3_MINUTES "активно в течение на 3 минути"
|
||||
#define D_FAILED_TO_START "неуспешно стартиране"
|
||||
#define D_PATCH_ISSUE_2186 "Проблем с патч 2186"
|
||||
#define D_CONNECTING_TO_AP "Свързване към точка за достъп"
|
||||
#define D_IN_MODE "в режим"
|
||||
#define D_CONNECT_FAILED_NO_IP_ADDRESS "Грешка при свързването, не е получен IP адрес"
|
||||
#define D_CONNECT_FAILED_AP_NOT_REACHED "Грешка при свързването, точката за достъп е недостижима"
|
||||
#define D_CONNECT_FAILED_WRONG_PASSWORD "Грешка при свързването, грешна парола към точката за достъп"
|
||||
#define D_CONNECT_FAILED_AP_TIMEOUT "Грешка при свързването, превишено време за изчакване"
|
||||
#define D_ATTEMPTING_CONNECTION "Опитва свързване..."
|
||||
#define D_CHECKING_CONNECTION "Проверка на свързването..."
|
||||
#define D_QUERY_DONE "Запитването е изпълнено. Намерена е услуга MQTT"
|
||||
#define D_MQTT_SERVICE_FOUND "MQTT услуга е намерена на"
|
||||
#define D_FOUND_AT "намерена в"
|
||||
#define D_SYSLOG_HOST_NOT_FOUND "Хостът на системния лог не е намерен"
|
||||
|
||||
// settings.ino
|
||||
#define D_SAVED_TO_FLASH_AT "Запазено във флаш паметта на"
|
||||
#define D_LOADED_FROM_FLASH_AT "Заредено от флаш паметта от"
|
||||
#define D_USE_DEFAULTS "Използване на параметри по подразбиране"
|
||||
#define D_ERASED_SECTOR "Изтрит сектор"
|
||||
|
||||
// webserver.ino
|
||||
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "Фърмуеър MINIMAL - моля надградете го"
|
||||
#define D_WEBSERVER_ACTIVE_ON "Уеб сървърът е активен на"
|
||||
#define D_WITH_IP_ADDRESS "с IP адрес"
|
||||
#define D_WEBSERVER_STOPPED "Уеб сървърът е спрян"
|
||||
#define D_FILE_NOT_FOUND "Файлът не е намерен"
|
||||
#define D_REDIRECTED "Пренасочено към адаптивния портал"
|
||||
#define D_WIFIMANAGER_SET_ACCESSPOINT_AND_STATION "Wifi мениджърът настройва точка за достъп и запомня станцията"
|
||||
#define D_WIFIMANAGER_SET_ACCESSPOINT "Wifi мениджърът настрои точката за достъп"
|
||||
#define D_TRYING_TO_CONNECT "Опит за свързване на устройството към мрежата"
|
||||
|
||||
#define D_RESTART_IN "Рестарт след"
|
||||
#define D_SECONDS "секунди"
|
||||
#define D_DEVICE_WILL_RESTART "Устройството ще се рестартира след няколко секунди"
|
||||
#define D_BUTTON_TOGGLE "Превключване"
|
||||
#define D_CONFIGURATION "Конфигурация"
|
||||
#define D_INFORMATION "Информация"
|
||||
#define D_FIRMWARE_UPGRADE "Обновяване на фърмуеъра"
|
||||
#define D_CONSOLE "Конзола"
|
||||
#define D_CONFIRM_RESTART "Подтвърдете рестартирането"
|
||||
|
||||
#define D_CONFIGURE_MODULE "Конфигурация на модула"
|
||||
#define D_CONFIGURE_WIFI "Конфигурация на WiFi"
|
||||
#define D_CONFIGURE_MQTT "Конфигурация на MQTT"
|
||||
#define D_CONFIGURE_DOMOTICZ "Конфигурация на Domoticz"
|
||||
#define D_CONFIGURE_LOGGING "Конфигурация на логинга"
|
||||
#define D_CONFIGURE_OTHER "Драги конфигурации"
|
||||
#define D_CONFIRM_RESET_CONFIGURATION "Потвърдете изчистването"
|
||||
#define D_RESET_CONFIGURATION "Изчистване на конфигурацията"
|
||||
#define D_BACKUP_CONFIGURATION "Запазване на конфигурацията"
|
||||
#define D_RESTORE_CONFIGURATION "Възстановяване на конфигурацията"
|
||||
#define D_MAIN_MENU "Основно меню"
|
||||
|
||||
#define D_MODULE_PARAMETERS "Параметри на модула"
|
||||
#define D_MODULE_TYPE "Тип на модула"
|
||||
#define D_GPIO "GPIO"
|
||||
#define D_SERIAL_IN "Сериен вход"
|
||||
#define D_SERIAL_OUT "Сериен изход"
|
||||
|
||||
#define D_WIFI_PARAMETERS "Wifi параметри"
|
||||
#define D_SCAN_FOR_WIFI_NETWORKS "Сканиране за безжични мрежи"
|
||||
#define D_SCAN_DONE "Сканирането приключи"
|
||||
#define D_NO_NETWORKS_FOUND "Не бяха открити мрежи"
|
||||
#define D_REFRESH_TO_SCAN_AGAIN "Обновяване за повторно сканиране"
|
||||
#define D_DUPLICATE_ACCESSPOINT "Дублиране на точката за достъп (AP)"
|
||||
#define D_SKIPPING_LOW_QUALITY "Пропускане поради лошо качество"
|
||||
#define D_RSSI "RSSI"
|
||||
#define D_WEP "WEP"
|
||||
#define D_WPA_PSK "WPA PSK"
|
||||
#define D_WPA2_PSK "WPA2 PSK"
|
||||
#define D_AP1_SSID "AP1 SSId"
|
||||
#define D_AP1_PASSWORD "AP1 Парола"
|
||||
#define D_AP2_SSID "AP2 SSId"
|
||||
#define D_AP2_PASSWORD "AP2 Парола"
|
||||
|
||||
#define D_MQTT_PARAMETERS "Параметри на MQTT"
|
||||
#define D_CLIENT "Клиент"
|
||||
#define D_FULL_TOPIC "Пълен топик"
|
||||
|
||||
#define D_LOGGING_PARAMETERS "Параметри на логинга"
|
||||
#define D_SERIAL_LOG_LEVEL "Степен на серийния лог"
|
||||
#define D_WEB_LOG_LEVEL "Степен на Уеб лога"
|
||||
#define D_SYS_LOG_LEVEL "Степен на системния лог"
|
||||
#define D_MORE_DEBUG "Още дебъгване"
|
||||
#define D_SYSLOG_HOST "Хост на системния лог"
|
||||
#define D_SYSLOG_PORT "Порт на системния лог"
|
||||
#define D_TELEMETRY_PERIOD "Период на телеметрия"
|
||||
|
||||
#define D_OTHER_PARAMETERS "Други параметри"
|
||||
#define D_WEB_ADMIN_PASSWORD "Парола на уеб администратора"
|
||||
#define D_MQTT_ENABLE "активиране на MQTT"
|
||||
#define D_FRIENDLY_NAME "приятелско име"
|
||||
#define D_BELKIN_WEMO "Belkin WeMo"
|
||||
#define D_HUE_BRIDGE "Hue Bridge"
|
||||
#define D_SINGLE_DEVICE "единично"
|
||||
#define D_MULTI_DEVICE "мулти"
|
||||
|
||||
#define D_SAVE_CONFIGURATION "Запазване на конфигурацията"
|
||||
#define D_CONFIGURATION_SAVED "Конфигурацията е запазена"
|
||||
#define D_CONFIGURATION_RESET "Конфигурацията е изчистена"
|
||||
|
||||
#define D_PROGRAM_VERSION "Версия на програмата"
|
||||
#define D_BUILD_DATE_AND_TIME "Дата и час на компилацията"
|
||||
#define D_CORE_AND_SDK_VERSION "Версия на Core/SDK"
|
||||
#define D_FLASH_WRITE_COUNT "Брой на записите във флаш паметта"
|
||||
#define D_MAC_ADDRESS "MAC адрес"
|
||||
#define D_MQTT_HOST "MQTT хост"
|
||||
#define D_MQTT_PORT "MQTT порт"
|
||||
#define D_MQTT_CLIENT "MQTT ID на клиент"
|
||||
#define D_MQTT_USER "MQTT потребител"
|
||||
#define D_MQTT_TOPIC "MQTT топик"
|
||||
#define D_MQTT_GROUP_TOPIC "MQTT групов топик"
|
||||
#define D_MQTT_FULL_TOPIC "MQTT пълен топик"
|
||||
#define D_MDNS_DISCOVERY "mDNS откриване"
|
||||
#define D_MDNS_ADVERTISE "mDNS транслация"
|
||||
#define D_ESP_CHIP_ID "ID на чипа ESP"
|
||||
#define D_FLASH_CHIP_ID "ID на чипа на флаш паметта"
|
||||
#define D_FLASH_CHIP_SIZE "Размер на флаш паметта"
|
||||
#define D_FREE_PROGRAM_SPACE "Свободно пространство за програми"
|
||||
|
||||
#define D_UPGRADE_BY_WEBSERVER "Обновяване чрез уеб сървър"
|
||||
#define D_OTA_URL "OTA Url"
|
||||
#define D_START_UPGRADE "Започване на обновяване"
|
||||
#define D_UPGRADE_BY_FILE_UPLOAD "Обновяване чрез зареждане на файл"
|
||||
#define D_UPLOAD_STARTED "Зареждането започна"
|
||||
#define D_UPGRADE_STARTED "Обновяването започна"
|
||||
#define D_UPLOAD_DONE "Зареждането завърши"
|
||||
#define D_UPLOAD_ERR_1 "Не е избран файл"
|
||||
#define D_UPLOAD_ERR_2 "Недостатъчно свободно място"
|
||||
#define D_UPLOAD_ERR_3 "Magic байтът не е 0xE9"
|
||||
#define D_UPLOAD_ERR_4 "Размерът на програмата е по-голям от реалния размер на флаш паметта"
|
||||
#define D_UPLOAD_ERR_5 "Грешка при зареждането в буфера"
|
||||
#define D_UPLOAD_ERR_6 "Грешка пр зареждането. Включено е ниво 3 на лога"
|
||||
#define D_UPLOAD_ERR_7 "Зареждането е прекъснато"
|
||||
#define D_UPLOAD_ERR_8 "Файлът е невалиден"
|
||||
#define D_UPLOAD_ERR_9 "Файлът е прекалено голям"
|
||||
#define D_UPLOAD_ERROR_CODE "Код на грешка при зареждането"
|
||||
|
||||
#define D_ENTER_COMMAND "Въвеждане на команда"
|
||||
#define D_ENABLE_WEBLOG_FOR_RESPONSE "Включете ниво 2 на лога, ако очаквате отговор"
|
||||
#define D_NEED_USER_AND_PASSWORD "Очаква user=<username>&password=<password>"
|
||||
|
||||
// xdrv_00_mqtt.ino
|
||||
#define D_FINGERPRINT "Проверка на TLS отпечатък..."
|
||||
#define D_TLS_CONNECT_FAILED_TO "Неуспешно TLS свързване към"
|
||||
#define D_RETRY_IN "Повторно след"
|
||||
#define D_VERIFIED "Проверен отпечтък"
|
||||
#define D_INSECURE "Нешифрована връзка, недействителен отпечатък"
|
||||
#define D_CONNECT_FAILED_TO "Грешка при свързването към"
|
||||
|
||||
// xdrv_wemohue.ino
|
||||
#define D_MULTICAST_DISABLED "Multicast е изключен"
|
||||
#define D_MULTICAST_REJOINED "Multicast е повторно съединен"
|
||||
#define D_MULTICAST_JOIN_FAILED "Multicast грешка при присъединяването"
|
||||
#define D_FAILED_TO_SEND_RESPONSE "Не се получи изпращането на отговор"
|
||||
|
||||
#define D_WEMO "WeMo"
|
||||
#define D_WEMO_BASIC_EVENT "WeMo главно събитие"
|
||||
#define D_WEMO_EVENT_SERVICE "WeMo услуга за събитията"
|
||||
#define D_WEMO_META_SERVICE "WeMo мета-услуга"
|
||||
#define D_WEMO_SETUP "WeMo настройка"
|
||||
#define D_RESPONSE_SENT "Отговорът е изпратен"
|
||||
|
||||
#define D_HUE "Hue"
|
||||
#define D_HUE_BRIDGE_SETUP "Hue мост настройка"
|
||||
#define D_HUE_API_NOT_IMPLEMENTED "Hue API не е внедрено"
|
||||
#define D_HUE_API "Hue API"
|
||||
#define D_HUE_POST_ARGS "Hue POST аргументи"
|
||||
#define D_3_RESPONSE_PACKETS_SENT "Изпратени са 3 пакета за отговор"
|
||||
|
||||
// xdrv_05_domoticz.ino
|
||||
#define D_DOMOTICZ_PARAMETERS "Domoticz параметри"
|
||||
#define D_DOMOTICZ_IDX "Idx"
|
||||
#define D_DOMOTICZ_KEY_IDX "Key idx"
|
||||
#define D_DOMOTICZ_SWITCH_IDX "Switch idx"
|
||||
#define D_DOMOTICZ_SENSOR_IDX "Sensor idx"
|
||||
#define D_DOMOTICZ_TEMP "Temp"
|
||||
#define D_DOMOTICZ_TEMP_HUM "Temp,Hum"
|
||||
#define D_DOMOTICZ_TEMP_HUM_BARO "Temp,Hum,Baro"
|
||||
#define D_DOMOTICZ_POWER_ENERGY "Power,Energy"
|
||||
#define D_DOMOTICZ_ILLUMINANCE "Illuminance"
|
||||
#define D_DOMOTICZ_COUNT "Count/PM1"
|
||||
#define D_DOMOTICZ_VOLTAGE "Voltage/PM2,5"
|
||||
#define D_DOMOTICZ_CURRENT "Current/PM10"
|
||||
#define D_DOMOTICZ_AIRQUALITY "AirQuality"
|
||||
#define D_DOMOTICZ_UPDATE_TIMER "Update timer"
|
||||
|
||||
// xdrv_09_timers.ino
|
||||
#define D_CONFIGURE_TIMER "Конфигуриране на таймер"
|
||||
#define D_TIMER_PARAMETERS "Параметри на таймера"
|
||||
#define D_TIMER_ARM "Arm"
|
||||
#define D_TIMER_TIME "Време"
|
||||
#define D_TIMER_DAYS "Дни"
|
||||
#define D_TIMER_REPEAT "Повтори"
|
||||
#define D_TIMER_OUTPUT "Изход"
|
||||
#define D_TIMER_ACTION "Действие"
|
||||
|
||||
// xdrv_10_knx.ino
|
||||
#define D_CONFIGURE_KNX "Конфигуриране на KNX"
|
||||
#define D_KNX_PARAMETERS "KNX параметри"
|
||||
#define D_KNX_GENERAL_CONFIG "Основни"
|
||||
#define D_KNX_PHYSICAL_ADDRESS "Физически адрес"
|
||||
#define D_KNX_PHYSICAL_ADDRESS_NOTE "( Трябва да е уникален в KNX мрежата )"
|
||||
#define D_KNX_ENABLE "Активиране на KNX"
|
||||
#define D_KNX_GROUP_ADDRESS_TO_WRITE "Групови адреси за изпращане на данни"
|
||||
#define D_ADD "Добаване"
|
||||
#define D_DELETE "Изтриване"
|
||||
#define D_REPLY "Отговор"
|
||||
#define D_KNX_GROUP_ADDRESS_TO_READ "Групови адреси за получаване на данни"
|
||||
#define D_LOG_KNX "KNX: "
|
||||
#define D_RECEIVED_FROM "Получен от"
|
||||
#define D_KNX_COMMAND_WRITE "Писане"
|
||||
#define D_KNX_COMMAND_READ "Четене"
|
||||
#define D_KNX_COMMAND_OTHER "Друго"
|
||||
#define D_SENT_TO "изпратен до"
|
||||
#define D_KNX_WARNING "Груповият адрес ( 0 / 0 / 0 ) е резервиран и не може да бъде използван."
|
||||
|
||||
// xdrv_03_energy.ino
|
||||
#define D_ENERGY_TODAY "Използвана енергия днес"
|
||||
#define D_ENERGY_YESTERDAY "Използвана енергия вчера"
|
||||
#define D_ENERGY_TOTAL "Използвана енергия общо"
|
||||
|
||||
// xsns_05_ds18b20.ino
|
||||
#define D_SENSOR_BUSY "Датчикът DS18x20 е зает"
|
||||
#define D_SENSOR_CRC_ERROR "Датчик DS18x20 - грешка CRC"
|
||||
#define D_SENSORS_FOUND "Намерен е датчик DS18x20"
|
||||
|
||||
// xsns_06_dht.ino
|
||||
#define D_TIMEOUT_WAITING_FOR "Изтекло време за очакване на"
|
||||
#define D_START_SIGNAL_LOW "стартов сигнал нисък"
|
||||
#define D_START_SIGNAL_HIGH "стартов сигнал висок"
|
||||
#define D_PULSE "импулс"
|
||||
#define D_CHECKSUM_FAILURE "Грешка в контролната сума"
|
||||
|
||||
// xsns_07_sht1x.ino
|
||||
#define D_SENSOR_DID_NOT_ACK_COMMAND "Датчикът не прие команда ACK"
|
||||
#define D_SHT1X_FOUND "Намерен е SHT1X"
|
||||
|
||||
// xsns_18_pms5003.ino
|
||||
#define D_STANDARD_CONCENTRATION "CF-1 PM" // Standard Particle CF-1 Particle Matter
|
||||
#define D_ENVIRONMENTAL_CONCENTRATION "PM" // Environmetal Particle Matter
|
||||
#define D_PARTICALS_BEYOND "Particals"
|
||||
|
||||
// sonoff_template.h
|
||||
#define D_SENSOR_NONE "няма"
|
||||
#define D_SENSOR_DHT11 "DHT11"
|
||||
#define D_SENSOR_AM2301 "AM2301"
|
||||
#define D_SENSOR_SI7021 "SI7021"
|
||||
#define D_SENSOR_DS18X20 "DS18x20"
|
||||
#define D_SENSOR_I2C_SCL "I2C SCL"
|
||||
#define D_SENSOR_I2C_SDA "I2C SDA"
|
||||
#define D_SENSOR_WS2812 "WS2812"
|
||||
#define D_SENSOR_IRSEND "IRsend"
|
||||
#define D_SENSOR_SWITCH "Ключ" // Suffix "1"
|
||||
#define D_SENSOR_BUTTON "Бутон" // Suffix "1"
|
||||
#define D_SENSOR_RELAY "Реле" // Suffix "1i"
|
||||
#define D_SENSOR_LED "Led" // Suffix "1i"
|
||||
#define D_SENSOR_PWM "PWM" // Suffix "1"
|
||||
#define D_SENSOR_COUNTER "Брояч" // Suffix "1"
|
||||
#define D_SENSOR_IRRECV "IRrecv"
|
||||
#define D_SENSOR_MHZ_RX "MHZ Rx"
|
||||
#define D_SENSOR_MHZ_TX "MHZ Tx"
|
||||
#define D_SENSOR_PZEM_RX "PZEM Rx"
|
||||
#define D_SENSOR_PZEM_TX "PZEM Tx"
|
||||
#define D_SENSOR_SAIR_RX "SAir Rx"
|
||||
#define D_SENSOR_SAIR_TX "SAir Tx"
|
||||
#define D_SENSOR_SPI_CS "SPI CS"
|
||||
#define D_SENSOR_SPI_DC "SPI DC"
|
||||
#define D_SENSOR_BACKLIGHT "Подсветка"
|
||||
#define D_SENSOR_PMS5003 "PMS5003"
|
||||
#define D_SENSOR_SDS0X1 "SDS0X1"
|
||||
#define D_SENSOR_SBR_RX "SerBr Rx"
|
||||
#define D_SENSOR_SBR_TX "SerBr Tx"
|
||||
#define D_SENSOR_SR04_TRIG "SR04 Tri"
|
||||
#define D_SENSOR_SR04_ECHO "SR04 Ech"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "А"
|
||||
#define D_UNIT_CENTIMETER "см"
|
||||
#define D_UNIT_HOUR "ч"
|
||||
#define D_UNIT_KILOOHM "кОм"
|
||||
#define D_UNIT_KILOWATTHOUR "кВт/ч"
|
||||
#define D_UNIT_LUX "лукс"
|
||||
#define D_UNIT_MICROGRAM_PER_CUBIC_METER "микрограм/м3"
|
||||
#define D_UNIT_MICROMETER "микрометър"
|
||||
#define D_UNIT_MICROSECOND "микросек"
|
||||
#define D_UNIT_MILLIAMPERE "мА"
|
||||
#define D_UNIT_MILLISECOND "мсек"
|
||||
#define D_UNIT_MINUTE "мин"
|
||||
#define D_UNIT_PARTS_PER_BILLION "ppb"
|
||||
#define D_UNIT_PARTS_PER_DECILITER "ppd"
|
||||
#define D_UNIT_PARTS_PER_MILLION "ppm"
|
||||
#define D_UNIT_PRESSURE "хПа"
|
||||
#define D_UNIT_SECOND "сек"
|
||||
#define D_UNIT_SECTORS "сектори"
|
||||
#define D_UNIT_VOLT "В"
|
||||
#define D_UNIT_WATT "Вт"
|
||||
#define D_UNIT_WATTHOUR "Вт/ч"
|
||||
|
||||
// Log message prefix
|
||||
#define D_LOG_APPLICATION "APP: " // Application
|
||||
#define D_LOG_BRIDGE "BRG: " // Bridge
|
||||
#define D_LOG_CONFIG "CFG: " // Settings
|
||||
#define D_LOG_COMMAND "CMD: " // Command
|
||||
#define D_LOG_DEBUG "DBG: " // Debug
|
||||
#define D_LOG_DHT "DHT: " // DHT sensor
|
||||
#define D_LOG_DOMOTICZ "DOM: " // Domoticz
|
||||
#define D_LOG_DSB "DSB: " // DS18xB20 sensor
|
||||
#define D_LOG_HTTP "HTP: " // HTTP webserver
|
||||
#define D_LOG_I2C "I2C: " // I2C
|
||||
#define D_LOG_IRR "IRR: " // Infra Red Received
|
||||
#define D_LOG_LOG "LOG: " // Logging
|
||||
#define D_LOG_MODULE "MOD: " // Module
|
||||
#define D_LOG_MDNS "DNS: " // mDNS
|
||||
#define D_LOG_MQTT "MQT: " // MQTT
|
||||
#define D_LOG_OTHER "OTH: " // Other
|
||||
#define D_LOG_RESULT "RSL: " // Result
|
||||
#define D_LOG_RFR "RFR: " // RF Received
|
||||
#define D_LOG_SERIAL "SER: " // Serial
|
||||
#define D_LOG_SHT1 "SHT: " // SHT1x sensor
|
||||
#define D_LOG_UPLOAD "UPL: " // Upload
|
||||
#define D_LOG_UPNP "UPP: " // UPnP
|
||||
#define D_LOG_WIFI "WIF: " // Wifi
|
||||
|
||||
#endif // _LANGUAGE_BG_BG_H_
|
|
@ -0,0 +1,505 @@
|
|||
/*
|
||||
cs-CZ.h - localization for Czech with diacritics - Czech for Sonoff-Tasmota
|
||||
|
||||
Copyright (C) 2018 Vladimír Synek
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _LANGUAGE_CS_CZ_H_
|
||||
#define _LANGUAGE_CS_CZ_H_
|
||||
|
||||
/*************************** ATTENTION *******************************\
|
||||
*
|
||||
* Due to memory constraints only UTF-8 is supported.
|
||||
* To save code space keep text as short as possible.
|
||||
* Time and Date provided by SDK can not be localized (yet).
|
||||
* Use online command StateText to translate ON, OFF, HOLD and TOGGLE.
|
||||
* Use online command Prefix to translate cmnd, stat and tele.
|
||||
*
|
||||
* Updated until v5.12.0n
|
||||
\*********************************************************************/
|
||||
|
||||
//#define LANGUAGE_MODULE_NAME // Enable to display "Module Generic" (ie Spanish), Disable to display "Generic Module" (ie English)
|
||||
|
||||
// HTML (ISO 639-1) Language Code
|
||||
#define D_HTML_LANGUAGE "cs"
|
||||
|
||||
// "2017-03-07T11:08:02" - ISO8601:2004
|
||||
#define D_YEAR_MONTH_SEPARATOR "-"
|
||||
#define D_MONTH_DAY_SEPARATOR "-"
|
||||
#define D_DATE_TIME_SEPARATOR "T"
|
||||
#define D_HOUR_MINUTE_SEPARATOR ":"
|
||||
#define D_MINUTE_SECOND_SEPARATOR ":"
|
||||
|
||||
#define D_DAY3LIST "Ne Po Út St Čt Pá So "
|
||||
#define D_MONTH3LIST "LedÚnoBřeDubKvěČvnČvcSrpZářŘíjLisPro"
|
||||
|
||||
// Non JSON decimal separator
|
||||
#define D_DECIMAL_SEPARATOR ","
|
||||
|
||||
// Common
|
||||
#define D_ADMIN "Admin"
|
||||
#define D_AIR_QUALITY "Kvalita vzduchu"
|
||||
#define D_AP "AP" // Access Point
|
||||
#define D_AS "jako"
|
||||
#define D_AUTO "AUTO"
|
||||
#define D_BLINK "Blikání"
|
||||
#define D_BLINKOFF "BlikáníVyp"
|
||||
#define D_BOOT_COUNT "Počítadlo spuštění"
|
||||
#define D_BRIGHTLIGHT "Světlý"
|
||||
#define D_BUTTON "Tlačítko"
|
||||
#define D_BY "by" // Written by me
|
||||
#define D_BYTES "Bytů"
|
||||
#define D_CELSIUS "°C"
|
||||
#define D_CO2 "CO2"
|
||||
#define D_CODE "kód" // Button code
|
||||
#define D_COLDLIGHT "Studené světlo"
|
||||
#define D_COMMAND "Příkaz"
|
||||
#define D_CONNECTED "...připojeno"
|
||||
#define D_COUNT "Počítej"
|
||||
#define D_COUNTER "Počítadlo"
|
||||
#define D_CURRENT "Proud" // As in Voltage and Current
|
||||
#define D_DATA "Data"
|
||||
#define D_DARKLIGHT "Tmavý"
|
||||
#define D_DEBUG "Debug"
|
||||
#define D_DISABLED "Zablokováno"
|
||||
#define D_DISTANCE "Distance"
|
||||
#define D_DNS_SERVER "Server DNS"
|
||||
#define D_DONE "Provedeno"
|
||||
#define D_DST_TIME "DST"
|
||||
#define D_ECO2 "eCO2"
|
||||
#define D_EMULATION "Emulace"
|
||||
#define D_ENABLED "Otevřený"
|
||||
#define D_ERASE "Smaž"
|
||||
#define D_ERROR "Chyba"
|
||||
#define D_FAHRENHEIT "Fahrenheita"
|
||||
#define D_FAILED "chyba"
|
||||
#define D_FALLBACK "Záložní"
|
||||
#define D_FALLBACK_TOPIC "Záložní topic"
|
||||
#define D_FALSE "Nepravda"
|
||||
#define D_FILE "Soubor"
|
||||
#define D_FREE_MEMORY "Volná paměť"
|
||||
#define D_GAS "Plyn"
|
||||
#define D_GATEWAY "Výchozí brána"
|
||||
#define D_GROUP "Skupina"
|
||||
#define D_HOST "Server"
|
||||
#define D_HOSTNAME "Název serveru"
|
||||
#define D_HUMIDITY "Vlhkost"
|
||||
#define D_ILLUMINANCE "Osvětlení"
|
||||
#define D_IMMEDIATE "Okamžité" // Button immediate
|
||||
#define D_INDEX "Index"
|
||||
#define D_INFO "Informace"
|
||||
#define D_INITIALIZED "Inicializovaný"
|
||||
#define D_IP_ADDRESS "Adresa IP"
|
||||
#define D_LIGHT "Světlo"
|
||||
#define D_LWT "LWT"
|
||||
#define D_MODULE "Modul"
|
||||
#define D_MQTT "MQTT"
|
||||
#define D_MULTI_PRESS "několikeré-stisknutí"
|
||||
#define D_NOISE "Hluk"
|
||||
#define D_NONE "Žádný"
|
||||
#define D_OFF "Vyp."
|
||||
#define D_OFFLINE "Neaktivní"
|
||||
#define D_OK "OK"
|
||||
#define D_ON "Zap."
|
||||
#define D_ONLINE "Aktivní"
|
||||
#define D_PASSWORD "Heslo"
|
||||
#define D_PORT "Port"
|
||||
#define D_POWER_FACTOR "Účiník"
|
||||
#define D_POWERUSAGE "Příkon"
|
||||
#define D_PRESSURE "Tlak"
|
||||
#define D_PRESSUREATSEALEVEL "Tlak na úrovni hladiny moře"
|
||||
#define D_PROGRAM_FLASH_SIZE "Velikost paměti flash"
|
||||
#define D_PROGRAM_SIZE "Velikost programu"
|
||||
#define D_PROJECT "Projekt"
|
||||
#define D_RECEIVED "Přijatý"
|
||||
#define D_RESTART "Restart"
|
||||
#define D_RESTARTING "Restartování"
|
||||
#define D_RESTART_REASON "Příčina restartu"
|
||||
#define D_RESTORE "Obnovit"
|
||||
#define D_RETAINED "Zachováno"
|
||||
#define D_RULE "Rule"
|
||||
#define D_SAVE "Ulož"
|
||||
#define D_SENSOR "Sensor"
|
||||
#define D_SSID "SSID"
|
||||
#define D_START "Start"
|
||||
#define D_STD_TIME "STD"
|
||||
#define D_STOP "Stop"
|
||||
#define D_SUBNET_MASK "Maska podsítě"
|
||||
#define D_SUBSCRIBE_TO "Přihlaš se do"
|
||||
#define D_SUCCESSFUL "úspěšné."
|
||||
#define D_SUNRISE "Svítání"
|
||||
#define D_SUNSET "Soumrak"
|
||||
#define D_TEMPERATURE "Teplota"
|
||||
#define D_TO "do"
|
||||
#define D_TOGGLE "Přepni"
|
||||
#define D_TOPIC "Topic"
|
||||
#define D_TRANSMIT "Odešli"
|
||||
#define D_TRUE "Pravda"
|
||||
#define D_TVOC "TVOC"
|
||||
#define D_UPGRADE "aktualizace"
|
||||
#define D_UPLOAD "Nahrání..."
|
||||
#define D_UPTIME "Uptime"
|
||||
#define D_USER "Uživatel"
|
||||
#define D_UTC_TIME "UTC"
|
||||
#define D_UV_LEVEL "úroveň UV"
|
||||
#define D_VERSION "Verze"
|
||||
#define D_VOLTAGE "Napětí"
|
||||
#define D_WARMLIGHT "Teplé světlo"
|
||||
#define D_WEB_SERVER "Web Server"
|
||||
|
||||
// sonoff.ino
|
||||
#define D_WARNING_MINIMAL_VERSION "UPOZORNĚNÍ Tato verze nepodporuje trvalé nastavení"
|
||||
#define D_LEVEL_10 "úroveň 1-0"
|
||||
#define D_LEVEL_01 "úroveň 0-1"
|
||||
#define D_SERIAL_LOGGING_DISABLED "Logování na sériovém portu ukončeno"
|
||||
#define D_SYSLOG_LOGGING_REENABLED "Obnoven zápis do Syslog"
|
||||
|
||||
#define D_SET_BAUDRATE_TO "Nastavení rychlosti přenosu na"
|
||||
#define D_RECEIVED_TOPIC "Přijatý topic"
|
||||
#define D_DATA_SIZE "Velikost dat"
|
||||
#define D_ANALOG_INPUT "Analogový vstup"
|
||||
|
||||
// support.ino
|
||||
#define D_OSWATCH "osWatch"
|
||||
#define D_BLOCKED_LOOP "Zablokování smyčky"
|
||||
#define D_WPS_FAILED_WITH_STATUS "Chyba WPSconfig se statusem"
|
||||
#define D_ACTIVE_FOR_3_MINUTES "aktivní 3 minuty"
|
||||
#define D_FAILED_TO_START "nepodařilo se spustit"
|
||||
#define D_PATCH_ISSUE_2186 "Chyba 2186"
|
||||
#define D_CONNECTING_TO_AP "Připojování k AP"
|
||||
#define D_IN_MODE "v módu"
|
||||
#define D_CONNECT_FAILED_NO_IP_ADDRESS "Chyba připojení, nebyla obdržena IP adresa"
|
||||
#define D_CONNECT_FAILED_AP_NOT_REACHED "Chyba připojení, nedostupný AP"
|
||||
#define D_CONNECT_FAILED_WRONG_PASSWORD "Chyba připojení, nesprávné heslo pro AP"
|
||||
#define D_CONNECT_FAILED_AP_TIMEOUT "Chyba připojení, uplynul AP timeout"
|
||||
#define D_ATTEMPTING_CONNECTION "Připojování..."
|
||||
#define D_CHECKING_CONNECTION "Zkouška spojení..."
|
||||
#define D_QUERY_DONE "Vyslání dotazu. Nalezena služba MQTT"
|
||||
#define D_MQTT_SERVICE_FOUND "Služba MQTT byla nalezena"
|
||||
#define D_FOUND_AT "znalezeno v"
|
||||
#define D_SYSLOG_HOST_NOT_FOUND "Syslog Host nebyl nalezen"
|
||||
|
||||
// settings.ino
|
||||
#define D_SAVED_TO_FLASH_AT "Uloženo do paměti flash v"
|
||||
#define D_LOADED_FROM_FLASH_AT "Staženo z paměti flash z"
|
||||
#define D_USE_DEFAULTS "Použij defaultní hodnoty"
|
||||
#define D_ERASED_SECTOR "Smazaný sektor"
|
||||
|
||||
// webserver.ino
|
||||
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "Firmware MINIMÁLNÍ - prosím zaktualizujte"
|
||||
#define D_WEBSERVER_ACTIVE_ON "Aktivní Web server"
|
||||
#define D_WITH_IP_ADDRESS "na IP adrese"
|
||||
#define D_WEBSERVER_STOPPED "Web server zastaven"
|
||||
#define D_FILE_NOT_FOUND "Soubor nebyl nalezen"
|
||||
#define D_REDIRECTED "Přesměrování na vlastní portál"
|
||||
#define D_WIFIMANAGER_SET_ACCESSPOINT_AND_STATION "Wi-Fi manager nastaví AP a zachová STA"
|
||||
#define D_WIFIMANAGER_SET_ACCESSPOINT "Wi-Fi manager nastaví Access Point"
|
||||
#define D_TRYING_TO_CONNECT "Zkouším připojit zařízení k síti"
|
||||
|
||||
#define D_RESTART_IN "Restart"
|
||||
#define D_SECONDS "sekund"
|
||||
#define D_DEVICE_WILL_RESTART "Zařízení bude zrestartováno během několika sekund"
|
||||
#define D_BUTTON_TOGGLE "Přepínač"
|
||||
#define D_CONFIGURATION "Nastavení"
|
||||
#define D_INFORMATION "Informace"
|
||||
#define D_FIRMWARE_UPGRADE "Aktualizace firmware"
|
||||
#define D_CONSOLE "Konzole"
|
||||
#define D_CONFIRM_RESTART "Potvrzení restartu"
|
||||
|
||||
#define D_CONFIGURE_MODULE "Nastavení modulu"
|
||||
#define D_CONFIGURE_WIFI "Nastavení WiFi"
|
||||
#define D_CONFIGURE_MQTT "Nastavení MQTT"
|
||||
#define D_CONFIGURE_DOMOTICZ "Nastavení Domoticz"
|
||||
#define D_CONFIGURE_LOGGING "Nastavení logování"
|
||||
#define D_CONFIGURE_OTHER "Jiná nastavení"
|
||||
#define D_CONFIRM_RESET_CONFIGURATION "Potvrzení resetu nastavení"
|
||||
#define D_RESET_CONFIGURATION "Reset nastavení"
|
||||
#define D_BACKUP_CONFIGURATION "Záloha nastavení"
|
||||
#define D_RESTORE_CONFIGURATION "Obnovení nastavení"
|
||||
#define D_MAIN_MENU "Hlavní menu"
|
||||
|
||||
#define D_MODULE_PARAMETERS "Nastavení modulu"
|
||||
#define D_MODULE_TYPE "Typ modulu"
|
||||
#define D_GPIO "GPIO"
|
||||
#define D_SERIAL_IN "Serial In"
|
||||
#define D_SERIAL_OUT "Serial Out"
|
||||
|
||||
#define D_WIFI_PARAMETERS "Nastavení WiFi"
|
||||
#define D_SCAN_FOR_WIFI_NETWORKS "Scan sítí WiFi"
|
||||
#define D_SCAN_DONE "Scan dokončen"
|
||||
#define D_NO_NETWORKS_FOUND "Síť nebyla nalezena"
|
||||
#define D_REFRESH_TO_SCAN_AGAIN "Zopakovat scan"
|
||||
#define D_DUPLICATE_ACCESSPOINT "Kopie AP"
|
||||
#define D_SKIPPING_LOW_QUALITY "Přeskočení z důvodu kvality signálu"
|
||||
#define D_RSSI "RSSI"
|
||||
#define D_WEP "WEP"
|
||||
#define D_WPA_PSK "WPA PSK"
|
||||
#define D_WPA2_PSK "WPA2 PSK"
|
||||
#define D_AP1_SSID "AP1 SSID"
|
||||
#define D_AP1_PASSWORD "Heslo AP1"
|
||||
#define D_AP2_SSID "AP2 SSID"
|
||||
#define D_AP2_PASSWORD "Heslo AP2"
|
||||
|
||||
#define D_MQTT_PARAMETERS "Nastavení MQTT"
|
||||
#define D_CLIENT "Klient"
|
||||
#define D_FULL_TOPIC "Celý topic"
|
||||
|
||||
#define D_LOGGING_PARAMETERS "Volba logování"
|
||||
#define D_SERIAL_LOG_LEVEL "Seriová úroveň logu"
|
||||
#define D_WEB_LOG_LEVEL "Webová úroveň logu"
|
||||
#define D_SYS_LOG_LEVEL "Systemová úroveň logu"
|
||||
#define D_MORE_DEBUG "Více debug informací"
|
||||
#define D_SYSLOG_HOST "Syslog host"
|
||||
#define D_SYSLOG_PORT "Syslog port"
|
||||
#define D_TELEMETRY_PERIOD "Interval telemetrie"
|
||||
|
||||
#define D_OTHER_PARAMETERS "Další nastavení"
|
||||
#define D_WEB_ADMIN_PASSWORD "Heslo Web administrátora"
|
||||
#define D_MQTT_ENABLE "MQTT aktivní"
|
||||
#define D_FRIENDLY_NAME "Friendly Name"
|
||||
#define D_BELKIN_WEMO "Belkin WeMo"
|
||||
#define D_HUE_BRIDGE "Hue Bridge"
|
||||
#define D_SINGLE_DEVICE "single device"
|
||||
#define D_MULTI_DEVICE "multi device"
|
||||
|
||||
#define D_SAVE_CONFIGURATION "Ulož nastavení"
|
||||
#define D_CONFIGURATION_SAVED "Nastavení uloženo"
|
||||
#define D_CONFIGURATION_RESET "Nastavení resetováno"
|
||||
|
||||
#define D_PROGRAM_VERSION "Verze programu"
|
||||
#define D_BUILD_DATE_AND_TIME "Datum a čas kompilace"
|
||||
#define D_CORE_AND_SDK_VERSION "Verze Core/SDK"
|
||||
#define D_FLASH_WRITE_COUNT "Počet zápisů do paměti"
|
||||
#define D_MAC_ADDRESS "Adresa MAC"
|
||||
#define D_MQTT_HOST "Host MQTT"
|
||||
#define D_MQTT_PORT "Port MQTT"
|
||||
#define D_MQTT_CLIENT "Klient MQTT"
|
||||
#define D_MQTT_USER "Uživatel MQTT"
|
||||
#define D_MQTT_TOPIC "Topic MQTT"
|
||||
#define D_MQTT_GROUP_TOPIC "Topic skupiny MQTT"
|
||||
#define D_MQTT_FULL_TOPIC "Celý topic MQTT"
|
||||
#define D_MDNS_DISCOVERY "Získávání mDNS"
|
||||
#define D_MDNS_ADVERTISE "Rozesílání mDNS"
|
||||
#define D_ESP_CHIP_ID "ID systému ESP"
|
||||
#define D_FLASH_CHIP_ID "ID systému paměti flash"
|
||||
#define D_FLASH_CHIP_SIZE "Velikost flash"
|
||||
#define D_FREE_PROGRAM_SPACE "Volné místo pro program"
|
||||
|
||||
#define D_UPGRADE_BY_WEBSERVER "Aktualizace z Web serveru"
|
||||
#define D_OTA_URL "URL OTA"
|
||||
#define D_START_UPGRADE "Start aktualizace"
|
||||
#define D_UPGRADE_BY_FILE_UPLOAD "Aktualizace nahráním souboru"
|
||||
#define D_UPLOAD_STARTED "Nahrávání zahájeno"
|
||||
#define D_UPGRADE_STARTED "Zahájení aktualizace"
|
||||
#define D_UPLOAD_DONE "Nahrávání ukončeno"
|
||||
#define D_UPLOAD_ERR_1 "Soubor nebyl vybrán"
|
||||
#define D_UPLOAD_ERR_2 "Málo místa"
|
||||
#define D_UPLOAD_ERR_3 "Magický byte má hodnotu jinou než 0xE9"
|
||||
#define D_UPLOAD_ERR_4 "Velikost programu je větší než skutečná velikost paměti flash"
|
||||
#define D_UPLOAD_ERR_5 "Chyba nahrávání, nesouhlasí porovnávané bity"
|
||||
#define D_UPLOAD_ERR_6 "Chyba nahrávání. Spuštěn zápis do logu na úrovni 3"
|
||||
#define D_UPLOAD_ERR_7 "Nahrávání přerušeno"
|
||||
#define D_UPLOAD_ERR_8 "Špatný soubor"
|
||||
#define D_UPLOAD_ERR_9 "Soubor je příliš velký"
|
||||
#define D_UPLOAD_ERROR_CODE "Chyba nahrávání"
|
||||
|
||||
#define D_ENTER_COMMAND "Vlož příkaz"
|
||||
#define D_ENABLE_WEBLOG_FOR_RESPONSE "Zapni úroveň 2 zápisu Weblog, pokud je očekávána odpověď"
|
||||
#define D_NEED_USER_AND_PASSWORD "Vyžadován uživatel=<username>&heslo=<password>"
|
||||
|
||||
// xdrv_00_mqtt.ino
|
||||
#define D_FINGERPRINT "Verifikuj otisk TLS..."
|
||||
#define D_TLS_CONNECT_FAILED_TO "Nepřipojeno TLS do"
|
||||
#define D_RETRY_IN "Zopakuji za"
|
||||
#define D_VERIFIED "Ověřeno otisk "
|
||||
#define D_INSECURE "Nesprávné připojení z důvodu chybného otisku TLS"
|
||||
#define D_CONNECT_FAILED_TO "Spojení se nepodařilo navázat"
|
||||
|
||||
// xdrv_wemohue.ino
|
||||
#define D_MULTICAST_DISABLED "Multicast je vypnutý"
|
||||
#define D_MULTICAST_REJOINED "Multicast opět připojený"
|
||||
#define D_MULTICAST_JOIN_FAILED "Multicast neúspěšný"
|
||||
#define D_FAILED_TO_SEND_RESPONSE "Nepodařilo se odeslat odpověď"
|
||||
|
||||
#define D_WEMO "WeMo"
|
||||
#define D_WEMO_BASIC_EVENT "WeMo základní událost"
|
||||
#define D_WEMO_EVENT_SERVICE "WeMo servisní událost"
|
||||
#define D_WEMO_META_SERVICE "WeMo meta událost"
|
||||
#define D_WEMO_SETUP "WeMo setup"
|
||||
#define D_RESPONSE_SENT "Odpověď odeslána"
|
||||
|
||||
#define D_HUE "Hue"
|
||||
#define D_HUE_BRIDGE_SETUP "Hue setup"
|
||||
#define D_HUE_API_NOT_IMPLEMENTED "Hue API není implementováno"
|
||||
#define D_HUE_API "Hue API"
|
||||
#define D_HUE_POST_ARGS "Hue POST args"
|
||||
#define D_3_RESPONSE_PACKETS_SENT "3 pakety odpovědi odeslány"
|
||||
|
||||
// xdrv_05_domoticz.ino
|
||||
#define D_DOMOTICZ_PARAMETERS "Nastavení Domoticz"
|
||||
#define D_DOMOTICZ_IDX "Idx"
|
||||
#define D_DOMOTICZ_KEY_IDX "Key idx"
|
||||
#define D_DOMOTICZ_SWITCH_IDX "Spinac idx"
|
||||
#define D_DOMOTICZ_SENSOR_IDX "Sensor idx"
|
||||
#define D_DOMOTICZ_TEMP "Temp"
|
||||
#define D_DOMOTICZ_TEMP_HUM "Temp,Vlhk"
|
||||
#define D_DOMOTICZ_TEMP_HUM_BARO "Temp,Vlhk,Tlak"
|
||||
#define D_DOMOTICZ_POWER_ENERGY "Příkon,Energie"
|
||||
#define D_DOMOTICZ_ILLUMINANCE "Osvětlení"
|
||||
#define D_DOMOTICZ_COUNT "Počítadlo/PM1"
|
||||
#define D_DOMOTICZ_VOLTAGE "Napětí/PM2,5"
|
||||
#define D_DOMOTICZ_CURRENT "Proud/PM10"
|
||||
#define D_DOMOTICZ_AIRQUALITY "AirQuality"
|
||||
#define D_DOMOTICZ_UPDATE_TIMER "Aktualizace stopek"
|
||||
|
||||
// xdrv_09_timers.ino
|
||||
#define D_CONFIGURE_TIMER "Nastavení Časovače"
|
||||
#define D_TIMER_PARAMETERS "Časovač"
|
||||
#define D_TIMER_ARM "Aktivní"
|
||||
#define D_TIMER_TIME "Čas"
|
||||
#define D_TIMER_DAYS "Dny"
|
||||
#define D_TIMER_REPEAT "Opakovat"
|
||||
#define D_TIMER_OUTPUT "Výstup"
|
||||
#define D_TIMER_ACTION "Napájení"
|
||||
|
||||
// xdrv_10_knx.ino
|
||||
#define D_CONFIGURE_KNX "Nastavení KNX"
|
||||
#define D_KNX_PARAMETERS "KNX parametry"
|
||||
#define D_KNX_GENERAL_CONFIG "Obecné"
|
||||
#define D_KNX_PHYSICAL_ADDRESS "Fyzická adresa"
|
||||
#define D_KNX_PHYSICAL_ADDRESS_NOTE "( Musí být jedinečná v síti KNX )"
|
||||
#define D_KNX_ENABLE "Povol KNX"
|
||||
#define D_KNX_GROUP_ADDRESS_TO_WRITE "Data k odeslání na skupinové adresy"
|
||||
#define D_ADD "Přidej"
|
||||
#define D_DELETE "Smaž"
|
||||
#define D_REPLY "Odpověď"
|
||||
#define D_KNX_GROUP_ADDRESS_TO_READ "Skupinové adresy pro příjem dat z"
|
||||
#define D_LOG_KNX "KNX: "
|
||||
#define D_RECEIVED_FROM "Přijato z"
|
||||
#define D_KNX_COMMAND_WRITE "Zapiš"
|
||||
#define D_KNX_COMMAND_READ "Čti"
|
||||
#define D_KNX_COMMAND_OTHER "Jiné"
|
||||
#define D_SENT_TO "pošli"
|
||||
#define D_KNX_WARNING "Skupinová adresa ( 0 / 0 / 0 ) je rezervována a nemůže být použita."
|
||||
|
||||
// xdrv_03_energy.ino
|
||||
#define D_ENERGY_TODAY "Spotřeba Dnes"
|
||||
#define D_ENERGY_YESTERDAY "Spotřeba Včera"
|
||||
#define D_ENERGY_TOTAL "Celková spotřeba"
|
||||
|
||||
// xsns_05_ds18b20.ino
|
||||
#define D_SENSOR_BUSY "Sensor DS18x20 obsazen"
|
||||
#define D_SENSOR_CRC_ERROR "Sensor DS18x20 chyba CRC"
|
||||
#define D_SENSORS_FOUND "Nalezen sensor DS18x20"
|
||||
|
||||
// xsns_06_dht.ino
|
||||
#define D_TIMEOUT_WAITING_FOR "Čekání na"
|
||||
#define D_START_SIGNAL_LOW "nízký startovní signál"
|
||||
#define D_START_SIGNAL_HIGH "vysoký startovní signál"
|
||||
#define D_PULSE "impuls"
|
||||
#define D_CHECKSUM_FAILURE "Chybný kontrolní součet"
|
||||
|
||||
// xsns_07_sht1x.ino
|
||||
#define D_SENSOR_DID_NOT_ACK_COMMAND "Sensor neobdržel příkaz ACK"
|
||||
#define D_SHT1X_FOUND "SHT1X nalezen"
|
||||
|
||||
// xsns_18_pms5003.ino
|
||||
#define D_STANDARD_CONCENTRATION "CF-1 PM" // Standard Particle CF-1 Particle Matter
|
||||
#define D_ENVIRONMENTAL_CONCENTRATION "PM" // Environmetal Particle Matter
|
||||
#define D_PARTICALS_BEYOND "částic"
|
||||
|
||||
// sonoff_template.h
|
||||
#define D_SENSOR_NONE "Není"
|
||||
#define D_SENSOR_DHT11 "DHT11"
|
||||
#define D_SENSOR_AM2301 "AM2301"
|
||||
#define D_SENSOR_SI7021 "SI7021"
|
||||
#define D_SENSOR_DS18X20 "DS18x20"
|
||||
#define D_SENSOR_I2C_SCL "I2C SCL"
|
||||
#define D_SENSOR_I2C_SDA "I2C SDA"
|
||||
#define D_SENSOR_WS2812 "WS2812"
|
||||
#define D_SENSOR_IRSEND "IRsend"
|
||||
#define D_SENSOR_SWITCH "Spínač" // Suffix "1"
|
||||
#define D_SENSOR_BUTTON "Tlačítko" // Suffix "1"
|
||||
#define D_SENSOR_RELAY "Relé" // Suffix "1i"
|
||||
#define D_SENSOR_LED "Led" // Suffix "1i"
|
||||
#define D_SENSOR_PWM "PWM" // Suffix "1",
|
||||
#define D_SENSOR_COUNTER "Počítadlo" // Suffix "1"
|
||||
#define D_SENSOR_IRRECV "IRrecv"
|
||||
#define D_SENSOR_MHZ_RX "MHZ Rx"
|
||||
#define D_SENSOR_MHZ_TX "MHZ Tx"
|
||||
#define D_SENSOR_PZEM_RX "PZEM Rx"
|
||||
#define D_SENSOR_PZEM_TX "PZEM Tx"
|
||||
#define D_SENSOR_SAIR_RX "SAir Rx"
|
||||
#define D_SENSOR_SAIR_TX "SAir Tx"
|
||||
#define D_SENSOR_SPI_CS "SPI CS"
|
||||
#define D_SENSOR_SPI_DC "SPI DC"
|
||||
#define D_SENSOR_BACKLIGHT "BkLight"
|
||||
#define D_SENSOR_PMS5003 "PMS5003"
|
||||
#define D_SENSOR_SDS0X1 "SDS0X1"
|
||||
#define D_SENSOR_SBR_RX "SerBr Rx"
|
||||
#define D_SENSOR_SBR_TX "SerBr Tx"
|
||||
#define D_SENSOR_SR04_TRIG "SR04 Tri"
|
||||
#define D_SENSOR_SR04_ECHO "SR04 Ech"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
#define D_UNIT_CENTIMETER "cm"
|
||||
#define D_UNIT_HOUR "hod"
|
||||
#define D_UNIT_KILOOHM "kOhm"
|
||||
#define D_UNIT_KILOWATTHOUR "kWh"
|
||||
#define D_UNIT_LUX "lx"
|
||||
#define D_UNIT_MICROGRAM_PER_CUBIC_METER "ug/m3"
|
||||
#define D_UNIT_MICROMETER "um"
|
||||
#define D_UNIT_MICROSECOND "us"
|
||||
#define D_UNIT_MILLIAMPERE "mA"
|
||||
#define D_UNIT_MILLISECOND "ms"
|
||||
#define D_UNIT_MINUTE "min"
|
||||
#define D_UNIT_PARTS_PER_BILLION "ppb"
|
||||
#define D_UNIT_PARTS_PER_DECILITER "ppd"
|
||||
#define D_UNIT_PARTS_PER_MILLION "ppm"
|
||||
#define D_UNIT_PRESSURE "hPa"
|
||||
#define D_UNIT_SECOND "sec"
|
||||
#define D_UNIT_SECTORS "sektory"
|
||||
#define D_UNIT_VOLT "V"
|
||||
#define D_UNIT_WATT "W"
|
||||
#define D_UNIT_WATTHOUR "Wh"
|
||||
|
||||
// Log message prefix
|
||||
#define D_LOG_APPLICATION "APP: " // Application
|
||||
#define D_LOG_BRIDGE "BRG: " // Bridge
|
||||
#define D_LOG_CONFIG "CFG: " // Settings
|
||||
#define D_LOG_COMMAND "CMD: " // Command
|
||||
#define D_LOG_DEBUG "DBG: " // Debug
|
||||
#define D_LOG_DHT "DHT: " // DHT sensor
|
||||
#define D_LOG_DOMOTICZ "DOM: " // Domoticz
|
||||
#define D_LOG_DSB "DSB: " // DS18xB20 sensor
|
||||
#define D_LOG_HTTP "HTP: " // HTTP webserver
|
||||
#define D_LOG_I2C "I2C: " // I2C
|
||||
#define D_LOG_IRR "IRR: " // Infra Red Received
|
||||
#define D_LOG_LOG "LOG: " // Logging
|
||||
#define D_LOG_MODULE "MOD: " // Module
|
||||
#define D_LOG_MDNS "DNS: " // mDNS
|
||||
#define D_LOG_MQTT "MQT: " // MQTT
|
||||
#define D_LOG_OTHER "OTH: " // Other
|
||||
#define D_LOG_RESULT "RSL: " // Result
|
||||
#define D_LOG_RFR "RFR: " // RF Received
|
||||
#define D_LOG_SERIAL "SER: " // Serial
|
||||
#define D_LOG_SHT1 "SHT: " // SHT1x sensor
|
||||
#define D_LOG_UPLOAD "UPL: " // Upload
|
||||
#define D_LOG_UPNP "UPP: " // UPnP
|
||||
#define D_LOG_WIFI "WIF: " // Wifi
|
||||
|
||||
#endif // _LANGUAGE_CS_CZ_H_
|
|
@ -28,10 +28,14 @@
|
|||
* Use online command StateText to translate ON, OFF, HOLD and TOGGLE.
|
||||
* Use online command Prefix to translate cmnd, stat and tele.
|
||||
*
|
||||
* Updated until v5.12.0l
|
||||
\*********************************************************************/
|
||||
|
||||
//#define LANGUAGE_MODULE_NAME // Enable to display "Module Generic" (ie Spanish), Disable to display "Generic Module" (ie English)
|
||||
|
||||
// HTML (ISO 639-1) Language Code
|
||||
#define D_HTML_LANGUAGE "de"
|
||||
|
||||
// "2017-03-07T11:08:02" - ISO8601:2004
|
||||
#define D_YEAR_MONTH_SEPARATOR "."
|
||||
#define D_MONTH_DAY_SEPARATOR "."
|
||||
|
@ -39,8 +43,8 @@
|
|||
#define D_HOUR_MINUTE_SEPARATOR ":"
|
||||
#define D_MINUTE_SECOND_SEPARATOR ":"
|
||||
|
||||
#define D_DAY3LIST "SonMonDieMitDonFriSam"
|
||||
#define D_MONTH3LIST "JanFebMaeAprMaiJunJulAugSepOktNovDez"
|
||||
#define D_DAY3LIST "So Mo Di Mi Do Fr Sa "
|
||||
#define D_MONTH3LIST "JanFebMärAprMaiJunJulAugSepOktNovDez"
|
||||
|
||||
// Non JSON decimal separator
|
||||
#define D_DECIMAL_SEPARATOR "."
|
||||
|
@ -71,9 +75,11 @@
|
|||
#define D_DARKLIGHT "dunkel"
|
||||
#define D_DEBUG "debug"
|
||||
#define D_DISABLED "deaktiviert"
|
||||
#define D_DNS_SERVER "DNS Server"
|
||||
#define D_DISTANCE "Abstand"
|
||||
#define D_DNS_SERVER "DNS-Server"
|
||||
#define D_DONE "erledigt"
|
||||
#define D_DST_TIME "DST"
|
||||
#define D_ECO2 "eCO2"
|
||||
#define D_EMULATION "Emulation"
|
||||
#define D_ENABLED "aktiviert"
|
||||
#define D_ERASE "löschen"
|
||||
|
@ -81,7 +87,7 @@
|
|||
#define D_FAHRENHEIT "Fahrenheit"
|
||||
#define D_FAILED "fehlgeschlagen"
|
||||
#define D_FALLBACK "Fallback"
|
||||
#define D_FALLBACK_TOPIC "Fallback topic"
|
||||
#define D_FALLBACK_TOPIC "Fallback-Topic"
|
||||
#define D_FALSE "falsch"
|
||||
#define D_FILE "Datei"
|
||||
#define D_FREE_MEMORY "Freier Arbeitsspeicher"
|
||||
|
@ -96,7 +102,7 @@
|
|||
#define D_INDEX "Index"
|
||||
#define D_INFO "Info"
|
||||
#define D_INITIALIZED "initialisiert"
|
||||
#define D_IP_ADDRESS "IP-Addresse"
|
||||
#define D_IP_ADDRESS "IP-Adresse"
|
||||
#define D_LIGHT "Licht"
|
||||
#define D_LWT "LWT"
|
||||
#define D_MODULE "Modul"
|
||||
|
@ -113,8 +119,8 @@
|
|||
#define D_PORT "Port"
|
||||
#define D_POWER_FACTOR "Leistungsfaktor"
|
||||
#define D_POWERUSAGE "Leistung"
|
||||
#define D_PRESSURE "Druck"
|
||||
#define D_PRESSUREATSEALEVEL "MeeresDruck"
|
||||
#define D_PRESSURE "Luftdruck"
|
||||
#define D_PRESSUREATSEALEVEL "Luftdruck auf Meereshöhe"
|
||||
#define D_PROGRAM_FLASH_SIZE "Ges. Flash Speicher"
|
||||
#define D_PROGRAM_SIZE "Ben. Flash Speicher"
|
||||
#define D_PROJECT "Projekt"
|
||||
|
@ -124,6 +130,7 @@
|
|||
#define D_RESTART_REASON "Grund für Neustart"
|
||||
#define D_RESTORE "Wiederherstellung"
|
||||
#define D_RETAINED "beibehalten"
|
||||
#define D_RULE "Regel"
|
||||
#define D_SAVE "Speichern"
|
||||
#define D_SENSOR "Sensor"
|
||||
#define D_SSID "SSID"
|
||||
|
@ -131,63 +138,59 @@
|
|||
#define D_STD_TIME "STD"
|
||||
#define D_STOP "Stop"
|
||||
#define D_SUBNET_MASK "Subnetzmaske"
|
||||
#define D_SUBSCRIBE_TO "subscribe to"
|
||||
#define D_SUBSCRIBE_TO "abonniere"
|
||||
#define D_SUCCESSFUL "erfolgreich"
|
||||
#define D_SUNRISE "Sonnenaufgang"
|
||||
#define D_SUNSET "Sonnenuntergang"
|
||||
#define D_TEMPERATURE "Temperatur"
|
||||
#define D_TO "zu"
|
||||
#define D_TOGGLE "An/Aus"
|
||||
#define D_TOPIC "topic"
|
||||
#define D_TRANSMIT "Übertragen"
|
||||
#define D_TRUE "wahr"
|
||||
#define D_TVOC "TVOC"
|
||||
#define D_UPGRADE "update"
|
||||
#define D_UPLOAD "Upload"
|
||||
#define D_UPTIME "Laufzeit"
|
||||
#define D_USER "Benutzer"
|
||||
#define D_UTC_TIME "UTC"
|
||||
#define D_UV_LEVEL "UV Level"
|
||||
#define D_UV_LEVEL "UV-Level"
|
||||
#define D_VERSION "Version"
|
||||
#define D_VOLTAGE "Spannung"
|
||||
#define D_WARMLIGHT "warm"
|
||||
#define D_WEB_SERVER "Web-Server"
|
||||
|
||||
// sonoff.ino
|
||||
#define D_WARNING_MINIMAL_VERSION "WARNING This version does not support persistent settings"
|
||||
#define D_WARNING_MINIMAL_VERSION "ACHTUNG: Diese Version unterstützt keine persistenten Einstellungen"
|
||||
#define D_LEVEL_10 "level 1-0"
|
||||
#define D_LEVEL_01 "level 0-1"
|
||||
#define D_SERIAL_LOGGING_DISABLED "Serielles logging deaktiviert"
|
||||
#define D_SYSLOG_LOGGING_REENABLED "Syslog logging reaktiviert"
|
||||
#define D_SERIAL_LOGGING_DISABLED "Serielles Logging deaktiviert"
|
||||
#define D_SYSLOG_LOGGING_REENABLED "Syslog-Logging aktiviert"
|
||||
|
||||
#define D_SET_BAUDRATE_TO "Baudrate eingestellt auf"
|
||||
#define D_SET_BAUDRATE_TO "Setze Baudrate auf"
|
||||
#define D_RECEIVED_TOPIC "empfangenes topic"
|
||||
#define D_DATA_SIZE "Datengröße"
|
||||
#define D_ANALOG_INPUT "Analog"
|
||||
|
||||
#define D_FINGERPRINT "TLS-Fingerabdruck wird verifiziert..."
|
||||
#define D_TLS_CONNECT_FAILED_TO "TLS-Verbindung fehlgeschlagen an"
|
||||
#define D_RETRY_IN "Wiederversuch in"
|
||||
#define D_VERIFIED "verifiziert"
|
||||
#define D_INSECURE "unsichere Verbindung aufgrund ungültigen Fingerabdrucks"
|
||||
#define D_CONNECT_FAILED_TO "Verbindung fehlgeschlagen aufgrund von"
|
||||
|
||||
// support.ino
|
||||
#define D_OSWATCH "osWatch"
|
||||
#define D_BLOCKED_LOOP "Blocked Loop"
|
||||
#define D_BLOCKED_LOOP "Schleife blockiert."
|
||||
#define D_WPS_FAILED_WITH_STATUS "WPS fehlgeschlagen mit Status"
|
||||
#define D_ACTIVE_FOR_3_MINUTES "aktiv für 3 Minuten"
|
||||
#define D_FAILED_TO_START "Starten fehlgeschlagen"
|
||||
#define D_PATCH_ISSUE_2186 "Patch-Problem 2186"
|
||||
#define D_PATCH_ISSUE_2186 "Repariere Problem #2186"
|
||||
#define D_CONNECTING_TO_AP "verbinden mit AP"
|
||||
#define D_IN_MODE "in Modus"
|
||||
#define D_CONNECT_FAILED_NO_IP_ADDRESS "Verbindung fehlgeschlagen da keine IP-Adresse zugeteilt wurde"
|
||||
#define D_CONNECT_FAILED_AP_NOT_REACHED "Verbindung fehlgeschlagen da AP nicht erreicht werden konnte"
|
||||
#define D_CONNECT_FAILED_WRONG_PASSWORD "Verbindung fehlgeschlagen mit AP weil das Passwort falsch ist"
|
||||
#define D_CONNECT_FAILED_AP_TIMEOUT "Verbindung fehlgeschlagen da der AP nicht antwortet (timeout)"
|
||||
#define D_CONNECT_FAILED_NO_IP_ADDRESS "Verbindung fehlgeschlagen, da keine IP-Adresse zugeteilt wurde"
|
||||
#define D_CONNECT_FAILED_AP_NOT_REACHED "Verbindung fehlgeschlagen, da AP nicht erreicht werden konnte"
|
||||
#define D_CONNECT_FAILED_WRONG_PASSWORD "Verbindung fehlgeschlagen, da das Passwort falsch ist"
|
||||
#define D_CONNECT_FAILED_AP_TIMEOUT "Verbindung fehlgeschlagen, da der AP nicht antwortet (timeout)"
|
||||
#define D_ATTEMPTING_CONNECTION "Verbindungsversuch..."
|
||||
#define D_CHECKING_CONNECTION "Prüfe Verbindung..."
|
||||
#define D_QUERY_DONE "Suchanfrage abgeschlossen. MQTT-Services gefunden"
|
||||
#define D_MQTT_SERVICE_FOUND "MQTT-Service gefunden bei"
|
||||
#define D_FOUND_AT "gefunden bei"
|
||||
#define D_SYSLOG_HOST_NOT_FOUND "Syslog Host nicht gefunden"
|
||||
#define D_SYSLOG_HOST_NOT_FOUND "Syslog-Host nicht gefunden"
|
||||
|
||||
// settings.ino
|
||||
#define D_SAVED_TO_FLASH_AT "in Flash gespeichert am"
|
||||
|
@ -228,40 +231,40 @@
|
|||
#define D_RESTORE_CONFIGURATION "Konfiguration wiederherstellen"
|
||||
#define D_MAIN_MENU "Hauptmenü"
|
||||
|
||||
#define D_MODULE_PARAMETERS "Geräte Einstellungen"
|
||||
#define D_MODULE_TYPE "Geräte Typ"
|
||||
#define D_MODULE_PARAMETERS "Geräte-Einstellungen"
|
||||
#define D_MODULE_TYPE "Gerätetyp"
|
||||
#define D_GPIO "GPIO"
|
||||
#define D_SERIAL_IN "serieller Eingang [serial in]"
|
||||
#define D_SERIAL_OUT "serieller Ausgang [serial out]"
|
||||
|
||||
#define D_WIFI_PARAMETERS "WLAN Einstellungen"
|
||||
#define D_WIFI_PARAMETERS "WLAN-Einstellungen"
|
||||
#define D_SCAN_FOR_WIFI_NETWORKS "WLAN-Netzwerk suchen und auswählen"
|
||||
#define D_SCAN_DONE "Suche abgeschlossen"
|
||||
#define D_NO_NETWORKS_FOUND "Keine Netzwerke gefunden"
|
||||
#define D_REFRESH_TO_SCAN_AGAIN "Aktualisieren um erneut zu suchen"
|
||||
#define D_REFRESH_TO_SCAN_AGAIN "Aktualisieren, um erneut zu suchen"
|
||||
#define D_DUPLICATE_ACCESSPOINT "AccessPoint duplizieren"
|
||||
#define D_SKIPPING_LOW_QUALITY "überspringe wegen niedriger Qualität"
|
||||
#define D_RSSI "RSSI"
|
||||
#define D_WEP "WEP"
|
||||
#define D_WPA_PSK "WPA PSK"
|
||||
#define D_WPA2_PSK "WPA2 PSK"
|
||||
#define D_WPA_PSK "WPA-PSK"
|
||||
#define D_WPA2_PSK "WPA2-PSK"
|
||||
#define D_AP1_SSID "WLAN 1 - SSID"
|
||||
#define D_AP1_PASSWORD "WLAN 1 - Passwort"
|
||||
#define D_AP2_SSID "WLAN 2 - SSID"
|
||||
#define D_AP2_PASSWORD "WLAN 2 - Passwort"
|
||||
|
||||
#define D_MQTT_PARAMETERS "MQTT Einstellungen"
|
||||
#define D_MQTT_PARAMETERS "MQTT-Einstellungen"
|
||||
#define D_CLIENT "client"
|
||||
#define D_FULL_TOPIC "full topic"
|
||||
|
||||
#define D_LOGGING_PARAMETERS "Logging Einstellungen"
|
||||
#define D_SERIAL_LOG_LEVEL "Seriell Log level"
|
||||
#define D_WEB_LOG_LEVEL "Web Log level"
|
||||
#define D_SYS_LOG_LEVEL "Sys Log level"
|
||||
#define D_LOGGING_PARAMETERS "Logging-Einstellungen"
|
||||
#define D_SERIAL_LOG_LEVEL "Seriell-Log Level"
|
||||
#define D_WEB_LOG_LEVEL "Web-Log Level"
|
||||
#define D_SYS_LOG_LEVEL "Sys-Log Level"
|
||||
#define D_MORE_DEBUG "More debug"
|
||||
#define D_SYSLOG_HOST "Sys Log Host"
|
||||
#define D_SYSLOG_PORT "Sys Log Port"
|
||||
#define D_TELEMETRY_PERIOD "Telemetry period"
|
||||
#define D_SYSLOG_HOST "Sys-Log Host"
|
||||
#define D_SYSLOG_PORT "Sys-Log Port"
|
||||
#define D_TELEMETRY_PERIOD "Telemetrieperiode"
|
||||
|
||||
#define D_OTHER_PARAMETERS "Sonstige Einstellungen"
|
||||
#define D_WEB_ADMIN_PASSWORD "Passwort für Web Oberfläche"
|
||||
|
@ -298,7 +301,7 @@
|
|||
#define D_UPGRADE_BY_WEBSERVER "Update über Web-Server"
|
||||
#define D_OTA_URL "OTA-URL"
|
||||
#define D_START_UPGRADE "Update starten"
|
||||
#define D_UPGRADE_BY_FILE_UPLOAD "Update Datei hochladen"
|
||||
#define D_UPGRADE_BY_FILE_UPLOAD "Update-Datei hochladen"
|
||||
#define D_UPLOAD_STARTED "Upload gestartet"
|
||||
#define D_UPGRADE_STARTED "Update gestartet"
|
||||
#define D_UPLOAD_DONE "Upload abgeschlossen"
|
||||
|
@ -315,7 +318,15 @@
|
|||
|
||||
#define D_ENTER_COMMAND "Befehl eingeben"
|
||||
#define D_ENABLE_WEBLOG_FOR_RESPONSE "Aktivere Web Log Level 2 falls Reaktion erwartet"
|
||||
#define D_NEED_USER_AND_PASSWORD "Benutzer benötigt=<Benutzername>&password=<Passwort>"
|
||||
#define D_NEED_USER_AND_PASSWORD "Benötige user=<Benutzername>&password=<Passwort>"
|
||||
|
||||
// xdrv_00_mqtt.ino
|
||||
#define D_FINGERPRINT "TLS-Fingerabdruck wird verifiziert..."
|
||||
#define D_TLS_CONNECT_FAILED_TO "TLS-Verbindung fehlgeschlagen an"
|
||||
#define D_RETRY_IN "Wiederversuch in"
|
||||
#define D_VERIFIED "verifiziert mit Fingerabdruck"
|
||||
#define D_INSECURE "unsichere Verbindung aufgrund ungültigen Fingerabdrucks"
|
||||
#define D_CONNECT_FAILED_TO "Verbindung fehlgeschlagen aufgrund von"
|
||||
|
||||
// xdrv_wemohue.ino
|
||||
#define D_MULTICAST_DISABLED "Multicast deaktiviert"
|
||||
|
@ -332,13 +343,13 @@
|
|||
|
||||
#define D_HUE "Hue"
|
||||
#define D_HUE_BRIDGE_SETUP "Hue-Setup"
|
||||
#define D_HUE_API_NOT_IMPLEMENTED "Hue API nicht implementiert"
|
||||
#define D_HUE_API "Hue API"
|
||||
#define D_HUE_POST_ARGS "Hue POST args"
|
||||
#define D_HUE_API_NOT_IMPLEMENTED "Hue-API nicht implementiert"
|
||||
#define D_HUE_API "Hue-API"
|
||||
#define D_HUE_POST_ARGS "Hue POST-Argumente"
|
||||
#define D_3_RESPONSE_PACKETS_SENT "3 Antwortpakete gesendet"
|
||||
|
||||
// xdrv_05_domoticz.ino
|
||||
#define D_DOMOTICZ_PARAMETERS "Domoticz parameters"
|
||||
#define D_DOMOTICZ_PARAMETERS "Domoticz-Parameter"
|
||||
#define D_DOMOTICZ_IDX "Idx"
|
||||
#define D_DOMOTICZ_KEY_IDX "Key idx"
|
||||
#define D_DOMOTICZ_SWITCH_IDX "Switch idx"
|
||||
|
@ -348,11 +359,41 @@
|
|||
#define D_DOMOTICZ_TEMP_HUM_BARO "Temp,Hum,Baro"
|
||||
#define D_DOMOTICZ_POWER_ENERGY "Power,Energy"
|
||||
#define D_DOMOTICZ_ILLUMINANCE "Illuminance"
|
||||
#define D_DOMOTICZ_COUNT "Count"
|
||||
#define D_DOMOTICZ_VOLTAGE "Voltage"
|
||||
#define D_DOMOTICZ_CURRENT "Current"
|
||||
#define D_DOMOTICZ_COUNT "Count/PM1"
|
||||
#define D_DOMOTICZ_VOLTAGE "Voltage/PM2.5"
|
||||
#define D_DOMOTICZ_CURRENT "Current/PM10"
|
||||
#define D_DOMOTICZ_AIRQUALITY "AirQuality"
|
||||
#define D_DOMOTICZ_UPDATE_TIMER "Update timer"
|
||||
#define D_DOMOTICZ_UPDATE_TIMER "Update Zeitplan"
|
||||
|
||||
// xdrv_09_timers.ino
|
||||
#define D_CONFIGURE_TIMER "Zeitplan konfigurieren"
|
||||
#define D_TIMER_PARAMETERS "Zeitplan-Einstellungen"
|
||||
#define D_TIMER_ARM "Aktiv"
|
||||
#define D_TIMER_TIME "Uhrzeit"
|
||||
#define D_TIMER_DAYS "Wochentage"
|
||||
#define D_TIMER_REPEAT "Wiederholen"
|
||||
#define D_TIMER_OUTPUT "Ausgang"
|
||||
#define D_TIMER_ACTION "Aktion"
|
||||
|
||||
// xdrv_10_knx.ino
|
||||
#define D_CONFIGURE_KNX "Configure KNX"
|
||||
#define D_KNX_PARAMETERS "KNX Parameters"
|
||||
#define D_KNX_GENERAL_CONFIG "General"
|
||||
#define D_KNX_PHYSICAL_ADDRESS "Physical Address"
|
||||
#define D_KNX_PHYSICAL_ADDRESS_NOTE "( Must be unique on the KNX network )"
|
||||
#define D_KNX_ENABLE "Enable KNX"
|
||||
#define D_KNX_GROUP_ADDRESS_TO_WRITE "Data to Send to Group Addresses"
|
||||
#define D_ADD "Add"
|
||||
#define D_DELETE "Delete"
|
||||
#define D_REPLY "Reply"
|
||||
#define D_KNX_GROUP_ADDRESS_TO_READ "Group Addresses to Receive Data from"
|
||||
#define D_LOG_KNX "KNX: "
|
||||
#define D_RECEIVED_FROM "Received from"
|
||||
#define D_KNX_COMMAND_WRITE "Write"
|
||||
#define D_KNX_COMMAND_READ "Read"
|
||||
#define D_KNX_COMMAND_OTHER "Other"
|
||||
#define D_SENT_TO "sent to"
|
||||
#define D_KNX_WARNING "The group address ( 0 / 0 / 0 ) is reserved and can not be used."
|
||||
|
||||
// xdrv_03_energy.ino
|
||||
#define D_ENERGY_TODAY "Energie heute"
|
||||
|
@ -365,7 +406,7 @@
|
|||
#define D_SENSORS_FOUND "Sensor gefunden"
|
||||
|
||||
// xsns_06_dht.ino
|
||||
#define D_TIMEOUT_WAITING_FOR "Timeout wartet auf"
|
||||
#define D_TIMEOUT_WAITING_FOR "Timeout während Warten auf"
|
||||
#define D_START_SIGNAL_LOW "Startausschlag niedrig"
|
||||
#define D_START_SIGNAL_HIGH "Startausschlag hoch"
|
||||
#define D_PULSE "pulse"
|
||||
|
@ -407,9 +448,15 @@
|
|||
#define D_SENSOR_SPI_DC "SPI DC"
|
||||
#define D_SENSOR_BACKLIGHT "BkLight"
|
||||
#define D_SENSOR_PMS5003 "PMS5003"
|
||||
#define D_SENSOR_SDS0X1 "SDS0X1"
|
||||
#define D_SENSOR_SBR_RX "SerBr Rx"
|
||||
#define D_SENSOR_SBR_TX "SerBr Tx"
|
||||
#define D_SENSOR_SR04_TRIG "SR04 Tri"
|
||||
#define D_SENSOR_SR04_ECHO "SR04 Ech"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
#define D_UNIT_CENTIMETER "cm"
|
||||
#define D_UNIT_HOUR "h"
|
||||
#define D_UNIT_KILOOHM "kOhm"
|
||||
#define D_UNIT_KILOWATTHOUR "kWh"
|
||||
|
@ -420,6 +467,7 @@
|
|||
#define D_UNIT_MILLIAMPERE "mA"
|
||||
#define D_UNIT_MILLISECOND "ms"
|
||||
#define D_UNIT_MINUTE "min"
|
||||
#define D_UNIT_PARTS_PER_BILLION "ppb"
|
||||
#define D_UNIT_PARTS_PER_DECILITER "ppd"
|
||||
#define D_UNIT_PARTS_PER_MILLION "ppm"
|
||||
#define D_UNIT_PRESSURE "hPa"
|
||||
|
|
|
@ -0,0 +1,505 @@
|
|||
/*
|
||||
el-GR.h - localization for Greek - Greece for Sonoff-Tasmota
|
||||
|
||||
Copyright (C) 2018 Kan3Nas
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _LANGUAGE_EL_GR_H_
|
||||
#define _LANGUAGE_EL_GR_H_
|
||||
|
||||
/*************************** ATTENTION *******************************\
|
||||
*
|
||||
* Due to memory constraints only UTF-8 is supported.
|
||||
* To save code space keep text as short as possible.
|
||||
* Time and Date provided by SDK can not be localized (yet).
|
||||
* Use online command StateText to translate ON, OFF, HOLD and TOGGLE.
|
||||
* Use online command Prefix to translate cmnd, stat and tele.
|
||||
*
|
||||
* Updated until v5.12.0n
|
||||
\*********************************************************************/
|
||||
|
||||
//#define LANGUAGE_MODULE_NAME // Enable to display "Module Generic" (ie Spanish), Disable to display "Generic Module" (ie English)
|
||||
|
||||
// HTML (ISO 639-1) Language Code
|
||||
#define D_HTML_LANGUAGE "el"
|
||||
|
||||
// "2017-03-07T11:08:02" - ISO8601:2004
|
||||
#define D_YEAR_MONTH_SEPARATOR "-"
|
||||
#define D_MONTH_DAY_SEPARATOR "-"
|
||||
#define D_DATE_TIME_SEPARATOR "T"
|
||||
#define D_HOUR_MINUTE_SEPARATOR ":"
|
||||
#define D_MINUTE_SECOND_SEPARATOR ":"
|
||||
|
||||
#define D_DAY3LIST "ΚυρΔευΤριΤετΠεμΠαρΣαβ"
|
||||
#define D_MONTH3LIST "ΙανΦεβΜαρΑπρΜαϊΙονΙολΑυγΣεπΟκτΝοεΔεκ"
|
||||
|
||||
// Non JSON decimal separator
|
||||
#define D_DECIMAL_SEPARATOR ","
|
||||
|
||||
// Common
|
||||
#define D_ADMIN "Admin"
|
||||
#define D_AIR_QUALITY "Ποιότητα Αέρα"
|
||||
#define D_AP "AP" // Access Point
|
||||
#define D_AS "as"
|
||||
#define D_AUTO "ΑΥΤΟΜΑΤΟ"
|
||||
#define D_BLINK "Αναβοσβήνει"
|
||||
#define D_BLINKOFF "Δεν αναβοσβήνει"
|
||||
#define D_BOOT_COUNT "Αριθμός εκκινήσεων"
|
||||
#define D_BRIGHTLIGHT "Λαμπερό"
|
||||
#define D_BUTTON "Κουμπί"
|
||||
#define D_BY "από" // Written by me
|
||||
#define D_BYTES "Bytes"
|
||||
#define D_CELSIUS "Κελσίου"
|
||||
#define D_CO2 "Διοξείδιο του άνθρακα"
|
||||
#define D_CODE "κώδικας" // Button code
|
||||
#define D_COLDLIGHT "Ψυχρός"
|
||||
#define D_COMMAND "Εντολή"
|
||||
#define D_CONNECTED "Συνδεδεμένο"
|
||||
#define D_COUNT "Μέτρημα"
|
||||
#define D_COUNTER "Μετρητής"
|
||||
#define D_CURRENT "Τάση ρεύματος" // As in Voltage and Current
|
||||
#define D_DATA "Δεδομένα"
|
||||
#define D_DARKLIGHT "Σκούρο"
|
||||
#define D_DEBUG "Debug"
|
||||
#define D_DISABLED "Απενεργοποιημένο"
|
||||
#define D_DISTANCE "Distance"
|
||||
#define D_DNS_SERVER "Διακομιστής DNS"
|
||||
#define D_DONE "Εγινε"
|
||||
#define D_DST_TIME "DST"
|
||||
#define D_ECO2 "eCO2"
|
||||
#define D_EMULATION "Emulation"
|
||||
#define D_ENABLED "Ενεργό"
|
||||
#define D_ERASE "Σβήσιμο"
|
||||
#define D_ERROR "Σφάλμα"
|
||||
#define D_FAHRENHEIT "Φαρενάιτ"
|
||||
#define D_FAILED "Αποτυχία"
|
||||
#define D_FALLBACK "Εφεδρικό"
|
||||
#define D_FALLBACK_TOPIC "Εφεδρικό θέμα"
|
||||
#define D_FALSE "Λάθος"
|
||||
#define D_FILE "Αρχείο"
|
||||
#define D_FREE_MEMORY "Ελεύθερη Μνήμη"
|
||||
#define D_GAS "Γκάζι"
|
||||
#define D_GATEWAY "Πύλη"
|
||||
#define D_GROUP "Ομάδα"
|
||||
#define D_HOST "Host"
|
||||
#define D_HOSTNAME "Hostname"
|
||||
#define D_HUMIDITY "Υγρασία"
|
||||
#define D_ILLUMINANCE "Illuminance"
|
||||
#define D_IMMEDIATE "Φωτεινότητα" // Button immediate
|
||||
#define D_INDEX "Κατάλογος"
|
||||
#define D_INFO "Πληροφορίες"
|
||||
#define D_INITIALIZED "Αρχικό"
|
||||
#define D_IP_ADDRESS "IP Address"
|
||||
#define D_LIGHT "Light"
|
||||
#define D_LWT "LWT"
|
||||
#define D_MODULE "Module"
|
||||
#define D_MQTT "MQTT"
|
||||
#define D_MULTI_PRESS "πολλαπλή πίεση"
|
||||
#define D_NOISE "θόρυβος"
|
||||
#define D_NONE "Κανένα"
|
||||
#define D_OFF "Κλειστό"
|
||||
#define D_OFFLINE "Offline"
|
||||
#define D_OK "Ok"
|
||||
#define D_ON "Ανοιχτό"
|
||||
#define D_ONLINE "Online"
|
||||
#define D_PASSWORD "ΚωδικόςPassword"
|
||||
#define D_PORT "Πόρτα"
|
||||
#define D_POWER_FACTOR "Παράγοντας ισχύος"
|
||||
#define D_POWERUSAGE "Ισχύης"
|
||||
#define D_PRESSURE "Πίεση"
|
||||
#define D_PRESSUREATSEALEVEL "Πίεση στην επιφάνεια της Θάλασσας"
|
||||
#define D_PROGRAM_FLASH_SIZE "Μέγεθος Προγράμματος Flash"
|
||||
#define D_PROGRAM_SIZE "Μέγεθος Προγράμματος"
|
||||
#define D_PROJECT "Έργο"
|
||||
#define D_RECEIVED "Λήψη"
|
||||
#define D_RESTART "Επανεκκίνηση"
|
||||
#define D_RESTARTING "Επανεκκίνηση"
|
||||
#define D_RESTART_REASON "Λόγος Επανεκκίνησης"
|
||||
#define D_RESTORE "επαναφορά"
|
||||
#define D_RETAINED "διατηρούνται"
|
||||
#define D_RULE "Κανόνας"
|
||||
#define D_SAVE "Αποθήκευση"
|
||||
#define D_SENSOR "Σένσορας"
|
||||
#define D_SSID "SSId"
|
||||
#define D_START "Έναρξη"
|
||||
#define D_STD_TIME "STD"
|
||||
#define D_STOP "Στοπ"
|
||||
#define D_SUBNET_MASK "Μάσκα υποδικτύου"
|
||||
#define D_SUBSCRIBE_TO "Εγγραφή στο"
|
||||
#define D_SUCCESSFUL "Επιτυχής"
|
||||
#define D_SUNRISE "Σούρουπο"
|
||||
#define D_SUNSET "Ηλιοβασίλεμα"
|
||||
#define D_TEMPERATURE "Θερμοκρασία"
|
||||
#define D_TO "στο"
|
||||
#define D_TOGGLE "Εναλλαγή"
|
||||
#define D_TOPIC "Θέμα"
|
||||
#define D_TRANSMIT "Μετάδοση"
|
||||
#define D_TRUE "Σωστό"
|
||||
#define D_TVOC "TVOC"
|
||||
#define D_UPGRADE "αναβάθμιση"
|
||||
#define D_UPLOAD "Ανέβασμα"
|
||||
#define D_UPTIME "Uptime"
|
||||
#define D_USER "Χρήστης"
|
||||
#define D_UTC_TIME "UTC"
|
||||
#define D_UV_LEVEL "Επίπεδο UV"
|
||||
#define D_VERSION "Έκδοση"
|
||||
#define D_VOLTAGE "Τάση"
|
||||
#define D_WARMLIGHT "Ζεστό"
|
||||
#define D_WEB_SERVER "Web διακομιστής"
|
||||
|
||||
// sonoff.ino
|
||||
#define D_WARNING_MINIMAL_VERSION "ΠΡΟΕΙΔΟΠΟΙΗΣΗ Αυτή η έκδοση δεν αποθηκεύει τις ρυθμίσεις"
|
||||
#define D_LEVEL_10 "επίπεδο 1-0"
|
||||
#define D_LEVEL_01 "επίπεδο 0-1"
|
||||
#define D_SERIAL_LOGGING_DISABLED "Η σειριακής καταγραφή απενεργοποιήθηκε"
|
||||
#define D_SYSLOG_LOGGING_REENABLED "Η καταγραφή Syslog είναι ενεργοποιημένη"
|
||||
|
||||
#define D_SET_BAUDRATE_TO "Ρύθμιση Baudrate σε"
|
||||
#define D_RECEIVED_TOPIC "Λήψη θεμάτων"
|
||||
#define D_DATA_SIZE "Μέγεθος δεδομένων"
|
||||
#define D_ANALOG_INPUT "Αναλογικό"
|
||||
|
||||
// support.ino
|
||||
#define D_OSWATCH "osWatch"
|
||||
#define D_BLOCKED_LOOP "Blocked Loop"
|
||||
#define D_WPS_FAILED_WITH_STATUS "WPSconfig FAILED with status"
|
||||
#define D_ACTIVE_FOR_3_MINUTES "active for 3 minutes"
|
||||
#define D_FAILED_TO_START "failed to start"
|
||||
#define D_PATCH_ISSUE_2186 "Patch issue 2186"
|
||||
#define D_CONNECTING_TO_AP "Connecting to AP"
|
||||
#define D_IN_MODE "in mode"
|
||||
#define D_CONNECT_FAILED_NO_IP_ADDRESS "Connect failed as no IP address received"
|
||||
#define D_CONNECT_FAILED_AP_NOT_REACHED "Connect failed as AP cannot be reached"
|
||||
#define D_CONNECT_FAILED_WRONG_PASSWORD "Connect failed with AP incorrect password"
|
||||
#define D_CONNECT_FAILED_AP_TIMEOUT "Connect failed with AP timeout"
|
||||
#define D_ATTEMPTING_CONNECTION "Attempting connection..."
|
||||
#define D_CHECKING_CONNECTION "Checking connection..."
|
||||
#define D_QUERY_DONE "Query done. MQTT services found"
|
||||
#define D_MQTT_SERVICE_FOUND "MQTT service found on"
|
||||
#define D_FOUND_AT "found at"
|
||||
#define D_SYSLOG_HOST_NOT_FOUND "Syslog Host not found"
|
||||
|
||||
// settings.ino
|
||||
#define D_SAVED_TO_FLASH_AT "Εγινε flash στην θέση"
|
||||
#define D_LOADED_FROM_FLASH_AT "Φορτώθηκε από την flash στην θέση"
|
||||
#define D_USE_DEFAULTS "Χρήση προεπιλογών"
|
||||
#define D_ERASED_SECTOR "Διαγραμμένος τομέας"
|
||||
|
||||
// webserver.ino
|
||||
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "MINIMAL firmware - παρακαλώ αναβαθμήστε"
|
||||
#define D_WEBSERVER_ACTIVE_ON "Web διακομιστής ενεργός"
|
||||
#define D_WITH_IP_ADDRESS "με διεύθυνση IP"
|
||||
#define D_WEBSERVER_STOPPED "Web διακομιστής σταμάτησε"
|
||||
#define D_FILE_NOT_FOUND "Το αρχείο δεν βρέθηκε"
|
||||
#define D_REDIRECTED "Ανακατεύθυνση σε captive portal"
|
||||
#define D_WIFIMANAGER_SET_ACCESSPOINT_AND_STATION "Wifimanager set AccessPoint and keep Station"
|
||||
#define D_WIFIMANAGER_SET_ACCESSPOINT "Wifimanager set AccessPoint"
|
||||
#define D_TRYING_TO_CONNECT "Προσπάθεια σύνδεσης της συσκευής στο δίκτυο"
|
||||
|
||||
#define D_RESTART_IN "Επανεκκίνηση σε"
|
||||
#define D_SECONDS "δευτερόλεπτα"
|
||||
#define D_DEVICE_WILL_RESTART "Η συσκευή θα ξεκινήσει ξανά σε λίγα δευτερόλεπτα"
|
||||
#define D_BUTTON_TOGGLE "Εναλλαγή"
|
||||
#define D_CONFIGURATION "Ρύθμιση"
|
||||
#define D_INFORMATION "Πληροφορίες"
|
||||
#define D_FIRMWARE_UPGRADE "Αναβάθμιση Firmware"
|
||||
#define D_CONSOLE "Κονσόλα"
|
||||
#define D_CONFIRM_RESTART "Επιβεβαίωση Επανεκκίνησης"
|
||||
|
||||
#define D_CONFIGURE_MODULE "Ρύθμιση Module"
|
||||
#define D_CONFIGURE_WIFI "Ρύθμιση WiFi"
|
||||
#define D_CONFIGURE_MQTT "Ρύθμιση MQTT"
|
||||
#define D_CONFIGURE_DOMOTICZ "Ρύθμιση Domoticz"
|
||||
#define D_CONFIGURE_LOGGING "Ρύθμιση καταγραφής"
|
||||
#define D_CONFIGURE_OTHER "Άλλες Ρυθμίσεις"
|
||||
#define D_CONFIRM_RESET_CONFIGURATION "Confirm Reset Configuration"
|
||||
#define D_RESET_CONFIGURATION "Επαναφορά Ρυθμίσεων"
|
||||
#define D_BACKUP_CONFIGURATION "Αντίγραφα Ασφαλείας Ρυθμίσεων"
|
||||
#define D_RESTORE_CONFIGURATION "Επαναφορά Ρυθμίσεων"
|
||||
#define D_MAIN_MENU "Κεντρικό Μενού"
|
||||
|
||||
#define D_MODULE_PARAMETERS "Παράμετροι Module"
|
||||
#define D_MODULE_TYPE "Είδος Module"
|
||||
#define D_GPIO "GPIO"
|
||||
#define D_SERIAL_IN "Serial In"
|
||||
#define D_SERIAL_OUT "Serial Out"
|
||||
|
||||
#define D_WIFI_PARAMETERS "Παράμετροι Wifi"
|
||||
#define D_SCAN_FOR_WIFI_NETWORKS "Σάρωση για δίκτυα wifi"
|
||||
#define D_SCAN_DONE "Ολοκλήρωση σάρωσης"
|
||||
#define D_NO_NETWORKS_FOUND "Δεν βρέθηκαν δίκτυα"
|
||||
#define D_REFRESH_TO_SCAN_AGAIN "Ανανέωση για επανάληψη σάρωσης"
|
||||
#define D_DUPLICATE_ACCESSPOINT "Duplicate AccessPoint"
|
||||
#define D_SKIPPING_LOW_QUALITY "Παράλειψη λόγω χαμηλού σήματος"
|
||||
#define D_RSSI "RSSI"
|
||||
#define D_WEP "WEP"
|
||||
#define D_WPA_PSK "WPA PSK"
|
||||
#define D_WPA2_PSK "WPA2 PSK"
|
||||
#define D_AP1_SSID "AP1 SSId"
|
||||
#define D_AP1_PASSWORD "AP1 Κωδικός"
|
||||
#define D_AP2_SSID "AP2 SSId"
|
||||
#define D_AP2_PASSWORD "AP2 Κωδικός"
|
||||
|
||||
#define D_MQTT_PARAMETERS "MQTT Παράμετροι"
|
||||
#define D_CLIENT "Πελάτης"
|
||||
#define D_FULL_TOPIC "Full Topic"
|
||||
|
||||
#define D_LOGGING_PARAMETERS "Παράμετροι καταγραφής"
|
||||
#define D_SERIAL_LOG_LEVEL "Επίπεδο καταγραφής Serial"
|
||||
#define D_WEB_LOG_LEVEL "Επίπεδο καταγραφής Web"
|
||||
#define D_SYS_LOG_LEVEL "Επίπεδο καταγραφής Syslog"
|
||||
#define D_MORE_DEBUG "Επιπλέον debug"
|
||||
#define D_SYSLOG_HOST "Υπολογιστής Syslog"
|
||||
#define D_SYSLOG_PORT "Πόρτα Syslog"
|
||||
#define D_TELEMETRY_PERIOD "Χρόνος τηλεμετρίας"
|
||||
|
||||
#define D_OTHER_PARAMETERS "Άλλες Παράμετροι"
|
||||
#define D_WEB_ADMIN_PASSWORD "Web Admin Κωδικός"
|
||||
#define D_MQTT_ENABLE "MQTT Ενεργό"
|
||||
#define D_FRIENDLY_NAME "Φιλικό Όνομα"
|
||||
#define D_BELKIN_WEMO "Belkin WeMo"
|
||||
#define D_HUE_BRIDGE "Hue Bridge"
|
||||
#define D_SINGLE_DEVICE "μονή συσκευή"
|
||||
#define D_MULTI_DEVICE "πολλαπλή συσκευή"
|
||||
|
||||
#define D_SAVE_CONFIGURATION "Αποθήκευση Ρυθμίσεων"
|
||||
#define D_CONFIGURATION_SAVED "Οι ρυθμίσεις αποθηκεύτηκαν"
|
||||
#define D_CONFIGURATION_RESET "Επαναφορά ρυθμίσεων"
|
||||
|
||||
#define D_PROGRAM_VERSION "Εκδοση προγράμματος"
|
||||
#define D_BUILD_DATE_AND_TIME "Ημερομηνία και Ώρα Build"
|
||||
#define D_CORE_AND_SDK_VERSION "Core/SDK Version"
|
||||
#define D_FLASH_WRITE_COUNT "Μετρητής εγγραφών Flash"
|
||||
#define D_MAC_ADDRESS "MAC Address"
|
||||
#define D_MQTT_HOST "MQTT Host"
|
||||
#define D_MQTT_PORT "MQTT Port"
|
||||
#define D_MQTT_CLIENT "MQTT Client"
|
||||
#define D_MQTT_USER "MQTT User"
|
||||
#define D_MQTT_TOPIC "MQTT Topic"
|
||||
#define D_MQTT_GROUP_TOPIC "MQTT Group Topic"
|
||||
#define D_MQTT_FULL_TOPIC "MQTT Full Topic"
|
||||
#define D_MDNS_DISCOVERY "mDNS Discovery"
|
||||
#define D_MDNS_ADVERTISE "mDNS Advertise"
|
||||
#define D_ESP_CHIP_ID "ESP Chip Id"
|
||||
#define D_FLASH_CHIP_ID "Flash Chip Id"
|
||||
#define D_FLASH_CHIP_SIZE "Μέγεθος Flash"
|
||||
#define D_FREE_PROGRAM_SPACE "Ελεύθερος Χώρος Προγράμματος"
|
||||
|
||||
#define D_UPGRADE_BY_WEBSERVER "αναβάθμιση από τον διακομιστή web"
|
||||
#define D_OTA_URL "OTA Url"
|
||||
#define D_START_UPGRADE "Εκκίνηση αναβάθμισης"
|
||||
#define D_UPGRADE_BY_FILE_UPLOAD "Αναβάθμιση με ανέβασμα αρχείου"
|
||||
#define D_UPLOAD_STARTED "Το ανέβασμα ξεκίνησε"
|
||||
#define D_UPGRADE_STARTED "Η αναβάθμιση ξεκίνησε"
|
||||
#define D_UPLOAD_DONE "Το ανέβασμα ολοκληρώθηκε"
|
||||
#define D_UPLOAD_ERR_1 "Δεν έχει επιλεγεί αρχείο"
|
||||
#define D_UPLOAD_ERR_2 "Δεν υπάρχει αρκετός χώρος"
|
||||
#define D_UPLOAD_ERR_3 "Magic byte δεν είναι 0xE9"
|
||||
#define D_UPLOAD_ERR_4 "Το μέγεθος του προγράμματος flash είναι μεγαλύτερο από το πραγματικό μέγεθος του flash"
|
||||
#define D_UPLOAD_ERR_5 "Upload buffer miscompare"
|
||||
#define D_UPLOAD_ERR_6 "Το ανέβασμα απέτυχε. Επιλέξτε επίπεδο καταγραφής 3"
|
||||
#define D_UPLOAD_ERR_7 "Το ανεβάσμα διακόπηκε"
|
||||
#define D_UPLOAD_ERR_8 "Μη έγκυρο αρχείο"
|
||||
#define D_UPLOAD_ERR_9 "Το αρχείο είναι πολύ μεγάλο"
|
||||
#define D_UPLOAD_ERROR_CODE "Κωδικός λάθους ανεβάσματος"
|
||||
|
||||
#define D_ENTER_COMMAND "Εισαγωγή εντολής"
|
||||
#define D_ENABLE_WEBLOG_FOR_RESPONSE "Ενεργοποιήστε το weblog 2 αν περιμένετε απάντηση"
|
||||
#define D_NEED_USER_AND_PASSWORD "Χρειάζεστε user=<όνομα χρήστη>&password=<κωδικό χρήστη>"
|
||||
|
||||
// xdrv_00_mqtt.ino
|
||||
#define D_FINGERPRINT "Επαλήθευση TLS fingerprint..."
|
||||
#define D_TLS_CONNECT_FAILED_TO "Αποτυχία TLS σύνδεσης"
|
||||
#define D_RETRY_IN "Επανάληψη σε"
|
||||
#define D_VERIFIED "Επαλήθευση με Fingerprint"
|
||||
#define D_INSECURE "Μη ασφαλής σύνδεση λόγο ακατάλληλου Fingerprint"
|
||||
#define D_CONNECT_FAILED_TO "Αποτυχία σύνδεσης στο"
|
||||
|
||||
// xdrv_wemohue.ino
|
||||
#define D_MULTICAST_DISABLED "Multicast απενεργοποιημένο"
|
||||
#define D_MULTICAST_REJOINED "Multicast επανασύνδεση"
|
||||
#define D_MULTICAST_JOIN_FAILED "Αποτυχία σύνδεσης Multicast"
|
||||
#define D_FAILED_TO_SEND_RESPONSE "Αποτυχία αποστολής απάντησης"
|
||||
|
||||
#define D_WEMO "WeMo"
|
||||
#define D_WEMO_BASIC_EVENT "WeMo βασικό event"
|
||||
#define D_WEMO_EVENT_SERVICE "WeMo υπηρεσία event"
|
||||
#define D_WEMO_META_SERVICE "WeMo υπηρεσία meta"
|
||||
#define D_WEMO_SETUP "WeMo ρυθμίσεις"
|
||||
#define D_RESPONSE_SENT "Αποστολή απάντησης"
|
||||
|
||||
#define D_HUE "Hue"
|
||||
#define D_HUE_BRIDGE_SETUP "Hue ρυθμίσεις"
|
||||
#define D_HUE_API_NOT_IMPLEMENTED "Hue API δεν έχει υλοποιηθεί"
|
||||
#define D_HUE_API "Hue API"
|
||||
#define D_HUE_POST_ARGS "Hue POST args"
|
||||
#define D_3_RESPONSE_PACKETS_SENT "3πλο πακέτο απάντησεης στάλθηκε"
|
||||
|
||||
// xdrv_05_domoticz.ino
|
||||
#define D_DOMOTICZ_PARAMETERS "Domoticz παράμετροι"
|
||||
#define D_DOMOTICZ_IDX "Idx"
|
||||
#define D_DOMOTICZ_KEY_IDX "Key idx"
|
||||
#define D_DOMOTICZ_SWITCH_IDX "Switch idx"
|
||||
#define D_DOMOTICZ_SENSOR_IDX "Sensor idx"
|
||||
#define D_DOMOTICZ_TEMP "Temp"
|
||||
#define D_DOMOTICZ_TEMP_HUM "Temp,Hum"
|
||||
#define D_DOMOTICZ_TEMP_HUM_BARO "Temp,Hum,Baro"
|
||||
#define D_DOMOTICZ_POWER_ENERGY "Power,Energy"
|
||||
#define D_DOMOTICZ_ILLUMINANCE "Illuminance"
|
||||
#define D_DOMOTICZ_COUNT "Count/PM1"
|
||||
#define D_DOMOTICZ_VOLTAGE "Voltage/PM2.5"
|
||||
#define D_DOMOTICZ_CURRENT "Current/PM10"
|
||||
#define D_DOMOTICZ_AIRQUALITY "Ποιότητα Αέρα"
|
||||
#define D_DOMOTICZ_UPDATE_TIMER "Ενημέρωση"
|
||||
|
||||
// xdrv_09_timers.ino
|
||||
#define D_CONFIGURE_TIMER "Ρυθμίσεις Χρόνου"
|
||||
#define D_TIMER_PARAMETERS "Χρονικοί παράμετροι"
|
||||
#define D_TIMER_ARM "Arm"
|
||||
#define D_TIMER_TIME "Ωρα"
|
||||
#define D_TIMER_DAYS "Μέρες"
|
||||
#define D_TIMER_REPEAT "Επανάληψη"
|
||||
#define D_TIMER_OUTPUT "Αποτέλεσμα"
|
||||
#define D_TIMER_ACTION "Εντολή"
|
||||
|
||||
// xdrv_10_knx.ino
|
||||
#define D_CONFIGURE_KNX "Ρυθμίσεις KNX"
|
||||
#define D_KNX_PARAMETERS "KNX Παράμετροι"
|
||||
#define D_KNX_GENERAL_CONFIG "Γενικά"
|
||||
#define D_KNX_PHYSICAL_ADDRESS "Διεύθυνση Μνήμης"
|
||||
#define D_KNX_PHYSICAL_ADDRESS_NOTE "( Πρέπει να είναι μοναδική στο KNX δίκτυο )"
|
||||
#define D_KNX_ENABLE "Ενεργοποιημένο KNX"
|
||||
#define D_KNX_GROUP_ADDRESS_TO_WRITE "Αποστολή δεδομένων σε Ομάδα Διευθύνσεων"
|
||||
#define D_ADD "Προσθήκη"
|
||||
#define D_DELETE "Διαγραφή"
|
||||
#define D_REPLY "Επανάληψη"
|
||||
#define D_KNX_GROUP_ADDRESS_TO_READ "Ομάδα Διευθύνσεων που θα λάβει τα Δεδομένα"
|
||||
#define D_LOG_KNX "KNX: "
|
||||
#define D_RECEIVED_FROM "Στάλθηκε από"
|
||||
#define D_KNX_COMMAND_WRITE "Εγγραφή"
|
||||
#define D_KNX_COMMAND_READ "Ανάγνωση"
|
||||
#define D_KNX_COMMAND_OTHER "Αλλο"
|
||||
#define D_SENT_TO "αποστολή σε"
|
||||
#define D_KNX_WARNING "Η Ομάδα Διευθύνσεων ( 0 / 0 / 0 ) είναι δεσμευμένη και δεν μπορεί να χρησιμοποιηθεί."
|
||||
|
||||
// xdrv_03_energy.ino
|
||||
#define D_ENERGY_TODAY "Energy Σήμερα"
|
||||
#define D_ENERGY_YESTERDAY "Energy Χτες"
|
||||
#define D_ENERGY_TOTAL "Energy Συνολικά"
|
||||
|
||||
// xsns_05_ds18b20.ino
|
||||
#define D_SENSOR_BUSY "Απασχολημένος Σένσορας"
|
||||
#define D_SENSOR_CRC_ERROR "CRC λάθος σένσορα"
|
||||
#define D_SENSORS_FOUND "Βρέθηκε σένσορας"
|
||||
|
||||
// xsns_06_dht.ino
|
||||
#define D_TIMEOUT_WAITING_FOR "Timeout περιμένετε για"
|
||||
#define D_START_SIGNAL_LOW "εκκίνηση με χαμηλό σήμα"
|
||||
#define D_START_SIGNAL_HIGH "εκκίνηση με υψηλό σήμα"
|
||||
#define D_PULSE "παλμός"
|
||||
#define D_CHECKSUM_FAILURE "Αποτυχία Checksum"
|
||||
|
||||
// xsns_07_sht1x.ino
|
||||
#define D_SENSOR_DID_NOT_ACK_COMMAND "Ο σένσορας δεν έλαβε την εντολή ACK"
|
||||
#define D_SHT1X_FOUND "Βρέθηκε SHT1X"
|
||||
|
||||
// xsns_18_pms5003.ino
|
||||
#define D_STANDARD_CONCENTRATION "CF-1 PM" // Standard Particle CF-1 Particle Matter
|
||||
#define D_ENVIRONMENTAL_CONCENTRATION "PM" // Environmetal Particle Matter
|
||||
#define D_PARTICALS_BEYOND "Particals"
|
||||
|
||||
// sonoff_template.h
|
||||
#define D_SENSOR_NONE "Κανένας"
|
||||
#define D_SENSOR_DHT11 "DHT11"
|
||||
#define D_SENSOR_AM2301 "AM2301"
|
||||
#define D_SENSOR_SI7021 "SI7021"
|
||||
#define D_SENSOR_DS18X20 "DS18x20"
|
||||
#define D_SENSOR_I2C_SCL "I2C SCL"
|
||||
#define D_SENSOR_I2C_SDA "I2C SDA"
|
||||
#define D_SENSOR_WS2812 "WS2812"
|
||||
#define D_SENSOR_IRSEND "IRsend"
|
||||
#define D_SENSOR_SWITCH "Διακόπτης" // Suffix "1"
|
||||
#define D_SENSOR_BUTTON "Κουμπί" // Suffix "1"
|
||||
#define D_SENSOR_RELAY "Ρελέ" // Suffix "1i"
|
||||
#define D_SENSOR_LED "Led" // Suffix "1i"
|
||||
#define D_SENSOR_PWM "PWM" // Suffix "1"
|
||||
#define D_SENSOR_COUNTER "Μετρητής" // Suffix "1"
|
||||
#define D_SENSOR_IRRECV "IRrecv"
|
||||
#define D_SENSOR_MHZ_RX "MHZ Rx"
|
||||
#define D_SENSOR_MHZ_TX "MHZ Tx"
|
||||
#define D_SENSOR_PZEM_RX "PZEM Rx"
|
||||
#define D_SENSOR_PZEM_TX "PZEM Tx"
|
||||
#define D_SENSOR_SAIR_RX "SAir Rx"
|
||||
#define D_SENSOR_SAIR_TX "SAir Tx"
|
||||
#define D_SENSOR_SPI_CS "SPI CS"
|
||||
#define D_SENSOR_SPI_DC "SPI DC"
|
||||
#define D_SENSOR_BACKLIGHT "BkLight"
|
||||
#define D_SENSOR_PMS5003 "PMS5003"
|
||||
#define D_SENSOR_SDS0X1 "SDS0X1"
|
||||
#define D_SENSOR_SBR_RX "SerBr Rx"
|
||||
#define D_SENSOR_SBR_TX "SerBr Tx"
|
||||
#define D_SENSOR_SR04_TRIG "SR04 Tri"
|
||||
#define D_SENSOR_SR04_ECHO "SR04 Ech"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
#define D_UNIT_CENTIMETER "cm"
|
||||
#define D_UNIT_HOUR "Hr"
|
||||
#define D_UNIT_KILOOHM "kOhm"
|
||||
#define D_UNIT_KILOWATTHOUR "kWh"
|
||||
#define D_UNIT_LUX "lx"
|
||||
#define D_UNIT_MICROGRAM_PER_CUBIC_METER "ug/m3"
|
||||
#define D_UNIT_MICROMETER "um"
|
||||
#define D_UNIT_MICROSECOND "us"
|
||||
#define D_UNIT_MILLIAMPERE "mA"
|
||||
#define D_UNIT_MILLISECOND "ms"
|
||||
#define D_UNIT_MINUTE "Min"
|
||||
#define D_UNIT_PARTS_PER_BILLION "ppb"
|
||||
#define D_UNIT_PARTS_PER_DECILITER "ppd"
|
||||
#define D_UNIT_PARTS_PER_MILLION "ppm"
|
||||
#define D_UNIT_PRESSURE "hPa"
|
||||
#define D_UNIT_SECOND "sec"
|
||||
#define D_UNIT_SECTORS "sectors"
|
||||
#define D_UNIT_VOLT "V"
|
||||
#define D_UNIT_WATT "W"
|
||||
#define D_UNIT_WATTHOUR "Wh"
|
||||
|
||||
// Log message prefix
|
||||
#define D_LOG_APPLICATION "APP: " // Application
|
||||
#define D_LOG_BRIDGE "BRG: " // Bridge
|
||||
#define D_LOG_CONFIG "CFG: " // Settings
|
||||
#define D_LOG_COMMAND "CMD: " // Command
|
||||
#define D_LOG_DEBUG "DBG: " // Debug
|
||||
#define D_LOG_DHT "DHT: " // DHT sensor
|
||||
#define D_LOG_DOMOTICZ "DOM: " // Domoticz
|
||||
#define D_LOG_DSB "DSB: " // DS18xB20 sensor
|
||||
#define D_LOG_HTTP "HTP: " // HTTP webserver
|
||||
#define D_LOG_I2C "I2C: " // I2C
|
||||
#define D_LOG_IRR "IRR: " // Infra Red Received
|
||||
#define D_LOG_LOG "LOG: " // Logging
|
||||
#define D_LOG_MODULE "MOD: " // Module
|
||||
#define D_LOG_MDNS "DNS: " // mDNS
|
||||
#define D_LOG_MQTT "MQT: " // MQTT
|
||||
#define D_LOG_OTHER "OTH: " // Other
|
||||
#define D_LOG_RESULT "RSL: " // Result
|
||||
#define D_LOG_RFR "RFR: " // RF Received
|
||||
#define D_LOG_SERIAL "SER: " // Serial
|
||||
#define D_LOG_SHT1 "SHT: " // SHT1x sensor
|
||||
#define D_LOG_UPLOAD "UPL: " // Upload
|
||||
#define D_LOG_UPNP "UPP: " // UPnP
|
||||
#define D_LOG_WIFI "WIF: " // Wifi
|
||||
|
||||
#endif // _LANGUAGE_EN_GB_H_
|
|
@ -28,10 +28,14 @@
|
|||
* Use online command StateText to translate ON, OFF, HOLD and TOGGLE.
|
||||
* Use online command Prefix to translate cmnd, stat and tele.
|
||||
*
|
||||
* Updated until v5.12.0n
|
||||
\*********************************************************************/
|
||||
|
||||
//#define LANGUAGE_MODULE_NAME // Enable to display "Module Generic" (ie Spanish), Disable to display "Generic Module" (ie English)
|
||||
|
||||
// HTML (ISO 639-1) Language Code
|
||||
#define D_HTML_LANGUAGE "en"
|
||||
|
||||
// "2017-03-07T11:08:02" - ISO8601:2004
|
||||
#define D_YEAR_MONTH_SEPARATOR "-"
|
||||
#define D_MONTH_DAY_SEPARATOR "-"
|
||||
|
@ -71,9 +75,11 @@
|
|||
#define D_DARKLIGHT "Dark"
|
||||
#define D_DEBUG "Debug"
|
||||
#define D_DISABLED "Disabled"
|
||||
#define D_DISTANCE "Distance"
|
||||
#define D_DNS_SERVER "DNS Server"
|
||||
#define D_DONE "Done"
|
||||
#define D_DST_TIME "DST"
|
||||
#define D_ECO2 "eCO2"
|
||||
#define D_EMULATION "Emulation"
|
||||
#define D_ENABLED "Enabled"
|
||||
#define D_ERASE "Erase"
|
||||
|
@ -124,6 +130,7 @@
|
|||
#define D_RESTART_REASON "Restart Reason"
|
||||
#define D_RESTORE "restore"
|
||||
#define D_RETAINED "retained"
|
||||
#define D_RULE "Rule"
|
||||
#define D_SAVE "Save"
|
||||
#define D_SENSOR "Sensor"
|
||||
#define D_SSID "SSId"
|
||||
|
@ -133,12 +140,15 @@
|
|||
#define D_SUBNET_MASK "Subnet Mask"
|
||||
#define D_SUBSCRIBE_TO "Subscribe to"
|
||||
#define D_SUCCESSFUL "Successful"
|
||||
#define D_SUNRISE "Sunrise"
|
||||
#define D_SUNSET "Sunset"
|
||||
#define D_TEMPERATURE "Temperature"
|
||||
#define D_TO "to"
|
||||
#define D_TOGGLE "Toggle"
|
||||
#define D_TOPIC "Topic"
|
||||
#define D_TRANSMIT "Transmit"
|
||||
#define D_TRUE "True"
|
||||
#define D_TVOC "TVOC"
|
||||
#define D_UPGRADE "upgrade"
|
||||
#define D_UPLOAD "Upload"
|
||||
#define D_UPTIME "Uptime"
|
||||
|
@ -162,13 +172,6 @@
|
|||
#define D_DATA_SIZE "Data Size"
|
||||
#define D_ANALOG_INPUT "Analog"
|
||||
|
||||
#define D_FINGERPRINT "Verify TLS fingerprint..."
|
||||
#define D_TLS_CONNECT_FAILED_TO "TLS Connect failed to"
|
||||
#define D_RETRY_IN "Retry in"
|
||||
#define D_VERIFIED "Verified"
|
||||
#define D_INSECURE "Insecure connection due to invalid Fingerprint"
|
||||
#define D_CONNECT_FAILED_TO "Connect failed to"
|
||||
|
||||
// support.ino
|
||||
#define D_OSWATCH "osWatch"
|
||||
#define D_BLOCKED_LOOP "Blocked Loop"
|
||||
|
@ -317,6 +320,14 @@
|
|||
#define D_ENABLE_WEBLOG_FOR_RESPONSE "Enable weblog 2 if response expected"
|
||||
#define D_NEED_USER_AND_PASSWORD "Need user=<username>&password=<password>"
|
||||
|
||||
// xdrv_00_mqtt.ino
|
||||
#define D_FINGERPRINT "Verify TLS fingerprint..."
|
||||
#define D_TLS_CONNECT_FAILED_TO "TLS Connect failed to"
|
||||
#define D_RETRY_IN "Retry in"
|
||||
#define D_VERIFIED "Verified using Fingerprint"
|
||||
#define D_INSECURE "Insecure connection due to invalid Fingerprint"
|
||||
#define D_CONNECT_FAILED_TO "Connect failed to"
|
||||
|
||||
// xdrv_wemohue.ino
|
||||
#define D_MULTICAST_DISABLED "Multicast disabled"
|
||||
#define D_MULTICAST_REJOINED "Multicast (re)joined"
|
||||
|
@ -348,12 +359,42 @@
|
|||
#define D_DOMOTICZ_TEMP_HUM_BARO "Temp,Hum,Baro"
|
||||
#define D_DOMOTICZ_POWER_ENERGY "Power,Energy"
|
||||
#define D_DOMOTICZ_ILLUMINANCE "Illuminance"
|
||||
#define D_DOMOTICZ_COUNT "Count"
|
||||
#define D_DOMOTICZ_VOLTAGE "Voltage"
|
||||
#define D_DOMOTICZ_CURRENT "Current"
|
||||
#define D_DOMOTICZ_COUNT "Count/PM1"
|
||||
#define D_DOMOTICZ_VOLTAGE "Voltage/PM2.5"
|
||||
#define D_DOMOTICZ_CURRENT "Current/PM10"
|
||||
#define D_DOMOTICZ_AIRQUALITY "AirQuality"
|
||||
#define D_DOMOTICZ_UPDATE_TIMER "Update timer"
|
||||
|
||||
// xdrv_09_timers.ino
|
||||
#define D_CONFIGURE_TIMER "Configure Timer"
|
||||
#define D_TIMER_PARAMETERS "Timer parameters"
|
||||
#define D_TIMER_ARM "Arm"
|
||||
#define D_TIMER_TIME "Time"
|
||||
#define D_TIMER_DAYS "Days"
|
||||
#define D_TIMER_REPEAT "Repeat"
|
||||
#define D_TIMER_OUTPUT "Output"
|
||||
#define D_TIMER_ACTION "Action"
|
||||
|
||||
// xdrv_10_knx.ino
|
||||
#define D_CONFIGURE_KNX "Configure KNX"
|
||||
#define D_KNX_PARAMETERS "KNX Parameters"
|
||||
#define D_KNX_GENERAL_CONFIG "General"
|
||||
#define D_KNX_PHYSICAL_ADDRESS "Physical Address"
|
||||
#define D_KNX_PHYSICAL_ADDRESS_NOTE "( Must be unique on the KNX network )"
|
||||
#define D_KNX_ENABLE "Enable KNX"
|
||||
#define D_KNX_GROUP_ADDRESS_TO_WRITE "Data to Send to Group Addresses"
|
||||
#define D_ADD "Add"
|
||||
#define D_DELETE "Delete"
|
||||
#define D_REPLY "Reply"
|
||||
#define D_KNX_GROUP_ADDRESS_TO_READ "Group Addresses to Receive Data from"
|
||||
#define D_LOG_KNX "KNX: "
|
||||
#define D_RECEIVED_FROM "Received from"
|
||||
#define D_KNX_COMMAND_WRITE "Write"
|
||||
#define D_KNX_COMMAND_READ "Read"
|
||||
#define D_KNX_COMMAND_OTHER "Other"
|
||||
#define D_SENT_TO "sent to"
|
||||
#define D_KNX_WARNING "The group address ( 0 / 0 / 0 ) is reserved and can not be used."
|
||||
|
||||
// xdrv_03_energy.ino
|
||||
#define D_ENERGY_TODAY "Energy Today"
|
||||
#define D_ENERGY_YESTERDAY "Energy Yesterday"
|
||||
|
@ -407,9 +448,15 @@
|
|||
#define D_SENSOR_SPI_DC "SPI DC"
|
||||
#define D_SENSOR_BACKLIGHT "BkLight"
|
||||
#define D_SENSOR_PMS5003 "PMS5003"
|
||||
#define D_SENSOR_SDS0X1 "SDS0X1"
|
||||
#define D_SENSOR_SBR_RX "SerBr Rx"
|
||||
#define D_SENSOR_SBR_TX "SerBr Tx"
|
||||
#define D_SENSOR_SR04_TRIG "SR04 Tri"
|
||||
#define D_SENSOR_SR04_ECHO "SR04 Ech"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
#define D_UNIT_CENTIMETER "cm"
|
||||
#define D_UNIT_HOUR "Hr"
|
||||
#define D_UNIT_KILOOHM "kOhm"
|
||||
#define D_UNIT_KILOWATTHOUR "kWh"
|
||||
|
@ -420,6 +467,7 @@
|
|||
#define D_UNIT_MILLIAMPERE "mA"
|
||||
#define D_UNIT_MILLISECOND "ms"
|
||||
#define D_UNIT_MINUTE "Min"
|
||||
#define D_UNIT_PARTS_PER_BILLION "ppb"
|
||||
#define D_UNIT_PARTS_PER_DECILITER "ppd"
|
||||
#define D_UNIT_PARTS_PER_MILLION "ppm"
|
||||
#define D_UNIT_PRESSURE "hPa"
|
||||
|
|
|
@ -28,10 +28,14 @@
|
|||
* Use online command StateText to translate ON, OFF, HOLD and TOGGLE.
|
||||
* Use online command Prefix to translate cmnd, stat and tele.
|
||||
*
|
||||
* Updated until v5.12.0m
|
||||
\*********************************************************************/
|
||||
|
||||
#define LANGUAGE_MODULE_NAME // Enable to display "Module Generic" (ie Spanish), Disable to display "Generic Module" (ie English)
|
||||
|
||||
// HTML (ISO 639-1) Language Code
|
||||
#define D_HTML_LANGUAGE "es"
|
||||
|
||||
// "2017-03-07T11:08:02" - ISO8601:2004
|
||||
#define D_YEAR_MONTH_SEPARATOR "-"
|
||||
#define D_MONTH_DAY_SEPARATOR "-"
|
||||
|
@ -71,9 +75,11 @@
|
|||
#define D_DARKLIGHT "Oscura"
|
||||
#define D_DEBUG "Debug"
|
||||
#define D_DISABLED "Deshabilitado"
|
||||
#define D_DISTANCE "Distancia"
|
||||
#define D_DNS_SERVER "DNS Server"
|
||||
#define D_DONE "Listo"
|
||||
#define D_DST_TIME "DST"
|
||||
#define D_ECO2 "eCO2"
|
||||
#define D_EMULATION "Emulación"
|
||||
#define D_ENABLED "Habilitado"
|
||||
#define D_ERASE "Borrar"
|
||||
|
@ -124,6 +130,7 @@
|
|||
#define D_RESTART_REASON "Causa Reinicio"
|
||||
#define D_RESTORE "Restauración"
|
||||
#define D_RETAINED "Grabado"
|
||||
#define D_RULE "Rule"
|
||||
#define D_SAVE "Grabar"
|
||||
#define D_SENSOR "Sensor"
|
||||
#define D_SSID "SSId"
|
||||
|
@ -133,12 +140,15 @@
|
|||
#define D_SUBNET_MASK "Máscara Subred"
|
||||
#define D_SUBSCRIBE_TO "Suscribir a"
|
||||
#define D_SUCCESSFUL "Exitosa"
|
||||
#define D_SUNRISE "Salida del Sol"
|
||||
#define D_SUNSET "Puesta del Sol"
|
||||
#define D_TEMPERATURE "Temperatura"
|
||||
#define D_TO "a"
|
||||
#define D_TOGGLE "Conmutar"
|
||||
#define D_TOPIC "Topic"
|
||||
#define D_TRANSMIT "Transmitir"
|
||||
#define D_TRUE "Verdadero"
|
||||
#define D_TVOC "TVOC"
|
||||
#define D_UPGRADE "Actualización"
|
||||
#define D_UPLOAD "Carga"
|
||||
#define D_UPTIME "Tiempo Encendido"
|
||||
|
@ -162,13 +172,6 @@
|
|||
#define D_DATA_SIZE "Tamaño de Datos"
|
||||
#define D_ANALOG_INPUT "Entrada Analógica"
|
||||
|
||||
#define D_FINGERPRINT "Verificar TLS fingerprint..."
|
||||
#define D_TLS_CONNECT_FAILED_TO "Falló Conección TLS a"
|
||||
#define D_RETRY_IN "Reintentando"
|
||||
#define D_VERIFIED "Verificado"
|
||||
#define D_INSECURE "Conección insegura por Fingerprint no válido"
|
||||
#define D_CONNECT_FAILED_TO "Falló Conección a"
|
||||
|
||||
// support.ino
|
||||
#define D_OSWATCH "osWatch"
|
||||
#define D_BLOCKED_LOOP "Ciclo Bloqueado"
|
||||
|
@ -317,6 +320,14 @@
|
|||
#define D_ENABLE_WEBLOG_FOR_RESPONSE "Habilitar weblog 2 si desea respuesta"
|
||||
#define D_NEED_USER_AND_PASSWORD "Se necesita user=<username>&password=<password>"
|
||||
|
||||
// xdrv_00_mqtt.ino
|
||||
#define D_FINGERPRINT "Verificar TLS fingerprint..."
|
||||
#define D_TLS_CONNECT_FAILED_TO "Falló Conección TLS a"
|
||||
#define D_RETRY_IN "Reintentando"
|
||||
#define D_VERIFIED "Verificado Fingerprint"
|
||||
#define D_INSECURE "Conección insegura por Fingerprint no válido"
|
||||
#define D_CONNECT_FAILED_TO "Falló Conección a"
|
||||
|
||||
// xdrv_wemohue.ino
|
||||
#define D_MULTICAST_DISABLED "Multicast deshabilitado"
|
||||
#define D_MULTICAST_REJOINED "Multicast (re)conectado"
|
||||
|
@ -348,12 +359,42 @@
|
|||
#define D_DOMOTICZ_TEMP_HUM_BARO "Temp,Hum,Baro"
|
||||
#define D_DOMOTICZ_POWER_ENERGY "Potencia,Energía"
|
||||
#define D_DOMOTICZ_ILLUMINANCE "Luminancia"
|
||||
#define D_DOMOTICZ_COUNT "Contador"
|
||||
#define D_DOMOTICZ_VOLTAGE "Voltaje"
|
||||
#define D_DOMOTICZ_CURRENT "Corriente"
|
||||
#define D_DOMOTICZ_COUNT "Contador/PM1"
|
||||
#define D_DOMOTICZ_VOLTAGE "Voltaje/PM2,5"
|
||||
#define D_DOMOTICZ_CURRENT "Corriente/PM10"
|
||||
#define D_DOMOTICZ_AIRQUALITY "Calidad del Aire"
|
||||
#define D_DOMOTICZ_UPDATE_TIMER "Intervalo de refresco"
|
||||
|
||||
// xdrv_09_timers.ino
|
||||
#define D_CONFIGURE_TIMER "Configuración Temporizadores"
|
||||
#define D_TIMER_PARAMETERS "Parámetros de Temporizadores"
|
||||
#define D_TIMER_ARM "Activo"
|
||||
#define D_TIMER_TIME "Hora"
|
||||
#define D_TIMER_DAYS "Días"
|
||||
#define D_TIMER_REPEAT "Repetir"
|
||||
#define D_TIMER_OUTPUT "Salida"
|
||||
#define D_TIMER_ACTION "Estado"
|
||||
|
||||
// xdrv_10_knx.ino
|
||||
#define D_CONFIGURE_KNX "Configuración de KNX"
|
||||
#define D_KNX_PARAMETERS "Parámetros de KNX"
|
||||
#define D_KNX_GENERAL_CONFIG "General"
|
||||
#define D_KNX_PHYSICAL_ADDRESS "Dirección Física"
|
||||
#define D_KNX_PHYSICAL_ADDRESS_NOTE "( Debe ser única en la red KNX )"
|
||||
#define D_KNX_ENABLE "Habilitar KNX"
|
||||
#define D_KNX_GROUP_ADDRESS_TO_WRITE "Datos a Enviar a las Direcciones de Grupo"
|
||||
#define D_ADD "Agregar"
|
||||
#define D_DELETE "Eliminar"
|
||||
#define D_REPLY "Responder"
|
||||
#define D_KNX_GROUP_ADDRESS_TO_READ "Direcciones de Grupo para Recibir Datos"
|
||||
#define D_LOG_KNX "KNX: "
|
||||
#define D_RECEIVED_FROM "Recibido desde"
|
||||
#define D_KNX_COMMAND_WRITE "Escribir"
|
||||
#define D_KNX_COMMAND_READ "Leer"
|
||||
#define D_KNX_COMMAND_OTHER "Otro"
|
||||
#define D_SENT_TO "enviada a"
|
||||
#define D_KNX_WARNING "La dirección de grupo ( 0 / 0 / 0 ) está reservada y no puede ser utilizada."
|
||||
|
||||
// xdrv_03_energy.ino
|
||||
#define D_ENERGY_TODAY "Energía Hoy"
|
||||
#define D_ENERGY_YESTERDAY "Energía Ayer"
|
||||
|
@ -407,9 +448,15 @@
|
|||
#define D_SENSOR_SPI_DC "SPI DC"
|
||||
#define D_SENSOR_BACKLIGHT "BkLight"
|
||||
#define D_SENSOR_PMS5003 "PMS5003"
|
||||
#define D_SENSOR_SDS0X1 "SDS0X1"
|
||||
#define D_SENSOR_SBR_RX "SerBr Rx"
|
||||
#define D_SENSOR_SBR_TX "SerBr Tx"
|
||||
#define D_SENSOR_SR04_TRIG "SR04 Tri"
|
||||
#define D_SENSOR_SR04_ECHO "SR04 Ech"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
#define D_UNIT_CENTIMETER "cm"
|
||||
#define D_UNIT_HOUR "Hr"
|
||||
#define D_UNIT_KILOOHM "kOhm"
|
||||
#define D_UNIT_KILOWATTHOUR "kWh"
|
||||
|
@ -420,6 +467,7 @@
|
|||
#define D_UNIT_MILLIAMPERE "mA"
|
||||
#define D_UNIT_MILLISECOND "ms"
|
||||
#define D_UNIT_MINUTE "Min"
|
||||
#define D_UNIT_PARTS_PER_BILLION "ppb"
|
||||
#define D_UNIT_PARTS_PER_DECILITER "ppd"
|
||||
#define D_UNIT_PARTS_PER_MILLION "ppm"
|
||||
#define D_UNIT_PRESSURE "hPa"
|
||||
|
|
|
@ -28,10 +28,14 @@
|
|||
* Use online command StateText to translate ON, OFF, HOLD and TOGGLE.
|
||||
* Use online command Prefix to translate cmnd, stat and tele.
|
||||
*
|
||||
* Updated until v5.12.0m
|
||||
\*********************************************************************/
|
||||
|
||||
#define LANGUAGE_MODULE_NAME // Enable to display "Module Generic" (ie Spanish), Disable to display "Generic Module" (ie English)
|
||||
|
||||
// HTML (ISO 639-1) Language Code
|
||||
#define D_HTML_LANGUAGE "fr"
|
||||
|
||||
// "2017-03-07T11:08:02" - ISO8601:2004
|
||||
#define D_YEAR_MONTH_SEPARATOR "-"
|
||||
#define D_MONTH_DAY_SEPARATOR "-"
|
||||
|
@ -55,7 +59,7 @@
|
|||
#define D_BLINKOFF "BlinkOff"
|
||||
#define D_BOOT_COUNT "Nombre de boot"
|
||||
#define D_BRIGHTLIGHT "Luminosité"
|
||||
#define D_BUTTON "Boutton"
|
||||
#define D_BUTTON "Bouton"
|
||||
#define D_BY "par" // Written by me
|
||||
#define D_BYTES "Bytes"
|
||||
#define D_CELSIUS "Celsius"
|
||||
|
@ -66,25 +70,27 @@
|
|||
#define D_CONNECTED "Connecté"
|
||||
#define D_COUNT "Compte"
|
||||
#define D_COUNTER "Compteur"
|
||||
#define D_CURRENT "Courrant" // As in Voltage and Current
|
||||
#define D_DATA "Data"
|
||||
#define D_CURRENT "Courant" // As in Voltage and Current
|
||||
#define D_DATA "Donnée"
|
||||
#define D_DARKLIGHT "Sombre"
|
||||
#define D_DEBUG "Debug"
|
||||
#define D_DISABLED "Désactivé"
|
||||
#define D_DISTANCE "Distance"
|
||||
#define D_DNS_SERVER "Serveur DNS"
|
||||
#define D_DONE "Fait"
|
||||
#define D_DST_TIME "DST"
|
||||
#define D_EMULATION "Emulation"
|
||||
#define D_ECO2 "eCO2"
|
||||
#define D_EMULATION "Émulation"
|
||||
#define D_ENABLED "Activé"
|
||||
#define D_ERASE "Effacer"
|
||||
#define D_ERROR "Erreur"
|
||||
#define D_FAHRENHEIT "Fahrenheit"
|
||||
#define D_FAILED "Echoué"
|
||||
#define D_FALLBACK "Fallback"
|
||||
#define D_FALLBACK_TOPIC "Fallback Topic"
|
||||
#define D_FAILED "Échoué"
|
||||
#define D_FALLBACK "Secours"
|
||||
#define D_FALLBACK_TOPIC "Topic de secours"
|
||||
#define D_FALSE "Faux"
|
||||
#define D_FILE "Fichier"
|
||||
#define D_FREE_MEMORY "Memoire libre"
|
||||
#define D_FREE_MEMORY "Mémoire libre"
|
||||
#define D_GAS "Gaz"
|
||||
#define D_GATEWAY "Passerelle"
|
||||
#define D_GROUP "Groupe"
|
||||
|
@ -92,7 +98,7 @@
|
|||
#define D_HOSTNAME "Hostname"
|
||||
#define D_HUMIDITY "Humidité"
|
||||
#define D_ILLUMINANCE "Éclairement"
|
||||
#define D_IMMEDIATE "immediat" // Button immediate
|
||||
#define D_IMMEDIATE "immédiat" // Button immediate
|
||||
#define D_INDEX "Index"
|
||||
#define D_INFO "Info"
|
||||
#define D_INITIALIZED "Initialisé"
|
||||
|
@ -103,11 +109,11 @@
|
|||
#define D_MQTT "MQTT"
|
||||
#define D_MULTI_PRESS "multi-pression"
|
||||
#define D_NOISE "Bruit"
|
||||
#define D_NONE "None"
|
||||
#define D_OFF "Off"
|
||||
#define D_NONE "Aucun"
|
||||
#define D_OFF "Arrêt"
|
||||
#define D_OFFLINE "Déconnecté"
|
||||
#define D_OK "Ok"
|
||||
#define D_ON "On"
|
||||
#define D_ON "Marche"
|
||||
#define D_ONLINE "Connecté"
|
||||
#define D_PASSWORD "Mot de passe"
|
||||
#define D_PORT "Port"
|
||||
|
@ -120,33 +126,37 @@
|
|||
#define D_PROJECT "Projet"
|
||||
#define D_RECEIVED "Reçu"
|
||||
#define D_RESTART "Redémarrage"
|
||||
#define D_RESTARTING "Redémarrage"
|
||||
#define D_RESTART_REASON "Raison redémarrage"
|
||||
#define D_RESTORE "restorer"
|
||||
#define D_RESTARTING "Redémarre"
|
||||
#define D_RESTART_REASON "Raison du redémarrage"
|
||||
#define D_RESTORE "restaurer"
|
||||
#define D_RETAINED "retenu"
|
||||
#define D_SAVE "Enregister"
|
||||
#define D_RULE "Règle"
|
||||
#define D_SAVE "Enregistrer"
|
||||
#define D_SENSOR "Capteur"
|
||||
#define D_SSID "SSID"
|
||||
#define D_START "Start"
|
||||
#define D_START "Lancer" // "Lancer la mise à jour"
|
||||
#define D_STD_TIME "STD"
|
||||
#define D_STOP "Stop"
|
||||
#define D_SUBNET_MASK "Masque sous réseau"
|
||||
#define D_SUBNET_MASK "Masque sous-réseau"
|
||||
#define D_SUBSCRIBE_TO "Souscrire à"
|
||||
#define D_SUCCESSFUL "Réussi"
|
||||
#define D_TEMPERATURE "Temperature"
|
||||
#define D_SUNRISE "Lever du jour"
|
||||
#define D_SUNSET "Tombée de la nuit"
|
||||
#define D_TEMPERATURE "Température"
|
||||
#define D_TO "à"
|
||||
#define D_TOGGLE "Bascule"
|
||||
#define D_TOPIC "Topic"
|
||||
#define D_TOGGLE "Inverser"
|
||||
#define D_TOPIC "Topic" // Keep MQTT keyword
|
||||
#define D_TRANSMIT "Transmettre"
|
||||
#define D_TRUE "Vrai"
|
||||
#define D_UPGRADE "upgrade"
|
||||
#define D_UPLOAD "Upload"
|
||||
#define D_UPTIME "Uptime"
|
||||
#define D_TVOC "TVOC"
|
||||
#define D_UPGRADE "la mise à jour" // "Lancer la mise à jour"
|
||||
#define D_UPLOAD "Upload" // Not better in french
|
||||
#define D_UPTIME "Durée d'activité"
|
||||
#define D_USER "Utilisateur"
|
||||
#define D_UTC_TIME "UTC"
|
||||
#define D_UV_LEVEL "Niveau UV"
|
||||
#define D_VERSION "Version"
|
||||
#define D_VOLTAGE "Voltage"
|
||||
#define D_VOLTAGE "Tension"
|
||||
#define D_WARMLIGHT "Chaud"
|
||||
#define D_WEB_SERVER "Serveur web"
|
||||
|
||||
|
@ -154,43 +164,36 @@
|
|||
#define D_WARNING_MINIMAL_VERSION "ATTENTION Cette version ne supporte pas les réglages persistants"
|
||||
#define D_LEVEL_10 "level 1-0"
|
||||
#define D_LEVEL_01 "level 0-1"
|
||||
#define D_SERIAL_LOGGING_DISABLED "Journalisation série désactivé"
|
||||
#define D_SYSLOG_LOGGING_REENABLED "Jounalisation syslog réactivé"
|
||||
#define D_SERIAL_LOGGING_DISABLED "Journalisation série désactivée"
|
||||
#define D_SYSLOG_LOGGING_REENABLED "Jounalisation syslog réactivée"
|
||||
|
||||
#define D_SET_BAUDRATE_TO "Definir baudrate à"
|
||||
#define D_RECEIVED_TOPIC "Topic reçu"
|
||||
#define D_SET_BAUDRATE_TO "Définir baudrate à"
|
||||
#define D_RECEIVED_TOPIC "Topic reçu" // Terme MQTT
|
||||
#define D_DATA_SIZE "Taille données"
|
||||
#define D_ANALOG_INPUT "Analogique"
|
||||
|
||||
#define D_FINGERPRINT "Verification empreinte TLS ..."
|
||||
#define D_TLS_CONNECT_FAILED_TO "Echec de connexion TLS à"
|
||||
#define D_RETRY_IN "Nouvelle tentative dans"
|
||||
#define D_VERIFIED "Verifié"
|
||||
#define D_INSECURE "Connexion non sécurisée car empreinte non vérifée"
|
||||
#define D_CONNECT_FAILED_TO "Echec de connexion à"
|
||||
|
||||
// support.ino
|
||||
#define D_OSWATCH "osWatch"
|
||||
#define D_BLOCKED_LOOP "Boucle bloquée"
|
||||
#define D_WPS_FAILED_WITH_STATUS "WPSconfig ECHOUÉ avec status"
|
||||
#define D_WPS_FAILED_WITH_STATUS "WPSconfig ÉCHOUÉ avec status"
|
||||
#define D_ACTIVE_FOR_3_MINUTES "actif pour 3 minutes"
|
||||
#define D_FAILED_TO_START "Echec de démarrage"
|
||||
#define D_PATCH_ISSUE_2186 "Patch issue 2186"
|
||||
#define D_FAILED_TO_START "Échec de démarrage"
|
||||
#define D_PATCH_ISSUE_2186 "Correction 2186"
|
||||
#define D_CONNECTING_TO_AP "Connexion à l'AP"
|
||||
#define D_IN_MODE "en mode"
|
||||
#define D_CONNECT_FAILED_NO_IP_ADDRESS "Echec de connexion car aucune adresse IP n'a été reçue"
|
||||
#define D_CONNECT_FAILED_AP_NOT_REACHED "Echec de connexion car l'AP ne peut-être contacté"
|
||||
#define D_CONNECT_FAILED_WRONG_PASSWORD "Echec de connexion car le mot de passe de l'AP est incorrect"
|
||||
#define D_CONNECT_FAILED_AP_TIMEOUT "Echec de connexion avec l'AP, expiré"
|
||||
#define D_CONNECT_FAILED_NO_IP_ADDRESS "Échec de connexion car aucune adresse IP n'a été reçue"
|
||||
#define D_CONNECT_FAILED_AP_NOT_REACHED "Échec de connexion car l'AP ne peut-être contacté"
|
||||
#define D_CONNECT_FAILED_WRONG_PASSWORD "Échec de connexion car le mot de passe de l'AP est incorrect"
|
||||
#define D_CONNECT_FAILED_AP_TIMEOUT "Échec de connexion avec l'AP, expiré"
|
||||
#define D_ATTEMPTING_CONNECTION "Tentative de connexion..."
|
||||
#define D_CHECKING_CONNECTION "Verification connexion..."
|
||||
#define D_QUERY_DONE "Requête terminé. Services MQTT trouvés"
|
||||
#define D_CHECKING_CONNECTION "Vérification connexion..."
|
||||
#define D_QUERY_DONE "Requête terminée. Services MQTT trouvés"
|
||||
#define D_MQTT_SERVICE_FOUND "Service MQTT trouvé sur"
|
||||
#define D_FOUND_AT "trouvé à"
|
||||
#define D_SYSLOG_HOST_NOT_FOUND "Host syslog introuvable"
|
||||
|
||||
// settings.ino
|
||||
#define D_SAVED_TO_FLASH_AT "Enregistré dans la flash à"
|
||||
#define D_SAVED_TO_FLASH_AT "Enregistré en flash à"
|
||||
#define D_LOADED_FROM_FLASH_AT "Chargé de la flash à"
|
||||
#define D_USE_DEFAULTS "Utiliser par défaut"
|
||||
#define D_ERASED_SECTOR "Secteur effacé"
|
||||
|
@ -202,8 +205,8 @@
|
|||
#define D_WEBSERVER_STOPPED "Serveur web éteint"
|
||||
#define D_FILE_NOT_FOUND "Fichier introuvable"
|
||||
#define D_REDIRECTED "Redirection sur le portail captif"
|
||||
#define D_WIFIMANAGER_SET_ACCESSPOINT_AND_STATION "Wifimanager defini AccessPoint et garde station"
|
||||
#define D_WIFIMANAGER_SET_ACCESSPOINT "Wifimanager defini AccessPoint"
|
||||
#define D_WIFIMANAGER_SET_ACCESSPOINT_AND_STATION "Wifimanager définit AccessPoint et garde station"
|
||||
#define D_WIFIMANAGER_SET_ACCESSPOINT "Wifimanager définit AccessPoint"
|
||||
#define D_TRYING_TO_CONNECT "Tentative de connexion du module au réseau"
|
||||
|
||||
#define D_RESTART_IN "Redémarrage dans"
|
||||
|
@ -212,24 +215,24 @@
|
|||
#define D_BUTTON_TOGGLE "on/off"
|
||||
#define D_CONFIGURATION "Configuration"
|
||||
#define D_INFORMATION "Information"
|
||||
#define D_FIRMWARE_UPGRADE "Mise à jour Firmware"
|
||||
#define D_FIRMWARE_UPGRADE "Mise à jour du Firmware"
|
||||
#define D_CONSOLE "Console"
|
||||
#define D_CONFIRM_RESTART "Confirmer redémarrage"
|
||||
|
||||
#define D_CONFIGURE_MODULE "Configuration Module"
|
||||
#define D_CONFIGURE_MODULE "Configuration du Module"
|
||||
#define D_CONFIGURE_WIFI "Configuration WiFi"
|
||||
#define D_CONFIGURE_MQTT "Configuration MQTT"
|
||||
#define D_CONFIGURE_DOMOTICZ "Configuration Domoticz"
|
||||
#define D_CONFIGURE_LOGGING "Configuration Logging"
|
||||
#define D_CONFIGURE_LOGGING "Configuration du journal"
|
||||
#define D_CONFIGURE_OTHER "Autre configuration"
|
||||
#define D_CONFIRM_RESET_CONFIGURATION "Confirmer réinitialisation configuration"
|
||||
#define D_RESET_CONFIGURATION "Réinitialisation Configuration"
|
||||
#define D_BACKUP_CONFIGURATION "Sauvegarde Configuration"
|
||||
#define D_RESTORE_CONFIGURATION "Restauration Configuration"
|
||||
#define D_RESET_CONFIGURATION "Configuration par défaut"
|
||||
#define D_BACKUP_CONFIGURATION "Sauvegarde de la config."
|
||||
#define D_RESTORE_CONFIGURATION "Restauration de la config."
|
||||
#define D_MAIN_MENU "Menu principal"
|
||||
|
||||
#define D_MODULE_PARAMETERS "Paramètres module"
|
||||
#define D_MODULE_TYPE "Type module"
|
||||
#define D_MODULE_TYPE "Type de module"
|
||||
#define D_GPIO "GPIO"
|
||||
#define D_SERIAL_IN "Serial In"
|
||||
#define D_SERIAL_OUT "Serial Out"
|
||||
|
@ -238,9 +241,9 @@
|
|||
#define D_SCAN_FOR_WIFI_NETWORKS "Scan des réseaux wifi"
|
||||
#define D_SCAN_DONE "Scan terminé"
|
||||
#define D_NO_NETWORKS_FOUND "Aucun réseau trouvé"
|
||||
#define D_REFRESH_TO_SCAN_AGAIN "Rafraichir pour scanner à nouveau"
|
||||
#define D_DUPLICATE_ACCESSPOINT "AccessPoint dupliqué"
|
||||
#define D_SKIPPING_LOW_QUALITY "Passe car mauvaise qualité"
|
||||
#define D_REFRESH_TO_SCAN_AGAIN "Rafraîchir pour scanner à nouveau"
|
||||
#define D_DUPLICATE_ACCESSPOINT "Point d'Accès dupliqué"
|
||||
#define D_SKIPPING_LOW_QUALITY "Évité car de mauvaise qualité"
|
||||
#define D_RSSI "RSSI"
|
||||
#define D_WEP "WEP"
|
||||
#define D_WPA_PSK "WPA PSK"
|
||||
|
@ -254,14 +257,14 @@
|
|||
#define D_CLIENT "Client"
|
||||
#define D_FULL_TOPIC "topic complet"
|
||||
|
||||
#define D_LOGGING_PARAMETERS "Paramètres journalisation"
|
||||
#define D_LOGGING_PARAMETERS "Paramètres du journal"
|
||||
#define D_SERIAL_LOG_LEVEL "Niveau de journalisation série"
|
||||
#define D_WEB_LOG_LEVEL "Niveau de journalisation web"
|
||||
#define D_SYS_LOG_LEVEL "Niveau syslog"
|
||||
#define D_SYS_LOG_LEVEL "Niveau Syslog"
|
||||
#define D_MORE_DEBUG "Plus de debug"
|
||||
#define D_SYSLOG_HOST "Host syslog"
|
||||
#define D_SYSLOG_PORT "Host syslog"
|
||||
#define D_TELEMETRY_PERIOD "Période télémetrie"
|
||||
#define D_SYSLOG_HOST "Hôte Syslog"
|
||||
#define D_SYSLOG_PORT "Port Syslog"
|
||||
#define D_TELEMETRY_PERIOD "Période télémétrie"
|
||||
|
||||
#define D_OTHER_PARAMETERS "Autres paramètres"
|
||||
#define D_WEB_ADMIN_PASSWORD "Mot de passe Web Admin"
|
||||
|
@ -272,11 +275,11 @@
|
|||
#define D_SINGLE_DEVICE "module unique"
|
||||
#define D_MULTI_DEVICE "multi module"
|
||||
|
||||
#define D_SAVE_CONFIGURATION "Enregistrer configuration"
|
||||
#define D_CONFIGURATION_SAVED "Configuration enregistré"
|
||||
#define D_CONFIGURATION_RESET "Configuration réinitialisé"
|
||||
#define D_SAVE_CONFIGURATION "Enregistrer la configuration"
|
||||
#define D_CONFIGURATION_SAVED "Configuration enregistrée"
|
||||
#define D_CONFIGURATION_RESET "Configuration réinitialisée"
|
||||
|
||||
#define D_PROGRAM_VERSION "Version Programme"
|
||||
#define D_PROGRAM_VERSION "Version du programme"
|
||||
#define D_BUILD_DATE_AND_TIME "Date & Heure de build"
|
||||
#define D_CORE_AND_SDK_VERSION "Version Core/SDK"
|
||||
#define D_FLASH_WRITE_COUNT "Compteur écriture flash"
|
||||
|
@ -300,42 +303,50 @@
|
|||
#define D_START_UPGRADE "Lancer la mise à jour"
|
||||
#define D_UPGRADE_BY_FILE_UPLOAD "Mise à jour par téléchargement fichier"
|
||||
#define D_UPLOAD_STARTED "Téléchargement lancé"
|
||||
#define D_UPGRADE_STARTED "Mise à jour lancé"
|
||||
#define D_UPGRADE_STARTED "Mise à jour lancée"
|
||||
#define D_UPLOAD_DONE "Téléchargement terminé"
|
||||
#define D_UPLOAD_ERR_1 "Aucun fichier sélectionné"
|
||||
#define D_UPLOAD_ERR_2 "Espace insuffisant"
|
||||
#define D_UPLOAD_ERR_3 "Magic byte n'est pas 0xE9"
|
||||
#define D_UPLOAD_ERR_4 "La taille de la flash programme est plus grande que la taille réelle de la flash"
|
||||
#define D_UPLOAD_ERR_5 "Erreur comparaison buffer de téléchargement"
|
||||
#define D_UPLOAD_ERR_6 "Téléchargement échoué. Activation logging 3"
|
||||
#define D_UPLOAD_ERR_3 "L'octet magique n'est pas 0xE9"
|
||||
#define D_UPLOAD_ERR_4 "La taille du programme à flasher est plus grande que la taille réelle de la mémoire flash"
|
||||
#define D_UPLOAD_ERR_5 "Erreur de comparaison du buffer de téléchargement"
|
||||
#define D_UPLOAD_ERR_6 "Téléchargement échoué. Activer Weblog 3"
|
||||
#define D_UPLOAD_ERR_7 "Téléchargement annulé"
|
||||
#define D_UPLOAD_ERR_8 "Fichier invalide"
|
||||
#define D_UPLOAD_ERR_9 "Fichier trop grand"
|
||||
#define D_UPLOAD_ERROR_CODE "Code d'erreur téléchargement"
|
||||
|
||||
#define D_ENTER_COMMAND "Saisir commande"
|
||||
#define D_ENABLE_WEBLOG_FOR_RESPONSE "Activer weblog 2 si response attendue"
|
||||
#define D_ENTER_COMMAND "Saisir une commande"
|
||||
#define D_ENABLE_WEBLOG_FOR_RESPONSE "Activer Weblog 2 si une réponse est attendue"
|
||||
#define D_NEED_USER_AND_PASSWORD "Nécessite utilisateur=<username>&password=<password>"
|
||||
|
||||
// xdrv_00_mqtt.ino
|
||||
#define D_FINGERPRINT "Vérification d'empreinte TLS ..."
|
||||
#define D_TLS_CONNECT_FAILED_TO "Échec de connexion TLS à"
|
||||
#define D_RETRY_IN "Nouvelle tentative dans"
|
||||
#define D_VERIFIED "Vérifié par empreinte "
|
||||
#define D_INSECURE "Connexion non sécurisée car empreinte non vérifiée"
|
||||
#define D_CONNECT_FAILED_TO "Échec de connexion à"
|
||||
|
||||
// xdrv_wemohue.ino
|
||||
#define D_MULTICAST_DISABLED "Multicast désactivé"
|
||||
#define D_MULTICAST_REJOINED "Multicast (re)joint"
|
||||
#define D_MULTICAST_JOIN_FAILED "Multicast echec abonnement"
|
||||
#define D_FAILED_TO_SEND_RESPONSE "Echec d'envoi réponse"
|
||||
#define D_MULTICAST_JOIN_FAILED "Multicast échec abonnement"
|
||||
#define D_FAILED_TO_SEND_RESPONSE "Échec d'envoi réponse"
|
||||
|
||||
#define D_WEMO "WeMo"
|
||||
#define D_WEMO_BASIC_EVENT "WeMo basic event"
|
||||
#define D_WEMO_EVENT_SERVICE "WeMo event service"
|
||||
#define D_WEMO_META_SERVICE "WeMo meta service"
|
||||
#define D_WEMO_SETUP "Réglage WeMo"
|
||||
#define D_RESPONSE_SENT "Response envoyé"
|
||||
#define D_RESPONSE_SENT "Réponse envoyée"
|
||||
|
||||
#define D_HUE "Hue"
|
||||
#define D_HUE_BRIDGE_SETUP "Réglage Hue"
|
||||
#define D_HUE_API_NOT_IMPLEMENTED "API Hue non implémentée"
|
||||
#define D_HUE_API "Hue API"
|
||||
#define D_HUE_POST_ARGS "Hue POST args"
|
||||
#define D_3_RESPONSE_PACKETS_SENT "3 paquets response envoyés"
|
||||
#define D_3_RESPONSE_PACKETS_SENT "3 paquets de réponse envoyés"
|
||||
|
||||
// xdrv_05_domoticz.ino
|
||||
#define D_DOMOTICZ_PARAMETERS "Paramètres Domoticz"
|
||||
|
@ -346,18 +357,48 @@
|
|||
#define D_DOMOTICZ_TEMP "Temp"
|
||||
#define D_DOMOTICZ_TEMP_HUM "Temp,Hum"
|
||||
#define D_DOMOTICZ_TEMP_HUM_BARO "Temp,Hum,Baro"
|
||||
#define D_DOMOTICZ_POWER_ENERGY "Power,Energy"
|
||||
#define D_DOMOTICZ_POWER_ENERGY "Puissance,Énergie"
|
||||
#define D_DOMOTICZ_ILLUMINANCE "Illuminance"
|
||||
#define D_DOMOTICZ_COUNT "Count"
|
||||
#define D_DOMOTICZ_VOLTAGE "Voltage"
|
||||
#define D_DOMOTICZ_CURRENT "Current"
|
||||
#define D_DOMOTICZ_AIRQUALITY "AirQuality"
|
||||
#define D_DOMOTICZ_UPDATE_TIMER "Update timer"
|
||||
#define D_DOMOTICZ_COUNT "Compteur/PM1"
|
||||
#define D_DOMOTICZ_VOLTAGE "Tension/PM2,5"
|
||||
#define D_DOMOTICZ_CURRENT "Courant/PM10"
|
||||
#define D_DOMOTICZ_AIRQUALITY "Qualité de l'air"
|
||||
#define D_DOMOTICZ_UPDATE_TIMER "Durée de rafraichissement"
|
||||
|
||||
// xdrv_09_timers.ino
|
||||
#define D_CONFIGURE_TIMER "Configuration des Timers"
|
||||
#define D_TIMER_PARAMETERS "Paramètres Timer"
|
||||
#define D_TIMER_ARM "Armer"
|
||||
#define D_TIMER_TIME "Temps"
|
||||
#define D_TIMER_DAYS "Jours"
|
||||
#define D_TIMER_REPEAT "Répéter"
|
||||
#define D_TIMER_OUTPUT "Sortie"
|
||||
#define D_TIMER_ACTION "Action"
|
||||
|
||||
// xdrv_10_knx.ino
|
||||
#define D_CONFIGURE_KNX "Configuration de KNX"
|
||||
#define D_KNX_PARAMETERS "Paramètres KNX"
|
||||
#define D_KNX_GENERAL_CONFIG "Général"
|
||||
#define D_KNX_PHYSICAL_ADDRESS "Adresse individuelle" // Backbone/Line/Device -> Zone/Ligne/Participant
|
||||
#define D_KNX_PHYSICAL_ADDRESS_NOTE "(Doit être unique sur le réseau KNX)"
|
||||
#define D_KNX_ENABLE "Activer KNX"
|
||||
#define D_KNX_GROUP_ADDRESS_TO_WRITE "Données à envoyer aux Adresses de Groupe"
|
||||
#define D_ADD "Ajoûter"
|
||||
#define D_DELETE "Supprimer"
|
||||
#define D_REPLY "Répondre"
|
||||
#define D_KNX_GROUP_ADDRESS_TO_READ "Données à recevoir des Adresses de Groupe"
|
||||
#define D_LOG_KNX "KNX: "
|
||||
#define D_RECEIVED_FROM "Reçu de"
|
||||
#define D_KNX_COMMAND_WRITE "Écrire"
|
||||
#define D_KNX_COMMAND_READ "Lire"
|
||||
#define D_KNX_COMMAND_OTHER "Autre"
|
||||
#define D_SENT_TO "envoyé à"
|
||||
#define D_KNX_WARNING "L'Adresse de Groupe ( 0 / 0 / 0 ) est réservée et ne peut être utilisée."
|
||||
|
||||
// xsns_03_energy.ino
|
||||
#define D_ENERGY_TODAY "Energie aujourd'hui"
|
||||
#define D_ENERGY_YESTERDAY "Energie hier"
|
||||
#define D_ENERGY_TOTAL "Energie totale"
|
||||
#define D_ENERGY_TODAY "Énergie aujourd'hui"
|
||||
#define D_ENERGY_YESTERDAY "Énergie hier"
|
||||
#define D_ENERGY_TOTAL "Énergie totale"
|
||||
|
||||
// xsns_05_ds18b20.ino
|
||||
#define D_SENSOR_BUSY "Capteur occupé"
|
||||
|
@ -365,14 +406,14 @@
|
|||
#define D_SENSORS_FOUND "Capteur trouvé"
|
||||
|
||||
// xsns_06_dht.ino
|
||||
#define D_TIMEOUT_WAITING_FOR "Expiré attend pour"
|
||||
#define D_START_SIGNAL_LOW "Signal démarrage bas"
|
||||
#define D_START_SIGNAL_HIGH "Signal démarrage haut"
|
||||
#define D_PULSE "pulse"
|
||||
#define D_CHECKSUM_FAILURE "Echec checksum"
|
||||
#define D_TIMEOUT_WAITING_FOR "Expiration du délai"
|
||||
#define D_START_SIGNAL_LOW "Signal Start bas"
|
||||
#define D_START_SIGNAL_HIGH "Signal Start haut"
|
||||
#define D_PULSE "Impulsion"
|
||||
#define D_CHECKSUM_FAILURE "Erreur checksum"
|
||||
|
||||
// xsns_07_sht1x.ino
|
||||
#define D_SENSOR_DID_NOT_ACK_COMMAND "Le capteur n'a pas ACK la commande"
|
||||
#define D_SENSOR_DID_NOT_ACK_COMMAND "Le capteur n'a pas acquitté la commande"
|
||||
#define D_SHT1X_FOUND "SHT1X found"
|
||||
|
||||
// xsns_18_pms5003.ino
|
||||
|
@ -381,7 +422,7 @@
|
|||
#define D_PARTICALS_BEYOND "Particules"
|
||||
|
||||
// sonoff_template.h
|
||||
#define D_SENSOR_NONE "None"
|
||||
#define D_SENSOR_NONE "Aucun"
|
||||
#define D_SENSOR_DHT11 "DHT11"
|
||||
#define D_SENSOR_AM2301 "AM2301"
|
||||
#define D_SENSOR_SI7021 "SI7021"
|
||||
|
@ -389,14 +430,14 @@
|
|||
#define D_SENSOR_I2C_SCL "I2C SCL"
|
||||
#define D_SENSOR_I2C_SDA "I2C SDA"
|
||||
#define D_SENSOR_WS2812 "WS2812"
|
||||
#define D_SENSOR_IRSEND "IRsend"
|
||||
#define D_SENSOR_SWITCH "Switch" // Suffix "1"
|
||||
#define D_SENSOR_BUTTON "Button" // Suffix "1"
|
||||
#define D_SENSOR_RELAY "Relay" // Suffix "1i"
|
||||
#define D_SENSOR_LED "LED" // Suffix "1i"
|
||||
#define D_SENSOR_PWM "PWM" // Suffix "1"
|
||||
#define D_SENSOR_COUNTER "Counter" // Suffix "1"
|
||||
#define D_SENSOR_IRRECV "IRrecv"
|
||||
#define D_SENSOR_IRSEND "ÉmetIR"
|
||||
#define D_SENSOR_SWITCH "Inter." // Suffix "1"
|
||||
#define D_SENSOR_BUTTON "Bouton" // Suffix "1"
|
||||
#define D_SENSOR_RELAY "Relais" // Suffix "1i"
|
||||
#define D_SENSOR_LED "LED" // Suffix "1i"
|
||||
#define D_SENSOR_PWM "PWM" // Suffix "1"
|
||||
#define D_SENSOR_COUNTER "Compteur" // Suffix "1"
|
||||
#define D_SENSOR_IRRECV "RécptIR"
|
||||
#define D_SENSOR_MHZ_RX "MHZ Rx"
|
||||
#define D_SENSOR_MHZ_TX "MHZ Tx"
|
||||
#define D_SENSOR_PZEM_RX "PZEM Rx"
|
||||
|
@ -405,21 +446,28 @@
|
|||
#define D_SENSOR_SAIR_TX "SAir Tx"
|
||||
#define D_SENSOR_SPI_CS "SPI CS"
|
||||
#define D_SENSOR_SPI_DC "SPI DC"
|
||||
#define D_SENSOR_BACKLIGHT "BkLight"
|
||||
#define D_SENSOR_BACKLIGHT "RétroÉcl"
|
||||
#define D_SENSOR_PMS5003 "PMS5003"
|
||||
#define D_SENSOR_SDS0X1 "SDS0X1"
|
||||
#define D_SENSOR_SBR_RX "SerBr Rx"
|
||||
#define D_SENSOR_SBR_TX "SerBr Tx"
|
||||
#define D_SENSOR_SR04_TRIG "SR04 Tri"
|
||||
#define D_SENSOR_SR04_ECHO "SR04 Ech"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
#define D_UNIT_CENTIMETER "cm"
|
||||
#define D_UNIT_HOUR "h"
|
||||
#define D_UNIT_KILOOHM "kOhm"
|
||||
#define D_UNIT_KILOOHM "kΩ"
|
||||
#define D_UNIT_KILOWATTHOUR "kWh"
|
||||
#define D_UNIT_LUX "lx"
|
||||
#define D_UNIT_MICROGRAM_PER_CUBIC_METER "ug/m3"
|
||||
#define D_UNIT_MICROMETER "um"
|
||||
#define D_UNIT_MICROSECOND "us"
|
||||
#define D_UNIT_MICROGRAM_PER_CUBIC_METER "µg/m3"
|
||||
#define D_UNIT_MICROMETER "µm"
|
||||
#define D_UNIT_MICROSECOND "µs"
|
||||
#define D_UNIT_MILLIAMPERE "mA"
|
||||
#define D_UNIT_MILLISECOND "ms"
|
||||
#define D_UNIT_MINUTE "Min"
|
||||
#define D_UNIT_PARTS_PER_BILLION "ppb"
|
||||
#define D_UNIT_PARTS_PER_DECILITER "ppd"
|
||||
#define D_UNIT_PARTS_PER_MILLION "ppm"
|
||||
#define D_UNIT_PRESSURE "hPa"
|
||||
|
|
|
@ -28,10 +28,14 @@
|
|||
* Use online command StateText to translate ON, OFF, HOLD and TOGGLE.
|
||||
* Use online command Prefix to translate cmnd, stat and tele.
|
||||
*
|
||||
* Updated until v5.12.0e
|
||||
\*********************************************************************/
|
||||
|
||||
//#define LANGUAGE_MODULE_NAME // Enable to display "Module Generic" (ie Spanish), Disable to display "Generic Module" (ie English)
|
||||
|
||||
// HTML (ISO 639-1) Language Code
|
||||
#define D_HTML_LANGUAGE "hu"
|
||||
|
||||
// "2017-03-07T11:08:02" - ISO8601:2004
|
||||
#define D_YEAR_MONTH_SEPARATOR "."
|
||||
#define D_MONTH_DAY_SEPARATOR "."
|
||||
|
@ -56,7 +60,7 @@
|
|||
#define D_BOOT_COUNT "Bootolások száma"
|
||||
#define D_BRIGHTLIGHT "Max. fényerő"
|
||||
#define D_BUTTON "Gomb"
|
||||
#define D_BY "által" // Written by me
|
||||
#define D_BY "tőle:" // Written by me
|
||||
#define D_BYTES "Byte-ok"
|
||||
#define D_CELSIUS "Celsius"
|
||||
#define D_CO2 "Szén-dioxid"
|
||||
|
@ -68,12 +72,14 @@
|
|||
#define D_COUNTER "Számláló"
|
||||
#define D_CURRENT "Áram" // As in Voltage and Current
|
||||
#define D_DATA "Adat"
|
||||
#define D_DARKLIGHT "Min. févnyerő"
|
||||
#define D_DARKLIGHT "Min. fényerő"
|
||||
#define D_DEBUG "Debug"
|
||||
#define D_DISABLED "Letiltva"
|
||||
#define D_DISTANCE "Distance"
|
||||
#define D_DNS_SERVER "DNS Szerver"
|
||||
#define D_DONE "Kész"
|
||||
#define D_DST_TIME "DST"
|
||||
#define D_ECO2 "eCO2"
|
||||
#define D_EMULATION "Emuláció"
|
||||
#define D_ENABLED "Engedélyezve"
|
||||
#define D_ERASE "Törlés"
|
||||
|
@ -124,6 +130,7 @@
|
|||
#define D_RESTART_REASON "Újraindítás oka:"
|
||||
#define D_RESTORE "Visszaállítás"
|
||||
#define D_RETAINED "mentve"
|
||||
#define D_RULE "Rule"
|
||||
#define D_SAVE "Mentés"
|
||||
#define D_SENSOR "Szenzor"
|
||||
#define D_SSID "SSId"
|
||||
|
@ -133,12 +140,15 @@
|
|||
#define D_SUBNET_MASK "Subnet Mask"
|
||||
#define D_SUBSCRIBE_TO "Feliratkozás a"
|
||||
#define D_SUCCESSFUL "Sikeres"
|
||||
#define D_SUNRISE "Sunrise"
|
||||
#define D_SUNSET "Sunset"
|
||||
#define D_TEMPERATURE "Hőmérséklet"
|
||||
#define D_TO "-nak"
|
||||
#define D_TOGGLE "Toggle"
|
||||
#define D_TOPIC "Téma"
|
||||
#define D_TRANSMIT "Továbbít"
|
||||
#define D_TRUE "Igaz"
|
||||
#define D_TVOC "TVOC"
|
||||
#define D_UPGRADE "frissítés"
|
||||
#define D_UPLOAD "Feltöltés"
|
||||
#define D_UPTIME "Üzemidő"
|
||||
|
@ -162,13 +172,6 @@
|
|||
#define D_DATA_SIZE "Adat Méret"
|
||||
#define D_ANALOG_INPUT "Analóg"
|
||||
|
||||
#define D_FINGERPRINT "TLS fingerprint hitelesítése..."
|
||||
#define D_TLS_CONNECT_FAILED_TO "TLS Csatlakozás sikertelen a"
|
||||
#define D_RETRY_IN "Újrapróbálás"
|
||||
#define D_VERIFIED "Hitelesítve"
|
||||
#define D_INSECURE "Nem biztonságos kapcsolat érvénytelen Fingerprint miatt"
|
||||
#define D_CONNECT_FAILED_TO "Sikertelen csatlakozás a"
|
||||
|
||||
// support.ino
|
||||
#define D_OSWATCH "osWatch"
|
||||
#define D_BLOCKED_LOOP "Blocked Loop"
|
||||
|
@ -214,7 +217,7 @@
|
|||
#define D_INFORMATION "Információ"
|
||||
#define D_FIRMWARE_UPGRADE "Firmware Frissítés"
|
||||
#define D_CONSOLE "Konzol"
|
||||
#define D_CONFIRM_RESTART "Újraindítés megerősítése"
|
||||
#define D_CONFIRM_RESTART "Újraindítás megerősítése"
|
||||
|
||||
#define D_CONFIGURE_MODULE "Eszköz konfiguráció"
|
||||
#define D_CONFIGURE_WIFI "WiFi konfiguráció"
|
||||
|
@ -317,6 +320,14 @@
|
|||
#define D_ENABLE_WEBLOG_FOR_RESPONSE "Engedélyezz 2-es weblogolást több információért"
|
||||
#define D_NEED_USER_AND_PASSWORD "Kell felhasználó=<felhasználónév>&jelszó=<jelszó>"
|
||||
|
||||
// xdrv_00_mqtt.ino
|
||||
#define D_FINGERPRINT "TLS fingerprint hitelesítése..."
|
||||
#define D_TLS_CONNECT_FAILED_TO "TLS Csatlakozás sikertelen a"
|
||||
#define D_RETRY_IN "Újrapróbálás"
|
||||
#define D_VERIFIED "Hitelesítve Fingerprint"
|
||||
#define D_INSECURE "Nem biztonságos kapcsolat érvénytelen Fingerprint miatt"
|
||||
#define D_CONNECT_FAILED_TO "Sikertelen csatlakozás a"
|
||||
|
||||
// xdrv_wemohue.ino
|
||||
#define D_MULTICAST_DISABLED "Multicast kikapcsolva"
|
||||
#define D_MULTICAST_REJOINED "Multicast (újra)csatlakozás"
|
||||
|
@ -348,12 +359,42 @@
|
|||
#define D_DOMOTICZ_TEMP_HUM_BARO "Hőm,Párat,Légny"
|
||||
#define D_DOMOTICZ_POWER_ENERGY "Teljesítmény,Energia"
|
||||
#define D_DOMOTICZ_ILLUMINANCE "Fényerő"
|
||||
#define D_DOMOTICZ_COUNT "Szám"
|
||||
#define D_DOMOTICZ_VOLTAGE "Feszültség"
|
||||
#define D_DOMOTICZ_CURRENT "Áram"
|
||||
#define D_DOMOTICZ_COUNT "Szám/PM1"
|
||||
#define D_DOMOTICZ_VOLTAGE "Feszültség/PM2.5"
|
||||
#define D_DOMOTICZ_CURRENT "Áram/PM10"
|
||||
#define D_DOMOTICZ_AIRQUALITY "Légminőség"
|
||||
#define D_DOMOTICZ_UPDATE_TIMER "Update időzítő"
|
||||
|
||||
// xdrv_09_timers.ino
|
||||
#define D_CONFIGURE_TIMER "Configure Timer"
|
||||
#define D_TIMER_PARAMETERS "Timer parameters"
|
||||
#define D_TIMER_ARM "Arm"
|
||||
#define D_TIMER_TIME "Time"
|
||||
#define D_TIMER_DAYS "Days"
|
||||
#define D_TIMER_REPEAT "Repeat"
|
||||
#define D_TIMER_OUTPUT "Output"
|
||||
#define D_TIMER_ACTION "Action"
|
||||
|
||||
// xdrv_10_knx.ino
|
||||
#define D_CONFIGURE_KNX "Configure KNX"
|
||||
#define D_KNX_PARAMETERS "KNX Parameters"
|
||||
#define D_KNX_GENERAL_CONFIG "General"
|
||||
#define D_KNX_PHYSICAL_ADDRESS "Physical Address"
|
||||
#define D_KNX_PHYSICAL_ADDRESS_NOTE "( Must be unique on the KNX network )"
|
||||
#define D_KNX_ENABLE "Enable KNX"
|
||||
#define D_KNX_GROUP_ADDRESS_TO_WRITE "Data to Send to Group Addresses"
|
||||
#define D_ADD "Add"
|
||||
#define D_DELETE "Delete"
|
||||
#define D_REPLY "Reply"
|
||||
#define D_KNX_GROUP_ADDRESS_TO_READ "Group Addresses to Receive Data from"
|
||||
#define D_LOG_KNX "KNX: "
|
||||
#define D_RECEIVED_FROM "Received from"
|
||||
#define D_KNX_COMMAND_WRITE "Write"
|
||||
#define D_KNX_COMMAND_READ "Read"
|
||||
#define D_KNX_COMMAND_OTHER "Other"
|
||||
#define D_SENT_TO "sent to"
|
||||
#define D_KNX_WARNING "The group address ( 0 / 0 / 0 ) is reserved and can not be used."
|
||||
|
||||
// xdrv_03_energy.ino
|
||||
#define D_ENERGY_TODAY "Mai Energia"
|
||||
#define D_ENERGY_YESTERDAY "Tegnapi Energia"
|
||||
|
@ -407,9 +448,15 @@
|
|||
#define D_SENSOR_SPI_DC "SPI DC"
|
||||
#define D_SENSOR_BACKLIGHT "Háttérvil"
|
||||
#define D_SENSOR_PMS5003 "PMS5003"
|
||||
#define D_SENSOR_SDS0X1 "SDS0X1"
|
||||
#define D_SENSOR_SBR_RX "SerBr Rx"
|
||||
#define D_SENSOR_SBR_TX "SerBr Tx"
|
||||
#define D_SENSOR_SR04_TRIG "SR04 Tri"
|
||||
#define D_SENSOR_SR04_ECHO "SR04 Ech"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
#define D_UNIT_CENTIMETER "cm"
|
||||
#define D_UNIT_HOUR "ó"
|
||||
#define D_UNIT_KILOOHM "kOhm"
|
||||
#define D_UNIT_KILOWATTHOUR "kWh"
|
||||
|
@ -420,6 +467,7 @@
|
|||
#define D_UNIT_MILLIAMPERE "mA"
|
||||
#define D_UNIT_MILLISECOND "ms"
|
||||
#define D_UNIT_MINUTE "p"
|
||||
#define D_UNIT_PARTS_PER_BILLION "ppb"
|
||||
#define D_UNIT_PARTS_PER_DECILITER "ppd"
|
||||
#define D_UNIT_PARTS_PER_MILLION "ppm"
|
||||
#define D_UNIT_PRESSURE "hPa"
|
||||
|
@ -454,4 +502,4 @@
|
|||
#define D_LOG_UPNP "UPP: " // UPnP
|
||||
#define D_LOG_WIFI "WIF: " // Wifi
|
||||
|
||||
#endif // _LANGUAGE_EN_GB_H_
|
||||
#endif // _LANGUAGE_HU_HU_H_
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
it-IT.h - localization for Italian - Italy for Sonoff-Tasmota
|
||||
|
||||
Copyright (C) 2018 Gennaro Tortone
|
||||
Copyright (C) 2018 Gennaro Tortone - some mods by Antonio Fragola
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -28,10 +28,14 @@
|
|||
* Use online command StateText to translate ON, OFF, HOLD and TOGGLE.
|
||||
* Use online command Prefix to translate cmnd, stat and tele.
|
||||
*
|
||||
* Updated until v5.13.0
|
||||
\*********************************************************************/
|
||||
|
||||
#define LANGUAGE_MODULE_NAME // Enable to display "Module Generic" (ie Spanish), Disable to display "Generic Module" (ie English)
|
||||
|
||||
// HTML (ISO 639-1) Language Code
|
||||
#define D_HTML_LANGUAGE "it"
|
||||
|
||||
// "2017-03-07T11:08:02" - ISO8601:2004
|
||||
#define D_YEAR_MONTH_SEPARATOR "-"
|
||||
#define D_MONTH_DAY_SEPARATOR "-"
|
||||
|
@ -47,7 +51,7 @@
|
|||
|
||||
// Common
|
||||
#define D_ADMIN "Admin"
|
||||
#define D_AIR_QUALITY "Qualita' dell'aria"
|
||||
#define D_AIR_QUALITY "Qualità dell'aria"
|
||||
#define D_AP "AP" // Access Point
|
||||
#define D_AS "come"
|
||||
#define D_AUTO "AUTO"
|
||||
|
@ -71,9 +75,11 @@
|
|||
#define D_DARKLIGHT "Scuro"
|
||||
#define D_DEBUG "Debug"
|
||||
#define D_DISABLED "Disabilitato"
|
||||
#define D_DISTANCE "Distance"
|
||||
#define D_DNS_SERVER "DNS Server"
|
||||
#define D_DONE "Fatto"
|
||||
#define D_DST_TIME "DST"
|
||||
#define D_ECO2 "eCO2"
|
||||
#define D_EMULATION "Emulazione"
|
||||
#define D_ENABLED "Abilitato"
|
||||
#define D_ERASE "Cancellare"
|
||||
|
@ -90,7 +96,7 @@
|
|||
#define D_GROUP "Gruppo"
|
||||
#define D_HOST "Host"
|
||||
#define D_HOSTNAME "Nome Host"
|
||||
#define D_HUMIDITY "Umidita'"
|
||||
#define D_HUMIDITY "Umidità"
|
||||
#define D_ILLUMINANCE "Illuminazione"
|
||||
#define D_IMMEDIATE "immediato" // Button immediate
|
||||
#define D_INDEX "Indice"
|
||||
|
@ -124,6 +130,7 @@
|
|||
#define D_RESTART_REASON "Causa Riavvio"
|
||||
#define D_RESTORE "ripristino"
|
||||
#define D_RETAINED "salvato"
|
||||
#define D_RULE "Rule"
|
||||
#define D_SAVE "Salva"
|
||||
#define D_SENSOR "Sensore"
|
||||
#define D_SSID "SSId"
|
||||
|
@ -133,12 +140,15 @@
|
|||
#define D_SUBNET_MASK "Maschera sottorete"
|
||||
#define D_SUBSCRIBE_TO "Sottoscrivi a"
|
||||
#define D_SUCCESSFUL "Riuscito"
|
||||
#define D_SUNRISE "Sunrise"
|
||||
#define D_SUNSET "Sunset"
|
||||
#define D_TEMPERATURE "Temperatura"
|
||||
#define D_TO "a"
|
||||
#define D_TOGGLE "Toggle"
|
||||
#define D_TOPIC "Topic"
|
||||
#define D_TRANSMIT "Trasmesso"
|
||||
#define D_TRUE "True"
|
||||
#define D_TVOC "TVOC"
|
||||
#define D_UPGRADE "aggiornamento"
|
||||
#define D_UPLOAD "Invio"
|
||||
#define D_UPTIME "Uptime"
|
||||
|
@ -162,13 +172,6 @@
|
|||
#define D_DATA_SIZE "Dimensione Dati"
|
||||
#define D_ANALOG_INPUT "Ingresso Analogico"
|
||||
|
||||
#define D_FINGERPRINT "Verifica TLS fingerprint..."
|
||||
#define D_TLS_CONNECT_FAILED_TO "Connessione TLS fallita a"
|
||||
#define D_RETRY_IN "Nuovo tentativo in"
|
||||
#define D_VERIFIED "Verificato"
|
||||
#define D_INSECURE "Connessione insicura a causa di Fingerprint non valido"
|
||||
#define D_CONNECT_FAILED_TO "Connessione Fallita a"
|
||||
|
||||
// support.ino
|
||||
#define D_OSWATCH "osWatch"
|
||||
#define D_BLOCKED_LOOP "Ciclo Bloccato"
|
||||
|
@ -177,7 +180,7 @@
|
|||
#define D_FAILED_TO_START "partenza fallita"
|
||||
#define D_PATCH_ISSUE_2186 "Patch issue 2186"
|
||||
#define D_CONNECTING_TO_AP "Connessione ad AP"
|
||||
#define D_IN_MODE "in modalita'"
|
||||
#define D_IN_MODE "in modalità"
|
||||
#define D_CONNECT_FAILED_NO_IP_ADDRESS "Connessione fallita, indirizzo IP non ricevuto"
|
||||
#define D_CONNECT_FAILED_AP_NOT_REACHED "Connessione fallita, AP non raggiungibile"
|
||||
#define D_CONNECT_FAILED_WRONG_PASSWORD "Connessione fallita, password AP non corretta"
|
||||
|
@ -208,7 +211,7 @@
|
|||
|
||||
#define D_RESTART_IN "Riavvio in"
|
||||
#define D_SECONDS "secondi"
|
||||
#define D_DEVICE_WILL_RESTART "Il dispositivo verra' riavviato tra pochi secondi"
|
||||
#define D_DEVICE_WILL_RESTART "Il dispositivo verrà riavviato tra pochi secondi"
|
||||
#define D_BUTTON_TOGGLE "On/Off"
|
||||
#define D_CONFIGURATION "Configurazione"
|
||||
#define D_INFORMATION "Informazioni"
|
||||
|
@ -226,7 +229,7 @@
|
|||
#define D_RESET_CONFIGURATION "Reset Configurazione"
|
||||
#define D_BACKUP_CONFIGURATION "Backup Configurazione"
|
||||
#define D_RESTORE_CONFIGURATION "Ripristino Configurazione"
|
||||
#define D_MAIN_MENU "Menu' Principale"
|
||||
#define D_MAIN_MENU "Menu Principale"
|
||||
|
||||
#define D_MODULE_PARAMETERS "Parametri del modulo"
|
||||
#define D_MODULE_TYPE "Tipo modulo"
|
||||
|
@ -240,7 +243,7 @@
|
|||
#define D_NO_NETWORKS_FOUND "Nessuna rete trovata"
|
||||
#define D_REFRESH_TO_SCAN_AGAIN "Ricarica per nuova scansione"
|
||||
#define D_DUPLICATE_ACCESSPOINT "AccessPoint duplicato"
|
||||
#define D_SKIPPING_LOW_QUALITY "Ignorato a causa di bassa qualita'"
|
||||
#define D_SKIPPING_LOW_QUALITY "Ignorato a causa di bassa qualità"
|
||||
#define D_RSSI "RSSI"
|
||||
#define D_WEP "WEP"
|
||||
#define D_WPA_PSK "WPA PSK"
|
||||
|
@ -314,9 +317,17 @@
|
|||
#define D_UPLOAD_ERROR_CODE "Codice errore invio"
|
||||
|
||||
#define D_ENTER_COMMAND "Inserire comando"
|
||||
#define D_ENABLE_WEBLOG_FOR_RESPONSE "Abilitare weblog 2 se e' attesa una risposta"
|
||||
#define D_ENABLE_WEBLOG_FOR_RESPONSE "Abilitare weblog 2 se è attesa una risposta"
|
||||
#define D_NEED_USER_AND_PASSWORD "Richiesto user=<username>&password=<password>"
|
||||
|
||||
// xdrv_00_mqtt.ino
|
||||
#define D_FINGERPRINT "Verifica TLS fingerprint..."
|
||||
#define D_TLS_CONNECT_FAILED_TO "Connessione TLS fallita a"
|
||||
#define D_RETRY_IN "Nuovo tentativo in"
|
||||
#define D_VERIFIED "Verificato Fingerprint"
|
||||
#define D_INSECURE "Connessione insicura a causa di Fingerprint non valido"
|
||||
#define D_CONNECT_FAILED_TO "Connessione Fallita a"
|
||||
|
||||
// xdrv_wemohue.ino
|
||||
#define D_MULTICAST_DISABLED "Multicast disabilitato"
|
||||
#define D_MULTICAST_REJOINED "Multicast (ri)associato"
|
||||
|
@ -348,12 +359,42 @@
|
|||
#define D_DOMOTICZ_TEMP_HUM_BARO "Temp,Hum,Baro"
|
||||
#define D_DOMOTICZ_POWER_ENERGY "Power,Energy"
|
||||
#define D_DOMOTICZ_ILLUMINANCE "Illuminance"
|
||||
#define D_DOMOTICZ_COUNT "Count"
|
||||
#define D_DOMOTICZ_VOLTAGE "Voltage"
|
||||
#define D_DOMOTICZ_CURRENT "Current"
|
||||
#define D_DOMOTICZ_COUNT "Count/PM1"
|
||||
#define D_DOMOTICZ_VOLTAGE "Voltage/PM2.5"
|
||||
#define D_DOMOTICZ_CURRENT "Current/PM10"
|
||||
#define D_DOMOTICZ_AIRQUALITY "AirQuality"
|
||||
#define D_DOMOTICZ_UPDATE_TIMER "Intervallo di aggiornamento"
|
||||
|
||||
// xdrv_09_timers.ino
|
||||
#define D_CONFIGURE_TIMER "Configura Timer"
|
||||
#define D_TIMER_PARAMETERS "Parametri Timer"
|
||||
#define D_TIMER_ARM "Attiva"
|
||||
#define D_TIMER_TIME "Ora"
|
||||
#define D_TIMER_DAYS "Giorni"
|
||||
#define D_TIMER_REPEAT "Ripeti"
|
||||
#define D_TIMER_OUTPUT "Output"
|
||||
#define D_TIMER_ACTION "Azione"
|
||||
|
||||
// xdrv_10_knx.ino
|
||||
#define D_CONFIGURE_KNX "Configura KNX"
|
||||
#define D_KNX_PARAMETERS "Parametri KNX"
|
||||
#define D_KNX_GENERAL_CONFIG "Generale"
|
||||
#define D_KNX_PHYSICAL_ADDRESS "Indirizzo Fisico"
|
||||
#define D_KNX_PHYSICAL_ADDRESS_NOTE "( Deve essere univoco nella rete KNX )"
|
||||
#define D_KNX_ENABLE "Abilita KNX"
|
||||
#define D_KNX_GROUP_ADDRESS_TO_WRITE "Dati da Inviare al Gruppo di Indirizzi"
|
||||
#define D_ADD "Aggiungi"
|
||||
#define D_DELETE "Elimina"
|
||||
#define D_REPLY "Rispondi"
|
||||
#define D_KNX_GROUP_ADDRESS_TO_READ "Gruppo di Indirizzi da cui Ricevere Dati"
|
||||
#define D_LOG_KNX "KNX: "
|
||||
#define D_RECEIVED_FROM "Ricevuto Da"
|
||||
#define D_KNX_COMMAND_WRITE "Scrivi"
|
||||
#define D_KNX_COMMAND_READ "Leggi"
|
||||
#define D_KNX_COMMAND_OTHER "Altro"
|
||||
#define D_SENT_TO "invia a"
|
||||
#define D_KNX_WARNING "L'indirizzo del gruppo ( 0 / 0 / 0 ) è riservato e non può essere usato."
|
||||
|
||||
// xdrv_03_energy.ino
|
||||
#define D_ENERGY_TODAY "Energia Oggi"
|
||||
#define D_ENERGY_YESTERDAY "Energia Ieri"
|
||||
|
@ -381,7 +422,7 @@
|
|||
#define D_PARTICALS_BEYOND "Particelle"
|
||||
|
||||
// sonoff_template.h
|
||||
#define D_SENSOR_NONE "None"
|
||||
#define D_SENSOR_NONE "Nessuno"
|
||||
#define D_SENSOR_DHT11 "DHT11"
|
||||
#define D_SENSOR_AM2301 "AM2301"
|
||||
#define D_SENSOR_SI7021 "SI7021"
|
||||
|
@ -407,9 +448,15 @@
|
|||
#define D_SENSOR_SPI_DC "SPI DC"
|
||||
#define D_SENSOR_BACKLIGHT "BkLight"
|
||||
#define D_SENSOR_PMS5003 "PMS5003"
|
||||
#define D_SENSOR_SDS0X1 "SDS0X1"
|
||||
#define D_SENSOR_SBR_RX "SerBr Rx"
|
||||
#define D_SENSOR_SBR_TX "SerBr Tx"
|
||||
#define D_SENSOR_SR04_TRIG "SR04 Tri"
|
||||
#define D_SENSOR_SR04_ECHO "SR04 Ech"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
#define D_UNIT_CENTIMETER "cm"
|
||||
#define D_UNIT_HOUR "Hr"
|
||||
#define D_UNIT_KILOOHM "kOhm"
|
||||
#define D_UNIT_KILOWATTHOUR "kWh"
|
||||
|
@ -420,6 +467,7 @@
|
|||
#define D_UNIT_MILLIAMPERE "mA"
|
||||
#define D_UNIT_MILLISECOND "ms"
|
||||
#define D_UNIT_MINUTE "Min"
|
||||
#define D_UNIT_PARTS_PER_BILLION "ppb"
|
||||
#define D_UNIT_PARTS_PER_DECILITER "ppd"
|
||||
#define D_UNIT_PARTS_PER_MILLION "ppm"
|
||||
#define D_UNIT_PRESSURE "hPa"
|
||||
|
|
|
@ -28,10 +28,14 @@
|
|||
* Use online command StateText to translate ON, OFF, HOLD and TOGGLE.
|
||||
* Use online command Prefix to translate cmnd, stat and tele.
|
||||
*
|
||||
* Updated until v5.12.0l
|
||||
\*********************************************************************/
|
||||
|
||||
//#define LANGUAGE_MODULE_NAME // Enable to display "Module Generic" (ie Spanish), Disable to display "Generic Module" (ie English)
|
||||
|
||||
// HTML (ISO 639-1) Language Code
|
||||
#define D_HTML_LANGUAGE "nl"
|
||||
|
||||
// "2017-03-07T11:08:02" - ISO8601:2004
|
||||
#define D_YEAR_MONTH_SEPARATOR "-"
|
||||
#define D_MONTH_DAY_SEPARATOR "-"
|
||||
|
@ -71,9 +75,11 @@
|
|||
#define D_DARKLIGHT "Donker"
|
||||
#define D_DEBUG "Debug"
|
||||
#define D_DISABLED "Uitgeschakeld"
|
||||
#define D_DISTANCE "Afstand"
|
||||
#define D_DNS_SERVER "DNS Server"
|
||||
#define D_DONE "Klaar"
|
||||
#define D_DST_TIME "ZT"
|
||||
#define D_ECO2 "eCO2"
|
||||
#define D_EMULATION "Emulatie"
|
||||
#define D_ENABLED "Geactiveerd"
|
||||
#define D_ERASE "Wissen"
|
||||
|
@ -107,7 +113,7 @@
|
|||
#define D_OFF "Uit"
|
||||
#define D_OFFLINE "Offline"
|
||||
#define D_OK "Ok"
|
||||
#define D_ON "Ann"
|
||||
#define D_ON "Aan"
|
||||
#define D_ONLINE "Online"
|
||||
#define D_PASSWORD "Wachtwoord"
|
||||
#define D_PORT "Poort"
|
||||
|
@ -124,6 +130,7 @@
|
|||
#define D_RESTART_REASON "Reden herstart"
|
||||
#define D_RESTORE "herstellen"
|
||||
#define D_RETAINED "retained"
|
||||
#define D_RULE "Regel"
|
||||
#define D_SAVE "Opslaan"
|
||||
#define D_SENSOR "Sensor"
|
||||
#define D_SSID "SSId"
|
||||
|
@ -133,12 +140,15 @@
|
|||
#define D_SUBNET_MASK "Subnet Masker"
|
||||
#define D_SUBSCRIBE_TO "Abonneer op"
|
||||
#define D_SUCCESSFUL "Gelukt"
|
||||
#define D_SUNRISE "Zonsopgang"
|
||||
#define D_SUNSET "Zonsondergang"
|
||||
#define D_TEMPERATURE "Temperatuur"
|
||||
#define D_TO "naar"
|
||||
#define D_TOGGLE "Toggle" // Wissel, Tuimel
|
||||
#define D_TOPIC "Topic" // Onderwerp
|
||||
#define D_TRANSMIT "Verzend"
|
||||
#define D_TRUE "Waar"
|
||||
#define D_TVOC "TVOC"
|
||||
#define D_UPGRADE "opwaarderen"
|
||||
#define D_UPLOAD "Verzenden"
|
||||
#define D_UPTIME "Bedrijfstijd"
|
||||
|
@ -162,13 +172,6 @@
|
|||
#define D_DATA_SIZE "Data lengte"
|
||||
#define D_ANALOG_INPUT "Analoog"
|
||||
|
||||
#define D_FINGERPRINT "Controleer TLS vingerafdruk..."
|
||||
#define D_TLS_CONNECT_FAILED_TO "TLS Verbinding mislukt naar"
|
||||
#define D_RETRY_IN "Opnieuw proberen over"
|
||||
#define D_VERIFIED "Gecontroleerd"
|
||||
#define D_INSECURE "Door ongeldige vingerafdruk een onveilige verbinding"
|
||||
#define D_CONNECT_FAILED_TO "Verbinding mislukt naar"
|
||||
|
||||
// support.ino
|
||||
#define D_OSWATCH "osWatch"
|
||||
#define D_BLOCKED_LOOP "Blocked Loop"
|
||||
|
@ -317,6 +320,14 @@
|
|||
#define D_ENABLE_WEBLOG_FOR_RESPONSE "Schakel weblog 2 in indien antwoord verwacht"
|
||||
#define D_NEED_USER_AND_PASSWORD "Benodig user=<gebruiker>&password=<webwachtwoord>"
|
||||
|
||||
// xdrv_00_mqtt.ino
|
||||
#define D_FINGERPRINT "Controleer TLS vingerafdruk..."
|
||||
#define D_TLS_CONNECT_FAILED_TO "TLS Verbinding mislukt naar"
|
||||
#define D_RETRY_IN "Opnieuw proberen over"
|
||||
#define D_VERIFIED "Gecontroleerd met vingerafdruk"
|
||||
#define D_INSECURE "Door ongeldige vingerafdruk een onveilige verbinding"
|
||||
#define D_CONNECT_FAILED_TO "Verbinding mislukt naar"
|
||||
|
||||
// xdrv_wemohue.ino
|
||||
#define D_MULTICAST_DISABLED "Multicast uitgeschakeld"
|
||||
#define D_MULTICAST_REJOINED "Multicast verbonden"
|
||||
|
@ -348,12 +359,42 @@
|
|||
#define D_DOMOTICZ_TEMP_HUM_BARO "Temp,Hum,Baro"
|
||||
#define D_DOMOTICZ_POWER_ENERGY "Power,Energy"
|
||||
#define D_DOMOTICZ_ILLUMINANCE "Illuminance"
|
||||
#define D_DOMOTICZ_COUNT "Count"
|
||||
#define D_DOMOTICZ_VOLTAGE "Spanning"
|
||||
#define D_DOMOTICZ_CURRENT "Stroom"
|
||||
#define D_DOMOTICZ_COUNT "Count/PM1"
|
||||
#define D_DOMOTICZ_VOLTAGE "Spanning/PM2,5"
|
||||
#define D_DOMOTICZ_CURRENT "Stroom/PM10"
|
||||
#define D_DOMOTICZ_AIRQUALITY "AirQuality"
|
||||
#define D_DOMOTICZ_UPDATE_TIMER "Bijwerk timer"
|
||||
|
||||
// xdrv_09_timers.ino
|
||||
#define D_CONFIGURE_TIMER "Configureer Tijdschakelaar"
|
||||
#define D_TIMER_PARAMETERS "Tijdschakelaar parameters"
|
||||
#define D_TIMER_ARM "Actief"
|
||||
#define D_TIMER_TIME "Tijd"
|
||||
#define D_TIMER_DAYS "Dagen"
|
||||
#define D_TIMER_REPEAT "Herhaal"
|
||||
#define D_TIMER_OUTPUT "Uitgang"
|
||||
#define D_TIMER_ACTION "Actie"
|
||||
|
||||
// xdrv_10_knx.ino
|
||||
#define D_CONFIGURE_KNX "Configure KNX"
|
||||
#define D_KNX_PARAMETERS "KNX Parameters"
|
||||
#define D_KNX_GENERAL_CONFIG "General"
|
||||
#define D_KNX_PHYSICAL_ADDRESS "Physical Address"
|
||||
#define D_KNX_PHYSICAL_ADDRESS_NOTE "( Must be unique on the KNX network )"
|
||||
#define D_KNX_ENABLE "Enable KNX"
|
||||
#define D_KNX_GROUP_ADDRESS_TO_WRITE "Data to Send to Group Addresses"
|
||||
#define D_ADD "Add"
|
||||
#define D_DELETE "Delete"
|
||||
#define D_REPLY "Reply"
|
||||
#define D_KNX_GROUP_ADDRESS_TO_READ "Group Addresses to Receive Data from"
|
||||
#define D_LOG_KNX "KNX: "
|
||||
#define D_RECEIVED_FROM "Received from"
|
||||
#define D_KNX_COMMAND_WRITE "Write"
|
||||
#define D_KNX_COMMAND_READ "Read"
|
||||
#define D_KNX_COMMAND_OTHER "Other"
|
||||
#define D_SENT_TO "sent to"
|
||||
#define D_KNX_WARNING "The group address ( 0 / 0 / 0 ) is reserved and can not be used."
|
||||
|
||||
// xdrv_03_energy.ino
|
||||
#define D_ENERGY_TODAY "Verbruik vandaag"
|
||||
#define D_ENERGY_YESTERDAY "Verbruik gisteren"
|
||||
|
@ -407,9 +448,15 @@
|
|||
#define D_SENSOR_SPI_DC "SPI DC"
|
||||
#define D_SENSOR_BACKLIGHT "BkLight"
|
||||
#define D_SENSOR_PMS5003 "PMS5003"
|
||||
#define D_SENSOR_SDS0X1 "SDS0X1"
|
||||
#define D_SENSOR_SBR_RX "SerBr Rx"
|
||||
#define D_SENSOR_SBR_TX "SerBr Tx"
|
||||
#define D_SENSOR_SR04_TRIG "SR04 Tri"
|
||||
#define D_SENSOR_SR04_ECHO "SR04 Ech"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
#define D_UNIT_CENTIMETER "cm"
|
||||
#define D_UNIT_HOUR "h"
|
||||
#define D_UNIT_KILOOHM "kOhm"
|
||||
#define D_UNIT_KILOWATTHOUR "kWh"
|
||||
|
@ -420,6 +467,7 @@
|
|||
#define D_UNIT_MILLIAMPERE "mA"
|
||||
#define D_UNIT_MILLISECOND "ms"
|
||||
#define D_UNIT_MINUTE "Min"
|
||||
#define D_UNIT_PARTS_PER_BILLION "ppb"
|
||||
#define D_UNIT_PARTS_PER_DECILITER "ppd"
|
||||
#define D_UNIT_PARTS_PER_MILLION "ppm"
|
||||
#define D_UNIT_PRESSURE "hPa"
|
||||
|
|
|
@ -28,10 +28,14 @@
|
|||
* Use online command StateText to translate ON, OFF, HOLD and TOGGLE.
|
||||
* Use online command Prefix to translate cmnd, stat and tele.
|
||||
*
|
||||
* Updated until v5.12.0d
|
||||
\*********************************************************************/
|
||||
|
||||
//#define LANGUAGE_MODULE_NAME // Enable to display "Module Generic" (ie Spanish), Disable to display "Generic Module" (ie English)
|
||||
|
||||
// HTML (ISO 639-1) Language Code
|
||||
#define D_HTML_LANGUAGE "pl"
|
||||
|
||||
// "2017-03-07T11:08:02" - ISO8601:2004
|
||||
#define D_YEAR_MONTH_SEPARATOR "-"
|
||||
#define D_MONTH_DAY_SEPARATOR "-"
|
||||
|
@ -71,9 +75,11 @@
|
|||
#define D_DARKLIGHT "Ciemny"
|
||||
#define D_DEBUG "Debug"
|
||||
#define D_DISABLED "Zablokowany"
|
||||
#define D_DISTANCE "Distance"
|
||||
#define D_DNS_SERVER "Server DNS"
|
||||
#define D_DONE "Wykonane"
|
||||
#define D_DST_TIME "DST"
|
||||
#define D_ECO2 "eCO2"
|
||||
#define D_EMULATION "Emulacja"
|
||||
#define D_ENABLED "Otwarty"
|
||||
#define D_ERASE "Nadpisz"
|
||||
|
@ -124,6 +130,7 @@
|
|||
#define D_RESTART_REASON "Przyczyna restartu"
|
||||
#define D_RESTORE "Przywracanie"
|
||||
#define D_RETAINED "Zachowane"
|
||||
#define D_RULE "Rule"
|
||||
#define D_SAVE "Zapisz"
|
||||
#define D_SENSOR "Czujnik"
|
||||
#define D_SSID "SSID"
|
||||
|
@ -133,12 +140,15 @@
|
|||
#define D_SUBNET_MASK "Maska podsieci"
|
||||
#define D_SUBSCRIBE_TO "Subskrybuj do"
|
||||
#define D_SUCCESSFUL "Powodzenie"
|
||||
#define D_SUNRISE "Sunrise"
|
||||
#define D_SUNSET "Sunset"
|
||||
#define D_TEMPERATURE "Temperatura"
|
||||
#define D_TO "do"
|
||||
#define D_TOGGLE "Przełącz"
|
||||
#define D_TOPIC "Temat"
|
||||
#define D_TRANSMIT "Wyślij"
|
||||
#define D_TRUE "Prawda"
|
||||
#define D_TVOC "TVOC"
|
||||
#define D_UPGRADE "aktualizacji"
|
||||
#define D_UPLOAD "Wgraj"
|
||||
#define D_UPTIME "Uptime"
|
||||
|
@ -162,13 +172,6 @@
|
|||
#define D_DATA_SIZE "Wielkość danych"
|
||||
#define D_ANALOG_INPUT "Wej_analogowe"
|
||||
|
||||
#define D_FINGERPRINT "Weryfikuj odcisk TLS..."
|
||||
#define D_TLS_CONNECT_FAILED_TO "Nieudane połączenie TLS do"
|
||||
#define D_RETRY_IN "Spróbuj ponownie"
|
||||
#define D_VERIFIED "Zweryfikowano"
|
||||
#define D_INSECURE "Nieprawidłowe połączenie z powodu błędnego odcisku TLS"
|
||||
#define D_CONNECT_FAILED_TO "Nie udało się nawiązać połączenia"
|
||||
|
||||
// support.ino
|
||||
#define D_OSWATCH "osWatch"
|
||||
#define D_BLOCKED_LOOP "Pętla zablokowana"
|
||||
|
@ -317,6 +320,14 @@
|
|||
#define D_ENABLE_WEBLOG_FOR_RESPONSE "Włącz poziom 2 zapisu Weblog, jeśli oczekiwana jest odpowiedź"
|
||||
#define D_NEED_USER_AND_PASSWORD "Wymagany użytkownik=<username>&hasło=<password>"
|
||||
|
||||
// xdrv_00_mqtt.ino
|
||||
#define D_FINGERPRINT "Weryfikuj odcisk TLS..."
|
||||
#define D_TLS_CONNECT_FAILED_TO "Nieudane połączenie TLS do"
|
||||
#define D_RETRY_IN "Spróbuj ponownie"
|
||||
#define D_VERIFIED "Zweryfikowano odcisku"
|
||||
#define D_INSECURE "Nieprawidłowe połączenie z powodu błędnego odcisku TLS"
|
||||
#define D_CONNECT_FAILED_TO "Nie udało się nawiązać połączenia"
|
||||
|
||||
// xdrv_wemohue.ino
|
||||
#define D_MULTICAST_DISABLED "Multicast jest wyłączony"
|
||||
#define D_MULTICAST_REJOINED "Multicast (re)dołączony"
|
||||
|
@ -348,12 +359,42 @@
|
|||
#define D_DOMOTICZ_TEMP_HUM_BARO "Temp,Wilg,Cis"
|
||||
#define D_DOMOTICZ_POWER_ENERGY "Moc,Energia"
|
||||
#define D_DOMOTICZ_ILLUMINANCE "Oświetl."
|
||||
#define D_DOMOTICZ_COUNT "Licznik"
|
||||
#define D_DOMOTICZ_VOLTAGE "Napięcie"
|
||||
#define D_DOMOTICZ_CURRENT "Prąd"
|
||||
#define D_DOMOTICZ_COUNT "Licznik/PM1"
|
||||
#define D_DOMOTICZ_VOLTAGE "Napięcie/PM2,5"
|
||||
#define D_DOMOTICZ_CURRENT "Prąd/PM10"
|
||||
#define D_DOMOTICZ_AIRQUALITY "AirQuality"
|
||||
#define D_DOMOTICZ_UPDATE_TIMER "Zaktualizuj czasomierz"
|
||||
|
||||
// xdrv_09_timers.ino
|
||||
#define D_CONFIGURE_TIMER "Configure Timer"
|
||||
#define D_TIMER_PARAMETERS "Timer parameters"
|
||||
#define D_TIMER_ARM "Arm"
|
||||
#define D_TIMER_TIME "Time"
|
||||
#define D_TIMER_DAYS "Days"
|
||||
#define D_TIMER_REPEAT "Repeat"
|
||||
#define D_TIMER_OUTPUT "Output"
|
||||
#define D_TIMER_ACTION "Action"
|
||||
|
||||
// xdrv_10_knx.ino
|
||||
#define D_CONFIGURE_KNX "Configure KNX"
|
||||
#define D_KNX_PARAMETERS "KNX Parameters"
|
||||
#define D_KNX_GENERAL_CONFIG "General"
|
||||
#define D_KNX_PHYSICAL_ADDRESS "Physical Address"
|
||||
#define D_KNX_PHYSICAL_ADDRESS_NOTE "( Must be unique on the KNX network )"
|
||||
#define D_KNX_ENABLE "Enable KNX"
|
||||
#define D_KNX_GROUP_ADDRESS_TO_WRITE "Data to Send to Group Addresses"
|
||||
#define D_ADD "Add"
|
||||
#define D_DELETE "Delete"
|
||||
#define D_REPLY "Reply"
|
||||
#define D_KNX_GROUP_ADDRESS_TO_READ "Group Addresses to Receive Data from"
|
||||
#define D_LOG_KNX "KNX: "
|
||||
#define D_RECEIVED_FROM "Received from"
|
||||
#define D_KNX_COMMAND_WRITE "Write"
|
||||
#define D_KNX_COMMAND_READ "Read"
|
||||
#define D_KNX_COMMAND_OTHER "Other"
|
||||
#define D_SENT_TO "sent to"
|
||||
#define D_KNX_WARNING "The group address ( 0 / 0 / 0 ) is reserved and can not be used."
|
||||
|
||||
// xdrv_03_energy.ino
|
||||
#define D_ENERGY_TODAY "Energia Dzisiaj"
|
||||
#define D_ENERGY_YESTERDAY "Energia Wczoraj"
|
||||
|
@ -407,9 +448,15 @@
|
|||
#define D_SENSOR_SPI_DC "SPI DC"
|
||||
#define D_SENSOR_BACKLIGHT "BkLight"
|
||||
#define D_SENSOR_PMS5003 "PMS5003"
|
||||
#define D_SENSOR_SDS0X1 "SDS0X1"
|
||||
#define D_SENSOR_SBR_RX "SerBr Rx"
|
||||
#define D_SENSOR_SBR_TX "SerBr Tx"
|
||||
#define D_SENSOR_SR04_TRIG "SR04 Tri"
|
||||
#define D_SENSOR_SR04_ECHO "SR04 Ech"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
#define D_UNIT_CENTIMETER "cm"
|
||||
#define D_UNIT_HOUR "Godz"
|
||||
#define D_UNIT_KILOOHM "kOhm"
|
||||
#define D_UNIT_KILOWATTHOUR "kWh"
|
||||
|
@ -420,6 +467,7 @@
|
|||
#define D_UNIT_MILLIAMPERE "mA"
|
||||
#define D_UNIT_MILLISECOND "ms"
|
||||
#define D_UNIT_MINUTE "Min"
|
||||
#define D_UNIT_PARTS_PER_BILLION "ppb"
|
||||
#define D_UNIT_PARTS_PER_DECILITER "ppd"
|
||||
#define D_UNIT_PARTS_PER_MILLION "ppm"
|
||||
#define D_UNIT_PRESSURE "hPa"
|
||||
|
|
|
@ -0,0 +1,505 @@
|
|||
/*
|
||||
pt-BR.h - localization for Portuguese - Brazil for Sonoff-Tasmota
|
||||
|
||||
Copyright (C) 2018 Fabiano Bovo
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _LANGUAGE_PT_BR_H_
|
||||
#define _LANGUAGE_PT_BR_H_
|
||||
|
||||
/*************************** ATTENTION *******************************\
|
||||
*
|
||||
* Due to memory constraints only UTF-8 is supported.
|
||||
* To save code space keep text as short as possible.
|
||||
* Time and Date provided by SDK can not be localized (yet).
|
||||
* Use online command StateText to translate ON, OFF, HOLD and TOGGLE.
|
||||
* Use online command Prefix to translate cmnd, stat and tele.
|
||||
*
|
||||
* Updated until v5.13.0
|
||||
\*********************************************************************/
|
||||
|
||||
//#define LANGUAGE_MODULE_NAME // Enable to display "Module Generic" (ie Spanish), Disable to display "Generic Module" (ie English)
|
||||
|
||||
// HTML (ISO 639-1) Language Code
|
||||
#define D_HTML_LANGUAGE "pt"
|
||||
|
||||
// "2017-03-07T11:08:02" - ISO8601:2004
|
||||
#define D_YEAR_MONTH_SEPARATOR "-"
|
||||
#define D_MONTH_DAY_SEPARATOR "-"
|
||||
#define D_DATE_TIME_SEPARATOR "T"
|
||||
#define D_HOUR_MINUTE_SEPARATOR ":"
|
||||
#define D_MINUTE_SECOND_SEPARATOR ":"
|
||||
|
||||
#define D_DAY3LIST "DomSegTerQuaQuiSexSab"
|
||||
#define D_MONTH3LIST "JanFevMarAbrMaiJunJulAgoSepOutNovDez"
|
||||
|
||||
// Non JSON decimal separator
|
||||
#define D_DECIMAL_SEPARATOR ","
|
||||
|
||||
// Common
|
||||
#define D_ADMIN "Admin"
|
||||
#define D_AIR_QUALITY "Qualidade do Ar"
|
||||
#define D_AP "Pondo de acesso" // Ponto de Acesso
|
||||
#define D_AS "como"
|
||||
#define D_AUTO "Auto"
|
||||
#define D_BLINK "Pulsar"
|
||||
#define D_BLINKOFF "Pulsar desligado"
|
||||
#define D_BOOT_COUNT "Contagem de inicialização"
|
||||
#define D_BRIGHTLIGHT "Brilho"
|
||||
#define D_BUTTON "Botão"
|
||||
#define D_BY "por" // Write by me
|
||||
#define D_BYTES "Bytes"
|
||||
#define D_CELSIUS "Celsius"
|
||||
#define D_CO2 "Dióxido de Carbono"
|
||||
#define D_CODE "Código" // Button code
|
||||
#define D_COLDLIGHT "Luz Fria"
|
||||
#define D_COMMAND "Comando"
|
||||
#define D_CONNECTED "Ligado"
|
||||
#define D_COUNT "Contagem"
|
||||
#define D_COUNTER "Contador"
|
||||
#define D_CURRENT "Corrente" // As in Voltage and Current
|
||||
#define D_DATA "Dados"
|
||||
#define D_DARKLIGHT "Luz Escura"
|
||||
#define D_DEBUG "Depurar"
|
||||
#define D_DISABLED "Desabilitado"
|
||||
#define D_DISTANCE "Distância"
|
||||
#define D_DNS_SERVER "Servidor DNS"
|
||||
#define D_DONE "Concluído"
|
||||
#define D_DST_TIME "DST"
|
||||
#define D_ECO2 "eCO2"
|
||||
#define D_EMULATION "Emulação"
|
||||
#define D_ENABLED "Habilitado"
|
||||
#define D_ERASE "Apagar"
|
||||
#define D_ERROR "Erro"
|
||||
#define D_FAHRENHEIT "Fahrenheit"
|
||||
#define D_FAILED "Falha"
|
||||
#define D_FALLBACK "Retornar"
|
||||
#define D_FALLBACK_TOPIC "Tópico para retornar"
|
||||
#define D_FALSE "Falso"
|
||||
#define D_FILE "Arquivo"
|
||||
#define D_FREE_MEMORY "Memória Livre"
|
||||
#define D_GAS "Gás"
|
||||
#define D_GATEWAY "Gateway"
|
||||
#define D_GROUP "Grupo"
|
||||
#define D_HOST "Anfitrião"
|
||||
#define D_HOSTNAME "Nome do anfitrião"
|
||||
#define D_HUMIDITY "Umidade"
|
||||
#define D_ILLUMINANCE "Luminância"
|
||||
#define D_IMMEDIATE "Imediato" // Button immediate
|
||||
#define D_INDEX "Índice"
|
||||
#define D_INFO "Informação"
|
||||
#define D_INITIALIZED "Inicializado"
|
||||
#define D_IP_ADDRESS "Endereço IP"
|
||||
#define D_LIGHT "Luz"
|
||||
#define D_LWT "LWT"
|
||||
#define D_MODULE "Módulo"
|
||||
#define D_MQTT "MQTT"
|
||||
#define D_MULTI_PRESS "multi-pressão"
|
||||
#define D_NOISE "Ruído"
|
||||
#define D_NONE "Nenhum"
|
||||
#define D_OFF "Desligado"
|
||||
#define D_OFFLINE "Desconectado"
|
||||
#define D_OK "Ok"
|
||||
#define D_ON "Ligado"
|
||||
#define D_ONLINE "Conectado"
|
||||
#define D_PASSWORD "Senha"
|
||||
#define D_PORT "Porta"
|
||||
#define D_POWER_FACTOR "Fator de potência"
|
||||
#define D_POWERUSAGE "Potência"
|
||||
#define D_PRESSURE "Pressão"
|
||||
#define D_PRESSUREATSEALEVEL "Pressão ao nível do mar"
|
||||
#define D_PROGRAM_FLASH_SIZE "Tamanho do programa na memória"
|
||||
#define D_PROGRAM_SIZE "Tamanho do programa"
|
||||
#define D_PROJECT "Projeto"
|
||||
#define D_RECEIVED "Recebido"
|
||||
#define D_RESTART "Reiniciar"
|
||||
#define D_RESTARTING "Reiniciando"
|
||||
#define D_RESTART_REASON "Motivo do reinício"
|
||||
#define D_RESTORE "Restauração"
|
||||
#define D_RETAINED "Manter"
|
||||
#define D_RULE "Regra"
|
||||
#define D_SAVE "Salvar"
|
||||
#define D_SENSOR "Sensor"
|
||||
#define D_SSID "SSId"
|
||||
#define D_START "Iniciar"
|
||||
#define D_STD_TIME "STD"
|
||||
#define D_STOP "Parar"
|
||||
#define D_SUBNET_MASK "Máscara sub rede"
|
||||
#define D_SUBSCRIBE_TO "Subescrever para"
|
||||
#define D_SUCCESSFUL "Successo"
|
||||
#define D_SUNRISE "Nascer do sol"
|
||||
#define D_SUNSET "Por do sol"
|
||||
#define D_TEMPERATURE "Temperatura"
|
||||
#define D_TO "Para"
|
||||
#define D_TOGGLE "Inverter"
|
||||
#define D_TOPIC "Tópico"
|
||||
#define D_TRANSMIT "Transmitir"
|
||||
#define D_TRUE "Verdadeiro"
|
||||
#define D_TVOC "TVOC"
|
||||
#define D_UPGRADE "atualização"
|
||||
#define D_UPLOAD "Enviar"
|
||||
#define D_UPTIME "Tempo de atividade"
|
||||
#define D_USER "Usuário"
|
||||
#define D_UTC_TIME "UTC"
|
||||
#define D_UV_LEVEL "Nível UV"
|
||||
#define D_VERSION "Versão"
|
||||
#define D_VOLTAGE "Voltagem"
|
||||
#define D_WARMLIGHT "Luz quente"
|
||||
#define D_WEB_SERVER "Servidor WEB"
|
||||
|
||||
// sonoff.ino
|
||||
#define D_WARNING_MINIMAL_VERSION "AVISO esta versão não supporta configurações persistentes"
|
||||
#define D_LEVEL_10 "nível 1-0"
|
||||
#define D_LEVEL_01 "nível 0-1"
|
||||
#define D_SERIAL_LOGGING_DISABLED "Registro em serie desabilitado"
|
||||
#define D_SYSLOG_LOGGING_REENABLED "Registro do Syslog reativado"
|
||||
|
||||
#define D_SET_BAUDRATE_TO "Ajuste da velocidade para"
|
||||
#define D_RECEIVED_TOPIC "Tópico recebido"
|
||||
#define D_DATA_SIZE "Tamanho de dados"
|
||||
#define D_ANALOG_INPUT "Entrada analógica"
|
||||
|
||||
// support.ino
|
||||
#define D_OSWATCH "osWatch"
|
||||
#define D_BLOCKED_LOOP "Loop bloqueado"
|
||||
#define D_WPS_FAILED_WITH_STATUS "WPSconfig falha de estado"
|
||||
#define D_ACTIVE_FOR_3_MINUTES "Ativo por 3 minutos"
|
||||
#define D_FAILED_TO_START "Falha ao iníciar"
|
||||
#define D_PATCH_ISSUE_2186 "Questão 2186"
|
||||
#define D_CONNECTING_TO_AP "Ligando ao PA"
|
||||
#define D_IN_MODE "em modo"
|
||||
#define D_CONNECT_FAILED_NO_IP_ADDRESS "A ligação falhou porque nenhum endereço IP foi recebido"
|
||||
#define D_CONNECT_FAILED_AP_NOT_REACHED "A ligação falhou porque o PA não pôde ser alcançado"
|
||||
#define D_CONNECT_FAILED_WRONG_PASSWORD "A ligação falhou porque a senha está incorreta"
|
||||
#define D_CONNECT_FAILED_AP_TIMEOUT "A ligação falhou porque o tempo foi excedido"
|
||||
#define D_ATTEMPTING_CONNECTION "Ligando..."
|
||||
#define D_CHECKING_CONNECTION "Verificando ligação..."
|
||||
#define D_QUERY_DONE "Consulta finalizada. Serviço MQTT não encontrado"
|
||||
#define D_MQTT_SERVICE_FOUND "Serviço MQTT encontrado em"
|
||||
#define D_FOUND_AT "encontrado em"
|
||||
#define D_SYSLOG_HOST_NOT_FOUND "Syslog anfitrião não encontrado"
|
||||
|
||||
// settings.ino
|
||||
#define D_SAVED_TO_FLASH_AT "Guardado na flash em"
|
||||
#define D_LOADED_FROM_FLASH_AT "Lido da flash em"
|
||||
#define D_USE_DEFAULTS "Usar predefinições"
|
||||
#define D_ERASED_SECTOR "Apagar setores"
|
||||
|
||||
// webserver.ino
|
||||
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "Firmware mínimo - Atualizar por favor"
|
||||
#define D_WEBSERVER_ACTIVE_ON "Servidor WEB ativo em"
|
||||
#define D_WITH_IP_ADDRESS "com o endereço IP"
|
||||
#define D_WEBSERVER_STOPPED "Servidor WEB parou"
|
||||
#define D_FILE_NOT_FOUND "Arquivo não encontrado"
|
||||
#define D_REDIRECTED "Redirecionado para o portal ativo"
|
||||
#define D_WIFIMANAGER_SET_ACCESSPOINT_AND_STATION "Wifimanager configura o Ponto de Acesso e mantém a estação"
|
||||
#define D_WIFIMANAGER_SET_ACCESSPOINT "Wifimanager configura o Ponto de Acesso"
|
||||
#define D_TRYING_TO_CONNECT "Conectar o dispositivo à rede"
|
||||
|
||||
#define D_RESTART_IN "Reinicia em"
|
||||
#define D_SECONDS "segundos"
|
||||
#define D_DEVICE_WILL_RESTART "O dispositivo irá reiniciar dentro de alguns segundos"
|
||||
#define D_BUTTON_TOGGLE "Comandar"
|
||||
#define D_CONFIGURATION "Configuração"
|
||||
#define D_INFORMATION "Informação"
|
||||
#define D_FIRMWARE_UPGRADE "Atualização de Firmware"
|
||||
#define D_CONSOLE "Console"
|
||||
#define D_CONFIRM_RESTART "Confirmar o reinicio"
|
||||
|
||||
#define D_CONFIGURE_MODULE "Configurar Módulo"
|
||||
#define D_CONFIGURE_WIFI "Configurar WiFi"
|
||||
#define D_CONFIGURE_MQTT "Configurar MQTT"
|
||||
#define D_CONFIGURE_DOMOTICZ "Configurar Domoticz"
|
||||
#define D_CONFIGURE_LOGGING "Configurar Logging"
|
||||
#define D_CONFIGURE_OTHER "Configurar outras opções"
|
||||
#define D_CONFIRM_RESET_CONFIGURATION "Confirmar limpeza de configuração"
|
||||
#define D_RESET_CONFIGURATION "Apagar configuração"
|
||||
#define D_BACKUP_CONFIGURATION "Salvar configuração"
|
||||
#define D_RESTORE_CONFIGURATION "Repor configuração"
|
||||
#define D_MAIN_MENU "Menu principal"
|
||||
|
||||
#define D_MODULE_PARAMETERS "Parametros do módulo"
|
||||
#define D_MODULE_TYPE "Tipo de módulo"
|
||||
#define D_GPIO "GPIO"
|
||||
#define D_SERIAL_IN "Entrada serial"
|
||||
#define D_SERIAL_OUT "Saída serial"
|
||||
|
||||
#define D_WIFI_PARAMETERS "Parâmetros do wifi"
|
||||
#define D_SCAN_FOR_WIFI_NETWORKS "Encontrar redes wifi"
|
||||
#define D_SCAN_DONE "Busca finalizada"
|
||||
#define D_NO_NETWORKS_FOUND "Sem redes"
|
||||
#define D_REFRESH_TO_SCAN_AGAIN "Nova busca"
|
||||
#define D_DUPLICATE_ACCESSPOINT "Ponto de Acesso duplicado"
|
||||
#define D_SKIPPING_LOW_QUALITY "Ignorado devido à baixa qualidade do sinal"
|
||||
#define D_RSSI "RSSI"
|
||||
#define D_WEP "WEP"
|
||||
#define D_WPA_PSK "WPA PSK"
|
||||
#define D_WPA2_PSK "WPA2 PSK"
|
||||
#define D_AP1_SSID "AP1 SSId"
|
||||
#define D_AP1_PASSWORD "Senha AP1"
|
||||
#define D_AP2_SSID "AP2 SSId"
|
||||
#define D_AP2_PASSWORD "Senha AP2"
|
||||
|
||||
#define D_MQTT_PARAMETERS "Parâmetros MQTT"
|
||||
#define D_CLIENT "Cliente"
|
||||
#define D_FULL_TOPIC "Tópico completo"
|
||||
|
||||
#define D_LOGGING_PARAMETERS "Parâmetros Logging"
|
||||
#define D_SERIAL_LOG_LEVEL "Nível de registro serial"
|
||||
#define D_WEB_LOG_LEVEL "Nível de registro WEB"
|
||||
#define D_SYS_LOG_LEVEL "Nível de registro Syslog"
|
||||
#define D_MORE_DEBUG "Depurar mais"
|
||||
#define D_SYSLOG_HOST "Syslog anfitrião"
|
||||
#define D_SYSLOG_PORT "Porta Syslog"
|
||||
#define D_TELEMETRY_PERIOD "Período de telemetria"
|
||||
|
||||
#define D_OTHER_PARAMETERS "Outros parâmetros"
|
||||
#define D_WEB_ADMIN_PASSWORD "Senha de WEB Admin"
|
||||
#define D_MQTT_ENABLE "MQTT habilitado"
|
||||
#define D_FRIENDLY_NAME "Nome amigável"
|
||||
#define D_BELKIN_WEMO "Belkin WeMo"
|
||||
#define D_HUE_BRIDGE "Hue Bridge"
|
||||
#define D_SINGLE_DEVICE "Dispositivo único"
|
||||
#define D_MULTI_DEVICE "Múltiplos dispositivos"
|
||||
|
||||
#define D_SAVE_CONFIGURATION "Salvar configuração"
|
||||
#define D_CONFIGURATION_SAVED "Configuração salva"
|
||||
#define D_CONFIGURATION_RESET "Reinicialização da configuração"
|
||||
|
||||
#define D_PROGRAM_VERSION "Versão do programa"
|
||||
#define D_BUILD_DATE_AND_TIME "Data e Hora da construção"
|
||||
#define D_CORE_AND_SDK_VERSION "Versão Core/SDK"
|
||||
#define D_FLASH_WRITE_COUNT "Contagem de gravação flash"
|
||||
#define D_MAC_ADDRESS "Endereço MAC"
|
||||
#define D_MQTT_HOST "MQTT Servidor"
|
||||
#define D_MQTT_PORT "MQTT Porta"
|
||||
#define D_MQTT_CLIENT "MQTT Cliente"
|
||||
#define D_MQTT_USER "MQTT Usuário"
|
||||
#define D_MQTT_TOPIC "MQTT Tópico"
|
||||
#define D_MQTT_GROUP_TOPIC "MQTT Tópico Grupo"
|
||||
#define D_MQTT_FULL_TOPIC "MQTT Tópico Completo"
|
||||
#define D_MDNS_DISCOVERY "Descobrir mDNS"
|
||||
#define D_MDNS_ADVERTISE "Anunciar mDNS"
|
||||
#define D_ESP_CHIP_ID "ESP Chip Id"
|
||||
#define D_FLASH_CHIP_ID "Flash Chip Id"
|
||||
#define D_FLASH_CHIP_SIZE "Flash Size"
|
||||
#define D_FREE_PROGRAM_SPACE "Espaço Livre Programa"
|
||||
|
||||
#define D_UPGRADE_BY_WEBSERVER "Atualizar pelo servidor WEB"
|
||||
#define D_OTA_URL "OTA Url"
|
||||
#define D_START_UPGRADE "Iniciar atualização"
|
||||
#define D_UPGRADE_BY_FILE_UPLOAD "Atualização por arquivo local"
|
||||
#define D_UPLOAD_STARTED "Início do envio"
|
||||
#define D_UPGRADE_STARTED "Atualização iniciada"
|
||||
#define D_UPLOAD_DONE "Atualização finalizada"
|
||||
#define D_UPLOAD_ERR_1 "Nenhum arquivo selecionado"
|
||||
#define D_UPLOAD_ERR_2 "Não existe memória disponível"
|
||||
#define D_UPLOAD_ERR_3 "Byte mágico não é 0xE9"
|
||||
#define D_UPLOAD_ERR_4 "O tamanho do programa é maior do que o tamanho da memória"
|
||||
#define D_UPLOAD_ERR_5 "Envio buffer miscompare"
|
||||
#define D_UPLOAD_ERR_6 "Falha no envio. Habilitar logging 3"
|
||||
#define D_UPLOAD_ERR_7 "Envio cancelado"
|
||||
#define D_UPLOAD_ERR_8 "Arquivo inválido"
|
||||
#define D_UPLOAD_ERR_9 "Arquivo muito grande"
|
||||
#define D_UPLOAD_ERROR_CODE "Código de erro do envio"
|
||||
|
||||
#define D_ENTER_COMMAND "Inserir comando"
|
||||
#define D_ENABLE_WEBLOG_FOR_RESPONSE "Habilitar weblog 2 se resposta esperada"
|
||||
#define D_NEED_USER_AND_PASSWORD "Necessário user=<nome usuário>&password=<senha>"
|
||||
|
||||
// xdrv_00_mqtt.ino
|
||||
#define D_FINGERPRINT "Verifique a impressão digital TLS..."
|
||||
#define D_TLS_CONNECT_FAILED_TO "TLS não conseguiu ligar"
|
||||
#define D_RETRY_IN "Tentativa em"
|
||||
#define D_VERIFIED "Verificado impressão digital "
|
||||
#define D_INSECURE "Ligação insegura devido à impressão digital inválida"
|
||||
#define D_CONNECT_FAILED_TO "A ligação falhou ao"
|
||||
|
||||
// xdrv_wemohue.ino
|
||||
#define D_MULTICAST_DISABLED "Multicast desabilitado"
|
||||
#define D_MULTICAST_REJOINED "Multicast (re)ingressou"
|
||||
#define D_MULTICAST_JOIN_FAILED "Multicast falha no reingresso"
|
||||
#define D_FAILED_TO_SEND_RESPONSE "Falha no envio de reposta"
|
||||
|
||||
#define D_WEMO "WeMo"
|
||||
#define D_WEMO_BASIC_EVENT "WeMo evento básico"
|
||||
#define D_WEMO_EVENT_SERVICE "WeMo evento de serviço"
|
||||
#define D_WEMO_META_SERVICE "WeMo serviço meta"
|
||||
#define D_WEMO_SETUP "WeMo configuração"
|
||||
#define D_RESPONSE_SENT "Resposta enviada"
|
||||
|
||||
#define D_HUE "Hue"
|
||||
#define D_HUE_BRIDGE_SETUP "Hue setup"
|
||||
#define D_HUE_API_NOT_IMPLEMENTED "Hue API nao implementada"
|
||||
#define D_HUE_API "Hue API"
|
||||
#define D_HUE_POST_ARGS "Hue POST args"
|
||||
#define D_3_RESPONSE_PACKETS_SENT "3 pacotes de resposta enviados"
|
||||
|
||||
// xdrv_05_domoticz.ino
|
||||
#define D_DOMOTICZ_PARAMETERS "Parâmetros Domoticz"
|
||||
#define D_DOMOTICZ_IDX "Idx"
|
||||
#define D_DOMOTICZ_KEY_IDX "Chave idx"
|
||||
#define D_DOMOTICZ_SWITCH_IDX "Interruptor idx"
|
||||
#define D_DOMOTICZ_SENSOR_IDX "Sensor idx"
|
||||
#define D_DOMOTICZ_TEMP "Temp"
|
||||
#define D_DOMOTICZ_TEMP_HUM "Temp,Hum"
|
||||
#define D_DOMOTICZ_TEMP_HUM_BARO "Temp,Hum,Baro"
|
||||
#define D_DOMOTICZ_POWER_ENERGY "Potência,Energia"
|
||||
#define D_DOMOTICZ_ILLUMINANCE "Luminância"
|
||||
#define D_DOMOTICZ_COUNT "Contagem/PM1"
|
||||
#define D_DOMOTICZ_VOLTAGE "Voltagem/PM2.5"
|
||||
#define D_DOMOTICZ_CURRENT "Corrente/PM10"
|
||||
#define D_DOMOTICZ_AIRQUALITY "Qualidade do ar"
|
||||
#define D_DOMOTICZ_UPDATE_TIMER "Tempo de atualização"
|
||||
|
||||
// xdrv_09_timers.ino
|
||||
#define D_CONFIGURE_TIMER "Configurar temporizador"
|
||||
#define D_TIMER_PARAMETERS "Parâmetros"
|
||||
#define D_TIMER_ARM "Habilitar"
|
||||
#define D_TIMER_TIME "Horário"
|
||||
#define D_TIMER_DAYS "Dias"
|
||||
#define D_TIMER_REPEAT "Repetir"
|
||||
#define D_TIMER_OUTPUT "Saída"
|
||||
#define D_TIMER_ACTION "Ação"
|
||||
|
||||
// xdrv_10_knx.ino
|
||||
#define D_CONFIGURE_KNX "Configurar KNX"
|
||||
#define D_KNX_PARAMETERS "Parâmetros KNX"
|
||||
#define D_KNX_GENERAL_CONFIG "Geral"
|
||||
#define D_KNX_PHYSICAL_ADDRESS "Endereço físico"
|
||||
#define D_KNX_PHYSICAL_ADDRESS_NOTE "(Deve ser único na rede KNX)"
|
||||
#define D_KNX_ENABLE "Habilitar KNX"
|
||||
#define D_KNX_GROUP_ADDRESS_TO_WRITE "Endereço do grupo para enviar"
|
||||
#define D_ADD "Adicionar"
|
||||
#define D_DELETE "Remover"
|
||||
#define D_REPLY "Responder"
|
||||
#define D_KNX_GROUP_ADDRESS_TO_READ "Endereço do grupo para receber"
|
||||
#define D_LOG_KNX "KNX: "
|
||||
#define D_RECEIVED_FROM "Recebido de"
|
||||
#define D_KNX_COMMAND_WRITE "Escrever"
|
||||
#define D_KNX_COMMAND_READ "Ler"
|
||||
#define D_KNX_COMMAND_OTHER "Outros"
|
||||
#define D_SENT_TO "Enviar para"
|
||||
#define D_KNX_WARNING "O endereço ( 0 / 0 / 0 ) é reservado e não pode ser usado."
|
||||
|
||||
// xdrv_03_energy.ino
|
||||
#define D_ENERGY_TODAY "Consumo energético de hoje"
|
||||
#define D_ENERGY_YESTERDAY "Consumo energético de ontem"
|
||||
#define D_ENERGY_TOTAL "Consumo total de energia"
|
||||
|
||||
// xsns_05_ds18b20.ino
|
||||
#define D_SENSOR_BUSY "Sensor ocupado"
|
||||
#define D_SENSOR_CRC_ERROR "Erro sensor CRC"
|
||||
#define D_SENSORS_FOUND "Sensores encontrados"
|
||||
|
||||
// xsns_06_dht.ino
|
||||
#define D_TIMEOUT_WAITING_FOR "Fim do tempo de espera"
|
||||
#define D_START_SIGNAL_LOW "Sinal de início baixo"
|
||||
#define D_START_SIGNAL_HIGH "Sinal de início elevado"
|
||||
#define D_PULSE "pulso"
|
||||
#define D_CHECKSUM_FAILURE "Falha checksum"
|
||||
|
||||
// xsns_07_sht1x.ino
|
||||
#define D_SENSOR_DID_NOT_ACK_COMMAND "Sensor não aceitou o comando ACK"
|
||||
#define D_SHT1X_FOUND "SHT1X encontrado"
|
||||
|
||||
// xsns_18_pms5003.ino
|
||||
#define D_STANDARD_CONCENTRATION "CF-1 PM" // Standard Particle CF-1 Particle Matter
|
||||
#define D_ENVIRONMENTAL_CONCENTRATION "PM" // Environmetal Particle Matter
|
||||
#define D_PARTICALS_BEYOND "Partículas"
|
||||
|
||||
// sonoff_template.h
|
||||
#define D_SENSOR_NONE "Nenhum"
|
||||
#define D_SENSOR_DHT11 "DHT11"
|
||||
#define D_SENSOR_AM2301 "AM2301"
|
||||
#define D_SENSOR_SI7021 "SI7021"
|
||||
#define D_SENSOR_DS18X20 "DS18x20"
|
||||
#define D_SENSOR_I2C_SCL "I2C SCL"
|
||||
#define D_SENSOR_I2C_SDA "I2C SDA"
|
||||
#define D_SENSOR_WS2812 "WS2812"
|
||||
#define D_SENSOR_IRSEND "IRsend"
|
||||
#define D_SENSOR_SWITCH "Interruptor" // Suffix "1"
|
||||
#define D_SENSOR_BUTTON "Botão" // Suffix "1"
|
||||
#define D_SENSOR_RELAY "Relé" // Suffix "1i"
|
||||
#define D_SENSOR_LED "Led" // Suffix "1i"
|
||||
#define D_SENSOR_PWM "PWM" // Suffix "1"
|
||||
#define D_SENSOR_COUNTER "Contador" // Suffix "1"
|
||||
#define D_SENSOR_IRRECV "IRrecv"
|
||||
#define D_SENSOR_MHZ_RX "MHZ Rx"
|
||||
#define D_SENSOR_MHZ_TX "MHZ Tx"
|
||||
#define D_SENSOR_PZEM_RX "PZEM Rx"
|
||||
#define D_SENSOR_PZEM_TX "PZEM Tx"
|
||||
#define D_SENSOR_SAIR_RX "SAir Rx"
|
||||
#define D_SENSOR_SAIR_TX "SAir Tx"
|
||||
#define D_SENSOR_SPI_CS "SPI CS"
|
||||
#define D_SENSOR_SPI_DC "SPI DC"
|
||||
#define D_SENSOR_BACKLIGHT "Luz de fundo"
|
||||
#define D_SENSOR_PMS5003 "PMS5003"
|
||||
#define D_SENSOR_SDS0X1 "SDS0X1"
|
||||
#define D_SENSOR_SBR_RX "SerBr Rx"
|
||||
#define D_SENSOR_SBR_TX "SerBr Tx"
|
||||
#define D_SENSOR_SR04_TRIG "SR04 Tri"
|
||||
#define D_SENSOR_SR04_ECHO "SR04 Ech"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
#define D_UNIT_CENTIMETER "cm"
|
||||
#define D_UNIT_HOUR "H"
|
||||
#define D_UNIT_KILOOHM "kOhm"
|
||||
#define D_UNIT_KILOWATTHOUR "kWh"
|
||||
#define D_UNIT_LUX "lx"
|
||||
#define D_UNIT_MICROGRAM_PER_CUBIC_METER "ug/m3"
|
||||
#define D_UNIT_MICROMETER "um"
|
||||
#define D_UNIT_MICROSECOND "us"
|
||||
#define D_UNIT_MILLIAMPERE "mA"
|
||||
#define D_UNIT_MILLISECOND "ms"
|
||||
#define D_UNIT_MINUTE "M"
|
||||
#define D_UNIT_PARTS_PER_BILLION "ppb"
|
||||
#define D_UNIT_PARTS_PER_DECILITER "ppd"
|
||||
#define D_UNIT_PARTS_PER_MILLION "ppm"
|
||||
#define D_UNIT_PRESSURE "hPa"
|
||||
#define D_UNIT_SECOND "s"
|
||||
#define D_UNIT_SECTORS "setores"
|
||||
#define D_UNIT_VOLT "V"
|
||||
#define D_UNIT_WATT "W"
|
||||
#define D_UNIT_WATTHOUR "W/h"
|
||||
|
||||
// Log message prefix
|
||||
#define D_LOG_APPLICATION "APP: " // Application
|
||||
#define D_LOG_BRIDGE "BRG: " // Bridge
|
||||
#define D_LOG_CONFIG "CFG: " // Settings
|
||||
#define D_LOG_COMMAND "CMD: " // Command
|
||||
#define D_LOG_DEBUG "DBG: " // Debug
|
||||
#define D_LOG_DHT "DHT: " // DHT sensor
|
||||
#define D_LOG_DOMOTICZ "DOM: " // Domoticz
|
||||
#define D_LOG_DSB "DSB: " // DS18xB20 sensor
|
||||
#define D_LOG_HTTP "HTP: " // HTTP webserver
|
||||
#define D_LOG_I2C "I2C: " // I2C
|
||||
#define D_LOG_IRR "IRR: " // Infra Red Received
|
||||
#define D_LOG_LOG "LOG: " // Logging
|
||||
#define D_LOG_MODULE "MOD: " // Module
|
||||
#define D_LOG_MDNS "DNS: " // mDNS
|
||||
#define D_LOG_MQTT "MQT: " // MQTT
|
||||
#define D_LOG_OTHER "OTH: " // Other
|
||||
#define D_LOG_RESULT "RSL: " // Result
|
||||
#define D_LOG_RFR "RFR: " // RF Received
|
||||
#define D_LOG_SERIAL "SER: " // Serial
|
||||
#define D_LOG_SHT1 "SHT: " // SHT1x sensor
|
||||
#define D_LOG_UPLOAD "UPL: " // Upload
|
||||
#define D_LOG_UPNP "UPP: " // UPnP
|
||||
#define D_LOG_WIFI "WIF: " // Wifi
|
||||
|
||||
#endif // _LANGUAGE_PT_BR_H_
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
pt-PT.h - localization for Portuguese - Portugal for Sonoff-Tasmota
|
||||
|
||||
Copyright (C) 2018 Theo Arends and Paulo Paiva
|
||||
Copyright (C) 2018 Paulo Paiva
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -28,10 +28,14 @@
|
|||
* Use online command StateText to translate ON, OFF, HOLD and TOGGLE.
|
||||
* Use online command Prefix to translate cmnd, stat and tele.
|
||||
*
|
||||
* Updated until v5.12.0
|
||||
\*********************************************************************/
|
||||
|
||||
//#define LANGUAGE_MODULE_NAME // Enable to display "Module Generic" (ie Spanish), Disable to display "Generic Module" (ie English)
|
||||
|
||||
// HTML (ISO 639-1) Language Code
|
||||
#define D_HTML_LANGUAGE "pt"
|
||||
|
||||
// "2017-03-07T11:08:02" - ISO8601:2004
|
||||
#define D_YEAR_MONTH_SEPARATOR "-"
|
||||
#define D_MONTH_DAY_SEPARATOR "-"
|
||||
|
@ -71,9 +75,11 @@
|
|||
#define D_DARKLIGHT "Luz Escura"
|
||||
#define D_DEBUG "Depurar"
|
||||
#define D_DISABLED "Disabilitado"
|
||||
#define D_DISTANCE "Distance"
|
||||
#define D_DNS_SERVER "Servidor DNS"
|
||||
#define D_DONE "Concluído"
|
||||
#define D_DST_TIME "DST"
|
||||
#define D_ECO2 "eCO2"
|
||||
#define D_EMULATION "Emulação"
|
||||
#define D_ENABLED "Habilitado"
|
||||
#define D_ERASE "Apagar"
|
||||
|
@ -124,6 +130,7 @@
|
|||
#define D_RESTART_REASON "Razão do reinicio"
|
||||
#define D_RESTORE "Restauro"
|
||||
#define D_RETAINED "Manter"
|
||||
#define D_RULE "Rule"
|
||||
#define D_SAVE "Salvar"
|
||||
#define D_SENSOR "Sensor"
|
||||
#define D_SSID "SSId"
|
||||
|
@ -133,12 +140,15 @@
|
|||
#define D_SUBNET_MASK "Mascara sub rede"
|
||||
#define D_SUBSCRIBE_TO "Subescrever para"
|
||||
#define D_SUCCESSFUL "Successo"
|
||||
#define D_SUNRISE "Sunrise"
|
||||
#define D_SUNSET "Sunset"
|
||||
#define D_TEMPERATURE "Temperatura"
|
||||
#define D_TO "para"
|
||||
#define D_TOGGLE "Pressionar"
|
||||
#define D_TOPIC "Tópico"
|
||||
#define D_TRANSMIT "Transmitir"
|
||||
#define D_TRUE "Verdadeiro"
|
||||
#define D_TVOC "TVOC"
|
||||
#define D_UPGRADE "Atualizar"
|
||||
#define D_UPLOAD "Enviar"
|
||||
#define D_UPTIME "Tempo de Atividade"
|
||||
|
@ -162,13 +172,6 @@
|
|||
#define D_DATA_SIZE "Tamanho de dados"
|
||||
#define D_ANALOG_INPUT "Entrada Analógica"
|
||||
|
||||
#define D_FINGERPRINT "Verifique a impressão digital TLS..."
|
||||
#define D_TLS_CONNECT_FAILED_TO "TLS não conseguiu ligar"
|
||||
#define D_RETRY_IN "Tentativa em"
|
||||
#define D_VERIFIED "Verificado"
|
||||
#define D_INSECURE "Ligação insegura devido à impressão digital inválida"
|
||||
#define D_CONNECT_FAILED_TO "A ligação falhou ao"
|
||||
|
||||
// support.ino
|
||||
#define D_OSWATCH "osWatch"
|
||||
#define D_BLOCKED_LOOP "Loop Bloqueado"
|
||||
|
@ -317,6 +320,14 @@
|
|||
#define D_ENABLE_WEBLOG_FOR_RESPONSE "Habilitar weblog 2 se resposta esperada"
|
||||
#define D_NEED_USER_AND_PASSWORD "Necessário user=<nome utilizador>&password=<palavra chave>"
|
||||
|
||||
// xdrv_00_mqtt.ino
|
||||
#define D_FINGERPRINT "Verifique a impressão digital TLS..."
|
||||
#define D_TLS_CONNECT_FAILED_TO "TLS não conseguiu ligar"
|
||||
#define D_RETRY_IN "Tentativa em"
|
||||
#define D_VERIFIED "Verificado impressão digital "
|
||||
#define D_INSECURE "Ligação insegura devido à impressão digital inválida"
|
||||
#define D_CONNECT_FAILED_TO "A ligação falhou ao"
|
||||
|
||||
// xdrv_wemohue.ino
|
||||
#define D_MULTICAST_DISABLED "Multicast desabilitado"
|
||||
#define D_MULTICAST_REJOINED "Multicast (re)ingressou"
|
||||
|
@ -348,12 +359,42 @@
|
|||
#define D_DOMOTICZ_TEMP_HUM_BARO "Temp,Hum,Baro"
|
||||
#define D_DOMOTICZ_POWER_ENERGY "Potência,Energia"
|
||||
#define D_DOMOTICZ_ILLUMINANCE "Luminâcia"
|
||||
#define D_DOMOTICZ_COUNT "Contagem"
|
||||
#define D_DOMOTICZ_VOLTAGE "Voltagem"
|
||||
#define D_DOMOTICZ_CURRENT "Corrente"
|
||||
#define D_DOMOTICZ_COUNT "Contagem/PM1"
|
||||
#define D_DOMOTICZ_VOLTAGE "Voltagem/PM2.5"
|
||||
#define D_DOMOTICZ_CURRENT "Corrente/PM10"
|
||||
#define D_DOMOTICZ_AIRQUALITY "Qualidade do Ar"
|
||||
#define D_DOMOTICZ_UPDATE_TIMER "Tempo de atualização"
|
||||
|
||||
// xdrv_09_timers.ino
|
||||
#define D_CONFIGURE_TIMER "Configure Timer"
|
||||
#define D_TIMER_PARAMETERS "Timer parameters"
|
||||
#define D_TIMER_ARM "Arm"
|
||||
#define D_TIMER_TIME "Time"
|
||||
#define D_TIMER_DAYS "Days"
|
||||
#define D_TIMER_REPEAT "Repeat"
|
||||
#define D_TIMER_OUTPUT "Output"
|
||||
#define D_TIMER_ACTION "Action"
|
||||
|
||||
// xdrv_10_knx.ino
|
||||
#define D_CONFIGURE_KNX "Configure KNX"
|
||||
#define D_KNX_PARAMETERS "KNX Parameters"
|
||||
#define D_KNX_GENERAL_CONFIG "General"
|
||||
#define D_KNX_PHYSICAL_ADDRESS "Physical Address"
|
||||
#define D_KNX_PHYSICAL_ADDRESS_NOTE "( Must be unique on the KNX network )"
|
||||
#define D_KNX_ENABLE "Enable KNX"
|
||||
#define D_KNX_GROUP_ADDRESS_TO_WRITE "Data to Send to Group Addresses"
|
||||
#define D_ADD "Add"
|
||||
#define D_DELETE "Delete"
|
||||
#define D_REPLY "Reply"
|
||||
#define D_KNX_GROUP_ADDRESS_TO_READ "Group Addresses to Receive Data from"
|
||||
#define D_LOG_KNX "KNX: "
|
||||
#define D_RECEIVED_FROM "Received from"
|
||||
#define D_KNX_COMMAND_WRITE "Write"
|
||||
#define D_KNX_COMMAND_READ "Read"
|
||||
#define D_KNX_COMMAND_OTHER "Other"
|
||||
#define D_SENT_TO "sent to"
|
||||
#define D_KNX_WARNING "The group address ( 0 / 0 / 0 ) is reserved and can not be used."
|
||||
|
||||
// xdrv_03_energy.ino
|
||||
#define D_ENERGY_TODAY "Consumo energético de hoje"
|
||||
#define D_ENERGY_YESTERDAY "Consumo energético de ontem"
|
||||
|
@ -407,9 +448,15 @@
|
|||
#define D_SENSOR_SPI_DC "SPI DC"
|
||||
#define D_SENSOR_BACKLIGHT "Luz negra"
|
||||
#define D_SENSOR_PMS5003 "PMS5003"
|
||||
#define D_SENSOR_SDS0X1 "SDS0X1"
|
||||
#define D_SENSOR_SBR_RX "SerBr Rx"
|
||||
#define D_SENSOR_SBR_TX "SerBr Tx"
|
||||
#define D_SENSOR_SR04_TRIG "SR04 Tri"
|
||||
#define D_SENSOR_SR04_ECHO "SR04 Ech"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
#define D_UNIT_CENTIMETER "cm"
|
||||
#define D_UNIT_HOUR "Hr"
|
||||
#define D_UNIT_KILOOHM "kOhm"
|
||||
#define D_UNIT_KILOWATTHOUR "kWh"
|
||||
|
@ -420,6 +467,7 @@
|
|||
#define D_UNIT_MILLIAMPERE "mA"
|
||||
#define D_UNIT_MILLISECOND "ms"
|
||||
#define D_UNIT_MINUTE "Min"
|
||||
#define D_UNIT_PARTS_PER_BILLION "ppb"
|
||||
#define D_UNIT_PARTS_PER_DECILITER "ppd"
|
||||
#define D_UNIT_PARTS_PER_MILLION "ppm"
|
||||
#define D_UNIT_PRESSURE "hPa"
|
||||
|
|
|
@ -28,10 +28,14 @@
|
|||
* Use online command StateText to translate ON, OFF, HOLD and TOGGLE.
|
||||
* Use online command Prefix to translate cmnd, stat and tele.
|
||||
*
|
||||
* Updated until v5.12.0b
|
||||
\*********************************************************************/
|
||||
|
||||
//#define LANGUAGE_MODULE_NAME // Enable to display "Module Generic" (ie Spanish), Disable to display "Generic Module" (ie English)
|
||||
|
||||
// HTML (ISO 639-1) Language Code
|
||||
#define D_HTML_LANGUAGE "ru"
|
||||
|
||||
// "2017-03-07T11:08:02" - ISO8601:2004
|
||||
#define D_YEAR_MONTH_SEPARATOR "-"
|
||||
#define D_MONTH_DAY_SEPARATOR "-"
|
||||
|
@ -71,9 +75,11 @@
|
|||
#define D_DARKLIGHT "Темный"
|
||||
#define D_DEBUG "Отладка"
|
||||
#define D_DISABLED "Блокирован"
|
||||
#define D_DISTANCE "Distance"
|
||||
#define D_DNS_SERVER "DNS Сервер"
|
||||
#define D_DONE "Выполнено"
|
||||
#define D_DST_TIME "DST"
|
||||
#define D_ECO2 "eCO2"
|
||||
#define D_EMULATION "Эмуляция"
|
||||
#define D_ENABLED "Активно"
|
||||
#define D_ERASE "Стирать"
|
||||
|
@ -124,6 +130,7 @@
|
|||
#define D_RESTART_REASON "Причина перезагрузки"
|
||||
#define D_RESTORE "восстановление"
|
||||
#define D_RETAINED "нераспред."
|
||||
#define D_RULE "Rule"
|
||||
#define D_SAVE "Сохранить"
|
||||
#define D_SENSOR "Датчик"
|
||||
#define D_SSID "SSId"
|
||||
|
@ -133,12 +140,15 @@
|
|||
#define D_SUBNET_MASK "Маска Подсети"
|
||||
#define D_SUBSCRIBE_TO "Подписаться на"
|
||||
#define D_SUCCESSFUL "Успешно"
|
||||
#define D_SUNRISE "Sunrise"
|
||||
#define D_SUNSET "Sunset"
|
||||
#define D_TEMPERATURE "Температура"
|
||||
#define D_TO "до"
|
||||
#define D_TOGGLE "Переключить"
|
||||
#define D_TOPIC "Топик"
|
||||
#define D_TRANSMIT "Передать"
|
||||
#define D_TRUE "Истина"
|
||||
#define D_TVOC "TVOC"
|
||||
#define D_UPGRADE "обновление"
|
||||
#define D_UPLOAD "Загрузить"
|
||||
#define D_UPTIME "Uptime"
|
||||
|
@ -162,13 +172,6 @@
|
|||
#define D_DATA_SIZE "Размер данных"
|
||||
#define D_ANALOG_INPUT "Аналоговый вход"
|
||||
|
||||
#define D_FINGERPRINT "Проверка TLS Fingerprint..."
|
||||
#define D_TLS_CONNECT_FAILED_TO "Сбой подключения TLS к"
|
||||
#define D_RETRY_IN "Повторить"
|
||||
#define D_VERIFIED "Проверено"
|
||||
#define D_INSECURE "Небезопасное соединение, недействительный Fingerprint"
|
||||
#define D_CONNECT_FAILED_TO "Ошибка подключения к"
|
||||
|
||||
// support.ino
|
||||
#define D_OSWATCH "osWatch"
|
||||
#define D_BLOCKED_LOOP "Блокирующий цикл"
|
||||
|
@ -317,6 +320,14 @@
|
|||
#define D_ENABLE_WEBLOG_FOR_RESPONSE "Включить Веб лог уровня 2 если ожидается ответ"
|
||||
#define D_NEED_USER_AND_PASSWORD "Ожидается user=<username>&password=<password>"
|
||||
|
||||
// xdrv_00_mqtt.ino
|
||||
#define D_FINGERPRINT "Проверка TLS Fingerprint..."
|
||||
#define D_TLS_CONNECT_FAILED_TO "Сбой подключения TLS к"
|
||||
#define D_RETRY_IN "Повторить"
|
||||
#define D_VERIFIED "Проверено Fingerprint"
|
||||
#define D_INSECURE "Небезопасное соединение, недействительный Fingerprint"
|
||||
#define D_CONNECT_FAILED_TO "Ошибка подключения к"
|
||||
|
||||
// xdrv_wemohue.ino
|
||||
#define D_MULTICAST_DISABLED "Multicast отключен"
|
||||
#define D_MULTICAST_REJOINED "Multicast (ре)соединился"
|
||||
|
@ -348,12 +359,42 @@
|
|||
#define D_DOMOTICZ_TEMP_HUM_BARO "Temp,Hum,Baro"
|
||||
#define D_DOMOTICZ_POWER_ENERGY "Power,Energy"
|
||||
#define D_DOMOTICZ_ILLUMINANCE "Illuminance"
|
||||
#define D_DOMOTICZ_COUNT "Count"
|
||||
#define D_DOMOTICZ_VOLTAGE "Voltage"
|
||||
#define D_DOMOTICZ_CURRENT "Current"
|
||||
#define D_DOMOTICZ_COUNT "Count/PM1"
|
||||
#define D_DOMOTICZ_VOLTAGE "Voltage/PM2,5"
|
||||
#define D_DOMOTICZ_CURRENT "Current/PM10"
|
||||
#define D_DOMOTICZ_AIRQUALITY "AirQuality"
|
||||
#define D_DOMOTICZ_UPDATE_TIMER "Update timer"
|
||||
|
||||
// xdrv_09_timers.ino
|
||||
#define D_CONFIGURE_TIMER "Configure Timer"
|
||||
#define D_TIMER_PARAMETERS "Timer parameters"
|
||||
#define D_TIMER_ARM "Arm"
|
||||
#define D_TIMER_TIME "Time"
|
||||
#define D_TIMER_DAYS "Days"
|
||||
#define D_TIMER_REPEAT "Repeat"
|
||||
#define D_TIMER_OUTPUT "Output"
|
||||
#define D_TIMER_ACTION "Action"
|
||||
|
||||
// xdrv_10_knx.ino
|
||||
#define D_CONFIGURE_KNX "Configure KNX"
|
||||
#define D_KNX_PARAMETERS "KNX Parameters"
|
||||
#define D_KNX_GENERAL_CONFIG "General"
|
||||
#define D_KNX_PHYSICAL_ADDRESS "Physical Address"
|
||||
#define D_KNX_PHYSICAL_ADDRESS_NOTE "( Must be unique on the KNX network )"
|
||||
#define D_KNX_ENABLE "Enable KNX"
|
||||
#define D_KNX_GROUP_ADDRESS_TO_WRITE "Data to Send to Group Addresses"
|
||||
#define D_ADD "Add"
|
||||
#define D_DELETE "Delete"
|
||||
#define D_REPLY "Reply"
|
||||
#define D_KNX_GROUP_ADDRESS_TO_READ "Group Addresses to Receive Data from"
|
||||
#define D_LOG_KNX "KNX: "
|
||||
#define D_RECEIVED_FROM "Received from"
|
||||
#define D_KNX_COMMAND_WRITE "Write"
|
||||
#define D_KNX_COMMAND_READ "Read"
|
||||
#define D_KNX_COMMAND_OTHER "Other"
|
||||
#define D_SENT_TO "sent to"
|
||||
#define D_KNX_WARNING "The group address ( 0 / 0 / 0 ) is reserved and can not be used."
|
||||
|
||||
// xdrv_03_energy.ino
|
||||
#define D_ENERGY_TODAY "Энергия Сегодня"
|
||||
#define D_ENERGY_YESTERDAY "Энергия Вчера"
|
||||
|
@ -381,7 +422,6 @@
|
|||
#define D_PARTICALS_BEYOND "Particals"
|
||||
|
||||
// sonoff_template.h
|
||||
// Max string length is 8 characters including suffixes
|
||||
#define D_SENSOR_NONE "-нет-"
|
||||
#define D_SENSOR_DHT11 "DHT11"
|
||||
#define D_SENSOR_AM2301 "AM2301"
|
||||
|
@ -408,9 +448,15 @@
|
|||
#define D_SENSOR_SPI_DC "SPI DC"
|
||||
#define D_SENSOR_BACKLIGHT "BkLight"
|
||||
#define D_SENSOR_PMS5003 "PMS5003"
|
||||
#define D_SENSOR_SDS0X1 "SDS0X1"
|
||||
#define D_SENSOR_SBR_RX "SerBr Rx"
|
||||
#define D_SENSOR_SBR_TX "SerBr Tx"
|
||||
#define D_SENSOR_SR04_TRIG "SR04 Tri"
|
||||
#define D_SENSOR_SR04_ECHO "SR04 Ech"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "А"
|
||||
#define D_UNIT_CENTIMETER "cm"
|
||||
#define D_UNIT_HOUR "Ч"
|
||||
#define D_UNIT_KILOOHM "кОм"
|
||||
#define D_UNIT_KILOWATTHOUR "кВт"
|
||||
|
@ -421,6 +467,7 @@
|
|||
#define D_UNIT_MILLIAMPERE "мА"
|
||||
#define D_UNIT_MILLISECOND "мс"
|
||||
#define D_UNIT_MINUTE "мин"
|
||||
#define D_UNIT_PARTS_PER_BILLION "ppb"
|
||||
#define D_UNIT_PARTS_PER_DECILITER "ppd"
|
||||
#define D_UNIT_PARTS_PER_MILLION "ppm"
|
||||
#define D_UNIT_PRESSURE "гПа"
|
||||
|
|
|
@ -28,10 +28,14 @@
|
|||
* Use online command StateText to translate ON, OFF, HOLD and TOGGLE.
|
||||
* Use online command Prefix to translate cmnd, stat and tele.
|
||||
*
|
||||
* Updated until v5.12.0d
|
||||
\*********************************************************************/
|
||||
|
||||
//#define LANGUAGE_MODULE_NAME // Enable to display "Module Generic" (ie Spanish), Disable to display "Generic Module" (ie English)
|
||||
|
||||
// HTML (ISO 639-1) Language Code
|
||||
#define D_HTML_LANGUAGE "zh"
|
||||
|
||||
// "2017-03-07T11:08:02" - ISO8601:2004
|
||||
#define D_YEAR_MONTH_SEPARATOR "-"
|
||||
#define D_MONTH_DAY_SEPARATOR "-"
|
||||
|
@ -71,9 +75,11 @@
|
|||
#define D_DARKLIGHT "Dark"
|
||||
#define D_DEBUG "调试"
|
||||
#define D_DISABLED "禁用"
|
||||
#define D_DISTANCE "Distance"
|
||||
#define D_DNS_SERVER "DNS服务器"
|
||||
#define D_DONE "完成"
|
||||
#define D_DST_TIME "DST"
|
||||
#define D_ECO2 "eCO2"
|
||||
#define D_EMULATION "设备模拟"
|
||||
#define D_ENABLED "启用"
|
||||
#define D_ERASE "擦除"
|
||||
|
@ -124,6 +130,7 @@
|
|||
#define D_RESTART_REASON "重启原因"
|
||||
#define D_RESTORE "恢复"
|
||||
#define D_RETAINED "已保留"
|
||||
#define D_RULE "Rule"
|
||||
#define D_SAVE "保存"
|
||||
#define D_SENSOR "传感器"
|
||||
#define D_SSID "名称"
|
||||
|
@ -133,12 +140,15 @@
|
|||
#define D_SUBNET_MASK "子网掩码"
|
||||
#define D_SUBSCRIBE_TO "订阅"
|
||||
#define D_SUCCESSFUL "成功"
|
||||
#define D_SUNRISE "Sunrise"
|
||||
#define D_SUNSET "Sunset"
|
||||
#define D_TEMPERATURE "温度"
|
||||
#define D_TO "to"
|
||||
#define D_TOGGLE "切换"
|
||||
#define D_TOPIC "主题"
|
||||
#define D_TRANSMIT "发送"
|
||||
#define D_TRUE "True"
|
||||
#define D_TVOC "TVOC"
|
||||
#define D_UPGRADE "升级"
|
||||
#define D_UPLOAD "上传"
|
||||
#define D_UPTIME "运行时间"
|
||||
|
@ -162,13 +172,6 @@
|
|||
#define D_DATA_SIZE "数据大小:"
|
||||
#define D_ANALOG_INPUT "Analog"
|
||||
|
||||
#define D_FINGERPRINT "验证 TLS 指纹..."
|
||||
#define D_TLS_CONNECT_FAILED_TO "TLS 连接失败"
|
||||
#define D_RETRY_IN "重试倒计时:"
|
||||
#define D_VERIFIED "验证成功"
|
||||
#define D_INSECURE "指纹无效导致连接不安全"
|
||||
#define D_CONNECT_FAILED_TO "连接失败:"
|
||||
|
||||
// support.ino
|
||||
#define D_OSWATCH "osWatch"
|
||||
#define D_BLOCKED_LOOP "Blocked Loop"
|
||||
|
@ -317,6 +320,14 @@
|
|||
#define D_ENABLE_WEBLOG_FOR_RESPONSE "如果预期响应,则启用Weblog 2"
|
||||
#define D_NEED_USER_AND_PASSWORD "需要 user=<用户名>&password=<密码>"
|
||||
|
||||
// xdrv_00_mqtt.ino
|
||||
#define D_FINGERPRINT "验证 TLS 指纹..."
|
||||
#define D_TLS_CONNECT_FAILED_TO "TLS 连接失败"
|
||||
#define D_RETRY_IN "重试倒计时:"
|
||||
#define D_VERIFIED "验证成功"
|
||||
#define D_INSECURE "指纹无效导致连接不安全"
|
||||
#define D_CONNECT_FAILED_TO "连接失败:"
|
||||
|
||||
// xdrv_wemohue.ino
|
||||
#define D_MULTICAST_DISABLED "组播已禁用"
|
||||
#define D_MULTICAST_REJOINED "组播已(重新)加入"
|
||||
|
@ -348,12 +359,42 @@
|
|||
#define D_DOMOTICZ_TEMP_HUM_BARO "温度,湿度,气压"
|
||||
#define D_DOMOTICZ_POWER_ENERGY "功率,电量"
|
||||
#define D_DOMOTICZ_ILLUMINANCE "照度"
|
||||
#define D_DOMOTICZ_COUNT "数值"
|
||||
#define D_DOMOTICZ_VOLTAGE "电压"
|
||||
#define D_DOMOTICZ_CURRENT "电流"
|
||||
#define D_DOMOTICZ_COUNT "数值/PM1"
|
||||
#define D_DOMOTICZ_VOLTAGE "电压/PM2.5"
|
||||
#define D_DOMOTICZ_CURRENT "电流/PM10"
|
||||
#define D_DOMOTICZ_AIRQUALITY "空气质量"
|
||||
#define D_DOMOTICZ_UPDATE_TIMER "更新计时器"
|
||||
|
||||
// xdrv_09_timers.ino
|
||||
#define D_CONFIGURE_TIMER "Configure Timer"
|
||||
#define D_TIMER_PARAMETERS "Timer parameters"
|
||||
#define D_TIMER_ARM "Arm"
|
||||
#define D_TIMER_TIME "Time"
|
||||
#define D_TIMER_DAYS "Days"
|
||||
#define D_TIMER_REPEAT "Repeat"
|
||||
#define D_TIMER_OUTPUT "Output"
|
||||
#define D_TIMER_ACTION "Action"
|
||||
|
||||
// xdrv_10_knx.ino
|
||||
#define D_CONFIGURE_KNX "Configure KNX"
|
||||
#define D_KNX_PARAMETERS "KNX Parameters"
|
||||
#define D_KNX_GENERAL_CONFIG "General"
|
||||
#define D_KNX_PHYSICAL_ADDRESS "Physical Address"
|
||||
#define D_KNX_PHYSICAL_ADDRESS_NOTE "( Must be unique on the KNX network )"
|
||||
#define D_KNX_ENABLE "Enable KNX"
|
||||
#define D_KNX_GROUP_ADDRESS_TO_WRITE "Data to Send to Group Addresses"
|
||||
#define D_ADD "Add"
|
||||
#define D_DELETE "Delete"
|
||||
#define D_REPLY "Reply"
|
||||
#define D_KNX_GROUP_ADDRESS_TO_READ "Group Addresses to Receive Data from"
|
||||
#define D_LOG_KNX "KNX: "
|
||||
#define D_RECEIVED_FROM "Received from"
|
||||
#define D_KNX_COMMAND_WRITE "Write"
|
||||
#define D_KNX_COMMAND_READ "Read"
|
||||
#define D_KNX_COMMAND_OTHER "Other"
|
||||
#define D_SENT_TO "sent to"
|
||||
#define D_KNX_WARNING "The group address ( 0 / 0 / 0 ) is reserved and can not be used."
|
||||
|
||||
// xdrv_03_energy.ino
|
||||
#define D_ENERGY_TODAY "今日用电量"
|
||||
#define D_ENERGY_YESTERDAY "昨日用电量"
|
||||
|
@ -407,9 +448,15 @@
|
|||
#define D_SENSOR_SPI_DC "SPI DC"
|
||||
#define D_SENSOR_BACKLIGHT "BkLight"
|
||||
#define D_SENSOR_PMS5003 "PMS5003"
|
||||
#define D_SENSOR_SDS0X1 "SDS0X1"
|
||||
#define D_SENSOR_SBR_RX "SerBr Rx"
|
||||
#define D_SENSOR_SBR_TX "SerBr Tx"
|
||||
#define D_SENSOR_SR04_TRIG "SR04 Tri"
|
||||
#define D_SENSOR_SR04_ECHO "SR04 Ech"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "安"
|
||||
#define D_UNIT_CENTIMETER "cm"
|
||||
#define D_UNIT_HOUR "时"
|
||||
#define D_UNIT_KILOOHM "千欧"
|
||||
#define D_UNIT_KILOWATTHOUR "千瓦时"
|
||||
|
@ -420,6 +467,7 @@
|
|||
#define D_UNIT_MILLIAMPERE "毫安"
|
||||
#define D_UNIT_MILLISECOND "毫秒"
|
||||
#define D_UNIT_MINUTE "分"
|
||||
#define D_UNIT_PARTS_PER_BILLION "ppb"
|
||||
#define D_UNIT_PARTS_PER_DECILITER "每分升"
|
||||
#define D_UNIT_PARTS_PER_MILLION "ppm"
|
||||
#define D_UNIT_PRESSURE "百帕"
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue