Compare commits

...
2337 Commits
Author SHA1 Message Date
ESPEasy release bot 8921ebbcaa automatically updated release notes for mega-20181031 2018-10-31 04:00:10 +01:00
Gijs NoorlanderandGitHub c67becac0c Merge pull request #1981 from TD-er/feature/ota_warning
[OTA] Add OTA info and disable when not enough space
2018-10-30 22:56:11 +01:00
Gijs NoorlanderandGitHub 0ec06161c5 Merge pull request #1984 from uzi18/patch-2
BlynkGet fix loop #1951
2018-10-30 22:55:40 +01:00
Gijs NoorlanderandGitHub a2b2cd857a Merge pull request #1983 from Grovkillen/UpdateFlashTool
[Flasher] Updated to 0.02.002
2018-10-30 22:49:40 +01:00
Bartłomiej ZimońandGitHub 0e581f0288 BlynkGet fix loop #1951
this commit fix #1951
2018-10-30 22:47:32 +01:00
Jimmy Westberg fffcd0f2a4 [Path] folder rename 2 2018-10-30 22:45:10 +01:00
Jimmy Westberg 1d923a527f [Path] folder rename 1 2018-10-30 22:44:40 +01:00
Jimmy Westberg 356ebbc875 [Flasher] Updated to 0.02.002
Spelling error
2018-10-30 22:35:42 +01:00
Jimmy Westberg 25fadfc1ed [Deploy] small letters are the standard 2018-10-30 22:29:56 +01:00
Jimmy Westberg 54d892e162 [Flasher] Updated to 0.02.001 2018-10-30 22:27:53 +01:00
Jimmy Westberg 007ef78f2b [Deploy] Added sub folder for BIN files
I moved the compiled files to a sub folder (BIN) which makes it auto load if using the ESP.Easy.Flasher.exe
2018-10-30 21:05:09 +01:00
Jimmy Westberg d16daeca56 [Flasher] Added ESP.Easy.Flasher.exe
And moved the bin files to sub folder "BIN"
2018-10-30 20:52:46 +01:00
TD-er 90fdb8f809 [OTA] Add OTA info and disable when not enough space 2018-10-30 15:58:46 +01:00
ESPEasy release bot ac20349854 automatically updated release notes for mega-20181030 2018-10-30 04:00:07 +01:00
Gijs NoorlanderandGitHub 1a972d61a6 Merge pull request #1619 from jamestutton/mega
Added Special Case to allow Servo to be disabled
2018-10-30 01:01:17 +01:00
Gijs NoorlanderandGitHub d6cf2e141b Merge pull request #1944 from svmac/mega
P022_PCA9685 Enhancements
2018-10-30 01:00:35 +01:00
Gijs NoorlanderandGitHub 7a2e9ba203 Merge pull request #1978 from TD-er/feature/core_2_4_2
[Core 2.4.2] Set core 2.4.2 as default platform
2018-10-30 00:58:46 +01:00
TD-er e3591aceb2 [Core 2.4.2] Set core 2.4.2 as default platform
Also added separate build using core 2.4.1 for those with PWM issues.
2018-10-30 00:23:36 +01:00
ESPEasy release bot ad3514e765 automatically updated release notes for mega-20181029 2018-10-29 04:00:08 +01:00
Gijs NoorlanderandGitHub f543995d86 Merge pull request #1968 from TD-er/bugfix/increase_ntp_accuracy
[NTP] Improve NTP accuracy
2018-10-29 01:02:09 +01:00
Gijs NoorlanderandGitHub 97ccb8eca1 Merge pull request #1975 from uzi18/patch9
Dallas: use reset timming from OneWire lib
2018-10-29 01:01:51 +01:00
Bartlomiej Zimon f291c9d25a Dallas: use reset timming from OneWire lib 2018-10-28 14:59:50 +00:00
Gijs NoorlanderandGitHub bd9ead3851 Merge pull request #1974 from uzi18/patch9
Dallas: add ScratchPad to debug log
2018-10-28 14:48:29 +01:00
Bartlomiej Zimon 43ea0039fd Dallas: add ScratchPad to debug log - OK suffix means data integrity ok (no communication problems) 2018-10-28 12:50:34 +00:00
ESPEasy release bot 74eb638bcb automatically updated release notes for mega-20181028 2018-10-28 04:00:09 +01:00
TD-er c87b035908 [NTP] Change log level for NTP success to INFO 2018-10-28 01:10:11 +02:00
TD-er 0f450eaa3d [NTP] Improve NTP accuracy
Use fractional part of TX section in NTP packet.
Also compensate for total delay to retrieve answer.

More possibilities for improvement of NTP, see https://github.com/lettier/ntpclient/issues/4#issuecomment-360703503
2018-10-28 00:22:39 +02:00
Gijs NoorlanderandGitHub 02df033fc6 Merge pull request #1967 from TD-er/bugfix/1684_Eastron
[Eastron] Make configurable and allow for multiple values read (#1684)
2018-10-28 00:07:57 +02:00
Gijs NoorlanderandGitHub 74d05e58f0 Merge pull request #1768 from workgroupengineering/feature/cron
[Feature] [Plugin] Cron
2018-10-28 00:07:31 +02:00
ESPEasy release bot 3d88537677 automatically updated release notes for mega-20181027 2018-10-27 04:00:12 +02:00
Gijs NoorlanderandGitHub 95b0a7bed9 Merge pull request #1784 from jazzgil/add-raw-ir-reading
Add IR RAW2 Reading / Transmitting.
2018-10-27 02:45:26 +02:00
Gijs NoorlanderandGitHub bc3434532e Merge pull request #1942 from giig1967g/new/doubleclick-pcf
doubleclick and longpress for PCF and MCP
2018-10-27 02:41:12 +02:00
TD-er 1f7639cb42 [Eastron] Make configurable and allow for multiple values read (#1684)
See #1684
It should now be possible to actually select parameters and configure it from the frontend.

N.B. Not yet tested on real hardware.
2018-10-27 00:49:52 +02:00
Gijs NoorlanderandGitHub 923642bb27 Merge pull request #1966 from uzi18/patch9
CSE7766 - fix stats plus add buffer fill level, #1934
2018-10-26 23:25:21 +02:00
Bartlomiej Zimon a09cb906eb CSE7766 - fix stats plus add buffer fill level 2018-10-26 20:43:31 +00:00
Saverio Cisternino 72b0a32839 [CRON] Fixed Daily flash write rate exceeded! 2018-10-26 09:51:41 +02:00
TD-erandSaverio Cisternino e279e5504b [Cron] Rename plugin name to match naming convention 2018-10-26 09:51:41 +02:00
Saverio Cisternino 6d5ddf06ce [CRON] Intercept event PLUGIN_TIME_CHANGE 2018-10-26 09:51:41 +02:00
Saverio Cisternino 7f544b7a10 [CRON] Add event PLUGIN_TIME_CHANGE 2018-10-26 09:51:41 +02:00
Saverio Cisternino fc407e86e1 [CRON] Plugin 2018-10-26 09:51:41 +02:00
Saverio Cisternino a35c3051df [CRON] Replace timeStruct with standard tm 2018-10-26 09:51:41 +02:00
ESPEasy release bot f8f2ddd33b automatically updated release notes for mega-20181026 2018-10-26 04:00:22 +02:00
Gijs NoorlanderandGitHub 6592b57615 Merge pull request #1934 from uzi18/patch9
fix for #1920
2018-10-25 23:52:04 +02:00
Bartlomiej Zimon 6e8e8214b2 CSE7766 - add some stats to debug log 2018-10-25 20:47:36 +00:00
Gijs NoorlanderandGitHub 24b6611c54 Merge pull request #1956 from workgroupengineering/BugFix/Issue_1995
Fixed plugin timer processing do not start, when call setPluginTaskTimer in PLUGIN_TIMER_IN
2018-10-25 21:37:07 +02:00
Gijs NoorlanderandGitHub 8135defa6f Merge pull request #1957 from TD-er/bugfix/c009_reduce_memory
[C009] Reduce memory usage for C009 controller.
2018-10-25 21:27:18 +02:00
Bartlomiej Zimon d5e9cfb081 Merge branch 'mega' of github.com:letscontrolit/ESPEasy into patch9 2018-10-25 18:17:10 +00:00
TD-er ffc8e1fb97 [C009] Reduce memory usage for C009 controller. 2018-10-25 12:09:49 +02:00
Saverio Cisternino 0255f41897 Fixed plugin timer processing do not start, when call setPluginTaskTimer in PLUGIN_TIMER_IN 2018-10-25 10:24:09 +02:00
ESPEasy release bot e88973861f automatically updated release notes for mega-20181025 2018-10-25 04:00:13 +02:00
Gijs NoorlanderandGitHub d6ec7aa736 Merge pull request #1941 from workgroupengineering/feature/Issue_1794
Added auto redirect to home after run reboot command from web page.
2018-10-25 02:12:08 +02:00
Gijs NoorlanderandGitHub 8aa5866dd9 Merge pull request #1954 from TD-er/bugfix/replace_yield_delay_0
[WDT] Replace yield() with delay(0)  & add Sonoff POW R2 build
2018-10-25 02:11:15 +02:00
TD-er 0c384c332e [Travis] Use variables even when no predefined plugins are added. 2018-10-25 01:54:00 +02:00
TD-er 7a4f3b15b3 [Info] Remove MD5 check fail on self-built images
And add in bold a statement it is self built.
2018-10-25 01:43:26 +02:00
TD-er c38e532e67 [Sonoff] Add pre-defined switch and relay + rules on factory reset
Define `GPIO_KEY1` containing GPIO number to get a pre-configured button input on factory reset.

Define `GPIO_REL1` containing GPIO number to get a pre-configured relay on factory reset.

When couple of `GPIO_KEY1` and `GPIO_REL1` is defined, a rule matching both will be added.
This is defined for 1...4
2018-10-25 01:28:25 +02:00
TD-er f983dd924d [Build] Add Sonoff POW R2 (4MB)
Sonoff POW R2 has 4 MB flash. So this needs a separate build, compared to the regular POW.
2018-10-24 20:44:48 +02:00
TD-er f0ff52b76b [WDT] Change yield() to delay(0)
`delay(0)` is a special case of delay, which also calls the system scheduler, `yield()` does not call.
It may interrupt a bit more than `yield()` 

See #1950
2018-10-24 13:25:36 +02:00
Plebs 3c0e5d1965 fixed as requested
- Fixed bootstate logic and inversed logic
- added selected events for doubleclick and longpress
- fixed log messages
- cleaned code
2018-10-23 23:45:23 +02:00
Bartlomiej Zimon 14489a2e98 optimization - remove double checksum check 2018-10-23 19:53:36 +00:00
Bartlomiej Zimon a920b95cfb move to PLUGIN_SERIAL_IN from PLUGIN_TEN_PER_SECOND - serial commandline uses our data 2018-10-23 15:52:27 +00:00
Saverio Cisternino a111175a8f Added auto redirect to home after run reboot command from web page. 2018-10-23 09:14:31 +02:00
svmac 4fd2166b5e P022_PCA9685 Enhancements
Added freq setting
Added mode2 command and setting
Added range command and setting
2018-10-23 05:06:23 +02:00
ESPEasy release bot db76aeb959 automatically updated release notes for mega-20181023 2018-10-23 04:00:14 +02:00
Gijs NoorlanderandGitHub b313957311 Merge pull request #1943 from TD-er/bugfix/pubsubclient_fixes
Bugfix/pubsubclient fixes
2018-10-23 02:09:38 +02:00
TD-er 9d0f741e84 [Docs] Add some WiFi related information to docs
Last week I added this text in a discussion on an issue.
It is also useful in the documentation so keep a copy there.
2018-10-23 01:48:26 +02:00
TD-er 7c0f1551b8 [WiFi timeout] Set default to 1000 msec again
Lower values might give strange issues
2018-10-23 01:45:33 +02:00
TD-er 8a59811392 [PubSubClient] Add delay when waiting for data and flush on disconnect
Applied suggestions:
- https://github.com/knolleary/pubsubclient/pull/472
- https://github.com/knolleary/pubsubclient/pull/495
2018-10-23 01:44:22 +02:00
Plebs e2e715d7de final fixes 2018-10-22 23:31:49 +02:00
Bartlomiej Zimon ccb4cf6a7a move to PLUGIN_TEN_PER_SECOND
update comments
2018-10-22 21:19:00 +00:00
Plebs 1b4a217bc9 fixed a display bug 2018-10-22 23:07:00 +02:00
Plebs 19ecf36358 doubleclick and longpress for PCF and MCP
Added doubleclick and longpress events for PCF (P019) and MCP (P009)
2018-10-22 22:30:20 +02:00
Bartlomiej Zimon bdea34a583 CSE7766 add online checksumming, autosyncing without data loos 2018-10-22 19:54:58 +00:00
Gijs NoorlanderandGitHub b7b5028c0c Merge branch 'mega' into add-raw-ir-reading 2018-10-22 20:05:59 +02:00
Gijs NoorlanderandGitHub c519d887db Merge pull request #1932 from TD-er/bugfix/1486_rotary_encoder
[#1486] Allow multiple instances of rotary encoder
2018-10-22 19:58:07 +02:00
Gijs NoorlanderandGitHub 29c8b850ba Merge pull request #1930 from Kurairaito/patch-1
Allow multiple instances of _P067_HX711_Load_Cell
2018-10-22 13:01:09 +02:00
Gijs NoorlanderandGitHub d01cb9b9a2 Merge pull request #1933 from TD-er/bugfix/Javascript_update_device_values
[JavaScript] Fix update values on Devices tab
2018-10-22 10:59:29 +02:00
ESPEasy release bot 9d894d7c83 automatically updated release notes for mega-20181022 2018-10-22 04:00:15 +02:00
Bartlomiej Zimon a418cb2bd0 Ser2Net catch serial data only if plugin used 2018-10-21 18:51:43 +00:00
Bartlomiej Zimon 907a672fa0 CSE7766 uses 8E1 serial connection 2018-10-21 18:50:57 +00:00
TD-er 2f10274da2 [JavaScript] Cleanup some code duplication 2018-10-21 17:01:55 +02:00
TD-er 399b344779 [JavaScript] Fix update values on Devices tab
Not all plugins have all values.
Now the JavaScript code checks if a DOM element exists before updating its value.
2018-10-21 16:47:06 +02:00
TD-er 2e06ed14c0 [#1486] Allow multiple instances of rotary encoder
Used same procedure as for P013 ultrasonic
See #1486
2018-10-21 15:51:36 +02:00
KurairaitoandGitHub b0032bebdb Update _P067_HX711_Load_Cell.ino
Reduce Ram footprint by using map vector instead of array
2018-10-21 13:41:40 +02:00
KurairaitoandGitHub a525ec34b0 Update _P067_HX711_Load_Cell.ino
Make it compatible when instantiated multiple time
2018-10-21 12:46:26 +02:00
Gijs NoorlanderandGitHub 024ec7b727 Merge pull request #1928 from TD-er/bugfix/reduce_webserver_strings
Reduce webserver strings
2018-10-21 11:12:52 +02:00
ESPEasy release bot 1ff0141e38 automatically updated release notes for mega-20181021 2018-10-21 04:00:16 +02:00
Gijs NoorlanderandGitHub 125db8046b Merge pull request #1927 from TD-er/feature/1870_build_sysino
[#1870] Feature request build date as system info
2018-10-21 01:20:51 +02:00
TD-er 720317c829 [Webserver] Uniform row labels to reduce flash string size 2018-10-21 01:18:43 +02:00
TD-er bbe9005a32 [Webserver] Generate copyText id names
Reduce amount of flash strings to reduce build file size
2018-10-21 00:05:31 +02:00
Gijs NoorlanderandGitHub afa16e80b6 Merge pull request #1923 from TD-er/bugfix/wifi_stability
Various network stability fixes and reduce memory usage when saving settings
2018-10-20 23:09:50 +02:00
Gijs NoorlanderandGitHub 37f5c92aa7 Merge pull request #1926 from TD-er/bugfix/1891_multiple_values
[#1891] Send all values for Generic UDP controller
2018-10-20 23:08:05 +02:00
TD-er 684b89ae4c [#1870] Feature request build date as system info
See #1870
Added:
- %sysbuild_date%
- %sysbuild_time%
2018-10-20 23:05:59 +02:00
TD-er 8c4612c300 [#1891] Send all values for Generic UDP controller
See https://github.com/letscontrolit/ESPEasy/issues/1891#issuecomment-431612051

A copy of the element from the queue was used, not a reference to it.
Therefore increasing the internal counter to send the next value was only executed on the copy, not the element in the list.
2018-10-20 22:34:11 +02:00
Gijs NoorlanderandGitHub 0afab53659 Merge pull request #1925 from TD-er/revert/1924_pull_request
Revert "fix for #1920"
2018-10-20 20:05:22 +02:00
Bartlomiej ZimonandTD-er e6e98345fe Revert "fix for #1920"
This reverts commit 3f84c35014.
2018-10-20 20:03:56 +02:00
Gijs NoorlanderandGitHub 2394e4a75f Merge pull request #1924 from uzi18/patch9
fix for #1920
2018-10-20 18:51:05 +02:00
ESPEasy release bot e1c4691325 automatically updated release notes for mega-20181020 2018-10-20 04:00:16 +02:00
Bartlomiej Zimon 3f84c35014 fix for #1920
fix for out of sync, check both header bytes
proper check for abnormal state
2018-10-19 22:40:11 +00:00
TD-er bc0bafa96b [#1910] Notification settings extra strings on stack
See #1910
Added a lot more of these changes and changed the input fields of the Notification Settings to be the same as all input fields in other places.
2018-10-20 00:20:58 +02:00
TD-er 4e7e66822d [Rules] Early exit on rules processing when rules not enabled 2018-10-20 00:20:58 +02:00
TD-er 6f226e6d65 Proper look for connection.
See discussion here: https://github.com/esp8266/Arduino/issues/5257
2018-10-20 00:20:58 +02:00
TD-er a50a035238 [stack usage] Allocate temp char array on heap for parsing arguments
These char arrays were rather large, so allocate on heap instead of char[240] on the stack.
Also re-order elements in not stored structs to reduce memory usage
2018-10-20 00:20:58 +02:00
Gijs NoorlanderandGitHub d560c635f5 Merge pull request #1922 from kpalczewski/mega
add support for 64bit IR codes.
2018-10-20 00:05:31 +02:00
kpalczewski f8db0c0a05 add support for 64bit IR codes. 2018-10-19 22:34:04 +02:00
Gijs NoorlanderandGitHub 79616022df Merge pull request #1919 from giig1967g/new/statusvariables
added 4 variables to verify the system status
2018-10-19 22:15:26 +02:00
Gijs NoorlanderandGitHub 559d294607 Merge branch 'mega' into new/statusvariables 2018-10-19 21:36:45 +02:00
Gijs NoorlanderandGitHub d2588c5e01 Merge pull request #1848 from giig1967g/new/plugin_pcf
Added [plugin#pcfgpio#pinstate#xx] and [plugin#mcpgpio#pinstate#xx]
2018-10-19 21:34:18 +02:00
Gijs NoorlanderandGitHub ba45a51576 Merge pull request #1884 from giig1967g/new/uservars
added Global Variables for rules
2018-10-19 21:33:10 +02:00
Gijs NoorlanderandGitHub 8321caaeed Merge branch 'mega' into new/statusvariables 2018-10-19 21:31:18 +02:00
Gijs NoorlanderandGitHub b35ed7d809 Merge pull request #1880 from giig1967g/doubleclick
DEBOUNCE, DOUBLECLICK and LONGPRESS events for PLUGIN001
2018-10-19 21:23:22 +02:00
Plebs a4583d150e added 4 variables to verify the system status
4 new system variables:
%iswifi% (=1 if wifi is connected)
%isntp% (=1 if NTP has been initialized)
%ismqtt% (=1 if mqtt is connected)
%ismqttimp% (=1 if mqtt import is connected)

Example:
if %isntp%=1 and %systime%>%sunset% do
....
endif
2018-10-18 17:44:05 +02:00
ESPEasy release bot cadc0a885d automatically updated release notes for mega-20181017 2018-10-17 04:00:18 +02:00
Gijs NoorlanderandGitHub 061eb20ae5 Merge pull request #1914 from TD-er/bugfix/reduce_stack
[#1906] Move Notification and Controller settings to heap
2018-10-17 00:40:30 +02:00
TD-er 9a9799eee7 [Stack] Add Free Stack to System Info plugin 2018-10-17 00:04:22 +02:00
Gijs NoorlanderandGitHub f4615bb76b Added checklist to the Issue_template
Lately a lot of new issues were non-descriptive and the same basic questions were to be asked over and over again.
These are now included in this template.
2018-10-16 23:02:33 +02:00
TD-er ecc498c359 [#1906] Allocate ControllerSettings on the heap
See #1906
2018-10-16 12:24:06 +02:00
TD-er e0e10fa6c8 [#1906] Allocate NotificationSettings on the heap
See #1906
2018-10-16 11:47:46 +02:00
ESPEasy release bot 228f09f394 automatically updated release notes for mega-20181016 2018-10-16 04:00:06 +02:00
Gijs NoorlanderandGitHub 19ac19778b Merge pull request #1909 from giig1967g/bug/toggle
Fix for "togglegpio" without gpio initialization
2018-10-16 01:11:46 +02:00
Gijs NoorlanderandGitHub 5e2d517ba2 Merge pull request #1913 from TD-er/bugfix/revert_safe_strncpy
[Revert] Safe_strncpy cannot be used as generic strncpy replacement
2018-10-16 01:09:59 +02:00
TD-er 7a4b17983e [Revert] Safe_strncpy cannot be used as generic strncpy replacement
It does do more. So only use it to convert Strings to single char arrays.
2018-10-16 00:11:17 +02:00
Plebs 6eba74ccc1 Fix for togglegpio without gpio initialization 2018-10-15 17:34:35 +02:00
ESPEasy release bot 27a05b674c automatically updated release notes for mega-20181015 2018-10-15 04:00:10 +02:00
Gijs NoorlanderandGitHub 4a66bbf081 Merge pull request #1905 from TD-er/bugfix/safe_strncpy
[safe strncpy] Add warning when entered string is too large
2018-10-15 00:52:34 +02:00
TD-er 109bddb5c3 [safe strncpy] Add warning when entered string is too large
Started with this issue:
"Framed Oled Display mixing up multiple values in different lines" #1904

Now almost all calls to `strncpy` are replaced with this safe variant which does some checking and zero-ing the buffer.
2018-10-15 00:24:57 +02:00
Gijs NoorlanderandGitHub 8158a919d8 Merge pull request #1879 from giig1967g/bug/1864
fix for bug #1864
2018-10-14 10:35:19 +02:00
ESPEasy release bot 706b91168b automatically updated release notes for mega-20181014 2018-10-14 04:00:13 +02:00
Gijs NoorlanderandGitHub d047999c5e Merge pull request #1901 from TD-er/bugfix/warn_incomplete_IPsettings
[UX] Warn user for incomplete network IP settings
2018-10-14 00:59:37 +02:00
Gijs NoorlanderandGitHub 42f361aacd Merge pull request #1902 from TD-er/bugfix/1895_I2C
[#1895] Incorrect number bytes read I2C_read32_reg
2018-10-14 00:43:15 +02:00
TD-er 3dd076cf25 [#1895] Incorrect number bytes read I2C_read32_reg
See #1895
2018-10-14 00:42:03 +02:00
TD-er c0d155dd99 [UX] Warn user for incomplete network IP settings
Was a left-over remark in #1291
2018-10-14 00:22:46 +02:00
Gijs NoorlanderandGitHub c433174d71 Merge pull request #1900 from TD-er/bugfix/time_initialized_event
Time#Initialized event in rules before %syshour% is set
2018-10-13 23:37:04 +02:00
Gijs NoorlanderandGitHub b805b59baf Merge pull request #1899 from TD-er/bugfix/controller_check_reply
Fix send only first value by controller (#1891 #1892 #1835)
2018-10-13 23:07:32 +02:00
Gijs NoorlanderandGitHub 9fae0477d8 Merge pull request #1894 from letscontrolit/feature/1799_SSID_mainpage
[#1799] Add SSID to main page
2018-10-13 23:06:55 +02:00
TD-er f7ac04dc96 Time#Initialized event in rules before %syshour% is set
See [forum](http://www.letscontrolit.com/forum/viewtopic.php?f=6&t=5819&p=31376&hilit=Initialized#p31376) and [other report of same issue](https://www.letscontrolit.com/forum/viewtopic.php?t=5925)
2018-10-13 23:05:35 +02:00
TD-er d50e661efb [Controller] Fix send only first value
See #1891 #1892 #1835
Added an extra option to explicitly check the reply  on sent messages by a controller.
2018-10-13 22:21:36 +02:00
Plebs 57b5338af6 Update src/StringConverter.ino 2018-10-12 15:00:58 +02:00
Plebs bd035c8f81 optimizations 2018-10-12 12:52:22 +02:00
Plebs ac63d93e1a Update src/_P001_Switch.ino 2018-10-12 12:10:10 +02:00
Plebs 4cff0d0e02 Update src/_P001_Switch.ino 2018-10-12 10:16:54 +02:00
TD-er ca83983fd2 [#1891] Generic UPD controller - send only first value from sensor
See #1891
2018-10-12 01:04:46 +02:00
Gijs NoorlanderandGitHub d808f7e79b [#1799] Add SSID to main page
See #1799
2018-10-12 00:57:08 +02:00
Plebs e469350ad9 modified command and variable name 2018-10-11 19:23:42 +02:00
Plebs 60536b1a93 some optimizations 2018-10-11 12:23:08 +02:00
Plebs b9e45bd515 fixed length check 2018-10-11 12:16:55 +02:00
Plebs a0992b8383 fixes 2018-10-11 11:50:37 +02:00
Plebs 9315581858 some fixes 2018-10-11 11:37:15 +02:00
ESPEasy release bot 9a763303ca automatically updated release notes for mega-20181011 2018-10-11 04:00:24 +02:00
Gijs NoorlanderandGitHub 7df9379f47 Merge pull request #1886 from TD-er/bugfix/reduce_memory_usage
Bugfix/reduce memory usage & improve load ExtraTaskSettings check
2018-10-11 01:48:31 +02:00
Plebs c32fe50521 Update src/_P023_OLED.ino 2018-10-10 23:28:34 +02:00
Plebs e4569b26f7 added global variables for rules
Added a new command:
customvar,x,y
that stores in a system variable %customvarx% the value 'y'.

Values are float
2018-10-10 23:19:09 +02:00
TD-er 48998886fe [WebLog] Disable weblog when it is not being read
This will prevent log items being generated when web log level is the highest level and it will clear the web log buffer to free memory.
2018-10-10 20:23:10 +02:00
Plebs 36f97d7909 some fixes 2018-10-10 19:24:45 +02:00
TD-er 0e3b9c9e47 [Travis Doc] Remove building documentation by Travis
It seems to break the nightly builds, so remove for now.
2018-10-10 15:54:34 +02:00
ESPEasy release bot acecff4108 automatically updated release notes for mega-20181010 2018-10-10 04:00:09 +02:00
TD-er 3322b954a7 Make sure to load ExtraTaskSettings when needed
There is only 1 `ExtraTaskSettings` object, so make sure it is always in sync.
2018-10-10 01:29:38 +02:00
TD-er 4c4b844a4d [Controller] Set default timeout to 300 msec (was 100 msec)
300 msec should be enough for most online services like `cloudmqtt.com`
2018-10-10 00:19:26 +02:00
Gijs NoorlanderandGitHub cf4d28eb4f Merge pull request #1877 from giig1967g/new/pcfinvertstate
Fix for #1767
2018-10-10 00:05:11 +02:00
TD-er 555b5386ae [C009] Reduce memory usage of FHEM HTTP delay queue
The entire JSON string was stored in the queue element, but lot of it can be computed later.
2018-10-09 23:52:46 +02:00
Plebs 1903fdc7f2 fix for bug #1864
Removed '.' check
2018-10-09 18:16:15 +02:00
Plebs 918353461e Update src/_P001_Switch.ino 2018-10-09 16:31:55 +02:00
Plebs e648a20fd0 Update src/_P019_PCF8574.ino 2018-10-09 16:24:13 +02:00
Plebs 1d7ea5e129 Update src/_P001_Switch.ino 2018-10-09 14:58:21 +02:00
Plebs 6ce5240dd7 few changes 2018-10-09 09:34:50 +02:00
ESPEasy release bot 692fb248ce automatically updated release notes for mega-20181009 2018-10-09 04:00:18 +02:00
Gijs NoorlanderandGitHub 5a87397ee0 Merge pull request #1872 from TD-er/bugfix/JSON_newline
Bugfix/json newline and memory allocation optimizations.
2018-10-09 01:14:50 +02:00
TD-er 99ba09b024 [StringConverter] Some optimisations to reduce memory allocation 2018-10-09 01:11:45 +02:00
Plebs 3dea091d21 small fixes 2018-10-09 00:20:27 +02:00
Plebs ca13317cbd Update src/_P001_Switch.ino 2018-10-09 00:12:50 +02:00
TD-er f68516d5bb [LWIP1.4] Move back to LWIP1.4
The combination LWIP1.4 and core 2.4.1 were used until begin of May and those were considered stable.
2018-10-08 23:56:55 +02:00
TD-er 8102a0096d [JSON] Replace \n and \r in text fields
Those are not allowed in strings in JSON.
This leads to (web) log viewer crashing.
2018-10-08 23:44:44 +02:00
Plebs 73cec59bd5 Update src/_P001_Switch.ino 2018-10-08 22:30:02 +02:00
Gijs NoorlanderandGitHub 96ecf9bf29 Merge pull request #1871 from TD-er/bugfix/travis_check_for_docs
[Docs] Disable travis_terminate for now
2018-10-08 21:05:55 +02:00
TD-er ef1e371514 [Docs] Disable travis_terminate for now
Apparently `travis_terminate` does not exist anymore as a command to stop the script without failing.
2018-10-08 19:29:56 +02:00
Gijs NoorlanderandGitHub 45d67292a3 Merge pull request #1869 from TD-er/feature/travis_build_docs
Feature/travis build docs
2018-10-08 16:38:16 +02:00
TD-er b5662baad4 [Docs] Run Travic documentation check before compiling project 2018-10-08 16:04:12 +02:00
TD-er 12c3e5f81f [Docs] Add Travis check for documentation and stop build for docs only
Let Travis build the documentation and prevent full build when only documentation changed.
2018-10-08 15:34:02 +02:00
TD-er dececf24ee [Docs] Add favicon to documentation 2018-10-08 15:31:48 +02:00
ESPEasy release bot 3fb6dec382 automatically updated release notes for mega-20181008 2018-10-08 04:00:09 +02:00
Gijs NoorlanderandGitHub cef962c5f1 Added link to ReadTheDocs 2018-10-08 00:05:58 +02:00
Gijs NoorlanderandGitHub cca2335070 Merge pull request #1868 from TD-er/feature/update_sphinx_docs
[Docs] Added some directory structure and template
2018-10-08 00:01:07 +02:00
TD-er ffd0d26ed3 [Docs] Added some directory structure and template 2018-10-08 00:00:27 +02:00
Plebs 9b457ed77b some code optimizations 2018-10-07 23:12:23 +02:00
GrovkillenandGitHub f787a9a9a6 [Sphinx] added extension "sphinx.ext.imgconverter" 2018-10-07 19:11:49 +02:00
Gijs NoorlanderandGitHub a0ae104794 Merge pull request #1865 from TD-er/feature/sphinx_docs
Feature/sphinx docs
2018-10-07 18:26:06 +02:00
TD-er 2b78810457 [Docs] First ESPEasy documentation (Controllers) 2018-10-07 18:23:25 +02:00
TD-er 43081c3ac8 [Sphinx] Initial setup for Sphinx documentation 2018-10-07 17:09:52 +02:00
ESPEasy release bot 33281c08c2 automatically updated release notes for mega-20181007 2018-10-07 04:00:09 +02:00
Gijs NoorlanderandGitHub 461aee26ad Merge pull request #1861 from TD-er/feature/debug_esp32_wrover_kit
Move stack to user memory space and close file handles + Add WROVER dev kit debug support
2018-10-06 23:19:18 +02:00
Gijs NoorlanderandGitHub 2b0b14b2e8 Merge pull request #1853 from blenk92/XSS
Fix XSS-Vulnerabilites on wifi configuration pages
2018-10-06 22:56:47 +02:00
Gijs NoorlanderandGitHub b7404666b1 Merge pull request #1851 from blenk92/mega
Force slash to be converted in htmlEscape
2018-10-06 22:56:37 +02:00
Gijs NoorlanderandGitHub da25aa87dd Merge pull request #1733 from giig1967g/new/invertvalue
Add four new TOGGLE commands
2018-10-06 22:55:57 +02:00
TD-er 10a1e634e2 [SPIFFS] Make sure to close open files on SPIFFS 2018-10-06 22:36:41 +02:00
TD-er 83f86449b9 [Stack] Move Arduino 'cont' stack into user RAM
As suggested [here](https://github.com/letscontrolit/ESPEasy/pull/1858#issuecomment-427578956) the previous used flag may also enable WPS.
So I used [this suggestion](https://github.com/esp8266/Arduino/issues/5148#issuecomment-424334261) to only re-allocate the stack at link time.
2018-10-06 20:01:39 +02:00
TD-er eee337d3e3 [ESP32] Allow Wrover dev kit to be used for PIO debug
Initial setup to be able to debug ESP32 Wrover dev kit from within Visual Studio Code + PIO plus.
2018-10-06 18:31:17 +02:00
ESPEasy release bot c549ecd329 automatically updated release notes for mega-20181006 2018-10-06 04:00:13 +02:00
Gijs NoorlanderandGitHub d9e682668d Merge pull request #1858 from TD-er/bugfix/increase_stack_5k
[Stack] Increase stack to 5k and reduce stack allocations in rules
2018-10-06 00:57:31 +02:00
TD-er e38072ac24 [Build flags] Remove NO_EXTRA_4K_HEAP
Core is now set to 2.4.1 again, so this flag is not needed anymore.
Also not sure if it did fix something in 2.4.2 core.
2018-10-06 00:53:53 +02:00
TD-er 6aebeba5dc [WiFi] Add delay to connection attempts in ControllerSettings
As suggested by @s0170071 [here](https://github.com/letscontrolit/ESPEasy/issues/1774#issuecomment-425038026)
2018-10-06 00:50:43 +02:00
TD-er da01c8f469 [Stack] Increase stack to 5k and reduce stack allocations in rules
Removed some unneeded stack allocations of 240 bytes in the rules processing.

Also gave the `process_system_event_queue()` a bit more priority to make sure it will be looked at at least once every 500 msec.
2018-10-05 00:52:22 +02:00
Plebs d3c86b9824 code optimization 2018-10-04 12:07:32 +02:00
Plebs 9621a91d90 added [plugin#mcpgpio#pinstate#xx] 2018-10-04 11:31:49 +02:00
ESPEasy release bot b3b68856f0 automatically updated release notes for mega-20181004 2018-10-04 04:00:08 +02:00
Max bec5cb5334 Fix XSS-Vulnerabilites on wifi configuration pages
Add escaping of wifi network names that can be discovered using the search
functionality of for instantce the /setup page. As these names are also used
inside an html tag, a stronger html encoding variant has been added.
2018-10-04 03:19:09 +02:00
Gijs NoorlanderandGitHub bda6011390 Merge pull request #1852 from TD-er/bugfix/wificlient_timeout
[#1830] WiFi client timeout & back to core 2.4.1
2018-10-04 00:56:09 +02:00
Gijs NoorlanderandGitHub f3fdb93a52 Merge pull request #1831 from JojoS62/mega
[P013_HCSR04] added error checking and logging
2018-10-04 00:54:02 +02:00
Gijs NoorlanderandGitHub 200b060b15 Merge pull request #1846 from thomastech/mega
Update _P075_Nextion.ino
2018-10-04 00:51:44 +02:00
Gijs NoorlanderandGitHub ff41cb2f94 Merge pull request #1849 from uzi18/patch9
- partial fix for #1723
2018-10-04 00:51:03 +02:00
TD-er c134eb6d13 [Core 2.4.1] Move back to core 2.4.1 from 2.4.2
PlatformIO `espressif8266@1.7.3` instead of `espressif8266@1.8.0`
2.4.2 has a lot of improvements like 4k of extra free memory.
But also the number of hardware watchdog reboots has increased a lot and the PWM related code no longer seems to work on 2.4.2
So for now, back to 2.4.1 library.
2018-10-04 00:24:28 +02:00
TD-er f9e2a211e1 [WiFiClient] Set timeout and make it configurable for controllers
The default timeout for wificlient is 1000 msec. This may cause all kind of strange effects when the node is being blocked for so long.
2018-10-04 00:21:00 +02:00
Max bd3d3f66f4 Force slash to be converted in htmlEscape
According to the owasp XSS prevention cheat sheet it is also necessary to encode / as it may helps to end html entities
(Source https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet#RULE_.231_-_HTML_Escape_Before_Inserting_Untrusted_Data_into_HTML_Element_Content)
2018-10-03 23:58:24 +02:00
Bartlomiej Zimon 3bad683211 - partial fix for #1723 2018-10-03 21:13:56 +00:00
TD-er 68f6e913a2 [sendHttp] #1830 Set timeout and early exit on timeout reached
See #1830
2018-10-03 23:10:47 +02:00
Plebs 0b9c550fd7 Added [plugin#pcfgpio#pinstate#xx]
Added [plugin#pcfgpio#pinstate#xx] variable for rules
2018-10-03 22:49:11 +02:00
Plebs 96420faa2f added "mcpgpiotoggle" command 2018-10-03 22:07:42 +02:00
ThomasandGitHub 8eea77e4ed Update _P075_Nextion.ino (#1)
Added DEBUG_LOG define to reduce info log messages and prevent serial log flooding.
Added SendStatus() to post log message on browser to acknowledge HTTP write.
Added reserve() to minimize string memory allocations.
2018-10-03 09:02:02 -07:00
JojoS62 3d1f723787 Merge branch 'mega' of https://github.com/letscontrolit/ESPEasy into mega 2018-10-03 15:27:40 +02:00
JojoS62 5d459003e4 fixed 'unused variable' warning 2018-10-03 15:19:19 +02:00
JojoS62 ad208c357c code clean up
added default for filter size = 5.
clode clieanup: using constants, read setting into local vars for better readability,
2018-10-03 14:33:17 +02:00
ESPEasy release bot b1c777e6fd automatically updated release notes for mega-20181003 2018-10-03 04:00:18 +02:00
JojoS62 f5ab15c255 max distance depends on measurement unit
setting is in user units, ping function needs cm. Conversion added.
added unit to log output.
2018-10-02 17:41:23 +02:00
JojoS62 001ec6dcd2 added more settings: unit, filtertype and size
Measuring unit can be changed bewtween metric/imperial
Filtertype can none or median. If median a filtersize can be set.
Meauring value time to distance conversion now as float division, resulting in a higher resolution output.
2018-10-02 17:00:22 +02:00
JojoS62 15e5edccd8 added float calculation for time to distance conversion
returns higher resolution, especially for measuring in inches the integer resolution was low.
2018-10-02 16:57:33 +02:00
Gijs NoorlanderandGitHub 651353cc99 Merge pull request #1842 from crankyoldgit/patch-2
Acknowledge credit & origin of code used in _P016IR.ino
2018-10-02 13:41:35 +02:00
Gijs NoorlanderandGitHub 85f97551c5 Merge pull request #1841 from crankyoldgit/patch-1
Acknowledge credit & origin of code used in IRTX
2018-10-02 13:41:23 +02:00
David ConranandGitHub 6a158f68f5 Acknowledge credit & origin of code used in _P016IR.ino
FYI @TD-er

Ref: https://github.com/letscontrolit/ESPEasy/pull/1645#issuecomment-422253497
2018-10-02 21:36:18 +10:00
David ConranandGitHub 1933714de5 Acknowledge credit & origin of code used in IRTX
FYI @TD-er

Ref: https://github.com/letscontrolit/ESPEasy/pull/1645#issuecomment-422253497
2018-10-02 21:29:57 +10:00
ESPEasy release bot 545117ddf7 automatically updated release notes for mega-20181002 2018-10-02 04:00:29 +02:00
Gijs NoorlanderandGitHub 8eb479c411 Merge pull request #1837 from TD-er/bugfix/schedule_commands_yield
[Stack] Report stack usage on ESP32 and increase stack for ESP8266normal
2018-10-01 23:27:07 +02:00
TD-er b39f51ca3c [Stack] Report stack usage on ESP32 and increase stack for ESP8266normal
Stack usage on ESP32 is querying current stack, not statistics per RTOS task.
2018-10-01 22:15:32 +02:00
Gijs NoorlanderandGitHub 4511e08d3c Merge pull request #1805 from giig1967g/new/parse
split parseTemplate function
2018-10-01 17:12:21 +02:00
Gijs NoorlanderandGitHub 086e836956 Merge pull request #1836 from TD-er/feature/esp32_pio_1_4_0
[ESP32] Update to platform espressif32@1.4.0
2018-10-01 17:10:45 +02:00
Gijs NoorlanderandGitHub 3e20f617ea Merge pull request #1827 from TD-er/bugfix/DTH_Si7021_reading_stability
[#1798] Bugfix Sonoff Si7021 stability
2018-10-01 17:10:23 +02:00
TD-er 8d9aacb6a4 [ESP32] Update to PIO espressif32@1.4.0
[ESP32 IDF 3.1](https://github.com/espressif/esp-idf/releases/tag/v3.1)
[ESP32 PIO 1.4.0](https://github.com/platformio/platform-espressif32/releases/tag/v1.4.0)
2018-10-01 16:34:21 +02:00
TD-er 0670fa98a6 [ESP32] Add default partition table for reference 2018-10-01 16:32:20 +02:00
ESPEasy release bot 2b3d1517c9 automatically updated release notes for mega-20181001 2018-10-01 13:13:13 +02:00
Gijs NoorlanderandGitHub 0be79759d1 Merge pull request #1834 from TD-er/bugfix/detect_large_stack_allocs
[Stack] Move Arduino stack back to top of System stack instead of overlap
2018-10-01 01:25:38 +02:00
TD-er d47bede215 [Stack] Revert move Settings from stack to heap
Apparently the settings are allocated on the system stack and not on the Arduino stack.
This means it takes a lot of ram when allocated on the heap. So move it back to the system stack.
2018-10-01 00:51:04 +02:00
TD-er 2988a244b2 [Stack] Check if a block sent to save on SPIFFS is stack allocated 2018-10-01 00:42:01 +02:00
TD-er 8d87dc0175 [Heap] Use NO_EXTRA_4K_HEAP to get old stack address space
Originally the Arduino stack was placed on top of the system stack.
But since the system stack is mostly empty, it was decided to shift the Arduino stack to overlap the system stack to save an extra 4k of memory.

However, since a lot of Watchdog timer reboots are reported lately, this optimisation will now be reverted to see if it will improve stability.
This will use about 4k more RAM.
2018-10-01 00:40:55 +02:00
Gijs NoorlanderandGitHub 21c86e666a Merge pull request #1829 from TD-er/feature/1824_stack_stats
[#1824] Show stack size on main page
2018-09-30 19:37:16 +02:00
JojoS e6fdd3380a added error checking and logging
there were several errors that all resulted in a distance value reading of 0. Added an errorState that is printed to the log and helps troubleshooting.
Max. Distance checking can be turned off by setting max distance to 0 cm. If max. distance is used, exceeding the range will return a distance of 0 cm and print this to the log.
2018-09-30 15:23:36 +02:00
TD-er e04f71ab47 [#1824] Show stack size on main page
See #1824
2018-09-30 09:32:01 +02:00
ESPEasy release bot 90ae0720cf automatically updated release notes for mega-20180930 2018-09-30 04:00:24 +02:00
Gilad Raz 4ec2af24a3 Increased buffer size. Added constants. 2018-09-30 01:10:55 +03:00
TD-er c8ecd8d374 [#1798] Bugfix Sonoff Si7021 stability
See #1798
2018-09-29 22:50:24 +02:00
Gijs NoorlanderandGitHub 7a451dd672 Merge pull request #1825 from TD-er/bugfix/proper_default_settings
Bugfix/proper default settings
2018-09-29 15:39:21 +02:00
Gijs NoorlanderandGitHub b06f6aa360 Merge pull request #1823 from JojoS62/mega
minor change: unit was missing for threshold in 'state' mode
2018-09-29 15:06:36 +02:00
TD-er 6b67415c71 [Defaults] Other default initializations 2018-09-29 15:05:10 +02:00
JojoS b095465d3a minor change: unit was missing for threshold in 'state' mode 2018-09-29 14:09:03 +02:00
Gijs NoorlanderandGitHub 81a5d911ba Merge pull request #1809 from JojoS62/mega
fixed distance reading
2018-09-29 13:38:44 +02:00
TD-er 48060d8d99 [Default Settings] Properly clear settings when reset to default 2018-09-29 12:40:29 +02:00
JojoS d303fa023f changed implementation to use shared_ptr instead of helper structure
this makes it easier to use this as a template for other sensors. No additional helper class/structure is needed.
2018-09-29 11:58:57 +02:00
JojoS 29b0cc1b32 removed sensordefs helper structure
to simplify the code
2018-09-27 22:00:01 +02:00
JojoS 584abd1e75 on INIT, delete sensordef before adding new 2018-09-27 14:19:54 +02:00
JojoS b4d8be0e59 fixed distance reading
the P_013_sensordef object was created on the stack and the destructor was called after leaving the PLUGIN_INIT. That deleted the included NewPingESP8266 object and using this object failed.
2018-09-27 11:56:31 +02:00
ESPEasy release bot 30f5c5cb7d automatically updated release notes for mega-20180927 2018-09-27 04:00:17 +02:00
Plebs 6e7286c6fb split parseTemplate function
simplifying code
2018-09-26 23:40:01 +02:00
Gijs NoorlanderandGitHub ae1db543ce Merge pull request #1804 from TD-er/bugfix/ESP32_partition_build
[ESP32] Split new partition layout to separate build
2018-09-26 22:52:30 +02:00
TD-er 947e1e0343 [Build] Add esp32test_1M8_partition build and warning on ESP32 partition 2018-09-26 22:49:30 +02:00
TD-er 0578d720f4 [ESP32] Split new partition layout to separate build
See "ESP32 not start after last upgrade" #1802
2018-09-26 21:55:02 +02:00
Gilad Raz 3fee6794f2 Merge branch 'mega' of https://github.com/letscontrolit/ESPEasy into add-raw-ir-reading 2018-09-26 19:03:47 +03:00
Gilad Raz 019e33331b Merge branch 'mega' into add-raw-ir-reading
# Conflicts:
#	src/_P016_IR.ino
#	src/_P035_IRTX.ino
2018-09-26 19:01:50 +03:00
Gijs NoorlanderandGitHub 211d79bbd5 Merge pull request #1792 from TD-er/feature/ESP32_partition_table
[ESP32] Change partition size (will clear all settings) and add plugins
2018-09-26 09:05:44 +02:00
Gilad 8a751a0922 Merge branch 'mega' of https://github.com/letscontrolit/ESPEasy into mega 2018-09-25 18:43:37 +03:00
Gilad 450eca8dc5 Fixed warnings... 2018-09-25 03:13:14 +03:00
Gilad ce0bfbf717 Fixed warnings... 2018-09-25 02:30:20 +03:00
Gilad bb316bbd30 Improved IR RAW2 format to support RLE. 2018-09-25 01:42:45 +03:00
TD-er 91c5d60af9 [Info] Add board name to the sysinfo page. 2018-09-25 00:19:17 +02:00
TD-er 0d9bc8027d [ESP32] RTOS move handle_schedule() to core1 and increase stack
Enable RTOS flag in advanced settings (and reboot) to create separate threads on the 2nd ESP32 core, which will handle the scheduler.
This lowers stack usage and CPU load.
Also the ESP will no longer crash when saving large settings like for the Framed OLED plugin.
2018-09-25 00:18:46 +02:00
TD-er bd2bdab95c [Stack] Move Settings from stack to heap 2018-09-24 22:08:02 +02:00
TD-er c4f98fbc8e [Travis] Uninitialized variable in P073_7DGT 2018-09-24 20:13:24 +02:00
ESPEasy release bot b332a513b5 automatically updated release notes for mega-20180924 2018-09-24 04:00:20 +02:00
TD-er e36bb714f1 [ESP32] Change partition size (will clear all settings) and add plugins
The last update to > 0.12 increased the binary size a lot. This is mainly due to the added BLE support.
This makes it almost impossible to use the default partition table layout.

This changes the app partitions to 1.8 MB and reduces the SPIFFS to 320 k.
Changing the partition table will clear all settings, so make a backup of the settings.

Also added all plugins that would compile (not tested) for ESP32.

Known issue:
ESP32 might crash due to stack overflow when saving settings of plugins. (e.g. OLED framed plugin)
2018-09-24 00:23:45 +02:00
Gijs NoorlanderandGitHub 6e1cde343f Merge pull request #1791 from TD-er/bugfix/ESP32_I2C
[ESP32] Fix I2C handling to allow I2C devices to work
2018-09-23 22:14:43 +02:00
TD-er cce9ddd2dc [ESP32] Fix I2C handling to allow I2C devices to work
See this issue: [I2C repeated start broken](https://github.com/platformio/platform-espressif32/issues/126)
2018-09-23 21:17:55 +02:00
Gijs NoorlanderandGitHub 51be17a436 Merge pull request #1780 from clumsy-stefan/sensor_type_change
Change type of sensor for MCP and PCF devices
2018-09-23 20:18:38 +02:00
Gijs NoorlanderandGitHub 66d27a6697 Merge pull request #1776 from beigenmann/mega
Fix platformio
2018-09-23 20:17:33 +02:00
Gijs NoorlanderandGitHub a033e458fb Merge pull request #1782 from TD-er/bugfix/MQTT_reconnect_name
[MQTT] Work around for lost MQTT connection
2018-09-23 20:17:07 +02:00
Gijs NoorlanderandGitHub 494436bbff Merge pull request #1789 from sakinit/ESP32-to-core_esp32_1_3_0
ESP32: change to platform version core_esp32_1_3_0
2018-09-23 20:16:52 +02:00
sakinit 23bacd0762 change to platform version core_esp32_1_3_0 2018-09-23 17:49:47 +02:00
Gilad 9bdfab3fa2 Add IR RAW2 Reading / Transmitting - added a safety check. 2018-09-23 15:49:26 +03:00
Gilad 9d446745cc Add IR RAW2 Reading / Transmitting - fixed ambiguity. 2018-09-23 14:38:36 +03:00
Gilad d2ab946d17 Add IR RAW2 Reading / Transmitting. 2018-09-23 12:44:56 +03:00
Gilad fcc71a56b6 Add IR RAW2 Reading / Transmitting. 2018-09-23 12:40:52 +03:00
ESPEasy release bot f131254853 automatically updated release notes for mega-20180923 2018-09-23 04:00:12 +02:00
TD-er 657d15d962 [MQTT] Work around for lost MQTT connection
Maybe a fix for #1525
Meant to be a fix for #1530

It looks like the MQTT broker is refusing to accept a new connection from a specific client ID, as long as the broker thinks a client with that ID is still connected.
This work around adds the number of wifi reconnects to the clientID, to make the ID unique when a reconnect has to be made.
2018-09-23 00:54:55 +02:00
Gijs NoorlanderandGitHub 60910da48d Merge pull request #1749 from sakinit/ESP32-P1WifiGateway-updates
Esp32 p1 wifi gateway updates
2018-09-22 20:59:32 +02:00
Gijs NoorlanderandGitHub 6cee2d0f32 Merge pull request #1779 from TD-er/bugfix/BME280_slow_reading
[BME280] Fix slow reading of BME280 causing watchdog resets
2018-09-22 20:45:20 +02:00
stefan 533cb88a64 Change type of sensor for MCP and PCF devices
MCP and PCF devices should be of type SWNSOR_TYPE_SWITCH instead of SENSOR_TYPE_SINGLE so that the controllers can identify them correctly as switches (for GPIO related functions)
2018-09-22 20:41:53 +02:00
TD-er ffa32fe851 [BME280] Fix slow reading of BME280 causing watchdog resets
The plugin still had some delay and an active polling to see if the reading was ready.
This  took more than 1.5 sec per reading, which could trigger a Watchdog reset.
2018-09-22 20:34:56 +02:00
Gijs NoorlanderandGitHub b900cc9389 Merge pull request #1777 from TD-er/bugfix/MQTTimport
[MQTT import] Fix crash at boot when plugin is enabled
2018-09-22 19:13:25 +02:00
TD-er 8e11c19af6 [MQTT import] Fix crash at boot when plugin is enabled
See #1722
Inspired by [this comment](https://github.com/letscontrolit/ESPEasy/issues/1722#issuecomment-422191721) of @kainhofer
2018-09-22 16:39:16 +02:00
Benno Eigenmann f33ca6df78 Fix platformio 2018-09-22 15:57:09 +02:00
ESPEasy release bot 194a230d20 automatically updated release notes for mega-20180922 2018-09-22 04:00:22 +02:00
Gijs NoorlanderandGitHub 7a5a432016 Merge pull request #1773 from TD-er/reapply_reverts
Reapply reverts
2018-09-22 02:04:30 +02:00
TD-er 07511fe144 Revert "Revert "Fix elseif & Add if-elseif-else nesting levels""
This reverts commit a4fe8d42d2.
2018-09-21 22:15:13 +02:00
Gijs Noorlander 9a390136f9 Revert "Revert "Added 2 new operators in Calculate() function""
This reverts commit fa42cadfa1.
2018-09-21 22:14:30 +02:00
Gijs NoorlanderandGitHub 27a03f166a Merge pull request #1770 from TD-er/bugfix/revert_disable_command_scheduler_0915
Revert "[Scheduler] Disable command scheduler"
2018-09-21 22:10:50 +02:00
TD-er 0a63aeb8f0 Revert "[Scheduler] Disable command scheduler"
This reverts commit 38af765935.
2018-09-20 23:20:19 +02:00
sakinit 22c10ac615 ESP32 platform updated to 1.2.0; Webserver replaced by platform one 2018-09-16 16:44:25 +02:00
ESPEasy release bot ac83cfa249 automatically updated release notes for mega-20180916 2018-09-16 04:00:11 +02:00
Gijs NoorlanderandGitHub 6ef0c08bc4 Merge pull request #1754 from TD-er/bugfix/backgroundtasks_rules
[HW Watchdog] Backgroundtasks instead of yield during rules handling
2018-09-16 01:19:47 +02:00
TD-er 1ee965067d [HW Watchdog] Backgroundtasks instead of yield during rules handling 2018-09-16 01:19:14 +02:00
Gijs NoorlanderandGitHub e46a873fce Merge pull request #1753 from letscontrolit/revert-1641-mega
Revert "Fix elseif & Add if-elseif-else nesting levels"
2018-09-16 01:15:04 +02:00
Gijs NoorlanderandGitHub 784e956c96 Merge pull request #1752 from letscontrolit/revert-1742-new/not
Revert "Added 2 new operators in Calculate() function"
2018-09-16 01:14:32 +02:00
Gijs NoorlanderandGitHub b6eebb330a Added warning to release notes 20180915 2018-09-16 01:13:49 +02:00
Gijs NoorlanderandGitHub a4fe8d42d2 Revert "Fix elseif & Add if-elseif-else nesting levels" 2018-09-16 01:08:42 +02:00
Gijs NoorlanderandGitHub fa42cadfa1 Revert "Added 2 new operators in Calculate() function" 2018-09-16 01:04:37 +02:00
sakinit 17dc6fa859 Reverted Webserver change 2018-09-15 16:22:58 +02:00
sakinit 1432726dec ESP32: Split webserver spiffs filelist into pages 2018-09-15 12:14:33 +02:00
sakinit 7ba6ffa407 Fix ESP32 stack overflow in addPinSelect when called from P1WifiGateway
In addFormPinSelect move local variables from the stack to the heap
because when it is called from the P1WifiGateway there is not enough
stack space resulting in a stack overflow.
2018-09-15 12:14:27 +02:00
sakinit ab555e4d6b ESP32 build issues fixed
- Compiler issue of comment within comment
 - ESP32Webserver renamed to Webserver in ESP32 Arduino library
2018-09-15 12:14:22 +02:00
ESPEasy release bot d4259f4e23 automatically updated release notes for mega-20180915 2018-09-15 04:00:15 +02:00
Gijs NoorlanderandGitHub aef45c06f6 Merge pull request #1747 from TD-er/bugfix/sunrise
[#1698] Incorrect sunrise value southern hemisphere
2018-09-15 00:19:42 +02:00
Gijs NoorlanderandGitHub 828f9e6a30 Merge pull request #1746 from TD-er/feature/hostname_settings
Validate settings + hostname format option
2018-09-15 00:14:30 +02:00
TD-er e79d778cf4 [#1698] Incorrect sunrise value southern hemisphere
See #1698
2018-09-15 00:10:45 +02:00
TD-er 965eb2d994 [#1713] Make hostname-unitnumber optional & validate settings
See #1713
Also added validation check for some values in the settings at load/save of settings.
This could be extended later on for task settings.
2018-09-14 23:44:58 +02:00
Gijs NoorlanderandGitHub 657fccf49f Merge pull request #1641 from svmac/mega
Fix elseif & Add if-elseif-else nesting levels
2018-09-14 23:27:00 +02:00
Gijs NoorlanderandGitHub 228b41a1ac Merge pull request #1742 from giig1967g/new/not
Added 2 new operators in Calculate() function
2018-09-14 23:26:25 +02:00
Gijs NoorlanderandGitHub 3bba294eb7 Merge pull request #1745 from TD-er/bugfix/commands_not_using_scheduler
[Scheduler] Disable command scheduler
2018-09-14 23:22:21 +02:00
TD-er 0254181b3e [Controller settings] Validate settings on load/save
Make sure new values are set to proper defaults and within valid range.
2018-09-14 22:54:23 +02:00
Gijs NoorlanderandGitHub 3b67282abb Merge branch 'mega' into mega 2018-09-14 21:26:21 +02:00
TD-er 38af765935 [Scheduler] Disable command scheduler
For now the commands will no longer use the scheduler.
Commands running asynchronous is causing too much issues.
2018-09-14 21:23:09 +02:00
Plebs ff180b085c Added 2 new operators in Calculate
hi,
added 2 new operators for calculations:

!: Logical NOT:
returns 1 if operand is = 0
returns 0 if operand is != 0

%: MOD:
converts operands in integers and calculates the remainder of the division
2018-09-14 16:44:11 +02:00
ESPEasy release bot e0785eb796 automatically updated release notes for mega-20180914 2018-09-14 04:00:17 +02:00
Gijs NoorlanderandGitHub 75a83787a4 Merge pull request #1740 from TD-er/bugfix/disable_failing_plugin
[CrashRecover] Disable failing step based on failed boot count
2018-09-14 00:18:48 +02:00
Gijs NoorlanderandGitHub 65bea6343c Merge pull request #1734 from giig1967g/new/eventvalue
adding more parameters to EVENT
2018-09-14 00:15:41 +02:00
Gijs NoorlanderandGitHub 6fe61411a0 Added PayPal link 2018-09-14 00:10:48 +02:00
Gijs NoorlanderandGitHub 4552e91022 Merge pull request #1731 from giig1967g/new/calculate
Use parameters inside rules when calling commands
2018-09-14 00:06:13 +02:00
Gijs NoorlanderandGitHub cc94d70e6c Merge pull request #1730 from sakinit/feature-webserver-spiffs-filelist-multiple-pages
Feature: Split webserver spiffs filelist into pages
2018-09-13 23:50:11 +02:00
Gijs NoorlanderandGitHub 2435078f76 Merge pull request #1732 from TD-er/feature/flash_tools
[Flash tools] Add blank files and README.txt to dist folder
2018-09-13 23:49:43 +02:00
Gijs NoorlanderandGitHub dd2cd50d4b Merge pull request #1738 from giddyhup/mega
Fix IR plugin passing received code
2018-09-13 23:48:46 +02:00
TD-er fe38eb629d [CrashRecover] Disable failing step based on failed boot count
When the node gets locked in a boot loop, the only recovery is to erase it and start all over.
This fix will count the number of failed boots and above a certain threshold it will start disabling plugin, then controller and then notification.

Only one will be disabled at once, so the user can see which one is giving issues.
The disabled state will not be saved, so make sure to save the failing part when it is accessible again.
2018-09-13 23:44:24 +02:00
Plebs e961507456 added %eventvalue4% 2018-09-13 19:14:13 +02:00
Plebs e5ee5644bf final version with '=' sign as a prefix to identify the formula in rules 2018-09-12 22:48:44 +02:00
Gijs NoorlanderandGitHub ac6d85e214 Merge branch 'mega' into mega 2018-09-12 21:54:50 +02:00
Markus Gloede 39c2d54aee Fix IR plugin passing received code 2018-09-12 21:09:05 +02:00
Plebs 68efd5ff9e adding more parameters to EVENT
Hi,
adding the possibility to have 3 parameters when calling an event:
event,eventname=p1,p2,p3

The variable name are:
param 1: %eventvalue% or %eventvalue1%
param 2: %eventvalue2%
param 3: %eventvalue3%
2018-09-11 17:38:47 +02:00
Plebs 627f516f85 fixed calls to F-macro 2018-09-11 16:03:35 +02:00
Plebs a45fadf42e fixed ESP32 compatibility issue 2018-09-11 14:38:14 +02:00
Plebs 2ae52b849c few changes
optimized the call to CALCULATE only when needed and description of error codes.
2018-09-11 13:10:00 +02:00
Plebs 639685ea0d fixed float to int conversion 2018-09-11 10:16:44 +02:00
Plebs 867209de6d Add three new TOGGLE commands
Added three new commands to toggle the pins from 0 to 1 or viceversa and to toggle the task value:

Command: taskvaluetoggle
P001: gpiotoggle
P019:pcfgpiotoggle
2018-09-11 00:38:55 +02:00
TD-er 1d8b6d346b [Flash tools] Add blank files and README.txt 2018-09-10 23:02:38 +02:00
Plebs 2a5ac327d3 Use parameters inside rules when calling commands
Hi,
here is a PR for using parameters when calling commands from inside the rules.

The scope is to be able to use formulas instead of an integer when calling a command inside the rules.

Example:
taskvalueset,1,%eventvalue%+65,[Relay1#r1]+1

Usage could be:

Assuming you have a PCF8574 with ports from 65 to 72.

You can write a rule:

on turnOnRelay do
  pcfgpio,%eventvalue%+64,0
endon

And to turn on port65, the rule can be called like this:

event,turnOn=1
2018-09-10 22:59:50 +02:00
sakinit 886101d4d4 Feature: Split webserver spiffs filelist into pages 2018-09-10 17:37:05 +02:00
ESPEasy release bot 8fc6486855 automatically updated release notes for mega-20180910 2018-09-10 04:00:23 +02:00
Gijs NoorlanderandGitHub eeb1cc71b3 Merge pull request #1728 from TD-er/bugfix/command_send_http
Bugfix/command SendToHTTP  & Domoticz IDX > 9999
2018-09-10 01:02:58 +02:00
TD-er 13837830e8 [Domoticz IDX] Allow for IDX of > 9999 2018-09-09 23:00:16 +02:00
Gijs NoorlanderandGitHub f86ff46a82 Merge pull request #1727 from sakinit/P1WifiGatewayModuleBufSize
Reduced buffer size to prevent stack overflow
2018-09-09 22:53:23 +02:00
TD-er e901bc957a [HTTP] Command SendToHttp cannot connect
Incorrect check for return value.
As suggested via the [forum](https://www.letscontrolit.com/forum/viewtopic.php?f=6&t=5794&p=31203#p31181)
2018-09-09 21:58:14 +02:00
sakinit e7e10c5305 Reduced buffer size to prevent stack overflow 2018-09-09 19:54:23 +02:00
ESPEasy release bot 466ddfbe88 automatically updated release notes for mega-20180909 2018-09-09 04:00:14 +02:00
Gijs NoorlanderandGitHub c8f02d2a4c Merge pull request #1721 from TD-er/bugfix/wifi_connection_slow_server
[#1720] WiFi read all lines from slow servers
2018-09-08 23:14:33 +02:00
TD-er af1d9b38c9 [Serial log] Use buffer to prevent Serial buffer to overflow
Write the log lines to a std::deque and write that buffer to the serial port without overflow of the Serial buffer.
This flushing is done during background task.
2018-09-08 20:48:29 +02:00
Gijs NoorlanderandGitHub 7294217489 Revert [WDT] Add watchdog feed to backgroundtasks()
See comment: https://github.com/letscontrolit/ESPEasy/issues/1722#issuecomment-419659193
2018-09-08 20:31:16 +02:00
TD-er 208fa8a3aa [ESP32] Fix Build, ESP32 doesn't have the availableForWrite 2018-09-08 18:24:48 +02:00
TD-er b3b8eff127 [Serial Log] Limit serial log to prevent buffer overflow
As suggested here: https://github.com/letscontrolit/ESPEasy/issues/1625#issuecomment-411558353 by @thomastech
2018-09-08 16:19:58 +02:00
TD-er c6a90ab2d0 Add forward declaration for void backgroundtasks() 2018-09-08 16:00:06 +02:00
TD-er e7d28e8576 [#1720] WiFi read all lines from slow servers
See #1720
2018-09-08 15:20:39 +02:00
ESPEasy release bot efa27dc01d automatically updated release notes for mega-20180908 2018-09-08 04:00:20 +02:00
Gijs NoorlanderandGitHub 7c7b81911d Merge pull request #1669 from TD-er/bugfix/buffer_send_controller
Use queue to manage controllers and add timing settings per controller
2018-09-07 23:31:55 +02:00
Gijs NoorlanderandGitHub c2962d7337 Update README.md 2018-09-07 23:30:33 +02:00
TD-er e2e2059ff0 [Queue] Add memory check to determine full queue
Depending on the type of controller, the queued messages can be quite big.
This means the queue limit set can cause the memory to fill up.
This commit adds another check. If the free memory is less than 5000 bytes, it will consider the queue being full.
It will then also log the actual memory usage of the queue.
2018-09-07 22:32:17 +02:00
TD-er 4e95bbef7f [Scheduler] Do not schedule task device timer for tasks without interval
See #1709
2018-09-06 22:21:39 +02:00
TD-er b0a90b5b14 [#1714] Parse notification sender to allow some sender formatting
`bla@bla.com` will be set as `nodename <bla@bla.com>` in the mail header as from part.
`John Doe <bla@bla.com>` will now be used like that in the mail header.  

N.B. `<` is actually the separator, so as long as that character is being used to separate the name and mail address, it will work. (see #1714 )
2018-09-05 23:20:49 +02:00
TD-er c8ac1bbd59 [#1707] Getting logs from the /log even when password is not entered
See #1707
2018-09-05 22:49:38 +02:00
TD-er e6105bfe71 [WDT] Add yield() and runbackgroundtasks() when parsing rules
Rules parsing may take some time, so perform some yields to prevent watchdog triggers.
2018-09-04 22:48:07 +02:00
ESPEasy release bot 1bb8669ed2 automatically updated release notes for mega-20180904 2018-09-04 04:00:34 +02:00
Gijs NoorlanderandGitHub 34f4a9a8e0 Merge pull request #1704 from TD-er/bugfix/duplicate_names_check
[#1702] Check for duplicate names bug
2018-09-04 00:22:30 +02:00
TD-er a517f3471c [#1702] Check for duplicate names bug
Make sure only enabled devices are used for checking. (see #1702)
Do a full erase of the task settings when deleting a plugin. Just to make sure no obsolete settings may corrupt behaviour of new settings.
2018-09-03 21:25:07 +02:00
ESPEasy release bot 9c706b7b0e automatically updated release notes for mega-20180903 2018-09-03 04:01:13 +02:00
TD-er f2b4e17e2a [MQTT] Force MQTT client reconnect when wifi reconnects
It looks like the check for `client->connected()` may return false positives.
This means the MQTT client may assume the connection is still active, while it isn't.
2018-09-02 23:01:36 +02:00
TD-er 6f62ba0f9b [Watchdog] Add watchdog feed to backgroundtasks() function
A lot of reports recently about resets by the Hardware Watchdog.
So maybe this timer is not reset as often as before.
2018-09-02 23:01:36 +02:00
TD-er 36c6fd4bf7 [SPIFFS] Add SPIFFS size + usage to sysinfo page 2018-09-02 23:01:36 +02:00
TD-er 4446d76c83 [MQTT] Give MQTT state in log when connect state changes. 2018-09-02 23:01:36 +02:00
TD-er f354b05b07 [Nodes] Fix String copy to properly read node names 2018-09-02 23:01:36 +02:00
TD-er 467df9dde2 [Cleanup] Memory optimisation in available controllers and plugins
These structs to keep track of available plugins and controllers were fixed in size and also the member variables were not ordered in the most optimum way.
Also the name of the nodes always used 26 Bytes and would impose a memory leak when deleted.
2018-09-02 23:01:36 +02:00
TD-er dac243cc82 [Nodes] Highlight current node in the list of nodes 2018-09-02 23:01:36 +02:00
TD-er 3d1be96f8a [Nodes] Make Nodes list a map with dynamic size
Nodes list is now a std::map, which may contain up-to 254 nodes (1...254), since 255 is reserved for broadcast and 0 for "all known".
2018-09-02 23:01:36 +02:00
TD-er 0dd53e38d7 [C013] Remove some obsolete function
`C013_Send` did actually only call another function and some other bogus object loading without using the data.
2018-09-02 23:01:36 +02:00
TD-er df6338dfee [C012] Controller C012 now also uses Delay Queue 2018-09-02 23:01:36 +02:00
TD-er 1bab99de40 [Controller] Moved the 'magic' default and max values to defines
The Max and Default values for the Controller Delay Queue are now set in the `ESPEasy-Globals.h` file.
2018-09-02 23:01:36 +02:00
TD-er ec44efb59f [C011] Controller C011 now also uses Delay Queue
And some code cleanup of shared code in C001 and C003.
Also fixed an issue in C011, where the result was not returned when sending a value.
2018-09-02 23:01:36 +02:00
TD-er 202a6fd1f7 [Cleanup] Merge code duplication between C008 and C010
Both use the same Queue Element class.
2018-09-02 23:01:36 +02:00
TD-er dc7828d343 [C010] Controller C010 now also uses Delay Queue 2018-09-02 23:01:36 +02:00
TD-er 5c92731b41 [HTTP] Add user agent in request header
Should make this optional later
2018-09-02 23:01:36 +02:00
TD-er 8c34067d9c [HTTP Auth] Now using proper index for retrieving credentials
I was using the controller number and not the controller index to get the user credentials.
Should now work for FHEM.
2018-09-02 23:01:36 +02:00
TD-er 92025249fc [C009] Remove 'no port' option in HTTP packet
As tested by @clumsy-stefan, it didn't make a difference.
2018-09-02 23:01:36 +02:00
TD-er dd5b5bb7c3 [Client Connect] Check for success on connecting with client.
In case of domain name resolution error result can be negative.
See [Dns.cpp](https://github.com/esp8266/Arduino/blob/18f643c7e2d6a0da9d26ff2b14c94e6536ab78c1/libraries/Ethernet/src/Dns.cpp#L44)

Thus must match the result with 1.
2018-09-02 23:01:36 +02:00
TD-er 03bc2f34f6 [C009] Controller C009 now also uses Delay Queue
Also fixed an issue where sending some value to a controller would fail when the buffer is full and the settings set to "Delete Oldest".
2018-09-02 23:01:36 +02:00
TD-er a19b59e184 [C009] Removed port number from HTTP host header
As suggested here: https://github.com/letscontrolit/ESPEasy/pull/1669#issuecomment-414434578
This plugin is not using the Queue yet, but only had some duplicate code moved to a helper class.
I now removed the port number from the HTTP header, since I am not really sure if the standard demands it or only for the connect part.
Also changed the HTTP command to use the code that has the port in the header, just to check if that will break now compared to older builds.
2018-09-02 23:01:36 +02:00
TD-er 861bc64ce3 [#1666] Moved code duplication for HTTP requests to special functions
The controller source files are now much cleaner and all use the same code.
So it is easier to fix issues and add features and checks.
2018-09-02 23:01:36 +02:00
TD-er 7428b03e18 [C008] Let C008 use queue and some bugfixes
Also added statistics
And some optimizations
2018-09-02 23:01:36 +02:00
TD-er 54a6ecac7d [Webserver] Add fields for new Controller settings
Make sure all new settings are configurable for all controllers.
2018-09-02 23:01:36 +02:00
TD-er ec4aa627bb [MQTT] Use set controller settings on MQTT controllers 2018-09-02 23:01:36 +02:00
TD-er 0dc47bc04c [C007] Let C007 controller use queue 2018-09-02 23:01:36 +02:00
TD-er 5f029c59d2 Added USES_Cxxx checks
functions may not be mentioned in the scheduler when the controller is not included in the build.
2018-09-02 23:01:36 +02:00
TD-er 8beeeaf7fa [C004] Let C004 controller use queue and simplify using macros
Added some simplifications to the code by creating one big macro in `_CPlugin_Helper.h` that does all the work and defines.
This will reduce the chance of typo errors a lot.
2018-09-02 23:01:36 +02:00
TD-er 293b63e654 [C003] Let C003 controller use queue 2018-09-02 23:01:36 +02:00
TD-er 734150e87b [C001] Let C001 controller use queue 2018-09-02 23:01:36 +02:00
TD-er 6bb1b4086c [Controller] Make ControllerDelayHandler templated and comment
Added recognisable comments throughout the `ESPEasy-Globals.h` file and made ControllerDelayHandler templated to be used for other controllers to use.
2018-09-02 23:01:36 +02:00
TD-er 9cd2d2d843 [MQTT] Add controller delay queue for MQTT
MQTT messages are queued and processed at set pace to not overload the broker.

N.B. other controllers still need a similar queue to process. Current interval for those is now probably too low.

Also initial queue parameters must still be corrected when set to 0.
2018-09-02 23:01:36 +02:00
TD-er 02c022d7d5 [controller delay] Let controllers handle their own delay and buffer 2018-09-02 23:01:36 +02:00
Gijs NoorlanderandGitHub b1c8346700 Merge pull request #1700 from TD-er/feature/Shelly_support
[Shelly1] Add first test build for Shelly1 nodes
2018-09-02 22:58:30 +02:00
TD-er 272ed8c578 [Shelly1] Add first test build for Shelly1 nodes
[Shelly1 Open Source (ESP8266-2MB)](https://shelly.cloud/shelly1-open-source/)
This is a preliminary test version as I have not yet received my ordered modules.
Also there is a [feature request](https://github.com/esp8266/Arduino/issues/5096#issuecomment-417942708) out for adding proper flash layout for these 2M flash modules which allow proper OTA.
2018-09-02 22:31:05 +02:00
Gijs NoorlanderandGitHub a9e473dbc6 Merge pull request #1697 from TD-er/feature/1688_dewpoint
[#1688] Add dew point computation as standard conversion
2018-09-02 20:31:37 +02:00
TD-er 4baccf5863 [#1688] Add dew point computation as standard conversion
Dew point(T,H): `%c_dew_th%(18.6,67)` will be replaced with `12.31`
See #1688
2018-09-02 20:30:42 +02:00
Gijs NoorlanderandGitHub ad84eb8b8a Merge pull request #1696 from TD-er/feature/leading_zero_sysvars
[sysvar] rename vars with leading zero to %..._0%
2018-09-02 18:35:07 +02:00
TD-er 23f2bfc6d8 [sysvar] rename vars with leading zero to %..._0%
For example `%syshour%` to `%syshour_0%` 
Both variables are now supported.
The ones without leading zero can be used in rules. 
The ones with leading zero will probably be used on displays.
2018-09-02 18:34:33 +02:00
Gijs NoorlanderandGitHub 34d2f25652 Merge pull request #1695 from TD-er/feature/sysparam_webpage
[#1549] Add page showing all system variables
2018-09-02 15:59:50 +02:00
Gijs NoorlanderandGitHub 294683ece1 Merge pull request #1694 from TD-er/bugfix/notification_mail
[#1692] Add 2nd Receiver for Email notification
2018-09-02 15:59:35 +02:00
Gijs NoorlanderandGitHub 56bd1cb19c Merge pull request #1686 from TD-er/bugfix/build_issues
[Pio] Build issue P016_IR and add PIO flags
2018-09-02 15:59:15 +02:00
TD-er 812f530c4b [#1549] Add page showing all system variables
Via Tools => System Variables.
2018-09-02 13:47:18 +02:00
TD-er 97258a531d Forgot to save before commit
Forgot to increase to next address.
2018-09-02 00:08:06 +02:00
TD-er 7d2ef727a7 [#1692] Add 2nd Receiver for Email notification
Implementation suggested by @dwarf2k See: https://github.com/letscontrolit/ESPEasy/issues/1692#issuecomment-417887364
2018-09-02 00:02:50 +02:00
TD-er 9e83213a13 [Pio] Build issues
Redefine of `TIMEOUT` in P016_IR.
Add option to set CPU frequency and flags undef per build
2018-08-28 00:10:27 +02:00
ESPEasy release bot ecb5ca9306 automatically updated release notes for mega-20180826 2018-08-26 04:00:20 +02:00
Gijs NoorlanderandGitHub edb6178ae2 Merge pull request #1682 from TD-er/bugfix/P080
[Build Travis] "Scratchpad was set but never used"
2018-08-26 00:32:18 +02:00
TD-er b8894efc57 [Build Travis] "Scratchpad was set but never used"
Build error with Travis.
2018-08-26 00:31:49 +02:00
Gijs NoorlanderandGitHub 970181d8c7 Merge pull request #1681 from TD-er/bugfix/P078_P080
Bugfix/p078 p080
2018-08-26 00:12:53 +02:00
TD-er 9d2fad783f [Build] Add "[TESTING]" labels to P078 and P080 2018-08-26 00:12:13 +02:00
jimmys01andGitHub 9d42e83314 Merge pull request #1 from letscontrolit/mega
test
2018-08-26 01:01:41 +03:00
Gijs NoorlanderandGitHub 0005915c5c Upgrade IR lib and move IR code to separate build
IR TX and RX enhancements and split to a special build, due to the resources needed for the IR library and code.
2018-08-25 23:29:17 +02:00
Gijs NoorlanderandGitHub eb78bc3e03 Merge pull request #1468 from henfri/patch-1
Create _P080_DallasIButton.ino
2018-08-25 23:27:11 +02:00
Gijs NoorlanderandGitHub 17777698cd Merge pull request #1679 from TD-er/feature/Eastron
[#205] Initial port of Playground P150 to Mega (Eastron)
2018-08-25 23:23:09 +02:00
Gijs NoorlanderandGitHub d091148dfc Merge branch 'mega' into feature/Eastron 2018-08-25 23:22:42 +02:00
Gijs NoorlanderandGitHub fcb25a2aec Merge pull request #1492 from TungstenE2/mega
added new Plugin for Wemos Motorshield P_079
2018-08-25 23:21:18 +02:00
TD-er a7d90a33a0 [Dallas iButton] Change VType to SENSOR_TYPE_LONG 2018-08-25 23:18:00 +02:00
TD-er 3a68ff8f9d [P080] Dallas iButton Rename P078 to P80 2018-08-25 22:51:43 +02:00
henfriandTD-er 3b45e200a7 Update _P078_DallasIButton.ino
empty lines removed
2018-08-25 22:51:43 +02:00
henfriandTD-er b724c22c80 Create _P078_DallasIButton.ino
Plugin for reading the Dallas iButton
2018-08-25 22:51:43 +02:00
TD-er b810e34b74 [MotorShield] Added comments in the code and fixes
Frequency was not using the upper 4 bits of the values.
Changed delay to yield.
2018-08-25 22:39:36 +02:00
TD-er c70ffd735c [MotorShield] Cleanup code layout
Indentation was hard to read, so ran code beautify.
2018-08-25 21:03:02 +02:00
TD-er 604c58a290 [MotorShield] Rename P078 to P079 2018-08-25 21:03:02 +02:00
TungstenE2andTD-er 1d1b69b1ce Added Wemos Motorshield Plugin (No. 78) 2018-08-25 21:03:02 +02:00
TungstenE2andTD-er bd2cc4138b Added Wemos Motorshield Plugin (No. 78) 2018-08-25 21:03:02 +02:00
Gijs NoorlanderandGitHub ca5f2815bc Merge pull request #1631 from GHolli/mega
Optimisations
2018-08-25 12:31:58 +02:00
Gijs NoorlanderandGitHub f67bf51606 Merge pull request #1672 from TD-er/bugfix/network_mqtt_issues
[MQTT] Check connection and specific check for success when connect.
2018-08-25 12:31:20 +02:00
Gijs NoorlanderandGitHub e1f0badd92 Merge pull request #1678 from Feuerreiter/mega
Add overview of known espeasy nodes to json
2018-08-25 12:30:57 +02:00
jimmys01 b9ea66037c Small correction 2018-08-25 13:15:41 +03:00
TD-er 62a196d398 [JSON] Only show node information when generic info is requested
This extra node information is not needed when values of a specific task is requested, so only output when other generic information is shown.
2018-08-25 12:09:00 +02:00
jimmys01 d4ee74297b IR RX updated
The IRrecvDumpV2.ino functionality added to the RX module.
Let me know for a good way to display the RAW values.
2018-08-25 12:53:42 +03:00
TD-er d0d95e221b [JSON] Fix issue when UDP port not set
With no nodes to display, the generated JSON was not valid.
Also removed some duplicate F() macro strings.
2018-08-25 11:49:54 +02:00
TD-er 7ad8880651 [IR/IRTX] For PullReq #1645 split IR/IRTX to a separate build
The new library takes a lot of resources.
2018-08-25 01:01:48 +02:00
TD-er f46a6c3414 [Eastron] Add missing SDM_Config_User.h 2018-08-24 23:48:20 +02:00
TD-er ab0ed4b5ca [Eastron] Make P078 Eastron compile, serial settings do not yet work
At this moment it is just using the same static configuration as P150 from the playground.
It is not yet using the settings. This will have to be changed later on.
2018-08-24 23:16:33 +02:00
TD-er b1fb308646 [SDM] Update library to latest version
Latest version requires a Software Serial object for the constructor.
2018-08-24 22:55:13 +02:00
feuerreiter 79ee397e8e Adds a overview of known espeasy nodes to the json response. I think this can be useful for own webinterfaces etc. 2018-08-24 17:20:17 +02:00
TD-er 56569374f3 [Eastron] Add P078 plugin from the Playground (was P150)
Still problems using the Software Serial
2018-08-24 01:29:55 +02:00
TD-er 41b13f6797 [Client Connect] Check for success on connecting with client.
In case of domain name resolution error result can be negative.
See [Dns.cpp](https://github.com/esp8266/Arduino/blob/18f643c7e2d6a0da9d26ff2b14c94e6536ab78c1/libraries/Ethernet/src/Dns.cpp#L44)

Thus must match the result with 1.
2018-08-22 21:58:34 +02:00
TD-er 8f23048f18 [MQTT] PubSubClient Add checks for connectivity
Taken from master branch of PubSubClient
2018-08-22 21:56:05 +02:00
ESPEasy release bot a123dbf37f automatically updated release notes for mega-20180822 2018-08-22 04:00:15 +02:00
Gijs NoorlanderandGitHub 6b65e90ddf Merge pull request #1664 from TD-er/bugfix/UDP_checks
[UDP] Use random outgoing port for NTP and check return values
2018-08-21 23:46:12 +02:00
Gijs NoorlanderandGitHub 890db55197 Changed INPUT_COMMAND_SIZE from 80 to 240
The default of 80 was too short for commands using an url like `sendtohttp`
Changed it to 240 to allow for some longer commands.
2018-08-21 23:44:58 +02:00
TD-er 514800433f [UDP] Use random outgoing port for NTP and check return values
As a NTP client, you don't need to send requests from port 123. Some internet providers even block ports below 1024. So try to use a random port for outgoing requests.

Also added some checks and increased buffer on the receiving end of UDP packets.
When using C013, the size of infoStruct is copied from that buffer and the size is about 137 bytes, which may lead to Exception crashes.
2018-08-19 00:51:21 +02:00
ESPEasy release bot deb18d2391 automatically updated release notes for mega-20180818 2018-08-18 04:00:17 +02:00
Edwin Eefting e18d069171 fixed network config for newer versions 2018-08-17 17:14:03 +02:00
Gijs NoorlanderandGitHub b63c375793 Merge pull request #1657 from TD-er/bugfix/web_menu_ios11
[#1650] Use icons in tabs on web page on small screens
2018-08-17 00:09:47 +02:00
TD-er f906e9173c [#1650] Use icons in tabs on web page on small screens
See #1650
2018-08-17 00:08:08 +02:00
jimmys01 c444022f5f Travis please be happy :-) 2018-08-16 11:35:36 +03:00
svmac 5511ee9f38 fix mistake 2018-08-15 05:22:27 +02:00
svmac 427a22d23b some code optimization 2018-08-15 04:54:29 +02:00
ESPEasy release bot 306cbf3107 automatically updated release notes for mega-20180815 2018-08-15 04:00:13 +02:00
Gijs NoorlanderandGitHub 458f672744 Merge pull request #1649 from TD-er/bugfix/1487_tone_PIO_update_180
[core 2.4.2] Update to PlatformIO espressif8266@1.8.0
2018-08-15 00:55:44 +02:00
Gijs NoorlanderandGitHub dee1ee6f32 Merge pull request #1648 from krikk/patch-1
Update _P047_i2c-soil-moisture-sensor.ino - Address change on new sensor firmware
2018-08-15 00:54:13 +02:00
TD-er 8930e331d3 [core 2.4.2] Update to PlatformIO espressif8266@1.8.0
Latest version would not build due to conflicting function definition for tone. See #1487
2018-08-15 00:42:41 +02:00
krikkandGitHub 6033990767 Update _P047_i2c-soil-moisture-sensor.ino
Add a duplicate call for changing the address. This is required by the new sensor firmware version 2.6. This is to avoid a stry address change command that happens during hotplugging of the sensor

also see here: https://github.com/Apollon77/I2CSoilMoistureSensor/pull/17
2018-08-15 00:30:57 +02:00
svmac d271898968 reenabled code about ! 2018-08-14 03:52:29 +02:00
jimmys01 f261e6a5ea commented out more unused code 2018-08-13 17:10:57 +03:00
jimmys01 ff160f386e Travis build complaining about unused vars 2018-08-13 13:02:21 +03:00
jimmys01 ef92e7ae4f IR library added 2018-08-13 12:18:01 +03:00
svmac 4051f0bd2e Fix elseif & Add if-elseif-else nesting levels
- The implementation of elseif is not correct. See this example:

Rule:
On SYSVAL do
if %syssec% < 10
publish %sysname%/IP,%ip%
elseif %syssec% < 20
publish %sysname%/Uptime/min,%uptime%
elseif %syssec% < 30
publish %sysname%/Systime/time,%systime%
elseif %syssec% < 40
publish %sysname%/RSSI/dB,%rssi%
elseif %syssec% < 50
publish %sysname%/Sunrise/time,%sunrise%
else
publish %sysname%/Sunset/time,%sunset-30m%
endif
endon

Result:
109360661 : EVENT: SYSVAL
109360668 : [if 11 < 10]=false
109360675 : [elseif 11 < 20]=true //THIS IS CORRECT
109360677 : ACT : publish Wemos51/Uptime/min,1823
109360686 : Command: publish
109360692 : [elseif 11 < 30]=false
109360697 : [elseif 11 < 40]=false
109360703 : [elseif 11 < 50]=false
109360705 : ReplacementString SunTime: %sunrise% offset: 0
109360708 : else = true //THIS IS NOT CORRECT
109360710 : ReplacementString SunTime: %sunset-30m% offset: -1800
109360712 : ACT : publish Wemos51/Sunset/time,20:46
109360723 : Command: publish
109360729 : EVENT: SYSVAL Processing time:68 milliSeconds

- Added also nesting levels to if-elseif-else clausules define in RULES_IF_MAX_NESTING_LEVEL declaration. Example:

Rule:
On SYSVAL do
if %eventvalue% > 1
publish %sysname%/Sunrise/time,%sunrise+1h%
else
if %syssec% < 10
publish %sysname%/IP,%ip%
elseif %syssec% < 20
publish %sysname%/Uptime/min,%uptime%
elseif %syssec% < 30
publish %sysname%/Systime/time,%systime%
elseif %syssec% < 40
publish %sysname%/eventvalue,%eventvalue%
elseif %syssec% < 50
publish %sysname%/Sunrise/time,%sunrise%
else
publish %sysname%/Sunset/time,%sunset-30m%
endif
endif
endon

Result:
>event,SYSVAL=-5
4977875 : Command: event
4977876 : EVENT: SYSVAL=-5
4977883 : Lev.1: [if -5 > 1]=false
4977886 : ReplacementString SunTime: %sunrise+1h% offset: 3600
4977889 : Lev.1: [else]=true
4977893 : Lev.2: [if 30 < 10]=false
4977900 : Lev.2: [elseif 30 < 20]=false
4977906 : Lev.2: [elseif 30 < 30]=false
4977913 : Lev.2: [elseif 30 < 40]=true
4977916 : ACT : publish Wemos49/eventvalue,-5
4977932 : ReplacementString SunTime: %sunrise% offset: 0
4977935 : Lev.2: [else]=false
4977938 : ReplacementString SunTime: %sunset-30m% offset: -1800
4977944 : EVENT: SYSVAL=-5 Processing time:67 milliSeconds

- Finally, the substitution of %eventvalue% is done earlier so that it can be used in if sentence too.
2018-08-11 16:51:56 +02:00
ESPEasy release bot 93105200d7 automatically updated release notes for mega-20180809 2018-08-09 04:00:06 +02:00
Gijs NoorlanderandGitHub f48ede5d7e Merge pull request #1637 from TD-er/bugfix/send_deepsleep
[deepsleep] Send values immediately after connections are made
2018-08-09 00:39:41 +02:00
TD-er b73181487c [deepsleep] Send values immediately after connections are made
Known issue:
The value of the first task is not sent via MQTT right after waking up from deep sleep.
2018-08-09 00:27:34 +02:00
Gijs NoorlanderandGitHub caee2892c4 Merge pull request #1636 from TD-er/bugfix/timing_issues
Bugfix: Several timing issues
2018-08-08 23:00:05 +02:00
Gijs NoorlanderandGitHub 432bd32967 Merge pull request #1635 from uzi18/patch9
small fix for #702
2018-08-08 22:24:30 +02:00
Gijs NoorlanderandGitHub 235bc0a598 Merge pull request #1634 from letscontrolit/bugfix/Blynk_command
[Blynk] Command handling was not active
2018-08-08 22:22:15 +02:00
TD-er f0cf26baec [Scheduler] Remove scheduled commands from scheduler to run in idle time
Scheduled commands are blocking when run all after another at highest priority.
This removes the scheduled commands from the scheduler and the scheduler will now process the next queued command when no other scheduled task has to run.
Also made some optimizations to reduce memory usage.
2018-08-08 22:19:49 +02:00
TD-er fffccd3787 [C011] Make sure the loaded extra controller settings end with 0
Controller C011 (Advanced HTTP)  uses all of the available `ExtraControllerSettings`.
Now the last byte of those arrays is set to 0, just to make sure they will not read beyond the range of those arrays when using as a string.
The controller still causes crashes, bit it is a start.
2018-08-08 22:16:21 +02:00
TD-er 5cfbac5eba [#1621] Timing interval of BME280 incorrect
New timing was only allowed after MessageDelay seconds. (default was 1000, which is about 20 minutes)
It should use `TaskDeviceTimer`.

BME280 can now schedule itself to perform a read-update as soon as a measurement has completed.
Then it schedules itself to perform a new measurement at set interval time.
2018-08-08 22:12:43 +02:00
Gijs NoorlanderandGitHub 2bce3f8d02 Merge branch 'mega' into patch9 2018-08-08 22:02:12 +02:00
Bartlomiej Zimon e210722e0e fix for #702, setup propper gpio state before send into PCF8574 for pcfpulse,pcflongpulse 2018-08-08 19:17:58 +00:00
Gijs NoorlanderandGitHub 909d9a4fd1 [Blynk] Change define to allow blynkget command 2018-08-08 19:41:36 +02:00
Gijs NoorlanderandGitHub c8b57cf9e0 [Blynk] Command handling was not active
It was blocked by an old `#define`
2018-08-08 19:39:06 +02:00
ESPEasy release bot d74493ced0 automatically updated release notes for mega-20180808 2018-08-08 04:00:13 +02:00
Gijs NoorlanderandGitHub 7783cf4ce5 Merge pull request #1627 from TD-er/bugfix/MQTT_yield
[#1625] Bugfix/mqtt yield
2018-08-07 20:37:40 +02:00
Gijs NoorlanderandGitHub 27e07d1f67 Merge pull request #1630 from letscontrolit/bugfix/1612_rfid
[#1612] Make P008_RFID using new functions
2018-08-07 20:37:20 +02:00
TD-er 40857cc57c [Schedule] Run command from webpage immediately
When sending command request from the Tools tab in the web interface, the command will be executed immediately.
In other situations it will use the scheduler to run commands async.

Commands will now be buffered and processed in order.
This will also speed-up rules which do a publish.
2018-08-06 23:12:26 +02:00
TD-er 4f764d6101 [Schedule] Scheduled command timer
Run commands async. The result is now not displayed in the web page anymore.
2018-08-06 08:22:08 +02:00
Gerald Hollweger 49e98f2f8b Optimisations
- Save RAM, move constants to flash (CharTableTM1637, CharTableMAX7219)
- Remove unnecessary parameter passing (the interface pins do not change during operation for one instance)
2018-08-05 19:19:04 +02:00
Gijs NoorlanderandGitHub ddad026a2b [#1612] Make P008_RFID using new functions
See #1612
2018-08-05 15:05:20 +02:00
TD-er b8df55ef36 [Commands] Return String output per command
The existing implementation was a bit sparse in returned info.
Now each command can return a useful string to display in the command output window in the webinterface. (or whatever the source of the command is)
2018-08-05 14:46:31 +02:00
TD-er be7724d8c7 [Rules] Split processing matched rule in a separate function
Just to get rules processing readable
2018-08-05 03:10:26 +02:00
TD-er c5c1c92cfb [Rules] Split parsing single line from rulesProcessingFile
The function `rulesProcessingFile` is way too long to understand.
First step in making those functions readable.
2018-08-05 01:45:34 +02:00
ESPEasy release bot e6b219a182 automatically updated release notes for mega-20180804 2018-08-04 04:00:23 +02:00
TD-er d2d03358ef [MQTT] Schedule from callback functions
To make sure execution of these functions is called from the `loop()` and not from a callback function.
2018-08-04 01:37:05 +02:00
TD-er a4d751b40f [Notifications] Schedule NPlugin_ptr calls async
To make sure execution of these functions is called from the `loop()` and not from a callback function.
2018-08-04 01:35:54 +02:00
TD-er 1c73cacc82 [Scheduler] Rename some functions and clean-up 2018-08-04 01:34:02 +02:00
Gijs NoorlanderandGitHub 23bfa54ec4 Merge pull request #1626 from thomastech/mega
Update _P075_Nextion.ino [TESTING]
2018-08-03 23:37:49 +02:00
ThomasandGitHub 95138489cd Update _P075_Nextion.ino 2018-08-03 13:46:34 -07:00
Gijs NoorlanderandGitHub c9ec69d30c Merge pull request #1623 from TD-er/bugfix/set_event_taskindex
[#1574] Set event->TaskIndex
2018-08-03 22:25:19 +02:00
TD-er 0e4cabeb17 [Cleanup] Replace a lot of TR TD with function
Flash strings are not checked for duplication by the compiler, so they make the resulting firmware binary larger.
2018-08-03 00:34:14 +02:00
TD-er 19961198fb [Settings file] Include SettingsStruct in the view
And made the `HumanReadable` format a bit more verbose by stripping trailing ".00" when needed.
2018-08-02 23:27:31 +02:00
TD-er c705c570db [ESP32] Small fix building ESP32 2018-08-02 22:40:25 +02:00
TD-er 34d48adb4a [Settings File] Show settings file layout
Run `meminfodetail` command once (can be done via Tools page) and then open the system info page.
2018-08-02 22:30:30 +02:00
ESPEasy release bot fda973bb78 automatically updated release notes for mega-20180802 2018-08-02 04:00:14 +02:00
TD-er c5bfd67d6d [#1574] Set event->TaskIndex
See discussion: https://github.com/letscontrolit/ESPEasy/issues/1574#issuecomment-409677981
2018-08-02 00:34:17 +02:00
GrovkillenandGitHub 402de69fd5 Added extra info to self compilers 2018-08-01 14:22:27 +02:00
ESPEasy release bot 41341b46de automatically updated release notes for mega-20180801 2018-08-01 04:00:18 +02:00
Gijs NoorlanderandGitHub 3574517014 Merge pull request #1618 from TD-er/bugfix/storage_task_settings
[#1574] Stability improvements on ExtraTaskSettings
2018-07-31 20:31:21 +02:00
Edwin Eefting cca785e1f0 Power down PN532 after reading. Saves power and reduces interference with Wifi. 2018-07-31 16:53:32 +02:00
TD-er 4215e058d0 [#1306] Added %R% and %N% for literals \r and \n 2018-07-30 22:41:25 +02:00
James TuttonandGitHub 60925778c6 Fixed missing ;
Fixed missing ;
2018-07-30 14:19:56 +01:00
James TuttonandGitHub 15233bf100 Added Special Case to allow Servo to be disabled
Servo Motors by default forcefully hold the desired position.  This consumes power.  In some cases for example to turn a value or open a latch once the position is set  there may be no need to hold the new position.  With this update users can pass a special case value above >9000 which is out of normal range 0-180 or 365. when this value is passed the servo is detached and is free to move.
2018-07-30 14:10:22 +01:00
TD-er 2f91fbe931 [#1379] Check for "forbidden" characters in names. 2018-07-29 21:59:27 +02:00
TD-er 90febfd46f [#882] Add checks on names in task setup
When saving a task, a warning or error is displayed (when appropriate) when the settings are saved.
2018-07-29 21:59:18 +02:00
TD-er ccc5b68111 [Storage] Simplify settings I/O error handling
Remove a lot of code duplication
2018-07-29 21:59:13 +02:00
TD-er 07f6b86138 [Storage] Split storage related functions to new file
Only moved the storage related functions from `Misc.ino` to the new `ESPEasyStorage.ino`
2018-07-29 21:59:08 +02:00
TD-er 7b2667feaa [compiler fix] Forgot to declare String 2018-07-29 21:59:02 +02:00
TD-er 48bd7b334d [FileHandling] Write some log indicating file operation
Add some log line indicating what setting is read of written.
2018-07-29 21:58:57 +02:00
TD-er 9dd4242590 [meminfodetail] Add command meminfodetail
This command `meminfodetail` does output the detailed structure of the settings stored.
See for an example:
https://github.com/letscontrolit/ESPEasy/issues/1574#issuecomment-408641424
2018-07-29 21:58:51 +02:00
TD-er ac8c29e9c5 [ExtraTaskSettings] Keep ExtraTaskSettings actualized for plugin calls 2018-07-29 21:58:45 +02:00
TD-er 387b0f68a8 [ExtraTaskSettings] Added extra clear functions and checks
Mainly reading and writing files / settings now perform a lot more checks.
2018-07-29 21:58:38 +02:00
TD-er fa130bf649 [ExtraTaskSettings] Added some comments & clarifications 2018-07-29 21:58:31 +02:00
ESPEasy release bot e596403c0a automatically updated release notes for mega-20180723 2018-07-23 04:00:09 +02:00
Gijs NoorlanderandGitHub 1030bd0b0f Merge pull request #1603 from TD-er/bugfix/commands_with_space
[parseString] Some fixes and checks added + quotes in parameters possible
2018-07-23 01:09:52 +02:00
TD-er 985e463ddf [GetArgv] Add some C-array size checks
There was no check in size of the given C-array to write into.
2018-07-23 01:08:45 +02:00
TD-er 3787fa637a [Compiler warning] Initialize the matching_parenthesis to something
The variable is not used uninitialised, but still the compiler gives a warning which may trip Travis.
2018-07-22 23:47:18 +02:00
TD-er ac62eb40a0 [WebLogViewer] Removed reRunCount as quick fix for web log viewer 2018-07-22 23:41:32 +02:00
TD-er b9e883beba [GetArgv] Make sure only matching ", ' or [ is allowed
Added `'` as allowed "parenthesis" and make sure only the matching character is allowed as end of the string match.
2018-07-22 23:40:49 +02:00
TD-er 6281c002e0 [Travis CI] Signed/unsigned compare fix 2018-07-22 21:36:26 +02:00
TD-er 4e8a3cab2f [parseString] Add checks when command parameters used as int
Several usages of `parseString` were directly converted to int, without proper checking.
2018-07-22 17:23:29 +02:00
TD-er 423b90a661 [parseString] Use quotes to use special characters in command parameters
A command parameter may now allow for spaces or comma when the String is wrapped with either ' ' or " ".
2018-07-22 16:07:23 +02:00
TD-er 63fc99dd34 [parseString] Fix 1-of error in getParamStartPos
We need to find the xth command, so we need to find the position of the (X-1)th separator.

Too bad the rest of the world (other than programmers) do not start counting at 0 :(
2018-07-22 11:34:11 +02:00
ESPEasy release bot 71caf09c70 automatically updated release notes for mega-20180722 2018-07-22 04:00:08 +02:00
Gijs NoorlanderandGitHub ee3164a8f6 Merge pull request #1602 from TD-er/feature/LogLevelCheck
Feature/log level check
2018-07-22 02:58:21 +02:00
TD-er 3d5f612ac9 [Scheduler] Call yield() when idle
This makes the ESP do a lot more background tasks, which makes each yield() call shorter on average.
This makes the ESP feel more snappy.
2018-07-22 02:53:49 +02:00
TD-er 79f2eaf808 [Scheduler] Keep statistics on timeDiff computations
Apparently it is called 1.4 million times in 30 seconds and takes 8.5 CPU cycles on average (about 50'000 calls per second)
So maybe this function can benefit from some optimisation?
2018-07-22 02:39:02 +02:00
TD-er 1806a1438a [LogLevel] Added extra checks and make sure loglevel cache is up to date 2018-07-22 02:34:36 +02:00
TD-er 5108967c35 [LogLevel] Add checks for LOG_LEVEL_DEBUG_DEV 2018-07-22 01:31:14 +02:00
TD-er d0f1014bef [LogLevel] Add checks for LOG_LEVEL_DEBUG_MORE
Do not create Strings when not needed.
Highest level of checks added: LOG_LEVEL_DEBUG_MORE
2018-07-22 00:52:58 +02:00
TD-er 2afc143051 [LogLevel] Check loglevel before sending to log
Using template to do the check to prevent creation of Strings when required log level is higher than anyone is reading.
2018-07-21 23:54:51 +02:00
TD-er b2bf70e4ce [LogLevel] Use function to set loglevel and keep track of max log level 2018-07-21 23:32:37 +02:00
TD-er 6a5f090198 [LogLevel] LoadFromFile log to LOG_LEVEL_DEBUG_DEV 2018-07-21 22:56:08 +02:00
Gijs NoorlanderandGitHub 92c0543743 Merge pull request #1601 from TD-er/bugfix/logviewer_JavaScript
[Log Viewer] Fix a 1-off error when parsing logs
2018-07-21 21:29:30 +02:00
TD-er 1859aaad7d [Log Viewer] Fix a 1-off error when parsing logs 2018-07-21 21:27:23 +02:00
Gijs NoorlanderandGitHub 7e67ce536d Merge pull request #1594 from TD-er/bugfix/longpulse
[#1591] Move system timers to main scheduler
2018-07-21 21:19:32 +02:00
TD-er 2bd573963a [#1596] Remove timerSensor and make it set its own interval.
All enabled plugins have their own timer added to the scheduler.
The `PLUGIN_INIT` function call is used to reschedule when it was added, or enabled.
The set interval for the plugin will be used to set the new entry in the scheduler.
2018-07-21 01:28:14 +02:00
TD-er 447e958e74 [#1592] Remove systemCMDTimers
These timers were not used.
2018-07-20 21:52:49 +02:00
ESPEasy release bot 43908b37cd automatically updated release notes for mega-20180720 2018-07-20 04:00:16 +02:00
TD-er 04b631e4c9 [#1591] Move system timers to main scheduler
And fix longpulse command

With other plugins active, like the OLED Framed, the set period of `longpulse_ms` may fluctuate and durations below 100 msec are quite useless.

However, when running just a few sensors, the set pulse width is quite accurate.

Must still check a few other plugins.
2018-07-20 02:17:00 +02:00
Gijs NoorlanderandGitHub 2e8fc777d2 Merge pull request #1568 from TD-er/bugfix/1556_change_parse_params
[ParseString] Make ParseString more efficient and check results when used
2018-07-19 18:43:49 +02:00
ESPEasy release bot e060c83cf8 automatically updated release notes for mega-20180719 2018-07-19 04:00:14 +02:00
Gijs NoorlanderandGitHub 5480af2d5d Merge pull request #1587 from TD-er/feature/sunrise_sunset_offset
[sunrise/sunset] Allow offset from sunrise/sunset
2018-07-19 01:07:39 +02:00
TD-er ff28605d39 [sunrise/sunset] Allow offset from sunrise/sunset
`%sunrise%` and `%sunset%` were already available.
Now it is also possible to get some time before or after those times.
For example `%sunrise+10m%` or `%sunset-1h%`
The offset must be an integer (including + or -) and can have a postfix of "m" or "h".
Default is "s", for seconds.
2018-07-19 01:06:06 +02:00
Gijs NoorlanderandGitHub fe0ca9b9a3 Merge pull request #1584 from denisfrench/enable_clientid_is_name_without_unit
When clientid = %sysname%, only add %unit% if non-zero (#1155)
2018-07-18 21:17:06 +02:00
Gijs NoorlanderandGitHub 54ef70aee9 Merge pull request #1586 from beigenmann/mega
lib_archive already exists & Implicit dependency not found
2018-07-18 21:16:03 +02:00
Gijs NoorlanderandGitHub e24d077061 Merge pull request #1583 from clumsy-stefan/P077_fix
Fix for P077 crashes
2018-07-18 21:15:44 +02:00
Benno Eigenmann 7ebf29d857 lib_archive already exists & Implicit dependency not found 2018-07-18 14:02:01 +02:00
denisfrench 33c6925376 When clientid = %sysname%, only add %unit% if non-zero 2018-07-17 19:35:17 +10:00
stefan 0b383a1f3b Fix for P077 crashes
some code rearrangements and improvements:
- fix a rare buffer overflow
- only update variables when new (correct) values are received
- little speed-up
- correct code indentations...
2018-07-16 13:39:51 +02:00
stefan 70d1b0807c Merge remote-tracking branch 'origin/mega' into mega 2018-07-16 07:22:31 +02:00
ESPEasy release bot 8e1f4d628b automatically updated release notes for mega-20180716 2018-07-16 04:00:09 +02:00
Gijs NoorlanderandGitHub ef29603f05 Merge pull request #1581 from TD-er/feature/ESP32_partitiontable
[ESP32] Show partition table on sysinfo page
2018-07-16 00:59:50 +02:00
Gijs NoorlanderandGitHub 71b27d95fa Merge pull request #1562 from TD-er/bugfix/wifi_reset_empty_IP
[WiFi] Reset wifi when IP is set to 0.0.0.0
2018-07-16 00:58:31 +02:00
Gijs NoorlanderandGitHub 787c1c6c39 Merge pull request #1579 from TD-er/bugfix/scheduler_rewrite
[Scheduler] Complete rewrite of time based scheduling
2018-07-16 00:58:02 +02:00
Gijs NoorlanderandGitHub 74e4848edc Merge pull request #1578 from TD-er/bugfix/JSON_device_info
[JSON] Fixed broken JSON output on /json URL
2018-07-16 00:57:41 +02:00
TD-er 9a7690473a [ESP32] Show partition table on sysinfo page
Graphical display of partition table.
2018-07-16 00:49:30 +02:00
TD-er c401edde6b [ParseString] Fix getting the right part of the command line
Fix several 1-off errors.
Should drink more coffee ;)
2018-07-15 21:34:29 +02:00
TD-er 3fc1ba27e5 [JSON] Fixed broken JSON output on /json URL
This bug also broke the auto update of the sensor values on the device tab.
2018-07-15 20:23:11 +02:00
TD-er b2212d2edb [Scheduler] Complete rewrite of time based scheduling
All scheduled operations are now handled by a time scheduler.
Also the CPU load is now based entirely on the idle time found by this scheduler.
2018-07-15 20:21:37 +02:00
stefan 76f7dc82fc Merge branch 'bugfix/wifi_reset_empty_IP' into mega 2018-07-15 11:07:47 +02:00
ESPEasy release bot 86233b65bc automatically updated release notes for mega-20180714 2018-07-14 04:00:13 +02:00
Gijs NoorlanderandGitHub 984cfe23a0 Merge pull request #1569 from letscontrolit/bugfix/1567_uservarcheck
[#1567] Only check values set before sending
2018-07-13 10:35:25 +02:00
Gijs NoorlanderandGitHub 621087d48f [#1567] Only check values set before sending
Fix suggested by @s0170071 [here](https://github.com/letscontrolit/ESPEasy/issues/1567#issuecomment-404746920)
2018-07-13 09:21:42 +02:00
TD-er 00683a38c5 [ParseString] Make ParseString more efficient and check results before use
`ParseString` and `getParamStartPos` made (lots of) copies of the strings.
Also the result of `getParamStartPos` was not checked, which can result in crashes.
2018-07-13 08:09:42 +02:00
ESPEasy release bot 9336697f1a automatically updated release notes for mega-20180712 2018-07-12 04:00:12 +02:00
TD-er ad06cbc835 [WiFi] Reset wifi when IP is set to 0.0.0.0
As being described a few times and a screenshot shown here: https://github.com/letscontrolit/ESPEasy/issues/1302#issuecomment-393631572
It looks like a DHCP request may fail resulting in a cleared IP setup. The web server then still replies to requests, but no new connections can be made then.

This patch should detect such a situation and then reset the wifi and make a new connection.
2018-07-12 00:20:55 +02:00
Gijs NoorlanderandGitHub f5b026e678 Merge pull request #1561 from TD-er/bugfix/1542_domoticz_IDX
[#1542] Fix  Domoticz IDX more than 4 characters
2018-07-11 22:27:05 +02:00
TD-er e29eb2eb3c [#1542] Fix Domoticz IDX more than 4 characters
Looks like Domoticz uses an unsigned int, so it could be up-to 32 bits.
Just to be sure, I limited it now to 1 bln.
2018-07-11 22:26:05 +02:00
Gijs NoorlanderandGitHub 10329f4351 Merge pull request #1560 from TD-er/bugfix/send_to_controller
[#1555] Fix TSL2591 values are not transferred to controller
2018-07-11 22:08:13 +02:00
TD-er ab4750d5fa [#1555] Fix TSL2591 values are not transferred to controller
Also checked other plugins to see if they had the same issue and fixed a few other obvious switch-statement bugs.
2018-07-11 22:04:11 +02:00
ESPEasy release bot b9f3f68335 automatically updated release notes for mega-20180710 2018-07-10 04:00:12 +02:00
GrovkillenandGitHub 777485077c P077: changed category to "energy" 2018-07-09 07:11:15 +02:00
ESPEasy release bot 3e3ef4253f automatically updated release notes for mega-20180708 2018-07-08 04:00:08 +02:00
Gijs NoorlanderandGitHub 0e78b1f8c4 Merge pull request #1554 from TD-er/bugfix/preprocessor_issues
[PIO build] Build issues caused by incorrect precompile processing
2018-07-08 00:43:41 +02:00
TD-er e7764ca7e6 [PIO build] Build issues caused by incorrect precompile processing
It looks like `ESP32` is not defined anymore, which leads to various issues when building.
2018-07-08 00:29:11 +02:00
ESPEasy release bot 89578058b6 automatically updated release notes for mega-20180705 2018-07-05 04:00:18 +02:00
Gijs NoorlanderandGitHub 34beb07120 Merge pull request #1548 from TD-er/bugfix/low_loop_count
Statistics routines to test performance and some stability fixes
2018-07-05 02:26:19 +02:00
Gijs NoorlanderandGitHub c98ae55f23 Merge pull request #1541 from tempura-san/webui_fixes
Minor WebUI fixes
2018-07-05 02:25:43 +02:00
Gijs NoorlanderandGitHub 6b08009fdd Merge pull request #1546 from uzi18/patch-1
Update _C005.ino
2018-07-05 02:25:17 +02:00
TD-er f3a8e503ac [info] Display ESP32 partition table
And added some HEX formatting functions to reduce code duplication and allow for more uniform formatting.
2018-07-05 02:14:43 +02:00
TD-er 856afe9ec5 [PlatformIO] Update to Espressif32@1.1.1 2018-07-05 02:12:52 +02:00
TD-er c4803b4136 [Stability] Use functions to get Webserver Arguments from POST messages.
These functions check values before attempting to convert to int for example.
2018-07-04 01:19:15 +02:00
TD-er 9de29b8d9c [Stability] Add check for string length to isNumerical() 2018-07-04 01:17:19 +02:00
TD-er 5a2b4146e5 [PIO build] Use newer flag syntax for Travis 2018-07-04 01:16:38 +02:00
TD-er 0a8050312c [ESP32] Upgrade to new ESpressif32 version
Known issue:
Crash when trying to load the devices page.
2018-07-03 00:48:27 +02:00
TD-er 2ffa52c7ee [Timing stats] Allow computing timing to estimate performance. 2018-07-03 00:47:29 +02:00
TD-er 6a984ad750 [BMx280] Do not wait for measurements, collect async
This plugin did wait for 1000 msec for new samples.
Such delays will disturb time critical tasks.
2018-07-03 00:46:07 +02:00
Bartłomiej ZimońandGitHub f0c1b10f46 Update _C005.ino
unification like on C002.ino
2018-07-02 20:59:54 +02:00
Tempura San da6ab075a5 [WebUI] removed stray </div> 2018-06-29 13:37:47 +02:00
Tempura San fb7ffe0731 [WebUI] font-family set to monospace for TEXTAREA 2018-06-29 13:37:47 +02:00
TD-er 1d3bafc982 [loop times] New timer statistics class to monitor performance 2018-06-28 02:19:57 +02:00
TD-er 2fde3d28a8 [CPU usage] Increase loop count
Attempting to find a plugin ID based on a task number was done a lot and also rather brute force.
Now a cache is added to lessen the load.
2018-06-27 01:25:43 +02:00
ESPEasy release bot 4c1b3a8abf automatically updated release notes for mega-20180625 2018-06-25 04:00:08 +02:00
Gijs NoorlanderandGitHub 988f269954 Merge pull request #1533 from TD-er/bugfix/ArduinoIDE_build
Bugfix/arduino ide build
2018-06-24 12:20:02 +02:00
TD-er 808b571814 [PIO update] platform to espressif8266@1.7.3 2018-06-24 12:18:41 +02:00
TD-er a4f8068fcd [Arduino IDE] Fix build include path ESPEasy-Globals.h
As mentioned by @clumsy-stefan See [here](https://github.com/letscontrolit/ESPEasy/commit/8c9b9b1700efacbf281dd9bcc94684726cd034b1#commitcomment-29475286)
2018-06-24 12:17:52 +02:00
ESPEasy release bot 025e346cb1 automatically updated release notes for mega-20180624 2018-06-24 04:00:29 +02:00
Gijs NoorlanderandGitHub 3481dd9868 Merge pull request #1532 from TD-er/bugfix/RAM_usage_command_executor
Bugfix/ram usage command executor
2018-06-24 02:52:31 +02:00
TD-er fd596c14b2 [Cmd Exec] Use switch statement instead of lookup map
The lookup of a function call based on a command string is known at compile time, so no need to keep track of this in memory.
This saves about 2200 bytes of RAM.

The strings alone account for close to 800 bytes (not using F() macro) and they are also being stored in the map.
So that's about 1600 bytes.
The extra 400 bytes are probably the pointers being stored in the map.
2018-06-24 02:48:55 +02:00
TD-er 8c9b9b1700 [Cmd Exec] Add #ifndef #def statements to prevent multiple includes
For .h files, it is common practice to add #ifndef #def statements around the implementation to prevent compiler issues when a file might be included twice.
2018-06-24 02:44:47 +02:00
Gijs NoorlanderandGitHub e0b00a23cf Merge pull request #1522 from workgroupengineering/feature/CommandsManger
Feature commands manger
2018-06-23 22:40:16 +02:00
Gijs NoorlanderandGitHub 685c975bab Merge pull request #1531 from TD-er/bugfix/build_newer_platformio
Bugfix/build newer platformio
2018-06-23 22:39:09 +02:00
TD-er d01ca5209e [web log] Disable excessive web log about RAM usage 2018-06-23 22:38:43 +02:00
TD-er d5a05a1ac5 [PlatformIO.ini] VScode needs monitor_speed and update ESP8266 platform
VScode + PlatformIO needs the monitor_speed setting to be able to monitor the connected node. (default 9600 baud)
Also set the ESP8266 code base to 1.7.2
2018-06-23 22:11:58 +02:00
TD-er c670520788 [SDS011] Set SDS011 Dust plugin to normal from testing
This plugin works on my test setup for more than 6 months and is by far the most stable node. (system uptimes of > 110 days)
So this may be considered stable.
2018-06-23 22:09:29 +02:00
TD-er 859b67e34d [ArduinoJson] Update external library ArduinoJson.
Is needed to compile new ESP32 code.
2018-06-23 22:06:22 +02:00
TD-er d325f7c1fd [JavaScript] Device measurement value update may sometimes fail
The Json data has more items at the level of `data.Sensors[c]` thus must check if it is a TaskValues item.
Otherwise the values shown on Device page will not be updated.
2018-06-23 22:04:51 +02:00
TD-er c2998b081f [AM2320] Explicit use boolean in Wire.endTransmission
Newer ESP32 environment also has endTransmission with an int as parameter.
2018-06-23 22:01:55 +02:00
Saverio Cisternino c3c2a0b6bd Migration core command 2018-06-21 15:05:44 +02:00
Saverio Cisternino 9e00623677 Implement CommandsManager 2018-06-21 15:05:44 +02:00
ESPEasy release bot 6be032b350 automatically updated release notes for mega-20180621 2018-06-21 04:00:14 +02:00
Gijs NoorlanderandGitHub 96367a9422 Merge pull request #1520 from workgroupengineering/HotFix/Issue_1489
Fixed Issue #1489
2018-06-20 15:56:54 +02:00
Gijs NoorlanderandGitHub 543ac49eaf Merge pull request #1521 from workgroupengineering/feature/show_device_port_in_hex
Show in devices list port number in hex
2018-06-20 15:55:02 +02:00
Saverio Cisternino 3e0362d52a Show in devices list port number in hex 2018-06-20 13:48:03 +02:00
Saverio Cisternino 15118d372e Fixed Issue #1489 2018-06-20 13:36:12 +02:00
ESPEasy release bot c8ee7976cc automatically updated release notes for mega-20180619 2018-06-19 04:00:10 +02:00
Gijs NoorlanderandGitHub b750e875bd Merge pull request #1515 from TD-er/bugfix/esp8285_build
[ESP8285] PlatformIO set max upload size limit
2018-06-18 23:52:36 +02:00
TD-er 5ad43348b4 [ESP8285] PlatformIO set max upload size limit
With the newer Platform IO versions, builds failed because of wrong size set in board definition of ESP8285 board.
The PlatformIO settings labels have changed.
2018-06-18 23:23:27 +02:00
Gijs NoorlanderandGitHub 08b2259924 Merge pull request #1514 from TD-er/bigfix/build_flash_ESP32
[ESP32] Allow flashing to ESP32 again from PlatformIO
2018-06-18 21:46:27 +02:00
TD-er f268b40291 [OTA] Output proper port number when ARDUINO_FEATURE_OTA is set
No functional change, only proper log entry and a bit of code cleanup.
2018-06-18 21:44:45 +02:00
TD-er 52d747dd49 [ESP32] Set build to @0.12.0
@1.0.2 does build, but ESP32 device hangs when booting.
2018-06-18 21:43:14 +02:00
TD-er e5653d1817 [ESP32] Allow flashing to ESP32 again from PlatformIO
See [this thread](https://community.platformio.org/t/esp32-esptool-error-too-few-arguments/4230/44)
2018-06-18 20:26:54 +02:00
ESPEasy release bot 6b2257063b automatically updated release notes for mega-20180618 2018-06-18 04:00:12 +02:00
Gijs NoorlanderandGitHub b9a4af54c9 Merge pull request #1509 from TD-er/bugfix/disable_ping
[#1494] Disabled ping to check if host is reachable
2018-06-18 00:11:16 +02:00
TD-er 26634f7ba9 [#1494] Disabled ping to check if host is reachable
A failing ping may also halt the ESP node and some services may not return a ping, or ICMP packets may be filtered out on some connections.
See issue #1494.
2018-06-18 00:09:31 +02:00
Gijs NoorlanderandGitHub 9beda98009 Merge pull request #1501 from clumsy-stefan/mega
Ammended central I2C fuctions (#1417)
2018-06-17 22:33:33 +02:00
Gijs NoorlanderandGitHub c7c46d28b1 Merge pull request #1507 from stelas/mega
Add sunset and sunrise variables...
2018-06-17 22:31:48 +02:00
Steffen Lange c51b78bfbf Add %sunrise% and %sunset% variables 2018-06-17 17:06:28 +02:00
Steffen Lange df5c22529f Add GPS coordinates to Advanced Settings 2018-06-17 16:51:12 +02:00
ESPEasy release bot 808ab85afb automatically updated release notes for mega-20180615 2018-06-15 04:00:11 +02:00
Gijs NoorlanderandGitHub ad1cbf5ddf Merge pull request #1504 from TD-er/feature/warn_OTA_1M
[1M flash warning] Warn for OTA when 1M flash present
2018-06-14 23:27:29 +02:00
TD-er 4aff834f76 [1M flash warning] Warn for OTA when 1M flash present 2018-06-14 20:04:01 +02:00
ESPEasy release bot f8405690c5 automatically updated release notes for mega-20180614 2018-06-14 04:00:11 +02:00
Gijs NoorlanderandGitHub 3edf12913d [#1503] Use proper timeout on BME280/BMP280 2018-06-13 23:18:59 +02:00
Gijs NoorlanderandGitHub f0aa9c50f6 [#1502] Change wait-to-connect timeout to 12 sec. 2018-06-13 22:51:31 +02:00
stefan 80f87b6c53 Ammended central I2C fuctions (#1417)
Ammended central I2C functions with 16bit write and 32 bit read.
also added "false" parameter to wire.endTransmission before wire.request form

all as discussed in #1417
2018-06-13 13:55:16 +02:00
ESPEasy release bot f41f0969f0 automatically updated release notes for mega-20180613 2018-06-13 04:00:15 +02:00
Gijs NoorlanderandGitHub 14e2f4c697 [BMx280] Correct nr values for special sensor type
`SENSOR_TYPE_TEMP_EMPTY_BARO` outputs values 1 and 3, so must consider them as 3-valued sensor.
2018-06-13 00:54:18 +02:00
Gijs NoorlanderandGitHub b9f5535b48 Merge pull request #1500 from TD-er/bugfix/bme280_change_type_for_BMP280
[BMx280] Send data from BMP280 as temp_baro, not temp_hum_baro
2018-06-13 00:43:16 +02:00
TD-er 81022e4605 [BMx280] Send data from BMP280 as temp_baro, not temp_hum_baro
The plugin BMx280 can handle BMP280 and BME280.
The BMP version has no humidity sensor.
For Domoticz you have to send the data formatted differently.

Now the same plugin can be used for both BME280 and BMP280 and the settings in Domoticz can be set accordingly.
2018-06-13 00:39:23 +02:00
Gijs NoorlanderandGitHub 616898514b Merge pull request #1499 from TD-er/feature/log_reset_reason
[Diag] Log Reset Reason at boot for ESP8266 and ESP32
2018-06-12 23:57:54 +02:00
TD-er 020aec0541 [Diag] Log Reset Reason at boot for ESP8266 and ESP32
To get a better idea of the cause with reported issues.
2018-06-12 23:24:59 +02:00
ESPEasy release bot 1e39a314f5 automatically updated release notes for mega-20180611 2018-06-11 04:00:21 +02:00
Gijs NoorlanderandGitHub 4d369927fd Merge pull request #1491 from TD-er/bugfix/ultrasonic_multi_device
Bugfix/ultrasonic multi device
2018-06-11 00:49:08 +02:00
Gijs NoorlanderandGitHub c1465831bb Merge pull request #1481 from tempura-san/mega
[MQTT Import] system variables support for topics
2018-06-11 00:48:50 +02:00
Gijs NoorlanderandGitHub 3ec1d29c19 Merge pull request #1473 from workgroupengineering/HotFix/PCA9685_Instance_Command
Fixed issue when there is more PCA9685
2018-06-11 00:48:23 +02:00
Gijs NoorlanderandGitHub 22b430c669 Merge pull request #1461 from TD-er/feature/central_i2c_code
[#1417] Move I2C functions to a separate file
2018-06-11 00:47:58 +02:00
TD-er 2f7560cc90 [BME/BMP280] Improve temperature/humidity readout
Previously the I2C registers containing measurement data was read per address at once.
Now all are read in one I2C command and then processed.

Also changed the source to be able to support multiple instances of the same task.
2018-06-11 00:08:30 +02:00
TD-er 4f97db87f7 [PlatformIO] Added libraries to be able to use std::map 2018-06-09 23:21:42 +02:00
TD-er dcf8e86db7 [#1484] Multiple instances of ultrasonic sensors
This should also fix #1381.

There is something strange about the handling of micros() timers in `NewPingESP8266`.
For this reason I added also a timeout based on `millis()`.
2018-06-09 23:20:29 +02:00
ESPEasy release bot 06914e72b1 automatically updated release notes for mega-20180606 2018-06-06 04:00:17 +02:00
Gijs NoorlanderandGitHub fca56ac311 Merge pull request #1485 from letscontrolit/bugfix/Gpio_command
[GPIO command] work-around as long as gpio command is still performed in P001
2018-06-05 20:38:44 +02:00
Gijs NoorlanderandGitHub 2bacc5a1b2 [GPIO command] work-around as long as gpio command is still performed in P001_switch.
As discussed in #1477
2018-06-05 20:02:00 +02:00
TD-er a487bd132d [I2C] Disable calls to wire.begin() from libraries 2018-06-05 19:56:23 +02:00
Tempura San 3f441b11ee [MQTT Import] system variables support for topics 2018-06-04 23:45:30 +02:00
Saverio Cisternino 40d5780600 Fixed issue when there is more PCA9685 2018-05-30 10:07:06 +02:00
TD-er 9822c4bac0 [I2Cdev] Add I2Cdevlib library
Adding an existing and proven I2C library.
Will need to test if this is working fine on ESP32 too and try to move I2C functionality to use these functions.
2018-05-27 01:32:40 +02:00
ESPEasy release bot 0fc3a28875 automatically updated release notes for mega-20180524 2018-05-24 04:00:14 +02:00
TD-er 0aac28b15e [#1417] Move I2C functions to a separate file
As discussed in #1417.
2018-05-24 00:41:18 +02:00
Gijs NoorlanderandGitHub 810927f32b Merge pull request #1244 from susisstrolch/git-hooks
GIT hooks: post-merge, post-commit, post-checkout
2018-05-23 22:28:00 +02:00
Gijs NoorlanderandGitHub c3d8d0a2fe Merge branch 'mega' into git-hooks 2018-05-23 22:27:41 +02:00
Gijs NoorlanderandGitHub 0c9e27a180 Merge pull request #1369 from workgroupengineering/feature/mqtt_enhanced_customization
[Feature]mqtt enhanced customization
2018-05-23 22:25:28 +02:00
Gijs NoorlanderandGitHub a5f44a1811 Merge pull request #1460 from TD-er/bugfix/CI-build-errors
[CI build] Small fix to prevent Travis CI build errors.
2018-05-23 22:15:46 +02:00
TD-er 66f386f3fc [CI build] Small fix to prevent Travis CI build errors. 2018-05-23 22:14:14 +02:00
Gijs NoorlanderandGitHub e74cc14dfb Merge pull request #1448 from workgroupengineering/feature/PCA9685_enhanced
PCA9685 enhanced
2018-05-23 22:00:38 +02:00
Gijs NoorlanderandGitHub ad1907eef4 Merge pull request #1387 from workgroupengineering/feature/Multi_OLED
Implement Issue #1377
2018-05-23 21:31:07 +02:00
Saverio Cisternino 7640132828 PCA9685: Add support at command [TaskName].gpio all,1 | 0 which allows you to turn on (1) or turn off (0) all gpio of expander. 2018-05-22 15:25:49 +02:00
Saverio Cisternino fecf740121 PCA9685: Add named istance pulse command. Es: Extend.pulse 0,1,50,auto gnenerate pulse on gpio 0 with duration of 50 ms an autorestart after 50 ms 2018-05-22 15:25:49 +02:00
Saverio Cisternino 7d9628c6d1 PCA9685: Add support at commad gpio on name instance call 2018-05-22 15:25:49 +02:00
Saverio Cisternino 7d5a0db6fa PCA9685: Allow use frq alias when call instance command es: Extender.frq 100 2018-05-22 15:25:49 +02:00
Saverio Cisternino 49fc761657 PCA9685: Add pcafrq arg validation 2018-05-22 15:25:48 +02:00
Saverio Cisternino 98d1a9cec4 PCA9685: Allow use pwm alias when call instance command es: Extender.pwm 1, 1000 2018-05-22 15:25:07 +02:00
Saverio Cisternino ae010e25fb PCA9685: show address in hex. 2018-05-22 15:25:06 +02:00
Saverio Cisternino 3013c8e468 PCA9685: Add Pin e PWM validation 2018-05-22 15:25:06 +02:00
Saverio Cisternino ade5f83819 PCA9685: Allow named istance commands for execute command on specific task when there is more PCA9685 task. 2018-05-22 15:25:05 +02:00
Saverio Cisternino caf487e04e PCA9685: Allow select address. 2018-05-22 15:25:05 +02:00
Saverio Cisternino d8100a2b9d ExecuteCommand intercept Par4 and Par5 2018-05-22 15:24:24 +02:00
Saverio Cisternino 18f38b3019 EventStruct copy ctor 2018-05-22 15:24:23 +02:00
Saverio Cisternino 952c532542 -Arminizze type of ParX of systemTimerStruct with EventStruct to prevent truncation issue
-Add setSystemTimer overload
2018-05-22 15:24:23 +02:00
Saverio Cisternino d1b15579a1 Allow PLUGIN_TIMER_IN TaskIndex 2018-05-22 15:24:23 +02:00
Saverio Cisternino 8445d8cc71 Allow escape char [ and ] for use with comannd and rule containde space es [Extra 2]#Go 2018-05-22 15:24:23 +02:00
Saverio Cisternino 7720b5bce3 Allows plugin to intercept PLUGIN_WRITE and PLUGIN_REQUEST, when there is more tasks of same plugin type but different configuration. 2018-05-22 15:24:23 +02:00
Saverio Cisternino 965046778a Allow use Unit Name as MQTT ClientId 2018-05-22 15:22:24 +02:00
Saverio Cisternino 1a8fffda28 Allow custom lwt message 2018-05-22 15:22:24 +02:00
Saverio Cisternino a5e3979be6 Allow custom mqtt lwt topic 2018-05-22 15:22:24 +02:00
ESPEasy release bot 9d2e008a5c automatically updated release notes for mega-20180522 2018-05-22 04:00:14 +02:00
Gijs NoorlanderandGitHub a031ce9b5b Merge pull request #1456 from TD-er/feature/SonoffPOW2
[P077] CSE7766 - Energy (Sonoff S31 and Sonoff Pow R2)
2018-05-22 00:10:35 +02:00
Gijs NoorlanderandGitHub c8593d5644 Merge pull request #1457 from tedenda/Inform_user_about_valid_tasknumber_for_PulseCounter
Added a note for PulseCounter
2018-05-22 00:09:44 +02:00
Daniel Tedenljung 306b2174f2 Add note for PulseCounter
I added a note if you choose PulseCounter on task 5-12.
Part of #882
2018-05-21 23:03:22 +02:00
Daniel TedenljungandGitHub 10ff688cc4 Merge pull request #3 from letscontrolit/mega
Catch up...
2018-05-21 22:45:52 +02:00
TD-er ae292921e2 [P077] CSE7766 - Energy (Sonoff S31 and Sonoff Pow R2)
Was P134 on the playground
2018-05-21 22:34:03 +02:00
Gijs NoorlanderandGitHub a1622f6066 Merge pull request #1449 from clumsy-stefan/mega
Add CSE7766 for Sonoff POW R2 to plugin_sets
2018-05-21 20:23:56 +02:00
Gijs NoorlanderandGitHub 86490d6f0b Merge pull request #1454 from giig1967g/new/commands_ip
Added 10 new commands for setup through serial port
2018-05-21 19:36:15 +02:00
Plebs 976df758d2 Added 10 new commands for serial port configuration
In order to semplify the setup of new units, I have added the following commands for modifying settings though serial port:

gateway (x.x.x.x)
dns (x.x.x.x)
subnet (x.x.x.x)
dst (0 or 1)
mqttretainflag (0 or 1)
messagedelay (ms)
ntphost (url)
timezone (minutes)
udpport (port number)
usentp (0 or 1)

work in serial and rules
2018-05-21 00:00:02 +02:00
stefan c31e50dfa0 Merge remote-tracking branch 'origin/mega' into mega 2018-05-19 10:25:05 +02:00
ESPEasy release bot 147acc6724 automatically updated release notes for mega-20180519 2018-05-19 04:00:07 +02:00
stefan bfd5ad587a Merge remote-tracking branch 'origin/mega' into mega 2018-05-19 00:19:06 +02:00
Saverio Cisternino 84791ecbd5 Allow using two oled at same time.
Suppose you have two oled task with name FrontPanel and BackPanel. If you want turn off FrontPanel and print on BackPanel "Hi" at posintion 0,0  you must use the following instructions:

frontpanel.oledcmd off
backpanel.oled 0,0,Hi

if task name have space you must surround with square brackets. es: [task with space].oledcmd off
2018-05-18 15:39:06 +02:00
Saverio Cisternino 6e4f4cb27b EventStruct copy ctor 2018-05-18 15:24:21 +02:00
Saverio Cisternino c1ee60ebca -Arminizze type of ParX of systemTimerStruct with EventStruct to prevent truncation issue
-Add setSystemTimer overload
2018-05-18 15:24:21 +02:00
Saverio Cisternino fc1f6acc61 Allow PLUGIN_TIMER_IN TaskIndex 2018-05-18 15:24:21 +02:00
Saverio Cisternino e2c82680aa Allow escape char [ and ] for use with comannd and rule containde space es [Extra 2]#Go 2018-05-18 15:23:59 +02:00
Saverio Cisternino f0eb7659b2 Allows plugin to intercept PLUGIN_WRITE and PLUGIN_REQUEST, when there is more tasks of same plugin type but different configuration. 2018-05-18 15:21:40 +02:00
GrovkillenandGitHub 966353614d [tools page] added a function for wide buttons 2018-05-18 09:58:18 +02:00
stefan 3308a47a3a Merge remote-tracking branch 'origin/mega' into mega 2018-05-18 08:19:08 +02:00
ESPEasy release bot ffad0256e9 automatically updated release notes for mega-20180518 2018-05-18 04:00:07 +02:00
GrovkillenandGitHub c531639d03 Merge pull request #1450 from Grovkillen/mega
[tools page] added 100% wide buttons + red factory reset
2018-05-18 00:42:50 +02:00
GrovkillenandGitHub a2ec2d15f1 [tools page] Center text, factory reset is red 2018-05-18 00:29:43 +02:00
GrovkillenandGitHub eaa21d0182 [tools page] wider buttons 2018-05-18 00:16:36 +02:00
GrovkillenandGitHub 5a19b08262 Merge pull request #30 from letscontrolit/mega
update from master
2018-05-18 00:14:07 +02:00
stefan 2c9964127c Add CSE7766 for Sonoff POW R2 to plugin_sets
Add USES_P134 to define_plugin_sets.h for use with Sonoff POW R2 measurments.
See also
pull request #94 on ESPEasyPlayground (https://github.com/letscontrolit/ESPEasyPluginPlayground/pull/94)
2018-05-17 20:35:22 +02:00
GrovkillenandGitHub ea20971b51 Merge pull request #1442 from Grovkillen/memory-optimization-for-JS
Memory optimization for JavaScript
2018-05-17 09:45:24 +02:00
GrovkillenandGitHub eed78f9613 [JavaScript] made static variables "const" 2018-05-17 08:51:13 +02:00
GrovkillenandGitHub fe26453927 Merge pull request #28 from letscontrolit/mega
update from master
2018-05-17 08:46:37 +02:00
GrovkillenandGitHub 70db6d65db Merge pull request #1440 from TD-er/feature/1431
[#1431] Add DataAcquisition to /json and reduce json for sensor updates
2018-05-17 08:18:55 +02:00
ESPEasy release bot 07b9d5c6f5 automatically updated release notes for mega-20180517 2018-05-17 04:00:08 +02:00
TD-er 45048ea6bc [#1431] Add DataAcquisition to /json and reduce json for sensor updates
The /json page now also supports a limited view for the device page sensor updates.

The supported URLs for the json page are:

- `/json` All information in JSON format.
- `/json?view=sensorupdate` Limited view only for auto update on Devices tab.
- `/json?tasknr=N` with N being the task number, just outputs the information for the given task number.

N.B. these parameters can be combined, like: `/json?tasknr=1&view=sensorupdate`
2018-05-16 23:41:50 +02:00
Gijs NoorlanderandGitHub c7ff6059ce Merge pull request #1438 from TD-er/bugfix/flash_strings
[Flash strings] Store more strings into flash to keep memory usage low
2018-05-16 21:39:04 +02:00
Gijs NoorlanderandGitHub 6d2cd505a8 Update WebServer.ino 2018-05-16 14:30:38 +02:00
Gijs NoorlanderandGitHub 6b05d2b02e Update _C012.ino 2018-05-16 13:45:29 +02:00
ESPEasy release bot 083310679c automatically updated release notes for mega-20180516 2018-05-16 04:00:09 +02:00
Gijs NoorlanderandGitHub 2758c80af2 Merge pull request #1437 from Grovkillen/add-current-log-level-+-legend
Add current log level + some error capture
2018-05-16 02:08:40 +02:00
TD-er 0bd1134eca [Flash strings] Store more strings into flash to keep memory usage low 2018-05-16 01:55:41 +02:00
GrovkillenandGitHub 4a75b1fa6d [web log] error capture of lower log levels
Also added the current log level as info above the log viewer...
2018-05-15 21:51:07 +02:00
GrovkillenandGitHub 21d30f0ebe Merge pull request #27 from letscontrolit/mega
update from master
2018-05-15 20:22:35 +02:00
Gijs NoorlanderandGitHub 16463dff85 Merge pull request #1432 from Grovkillen/github-copy-button
GitHub copy button
2018-05-15 20:20:08 +02:00
Gijs NoorlanderandGitHub 8e5fb85fa8 Merge pull request #1429 from giig1967g/bugfix/formats
Another small fix for #1426
2018-05-15 20:19:25 +02:00
GrovkillenandGitHub 74f059e639 Merge pull request #1434 from Grovkillen/bugfix-for-log-level-info
Bugfix for log level info
2018-05-15 20:17:53 +02:00
GrovkillenandGitHub 045c50f69f [web log] bugfix for empty logJSON stings 2018-05-15 19:49:18 +02:00
GrovkillenandGitHub a122066e36 Merge pull request #26 from letscontrolit/mega
update from master
2018-05-15 19:24:20 +02:00
GrovkillenandGitHub d3bf64fc4f Merge pull request #25 from letscontrolit/mega
Update from master
2018-05-15 15:39:13 +02:00
GrovkillenandGitHub 74decbd159 [sysinfo page] fixed layout of button 2018-05-15 15:38:03 +02:00
GrovkillenandGitHub b00020de89 [sysinfo page] Added GitHub button to TXBuffer 2018-05-15 07:03:40 +02:00
GrovkillenandGitHub d9848c1911 [sysinfo page] added CSS to GitHub copy button 2018-05-15 07:02:27 +02:00
ESPEasy release bot 648353b216 automatically updated release notes for mega-20180515 2018-05-15 04:00:11 +02:00
GrovkillenandGitHub f729012ee1 [sysinfo page] added GitHub copy 2018-05-15 00:44:10 +02:00
GrovkillenandGitHub 87176b453a Added latest nightly release badge 2018-05-14 23:18:23 +02:00
GrovkillenandGitHub a2270bebbf Merge pull request #24 from Grovkillen/mega
update
2018-05-14 23:02:50 +02:00
GrovkillenandGitHub 305d729015 Merge pull request #23 from letscontrolit/mega
update from master
2018-05-14 23:01:39 +02:00
Plebs c31fa71988 Another small fix for #1426 2018-05-14 22:38:58 +02:00
Gijs NoorlanderandGitHub fba4331213 Merge pull request #1423 from Grovkillen/optimize-log-script
Optimize log script
2018-05-14 20:51:55 +02:00
Gijs NoorlanderandGitHub 972d24118a Merge pull request #1424 from Grovkillen/fix-corrupted-bin-files
Fix corrupted bin files
2018-05-14 20:51:34 +02:00
Gijs NoorlanderandGitHub a885cf1f90 Merge pull request #1427 from giig1967g/bugfix/formats
fix for #1426
2018-05-14 20:50:35 +02:00
Plebs 56d85814b1 fix for #1426 2018-05-14 19:09:35 +02:00
GrovkillenandGitHub c760174c78 [fix for crc2.py] truncation corrupted bin file 2018-05-14 12:20:13 +02:00
GrovkillenandGitHub 2c43094a87 [web log] added warning if IE11 or older is used 2018-05-14 10:59:23 +02:00
GrovkillenandGitHub ee99e9e6f4 [web log] added the reRunCout to the function 2018-05-14 10:09:08 +02:00
GrovkillenandGitHub 864e402cc2 [web log] Added declaring of reRunCount 2018-05-14 09:29:55 +02:00
GrovkillenandGitHub dff51ba54d [web log] Chunk transfer instead of line transfer 2018-05-14 09:27:18 +02:00
GrovkillenandGitHub 0eea67d176 Merge pull request #22 from Grovkillen/mega
update
2018-05-14 08:10:10 +02:00
GrovkillenandGitHub 9139baa6cb Merge pull request #21 from letscontrolit/mega
update from master
2018-05-14 08:09:06 +02:00
ESPEasy release bot fdf8a40acf automatically updated release notes for mega-20180514 2018-05-14 04:00:09 +02:00
Gijs NoorlanderandGitHub 547f3643ff Merge pull request #1421 from TD-er/bugfix_issue#1411
Memory optimizations
2018-05-13 23:46:12 +02:00
TD-er 83d0980248 [ESP32] ESP.getResetReason() is unknown to ESP32 2018-05-13 23:25:08 +02:00
TD-er 0b1f9a81b5 [memory corruption] LWIP data corrupts log buffer
Not sure how, but the headers of new JSON message can corrupt the buffer in the web log buffer.
In this attempt the log buffer lines are now moved to heap instead of stack. 
Also the streaming webserver is given a bit more time to handle requests.

Steps to reproduce:
Set web log level to maximum and open web log viewer.
Then wait a few seconds to minutes to let the JSON stream stop and look at the last sent Json message. This will contain some typical Json web headers and thus no valid Json anymore.

Also added a quick fix for #1419
2018-05-13 23:12:02 +02:00
TD-er 0e8b333f48 [issue #1380] Prevent memory leaks in WiFiClient
See described work-around in https://github.com/esp8266/Arduino/issues/4497#issuecomment-373023864
2018-05-13 23:04:45 +02:00
TD-er 67098c2539 [memory] use "-DNDEBUG" to disable ASSERT macros
See https://github.com/esp8266/Arduino/issues/3978
2018-05-13 22:58:10 +02:00
Gijs NoorlanderandGitHub 700b14b8ff Merge pull request #1420 from ZericE/mega
[#1404] Change email notify protocol to better comply with RFC2821. Rewrite line breaks for content-type: text/html
2018-05-13 19:05:03 +02:00
ZericE 9175cd3a17 use reference to free up mem. 2018-05-13 09:23:23 -07:00
ZericE c16f27af1b remove unneeded use of bMesg to free up mem. 2018-05-13 08:45:43 -07:00
Gijs NoorlanderandGitHub cc60b8a05d Merge pull request #1382 from flexiti/mega
ESP32 OTA amendments
2018-05-13 11:42:33 +02:00
Gijs NoorlanderandGitHub d7b46b3395 Merge pull request #1416 from giig1967g/new/formats
Added more #formats transformations
2018-05-13 11:41:12 +02:00
ESPEasy release bot 701677274f automatically updated release notes for mega-20180513 2018-05-13 04:00:08 +02:00
ZericE ebfffb8d43 updated comment 2018-05-12 18:08:47 -07:00
ZericE f5fd624739 remove debug lines in email notify 2018-05-12 18:06:00 -07:00
ZericE abdf011a2d undo unnecessary changes in email body
Previously I thought the body wasn't working correctly in email, however it was, with the exception of line breaks for text/html that have to be rewritten.
2018-05-12 18:03:59 -07:00
ZericE 4ece42bdc9 Merge branch 'mega' of https://github.com/ZericE/ESPEasy into mega 2018-05-12 16:48:17 -07:00
ZericE b0961c15a3 [#1404] Fix email notification for RFC2821, fix so msg body included.
In communicating with the server, the sender and receiver needed to be surrounded by <> to be RFC2821 compliant.
The message body was coming out blank as an empty string was being sent instead of the correct string.
2018-05-12 16:43:30 -07:00
Plebs 70a422bdfd Added more #formats transformations
New Transformations:
#H: Hot/Cold
#A: Man/Auto
#a: M/A

New Justifications:
#Lx: Left (x=number of chars)
#Rx: Right (x=number of chars)
#Ux.y: Substring (x=first char; y=number of chars)
2018-05-12 23:57:58 +02:00
Gijs NoorlanderandGitHub 5449d82639 [PR #1304] Rename file before running crc2.py
Quick patch of PR #1304
2018-05-12 22:57:17 +02:00
ZericEandGitHub 7e5577b30b Merge pull request #1 from letscontrolit/mega
update latest changes from main repository
2018-05-12 13:14:39 -07:00
Gijs NoorlanderandGitHub 0d95fd12fe Fix debug code (commented) in _P045_MPU6050.ino
Original PR was https://github.com/letscontrolit/ESPEasy/pull/1389
Found by @maartenpaauw
2018-05-12 22:10:33 +02:00
flexitiandGitHub b7df21a1d5 Merge pull request #4 from letscontrolit/mega
Sat May 12 04:00:06 CEST 2018
2018-05-12 11:00:14 +02:00
ESPEasy release bot 431b94c587 automatically updated release notes for mega-20180512 2018-05-12 04:00:06 +02:00
GrovkillenandGitHub 53241f2afc Added Github logo (for button) 2018-05-12 00:46:10 +02:00
GrovkillenandGitHub 076c2c04f1 Merge pull request #20 from letscontrolit/mega
update from master
2018-05-12 00:43:00 +02:00
GrovkillenandGitHub 10e912f46f Merge pull request #1413 from Grovkillen/optimized-log-a-tiny-bit-(feels-good)
Optimized log a tiny bit (feels good)
2018-05-12 00:25:26 +02:00
GrovkillenandGitHub c90174712b [web log] safety net not needed anymore 2018-05-12 00:14:54 +02:00
GrovkillenandGitHub 1d71d362b9 Merge pull request #19 from letscontrolit/mega
update from master
2018-05-12 00:06:39 +02:00
Gijs NoorlanderandGitHub 73fbe04981 Merge pull request #1410 from TD-er/bugfix/nightlybuilds
[build] Do builds twice on the nightly builds
2018-05-11 22:11:08 +02:00
flexitiandGitHub 469735b5fd Merge pull request #3 from letscontrolit/mega
Commits on May 10, 2018
2018-05-11 17:42:10 +02:00
TD-er cf13024175 [#1411] Add SensorTypeNone to indicate no sensor values for Domoticz
Some plugins which do not output any values had this setting set to "Switch" or "single".
2018-05-11 17:20:32 +02:00
Gijs NoorlanderandGitHub eaf6488b0c Merge pull request #1409 from Grovkillen/device-page]-added-max-request
[Device page] added max request
2018-05-11 14:44:32 +02:00
GrovkillenandGitHub 4d067f010f [device page] added dynamic length to loop 2018-05-11 14:41:01 +02:00
GrovkillenandGitHub e6db005dba [web log] also taking care of disconnects 2018-05-11 14:19:16 +02:00
GrovkillenandGitHub 7a03802c15 [device page] added max request here too 2018-05-11 14:00:17 +02:00
GrovkillenandGitHub 1e2e750b3b Merge pull request #18 from letscontrolit/mega
update from master
2018-05-11 13:59:23 +02:00
Gijs NoorlanderandGitHub 50a19692b5 Merge pull request #1408 from Grovkillen/fix-request-issue
[web log] Fix request issue
2018-05-11 13:46:52 +02:00
TD-er b6284f2701 [build] Do builds twice on the nightly builds
And added build for ESP32 and Sonoff POW
2018-05-11 13:42:41 +02:00
GrovkillenandGitHub b3db6621e2 [web log] fixed wait on requests 2018-05-11 13:33:28 +02:00
GrovkillenandGitHub 2d32fe3e32 Merge pull request #17 from letscontrolit/mega
update from master
2018-05-11 11:33:28 +02:00
GrovkillenandGitHub 241f21b87c Merge pull request #1407 from Grovkillen/fix-for-sub-second-timers
[web log] Fix for sub second timers
2018-05-11 10:58:45 +02:00
GrovkillenandGitHub 4f18f81522 [web log] fixed overflow when set to "debug dev" 2018-05-11 10:50:47 +02:00
GrovkillenandGitHub b860f79e77 Merge pull request #16 from letscontrolit/mega
update from master
2018-05-11 10:44:17 +02:00
Gijs NoorlanderandGitHub 8966e1680b Merge pull request #1403 from Grovkillen/fix-timer-in-javascript
Fix timer in javascript
2018-05-11 10:03:34 +02:00
GrovkillenandGitHub 01436201a3 Added ";" 2018-05-11 09:59:31 +02:00
GrovkillenandGitHub 1ac94bf6db Merge pull request #15 from letscontrolit/mega
Update from master
2018-05-11 09:44:20 +02:00
GrovkillenandGitHub ed66a98e08 Fix for decimals on auto update device page 2018-05-11 09:43:07 +02:00
Gijs NoorlanderandGitHub 5a0c2e2353 Merge pull request #1405 from TD-er/bugfix/json_nr_decimals
[JSON] Add number of decimals to the JSON output
2018-05-11 09:42:01 +02:00
TD-er 06bc63e385 [JSON] Add number of decimals to the JSON output 2018-05-11 09:40:32 +02:00
GrovkillenandGitHub d3ebe3ec46 Fixed scrolling issue when fetch <450mSec 2018-05-11 09:32:23 +02:00
GrovkillenandGitHub 2282288030 Added check to stop flooding 2018-05-11 09:17:17 +02:00
GrovkillenandGitHub e5766bee46 Fixed some small syntax missing 2018-05-11 08:31:04 +02:00
flexitiandGitHub c5bbfd1b4c Merge pull request #2 from letscontrolit/mega
Fri May 11 04:00:08 CEST 2018
2018-05-11 08:18:27 +02:00
ESPEasy release bot 652ce2f809 automatically updated release notes for mega-20180511 2018-05-11 04:00:08 +02:00
GrovkillenandGitHub f3fd3900e5 Removed a timer reset... 2018-05-11 00:44:49 +02:00
GrovkillenandGitHub 07b726d4b1 Preparation for fixed decimals... 2018-05-11 00:30:58 +02:00
GrovkillenandGitHub 648d960bf5 Fixed format (I like tabs, Platformio like spaces) 2018-05-10 23:25:45 +02:00
GrovkillenandGitHub 1829a35df2 Fixed the timers for log + devices 2018-05-10 23:23:06 +02:00
GrovkillenandGitHub c5bb6700d9 Merge pull request #14 from letscontrolit/mega
update from master
2018-05-10 22:45:00 +02:00
Gijs NoorlanderandGitHub 3b2dd86280 Merge pull request #1402 from TD-er/feature/ImproveWebserver
[Web] Improve serving large blobs directly from flash
2018-05-10 22:27:38 +02:00
TD-er 11563469d0 [Web] Improve serving large blobs directly from flash
Serve PROGMEM data directly from flash.
This makes it easier to add Javascript code to the source and it will be served directly from flash
2018-05-10 22:13:56 +02:00
Gijs NoorlanderandGitHub fcea12b515 Merge pull request #1400 from TD-er/bugfix/JSONoutput
Format user values + Legend for log JSON
2018-05-10 18:48:33 +02:00
TD-er 2b72ad2088 [log JSON] Add log level legend to the logjson output
To be shown on the  web log viewer as legend
2018-05-10 18:10:40 +02:00
TD-er 30acf569e7 [cleanup] Simplify formatting user variables and allow checking
Extended the way a user variable is formatted to allow checking the value.
Also made clear when values are actually checked.
2018-05-10 18:05:14 +02:00
GrovkillenandGitHub cb71f73b56 Merge pull request #13 from letscontrolit/mega
update from master
2018-05-10 13:11:14 +02:00
flexitiandGitHub 521ca465e5 Merge pull request #1 from letscontrolit/mega
Thu May 10 04:00:13 CEST 2018
2018-05-10 10:51:44 +02:00
ESPEasy release bot ca10c834cc automatically updated release notes for mega-20180510 2018-05-10 04:00:13 +02:00
Gijs NoorlanderandGitHub ef90c84506 Merge pull request #1393 from Grovkillen/color-scheme-for-web-log
Color scheme for web log
2018-05-09 23:34:47 +02:00
Gijs NoorlanderandGitHub 3c2f539ec3 Merge pull request #1390 from workgroupengineering/HotFix/Device_Plugin_ID
Fix plugin_id visualization
2018-05-09 23:34:22 +02:00
Gijs NoorlanderandGitHub 30419c9932 Merge pull request #1378 from TD-er/feature/Ventus_W266_build_selection
[build] Special build config for Ventus W266
2018-05-09 23:33:44 +02:00
Gijs NoorlanderandGitHub a340b4dedc Merge pull request #1385 from Grovkillen/auto-update-values
Auto update values on device page
2018-05-09 23:32:58 +02:00
Gijs NoorlanderandGitHub 69e4d1ec7a Merge pull request #1384 from ZericE/mega
[#1368] Remove call to Plugin_041_update in _P041_NeoClock that caused a hard crash.
2018-05-09 23:29:55 +02:00
GrovkillenandGitHub 91570e9df5 Fixed copy to clipboard (handle HTML tags) 2018-05-09 20:48:03 +02:00
GrovkillenandGitHub 53e9a8f4a3 Fixed the log level colors 2018-05-09 19:51:21 +02:00
GrovkillenandGitHub 71c9b772fe Removed auto update of values... wrong branch 2018-05-09 19:34:40 +02:00
Saverio Cisternino 3ff96a5bec Fix plugin_id visualization on devices view that afflict Development build 2018-05-09 18:54:00 +02:00
GrovkillenandGitHub 32f8edb1ce Added div to web log (color scheme)
Need to add clean up to copy button.
2018-05-09 16:04:40 +02:00
GrovkillenandGitHub 977611b39c Wrap up for the PR 2018-05-08 00:09:22 +02:00
GrovkillenandGitHub 52979cafba Values are updated (1-4 values per task) 2018-05-07 23:47:36 +02:00
ZericE b0a1b95f64 Merge remote-tracking branch 'upstream/mega' into mega 2018-05-07 12:58:07 -07:00
ZericE 04f323b902 [#1368] Remove call to Plugin_041_update causing a hard crash.
Plugin_041_update was being called before the plugin has been initialized, this resulted in an exception 28 type crash. Plugin_041_update clears the display and isn't required at the time of webform save.
2018-05-07 12:34:38 -07:00
GrovkillenandGitHub c20656fe77 First draft of auto update of task/device values 2018-05-07 20:41:55 +02:00
GrovkillenandGitHub 6d3b2d1b18 Merge pull request #12 from letscontrolit/mega
update from master
2018-05-07 12:52:02 +02:00
flexitiandGitHub 388b8f4feb ESP32 OTA port setting 2018-05-07 11:57:32 +02:00
flexitiandGitHub 7b6b72b912 ESP32 OTA port is set to 3232 2018-05-07 11:53:06 +02:00
flexitiandGitHub 5e9ad087b9 OTA check box
if Arduino OTA is not compiled, a button to choose  it is not available
2018-05-07 11:50:03 +02:00
flexitiandGitHub ca5a1bdba1 Improvement in the file platformio.ini 2018-05-07 11:46:50 +02:00
ESPEasy release bot 98522d7cfc automatically updated release notes for mega-20180507 2018-05-07 04:00:08 +02:00
GrovkillenandGitHub 30ab8aef9e [issue template] extra reminder to self compilers 2018-05-06 23:35:59 +02:00
TD-er 22593d7116 [Ventus W266] Fix signed/unsigned warning 2018-05-06 22:52:04 +02:00
TD-er a8f3ad1be2 [build] Special build config for Ventus W266 2018-05-06 22:29:25 +02:00
ESPEasy release bot d54a01a3e6 automatically updated release notes for mega-20180506 2018-05-06 04:00:08 +02:00
Gijs NoorlanderandGitHub 226b3f3d54 Merge pull request #1344 from giig1967g/bugfix/960
fix for #960: new command: TaskValueSetAndRun
2018-05-05 23:47:52 +02:00
Gijs NoorlanderandGitHub 1e4a0858c1 Merge branch 'mega' into bugfix/960 2018-05-05 23:34:02 +02:00
Gijs NoorlanderandGitHub 379c4fccd1 Merge pull request #1347 from Grovkillen/Infinitive-web-log
This one is not yet complete, way more features and improvements are coming. 
But for now it is already much much better than the old log viewer :)
So I'll merge it now and we'll see what it will become.
2018-05-05 23:30:41 +02:00
Gijs NoorlanderandGitHub 886d46fd4c Merge pull request #1370 from ZericE/mega
[#1356] Remove redundant call to MQTTCheck
2018-05-05 22:47:35 +02:00
Gijs NoorlanderandGitHub 5184cba646 Merge pull request #1374 from giig1967g/new/logentry
new command: logentry #1183
2018-05-05 22:46:57 +02:00
Gijs NoorlanderandGitHub b8c4215a27 Merge pull request #1373 from TD-er/feature/optimize_json_pages
Feature/optimize json pages
2018-05-05 22:46:24 +02:00
TD-er d1b017b287 [JSON] Fix for single task view of json output. 2018-05-05 22:26:56 +02:00
TD-er a5421e816c [JSON] Add TTL, task interval and task enabled
TTL = The shortest interval per enabled task (with output values) in msec.
2018-05-05 22:14:42 +02:00
GrovkillenandGitHub d6ca15671d Forgot the auto-scroll function... now added 2018-05-05 21:14:51 +02:00
GrovkillenandGitHub 24231cdc56 Updated to compile with TD-er's update on JSON 2018-05-05 21:05:31 +02:00
TD-er 30e192f041 [JSON] Sanitize JSON value strings
May not contain newline nor "
2018-05-05 17:15:46 +02:00
Plebs 38472a3d6b new command logentry
Command:
usage: logentry,anything (including system variables, task#values with formatting, text, etc.)

Example:
logentry,S=[task#value] T=[task1#value]:

Log output:
ACT  : logentry,S=24 T=23.1
Command: logentry
2018-05-05 16:58:58 +02:00
TD-er d54af04a79 [JSON] Make proper log JSON output for log viewer 2018-05-05 16:52:55 +02:00
TD-er 056e7a7a40 [JSON] Use streaming webserver for serving JSON page
Reduces memory and load times.
2018-05-05 13:31:02 +02:00
ESPEasy release bot f69e476174 automatically updated release notes for mega-20180505 2018-05-05 04:00:07 +02:00
Gijs NoorlanderandGitHub b368252db8 Merge pull request #1371 from TD-er/bugfix/wifi_scan_hidden
[#1337]  Include hidden SSID in wifi scans
2018-05-05 00:55:55 +02:00
TD-er ea3389f792 [#1337] WiFi.isHidden() is unknown to ESP32 2018-05-05 00:55:19 +02:00
TD-er 33b8570c33 [#1337] Include hidden SSID in wifi scans
When found, they appear with "#Hidden#" in the list.
2018-05-04 23:38:48 +02:00
ZericE 76ff83e3f4 [#1356] Remove redundant call to MQTTCheck
A redundant call to MQTTcheck in runEach30Seconds was adding to the blocking issue when attempting to connect to unavailable broker.
2018-05-04 10:00:20 -07:00
mvdbro 92680c5542 Fix corruption of task settings 2018-05-04 15:43:24 +02:00
ESPEasy release bot e568bbed7c automatically updated release notes for mega-20180504 2018-05-04 04:00:10 +02:00
Gijs NoorlanderandGitHub 82bfadd77a Merge pull request #1367 from TD-er/bugfix/20180503
Bugfix/20180503
2018-05-04 00:49:02 +02:00
TD-er b636959cc7 [LWIP2] Change LWIP1.4 => LWIP2 Low Memory
Please make sure to restart PlatformIO after loading this changed ini file and do a clean build (twice???)
2018-05-04 00:42:07 +02:00
TD-er 2a1f6eebe7 [Settings] Add checks to investigate issues with overlap in settings
See #1361
2018-05-04 00:40:44 +02:00
Gijs NoorlanderandGitHub b7b8ceebcf Merge pull request #1366 from Grovkillen/fix-dropdown-a-bit
Fix dropdown a bit
2018-05-04 00:30:12 +02:00
GrovkillenandGitHub 9f6f39053e Added a break under the hamburger
to have a bit of a buffer zone. Or else you'll accidently click the "main" button....
2018-05-04 00:01:33 +02:00
GrovkillenandGitHub 8eed47393f Merge pull request #11 from letscontrolit/mega
update from master
2018-05-03 23:54:15 +02:00
TD-er cc0c2c0f8b [rules timer] revert treating the rules timer as periodical timer
May have unexpected effects, so if a more accurate timer is needed, a new timer type should be used, not setting an interval in the rules.
2018-05-03 23:13:21 +02:00
Gijs NoorlanderandGitHub 0450d8a106 Merge pull request #1352 from Grovkillen/Menu-for-phone
Dropdown menu for phone
2018-05-03 21:36:30 +02:00
Gijs NoorlanderandGitHub e96de4a988 Merge branch 'mega' into Menu-for-phone 2018-05-03 21:36:14 +02:00
Gijs NoorlanderandGitHub 28bdc37d24 Merge pull request #1364 from Grovkillen/fix-checkboxe
Fix checkboxes (#1363)
2018-05-03 21:19:05 +02:00
GrovkillenandGitHub b7ccba979c [#1363] fixed overlapping checkboxes 2018-05-03 20:35:34 +02:00
GrovkillenandGitHub 5132a318af Merge pull request #10 from letscontrolit/mega
Update from master
2018-05-03 09:45:16 +02:00
ESPEasy release bot cfd27b4918 automatically updated release notes for mega-20180503 2018-05-03 04:00:12 +02:00
Gijs NoorlanderandGitHub feba82188a Merge pull request #1359 from TD-er/bugfix/timers
Bugfix/timers
2018-05-03 00:34:25 +02:00
TD-er 1a3274d2c2 [#1353] Remove Domoticz HTTP as default controller 2018-05-03 00:32:18 +02:00
TD-er 0f04456ae6 [timers] Make rules timers more constant and MQTT reconnect less aggressive
See #1356
And #1223
2018-05-02 23:49:50 +02:00
Gijs NoorlanderandGitHub 6016e1b1d3 Merge pull request #1358 from TD-er/bugfix/issue1351_rules
[rules] Make rules start working again.
2018-05-02 23:30:07 +02:00
TD-er 39e391ca0e [rules] Make rules start working again.
See #1351
Whenever a plugin_write returns success = true, the execute command will no longer be called.
It doesn't matter whether the plugin is enabled or present.
It should only return success = true when the command was actually meant for this plugin.
2018-05-02 23:23:19 +02:00
GrovkillenandGitHub 8088ed4ed8 Added some "-" 2018-05-02 23:08:55 +02:00
GrovkillenandGitHub 13bd7ba26b Forgot extra \ for escape in code 2018-05-02 23:06:12 +02:00
GrovkillenandGitHub 3cb90939c4 BR should be \n, now fixed 2018-05-02 23:01:12 +02:00
GrovkillenandGitHub 76cddb7c71 Added break... 2018-05-02 22:56:24 +02:00
GrovkillenandGitHub 3d0f871600 If error make log show this more clear 2018-05-02 22:54:34 +02:00
GrovkillenandGitHub ffb3ee4039 Spelling correction 2018-05-02 22:33:43 +02:00
GrovkillenandGitHub 456796a87d Added dropdown for phones 2018-05-02 15:09:37 +02:00
GrovkillenandGitHub bf512f9da0 Merge pull request #9 from letscontrolit/mega
Update from master
2018-05-02 13:11:04 +02:00
GrovkillenandGitHub d5b8a36acb Web log now inside a textarea 2018-05-02 09:43:40 +02:00
GrovkillenandGitHub f09642101f Merge pull request #8 from letscontrolit/mega
Update from master
2018-05-02 08:23:46 +02:00
ESPEasy release bot cb16773128 automaticly updated release notes for mega-20180502 2018-05-02 04:00:16 +02:00
Gijs NoorlanderandGitHub 2e55b6304c Merge pull request #1348 from TD-er/bugfix/improvetimers
Bugfix/improvetimers
2018-05-02 01:33:40 +02:00
TD-er f61586ebbc [web log] Read all items from the log buffer
This is a very sub optimal implementation. Eventually it should use the streaming web TXBuffer we made. It now uses quite some memory, when called.
2018-05-02 01:19:44 +02:00
TD-er 7f385fc74a [wifi] Make retry intervals to connect increase at each attempt.
There is still an issue when the node is trying to reconnect very hard, it will not react to commands given via the serial port.
2018-05-02 01:18:05 +02:00
TD-er a579c906d5 [timers] Make timers more accurate
Previously the moment a timed function was called, the new timer was set. That would make the timer interval to be the minimum interval, with quite some margin of error.
Now the timers are at a more strict interval, unless the device cannot keep up.
2018-05-02 01:16:39 +02:00
GrovkillenandGitHub a80f3a5f0b Added div to not copy "Fetching log entries...."
Clipboard should not have the fetch info text
2018-05-01 23:27:03 +02:00
GrovkillenandGitHub 7e10fda7e5 Added javascript to handle the log entries 2018-05-01 22:57:03 +02:00
GrovkillenandGitHub 16a6135f53 Merge pull request #7 from letscontrolit/mega
update from master
2018-05-01 22:55:13 +02:00
Gijs NoorlanderandGitHub 343ea459ab Merge pull request #1343 from giig1967g/bugfix/1142
fix for #1142
2018-05-01 22:46:55 +02:00
Gijs NoorlanderandGitHub 0ddcee1f07 Merge pull request #1323 from workgroupengineering/Optimize_setSystemTimer
Optimize setSystemTimer
2018-05-01 22:39:25 +02:00
Gijs NoorlanderandGitHub 07ac4cf8cf Merge pull request #1345 from giig1967g/new/strings
Added 2 system variables
2018-05-01 22:29:23 +02:00
Gijs NoorlanderandGitHub a864aeab1e Merge pull request #1339 from Grovkillen/new-weblog
New web log
2018-05-01 22:25:39 +02:00
Gijs NoorlanderandGitHub 35a7ab94df Merge pull request #1346 from TD-er/bugfix/change_to_LWIP_140
[LWIP 1.4.0] Change to LWIP 1.4.0, to allow large http POST messages
2018-05-01 22:18:07 +02:00
TD-er 44755e83b9 [LWIP] fix ESP32 build 2018-05-01 22:04:29 +02:00
Gijs NoorlanderandGitHub f93b38624d Merge pull request #1342 from giig1967g/bugfix/1170
fix for #1170
2018-05-01 21:10:11 +02:00
TD-er c1cb7d873c [LWIP 1.4.0] Change to LWIP 1.4.0, to allow large http POST messages
See #1296
Rules got truncated when trying to save rules > 1520 Bytes.

Also added a bit more log information and some details about the used libraries in the sysinfo page and json output.
2018-05-01 21:05:50 +02:00
Plebs 62d81325b2 Added 2 system variables
Added 2 system variables

%SP% = space
%ip4% = 4th IP octet
2018-05-01 20:58:13 +02:00
Plebs 5bc2af0e4c deleted comments
deleted comments and moved success outside of the if clause.
2018-05-01 20:52:00 +02:00
Plebs bc5bf7f3f1 fix for #960
Added a new global command: TaskValueSetAndRun.

It changes the value of a task and runs it, so new value is pubished on MQTT and rules are executed.
2018-05-01 19:56:49 +02:00
Plebs 0b4013b33c fix for #1142 2018-05-01 19:51:26 +02:00
Plebs 3c3a11d77b fix for #1170
The reason is that inside PLUGIN_WRITE the variable [event->BaseVarIndex] is not set and is always = 0.
So actually this PR modifies the 1st value of task 1 and not the encoder counter.
Line 183 of P059_Encoder.ino should be removed:
UserVar[event->BaseVarIndex] = (float) event->Par1;
2018-05-01 19:46:51 +02:00
ESPEasy release bot 5876fb84af automaticly updated release notes for mega-20180501 2018-05-01 04:00:17 +02:00
GrovkillenandGitHub 25ab07a9ba Merge pull request #6 from letscontrolit/mega
update from master
2018-04-30 21:41:41 +02:00
GrovkillenandGitHub e6044bdbf8 Added log JSON 2018-04-30 21:40:35 +02:00
mvdbro 572f8bcde7 Fix broken Mini Dashboard feature 2018-04-30 14:28:25 +02:00
Saverio Cisternino c010640aa5 Optimize setSystemTimer; Removed the second "for" cycle for checking the availability of timers 2018-04-30 09:29:50 +02:00
ESPEasy release bot e60c0dc5f0 automaticly updated release notes for mega-20180430 2018-04-30 04:00:08 +02:00
Gijs NoorlanderandGitHub 4e6e31fdae Merge pull request #1335 from TD-er/bugfix/mqtt_timout
Bugfix/mqtt timout
2018-04-29 17:49:01 +02:00
TD-er 77deb3d8b3 [MQTT] Set default timeout to 10 sec, equal to default Mosquito timeout
See https://github.com/knolleary/pubsubclient/issues/239
2018-04-29 17:41:00 +02:00
TD-er 3530027864 [rules] Add log indicating POST request for update rules
There is something strange going on, POST variables may be empty.
2018-04-29 17:40:07 +02:00
Gijs NoorlanderandGitHub 07bfec4234 Merge pull request #1334 from TD-er/bugfix/wifi_connected_check
[wifi] Use internal ESPeasy state to check connected status
2018-04-29 14:59:28 +02:00
TD-er 3476792c58 [wifi] Use internal ESPeasy state to check connected status 2018-04-29 14:58:50 +02:00
Gijs NoorlanderandGitHub 45afaf8d3f Merge pull request #1333 from TD-er/bugfix/displayNamesInLog
[wifi] Do not rely on WiFi.status() and better log of status
2018-04-29 13:45:58 +02:00
TD-er 9084a5542b [wifi] Do not rely on WiFi.status() and better log of status
`WiFi.status() == WL_CONNECTED` may not always be correct.
For ESP82xx check the SDK status.
2018-04-29 13:27:32 +02:00
mvdbro 4ac330ebf6 Changed plugin call debug timers 2018-04-29 11:51:46 +02:00
ESPEasy release bot 49a0476487 automaticly updated release notes for mega-20180429 2018-04-29 04:00:07 +02:00
Gijs NoorlanderandGitHub f606d2c55d Merge pull request #1331 from TD-er/bugfix/ChangeReconnect
[wifi] Force wifi reconnect at lots of MQTT failed connects.
2018-04-29 00:53:27 +02:00
TD-er 4f9a383d93 [wifi] Force wifi reconnect at lots of MQTT failed connects. 2018-04-29 00:52:41 +02:00
Gijs NoorlanderandGitHub d4d0ee3b30 Merge pull request #1328 from TD-er/bugfix/set_static_IP_after_reconnect
[wifi] Setup static IP config after connecting to wifi.
2018-04-28 23:57:42 +02:00
TD-er 9705702f4c [wifi] Added connectionCheckHandler() to force reconnect when needed
Example taken from [this issue discussion](https://github.com/esp8266/Arduino/issues/4445)
2018-04-28 23:42:34 +02:00
TD-er c3e015342c [wifi] ESP32 does not know wifi_station_get_connect_status() 2018-04-28 23:10:24 +02:00
TD-er 209484554e [wifi] Add wifi status log (Debug More) and DHCP/Static config to info page 2018-04-28 23:06:16 +02:00
TD-er 27377ab3ed [wifi] Show number of reconnects in the sysinfo 2018-04-28 19:08:07 +02:00
TD-er 7055d24693 [wifi] Set static IP config before and after connect
Apparently static IP needs to have IP config set before and after connection has been made.
The beginning is needed to make sure no DHCP client is started.
The second one is needed to make sure the wifi status is correct in the core library.
2018-04-28 17:39:47 +02:00
TD-er 62e6317a23 [wifi] Setup static IP config after connecting to wifi. 2018-04-28 15:45:59 +02:00
ESPEasy release bot 29f89b687d automaticly updated release notes for mega-20180428 2018-04-28 04:00:15 +02:00
Gijs NoorlanderandGitHub 697d20a028 Merge pull request #1325 from TD-er/bugfix/wifi_stability
Known issue:   With NTP enabled, it may be possible the connection is not fully operational.
2018-04-28 00:50:52 +02:00
TD-er e9df0e75b9 [Wifi] Avoid doing network communications when not connected.
This may disrupt the network stack.
2018-04-28 00:10:01 +02:00
TD-er f23f49931b [wifi] Just disconnect when DNS lookup is not possible
This may prevent issues with hostname resolving to 0.0.0.0.
2018-04-27 23:45:31 +02:00
TD-er 4af29c405b [PlatformIO] Updated core to 2.4.1
```
[core_2_4_1]
platform         = espressif8266@1.7.0

[common]
build_flags      = -D BUILD_GIT='"${env.TRAVIS_TAG}"'  ; ${compiler_warnings.build_flags}
                   -D PIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH
```
2018-04-27 21:45:30 +02:00
ESPEasy release bot d780f1a07f automaticly updated release notes for mega-20180426 2018-04-26 04:00:14 +02:00
TD-er f9be283cb7 [wifi] Attempt to make event based wifi simpler
With static IP, the connection is lost frequently.
2018-04-26 02:04:18 +02:00
Gijs NoorlanderandGitHub 3f1cda7b81 Change use of core 2_4_0 to 2_3_0 2018-04-25 16:05:05 +02:00
ESPEasy release bot 2fd226d6bd automaticly updated release notes for mega-20180425 2018-04-25 04:00:08 +02:00
Gijs NoorlanderandGitHub 3d1edcf33e Merge pull request #1311 from TD-er/bugfix/more_active_reconnect
[wifi] More active reconnect to wifi when disconnected
2018-04-25 00:44:30 +02:00
TD-er cc740b46f1 [wifi] More active reconnect to wifi when disconnected
And also set ESP32 to a fixed version, since latest versions may cause lots of reboots/bootloops.
2018-04-25 00:43:05 +02:00
Gijs NoorlanderandGitHub e829058c92 Merge pull request #1310 from giig1967g/mega
Fix another bug in LCD plugin
2018-04-25 00:06:03 +02:00
Plebs 685438c35d Fix another bug in LCD plugin
There was another part in the WRITE section where was trying to read the Settings. Fixed with a global variable.
2018-04-24 23:52:22 +02:00
Gijs NoorlanderandGitHub f8a4ef389f Merge pull request #1309 from giig1967g/mega
Adding 3 new http commands: taskrun, taskvalueset and rules
2018-04-24 23:09:43 +02:00
Gijs NoorlanderandGitHub 7e9c31131c Merge pull request #1308 from TD-er/merge/modbus_1128
[Modbus] PR #1128 made by @s0170071
2018-04-24 22:41:07 +02:00
Plebs 99150c4214 Adding 3 new http commands: taskrun, taskvalueset and rules
Usage:
control?cmd=taskrun,n
control?cmd=taskvalueset,t,v,n
control?cmd=rules,n (0 or 1 to activate or deactivate rules
2018-04-24 22:28:18 +02:00
TD-er ec7e6f80b0 [Modbus] PR #1128 made by @s0170071
Was long overdue to merge, a simple re-do to include the Modbus.ino to allow development of Modbus plugins.
2018-04-24 22:21:50 +02:00
Gijs NoorlanderandGitHub dada682ed6 Merge pull request #1307 from giig1967g/mega
Fix for #1300
2018-04-24 21:40:52 +02:00
GrovkillenandGitHub ab31b33a2c Merge pull request #1305 from Grovkillen/added-"addcopybutton"
Added "addcopybutton"
2018-04-24 12:13:32 +02:00
GrovkillenandGitHub 621585901f Added new lines if BR + delimiter if wanted 2018-04-24 11:09:51 +02:00
ESPEasy release bot eaaf1fe888 automaticly updated release notes for mega-20180424 2018-04-24 04:00:13 +02:00
GrovkillenandGitHub 41e4705198 Merge pull request #5 from Grovkillen/mega
Added copy to clipboard on log page
2018-04-23 21:28:35 +02:00
GrovkillenandGitHub c35fe3d500 Added copy to clipboard on log page
The <br> will work as new lines if pasted into issue template but we might add a conversion within the javascript code. I leave as is for now.
2018-04-23 21:27:36 +02:00
GrovkillenandGitHub e2da8ecbb9 Made copy to clipboard JavaScript based instead 2018-04-23 21:15:20 +02:00
Plebs 3dad26a58a Fix for #1300
LCD 1602 and 2004 fixed.
2018-04-23 19:19:08 +02:00
GrovkillenandGitHub ae930a1d36 Added a void addCopyButton
For general use...
2018-04-23 15:47:02 +02:00
GrovkillenandGitHub 45e980beda Merge pull request #4 from letscontrolit/mega
Update from master
2018-04-23 09:23:52 +02:00
GrovkillenandGitHub 8723e177df Added note to self compilers
Many self compilers are reporting stuff, it's near to impossible to also support these since the different environments are so hard to set up for us developers to test.
2018-04-23 08:34:14 +02:00
ESPEasy release bot 8454994023 automaticly updated release notes for mega-20180423 2018-04-23 04:00:10 +02:00
Gijs NoorlanderandGitHub 50732aed8a Merge pull request #1295 from TD-er/bugfix/delay_between_connection_attempts
[wifi] Add delay between connection attempts
2018-04-22 12:28:09 +02:00
TD-er f2888951dc [wifi] Add delay between connection attempts
Accesspoints cannot handle lots of (immediate) reconnect attempts.
Added a delay of up-to a second between new attempts.
2018-04-22 12:27:24 +02:00
Gijs NoorlanderandGitHub 56ac640986 Merge pull request #1294 from giig1967g/mega
Fixing #1289 for backwards compatibility
2018-04-22 11:52:53 +02:00
Plebs df2d7be30b Fixing #1289 for backwards compatibility
I noticed that my latest commit introduced a small issue with Transformations:
The previous transformations were right justified. The new ones are left justified.
To maintain backwards compatibility I have modified the code.
2018-04-22 11:49:51 +02:00
ESPEasy release bot 9e06cf4dc7 automaticly updated release notes for mega-20180422 2018-04-22 04:00:09 +02:00
Gijs NoorlanderandGitHub cd27339b8e Merge pull request #1293 from TD-er/bugfix/remove_crc_from_config_file
[issue #1292] Remove CRC from settings, init settings and wifi fixes
2018-04-22 02:02:23 +02:00
TD-er ec38ba1fb7 [issue #1292] Remove CRC from settings, init settings and wifi fixes
- Reset wifi when DNS lookup returns *.0.0.0 (NTP lookup sometimes returns like these)
- Accept Wifi events out of order.
- Remove CRC from settings struct
- Patch settings with last few added items initialized
- Changed red question mark to white questionmark, for links to wiki.
2018-04-22 02:01:10 +02:00
Gijs NoorlanderandGitHub b8fa42925f Merge pull request #1289 from giig1967g/mega
Syntax: [task#value#transformation#justification]
2018-04-21 14:21:05 +02:00
Plebs 4169ca0ee8 Code changed as per TD-er suggestions 2018-04-21 09:53:19 +02:00
ESPEasy release bot 578477bf6d automaticly updated release notes for mega-20180421 2018-04-21 04:00:08 +02:00
Gijs NoorlanderandGitHub 0803e946b0 Merge pull request #1290 from TD-er/feature/P076_SonoffPOW
[Sonoff Pow] P076 - Add support for HLW8012 by @papperone
2018-04-21 01:42:38 +02:00
TD-er 06001bbc94 [Sonoff POW] Set some proper defaults for the Sonoff POW
I2C pins may conflict with the used energy sensor.
Also the status LED is set to a non standard pin.
2018-04-21 01:24:48 +02:00
TD-er f171d5b211 [Sonoff POW] Change Plugin ID to 76
Nextion was added as P075
2018-04-21 00:18:05 +02:00
TD-er 360b552424 [Sonoff Pow] Add support for HLW8012 2018-04-21 00:17:52 +02:00
Unknown d9597febf8 Merge remote-tracking branch 'papperone/mega' into merge/papperone
Remove edits on P073 to separate PRs
2018-04-21 00:17:43 +02:00
TD-er 6aa21ea6f8 [Sonoff Pow] Add support for HLW8012 2018-04-21 00:17:33 +02:00
Unknown b1de652b62 Merge remote-tracking branch 'papperone/mega' into merge/papperone
Remove edits on P073 to separate PRs
2018-04-21 00:17:22 +02:00
Plebs 5c3bf9e894 Syntax: [task#value#transformation#justification]
Transformations:
Special:
!: negate (only for 0 or 1)
R: RIGHT JUSTIFY

V: value
O: ON/OFF
C: OPEN/CLOSE
U: UP/DOWN
u: U/D
Y: YES/NO
y: Y/N
X: O/X
I: IN/OUT
Z: 0/1
1: 1 decimal
2: 2 decimals
3: 3 decimals
Dx.y: x digits + y decimals
F: floor
E: ceiling

Justification:
P: prefix spaces
S: suffix spaces
2018-04-20 23:21:17 +02:00
Gijs NoorlanderandGitHub 0acd7b0e70 Merge pull request #1288 from TD-er/bugfix/InitStaticIP_before_connect
[WiFi] Init static IP before connect to wifi
2018-04-20 22:08:22 +02:00
TD-er 8bbaffdeb0 [info] Add more build related info to the log and wifi info link to wiki
Add core information to the log and info page
Add "more info" button to main page
Add question mark link button to sysinfo section describing wifi. This links to the wifi page on the wiki.
2018-04-20 21:54:40 +02:00
TD-er 19e86e7df3 [Toast message] Change "Settings saved" to "Submitted"
Message is sent to provide feedback on pressing the 'submit' button.
At that moment, it is not yet clear the data will be saved successful.
To prevent "Settings Saved" and "Error writing to..." to show on the same page, this text was changed.
2018-04-20 20:55:17 +02:00
TD-er 311d6f01df [WiFi] Init static IP before connect to wifi
As suggested by @Feuerreiter  [here](https://github.com/letscontrolit/ESPEasy/issues/1255#issuecomment-383094333)
2018-04-20 20:37:38 +02:00
Gijs NoorlanderandGitHub 61f47d5ffc Merge pull request #1287 from workgroupengineering/feature/elseif
[Feature] Allow elseif
2018-04-20 20:25:16 +02:00
Gijs NoorlanderandGitHub 72f0f95471 Merge pull request #1285 from Grovkillen/toast-mes
Toast message added
2018-04-20 20:24:56 +02:00
Gijs NoorlanderandGitHub 4e33472d81 Merge pull request #1246 from workgroupengineering/feature/timer_pause_resume
[Feature] Timers Pause and Resume
2018-04-20 20:24:33 +02:00
Saverio Cisternino 69c4f970a9 Add debug info 2018-04-20 16:46:04 +02:00
GrovkillenandGitHub 28866bd08c Removed fade in of body added toast message! 2018-04-20 13:01:14 +02:00
GrovkillenandGitHub 0f93e3ed3c Merge pull request #3 from letscontrolit/mega
Update
2018-04-20 12:59:38 +02:00
Saverio Cisternino 59a82ee17f Add support at elseif statment 2018-04-20 11:36:12 +02:00
Saverio Cisternino e8af00f99f Add Trigger Rules#TimerPause= and Rules#TimerResume= 2018-04-20 11:33:05 +02:00
Saverio Cisternino ad4b0f8008 Add Commands timerpause and timerresume 2018-04-20 11:33:05 +02:00
ESPEasy release bot ae2a0b5208 automaticly updated release notes for mega-20180420 2018-04-20 04:00:09 +02:00
Gijs NoorlanderandGitHub 785266bd39 Merge pull request #1283 from TD-er/bugfix/webserver_restart_connection_change
Bugfix/webserver restart connection change
2018-04-20 00:38:10 +02:00
TD-er 2e63e764b2 [wifi] Create event 'gotIP' after processing 'connected' event
And stop webserver when trying to reconnect to WiFi
2018-04-20 00:35:09 +02:00
TD-er f7eaecf5d4 [log] Make web log 30 lines for ESP32 2018-04-20 00:01:52 +02:00
TD-er 1bee80d0ec [wifi] Restart webserver when connection changes. 2018-04-19 23:43:30 +02:00
GrovkillenandGitHub 504a9aa295 Added extra breaks below "back to setup" button 2018-04-19 15:21:24 +02:00
GrovkillenandGitHub 059530a6b7 Merge pull request #1277 from Grovkillen/Update-GUI
Update GUI a bit more
2018-04-19 11:53:22 +02:00
Gijs NoorlanderandGitHub 5b83c634e9 Merge pull request #1278 from TD-er/bugfix/set_static_at_change_mode
[Static IP] Make sure static mode is set correct always
2018-04-19 11:08:09 +02:00
TD-er ff7ab3837e [Static IP] Make sure static mode is set correct always
Also when changing settings from static to DHCP and vice verse.
2018-04-19 11:07:29 +02:00
GrovkillenandGitHub badad651de "bodymenu" was accidentally copied to all body 2018-04-19 11:01:02 +02:00
GrovkillenandGitHub 8a767b77e8 Added small fade in (0.5s)
To make user understand that submit have been clicked (web interface is so fast now).
2018-04-19 10:38:41 +02:00
GrovkillenandGitHub 072a1a4080 Merge pull request #2 from letscontrolit/mega
update
2018-04-19 10:37:20 +02:00
ESPEasy release bot 394e4b095d automaticly updated release notes for mega-20180419 2018-04-19 04:00:17 +02:00
Gijs NoorlanderandGitHub ae1e62c8c6 Merge pull request #1276 from TD-er/bugfix/pr_1257
Bugfix/pr 1257
2018-04-19 01:25:45 +02:00
TD-er 0efb7823d7 [ESP32] Add Generic info plugin 2018-04-19 01:24:40 +02:00
TD-er 3ee7d4d04e [PR #1257] Make it compile again 2018-04-19 01:24:14 +02:00
stefanandTD-er f2d3a5d222 Changes for use of plugin sets
Remove ifdefs for PLUGIN_BUILD_TESTING to make use of USES_ defines and define_plugin_defs.h
2018-04-19 00:42:56 +02:00
Gijs NoorlanderandGitHub 904a5cc612 Merge pull request #1267 from sentinel073/plugin_template_issue_1211
Issue #1211: Plugin template file and hints on writing new plugins
2018-04-19 00:40:37 +02:00
Gijs NoorlanderandGitHub 5241f93f5f Merge pull request #1268 from hansrune/mega
Implemented syslog facilities and levels
2018-04-19 00:38:37 +02:00
Gijs NoorlanderandGitHub 6d33d21f70 Merge pull request #1266 from Grovkillen/CSS-the-reset-of-the-gui
CSS the rest of the GUI
2018-04-19 00:37:56 +02:00
Gijs NoorlanderandGitHub 045e2ef9f4 Merge pull request #1275 from TD-er/bugfix/Static_ip
[Static IP] Work-around for set _use_static_ip
2018-04-19 00:37:32 +02:00
TD-er 527267de62 [Static IP] Work-around for set _use_static_ip
See [this bug report](https://github.com/esp8266/Arduino/issues/4114), which is not fixed in 2.4.0.

This work-around will make sure no dhcp-client will be started when connecting to a network.
The active DHCP client could result in IP conflicts, difficulty in reconnect and other strange issues.
2018-04-19 00:13:53 +02:00
sentinel073 29c01eeb38 Issue #1211: Plugin template file and hints on writing new plugins
Added review comments
2018-04-18 13:01:49 +03:00
GrovkillenandGitHub 1c5a1d3656 Removed unused row on hardware settings page 2018-04-17 17:31:28 +02:00
GrovkillenandGitHub d6fe76750a Added CSS radio buttons to WiFi setup wizard 2018-04-17 17:18:28 +02:00
Hans-Rune Bue 1889c0f9e5 Implemented syslog facilities and levels
Sending LOG_LEVEL_ERROR as syslog error, LOG_LEVEL_INFO as syslog notice, and everything else as syslog deug
Also added Settings.Syslogfacility setting to be able to choose kernel (still default), user, daemon, message and local0-local7
2018-04-17 12:43:52 +02:00
sentinel073 ebc16044e2 Issue #1211: Plugin template file and hints on writing new plugins 2018-04-17 11:57:37 +03:00
GrovkillenandGitHub 5695ea8fa8 Updated the input, select, textareas with CSS 2018-04-17 10:50:52 +02:00
GrovkillenandGitHub 16cc9aaa6b Merge pull request #1 from letscontrolit/mega
Updated from main
2018-04-17 10:48:37 +02:00
ESPEasy release bot 7f393af2a0 automaticly updated release notes for mega-20180417 2018-04-17 04:00:09 +02:00
Gijs NoorlanderandGitHub 3e22607276 Merge pull request #1264 from TD-er/feature/nextion_port_from_playground
Feature/nextion port from playground
2018-04-17 01:35:06 +02:00
TD-er 4de720382d [wifi] Fix build error for ESP32
Shared function was declared within #ifdef scope.
2018-04-17 01:34:07 +02:00
TD-er a718572688 [P075] Nextion plugin (testing)
Added Nextion plugin for testing from the Playground.
It is not yet tested on real hardware, but it has been in development for a while on the forum and playground.
Also requested in issue #1256 and by several others.
2018-04-17 01:29:31 +02:00
Unknown 2d66c9fefa [Nextion] Initial support for Nextion displays
Code taken from playground P117 and added minimal changes.
Still need some work to check and test with real display.
Not tested yet, myself.
2018-04-16 23:47:12 +02:00
Gijs NoorlanderandGitHub de51a130b3 Merge pull request #1262 from TD-er/bugfix/json_oled
[issue #1260] parentheses error on the json page
2018-04-16 23:28:53 +02:00
TD-er a8020c9011 [issue #1260] parentheses error on the json page 2018-04-16 23:28:02 +02:00
Gijs NoorlanderandGitHub a2cbc6d474 Merge pull request #1261 from TD-er/bugfix/fix_disconnects_static_ip
[wifi] Fix wifi reconnects with static IP
2018-04-16 23:03:05 +02:00
TD-er ea5c99431c [NTP] Add more information in the log when connecting to NTP server fail 2018-04-16 22:49:07 +02:00
TD-er 6f68d87f50 [wifi] Fix wifi reconnects with static IP
When a fixed IP setting is used, there will be no "Got IP" event, which will lead to a timeout and thus reconnect.
As a fix, the "Connected" event will also act like when a "Got IP" event was received when configured to use static IP.
2018-04-16 22:48:23 +02:00
Gijs NoorlanderandGitHub 4aa9c5e0ba Merge pull request #1259 from Grovkillen/Updating-gui
Updating gui (max width etc)
2018-04-16 20:49:07 +02:00
GrovkillenandGitHub 7e4666afed "Ctr (IDX)" was accidentally removed, now added 2018-04-16 17:23:37 +02:00
GrovkillenandGitHub 7651a07efc Added max widths for inputs 2018-04-16 17:02:31 +02:00
GrovkillenandGitHub f961a9f331 Made IDX column wider (device list) 2018-04-16 16:37:39 +02:00
GrovkillenandGitHub bb49cbdc89 Added number input to CSS (width 100px) 2018-04-16 16:34:00 +02:00
GrovkillenandGitHub 7fe1b41ea5 Made input type password part of "wide" 2018-04-16 16:26:18 +02:00
GrovkillenandGitHub 358e9f1e24 Change enable "off" to a nicer X 2018-04-16 16:20:14 +02:00
GrovkillenandGitHub 8f77ffc871 Made controller symbols a bit bigger (1)(2)(3) 2018-04-16 16:09:14 +02:00
GrovkillenandGitHub 60faa58894 Moved help button on hardware page
Moved it up (from right of the submit button which wasn't a good place for it)
2018-04-16 14:40:52 +02:00
GrovkillenandGitHub aba095b25d Moved help button for sleep 2018-04-16 14:00:17 +02:00
GrovkillenandGitHub 617ebe96de Re-arranged Rules page
Button moved down
Edit text removed
2018-04-16 13:45:57 +02:00
GrovkillenandGitHub a1bf42dde1 Put borders around checkboxes
Suggested here: #1253
2018-04-16 13:20:04 +02:00
ESPEasy release bot b0b83543eb automaticly updated release notes for mega-20180416 2018-04-16 04:00:09 +02:00
Gijs NoorlanderandGitHub b97be9c718 Merge pull request #1250 from TD-er/bugfix/wifi_start_ap_mode
[wifi] Prevent starting AP+STA mode with correct settings
2018-04-16 00:51:04 +02:00
TD-er 33831b072b [info] Added FW information to help diagnose issues
A lot of issue reports do not include information about the used version of the core libraries and 'normal', 'dev', etc. 
Since this information helps narrowing down the possible causes of the reported issues, it is best to add them in the general log.
2018-04-16 00:49:17 +02:00
TD-er a5f94298d8 [wifi] Proper log of static IP configuration 2018-04-15 14:41:41 +02:00
TD-er d0dc959d31 [Wifi] force STA mode at boot
I finally have one node acting as described by others and this one reported a disconnect before a connect attempt was made.

Now forcing the wifi in STA mode, should resolve this issue.
2018-04-15 14:10:02 +02:00
TD-er 644aa2f65e [wifi] Prevent starting AP+STA mode with correct settings
WiFi persistent settings were disabled after initialisation of the event handler.
This allowed the firmware to start WiFi connection with settings stored in the flash (not our settings, the settings kept by the core library). If these fail, then a connection failed event would occur before a connect attempt was started from ESPeasy, which would lead to strange results on some nodes while others work just fine.
2018-04-15 12:05:07 +02:00
ESPEasy release bot e457fe7597 automaticly updated release notes for mega-20180415 2018-04-15 04:00:08 +02:00
Gijs NoorlanderandGitHub dcd409e9d9 Merge pull request #1249 from TD-er/bugfix/Webserver_appendingStrings
A lot of functions in Webserver.ino were just appending to a ever increasing string. These strings were eventually sent to TXBuffer of the Webinterface.
So why not directly send them to the streaming buffer and thus reduce memory usage and gain speed.
2018-04-15 02:06:34 +02:00
TD-er c227c13ba2 [Merge] Easier to merge, rebased on Mega branch. 2018-04-15 01:55:22 +02:00
TD-er c64566ce49 [PR #1248] Fixed textarea sizes
See #1248
2018-04-15 01:45:52 +02:00
TD-er a9366c8f23 [PR #1247 ] Merged PR into the refactoring of Webserver 2018-04-15 01:45:52 +02:00
TD-er bbf470c61d [WebServer] Cleanup of all functions appending to a big string
A lot of functions in Webserver.ino were just appending to a ever increasing string. These strings were eventually sent to TXBuffer of the Webinterface.
So why not directly send them to the streaming buffer and thus reduce memory usage and gain speed.
2018-04-15 01:45:30 +02:00
GrovkillenandGitHub 1c1211c4f3 Bumped delay timer for MQTT pub 10mSec
Tests showed that instead of publishing "now" a 10mSec delay made the unit respond better and publish faster.
2018-04-15 00:50:30 +02:00
Gijs NoorlanderandGitHub 7da0bc4a44 Merge pull request #1247 from Grovkillen/Fix-some-html
Fix some html
2018-04-14 21:19:52 +02:00
GrovkillenandGitHub 91a0c51ff8 Made addFormSeparator function a lot cleaner
Thanks to da man @TD-er
2018-04-14 21:15:33 +02:00
GrovkillenandGitHub 0aa523a329 Updated some more stuff
Made the call for the function work without the extra (not used) "extra text"... it's still in the base function for future use.
2018-04-14 20:55:52 +02:00
Gijs NoorlanderandGitHub cac7275eb9 Merge pull request #1245 from susisstrolch/ds18b20
ignore power-on reset value (85.0 °C)
2018-04-14 17:29:50 +02:00
Susis Strolch c705fdfff0 add missing &amp; around value 2018-04-14 15:51:09 +02:00
Susis Strolch 1fc876cfea add missing &amp; around value, add README 2018-04-14 15:44:20 +02:00
Susis Strolch 109eaf7d25 DS_readTemp: handle power-on reset value
return false if DS_readTemp is power-on reset value
(0xaa for DS1820|DS18B20, 0x550 for DS18B20|DS1825|DS1822)
2018-04-14 15:38:11 +02:00
GrovkillenandGitHub 9ba15f2c19 Added column width for separator...
Now variable
2018-04-14 13:51:06 +02:00
GrovkillenandGitHub 1c07d787c5 Fixed missed update. 2018-04-14 13:45:13 +02:00
GrovkillenandGitHub b7ae2ea5fe Made checkmarks CSS
The &nbsp; is made to be able to have text after the custom checkbox... the text itself is not yet styled since we're not using labels like that yet.
2018-04-14 13:40:49 +02:00
Gijs NoorlanderandGitHub b75bb204e3 Merge pull request #1209 from nunofgs/enhancement/replace-ultrasonic-plugin-with-newping-lib
Replace ultrasonic plugin with NewPing lib
2018-04-14 13:11:14 +02:00
Gijs NoorlanderandGitHub bfc8006205 Merge pull request #1242 from susisstrolch/stringConverter
system variables %sysheap%, %syssec_d
2018-04-14 13:08:28 +02:00
Gijs NoorlanderandGitHub aab2e4a442 Added C013 2018-04-14 12:56:41 +02:00
Gijs NoorlanderandGitHub abfdfe014e Merge pull request #1243 from susisstrolch/defineUses
add missing USES_XXX to _C*.ino, _N*.ino
2018-04-14 12:53:42 +02:00
Susis Strolch f82040d2ef ignore power-on reset value (85.0 °C) 2018-04-14 12:31:17 +02:00
Susis Strolch 56f2cf3121 system variables %sysheap%, %syssec_d
- %sysheap%: free heap memory
- %syssec_d%: seconds since midnight
2018-04-14 12:03:23 +02:00
Susis Strolch 21011c548e GIT hooks: post-merge, post-commit, post-checkout
scripts intended as local git hooks.
post-merge:
- create symlink ESPEasy - if necessary
- add "#define BUILD_GIT <git revision>" to Custom.h
- add "#define USE_CUSTOM_H" to src/ESPEasy-Globals.h

post-commit:
- add "#define BUILD_GIT <git revision>" to Custom.h

post-checkout:
- on branch checkout also add "#define BUILD_GIT <git revision>"
2018-04-14 11:28:05 +02:00
Susis Strolch 6349f07d1a add missing USES_XXX to _C*.ino, _N*.ino 2018-04-14 10:44:25 +02:00
GrovkillenandGitHub 1b44559d3e Merge pull request #2 from letscontrolit/mega
Update source from MAIN
2018-04-14 08:57:26 +02:00
ESPEasy release bot a151e60755 automaticly updated release notes for mega-20180414 2018-04-14 04:00:08 +02:00
Gijs NoorlanderandGitHub ce11c84e74 Merge pull request #1186 from linuxnico/mega
add ds1822 definition to ds_read_temp function
2018-04-14 00:13:39 +02:00
Gijs NoorlanderandGitHub 9808bf86c4 Merge pull request #1078 from GHolli/mega
Sensor MH-Z19: Fixing offsets for the detection range setting command
2018-04-14 00:13:04 +02:00
Gijs NoorlanderandGitHub cfae636e55 Merge pull request #1240 from TD-er/feature/bssid_channel_variables
[issue #1239] %bssid% and %wi_ch% added as variables
2018-04-14 00:09:23 +02:00
Gijs NoorlanderandGitHub ebaaf50df6 Merge pull request #1230 from Grovkillen/Fix-nomenclature-for-delay/interval
Renamed delay to interval/time for better understanding
2018-04-14 00:09:09 +02:00
Gijs NoorlanderandGitHub 5c0be9e89f Merge pull request #1193 from clumsy-stefan/patch-1
_P015_TSL2561 added Broadband and IR Values
2018-04-14 00:07:32 +02:00
Gijs NoorlanderandGitHub 36468663f7 Merge pull request #1210 from giig1967g/mega
Fixes for #1208 and partial #1196
2018-04-14 00:05:36 +02:00
TD-er fba32608ee [issue #1239] %bssid% and %wi_ch% added as variables
See #1239
2018-04-13 23:47:08 +02:00
GrovkillenandGitHub 06848e50c3 Fixed main page!
Table was messed up... also update other tables
2018-04-13 23:46:45 +02:00
GrovkillenandGitHub 879d0d4916 Added better(?) format for tables
Fixed "normal" and "multirow" table css and made some column widths fixed.
2018-04-13 15:47:13 +02:00
ESPEasy release bot d083a58cd7 automaticly updated release notes for mega-20180413 2018-04-13 04:00:09 +02:00
Gijs NoorlanderandGitHub b1e9ff9fdc Merge pull request #1234 from TD-er/bugfix/Wifi_connection_issues
[wifi] Event based wifi, fix set AP and crash on start
2018-04-13 01:51:45 +02:00
TD-er 304280f415 [wifi] Event based wifi, fix set AP and crash on start
The settings had 2 new values which would be overwriten by the checksum and there was still some issue about when to save the settings.

Also added a check to only save changed settings.

Known issue: 
Sometimes after initial setup of wifi credentials, it is best to perform a reset.
2018-04-13 01:48:22 +02:00
GrovkillenandGitHub 2c8ca1421f Removed the serial print "done." 2018-04-12 09:55:11 +02:00
GrovkillenandGitHub 3ce0fb9f75 Merge branch 'mega' into Fix-nomenclature-for-delay/interval 2018-04-12 09:28:48 +02:00
ESPEasy release bot 8a71d2abd6 automaticly updated release notes for mega-20180412 2018-04-12 04:00:14 +02:00
Gijs NoorlanderandGitHub 1b174f4eac Merge pull request #1224 from flexiti/mega
ESP32 cpu speed and Id
2018-04-12 01:25:45 +02:00
Gijs NoorlanderandGitHub f1d18c7b41 Merge pull request #1220 from TD-er/bugfix/SoftAP_event_based_wifi
[issue #1215] Cannot login to accesspoint on new install
2018-04-12 01:22:46 +02:00
TD-er 204d4607ba Merge remote-tracking branch 'upstream/mega' into bugfix/SoftAP_event_based_wifi 2018-04-12 01:12:28 +02:00
TD-er 51f7ce0cb6 [wifi] Event based wifi, improve scan information. 2018-04-12 01:07:39 +02:00
Nuno Sousa 8f73deb133 Replace ultrasonic plugin with NewPing lib 2018-04-11 23:26:58 +01:00
Gijs NoorlanderandGitHub 1d4147309c [MQTT] Process MQTT loop on publish
As [discussed here](https://github.com/letscontrolit/ESPEasy/issues/1228#issuecomment-380420609).
2018-04-11 15:29:49 +02:00
mvdbro a68e4c1456 Merge branch 'mega' of https://github.com/letscontrolit/ESPEasy into mega 2018-04-11 14:57:22 +02:00
mvdbro 2ee51363dd Reboot/Reset pin, build 20101 patch 2018-04-11 14:57:12 +02:00
TD-er 172eb37b5b [wifi] Fix wifi AP setup mode for ESP32. 2018-04-11 01:24:34 +02:00
GrovkillenandGitHub 68e1d8ea69 Added RSSI, BSSID, Channel to WifiScan/Setup
And also delay is now renamed interval.
2018-04-10 15:47:59 +02:00
GrovkillenandGitHub ac8e8db0e7 Merge pull request #1 from letscontrolit/mega
Update
2018-04-10 14:24:17 +02:00
ESPEasy release bot d72bf9b76c automaticly updated release notes for mega-20180410 2018-04-10 04:00:21 +02:00
GeraldandGitHub 6d3f535d16 Merge pull request #3 from letscontrolit/mega
Downstream updates from head fork.
2018-04-09 21:39:15 +02:00
GrovkillenandGitHub 0709763f3a Update issue_template.md
`YOUR TEXT GOES HERE` added
2018-04-09 13:09:59 +02:00
GrovkillenandGitHub 538d843643 Update issue_template.md
Rearranged the topics...
2018-04-09 13:07:56 +02:00
GrovkillenandGitHub 2339ee928c Update issue_template.md
Added code format
2018-04-09 13:05:55 +02:00
GrovkillenandGitHub 9550b951d5 Update issue_template.md
Added a "Summarize" topic
2018-04-09 12:55:43 +02:00
GrovkillenandGitHub 0491af8a2f Added comments that will not show up on issues
Many users forget to "clean" the template from unnecessary text... these are now automatically hidden.
2018-04-09 12:53:05 +02:00
ESPEasy release bot 806a2757b2 automaticly updated release notes for mega-20180409 2018-04-09 04:00:13 +02:00
TD-er 3931b71d00 Merge branch 'mega' into bugfix/SoftAP_event_based_wifi 2018-04-09 00:17:48 +02:00
TD-er af0c3d5f62 [wifi] Make it work for ESP32 again 2018-04-08 23:50:07 +02:00
mvdbro c7a6ca4555 Both reset/factoryreset option 2018-04-08 17:05:59 +02:00
mvdbro 4a01e2eb49 Factory Reset (not enabled yet) 2018-04-08 08:27:25 +02:00
TD-er d6ff20b35d [WiFi] Event based wifi, now AP mode works
It appeared to be related to the core 2.3.0 version. The 2.4.0 does just work. Also changed a number of other things to improve stability.
2018-04-08 00:34:34 +02:00
ESPEasy release bot 0ada9aa105 automaticly updated release notes for mega-20180407 2018-04-07 04:00:12 +02:00
Holli 6b04539571 Disable detection range commands by default. 2018-04-06 18:40:08 +02:00
Plebs 9380ec13dc Added #I
#I: IN/OUT
2018-04-06 12:41:00 +02:00
GrovkillenandGitHub ae946c27c0 Fixed clickable link www.letscontrolit.com (#1192) 2018-04-06 10:02:36 +02:00
Plebs 86cf00759f added more formats
#X
#y
#Z
2018-04-06 08:38:26 +02:00
Plebs 0eb5f55d63 new #formats
Hi, here the new formats:
#O: ON/OFF
#C: Open/Close
#U: UP/Down
#Y: YES/NO
#D: converto to nearest integer
#F: convert to floor
#E: convert to ceiling
2018-04-05 23:39:54 +02:00
flexitiandGitHub f27d2aa7eb ESP CPU speed and ID 2018-04-05 15:09:24 +02:00
flexitiandGitHub 2d3285aaaf Merge pull request #1 from letscontrolit/mega
update
2018-04-05 15:05:25 +02:00
ESPEasy release bot 5bd2532853 automaticly updated release notes for mega-20180405 2018-04-05 04:00:10 +02:00
Plebs 765c56ccef modified float() call 2018-04-05 00:20:38 +02:00
mvdbro 4c755d83a6 ESP32 RTOS 10 per second
Run 10 per seconds call independent from main loop
2018-04-04 21:55:50 +02:00
mvdbro 1b9e1b92aa ESP32 RTOS config setting 2018-04-04 12:32:17 +02:00
Gijs NoorlanderandGitHub a4c73cc91e Merge pull request #1175 from Grovkillen/Fix-parsing-structure-for-JSON-+-upload-file-filter
Updated JSON path for sensor values and names
2018-04-04 10:06:17 +02:00
Gijs NoorlanderandGitHub 736fe2111a Merge pull request #1218 from soif/Fix/PioConfTypo
Unwanted lib_ignore now properly commented
2018-04-04 10:05:22 +02:00
Gijs NoorlanderandGitHub 767b0af733 Merge pull request #1217 from soif/Feat/JsonLoad
Shows CPU Load in JSON page
2018-04-04 10:04:59 +02:00
TD-er 02255180e9 [Wifi] Use statemachine to move between Wifi states
Still existing problems:
- Credentials are not being saved from web interface and thus connection doesn't work from setup page.
- First time connect to SoftAP takes a lot of attempts, when the wifi was searching for an existing accesspoint. This searching does prevent the SoftAP to form a stable connection to the client.

Maybe the entire wifi stack has to be reset before switching to SoftAP. Now it is near to impossible to recover from incorrect settings or a changes accesspoint.
Still under investigation.

It looks to be a problem with the
2018-04-04 03:19:03 +02:00
ESPEasy release bot c3bde94f7a automaticly updated release notes for mega-20180403 2018-04-03 04:00:14 +02:00
TD-er 886958d479 Merge remote-tracking branch 'origin/bugfix/SoftAP_event_based_wifi' into bugfix/SoftAP_event_based_wifi 2018-04-03 01:04:22 +02:00
TD-er 84cbc19f38 [issue #1215] Cannot login to accesspoint on new install
Since event based wifi, it became more apparent the ESP8266 has some issues with running AP and STA mode simultaneous.
It appears this can only work when the channel remains constant. But when trying to connect to an accesspoint that channel will change.
This means Soft AP and STA cannot be active at the same time when searching for an accesspoint to connect to. For example login to the Soft AP to correct some settings or replace an accesspoint would not be possible.

This fix deals with all of these issues and keeps the fast try/fail connection attempts offered by the event based wifi.
In short:
- 3x attempt to connect to AP1 (each attempt takes about 2.5 seconds when failing)
- 3x attempt to connect to AP2
- Enable accesspoint

When accesspoint is active, the connect attempts will be done at a slower pace and STA mode is disabled. STA mode is also disabled as soon as someone connects to the Soft AP.
When the settings are saved, a retry to connect like normal is started almost immediately. N.B. This will result in a disconnect of the connected users to the Soft AP.

So the connection time is:
- AP1 is valid: 4 - 10 seconds
- AP1 is not valid, AP2 is: 12 - 20 seconds
- AP1 and AP2 are not valid: +/- 18 seconds before activating Soft AP
2018-04-03 01:03:27 +02:00
TD-er 178ec9dfa9 [issue #1215] Cannot login to accesspoint on new install
Since event based wifi, it became more apparent the ESP8266 has some issues with running AP and STA mode simultaneous.
It appears this can only work when the channel remains constant. But when trying to connect to an accesspoint that channel will change.
This means Soft AP and STA cannot be active at the same time when searching for an accesspoint to connect to. For example login to the Soft AP to correct some settings or replace an accesspoint would not be possible.

This fix deals with all of these issues and keeps the fast try/fail connection attempts offered by the event based wifi.
In short:
- 3x attempt to connect to AP1 (each attempt takes about 2.5 seconds when failing)
- 3x attempt to connect to AP2
- Enable accesspoint

When accesspoint is active, the connect attempts will be done at a slower pace and STA mode is disabled. STA mode is also disabled as soon as someone connects to the Soft AP.
When the settings are saved, a retry to connect like normal is started almost immediately. N.B. This will result in a disconnect of the connected users to the Soft AP.

So the connection time is:
- AP1 is valid: 4 - 10 seconds
- AP1 is not valid, AP2 is: 12 - 20 seconds
- AP1 and AP2 are not valid: +/- 18 seconds before activating Soft AP
2018-04-03 00:47:06 +02:00
GrovkillenandGitHub 080be1ad0a Update _P029_Output.ino 2018-04-02 20:41:22 +02:00
GrovkillenandGitHub 232ca4f215 Update _P038_NeoPixel.ino 2018-04-02 20:40:08 +02:00
mvdbro bfa6eac538 ESP32 prep for RTOS multitasking 2018-04-02 15:59:01 +02:00
moi 0ca06782b9 unwanted lib_ignore now properly commented 2018-04-02 13:27:02 +02:00
moi 2079b0f28b Adds CPU Load LC in JSON page 2018-04-02 12:39:14 +02:00
moi 32bf45e817 Show CPU Load in JSON page 2018-04-02 12:38:30 +02:00
ESPEasy release bot 5d41bf9e73 automaticly updated release notes for mega-20180402 2018-04-02 04:00:10 +02:00
Gijs Noorlander dc5a2fd956 Revert "Merge pull request #1205 from s0170071/SerialSwap"
This reverts commit 46586e5355.
2018-04-01 10:47:50 +02:00
ESPEasy release bot b20f05305b automaticly updated release notes for mega-20180401 2018-04-01 04:00:08 +02:00
Gijs NoorlanderandGitHub 46586e5355 Merge pull request #1205 from s0170071/SerialSwap
Serial Swap function
2018-04-01 01:17:51 +02:00
Gijs NoorlanderandGitHub 7e8a751657 Merge pull request #1203 from TD-er/feature/mqtt_disconnect_event
[issue #1201] MQTT#Disconnected event and MQTT stability improvements
2018-04-01 01:14:55 +02:00
TD-er 7d61e55d34 [deepsleep] Allow for some minimum wifi connect time
In Deepsleep mode the wifi connect time is now minimum of 6 seconds.
Also the first loop after connect, the 'awake' timer will reset and start over. Without WiFi connection the set 'awake' timer starts at the moment the node boots.
2018-03-31 23:53:15 +02:00
GrovkillenandGitHub 2f663429a3 P0059 (rotary encoder) and P0063 (ttp229, keypad)
These two plugins are not in test but in normal.
2018-03-31 19:52:25 +02:00
ESPEasy release bot 492791a4ac automaticly updated release notes for mega-20180331 2018-03-31 04:00:09 +02:00
TD-er 52e75ade78 Merge remote-tracking branch 'origin/feature/mqtt_disconnect_event' into feature/mqtt_disconnect_event 2018-03-31 01:42:19 +02:00
TD-er 525a0ba0a1 [issue #1201] MQTT#Disconnected event and MQTT stability improvements
While looking for issues regarding DeepSleep + MQTT and issue #1195, I came across a number of other issues related to high CPU load and WiFi disconnects when a MQTT controller cannot reach the MQTT broker or is set to be no longer enabled.

These fixes improve CPU load and WiFi stability and also send the following events:
- `MQTT#Connected` 
- `MQTT#Disconnected`
- `MQTTimport#Connected` 
- `MQTTimport#Disconnected`

The MQTTimport plugin still has some major issues which have to be taken care of, so #1195 is not fixed yet.
2018-03-31 01:34:50 +02:00
Gijs NoorlanderandGitHub 52c7e5012e Merge pull request #1212 from TD-er/bugfix/build_issues_ESP32_ESP8266
[Build ESP32] Fix for build issues between ESP32 and ESP8266
2018-03-31 01:32:13 +02:00
TD-er 4dd733eb63 [ESP32] Build errors/warnings 2018-03-31 00:53:25 +02:00
TD-er 02a065d623 [Build ESP32] Fix for build issues between ESP32 and ESP8266
There is a problem with the PlatformIO builder since the last update of @mvdbro
It's an issue with the parsing of `#ifdef ESP32`.

It is very well explained here: [platformio/platformio-core#801 (comment)](https://github.com/platformio/platformio-core/issues/801#issuecomment-252447178)

In short, the event handling functions for the wifi have been moved to a separate .h file, since those files will be parsed properly by the Library Dependency Finder (LDF) in PlatformIO 3.x
2018-03-31 00:22:12 +02:00
Plebs e774ef5751 Fixes for #1208 and partial #1196
Fixed #1208
Added dìformat commands:
#C: 1/0 = Open/Close
#U: 1/0 = Up/Down
2018-03-30 21:05:33 +02:00
mvdbro 0afee4fafb ESP32: Fix Wifi Disconnect reason 2018-03-30 16:21:47 +02:00
s0170071 eba1fb3388 Serial Swap function
swaps Serial Pins *and* keeps track of it.
2018-03-30 08:47:55 +02:00
ESPEasy release bot b2c866edeb automaticly updated release notes for mega-20180330 2018-03-30 04:00:10 +02:00
TD-er 3583db3e22 [issue #1201] MQTT#Disconnected event and MQTT stability improvements
While looking for issues regarding DeepSleep + MQTT and issue #1195, I came across a number of other issues related to high CPU load and WiFi disconnects when a MQTT controller cannot reach the MQTT broker or is set to be no longer enabled.

These fixes improve CPU load and WiFi stability and also send the following events:
- `MQTT#Connected` 
- `MQTT#Disconnected`
- `MQTTimport#Connected` 
- `MQTTimport#Disconnected`

The MQTTimport plugin still has some major issues which have to be taken care of, so #1195 is not fixed yet.
2018-03-30 02:48:23 +02:00
GeraldandGitHub 5d3f8bf073 Update _P049_MHZ19.ino
Clarification of pin connections.
2018-03-29 21:28:25 +02:00
Gijs NoorlanderandGitHub 1a72444b0a Build issue with Arduino IDE
See https://github.com/letscontrolit/ESPEasy/issues/1188#issuecomment-377020065
2018-03-29 21:27:09 +02:00
GHolliandGitHub dd88db1913 Merge pull request #2 from letscontrolit/mega
Downstream updates
2018-03-29 20:10:05 +02:00
GHolliandGitHub aab00567fc Downstream updates (#1)
* Initial re-organisation of plugin sets (#1019)

* 12bit ADC values acceted up to 4095

MCP3221 is a 12bit ADC so accepted values should be up to 40195 not 1024

* automaticly updated release notes for v2.0-20180313

* - move all structs from ESPEasy.ino into header file
- add some fix for headers
- add const to rtttl notes array

* [issue #1066] Fix Webserver handle_control

There wasn't a proper start/end for the streaming webserver.
See discussion on issue #1066

* automaticly updated release notes for mega-20180314

* Custom controller GUI option

* Fixed #433

Not tested!

* #893, part 2 receiving

* Merge branch 'mega' of github.com:letscontrolit/ESPEasy into mega

# Conflicts:
#	src/ESPEasy.ino

* Rules fix

* #893 part1, send messages

* Custom controller GUI option

* #893, part 2 receiving

* Rules fix

* automaticly updated release notes for mega-20180315

* - move all structs from ESPEasy.ino into header file

- add some fix for headers
- add const to rtttl notes array

* Merge branch 'mega' of github.com:letscontrolit/ESPEasy into mega

# Conflicts:
#	src/ESPEasy.ino

* [v2.0 split globals] Base split on v2.0 version of ESPEasy.ino

*  MCP3221 allow values for calibration (#1073)

MCP3221 allow values for calibration

* [issue #1066] Fix Webserver handle_control (#1079)

[issue #1066] Fix Webserver handle_control

* Fixed multi instance problem on SHT3x #433 (#1081)

Fixed multi instance problem on SHT3x #433

* [issue #1057] AM PM display issue

X:XX PM (for hours 1...9)
X:XX AM (for hours 1...9)
XX:XX PM (for hours 10...12)
XX:XX AM (for hours 10...12)

Added for H:MM (without seconds) notations:
- `%systm_hm%`
-`%systm_hm_am%`

* [issue #993] variable in MQTT subscribe topic

As [noted](https://github.com/letscontrolit/ESPEasy/issues/993#issuecomment-373140135) by @kluszcyn

* [issue #951] Changed System#Initialized  => System#Wake

Changed System#Initialized  => System#Wake
New event name makes more sense and Initialized may be used later to indicate all needed connections, etc. are ready.

* [issue #1057] AM PM display issue

X:XX PM (for hours 1...9)
X:XX AM (for hours 1...9)
XX:XX PM (for hours 10...12)
XX:XX AM (for hours 10...12)

Added for H:MM (without seconds) notations:
- `%systm_hm%`
-`%systm_hm_am%`

* [issue #993] variable in MQTT subscribe topic

As [noted](https://github.com/letscontrolit/ESPEasy/issues/993#issuecomment-373140135) by @kluszcyn

* [issue #951] Changed System#Initialized  => System#Wake

Changed System#Initialized  => System#Wake
New event name makes more sense and Initialized may be used later to indicate all needed connections, etc. are ready.

* automaticly updated release notes for mega-20180316

* automaticly updated release notes for v2.0-20180316

* Add download button for current rule set

* - add encoder write #1086

* changed memory tracker to uint64_t for the ESP32

* Changed so that running all tasks immediately with deep sleep enabled only happens on first iteration after wake up

* Keep uint. Just change the init value.

* [WiFi] Try to minimize effect of WiFi interruptions

And send event when connected to a different accesspoint.
Currently the impact on WiFi reconnects is enorm. The ESP stalls, won't react on events, etc.

* - fix success setting

* - fix P073 success setting in PLUGIN_WRITE callback

* - initialize pointer in P073

* [Relaxed WiFi] Perform WiFi initialization in steps

Doing WiFi initialization in multiple steps, will reduce boot time a lot.
For deepsleep the Setup is waiting for wifi initialization to complete, but for normal use the wifi connection is initiated during setup and checked on regular intervals to see if it is available.
The same for WiFi reconnect, which will hopefully not affect the performance of the ESP module during reconnects.

Also added a check + event when connected to another accesspoint with different BSSID (MAC address of accesspoint). Also the last used BSSID is used to reconnect to try to connect to the same device over and over, which may be useful with WiFi repeaters.

* [Travis error] Some #include test that wasn't meant to be included

... in the commit.

* [JSON] Add uint name (#1099) and WiFi information (PR #1113)

As suggested by @Grovkillen on PR #1113.

* [issue #1007] Allow user specific data in separate file

File will be ignored by git and can be simply included using `-D USE_OWN_DEFAULTS` in the build

* #ifndef instead of #ifdef

* [issue #1007] Add other defines as suggested by @uzi18

* [Memory] parseTemplate did not check if markers were found

"Free Mem" reported this function to be using quite a lot of memory.
Maybe that was related to parsing texts without matching ']' or '#'
Just added some checks to see if they were found.

* [issue #1097] MQTT publish after deep sleep

The MQTTConnect was only called after a while. This is a problem for deepsleep.
So now the MQTT connect is done at the first loop when deep sleep is enabled.

* Add download button for current rule set (#1102)

Add download button for current rule set

* - add encoder write command #1086 (#1103)

- add encoder write command #1086

* Changed so that running all tasks immediately with deep sleep enabled… (#1110)

Changed so that running all tasks immediately with deep sleep enabled only happens on first iteration after wake up

* Merge pull request #1112 from uzi18/fix-p073

Fix p073 - #1111

* Merge pull request #1114 from TD-er/feature/wifi_details_json

[JSON] Add uint name (#1099) and WiFi information (PR #1113)

* Merge pull request #1113 from TD-er/feature/reduce_impact_wifi_disconnect

[Relaxed WiFi] Perform WiFi initialization in steps

* Merge pull request #1116 from TD-er/feature/allow_own_defaults

[issue #1007] Allow user specific data in separate file

* Merge pull request #1118 from TD-er/bugfix/mqtt_publish_after_deep_sleep

[issue #1097] MQTT publish after deep sleep

* [merge] MIssing #endif due to merging.

* automaticly updated release notes for mega-20180319

* automaticly updated release notes for v2.0-20180319

* Fix wiring description for SN75176 transceiver

* Revert "Merge pull request #1116 from TD-er/feature/allow_own_defaults"

This reverts commit 8ccbdcadf0.

* Fix wiring description for SN75176 transceiver

* Revert "Merge pull request #1116 from TD-er/feature/allow_own_defaults"

This reverts commit 8ccbdcadf0.

* [issue #1097] WiFi connect with deepsleep enabled trigger watchdog reset

Did not allow for enough time to do background tasks while waiting for wifi connect with DeepSleep enabled.

* [issue #1097] WiFi connect with deepsleep enabled trigger watchdog reset

Did not allow for enough time to do background tasks while waiting for wifi connect with DeepSleep enabled.

* automaticly updated release notes for mega-20180320

* automaticly updated release notes for v2.0-20180320

* [wifi] Setup with factory settings could not complete

* [wifi] Setup with factory settings could not complete

* [merge issue] Forgotten #endif in merge

* - P012 fix command interpretation

* - P023 fix command interpretation

* - P035 move strings to flash

* - P048 fetch params only when needed

* automaticly updated release notes for mega-20180321

* automaticly updated release notes for v2.0-20180321

* Serial WD crash

* [wifi] Make more robust checks and increase timeout

See #1145

* - P012 fix command interpretation

* - P023 fix command interpretation

* - P035 move strings to flash

* - P048 fetch params only when needed

* Serial WD crash

* [wifi] Make more robust checks and increase timeout

See #1145

* [Memory] parseTemplate did not check if markers were found

"Free Mem" reported this function to be using quite a lot of memory.
Maybe that was related to parsing texts without matching ']' or '#'
Just added some checks to see if they were found.

* [WiFi] Take much more time for initial WiFi connect during setup

Accesspoint is still active, so it may take a lot more time to make the initial connection

* [WiFi] Take much more time for initial WiFi connect during setup

Accesspoint is still active, so it may take a lot more time to make the initial connection

* automaticly updated release notes for mega-20180322

* ESP32 fix

* [Command] Parsing improvement for commands

Use more intelligent parsing of commands and switch statement to improve speed

* automaticly updated release notes for mega-20180323

* [WiFi] Reverted those temp String uses for ssid/pass

Was introduced due to misunderstanding of reported issues with WiFi.

* [issue #1131] Add %unixtime%

Show the current time as [Unix time](https://en.wikipedia.org/wiki/Unix_time) (numbers of seconds that have elapsed since midnight 1970-01-01, UTC)

* [issue #1097] Call MQTTclient.loop() during deepsleep

The `MQTTclient.loop()` function should be called quite often.
This does the actual MQTT handling.
In normal operations, this is called quite frequently, but it should also be called when deepsleep is active and right before deepsleep is activated again.

* [P1] Support for latest standard

* [wifi] Event based connect/reconnect

Now using the core WiFiEvents to act on:

- connect
- disconnect
- gotIP

This will make polling for a status no longer needed.
It also allows to get a better understanding in why diconnects happen, since the disconnect reason is given in the events.
This extra information is also present on the information panel on the webinterface and also in the JSON output.

The entire connect/disconnect/reconnect is now done completely asynchronous and thus takes much less resources from the ESP.
A disconnect will now also send an event: "WiFi#Disconnected"

For deepsleep this means there has to be a minimum awake time set and perhaps use rules to set the ESP into sleep again when done.
Typical connection times to an accesspoint are about 3 seconds + about 1 second for DHCP.

This also resolves the issues where services my try to connect while there is a WiFi connection, but not yet an IP address set.

I already noticed a lot of NTP servers from pool.ntp.org are non responsive the last few weeks, so that may still take some time, but that's another issue.

* automaticly updated release notes for mega-20180324

* [NTP] Speedup NTP again with async WiFi

Previously it would only start calling "now" when the WiFi was already setup.
And in calling `now()`, a call to an NTP server is being made. When this fails, retry again in a minute.
But now the WiFi initialization is asynchronous, so the first NTP query was already failing and thus the retry is already set to a minute.

This is fixed now and also the pool.ntp.org will pick a random one from 0...3 (.pool.ntp.org).
The DNS queries from this pool change about every minute, so if you want to retry because one of the servers is offline, you should try one from the other `N.pool.ntp.org` or else you have to wait for another minute.

* - fix for #1170 - uservar not setted on encwrite

* automaticly updated release notes for mega-20180326

* [issue #1174] Show degree sign via external writes to LCD

Fix suggested by [elmicha](https://github.com/letscontrolit/ESPEasy/issues/1174#issuecomment-376244766)

* [ESP32] Event driven WiFi for ESP32

Not tested, just got some inspiration by these files:

- https://github.com/espressif/arduino-esp32/blob/master/libraries/WiFi/examples/WiFiClientEvents/WiFiClientEvents.ino
- https://github.com/espressif/arduino-esp32/blob/master/libraries/WiFi/src/WiFiGeneric.cpp
- https://github.com/espressif/arduino-esp32/blob/master/tools/sdk/include/esp32/esp_event.h

* automaticly updated release notes for mega-20180327

* Fix nesting level check

* [Build] Cleanup/split builds using defines

See PR #1034 and #1040 made by @soif

* [build] Disabled a few PlatformIO profiles for now.

There were way too many.
Just placed them in comments and Travis had already built them all to test first.

* automaticly updated release notes for mega-20180328

* [Arduino IDE] Revert changes in include paths

Were changed to be able to test the PlatformIO feature to compile only files that are actually used.
Apparently the Arduino IDE cannot find the files anymore because that IDE needs the parent directory to be named as the main project file, not "src"

* automaticly updated release notes for mega-20180329
2018-03-29 19:53:54 +02:00
clumsy-stefanandGitHub 21cb6135dd _P015_TSL2561 added Broadband and IR Values
Extended Plugin to also read Broadband and IR values from device.
2018-03-29 09:27:53 +02:00
ESPEasy release bot f613bb4572 automaticly updated release notes for mega-20180329 2018-03-29 04:00:11 +02:00
Gijs NoorlanderandGitHub 51059f0c18 Merge pull request #1189 from TD-er/bugfix/include_paths_ArduinoIDE
[issue #1188] Revert changes in include paths
2018-03-28 21:58:07 +02:00
TD-er dec6598f49 [Arduino IDE] Revert changes in include paths
Were changed to be able to test the PlatformIO feature to compile only files that are actually used.
Apparently the Arduino IDE cannot find the files anymore because that IDE needs the parent directory to be named as the main project file, not "src"
2018-03-28 21:40:09 +02:00
mvdbroandGitHub f8f6767bec Merge pull request #1180 from TD-er/bugfix/esp32_eventbased_wifi
[ESP32] Event driven WiFi for ESP32
2018-03-28 19:42:54 +02:00
linuxnico 07948c87aa add ds1822 definition to ds_read_temp function 2018-03-28 14:30:05 +02:00
ESPEasy release bot 5c475b98db automaticly updated release notes for mega-20180328 2018-03-28 04:00:09 +02:00
Gijs NoorlanderandGitHub 58fb8dc42b Merge pull request #1182 from TD-er/feature/pluginsets
[Build] Cleanup/split builds using defines
2018-03-27 22:37:45 +02:00
TD-er cb2b11a41a [build] Disabled a few PlatformIO profiles for now.
There were way too many.
Just placed them in comments and Travis had already built them all to test first.
2018-03-27 22:27:31 +02:00
TD-er ac4f3c4cd4 [Build] Cleanup/split builds using defines
See PR #1034 and #1040 made by @soif
2018-03-27 21:24:08 +02:00
mvdbro c651e29d2a Merge branch 'mega' of https://github.com/letscontrolit/ESPEasy into mega 2018-03-27 17:24:45 +02:00
mvdbro d7e886a841 Fix nesting level check 2018-03-27 17:23:56 +02:00
Gijs NoorlanderandGitHub eec7647782 Merge pull request #1025 from soif/Feat/PlugSets
Initial re-organisation of plugin sets (#1019)
2018-03-27 10:12:56 +02:00
ESPEasy release bot 6f9d120ff0 automaticly updated release notes for mega-20180327 2018-03-27 04:00:09 +02:00
TD-er 28ddc2d9c0 [ESP32] Event driven WiFi for ESP32
Not tested, just got some inspiration by these files:

- https://github.com/espressif/arduino-esp32/blob/master/libraries/WiFi/examples/WiFiClientEvents/WiFiClientEvents.ino
- https://github.com/espressif/arduino-esp32/blob/master/libraries/WiFi/src/WiFiGeneric.cpp
- https://github.com/espressif/arduino-esp32/blob/master/tools/sdk/include/esp32/esp_event.h
2018-03-26 22:44:58 +02:00
Gijs NoorlanderandGitHub cc54354ac3 Merge pull request #1178 from TD-er/bugfix/degree_parse_LCD
[issue #1174] Show degree sign via external writes to LCD
2018-03-26 19:48:56 +02:00
TD-er 3929390629 [issue #1174] Show degree sign via external writes to LCD
Fix suggested by [elmicha](https://github.com/letscontrolit/ESPEasy/issues/1174#issuecomment-376244766)
2018-03-26 19:48:12 +02:00
GrovkillenandGitHub 5f4685337e Added value number as discussed. 2018-03-26 14:59:47 +02:00
GrovkillenandGitHub 08c158aa9c Moved to correct folder 2018-03-26 10:33:22 +02:00
GrovkillenandGitHub e9d71a8f35 Delete WebServer.ino
Same mistake as before, wrong folder upload
2018-03-26 10:32:58 +02:00
GrovkillenandGitHub 3e3173cbb0 Updated JSON path for sensor values and names
+file type filter on upload (not OTA since that is not part of ESP Easy core)
2018-03-26 10:31:27 +02:00
ESPEasy release bot 3a26ebf7b1 automaticly updated release notes for mega-20180326 2018-03-26 04:00:15 +02:00
Gijs NoorlanderandGitHub 1685bead52 Merge pull request #1173 from TD-er/merge/command_parsing
Merge "improve command parsing" & fix for #1170 - uservar not set on encwrite
2018-03-25 21:54:19 +02:00
Bartlomiej ZimonandTD-er 3a2fe35e5c - fix for #1170 - uservar not setted on encwrite 2018-03-25 21:04:34 +02:00
TD-er 29ce7f774f Merge branch 'bugfix/improve_command_parsing' into mega 2018-03-25 20:51:23 +02:00
Gijs NoorlanderandGitHub cc85327356 Merge pull request #1164 from BrianSetz/bugfix/plugin044
[P1 Wifi Gateway] Support for ESMR 5.0
2018-03-25 20:33:01 +02:00
Gijs NoorlanderandGitHub 0851bb655e Merge pull request #1165 from TD-er/feature/event_driven_wifi
[wifi] Event based connect/reconnect
2018-03-25 20:30:49 +02:00
TD-er d4bc10d8f1 [NTP] Speedup NTP again with async WiFi
Previously it would only start calling "now" when the WiFi was already setup.
And in calling `now()`, a call to an NTP server is being made. When this fails, retry again in a minute.
But now the WiFi initialization is asynchronous, so the first NTP query was already failing and thus the retry is already set to a minute.

This is fixed now and also the pool.ntp.org will pick a random one from 0...3 (.pool.ntp.org).
The DNS queries from this pool change about every minute, so if you want to retry because one of the servers is offline, you should try one from the other `N.pool.ntp.org` or else you have to wait for another minute.
2018-03-25 12:32:06 +02:00
ESPEasy release bot 0672f32f4b automaticly updated release notes for mega-20180324 2018-03-24 04:00:10 +01:00
TD-er a17f7b679c [wifi] Event based connect/reconnect
Now using the core WiFiEvents to act on:

- connect
- disconnect
- gotIP

This will make polling for a status no longer needed.
It also allows to get a better understanding in why diconnects happen, since the disconnect reason is given in the events.
This extra information is also present on the information panel on the webinterface and also in the JSON output.

The entire connect/disconnect/reconnect is now done completely asynchronous and thus takes much less resources from the ESP.
A disconnect will now also send an event: "WiFi#Disconnected"

For deepsleep this means there has to be a minimum awake time set and perhaps use rules to set the ESP into sleep again when done.
Typical connection times to an accesspoint are about 3 seconds + about 1 second for DHCP.

This also resolves the issues where services my try to connect while there is a WiFi connection, but not yet an IP address set.

I already noticed a lot of NTP servers from pool.ntp.org are non responsive the last few weeks, so that may still take some time, but that's another issue.
2018-03-24 01:19:32 +01:00
Brian Setz 425bd85c83 [P1] Support for latest standard 2018-03-23 22:13:03 +01:00
Gijs NoorlanderandGitHub 3be005e1ee Merge pull request #1161 from TD-er/bugfix/mqtt_deepsleep
[issue #1097] Call MQTTclient.loop() during deepsleep
2018-03-23 15:52:48 +01:00
TD-er 174f9e6e03 [issue #1097] Call MQTTclient.loop() during deepsleep
The `MQTTclient.loop()` function should be called quite often.
This does the actual MQTT handling.
In normal operations, this is called quite frequently, but it should also be called when deepsleep is active and right before deepsleep is activated again.
2018-03-23 15:19:10 +01:00
Gijs NoorlanderandGitHub 51a14a174f Merge pull request #1160 from TD-er/feature/epoch_time
[issue #1131] Add %unixtime%
2018-03-23 14:44:55 +01:00
Gijs NoorlanderandGitHub 7cb1f453d3 Merge pull request #1159 from TD-er/bugfix/wifi_issues
[WiFi] Reverted those temp String uses for ssid/pass
2018-03-23 14:44:41 +01:00
TD-er 23a6caab89 [issue #1131] Add %unixtime%
Show the current time as [Unix time](https://en.wikipedia.org/wiki/Unix_time) (numbers of seconds that have elapsed since midnight 1970-01-01, UTC)
2018-03-23 14:23:27 +01:00
TD-er 6b4300bd46 [WiFi] Reverted those temp String uses for ssid/pass
Was introduced due to misunderstanding of reported issues with WiFi.
2018-03-23 12:34:27 +01:00
ESPEasy release bot 04a9069db0 automaticly updated release notes for mega-20180323 2018-03-23 04:00:06 +01:00
TD-er dd636903c8 [Command] Parsing improvement for commands
Use more intelligent parsing of commands and switch statement to improve speed
2018-03-22 22:33:41 +01:00
GHolliandGitHub 4543a10739 Change comma to semicolon
Same functionality, but more common.
2018-03-22 20:12:28 +01:00
mvdbro 940b65e86a ESP32 fix 2018-03-22 14:08:47 +01:00
ESPEasy release bot 6344de0649 automaticly updated release notes for mega-20180322 2018-03-22 04:00:11 +01:00
TD-er 8ccd7c3e8d Merge branch 'v2.0' into mega 2018-03-22 01:06:27 +01:00
TD-er 22371649a4 [WiFi] Take much more time for initial WiFi connect during setup
Accesspoint is still active, so it may take a lot more time to make the initial connection
2018-03-22 01:05:56 +01:00
Gijs NoorlanderandGitHub 2a48d5033e Merge pull request #1149 from TD-er/bugfix/initialWiFiconnect
[WiFi] Take much more time for initial WiFi connect during setup
2018-03-22 01:04:48 +01:00
TD-er f064da797d [WiFi] Take much more time for initial WiFi connect during setup
Accesspoint is still active, so it may take a lot more time to make the initial connection
2018-03-22 01:04:19 +01:00
TD-er b0b8edf935 Merge branch 'v2.0' into mega 2018-03-22 00:27:38 +01:00
Gijs NoorlanderandGitHub 8cbd9a0822 Merge pull request #1148 from TD-er/merge/mega_to_v2.0_0321
Merge/mega to v2.0 0321
2018-03-22 00:24:59 +01:00
TD-er 93f9d11738 [Memory] parseTemplate did not check if markers were found
"Free Mem" reported this function to be using quite a lot of memory.
Maybe that was related to parsing texts without matching ']' or '#'
Just added some checks to see if they were found.
2018-03-22 00:24:17 +01:00
TD-er cf3e0a3f0a [wifi] Make more robust checks and increase timeout
See #1145
2018-03-22 00:12:04 +01:00
s0170071andTD-er ccfd14dbd3 Serial WD crash 2018-03-22 00:11:48 +01:00
Bartlomiej ZimonandTD-er 3034738ad4 - P048 fetch params only when needed 2018-03-22 00:11:30 +01:00
TD-er 178d1c46a2 - P035 move strings to flash 2018-03-22 00:11:21 +01:00
Bartlomiej ZimonandTD-er cdfd1d986e - P023 fix command interpretation 2018-03-22 00:10:55 +01:00
Bartlomiej ZimonandTD-er 4b7aa53692 - P012 fix command interpretation 2018-03-22 00:10:50 +01:00
Gijs NoorlanderandGitHub 7959a5133f Merge pull request #1117 from TD-er/bugfix/memoryusage_parsetemplate
[Memory] parseTemplate did not check if markers were found
2018-03-21 23:33:47 +01:00
Gijs NoorlanderandGitHub 941fb5c29c Merge pull request #1147 from TD-er/bugfix/check_wifi_cred
[wifi] Make more robust checks and increase timeout
2018-03-21 23:32:37 +01:00
TD-er c43c9ea2b3 [wifi] Make more robust checks and increase timeout
See #1145
2018-03-21 23:19:05 +01:00
Gijs NoorlanderandGitHub 967103bcad Merge pull request #1141 from uzi18/mega-plugins_check
some small fixes found during check for propper success setting
2018-03-21 21:36:52 +01:00
Gijs NoorlanderandGitHub efe637ec70 Merge pull request #1146 from s0170071/SerialWDCrash
Wifi connect fails if serial bytes are incoming
2018-03-21 21:24:43 +01:00
s0170071 00450eb260 Serial WD crash 2018-03-21 19:48:04 +01:00
ESPEasy release bot cc02fa4481 automaticly updated release notes for v2.0-20180321 2018-03-21 04:00:21 +01:00
ESPEasy release bot 1c5f8af083 automaticly updated release notes for mega-20180321 2018-03-21 04:00:08 +01:00
Bartlomiej Zimon fccc31a7c6 - P048 fetch params only when needed 2018-03-21 02:43:04 +01:00
Bartlomiej Zimon b84d905a0b - P035 move strings to flash 2018-03-21 02:42:13 +01:00
Bartlomiej Zimon 94aa951cba - P023 fix command interpretation 2018-03-21 02:41:35 +01:00
Bartlomiej Zimon 2a23dcd011 - P012 fix command interpretation 2018-03-21 02:41:08 +01:00
Gijs NoorlanderandGitHub ab3a406706 [merge issue] Forgotten #endif in merge 2018-03-20 23:46:43 +01:00
TD-er e7a9ee7eee Merge branch 'v2.0' into mega 2018-03-20 23:28:59 +01:00
Unknown 3edfdbf5f7 [wifi] Setup with factory settings could not complete 2018-03-20 23:27:39 +01:00
Gijs NoorlanderandGitHub 27bac2ca00 Merge pull request #1140 from TD-er/bugfix/connect_to_wifi_during_setup
[wifi] Setup with factory settings could not complete
2018-03-20 23:25:57 +01:00
Unknown 373f74e9f8 [wifi] Setup with factory settings could not complete 2018-03-20 23:25:23 +01:00
ESPEasy release bot 1220c565c8 automaticly updated release notes for v2.0-20180320 2018-03-20 04:00:23 +01:00
ESPEasy release bot 1931fe9e53 automaticly updated release notes for mega-20180320 2018-03-20 04:00:10 +01:00
Unknown 0eab6293dc Merge branch 'v2.0' into mega 2018-03-20 00:30:02 +01:00
Unknown f0987dab41 [issue #1097] WiFi connect with deepsleep enabled trigger watchdog reset
Did not allow for enough time to do background tasks while waiting for wifi connect with DeepSleep enabled.
2018-03-20 00:29:24 +01:00
Gijs NoorlanderandGitHub 51bd52603f Merge pull request #1134 from TD-er/bugfix/deepsleep_mqtt
[issue #1097] WiFi connect with deepsleep enabled trigger watchdog reset
2018-03-20 00:27:58 +01:00
Unknown 47f1fa145a [issue #1097] WiFi connect with deepsleep enabled trigger watchdog reset
Did not allow for enough time to do background tasks while waiting for wifi connect with DeepSleep enabled.
2018-03-20 00:26:48 +01:00
Unknown 605055d95a Merge branch 'v2.0' into mega 2018-03-19 22:52:36 +01:00
Unknown af3e353181 Revert "Merge pull request #1116 from TD-er/feature/allow_own_defaults"
This reverts commit 8ccbdcadf0.
2018-03-19 22:51:23 +01:00
es-kaandUnknown c711d6ea51 Fix wiring description for SN75176 transceiver 2018-03-19 22:50:31 +01:00
Gijs NoorlanderandGitHub 20c23a2935 Merge pull request #1133 from TD-er/bugfix/undo_espeasy_globals.h
Revert "Merge pull request #1116 from TD-er/feature/allow_own_defaults"
2018-03-19 22:48:51 +01:00
Gijs Noorlander bbfe254232 Revert "Merge pull request #1116 from TD-er/feature/allow_own_defaults"
This reverts commit 8ccbdcadf0.
2018-03-19 22:47:42 +01:00
Gijs NoorlanderandGitHub 882c888f6d Merge pull request #1132 from es-ka/mega
Fix wiring description for SN75176 transceiver
2018-03-19 22:37:04 +01:00
es-kaandGitHub 0a754f072c Fix wiring description for SN75176 transceiver 2018-03-19 20:00:41 +01:00
ESPEasy release bot 1f084c51cc automaticly updated release notes for v2.0-20180319 2018-03-19 04:00:24 +01:00
ESPEasy release bot 89df0932c5 automaticly updated release notes for mega-20180319 2018-03-19 04:00:11 +01:00
Unknown 429fd3e4d0 Merge branch 'v2.0' into mega 2018-03-19 01:06:32 +01:00
Gijs NoorlanderandGitHub 85e8d98da8 Merge pull request #1121 from TD-er/merge/fixes_20180318_to_v2.0
Merge/fixes 20180318 to v2.0
2018-03-19 01:01:42 +01:00
Unknown 6d52a7e03a [merge] MIssing #endif due to merging. 2018-03-19 00:51:05 +01:00
Gijs Noorlander fa513b52f9 Merge pull request #1118 from TD-er/bugfix/mqtt_publish_after_deep_sleep
[issue #1097] MQTT publish after deep sleep
2018-03-19 00:46:03 +01:00
Unknown f98401524f Merge pull request #1116 from TD-er/feature/allow_own_defaults
[issue #1007] Allow user specific data in separate file
2018-03-19 00:45:52 +01:00
Unknown 4090b4f23c Merge pull request #1113 from TD-er/feature/reduce_impact_wifi_disconnect
[Relaxed WiFi] Perform WiFi initialization in steps
2018-03-19 00:42:58 +01:00
Gijs Noorlander b89c00008d Merge pull request #1114 from TD-er/feature/wifi_details_json
[JSON] Add uint name (#1099) and WiFi information (PR #1113)
2018-03-19 00:39:43 +01:00
Gijs Noorlander d57a617138 Merge pull request #1112 from uzi18/fix-p073
Fix p073 - #1111
2018-03-19 00:39:32 +01:00
Gijs Noorlander cefe6b4b7c Changed so that running all tasks immediately with deep sleep enabled… (#1110)
Changed so that running all tasks immediately with deep sleep enabled only happens on first iteration after wake up
2018-03-19 00:38:30 +01:00
Gijs Noorlander 2432740b41 - add encoder write command #1086 (#1103)
- add encoder write command #1086
2018-03-19 00:35:09 +01:00
Gijs Noorlander 44a934651c Add download button for current rule set (#1102)
Add download button for current rule set
2018-03-19 00:34:52 +01:00
Gijs NoorlanderandGitHub 95fb0d6e6c Merge pull request #1118 from TD-er/bugfix/mqtt_publish_after_deep_sleep
[issue #1097] MQTT publish after deep sleep
2018-03-19 00:29:37 +01:00
Gijs NoorlanderandGitHub 8ccbdcadf0 Merge pull request #1116 from TD-er/feature/allow_own_defaults
[issue #1007] Allow user specific data in separate file
2018-03-19 00:29:08 +01:00
Unknown 433aa6910a [issue #1097] MQTT publish after deep sleep
The MQTTConnect was only called after a while. This is a problem for deepsleep.
So now the MQTT connect is done at the first loop when deep sleep is enabled.
2018-03-19 00:18:29 +01:00
Unknown f135c63d84 [Memory] parseTemplate did not check if markers were found
"Free Mem" reported this function to be using quite a lot of memory.
Maybe that was related to parsing texts without matching ']' or '#'
Just added some checks to see if they were found.
2018-03-18 23:57:42 +01:00
Unknown 2ebc733b63 [issue #1007] Add other defines as suggested by @uzi18 2018-03-18 23:17:57 +01:00
Unknown 21bc1a7814 #ifndef instead of #ifdef 2018-03-18 22:55:30 +01:00
Unknown 53b8009df6 [issue #1007] Allow user specific data in separate file
File will be ignored by git and can be simply included using `-D USE_OWN_DEFAULTS` in the build
2018-03-18 22:46:15 +01:00
Gijs NoorlanderandGitHub 68a8e5982e Merge pull request #1113 from TD-er/feature/reduce_impact_wifi_disconnect
[Relaxed WiFi] Perform WiFi initialization in steps
2018-03-18 21:53:33 +01:00
Gijs NoorlanderandGitHub 08acfeac97 Merge pull request #1114 from TD-er/feature/wifi_details_json
[JSON] Add uint name (#1099) and WiFi information (PR #1113)
2018-03-18 21:52:24 +01:00
Unknown 999a561515 [JSON] Add uint name (#1099) and WiFi information (PR #1113)
As suggested by @Grovkillen on PR #1113.
2018-03-18 21:51:46 +01:00
Gijs NoorlanderandGitHub 3ee1a4ed2e Merge pull request #1112 from uzi18/fix-p073
Fix p073 - #1111
2018-03-18 21:23:11 +01:00
Gijs NoorlanderandGitHub 05801db47c Changed so that running all tasks immediately with deep sleep enabled… (#1110)
Changed so that running all tasks immediately with deep sleep enabled only happens on first iteration after wake up
2018-03-18 21:22:43 +01:00
Gijs NoorlanderandGitHub 7bec632f15 Merge pull request #1109 from s0170071/memtracker
changed memory tracker to uint64_t for the ESP32
2018-03-18 21:21:18 +01:00
Gijs NoorlanderandGitHub 3f8fe11b47 - add encoder write command #1086 (#1103)
- add encoder write command #1086
2018-03-18 21:17:13 +01:00
Gijs NoorlanderandGitHub 4b8f1e4c1b Add download button for current rule set (#1102)
Add download button for current rule set
2018-03-18 21:13:26 +01:00
Unknown 573fd0f320 [Travis error] Some #include test that wasn't meant to be included
... in the commit.
2018-03-18 21:08:22 +01:00
Unknown 4fa5203c5b [Relaxed WiFi] Perform WiFi initialization in steps
Doing WiFi initialization in multiple steps, will reduce boot time a lot.
For deepsleep the Setup is waiting for wifi initialization to complete, but for normal use the wifi connection is initiated during setup and checked on regular intervals to see if it is available.
The same for WiFi reconnect, which will hopefully not affect the performance of the ESP module during reconnects.

Also added a check + event when connected to another accesspoint with different BSSID (MAC address of accesspoint). Also the last used BSSID is used to reconnect to try to connect to the same device over and over, which may be useful with WiFi repeaters.
2018-03-18 20:54:27 +01:00
Bartlomiej Zimon 9c9617f6ed - initialize pointer in P073 2018-03-18 20:30:47 +01:00
Bartlomiej Zimon bbbf6c483f - fix P073 success setting in PLUGIN_WRITE callback 2018-03-18 20:30:18 +01:00
Bartlomiej Zimon 668909e7b3 - fix success setting 2018-03-18 20:16:37 +01:00
Unknown c642848ef2 [WiFi] Try to minimize effect of WiFi interruptions
And send event when connected to a different accesspoint.
Currently the impact on WiFi reconnects is enorm. The ESP stalls, won't react on events, etc.
2018-03-18 02:51:59 +01:00
s0170071 6eea35aa81 Keep uint. Just change the init value. 2018-03-17 22:58:09 +01:00
Panayotis Kouvarakis 738a48213c Changed so that running all tasks immediately with deep sleep enabled only happens on first iteration after wake up 2018-03-17 23:33:21 +02:00
s0170071 d1c093d109 changed memory tracker to uint64_t for the ESP32 2018-03-17 20:15:48 +01:00
Bartlomiej Zimon 00166a1aad - add encoder write #1086 2018-03-16 19:54:24 +01:00
Bartlomiej Zimon 589238324b Add download button for current rule set 2018-03-16 18:15:52 +01:00
ESPEasy release bot 6787bc8c0e automaticly updated release notes for v2.0-20180316 2018-03-16 04:00:23 +01:00
ESPEasy release bot 6845a03741 automaticly updated release notes for mega-20180316 2018-03-16 04:00:11 +01:00
Unknown 6a4284f189 Merge branch 'v2.0' into mega 2018-03-16 00:44:54 +01:00
Gijs NoorlanderandGitHub cf644b45b1 Merge pull request #1095 from TD-er/merge/PR_1092_1093_1094
Merge/pr 1092 1093 1094
2018-03-16 00:43:16 +01:00
Unknown e6fe1c63a9 [issue #951] Changed System#Initialized => System#Wake
Changed System#Initialized  => System#Wake
New event name makes more sense and Initialized may be used later to indicate all needed connections, etc. are ready.
2018-03-16 00:38:00 +01:00
Unknown df978036f0 [issue #993] variable in MQTT subscribe topic
As [noted](https://github.com/letscontrolit/ESPEasy/issues/993#issuecomment-373140135) by @kluszcyn
2018-03-16 00:37:54 +01:00
Unknown 7cb375833d [issue #1057] AM PM display issue
X:XX PM (for hours 1...9)
X:XX AM (for hours 1...9)
XX:XX PM (for hours 10...12)
XX:XX AM (for hours 10...12)

Added for H:MM (without seconds) notations:
- `%systm_hm%`
-`%systm_hm_am%`
2018-03-16 00:37:45 +01:00
Gijs NoorlanderandGitHub 41c57f1ef9 Merge pull request #1094 from TD-er/bugfix/System_Wake_event
[issue #951] Changed System#Initialized  => System#Wake
2018-03-16 00:35:24 +01:00
Unknown 808b40bdba [issue #951] Changed System#Initialized => System#Wake
Changed System#Initialized  => System#Wake
New event name makes more sense and Initialized may be used later to indicate all needed connections, etc. are ready.
2018-03-16 00:34:32 +01:00
Gijs NoorlanderandGitHub 58b20615da Merge pull request #1093 from TD-er/bugfix/993_parse_sysvars
[issue #993] variable in MQTT subscribe topic
2018-03-15 23:57:01 +01:00
Unknown 13026b1cc4 [issue #993] variable in MQTT subscribe topic
As [noted](https://github.com/letscontrolit/ESPEasy/issues/993#issuecomment-373140135) by @kluszcyn
2018-03-15 23:56:01 +01:00
Gijs NoorlanderandGitHub 7f3460e492 Merge pull request #1092 from TD-er/bugfix/am_pm_time
[issue #1057] AM PM display issue
2018-03-15 23:44:18 +01:00
Unknown a222391f81 [issue #1057] AM PM display issue
X:XX PM (for hours 1...9)
X:XX AM (for hours 1...9)
XX:XX PM (for hours 10...12)
XX:XX AM (for hours 10...12)

Added for H:MM (without seconds) notations:
- `%systm_hm%`
-`%systm_hm_am%`
2018-03-15 23:43:14 +01:00
Unknown a8165531d5 Merge branch 'v2.0' into mega 2018-03-15 23:06:07 +01:00
Gijs NoorlanderandGitHub 3218ea9839 Merge pull request #1091 from TD-er/merge/fixes_1073_1079_1081 into v2.0
Merge/fixes 1073 1079 1081 into v2.0
2018-03-15 23:05:06 +01:00
Gijs Noorlander eca8901fca Fixed multi instance problem on SHT3x #433 (#1081)
Fixed multi instance problem on SHT3x #433
2018-03-15 23:02:04 +01:00
Gijs Noorlander 6635eafe91 [issue #1066] Fix Webserver handle_control (#1079)
[issue #1066] Fix Webserver handle_control
2018-03-15 23:01:52 +01:00
Gijs Noorlander fe4d1f952f MCP3221 allow values for calibration (#1073)
MCP3221 allow values for calibration
2018-03-15 23:01:39 +01:00
Gijs NoorlanderandGitHub 1abd31b421 Fixed multi instance problem on SHT3x #433 (#1081)
Fixed multi instance problem on SHT3x #433
2018-03-15 23:00:05 +01:00
Gijs NoorlanderandGitHub 72fe49d905 [issue #1066] Fix Webserver handle_control (#1079)
[issue #1066] Fix Webserver handle_control
2018-03-15 22:58:38 +01:00
Gijs NoorlanderandGitHub 9dd9f3befa MCP3221 allow values for calibration (#1073)
MCP3221 allow values for calibration
2018-03-15 22:57:14 +01:00
Unknown 471d76dbe6 Merge branch 'v2.0' into mega 2018-03-15 22:55:31 +01:00
Gijs NoorlanderandGitHub 4475a225cc Merge pull request #1090 from TD-er/merge/split_globals_v2.0
Merge/split globals v2.0
2018-03-15 22:46:46 +01:00
Gijs NoorlanderandGitHub 8b047490c4 Merge pull request #1089 from TD-er/merge/split_globals_Mega
Merge/split globals mega
2018-03-15 22:46:28 +01:00
Unknown 455f77d0ed Merge branch 'v2.0' into mega 2018-03-15 22:42:50 +01:00
Unknown 836fc4a875 Merge remote-tracking branch 'uzi18/mega' into merge/split_globals 2018-03-15 22:29:30 +01:00
Unknown 2aece1c143 [v2.0 split globals] Base split on v2.0 version of ESPEasy.ino 2018-03-15 22:23:59 +01:00
Bartlomiej ZimonandUnknown 70df225e7e Merge branch 'mega' of github.com:letscontrolit/ESPEasy into mega
# Conflicts:
#	src/ESPEasy.ino
2018-03-15 22:05:36 +01:00
Unknown 19af52a3ef - move all structs from ESPEasy.ino into header file
- add some fix for headers
- add const to rtttl notes array
2018-03-15 22:05:22 +01:00
Gijs NoorlanderandGitHub 3d396575ff Merge pull request #1088 from TD-er/merge/rules_fix__and_globalsync_toV2.0
Merge/rules fix  and globalsync to v2.0
2018-03-15 21:52:41 +01:00
ESPEasy release bot 873f8474b5 automaticly updated release notes for mega-20180315 2018-03-15 04:00:08 +01:00
mvdbroandUnknown 826deaac89 Rules fix 2018-03-14 21:28:24 +01:00
mvdbroandUnknown cce621cff8 #893, part 2 receiving 2018-03-14 21:28:15 +01:00
mvdbroandUnknown 57eb38dbd0 Custom controller GUI option 2018-03-14 21:28:08 +01:00
mvdbroandUnknown fd2451bb07 #893 part1, send messages 2018-03-14 21:27:50 +01:00
mvdbro c94e5cb903 Rules fix 2018-03-14 19:26:29 +01:00
Bartlomiej Zimon 27699f7192 Merge branch 'mega' of github.com:letscontrolit/ESPEasy into mega
# Conflicts:
#	src/ESPEasy.ino
2018-03-14 19:09:46 +01:00
Bartlomiej Zimon 2eff001b14 Merge branch 'mega' of github.com:letscontrolit/ESPEasy into mega 2018-03-14 18:54:24 +01:00
mvdbro bd499c7a94 #893, part 2 receiving 2018-03-14 13:11:16 +01:00
JK 4da1e4fbdd Fixed #433
Not tested!
2018-03-14 12:19:57 +01:00
mvdbro 1d14770ea7 Custom controller GUI option 2018-03-14 10:45:15 +01:00
ESPEasy release bot 8b7574d298 automaticly updated release notes for mega-20180314 2018-03-14 04:00:11 +01:00
Unknown 14d87d95f6 [issue #1066] Fix Webserver handle_control
There wasn't a proper start/end for the streaming webserver.
See discussion on issue #1066
2018-03-14 01:30:49 +01:00
GHolliandGitHub daecf2017e Update _P049_MHZ19.ino 2018-03-13 21:41:17 +01:00
Holli 37122bc619 It seems the offsets [3]..[4] for the detection range setting (command byte 0x99) are wrong in the latest online data sheet: http://www.winsen-sensor.com/d/files/infrared-gas-sensor/mh-z19b-co2-ver1_0.pdf
According to the MH-Z19B data sheet version 1.2, valid from: 2017.03.22 (received 2018-03-07), the offset should be [6]..[7] instead.
Fixing the implementation accordingly.
2018-03-13 20:22:45 +01:00
mvdbro 5a15288d80 #893 part1, send messages 2018-03-13 16:36:58 +01:00
Bartlomiej Zimon 869dff12ce - move all structs from ESPEasy.ino into header file
- add some fix for headers
- add const to rtttl notes array
2018-03-13 15:53:42 +01:00
ESPEasy release bot cc0b3dac26 automaticly updated release notes for v2.0-20180313 2018-03-13 04:00:23 +01:00
ESPEasy release bot 4208048fc1 automaticly updated release notes for mega-20180313 2018-03-13 04:00:11 +01:00
Unknown 06a2f47812 Merge branch 'v2.0' into mega 2018-03-12 23:20:59 +01:00
Gijs NoorlanderandGitHub d3434eb4d2 Merge/fix rules trailing spaces (#1065) #1074
Merge/fix rules trailing spaces (#1065)
2018-03-12 23:18:22 +01:00
Bartlomiej ZimonandUnknown bd2665041f - remove double trimm() 2018-03-12 23:15:48 +01:00
Bartlomiej ZimonandUnknown 1fd429a029 - fix for #1065 2018-03-12 23:15:40 +01:00
sassod 7b3a71bcc9 12bit ADC values acceted up to 4095
MCP3221 is a 12bit ADC so accepted values should be up to 40195 not 1024
2018-03-12 19:56:42 +01:00
mvdbroandGitHub 18e612dea2 Merge pull request #1067 from uzi18/mega
- fix for #1065
2018-03-12 19:35:51 +01:00
mvdbro f99593ed62 ESP32 C010 fix 2018-03-12 19:34:40 +01:00
sassod 2f7e96fa5b Merge remote-tracking branch 'refs/remotes/origin/mega' into letscontrolit/mega 2018-03-12 18:51:00 +01:00
Bartlomiej Zimon 25b4392dd5 - remove double trimm() 2018-03-12 12:09:07 +01:00
Bartlomiej Zimon ad4130a547 - fix for #1065 2018-03-12 11:42:00 +01:00
ESPEasy release bot e4d4463eab automaticly updated release notes for v2.0-20180312 2018-03-12 04:00:19 +01:00
ESPEasy release bot 991384822f automaticly updated release notes for mega-20180312 2018-03-12 04:00:07 +01:00
Gijs NoorlanderandGitHub b29f56c6f4 Merge pull request #1063 from TD-er/merge/rule_engine_fix
Rule Engine minor fix and added dev debugging
2018-03-12 00:55:49 +01:00
Unknown 779514481d Rule Engine minor fix and added dev debugging 2018-03-12 00:52:30 +01:00
Unknown 82ed319e59 Merge branch 'v2.0' into mega 2018-03-12 00:46:31 +01:00
Gijs NoorlanderandGitHub 0a752dd26f Merge pull request #1062 from TD-er/merge/issue_1039
Merge/issue 1039
2018-03-12 00:44:02 +01:00
Gijs NoorlanderandGitHub 2e4af86a99 Merge pull request #1061 from TD-er/bugfix/chunking_webserver
[webserver] Improve chunked transfer
2018-03-12 00:42:30 +01:00
Unknown 8112e0e67a [webserver] Improve chunked transfer
Do chunked transfer using full buffer on all data sent to the streaming webserver.
2018-03-12 00:42:08 +01:00
Unknown 89a9f842fd [issue #1039 ] Change CSS to show topmost SSID on large screens
For screens with > 960 pixels width.
To show all accesspoints on AP selection.
2018-03-12 00:41:44 +01:00
Gijs NoorlanderandGitHub b4791d3421 Merge pull request #1060 from TD-er/bugfix/selection_accesspoints
[issue #1039 ] Change CSS to show topmost SSID on large screens
2018-03-12 00:40:13 +01:00
Unknown 885c5394a3 [webserver] Improve chunked transfer
Do chunked transfer using full buffer on all data sent to the streaming webserver.
2018-03-12 00:34:51 +01:00
Unknown e35304e4e7 [issue #1039 ] Change CSS to show topmost SSID on large screens
For screens with > 960 pixels width.
To show all accesspoints on AP selection.
2018-03-12 00:32:46 +01:00
mvdbro 6561d577d4 Rule Engine minor fix and added dev debugging 2018-03-11 10:40:54 +01:00
ESPEasy release bot 92932fddb2 automaticly updated release notes for v2.0-20180311 2018-03-11 04:00:19 +01:00
ESPEasy release bot 02d8834763 automaticly updated release notes for mega-20180311 2018-03-11 04:00:06 +01:00
Gijs NoorlanderandGitHub e82080dc52 Merge pull request #1053 from letscontrolit/v2.0
V2.0
2018-03-11 02:07:27 +01:00
Unknown 89581fd0fb [issue #1039] Topmost SSID are covered on mobile Browser
Added <span> tags with a class around the error, which allow the CSS to position the content below the header.
2018-03-11 01:59:51 +01:00
Gijs NoorlanderandGitHub cfbf972c1b [issue #1039] Topmost SSID are covered on mobile Browser (#1052)
[issue #1039] Topmost SSID are covered on mobile Browser
2018-03-11 01:58:13 +01:00
Unknown e25ea52edc [issue #1039] Topmost SSID are covered on mobile Browser
Added <span> tags with a class around the error, which allow the CSS to position the content below the header.
2018-03-11 01:57:24 +01:00
Unknown 3f84a961ad [DNS lookup] Controllers sometimes try to connect to 0.0.0.0
See issue #824
2018-03-11 01:38:50 +01:00
Gijs NoorlanderandGitHub 7d8e5e5175 [DNS lookup] Controllers sometimes try to connect to 0.0.0.0 (#1051)
[DNS lookup] Controllers sometimes try to connect to 0.0.0.0
2018-03-11 01:37:38 +01:00
Unknown 3d39dec686 [DNS lookup] Controllers sometimes try to connect to 0.0.0.0
See issue #824
2018-03-11 01:36:29 +01:00
Unknown ff656593ec Merge branch 'v2.0' into mega 2018-03-10 23:07:53 +01:00
Unknown 96bfaa27f5 [OLED] fix drawProgressBar
See this PR: https://github.com/ThingPulse/esp8266-oled-ssd1306/pull/178
2018-03-10 23:04:03 +01:00
Unknown bcca0514dd [deepsleep] Make sure the 'shortcut' of running all services when sleep enabled
As pointed out on [the forum by arion_p](https://www.letscontrolit.com/forum/viewtopic.php?p=25771#p25771)
2018-03-10 23:03:55 +01:00
Gijs NoorlanderandGitHub 90b4e3438d [OLED] fix drawProgressBar (#1048)
[OLED] fix drawProgressBar
2018-03-10 22:58:25 +01:00
Gijs NoorlanderandGitHub 139f8905d0 [deepsleep] Use the 'shortcut' of running all when sleep enabled (#1047)
[deepsleep] Use the 'shortcut' of running all when sleep enabled
2018-03-10 22:55:59 +01:00
Unknown 6c1806fae6 [OLED] fix drawProgressBar
See this PR: https://github.com/ThingPulse/esp8266-oled-ssd1306/pull/178
2018-03-10 22:53:18 +01:00
Unknown e6b581e7ff [deepsleep] Make sure the 'shortcut' of running all services when sleep enabled
As pointed out on [the forum by arion_p](https://www.letscontrolit.com/forum/viewtopic.php?p=25771#p25771)
2018-03-10 22:42:04 +01:00
Gijs NoorlanderandGitHub bb9f8fc809 Merge pull request #1046 from TD-er/merge/mega_to_v2.0
Merge/mega to v2.0
2018-03-10 22:03:14 +01:00
Unknown 4d9504bce0 [P073] Remove tm1637_bitDelay()
Not used anymore
2018-03-10 22:01:27 +01:00
Unknown ff3a769033 Update P07 Plugin
added suppor for other version of TM1637 modules (4dgt+colon, 4dgt+dots,6dgt+dots)
2018-03-10 22:01:20 +01:00
Unknown e3de56a7a8 [AM/PM] Am/Pm notation doesn't have '0' hours
11.59 a.m. => 12.00 p.m.
12.59 p.m. => 1.00 p.m.
11.59 p.m. => 12.00 a.m.
2018-03-10 22:01:04 +01:00
Gijs NoorlanderandGitHub 873d639461 Update P073 Plugin - support extra versions of TM1637 modules (@Papperone) (#1043)
Update P073 Plugin - support extra versions of TM1637 modules  (@Papperone)
2018-03-10 21:58:14 +01:00
Gijs NoorlanderandGitHub edb2a6d3f6 [AM/PM] Am/Pm notation doesn't have '0' hours (#1044)
[AM/PM] Am/Pm notation doesn't have '0' hours
2018-03-10 21:56:42 +01:00
Gijs NoorlanderandGitHub 2682b0bd2f [v2.0] Merge/rules process speed improvements (#1045)
[v2.0] Merge/rules process speed improvements
2018-03-10 21:55:25 +01:00
Unknown 5097157a09 Final ruleset speed-up
It's now down from 100 mSec to 19 mSec for 1 fully loaded non matching ruleset.
2018-03-10 21:41:13 +01:00
Unknown 02ea957894 Add read buffer to rule processing to speedup parsing
On a full ruleset (2k), a non matching event takes 100 mSec instead of 170 mSec.
2018-03-10 21:39:51 +01:00
mvdbroandUnknown c2b0d76595 Rule Engine, stop waisting time on non matching rules 2018-03-10 21:38:01 +01:00
Unknown 91b7cbe075 Improve flash read performance 2018-03-10 21:37:47 +01:00
Unknown bff60a2e27 [P073] Remove tm1637_bitDelay()
Not used anymore
2018-03-10 21:28:09 +01:00
Unknown 61831e5962 [AM/PM] Am/Pm notation doesn't have '0' hours
11.59 a.m. => 12.00 p.m.
12.59 p.m. => 1.00 p.m.
11.59 p.m. => 12.00 a.m.
2018-03-10 21:19:35 +01:00
Unknown d105b47d44 Update P07 Plugin
added suppor for other version of TM1637 modules (4dgt+colon, 4dgt+dots,6dgt+dots)
2018-03-10 18:38:33 +01:00
mvdbro 449568bcc4 Final ruleset speed-up
It's now down from 100 mSec to 19 mSec for 1 fully loaded non matching ruleset.
2018-03-10 16:53:02 +01:00
mvdbro 3144077103 Add read buffer to rule processing to speedup parsing
On a full ruleset (2k), a non matching event takes 100 mSec instead of 170 mSec.
2018-03-10 15:48:56 +01:00
mvdbro 8f056be0a8 Rule Engine, stop waisting time on non matching rules 2018-03-10 10:48:03 +01:00
mvdbro e9cdc5693d Improve flash read performance 2018-03-10 08:51:35 +01:00
ESPEasy release bot 64b38df187 automaticly updated release notes for v2.0-20180310 2018-03-10 04:00:20 +01:00
ESPEasy release bot 377c50ec36 automaticly updated release notes for mega-20180310 2018-03-10 04:00:07 +01:00
Gijs NoorlanderandGitHub 76f6dfdc59 Merge Mega -> v2.0: conversions & delay wifi init (#1037)
Merge Mega -> v2.0: conversions  & delay wifi init
2018-03-09 23:20:47 +01:00
Unknown 3a6f7acd15 [Conversions] Use more decimals in conversions and add AM/PM for time.
See comments on #1015
2018-03-09 23:19:19 +01:00
Unknown d65b126f84 Move plugin init before WiFi init
As suggested at PR #1032 by @M0ebiu5
2018-03-09 23:18:10 +01:00
Gijs NoorlanderandGitHub 90a2a799da [Conversions] Use more decimals in conversions and add AM/PM for time. (#1036)
[Conversions] Use more decimals in conversions and add AM/PM for time.
2018-03-09 23:15:48 +01:00
Unknown feb419b6ae [Conversions] Use more decimals in conversions and add AM/PM for time.
See comments on #1015
2018-03-09 23:13:03 +01:00
Gijs NoorlanderandGitHub e83d8468b0 Move plugin init before WiFi init (#1035)
Move plugin init before WiFi init
2018-03-09 22:18:35 +01:00
Unknown 6eabaaa62d Move plugin init before WiFi init
As suggested at PR #1032 by @M0ebiu5
2018-03-09 22:10:25 +01:00
ESPEasy release bot 8299e38b24 automaticly updated release notes for v2.0-20180309 2018-03-09 04:00:22 +01:00
ESPEasy release bot b0169b4aa7 automaticly updated release notes for mega-20180309 2018-03-09 04:00:11 +01:00
Unknown 786ec4714a Merge branch 'v2.0' into mega 2018-03-09 00:37:47 +01:00
Gijs NoorlanderandGitHub 67a28a7f97 Add other simple conversions like Celsius to Fahrenheit (#1033)
[issue #1015] Add other simple conversions like Celsius to Fahrenheit…
2018-03-09 00:35:06 +01:00
Unknown 18b8e61d32 [issue #1015] Add other simple conversions like Celsius to Fahrenheit, etc.
- %c_w_dir%   -  getBearing 
- %c_c2f%   -    String(CelsiusToFahrenheit) 
- %c_ms2Bft%   - String(m_secToBeaufort) 
- %c_cm2imp%   - centimeterToImperialLength 
- %c_mm2imp%   - millimeterToImperialLength 
- %c_m2day%   -  String(minutesToDay) 
- %c_m2dh%   -   minutesToDayHour 
- %c_m2dhm%   -  minutesToDayHourMinute 
- %c_s2dhms%   - secondsToDayHourMinuteSecond
2018-03-09 00:31:27 +01:00
Unknown 5821b0709c [issue #1015] Add other simple conversions like Celsius to Fahrenheit, etc.
- %c_w_dir%   -  getBearing 
- %c_c2f%   -    String(CelsiusToFahrenheit) 
- %c_ms2Bft%   - String(m_secToBeaufort) 
- %c_cm2imp%   - centimeterToImperialLength 
- %c_mm2imp%   - millimeterToImperialLength 
- %c_m2day%   -  String(minutesToDay) 
- %c_m2dh%   -   minutesToDayHour 
- %c_m2dhm%   -  minutesToDayHourMinute 
- %c_s2dhms%   - secondsToDayHourMinuteSecond
2018-03-09 00:29:52 +01:00
Unknown ec783fe03b [Rule Events] Add a number of events to handle in rules and awake timer
Changed the sleep checkbox to allow a number of seconds awake from deep sleep.

Also added the following events:

- MQTT#Connected
- WiFi#Connected
- System#Initialized
- Time#Set    Time set by an update from NTP.
- Time#Initialized  Time set for the first time since boot.
- Login#Failed

See #951
2018-03-08 23:00:33 +01:00
Gijs NoorlanderandGitHub 4d749b19fd [Rule Events] Add a number of events to handle in rules and awake timer (#1032)
[Rule Events] Add a number of events to handle in rules and awake timer
2018-03-08 22:55:19 +01:00
Unknown 6a66440a5f [Rule Events] Add a number of events to handle in rules and awake timer
Changed the sleep checkbox to allow a number of seconds awake from deep sleep.

Also added the following events:

- MQTT#Connected
- WiFi#Connected
- System#Initialized 
- Time#Set    Time set by an update from NTP.
- Time#Initialized  Time set for the first time since boot.
- Login#Failed

See #951
2018-03-08 21:43:52 +01:00
ESPEasy release bot 1b23efe48c automaticly updated release notes for mega-20180308 2018-03-08 04:00:08 +01:00
mvdbro 9a9d39763f Second step towards port monitoring without tasks 2018-03-07 16:17:40 +01:00
mvdbro 9f94ef073c First step towards port monitoring without tasks 2018-03-07 14:13:12 +01:00
ESPEasy release bot 9122565431 automaticly updated release notes for v2.0-20180307 2018-03-07 04:00:21 +01:00
ESPEasy release bot 000d2d7c77 automaticly updated release notes for mega-20180307 2018-03-07 04:00:09 +01:00
Unknown 64a0f79e02 [issue #1012] Removed Content-Length header + improved webserver speed
See: Web interface doesn't work on iOS #1012

The operatore+= String function now chunks long strings
2018-03-07 00:56:23 +01:00
Gijs NoorlanderandGitHub c1b945e6c1 [issue #1012] Removed Content-Length header + improved webserver speed (#1027)
[issue #1012] Removed Content-Length header + improved webserver speed
2018-03-07 00:55:48 +01:00
Unknown dbbe6b65dd [issue #1012] Removed Content-Length header + improved webserver speed
See: Web interface doesn't work on iOS #1012

The operatore+= String function now chunks long strings
2018-03-07 00:54:23 +01:00
Gijs Noorlander 92e4a8da9b [CSS] Quick fix for smaller displays (#1026)
[CSS] Quick fix for smaller displays by @doxikus
2018-03-06 21:53:54 +01:00
Gijs NoorlanderandGitHub 4611ef5d87 [CSS] Quick fix for smaller displays (#1026)
[CSS] Quick fix for smaller displays by @doxikus
2018-03-06 21:52:15 +01:00
Unknown 807cc1796d [CSS] Quick fix for smaller displays
Quick fix, created by @doxikus
2018-03-06 21:50:54 +01:00
soif 4bca2c6361 Initial re-organisation of plugin sets (#1019) 2018-03-06 09:53:17 +01:00
ESPEasy release bot 40e2d7ec8e automaticly updated release notes for v2.0-20180306 2018-03-06 04:00:17 +01:00
Gijs NoorlanderandDatuX 7318e87965 Fixes P073 plugin for latest TM1637 based 7 segments displays modules (#996) (#1022)
Fixes P073 plugin for latest TM1637 based 7 segments displays modules
2018-03-05 20:17:51 +01:00
ESPEasy release bot 9c3a28439f automaticly updated release notes for v2.0-20180305 2018-03-05 04:00:20 +01:00
ESPEasy release bot 82933ae170 automaticly updated release notes for mega-20180305 2018-03-05 04:00:08 +01:00
Unknown 503fd3555e Merge branch 'v2.0' into mega 2018-03-05 00:40:22 +01:00
Gijs NoorlanderandGitHub 127627a22c [issue #1003 ] Add conversion of wind direction to string (#1014)
[issue #1003 ] Add conversion of wind direction to string
2018-03-05 00:37:44 +01:00
Gijs NoorlanderandGitHub e59401e24f [issue #528] Set DOUT flash mode for all 1M builds (#1013)
[issue #528] Set DOUT flash mode for all 1M builds
2018-03-05 00:36:39 +01:00
Unknown 769f76d3dc [issue #1003 ] Add conversion of wind direction to string
Also made some clean-up of calls to string replacements.
Improved the lookup function to determine the wind direction (was 11.25 degree off)
Now it is also possible to add simple standard conversions like Celcius-Fahrenheit, m/s - Beaufort, etc.
2018-03-05 00:28:32 +01:00
Unknown 4eb7cf0859 [issue #528] Set DOUT flash mode for all 1M builds
See [this elaborate post on the different flash modes](https://www.esp32.com/viewtopic.php?t=1250)
2018-03-04 22:30:13 +01:00
Edwin Eefting a464f638ad automaticly updated release notes for v2.0-20180304b 2018-03-04 18:20:49 +01:00
Edwin Eefting f31cce4182 Merge branch 'v2.0' into mega 2018-03-04 18:14:58 +01:00
Edwin Eefting a5cfe1beec dont build in silent mode to prevent travis timeouts 2018-03-04 18:14:27 +01:00
Edwin Eefting f36fada375 Merge branch 'v2.0' into mega 2018-03-04 18:12:07 +01:00
soifandDatuX d51bce97f5 fixes typos in the issue template (#1006) 2018-03-04 18:09:34 +01:00
soifandDatuX 0368aa4d43 Add OS specific hidden files (#1005) 2018-03-04 18:09:08 +01:00
mvdbro 3c4aa7564f ESP32 - 32 Tasks -redo commit 2018-03-04 17:34:08 +01:00
mvdbro f46b89f1bd Merge branch 'mega' of https://github.com/letscontrolit/ESPEasy into mega 2018-03-04 17:15:43 +01:00
mvdbro 4e2b78056a ESP32 - 32 Tasks
Full reset needed!
2018-03-04 17:14:35 +01:00
Gijs NoorlanderandGitHub d94ce17fd4 Merge pull request #1009 from TD-er/bugfix/factory_reset_twice
[Webserver] Factory Reset was present twice
2018-03-04 16:27:16 +01:00
Unknown cd2c59ba5b [Webserver] Factory Reset was present twice
See issue #1008
2018-03-04 16:26:07 +01:00
mvdbro b6a6943668 ESP32 fix-2 for P020/P044
This time it actually works.
2018-03-04 12:27:38 +01:00
ESPEasy release bot a8fcb420e7 automaticly updated release notes for v2.0-20180304 2018-03-04 04:00:19 +01:00
ESPEasy release bot e1e894d540 automaticly updated release notes for mega-20180304 2018-03-04 04:00:08 +01:00
Unknown d15311e70a Merge branch 'v2.0' into mega 2018-03-04 00:50:43 +01:00
Gijs NoorlanderandGitHub 3ed6564063 [issue #892 ] Only use sensor type when really needed (#1004)
[issue #892 ] Only use sensor type when really needed
2018-03-04 00:45:52 +01:00
Unknown 5f575c0224 [issue #892 ] Only use sensor type when really needed
Only the Domoticz controllers need the sensor type. The rest just needs the number of sensor values.
2018-03-04 00:37:18 +01:00
Gijs NoorlanderandGitHub 34c1ba158f [issue #993] Add %unit% variable in MQTT subscribe topic (PR #1002)
[issue #993] Add %unit% variable in MQTT subscribe topic
2018-03-03 22:40:18 +01:00
Unknown 04ca424085 [issue #993] Add %unit% variable in MQTT subscribe topic 2018-03-03 22:39:09 +01:00
Gijs Noorlander 7a8f476e05 _P072_HDC1080 allow to send values to the controllers (#999)
_P072_HDC1080 add success and break statement.
it seems that without the break statement and success set to true, the values aren't sent back to the controller(s).
2018-03-03 21:30:22 +01:00
Gijs NoorlanderandGitHub eef8391ffc _P072_HDC1080 allow to send values to the controllers (#999)
_P072_HDC1080 add success and break statement.
it seems that without the break statement and success set to true, the values aren't sent back to the controller(s).
2018-03-03 21:29:12 +01:00
Gijs NoorlanderandGitHub d47751c31f Fixes P073 plugin for latest TM1637 based 7 segments displays modules (#996)
Fixes P073 plugin for latest TM1637 based 7 segments displays modules
2018-03-03 20:40:11 +01:00
Gijs Noorlander e42ab85f4b Merge pull request #1000 from uzi18/test3 (more comparisions in IF condition)
support for more comparisions in IF condition: >=,<=,!=,<>,<,>,= also fix extended conditions when first check is not '>'
2018-03-03 20:38:13 +01:00
Gijs NoorlanderandGitHub b048d3f1f8 Merge pull request #1000 from uzi18/test3 (more comparisions in IF condition)
support for more comparisions in IF condition: >=,<=,!=,<>,<,>,= also fix extended conditions when first check is not '>'
2018-03-03 20:37:07 +01:00
Bartlomiej Zimon f94ab3a04a - support for more comparisions in IF conditions: >=,<=,!=,<>,<,>,=
also fix extended conditions when first check is not >
2018-03-03 16:04:44 +01:00
mvdbro 1b9375f83b ESP32 Dallas DS18B20 fix
This is a quick fix for this sensor only. It seems that ESP32 RTOS needs more or differtent interrupt handling for time critical sensor code.
2018-03-03 14:08:20 +01:00
clumsy-stefanandGitHub a77798d18f add success and break statement
it seems that without the break statement and success set to true, the values aren ot sent back to the controller(s).
2018-03-03 13:05:25 +01:00
ESPEasy release bot 3094cb5260 automaticly updated release notes for v2.0-20180303 2018-03-03 04:00:19 +01:00
ESPEasy release bot ec4dd09968 automaticly updated release notes for mega-20180303 2018-03-03 04:00:08 +01:00
Unknown d68a5fb9d4 Merge branch 'v2.0' into mega 2018-03-03 02:23:03 +01:00
Gijs NoorlanderandGitHub 0e67480f46 Merge pull request #995 from TD-er/bugfix/mqtt_proper_case
Bugfix/mqtt proper case
2018-03-03 02:19:49 +01:00
Unknown c32f2cc89d Add AND/OR to rules & prevent unwanted case changes in strings (#994) 2018-03-03 02:09:41 +01:00
Unknown ad489f0db2 [Issue #827] MQTT not using proper case for %sysname% variable.
Some functions and plugins could change strings to lowercase.
Added some check also to help debugging.
2018-03-03 02:03:20 +01:00
Gijs NoorlanderandGitHub d9267fa9c2 Add Task device type to json by @s0170071 (#991)
Add Task device type to json by @s0170071
2018-03-02 22:40:20 +01:00
Unknown e82fb37870 Add Task device type to json by @s0170071
Taken from his branch, he forgot to PR.
2018-03-02 22:30:55 +01:00
Unknown 635c149f12 Merge branch 'v2.0' into mega 2018-03-02 22:16:37 +01:00
Gijs NoorlanderandGitHub 26f00dcdec [issue #293] json output nan values not double quoted (#990)
[issue #293] json output nan values not double quoted
2018-03-02 22:03:07 +01:00
Unknown b2bb1d039b [issue #293] json output nan values not double quoted
Generate valid JSON output
2018-03-02 21:49:06 +01:00
soif 57e256a5fa Fixes P073 plugin for latest TM1637 based 7 segments displays modules 2018-03-02 21:06:45 +01:00
Unknown c58e975b7e revert json to non-chunking #988 from s0170071/mega
revert json to non-chunking
2018-03-02 20:40:13 +01:00
Gijs NoorlanderandGitHub 7d16ffa4a4 revert json to non-chunking #988 from s0170071/mega
revert json to non-chunking
2018-03-02 20:36:42 +01:00
s0170071 856e370ba0 make handle_json return void 2018-03-02 15:00:48 +01:00
s0170071 4df9e7d065 Add git build and local time 2018-03-02 13:58:05 +01:00
s0170071 edb3857e04 revert json to non-chunking 2018-03-02 13:17:20 +01:00
ESPEasy release bot 08312cbcb7 automaticly updated release notes for v2.0-20180302 2018-03-02 04:00:21 +01:00
ESPEasy release bot fb1cc219ee automaticly updated release notes for mega-20180302 2018-03-02 04:00:10 +01:00
Unknown da7329891d Merge branch 'v2.0' into mega 2018-03-02 02:08:55 +01:00
Gijs NoorlanderandGitHub 953a53bb9a Merge pull request #985 from TD-er/bugfix/json_content-length
backport of "rule wildcard" + improve formatting of Webserver's StreamingBuffer
2018-03-02 01:58:53 +01:00
Unknown e9fac7926f [webserver] Layout of code to improve readability
Indentation was completely off, which made it hard to read.
Also added member json_format, which is set at start of stream.
2018-03-02 01:53:40 +01:00
mvdbroandUnknown 810a0b2aa9 Rule wildcard option on literal events
Added wildcard rule filter on literal string events
Changed "sendcontent free"content logging level to 'DEV'
2018-03-01 23:41:42 +01:00
Unknown 7f897bc856 Merge branch 'v2.0' into mega
Merge initiated from GitKraken directly on Letscontrol_it/ESPEasy
2018-03-01 23:31:00 +01:00
Gijs NoorlanderandGitHub 5d9137d1d2 Merge pull request #976 from TD-er/bugfix/P053_PMSx003DustPlugin
[issue #914] _P053_PMSx003 Dust Sensor looses sync
2018-03-01 23:07:38 +01:00
Gijs Noorlander 8de49cd38e Merge pull request #983 from kahvm/mega
Added support for degree sign on LCD1602/2004
2018-03-01 22:42:58 +01:00
Gijs NoorlanderandGitHub 0092ba92b5 Merge pull request #983 from kahvm/mega
Added support for degree sign on LCD1602/2004
2018-03-01 22:41:54 +01:00
Gijs NoorlanderandGitHub fe1c44f6b3 Merge pull request #980 from uzi18/formatout
Format output marge from mega to v2.0
2018-03-01 22:34:08 +01:00
Gijs NoorlanderandGitHub e39d588530 Merge pull request #975 from TD-er/merge/important_fixes_from_mega
Merge/important fixes from mega
2018-03-01 22:31:36 +01:00
kahvmandGitHub 7a4e3d954d Merge pull request #1 from kahvm/support-degree-sign-lcd1602
Support for degree sign on LCD1602
2018-03-01 22:00:41 +01:00
kahvmandGitHub 9dc4fefa0b Support for degree sign on LCD1602
More: https://www.letscontrolit.com/forum/viewtopic.php?p=11875#p11875
2018-03-01 20:09:50 +01:00
Unknown 4ca318f5a6 [Build error fix] Must-keep-focus-when-pressing-buttons...
Quickly commit + merge is never a good idea when some visitors arrive...
Fixed now.
2018-03-01 20:08:51 +01:00
mvdbro 695bb58d64 Rule wildcard option on literal events
Added wildcard rule filter on literal string events
Changed "sendcontent free"content logging level to 'DEV'
2018-03-01 14:29:10 +01:00
Bartlomiej Zimon 608a7212eb Merge branch 'mega' of github.com:letscontrolit/ESPEasy into test3 2018-03-01 03:02:23 +01:00
Bartłomiej ZimońandBartlomiej Zimon 37a24933f5 add format #O to templates to show OFF/ON instead 0/1 (#949)
* - pcfgpio,port,2 sets pin as input
- fix for #222,#702 - we can mix inputs and outputs now

* - extend conditions with AND/OR, now it is possible to simplify rules

test rules:
on test do
  if [test#a]=0 or [test#b]=0 or [test#c]=0
    event ok
  else
    event nok
  endif
endon

on test2 do
  if [test#a]=1 and [test#b]=1 and [test#c]=1
    event ok
  else
    event nok
  endif
endon

on test3 do
  if [test#a]=1 and [test#b]=1 or [test#c]=0
    event ok
  else
    event nok
  endif
endon

on test4 do
  if [test#a]=0
    event ok
  else
    event nok
  endif
endon

* - remove Serial print

* - add format #O to templates to show OFF/ON instead 0/1 - eg.: Pump:[Outputs#pump#O]

* - add formating for active low outputs eg.: #O!
2018-02-28 23:06:01 +01:00
Bartlomiej Zimon a6b447600f Merge branch 'v2.0' of github.com:letscontrolit/ESPEasy into v2.0 2018-02-28 22:43:52 +01:00
Unknown 5fbb900e5b [issue #914] Check first 2 bytes of packet 2018-02-28 22:39:34 +01:00
ESPEasy release bot aa5dee01fb automaticly updated release notes for v2.0-20180228 2018-02-28 04:00:20 +01:00
ESPEasy release bot 4e2a5d3b3d automaticly updated release notes for mega-20180228 2018-02-28 04:00:09 +01:00
Unknown 1a44ed6578 [issue #914] _P053_PMSx003 Dust Sensor looses sync
- Use peek instead of read, to make sure a complete packet is in the buffer.
- Flush buffer after processing a packet.
- Increased software serial buffer to the size of 3 packets.
- Peek (+ read garbage) 10 times per second to get the buffer in sync to start with start byte of packet.
- Decent delete + clean up of software serial allocation when changing settings (prevent memory leak)
- Move log String allocation to inside scope of function, not permanent allocated.
- Split into separate functions to make it better readable.
2018-02-28 02:11:33 +01:00
Bartłomiej ZimońandUnknown e86667e37e fix #964, add timeStringToSeconds and use it to compare time conditions (#965)
* - pcfgpio,port,2 sets pin as input
- fix for #222,#702 - we can mix inputs and outputs now

* - extend conditions with AND/OR, now it is possible to simplify rules

test rules:
on test do
  if [test#a]=0 or [test#b]=0 or [test#c]=0
    event ok
  else
    event nok
  endif
endon

on test2 do
  if [test#a]=1 and [test#b]=1 and [test#c]=1
    event ok
  else
    event nok
  endif
endon

on test3 do
  if [test#a]=1 and [test#b]=1 or [test#c]=0
    event ok
  else
    event nok
  endif
endon

on test4 do
  if [test#a]=0
    event ok
  else
    event nok
  endif
endon

* - remove Serial print

* - add format #O to templates to show OFF/ON instead 0/1 - eg.: Pump:[Outputs#pump#O]

* - add formating for active low outputs eg.: #O!

* - fix #964, add timeStringToSeconds and use it to compare time conditions

* - fix number of pages available to browse
2018-02-28 00:00:37 +01:00
s0170071andUnknown 0db1f78421 Add Factory Reset button to web interface (#954) 2018-02-27 23:59:31 +01:00
Bartłomiej ZimońandUnknown 780c34846e add format #O to templates to show OFF/ON instead 0/1 (#949)
* - pcfgpio,port,2 sets pin as input
- fix for #222,#702 - we can mix inputs and outputs now

* - extend conditions with AND/OR, now it is possible to simplify rules

test rules:
on test do
  if [test#a]=0 or [test#b]=0 or [test#c]=0
    event ok
  else
    event nok
  endif
endon

on test2 do
  if [test#a]=1 and [test#b]=1 and [test#c]=1
    event ok
  else
    event nok
  endif
endon

on test3 do
  if [test#a]=1 and [test#b]=1 or [test#c]=0
    event ok
  else
    event nok
  endif
endon

on test4 do
  if [test#a]=0
    event ok
  else
    event nok
  endif
endon

* - remove Serial print

* - add format #O to templates to show OFF/ON instead 0/1 - eg.: Pump:[Outputs#pump#O]

* - add formating for active low outputs eg.: #O!
2018-02-27 23:58:50 +01:00
Edwin Eefting a4dcc304a9 Merge branch 'v2.0' into mega 2018-02-27 23:43:36 +01:00
Gijs NoorlanderandDatuX a938bc78c1 [issue #968] Use template parser for OLED commands (#974)
N.B. Now even task values can be used in commands, next to special characters.
2018-02-27 23:43:18 +01:00
Gijs NoorlanderandDatuX d2c7743197 [issue #966] Add %sysweekday% and %sysweekday_s% (#973)
- %sysweekday%  number of the day (Sunday = 1)
- %sysweekday_s%  3 letter String of the weekday (Sun, Mon, Tue, ...)
2018-02-27 23:43:01 +01:00
Bartłomiej ZimońandDatuX f0fc20de57 fix #964, add timeStringToSeconds and use it to compare time conditions (#965)
* - pcfgpio,port,2 sets pin as input
- fix for #222,#702 - we can mix inputs and outputs now

* - extend conditions with AND/OR, now it is possible to simplify rules

test rules:
on test do
  if [test#a]=0 or [test#b]=0 or [test#c]=0
    event ok
  else
    event nok
  endif
endon

on test2 do
  if [test#a]=1 and [test#b]=1 and [test#c]=1
    event ok
  else
    event nok
  endif
endon

on test3 do
  if [test#a]=1 and [test#b]=1 or [test#c]=0
    event ok
  else
    event nok
  endif
endon

on test4 do
  if [test#a]=0
    event ok
  else
    event nok
  endif
endon

* - remove Serial print

* - add format #O to templates to show OFF/ON instead 0/1 - eg.: Pump:[Outputs#pump#O]

* - add formating for active low outputs eg.: #O!

* - fix #964, add timeStringToSeconds and use it to compare time conditions

* - fix number of pages available to browse
2018-02-27 23:42:20 +01:00
ESPEasy release bot d35a50be17 automaticly updated release notes for v2.0-20180227 2018-02-27 04:00:22 +01:00
ESPEasy release bot 537d4cd1e9 automaticly updated release notes for mega-20180227 2018-02-27 04:00:11 +01:00
Edwin Eefting 62422f4924 Merge branch 'v2.0' into mega 2018-02-27 00:42:15 +01:00
Edwin Eefting 04de145dbb [test suite] changes from mega to 2.0 2018-02-27 00:41:27 +01:00
Edwin Eefting 21840d0b26 [test suite] changes from mega to 2.0 2018-02-27 00:41:21 +01:00
Gijs NoorlanderandDatuX 076ce0127b [build conflict] Renamed ESP32 version of ping (#963)
Had a conflict with the ESP8266 version of ping.
Let's hope I did not break anything with the ESP32 builds @mvdbro does.
2018-02-27 00:10:17 +01:00
Edwin Eefting 226c0a6f83 Merge branch 'v2.0' into mega 2018-02-26 23:03:48 +01:00
s0170071andDatuX 6ffa8d92a6 Add Factory Reset button to web interface (#954) 2018-02-26 22:54:24 +01:00
Bartłomiej ZimońandDatuX dae2cc2f4a add format #O to templates to show OFF/ON instead 0/1 (#949)
* - pcfgpio,port,2 sets pin as input
- fix for #222,#702 - we can mix inputs and outputs now

* - extend conditions with AND/OR, now it is possible to simplify rules

test rules:
on test do
  if [test#a]=0 or [test#b]=0 or [test#c]=0
    event ok
  else
    event nok
  endif
endon

on test2 do
  if [test#a]=1 and [test#b]=1 and [test#c]=1
    event ok
  else
    event nok
  endif
endon

on test3 do
  if [test#a]=1 and [test#b]=1 or [test#c]=0
    event ok
  else
    event nok
  endif
endon

on test4 do
  if [test#a]=0
    event ok
  else
    event nok
  endif
endon

* - remove Serial print

* - add format #O to templates to show OFF/ON instead 0/1 - eg.: Pump:[Outputs#pump#O]

* - add formating for active low outputs eg.: #O!
2018-02-26 22:53:15 +01:00
Gijs NoorlanderandDatuX 555ccbe229 [BuildError] StreamingBuffer code cleanup + fix order member initialize (#961)
The order in which the members are defined should also be the order in which they will be initialized.

Also applied #958
2018-02-26 22:52:27 +01:00
mvdbro d277d22914 Fix ESP32 compile errors 2018-02-26 14:26:17 +01:00
ESPEasy release bot b5e4994392 automaticly updated release notes for v2.0-20180226 2018-02-26 04:00:21 +01:00
ESPEasy release bot cbdddf8c06 automaticly updated release notes for mega-20180226 2018-02-26 04:00:08 +01:00
Gijs NoorlanderandGitHub 8b5d22a081 Merge pull request #948 from TD-er/build/remove_duplicate_library
[softwareSerial] Remove duplicate with only capilization as difference
2018-02-25 21:29:09 +01:00
Unknown 88fc0a8445 [softwareSerial] Remove duplicate with only capilization as difference 2018-02-25 21:27:57 +01:00
Gijs NoorlanderandGitHub ec9187d038 Merge pull request #947 from letscontrolit/v2.0
V2.0 => Mega: Ping library and Webserver@LowMemory
2018-02-25 21:20:37 +01:00
s0170071andUnknown 51ede17d2a Update WebServer.ino 2018-02-25 21:15:33 +01:00
s0170071andUnknown 97ee69b371 V20 Webserver@LowMemory 2018-02-25 21:15:24 +01:00
Unknown f77ce9c8f7 [ping lib] Added ping library
It was linked as a dependency in PlatformIO.ini, but apparently will add complexity to Arduino IDE users.
2018-02-25 21:14:07 +01:00
Edwin Eefting 99cc6f72af Merge branch 'v2.0' into mega 2018-02-25 17:18:59 +01:00
Gijs NoorlanderandDatuX 848f43b704 [2k Webserver] Proper initialisation of StreamingBuffer members. (#941)
Was reported in Travis as build error.
2018-02-25 17:17:47 +01:00
Edwin Eefting 3a5ef5da81 device page doesnt need next/previous page buttons anymore 2018-02-25 17:12:45 +01:00
Edwin Eefting 3527b69718 Merge branch 'v2.0' into mega 2018-02-25 16:57:03 +01:00
Gijs NoorlanderandDatuX 54628bfca9 [timeouts] Improve response when hosts are not reachable (#939)
See #922 and #847

Problem with DNS resolve is that it is quite slow when resulting in a failure and it tends to keep the ESP occupied and make it unresponsive.

Changed the way it is connecting to a controller.
Not sure if http requests are still OK, maybe we should make an exception for those when selected to use DNS.
2018-02-25 14:15:56 +01:00
Gijs NoorlanderandDatuX 72ff745eff [Mega] rename SoftwareSerial lib #930 (#937)
Just a rename of the library directory + some notes in the library description to indicate the differences.
2018-02-25 14:12:59 +01:00
Gijs NoorlanderandDatuX aed566b6db [v2.0] Use ESPeasySoftwareSerial (#936)
This one has virtual destructor and will use less memory.
See issue #930.
2018-02-25 14:12:33 +01:00
Gijs NoorlanderandDatuX 504ea0c813 [v2.0 merge] 2kwebserver_merge_to_mega #929 (#934)
The v2.0 branch merge of the 2k webserver PR.
As test build, please try [these builds](https://www.dropbox.com/s/ky6ldixh6wgzd8k/2k_webserver_build_v2.0_20180221.rar?dl=0)
2018-02-25 14:12:11 +01:00
Gijs NoorlanderandDatuX 4ca5ef3f72 [v2.0] Added Vcc-binaries to deploy process #933 (#935)
PR for the V2.0 branch to add the VCC binaries to the deploy process.
2018-02-25 14:11:34 +01:00
Michael SchröderandDatuX dd9db3b557 Added Vcc-binaries to deploy process (#933) 2018-02-25 14:11:25 +01:00
Bartłomiej ZimońandDatuX 9c531b30bc - extend conditions with AND/OR, now it is possible to simplify rules (#932)
* - pcfgpio,port,2 sets pin as input
- fix for #222,#702 - we can mix inputs and outputs now

* - extend conditions with AND/OR, now it is possible to simplify rules

test rules:
on test do
  if [test#a]=0 or [test#b]=0 or [test#c]=0
    event ok
  else
    event nok
  endif
endon

on test2 do
  if [test#a]=1 and [test#b]=1 and [test#c]=1
    event ok
  else
    event nok
  endif
endon

on test3 do
  if [test#a]=1 and [test#b]=1 or [test#c]=0
    event ok
  else
    event nok
  endif
endon

on test4 do
  if [test#a]=0
    event ok
  else
    event nok
  endif
endon

* - remove Serial print
2018-02-25 14:04:55 +01:00
Bartłomiej ZimońandDatuX 67c8477a61 provide System@Sleep event (#875) (#931)
- provide System@Sleep event
- fixes #870 (mqtt not sent before sleep)
- call deepsleep at the end of loop - so we know all is done
2018-02-25 14:01:40 +01:00
Edwin Eefting cd30b81202 Merge branch '2kwebservermergetomega' of https://github.com/s0170071/ESPEasy into mega 2018-02-25 13:55:28 +01:00
s0170071andDatuX 550881faa5 Memtracker (#927)
* preparations for lwip2

* Add CRC32 to settings

* Add CRC to progmem

* Add crc of program memory to stettings and security settings

.. so that there is a warning if the settings are used by another binary than they were written with.

* Moved to md5

* Flash included, moved to MD5 now

* Broken comment

* Stability improvements

free memory went as low as 3000 bytes which made the webserver unresponsive.

* Add binary filename to crc2.py and sysinfo

* Update WebServer.ino

* Memory tracker

displays debug memory trace

WD   : Uptime 3 ConnectFailures 0 FreeMem 15304
Memtrace
0: lowest: 4456  PluginCall_s (35)-> 15328 PluginCall_s (35)-> 15328 PluginCall_s (35)-> 15328 PluginCall_s (35)-> 15328 PluginCall_s (35)-> 15328 PluginCall_s (35)-> 15328 PluginCall_s (35)-> 15328 PluginCall_s (35)-> 15328 PluginCall_s (35)-> 15328 handle_hardware-> 15192 sendWebPage-> 9672 sendWebPageChunkedData-> 5816 sendWebPageChunkedData-> 5128 sendWebPageChunkedData-> 4456 sendWebPageChunkedData-> 4456 
1: lowest: 4456  PluginCall_s (35)-> 15328 PluginCall_s (35)-> 15328 PluginCall_s (35)-> 15328 PluginCall_s (35)-> 15328 PluginCall_s (35)-> 15328 PluginCall_s (35)-> 15328 PluginCall_s (35)-> 15328 PluginCall_s (35)-> 15328 PluginCall_s (35)-> 15328 PluginCall_s (35)-> 15328 handle_hardware-> 15192 sendWebPage-> 9672 sendWebPageChunkedData-> 5816 sendWebPageChunkedData-> 5128 sendWebPageChunkedData-> 4456 
2: lowest: 3768  PluginCall_s (35)-> 15328 PluginCall_s (35)-> 15328 PluginCall_s (35)-> 15328 PluginCall_s (35)-> 15328 PluginCall_s (35)-> 15328 PluginCall_s (35)-> 15328 PluginCall_s (35)-> 15328 PluginCall_s (35)-> 15328 handle_hardware-> 15192 sendWebPage-> 9672 sendWebPageChunkedData-> 5816 sendWebPageChunkedData-> 5128 sendWebPageChunkedData-> 4456 sendWebPageChunkedData-> 4456 sendWebPageChunkedData-> 3768 
WD   : Uptime 4 ConnectFailures 0 FreeMem 15304

* Update Misc.ino
2018-02-25 13:14:57 +01:00
Gijs NoorlanderandDatuX 3d07466904 [MQTT] LWT "Connected" message doesn't have the retained flag (#925)
See comments of [Superpiffer](https://github.com/letscontrolit/ESPEasy/commit/a93a078c0b8ae4090c22717eacc8bc8ba92ad780#commitcomment-27718045)
2018-02-25 13:10:58 +01:00
s0170071 ed45945f21 Fix compile error when SD card is enabled 2018-02-24 18:03:38 +01:00
s0170071 f13abe8922 Removed double entry on info page 2018-02-24 17:32:44 +01:00
s0170071 34b0a683a9 fix travis 2018-02-24 17:10:52 +01:00
s0170071 9ab10437b5 Merge remote-tracking branch 's0170071/2kwebservermergetomega' into 2kwebservermergetomega 2018-02-24 16:59:54 +01:00
s0170071 b0b7408522 variable timeout 2018-02-24 16:59:46 +01:00
s0170071 b104942db9 Merge remote-tracking branch 's0170071/2kwebservermergetomega' into 2kwebservermergetomega 2018-02-24 16:57:17 +01:00
s0170071 a694b658b1 Merge remote-tracking branch 's0170071/2kwebservermergetomega' into 2kwebservermergetomega 2018-02-24 16:57:07 +01:00
s0170071 cb07a0d342 Merge remote-tracking branch 's0170071/2kwebservermergetomega' into 2kwebservermergetomega 2018-02-24 16:54:06 +01:00
s0170071 1ceaad04ec Merge branch '2kws_dynpayload' into 2kwebservermergetomega 2018-02-24 16:53:56 +01:00
s0170071 5cbf0c1e38 Merge branch '2kws_dynpayload' into 2kwebservermergetomega 2018-02-24 16:48:14 +01:00
Bartlomiej Zimon 4951f294b9 - remove Serial print 2018-02-24 16:34:30 +01:00
s0170071 ef0ef092f0 Merge remote-tracking branch 's0170071/2kws_dynpayload' into 2kws_dynpayload 2018-02-24 16:24:44 +01:00
s0170071ands0170071 46d3ae6a2b Merge branch 'mega' into 2kwebservermergetomega 2018-02-24 16:24:32 +01:00
Bartlomiej Zimon ef1bf646ab Merge branch 'mega' of github.com:letscontrolit/ESPEasy into mega 2018-02-24 10:32:09 +01:00
Bartlomiej Zimon f72a48ffc2 - extend conditions with AND/OR, now it is possible to simplify rules
test rules:
on test do
  if [test#a]=0 or [test#b]=0 or [test#c]=0
    event ok
  else
    event nok
  endif
endon

on test2 do
  if [test#a]=1 and [test#b]=1 and [test#c]=1
    event ok
  else
    event nok
  endif
endon

on test3 do
  if [test#a]=1 and [test#b]=1 or [test#c]=0
    event ok
  else
    event nok
  endif
endon

on test4 do
  if [test#a]=0
    event ok
  else
    event nok
  endif
endon
2018-02-24 10:19:12 +01:00
ESPEasy release bot da54ddda78 automaticly updated release notes for mega-20180224 2018-02-24 04:00:06 +01:00
Bartłomiej ZimońandBartlomiej Zimon 03ee569510 provide System@Sleep event (#875)
- provide System@Sleep event
- fixes #870 (mqtt not sent before sleep)
- call deepsleep at the end of loop - so we know all is done
2018-02-23 19:57:01 +01:00
mvdbro c24205713d ESP32 fixed P020 and P044 2018-02-23 15:21:48 +01:00
s0170071andGitHub 52d4cb804e Merge branch 'mega' into 2kwebservermergetomega 2018-02-23 15:07:18 +01:00
mvdbro ae077de72b Fix ESP32 compile errors 2018-02-23 14:38:14 +01:00
s0170071 86fa5ec6ae Merge into mega
... and removed obsolete function
2018-02-23 14:07:46 +01:00
s0170071 41c9d68422 Merge remote-tracking branch 'origin/mega' into 2kwebservermergetomega 2018-02-23 14:00:19 +01:00
ESPEasy release bot e713da5d79 automaticly updated release notes for mega-20180223 2018-02-23 04:00:07 +01:00
GHolliandDatuX edc261ca2b * BugFix: According to the data sheet, the offset for the detection range values (command byte 0x99) is 3..4 instead of 6..7 (#921)
Reference: http://www.winsen-sensor.com/d/files/infrared-gas-sensor/mh-z19b-co2-ver1_0.pdf
* Optimisation of the code
  - Using an enumeration for the commands to send
  - Removing redundancy of the commands stored in flash
  - Creating a function for the checksum calculation
2018-02-22 19:11:35 +01:00
s0170071andDatuX 8f4a52a6f1 Include name of binary file in crc2.py and sysinfo (#918)
* preparations for lwip2

* Add CRC32 to settings

* Add CRC to progmem

* Add crc of program memory to stettings and security settings

.. so that there is a warning if the settings are used by another binary than they were written with.

* Moved to md5

* Flash included, moved to MD5 now

* Broken comment

* Stability improvements

free memory went as low as 3000 bytes which made the webserver unresponsive.

* Add binary filename to crc2.py and sysinfo

* Update WebServer.ino
2018-02-22 18:55:45 +01:00
ESPEasy release bot af519748a6 automaticly updated release notes for v2.0-20180221 2018-02-21 04:00:20 +01:00
ESPEasy release bot c04b80b2f1 automaticly updated release notes for mega-20180221 2018-02-21 04:00:09 +01:00
Edwin Eefting cdbc2498c1 [test suite] corrected PUYA test. added erase/build/flash for all chips. preparations for full automatic hardware regression testing 2018-02-21 02:44:57 +01:00
Edwin Eefting 78997b4329 Merge branch 'v2.0' into mega 2018-02-21 02:11:18 +01:00
Edwin Eefting 2bece45712 apply PUYA patch to all available frameworks 2018-02-21 02:08:06 +01:00
Gijs NoorlanderandDatuX 10c73a001a [issue #899 ] Backport of DHT22 implementation on Mega (#913)
It has quite some changes, but according to [litrinhos](https://github.com/letscontrolit/ESPEasy/issues/899#issuecomment-366940174) it works, instead of the v2.0 implementation.
2018-02-21 01:26:08 +01:00
GHolliandDatuX 790a946cf6 Optimisation: Save RAM (freeing RAM by moving static data from RAM to program memory). (#910) 2018-02-21 00:02:59 +01:00
Stanislav MihicandDatuX 69c5be6489 Frontend (#906)
* Updating template structure, adding viewport meta name for mobile devices, feature ready for responsive layout

* Adding meta viewport, feature ready nad support for mobile devices, responsive layout, update template structure, adding article html5 tag, easier to style interface, find/replace uppercase to lowercase, matter of elegance and preference code readability :-)

* revert to default state and change only template related lines

* final check, revert uppercase

* Last template changes, lost in undo process :-)

* h6 footer TR
2018-02-20 23:54:46 +01:00
ESPEasy release bot 233ca2bf43 automaticly updated release notes for v2.0-20180220 2018-02-20 04:00:19 +01:00
ESPEasy release bot 3de400fc91 automaticly updated release notes for mega-20180220 2018-02-20 04:00:08 +01:00
Edwin Eefting edeea02f71 SENSOR_TYPE_TEMP_BARO changed, was probably implemented incorrectly before 2018-02-20 01:56:40 +01:00
Edwin Eefting 6fae1f79d8 function was moved to StringConverter.inp 2018-02-20 01:20:57 +01:00
Edwin Eefting 1222e04caf Merge branch 'v2.0' into mega 2018-02-20 01:08:29 +01:00
Bartłomiej ZimońandDatuX f38973aad6 - pcfgpio,port,2 sets pin as input (#897)
- fix for #222,#702 - we can mix inputs and outputs now
2018-02-20 00:57:55 +01:00
Gijs NoorlanderandDatuX b31b1d913f [issue #893] Fix globalSync not working when no controllers active (#896)
* [issue #893] Fix globalSync not working when no controllers active

See #893 and [this topic on the forum](https://www.letscontrolit.com/forum/viewtopic.php?p=24851#p24851)

* [issue #893] Global Sync call when no other controllers active
2018-02-20 00:52:43 +01:00
Gijs NoorlanderandDatuX fa3d4af8cb [Cleanup] Move String manipulating functions to single file (#895)
Makes it easier to re-use functions and improve them.
2018-02-20 00:52:18 +01:00
Gijs NoorlanderandDatuX 29320aab90 [isue #877] Add VCC enable firmware file to release list (#894)
* [isue #877] Add VCC enable firmware file to release list

Added one for the testing build.
Not sure if we should add one for every build, since these flags will lead to an explosion of release versions. 
But at least we will test builds with FEATURE_ADC_VCC define enabled more often.

* Add define FEATURE_ADC_VCC to the PUYA build

Since it is so hard to make a puya version on your own.
2018-02-20 00:50:56 +01:00
Gijs NoorlanderandGitHub 3bc8609611 Merge pull request #905 from TD-er/bugfix/DHTinit_sequence_wrong
[issue #899] DHT22 readings not received
2018-02-20 00:16:51 +01:00
Gijs NoorlanderandGitHub c43d6b3769 Merge pull request #904 from TD-er/feature/log_event_name
[Event Log] Add event name to event processing time log
2018-02-20 00:16:19 +01:00
Gijs NoorlanderandGitHub e9e2ea32ed Merge pull request #903 from TD-er/bugfix/OpenHAB_MQTT_topic_parser_fix
[issue #847] Fix last letter of command is cut in OpenHAB MQTT
2018-02-20 00:15:51 +01:00
Unknown 24b7d1f438 [issue #899] DHT22 readings not received
Applied fix as suggested here: https://github.com/adafruit/DHT-sensor-library/issues/48
2018-02-20 00:04:13 +01:00
Unknown 4febf08501 [Event Log] Add event name to event processing time log
As suggested on the forum by [Methusalem](https://www.letscontrolit.com/forum/viewtopic.php?p=24887#p24887)
2018-02-19 23:31:19 +01:00
Unknown 7f4eae19f4 [issue #847] Fix last letter of command is cut in OpenHAB MQTT
Thanks [jivkopavlovski](https://github.com/letscontrolit/ESPEasy/commit/f23d9fa3d3def506e1401c2208c8a19a1d5d1da2#commitcomment-27660279) for pointing this out (and testing ofcourse)
2018-02-19 22:57:57 +01:00
ESPEasy release bot c13952d04c automaticly updated release notes for v2.0-20180219 2018-02-19 04:00:19 +01:00
ESPEasy release bot 3032463917 automaticly updated release notes for mega-20180219 2018-02-19 04:00:09 +01:00
Bartlomiej Zimon f5e84a155e - pcfgpio,port,2 sets pin as input
- fix for #222,#702 - we can mix inputs and outputs now
2018-02-19 01:38:52 +01:00
Edwin Eefting bbb97bfc7e Merge branch 'v2.0' into mega 2018-02-18 19:23:09 +01:00
Gijs NoorlanderandDatuX e51f7683a5 [issue #890] Split overlap for both Domoticz controllers to helper (#891)
* [issue #890] Split overlap for both Domoticz controllers to helper

Both Domoticz controllers had quite some overlap in code.
And where they differ, one of them was faulty and/or already fixed.

Now this overlap is split into a Domoticz helper file to keep code duplication to a minimum.

* [issue #890] Fix some wierd data corruption

Do not store references in a Json object, but just the string :)

* [Domoticz] Add WiFi strength and battery info
2018-02-18 13:18:23 +01:00
Gijs NoorlanderandDatuX e747756dd2 [Build Mega] Fix for Build Mega 20180217 (#889) 2018-02-18 13:17:02 +01:00
Gijs NoorlanderandDatuX 1ad6fd6ea0 [issue #885] MAC address as system variable (#887)
%mac% will be replaced by the MAC-address of the ESP board.
%mac_int% will show the integer representation of the last 24 bits (MAC address without the OUI part) for use in rules.
2018-02-18 13:16:42 +01:00
ESPEasy release bot d2ec15a4bf automaticly updated release notes for v2.0-20180218 2018-02-18 04:00:11 +01:00
Gijs NoorlanderandDatuX f23d9fa3d3 [issue #847 ] OpenHAB MQTT rewrite topic parser (#886)
* [issue #847 ] OpenHAB MQTT rewrite topic parser

When OpenHAB MQTT controller was selected, the web interface becomes unresponsive when the controller tab was selected.
Also the ESP almost freezes when MQTT messages were sent.

This is an attempt to make them work faster.
Also a lot of string manipulation, copies and resizes are now no longer needed and the received values are checked to be valid int or float before used.

* signed unsigned warning
2018-02-17 13:18:52 +01:00
s0170071 6df5840db9 Fixed String redeclaration 2018-02-17 09:45:40 +01:00
s0170071 5f79e4b922 Merge Webserver 2018-02-17 09:43:46 +01:00
s0170071 e058507b9a Merge remote-tracking branch 'origin/mega' into 2kRamWebserver 2018-02-17 09:26:32 +01:00
ESPEasy release bot 3cea522ec4 automaticly updated release notes for v2.0-20180217 2018-02-17 04:00:18 +01:00
ESPEasy release bot 5c4defdf6e automaticly updated release notes for mega-20180217 2018-02-17 04:00:07 +01:00
Edwin Eefting e58ea2a3fe Merge branch 'v2.0' into mega 2018-02-16 21:43:23 +01:00
Gijs NoorlanderandDatuX a93a078c0b [issue #869] Added 'LWT' to last will topic and improved CPU load (#883)
* [issue #869] Added 'LWT' to last will topic and improved CPU load

See #869 for discussion on Last Will Topic.
Also changed the way it tried to reconnect to make it return a lot faster when connection is not (yet) possible and call the PubSubClient::loop() at a much slower pace to reduce CPU usage. (See #847)
This higher CPU load was probably introduced when fixing #683.

* [MQTT] Fix error reporting success status with longer payloads

Applied PR https://github.com/knolleary/pubsubclient/pull/360/files

* made MQTT_CALLBACK_SIGNATURE for esp32 functional

Applied PR https://github.com/knolleary/pubsubclient/pull/336
2018-02-16 21:32:53 +01:00
Gijs NoorlanderandDatuX 0e0e7be95a [OLED Framed] ESP Easy logo (#876) 2018-02-16 21:29:44 +01:00
Bartłomiej ZimońandDatuX 2b7a61469f provide System@Sleep event (#875)
- provide System@Sleep event
- fixes #870 (mqtt not sent before sleep)
- call deepsleep at the end of loop - so we know all is done
2018-02-16 21:28:52 +01:00
Gijs NoorlanderandDatuX ce02c9e039 [issue #853] Favicon.ico (#874)
* [issue #853] Favicon.ico

Added a very small favicon.ico of the ESPeasy logo. (1150 Bytes, 16x16)

* [Favicon] Added instructions to change icon.

In the comments. Just use 'xxd' from the (Linux) commandline.
2018-02-16 21:27:58 +01:00
Gijs NoorlanderandDatuX 1e9dc1d14c [issue 866] Try to stop logging to serial when serial is not read. (#868)
First attempt, not clear yet how to detect it.
See #866

Also preparation for future improvement on logging. (to detect whether there is some logging active so Strings may not have to be prepared.
2018-02-16 21:26:18 +01:00
s0170071andGitHub 75f1c6c140 Update .gitignore 2018-02-14 20:56:44 +01:00
ESPEasy release bot 9a6f7360da automaticly updated release notes for v2.0-20180214 2018-02-14 04:00:21 +01:00
ESPEasy release bot e3cd057ad8 automaticly updated release notes for mega-20180214 2018-02-14 04:00:10 +01:00
Edwin Eefting fec069ba00 Merge branch 'v2.0' into mega 2018-02-14 03:27:15 +01:00
Edwin Eefting d835ef679c updated deploy script for PUYA 2018-02-14 03:23:50 +01:00
Edwin Eefting 9144e7901b travis build fix for PUYA 2018-02-14 03:10:30 +01:00
Edwin Eefting 858ce397c3 workaround for PUYA flash chips with write issues #650 2018-02-14 03:01:42 +01:00
Gijs NoorlanderandDatuX 78c9ff70be [v2.0] Blynk controller (#865)
* update Blynk controller

- use of real controller index
- we use idx
- check if password not empty
- use real password

* fix for Blynk Controller

- use of real controller index
- we use idx
- check if password not empty
- use real password
- use proper port

* Update _C012.ino

add SENSOR_TYPE_SWITCH support

* [v2.0] Blynk controller
2018-02-14 00:23:59 +01:00
Bartłomiej ZimońandDatuX b2db97e808 fix for Blynk Controller (#863)
* fix for Blynk Controller

- use of real controller index
- we use idx
- check if password not empty
- use real password
- use proper port

* Update _C012.ino

add SENSOR_TYPE_SWITCH support
2018-02-14 00:23:38 +01:00
s0170071 4e537461f2 Fix travis
unsigned int -> int comparison
2018-02-13 21:59:18 +01:00
s0170071 dc7bb12581 4->12 Devices per page
that was easy :-)
2018-02-13 21:53:04 +01:00
s0170071andGitHub 0c80cdc119 Merge branch 'mega' into 2kRamWebserver 2018-02-13 21:36:05 +01:00
s0170071 37210031b7 Cleanup and +1k Ram
- on 2.4.0 git /low mem LWIP ram goes never below 20k, during TX core dives down to 18,7k (each main menu clicked once, plain new config.)
- Fixed json output
- cleanup of send function#
- un-split css, transfer to buffer byte by byte (prevents 1.7k temporary string)
- removed commented-out function
2018-02-13 21:28:10 +01:00
ESPEasy release bot 40eb3e7ceb automaticly updated release notes for v2.0-20180213 2018-02-13 04:00:20 +01:00
ESPEasy release bot d7134e6b87 automaticly updated release notes for mega-20180213 2018-02-13 04:00:09 +01:00
Edwin Eefting 8dc1924059 Merge branch 'v2.0' into mega 2018-02-13 03:16:06 +01:00
Edwin Eefting a7b77b6008 make blynk stuff compile again 2018-02-13 03:11:09 +01:00
Gijs NoorlanderandDatuX 88320d25fc [MQTT] Allow for background tests while waiting for wifi (#860)
Recent changes in 'early exit' when not connected, triggered lots of retry events.
Added some function to allow to wait for WiFi and in the meantime do some background tasks.
2018-02-13 03:01:15 +01:00
Edwin Eefting 649305a2dd Merge branch 'v2.0' into mega 2018-02-13 01:43:11 +01:00
Gijs NoorlanderandDatuX d49197a621 [issue #825] Change labels and password form for Thingspeak controller (#849)
See #825

Added option for controllers to change their display string on some controller fields in the web interface.
When password field label is non-default it also implies to use a visible textfield instead of a password field.
2018-02-13 01:17:04 +01:00
Henri de JongandDatuX 2371b0f315 Added support for pioneer ir signals (#844) 2018-02-13 01:14:44 +01:00
Gijs NoorlanderandDatuX 9abdd097c9 Formatting user vars (re-do of PR#482) + enabled check OpenHabMQTT (#851)
Re-implementation of PR #482 which was done on Mega branch.
Just to keep merges simple between branches. (and improve readabilit)

Also added a simple check to C005 (OpenHAB MQTT) on receiving messages. (see #847 )
2018-02-13 01:07:24 +01:00
Gijs NoorlanderandDatuX f8849cb601 Bugfix/oled framed less memory (#859)
* [OLED] Move font to oled lib dir

It is specific for use wth that library.

* [OLED framed] Stop reading from flash constantly and live update WiFi

See #857
The OLED Framed plugin was reading from spiffs all of the time (on every display update)
Now the data is only read from SPIFFS when needed.
Also made the WiFi strength indicator update every second (only when changed) to be able to see changes in WiFi status much easier.
2018-02-13 01:05:36 +01:00
soifandDatuX b293e8fee0 P012 - Fix/handle lines exceeding LCD width + allow to clear line b4 print (#852)
* Update Library LiquidCrystal_I2C to the latest version

* Fix LCD command (when message is longer than columns) that get split into the wrong lines - issue #603

* Added a "LCD command mode" parameter to handle how exceeding message would be treated, and if the line should be first padded with space.
2018-02-13 01:03:24 +01:00
Gijs NoorlanderandDatuX 11b1c8505a [v2.0] Fix compile errors on ESP32 (#848)
Cherry pick from Mega branch to avoid future merge conflicts.
2018-02-13 00:39:12 +01:00
Gijs NoorlanderandDatuX 9cb3ceed83 [P001 Switch] Fix a mixup in previous fix for switch (#845)
It was causing issues when people upgraded from previous builds.
Leaving it would cause high CPU loads, instable wifi, and incorrect set switch type when upgrading from older builds.

Only thing is when people were using it as a dimmer and used one of the builds in the last few weeks.
Then it will be used as a 'switch', not a dimmer. Change and set and all is fine again.
2018-02-13 00:38:51 +01:00
Gijs NoorlanderandDatuX 2ac1df9482 [issue #839] Add command support for setting contrast for OLED Framed (#841)
* [issue #839] Add command support for setting contrast for OLED Framed

See #839

* [issue #839] Should not use 0 as off value, since that is default

With 0 as "off", the display would be off when not set.
Changed it to 1, which is not a value that can be set other than with the commands
2018-02-13 00:38:01 +01:00
Gijs NoorlanderandDatuX 59b7768722 Blynk controler (re-implementation of PR#92) (#837)
* Blynk controler (re-implementation of PR#92)

See #92
This plugin is just ported from the old implementation, which was not merged into the Mega branch.
It now is using a lot of the newly created functions and optimizations.
But not yet tested.

* Update _C012.ino
2018-02-13 00:32:02 +01:00
Gijs NoorlanderandDatuX d4e5742b1c [#804] Degree symbol for non-framed OLED display (#835) 2018-02-13 00:24:32 +01:00
s0170071 baa1df620f Travis... 2018-02-12 16:55:24 +01:00
s0170071 a310811919 fix Travis
uninitialized variable.
2018-02-12 13:46:36 +01:00
s0170071 e9dd5da690 Add Ram usage debug message
usually shows: 
Ram usage: Webserver only: 1048 including Core: 3120
2018-02-12 11:48:01 +01:00
s0170071 f9c25489d1 fix download page
don't stream this one.
2018-02-12 09:26:00 +01:00
s0170071 46ee928b07 navMenuIndex
fixed order. Needs to be set before stream starts.
2018-02-12 08:11:15 +01:00
s0170071 3af102f2ad Unused variable 2018-02-12 07:07:12 +01:00
s0170071 ca53ec0263 fix travis
unused variable
2018-02-12 06:48:46 +01:00
s0170071 5ca7c073f1 fix travis 2018-02-12 06:34:19 +01:00
ESPEasy release bot f815564dc7 automaticly updated release notes for v2.0-20180212 2018-02-12 04:00:22 +01:00
ESPEasy release bot b320c2a1e2 automaticly updated release notes for mega-20180212 2018-02-12 04:00:09 +01:00
Gijs NoorlanderandDatuX 2b51a4d7c4 [Issue #831] Use DOUT flash mode (#834)
Set DOUT flash mode in the firmware image.
2018-02-12 02:24:16 +01:00
soifandDatuX 01d0723424 Add Device Name in /json page (#815)
* Add Name in /json page

* Json dev friendly (updatable) syntax

* Reorder Json field
2018-02-12 02:11:01 +01:00
s0170071 3f68154819 Merge branch 'webserverminmem' into mega 2018-02-11 22:24:17 +01:00
s0170071 7b1c4483bb Merge remote-tracking branch 's0170071/webserverminmem' into webserverminmem 2018-02-11 22:23:50 +01:00
s0170071 572d9c0714 2k Webserver 2018-02-11 22:23:38 +01:00
mvdbro b85010006b Fix compile errors on ESP32 2018-02-11 14:46:08 +01:00
s0170071 48643cf87e Merge remote-tracking branch 's0170071/webserverminmem' into webserverminmem 2018-02-09 12:28:17 +01:00
s0170071 9ea594afeb Optimized memory usage
memory never goes below 10k now. 
Added wait for memory return on header send, 
Added wait for memory return on chunk end send,
removed duplicate of data stashing with  getWebPageTemplateVar
2018-02-09 12:27:45 +01:00
ESPEasy release bot aec539be43 automaticly updated release notes for v2.0-20180209 2018-02-09 04:00:26 +01:00
ESPEasy release bot 749c8cd931 automaticly updated release notes for mega-20180209 2018-02-09 04:00:15 +01:00
s0170071 49a783c381 "Content-Type","text/html" 2018-02-08 20:11:07 +01:00
s0170071 c9b81f7ab9 Wait for memory be like before send chunked
goes not below 9680 bytes now
2018-02-08 19:57:16 +01:00
AndreyandDatuX eb2dbb5b90 Added HIGH-Z state options for GPIO command (#833)
Add command like 'GPIO,12,2' for set pin to HIGH-Z (INPUT) state.
2018-02-08 19:37:52 +01:00
wdonkerandDatuX e49f31121c Add trigger for rulesprocessing (#826)
* Update _C002.ino

Trigger rulesprocessing om MQTT receive message

* Replace direct call by createRuleEvents

Change to createRuleEvents
2018-02-08 19:33:32 +01:00
s0170071 91c6e3af61 Does Travis like extern "C" ? 2018-02-08 17:31:26 +01:00
s0170071 faeb921bcf Merge remote-tracking branch 's0170071/webserverminmem' into webserverminmem 2018-02-08 17:13:01 +01:00
s0170071 9928f56ad3 try fix travis 2018-02-08 17:12:53 +01:00
s0170071andGitHub 61d27084c1 trigger travis re-compile
trigger travis re-compile to see if the compile failure was due to a quick re-submission.
2018-02-08 10:04:07 +01:00
s0170071 e5393a9fa4 Adapted timeout 2018-02-07 22:08:43 +01:00
s0170071 1cbc49021a tcp_cleanup for LWIP1 & 2 2018-02-07 22:04:39 +01:00
s0170071 84f389b44e Timeout 100ms 2018-02-07 17:29:16 +01:00
s0170071 765775e22f Adjusted to min 7k free 2018-02-07 17:21:28 +01:00
s0170071 02c97c4513 Webserver min memory
memory went as low as 3k, so wait for it to return ...
2018-02-07 17:15:23 +01:00
ESPEasy release bot bd874c4a13 automaticly updated release notes for v2.0-20180206 2018-02-06 05:00:21 +01:00
ESPEasy release bot d87cd7eafe automaticly updated release notes for mega-20180206 2018-02-06 05:00:10 +01:00
Edwin Eefting 58bb62cc1a Merge branch 'v2.0' into mega 2018-02-06 01:08:36 +01:00
Gijs NoorlanderandDatuX 6b8ea6c15b [issue #727] Proper user interface to set DST rules (#823)
See #727
And it only took 4 bytes extra storage :)

When initialized with an invalid setting for DST, (like fresh after flashing), it will use the CEST/CET setting.
2018-02-06 00:42:45 +01:00
Gijs NoorlanderandDatuX a62dd5ce8f [issue #817] Added mail header to SMTP (#820)
* [issue #817] Added mail header to SMTP

N.B. use only mail address (no name, no '<>' etc) as sender.

* [SMTP] Add user/pass to send email.

* [issue #817] Added user + passwd authentication to SMTP notifications

Tested with smtp2go.com (non TLS mail proxy)
It is now possible to add username + passwd when sending mail.
If both left empty, authentication will not be used.
2018-02-05 23:59:24 +01:00
Gijs NoorlanderandDatuX 92889b6cf1 Backport OLED framed from mega + support special characters (#818)
* [OLED framed] Backport of OLED lib upgrade from Mega to v2.0

Lots of issues with older lib and the newer version in the Mega branch appeared to be very stable.

* [OLED framed] Use less string allocations

And a first attempt to display the Euro sign. (does not yet work)

* [Special Char] Allow to use special characters

For some special characters, it is often hard to find them and/or use them in URL or JSON streams.
For a subset of supported special characters, a short notation and HTML equivalent is added.
These can be used anywhere.

* [OLED lib] Fixed memory leak

Man library did some allocs without free.
Also unneeded allocs.

* Applied pull requests from esp8266-oled-ssd1306:
https://github.com/squix78/esp8266-oled-ssd1306/pull/169
https://github.com/squix78/esp8266-oled-ssd1306/pull/157
https://github.com/squix78/esp8266-oled-ssd1306/pull/144

And applied the suggestions from issues:
https://github.com/squix78/esp8266-oled-ssd1306/issues/170
https://github.com/squix78/esp8266-oled-ssd1306/issues/161

* [OLED] Support multiple display resolutions

Applied PR from esp8266-oled-ssd1306:
https://github.com/squix78/esp8266-oled-ssd1306/pull/133

* [OLED] Better Brightness / Contrast control

Suggestions taken from this issue:
https://github.com/squix78/esp8266-oled-ssd1306/issues/134

* [OLED] Set contrast to High by default, when no choice was made

Sounds like a valid choice, based on the findings in issue #821

* Compiler error on comments

As suggested here: https://github.com/TD-er/ESPEasy/pull/3/files
2018-02-05 23:56:17 +01:00
soifandDatuX b5479575eb All Advanced Settings as 'DEFAULT_' Defines (#813)
* Implements all Advanced Settings as "DEFAULT_" defines

* Organise and comment "DEFAULT_" defines
2018-02-05 23:50:48 +01:00
s0170071andDatuX 201d013230 Add compile time (#811) 2018-02-05 23:49:26 +01:00
ESPEasy release bot 6fead68f34 automaticly updated release notes for v2.0-20180203 2018-02-03 05:00:20 +01:00
ESPEasy release bot 9a77b1727c automaticly updated release notes for mega-20180203 2018-02-03 05:00:11 +01:00
GrovkillenandGitHub 2f26cd13bc Update README.md 2018-02-02 12:52:12 +01:00
GrovkillenandGitHub f0d35527df Update README.md
Made the "warning" stand out a bit more.
2018-02-02 12:50:58 +01:00
ESPEasy release bot 3a9ef290e8 automaticly updated release notes for v2.0-20180202 2018-02-02 05:00:23 +01:00
ESPEasy release bot 9cbaa4d7e7 automaticly updated release notes for mega-20180202 2018-02-02 05:00:12 +01:00
Edwin Eefting af4ad9fbcb Merge branch 'v2.0' into mega 2018-02-02 03:17:01 +01:00
soifandDatuX 36a9bdae72 Json page also Shows Git Build (#808)
* remove un-needed spaces in JSON (save some memory?)

* Add the Git Build string in the /json page
2018-02-02 03:11:02 +01:00
soifandDatuX ebfa0a45a6 Custom define file (#807)
* Allows to use a Custom.h file to change defaults setting without changing the repo file

* Custom.h example
2018-02-02 02:40:56 +01:00
soifandDatuX c2e70360c4 Allows to define the IP address when in AP Mode (#806) 2018-02-02 02:39:47 +01:00
Edwin Eefting 8bdfa656de Add CRC checks to all binaries when building a release with travis. fixes #779 2018-02-02 02:27:23 +01:00
Edwin Eefting 952bf68b93 Merge branch 'v2.0' into mega 2018-02-02 01:37:35 +01:00
DatuXandGitHub 712a5e80d0 Update README.md 2018-02-02 01:23:42 +01:00
DatuXandGitHub a44069ae26 Update README.md 2018-02-02 01:17:06 +01:00
DatuXandGitHub 13f73c0156 Update README.md 2018-02-02 01:15:34 +01:00
soifandDatuX bb88225cab Fix Syslog : include Hosname instead of Unit Number - now RFC3164 compliant (#805) 2018-02-02 00:40:04 +01:00
Gijs NoorlanderandDatuX 3089b288b2 [issue #739] Reconnect MQTT when Unit Name has changed. (#803)
See #739
When %sysname% has changed, force a reconnect of the MQTT client.

Also made the client ID guaranteed unique by using the MAC address.
2018-02-02 00:38:28 +01:00
soifandDatuX 6abea46eb5 Fixes invalid '/json' page output format : DateTimeString is now correctly quoted (#802) 2018-02-02 00:37:01 +01:00
Gijs NoorlanderandDatuX ffa73aee59 [v2.0] Resource friendly string replacement (#798)
As part of #698 and also since these system variable replacement may grow.
Some replacement strings may need some work to create and such effort is wasted if the matching string does not occur.
To improve this and still remain readable, I added a simple macro to check first and then create the strings only when needed.
Some strings are already present, so these do not use the macro since searching first and then look again to replace will take more effort.
2018-02-02 00:34:02 +01:00
Gijs NoorlanderandDatuX f4b7e97997 [issue #794] Add longpulse_ms command (#796)
See #794
2018-02-02 00:30:49 +01:00
Gijs NoorlanderandDatuX b32212b061 [Mega] Fix pointer arithmetic on void pointers for CRC computations (#795)
It was a change I made last week to get it to compile for the 2.4.0 core lib, but made an error in the pointer arithmetic.
No it shoud be correct.
See https://github.com/letscontrolit/ESPEasy/issues/792#issuecomment-361714575
2018-02-02 00:28:58 +01:00
ESPEasy release bot 66d0de684a automaticly updated release notes for v2.0-20180130 2018-01-30 05:00:23 +01:00
ESPEasy release bot cae3baf71e automaticly updated release notes for mega-20180130 2018-01-30 05:00:12 +01:00
Edwin Eefting 27db33f1bd Merge branch 'v2.0' into mega 2018-01-30 01:54:10 +01:00
Gijs NoorlanderandDatuX 23d5709957 [Log] Clean up of log routines and more intuitive log level input (#788)
As part of #781, #747 and the general cleanup issue #698.
2018-01-30 01:50:24 +01:00
Edwin Eefting b96e12f217 Merge branch 'v2.0' into mega 2018-01-29 22:52:14 +01:00
Gijs NoorlanderandDatuX 16eb08afa0 [#784] Add %rssi% as system variable (#786)
* [#784] Add %rssi% as system variable

See #784

* [#787] Add %unit% and %ssid% system variable

See #787
Unit is the unit number of the ESP device.
SSID is the name of the WiFi accesspoint the ESP device is connected with.
2018-01-29 22:51:26 +01:00
Edwin Eefting ad8e229c06 Merge branch 'v2.0' into mega 2018-01-29 20:52:56 +01:00
Gijs NoorlanderandDatuX b9b7ceccb6 Bugfix/issue 740 allow mqtt as controller 2 3 (#785)
* [issue #740] Allow MQTT controller to be on any controller

See #740

Still there is an issue when >1 MQTT controller is selected and enabled.
Currently only one MQTT controller may be active.

* [issue #740] Add warning when >1 MQTT controller is active

Add a warning to the web interface when >1 MQTT controller is active.
See #740
2018-01-29 18:12:47 +01:00
Edwin Eefting 5c4bf52b66 forgot to commit last framed oled display fix 2018-01-29 17:30:01 +01:00
ESPEasy release bot 34369d268e automaticly updated release notes for v2.0-20180126 2018-01-26 05:00:22 +01:00
ESPEasy release bot 0ec7085022 automaticly updated release notes for mega-20180126 2018-01-26 05:00:12 +01:00
Edwin Eefting 913cd67eee Merge branch 'v2.0' into mega 2018-01-25 22:15:57 +01:00
Gijs NoorlanderandDatuX 3292051bae Update _C007.ino (#774) (#776)
This change allows to send the switch state to Emoncms, previously it was ignored
2018-01-25 22:07:07 +01:00
Gijs NoorlanderandDatuX 2586b94e28 [Mega] Force 2.3.0 for all builds and add an option for 2.4.0 core (#775)
* [Mega] Force 2.3.0 for all builds and add an option for 2.4.0 core

This way we can test issues easier and people are still using 2.3.0 core version.

* Update platformio.ini

Environment labels should not use dots. Then they will not show in the build selection box.
2018-01-25 22:06:45 +01:00
Gijs NoorlanderandDatuX d492347f31 [V2.0] Allow IRremoteESP8266 to be built with core 2.4.0 (#773)
* [V2.0] Allow IRremoteESP8266 to be build with core 2.4.0

A partial cherrypick of #772, to make merging easier.
Just some simple patches on the use of min() and max() in the library to allow it to compile using the 2.4.0 core lib. Actual use of this core lib is still prohibited by the check in ESPEasy.ino.

* [core 2.3.0] Force PlatformIO to use the 2.3.0 core libs

This update forces the PlatformIO environment to load the 1.5.0 version of espressif8266@1.5.0, which uses Core 2.3.0
2018-01-25 22:04:54 +01:00
josemariaaraujoandDatuX b811b13483 Update _C007.ino (#774)
This change allows to send the switch state to Emoncms, previously it was ignored
2018-01-25 15:49:31 +01:00
Gijs NoorlanderandDatuX 56f9bc9c3a [issue #759] Disable Senseair ABC due to firmware issues (#771)
See #759

Just commented the Set ABC functionality. People may compile it for themselves, but be aware of possible consequences.
2018-01-25 15:48:21 +01:00
Gijs NoorlanderandDatuX c149888bed [Mega] Allow compile with 2.4.0 core library (#772)
Last few days, lots of issues reported by users who installed the 2.4.0 core libraries.
e.g. #769 and #763
It appeared the default PlatformIO Espressif 8266 1.6.0 libs now include the 2.4.0 core libraries.
Now I have to find a way to get my own environment back to the 2.3.0 core libs and see how I can get PlatformIO Espressif 8266 library back to version 1.5.0
2018-01-25 15:47:58 +01:00
ESPEasy release bot 82cea3db2e automaticly updated release notes for v2.0-20180124 2018-01-24 05:00:20 +01:00
ESPEasy release bot 8aea298854 automaticly updated release notes for mega-20180124 2018-01-24 05:00:09 +01:00
Edwin Eefting 5617fbe0a0 Merge branch 'mega' of github.com:letscontrolit/ESPEasy into mega 2018-01-24 03:17:32 +01:00
Edwin Eefting 6a643da8ee Merge branch 'v2.0' into mega 2018-01-24 03:17:20 +01:00
Edwin Eefting 2f32799b67 fix #718. also update display on save and removed graphical boot logo to conserve space. also fixes #713. (web interface will be non repsonsive during scrolling now, but there is no easy fix for that) 2018-01-24 02:58:25 +01:00
s0170071andDatuX ee568a76c1 Space (#767)
* preparations for lwip2

* Add CRC32 to settings

* Add CRC to progmem

* Add crc of program memory to stettings and security settings

.. so that there is a warning if the settings are used by another binary than they were written with.

* Moved to md5

* Flash included, moved to MD5 now

* Broken comment
2018-01-23 23:55:55 +01:00
s0170071andDatuX beaf077b06 Broken comment (#766)
* preparations for lwip2

* Add CRC32 to settings

* Add CRC to progmem

* Add crc of program memory to stettings and security settings

.. so that there is a warning if the settings are used by another binary than they were written with.

* Moved to md5

* Flash included, moved to MD5 now

* Broken comment
2018-01-23 23:55:29 +01:00
Gijs NoorlanderandDatuX fd5da94f9c [issue #758] P029 MQTT helper does not log anymore (#764)
See #758
2018-01-23 23:54:34 +01:00
ESPEasy release bot 0694fcc5fb automaticly updated release notes for v2.0-20180123 2018-01-23 05:00:20 +01:00
ESPEasy release bot e36a9f163e automaticly updated release notes for mega-20180123 2018-01-23 05:00:10 +01:00
Edwin Eefting 17f0f6637a Merge branch 'v2.0' into mega 2018-01-23 04:58:52 +01:00
Edwin Eefting bc91939757 request mainpage when checking if reboot is complete 2018-01-23 04:57:20 +01:00
Edwin Eefting eb743f95cf added easy reboot warning and function to work around several issues 2018-01-23 04:49:16 +01:00
Edwin Eefting 0ec770fc51 Merge branch 'v2.0' into mega 2018-01-23 02:43:07 +01:00
Edwin Eefting ed4cdc3d90 clear custom task and controller settings when selecting a different device or protocol. replaces #762 . fixes #721 2018-01-23 02:37:02 +01:00
Edwin Eefting 9da5f465d1 Merge branch 'v2.0' into mega 2018-01-23 01:02:12 +01:00
Edwin Eefting 8e72ace3b5 test suite: espcli can now do stuff for all configured nodes 2018-01-23 00:50:00 +01:00
s0170071andDatuX 5230a4fe4f CRC on settings and security settings and progmem (#720)
* preparations for lwip2

* Add CRC32 to settings

* Add CRC to progmem

* Add crc of program memory to stettings and security settings

.. so that there is a warning if the settings are used by another binary than they were written with.

* Moved to md5

* Flash included, moved to MD5 now
2018-01-22 23:58:43 +01:00
Edwin Eefting b236887718 Merge branch 'v2.0' into mega 2018-01-22 23:54:55 +01:00
Gijs NoorlanderandDatuX 2527cbe097 Central function for system variable replacement (#757)
* Central function for system variable replacement

Related to:
- #698 => Not complete
- #709 => fixed
- #751 => fixed

Redesign of PR #485 (in mega branch)

One note: no sensor values can be used in controllers. Is this what we want, or should we call parseTemplate everywhere parseSystemVariables is being used?
Also not all controllers apparently allow system variables. Is this also correct?

* [issue 757] Add %lcltime% to display date + time

As requested by @PsychoAndi at PR #757

* [issue 757] Add local time to JSON output

As suggested by @PsychoAndi
2018-01-22 23:38:14 +01:00
Edwin Eefting cbca4c3efa Merge branch 'v2.0' into mega 2018-01-22 23:35:45 +01:00
Edwin Eefting 5b0e9d934c test suite: now possible to run all tests at once. fixes 2018-01-22 23:32:46 +01:00
ESPEasy release bot 19429e8507 automaticly updated release notes for v2.0-20180122 2018-01-22 05:00:19 +01:00
ESPEasy release bot a67f92176f automaticly updated release notes for mega-20180122 2018-01-22 05:00:08 +01:00
Edwin Eefting 3922827fad Merged v2.0 changes and fixed some regressions 2018-01-22 01:43:42 +01:00
Gijs NoorlanderandDatuX 0c637da19f [#732] Only process P029 MQTT helper when enabled (#743)
See #732
Also did some small optimizations for when no Domoticz MQTT controller enabled and/or task enabled.
2018-01-21 17:10:08 +01:00
Gijs NoorlanderandDatuX 48f168da9d [issue #745] Set IPaddress to 0.0.0.0 when read from empty string (#754)
Also str2ip now uses IPAddress.fromString()
2018-01-21 17:08:15 +01:00
ESPEasy release bot 3357eb287c automaticly updated release notes for v2.0-20180121 2018-01-21 05:00:13 +01:00
Edwin Eefting 5da1c54b70 test suite: fixes. testing boot gpio states 2018-01-21 04:28:12 +01:00
Edwin Eefting c5bbdb401a test suite: lots of refactoring and fixing 2018-01-21 03:23:22 +01:00
Edwin Eefting f69b84d24b test suite: fixed issues, started working on nodo 2018-01-21 01:53:22 +01:00
Edwin Eefting 1250e09fef cleaned up nodo logging. fixed domotics SENSOR_TYPE_WIND inconsistency 2018-01-21 01:52:36 +01:00
Edwin Eefting fbf22ba7af test suite: generelized controller testing in test005 2018-01-20 21:49:24 +01:00
ESPEasy release bot 5c26d50227 automaticly updated release notes for v2.0-20180120 2018-01-20 05:00:12 +01:00
Edwin Eefting 47be037be9 Merge branch 'v2.0' of github.com:letscontrolit/ESPEasy into v2.0 2018-01-19 05:45:10 +01:00
Edwin Eefting bc4f7d390c test suite: started on testcase to test all sensor types via the dummy plugin 2018-01-19 05:44:57 +01:00
Edwin Eefting 9fe64834f9 added QUAD to c002. fixed getBearing and SENSOR_TYPE_WIND. 2018-01-19 05:43:50 +01:00
ESPEasy release bot 4d943c2386 automaticly updated release notes for v2.0-20180119 2018-01-19 05:00:18 +01:00
ESPEasy release bot 4b298d6e31 automaticly updated release notes for mega-20180119 2018-01-19 05:00:07 +01:00
jctualandDatuX c0c65364e5 DHT plugin update (#736)
Modification of DHT plugin to use Sonoff am2301 and si7021 sensors.
Also correct some NAN readings.
2018-01-19 02:43:22 +01:00
Edwin Eefting 51b76682cf test suite: added dht22 2018-01-19 02:35:38 +01:00
Edwin Eefting 5f89698308 Merge branch 'v2.0' into mega 2018-01-19 01:30:40 +01:00
Edwin Eefting 400ee82686 test suite domoticz mqtt + found few fixmes 2018-01-19 01:28:14 +01:00
ESPEasy release bot 485f97bdc2 automaticly updated release notes for v2.0-20180118 2018-01-18 05:00:19 +01:00
ESPEasy release bot 5821377b6c automaticly updated release notes for mega-20180118 2018-01-18 05:00:08 +01:00
Edwin Eefting e6e3c1ddee refactoring test suite controller stuff 2018-01-18 03:37:25 +01:00
Edwin Eefting a6ea35ef9c Merge branch 'v2.0' into mega 2018-01-18 02:15:01 +01:00
Edwin Eefting fe9a579dc3 added fixme 2018-01-18 02:03:54 +01:00
Gijs NoorlanderandDatuX 017aad051e [issue 728] Proper reconnect for MQTT controllers (#737)
See #728
Also looked into the very strange configuration settings lookup for MQTT settings. The way it was, the settings for the first MQTT controller were used even when the actual MQTT controller was inactive or using different settings.

Now the controller selected in the the plugin is being used and when no plugin setting is available (and also for P037 MQTT import) the first active MQTT controller will be used.
2018-01-18 01:04:55 +01:00
Gijs NoorlanderandDatuX 8a30659015 [issue 733] Fix for negative values on MQTT import (#735)
See #733.
The '-' was parsed, but not copied to the tmp char array to be converted.
2018-01-18 00:44:08 +01:00
ESPEasy release bot ed7f597b3d automaticly updated release notes for mega-20180117 2018-01-17 05:00:08 +01:00
Edwin Eefting 6700030d7c Merge branch 'mega' of github.com:letscontrolit/ESPEasy into mega 2018-01-17 00:16:09 +01:00
Edwin Eefting f45c7650de fix #719 (initial ds18b20 value after power on 85 degrees) 2018-01-17 00:15:59 +01:00
papperoneandDatuX a36ee65865 merge with main branch (#648)
* removed note for 74HC595

74HC595 pin reminder not needed as this chip won't be supported anymore

* deleted GPIO notes referring to 75HC595 not supported
2018-01-16 20:20:52 +01:00
ESPEasy release bot b61c638f0a automaticly updated release notes for v2.0-20180116 2018-01-16 05:00:21 +01:00
ESPEasy release bot dfb5b8a4c5 automaticly updated release notes for mega-20180116 2018-01-16 05:00:11 +01:00
Edwin Eefting 09e5d6abcd now supports powercycle to test for bugs like #719 2018-01-16 04:15:48 +01:00
Edwin Eefting 2aafbb57a8 made test resumable and importable 2018-01-16 03:41:29 +01:00
Edwin Eefting 9d3dd49e9d Merge branch 'v2.0' into mega 2018-01-16 00:20:12 +01:00
Edwin Eefting 744f22112b Merge branch 'v2.0' of github.com:letscontrolit/ESPEasy into v2.0 2018-01-15 23:04:48 +01:00
Edwin Eefting b38edfb672 fixed custom build path 2018-01-15 23:04:40 +01:00
Gijs NoorlanderandDatuX a73875a2e2 [AutoDST] Added Auto DST (Bugfix/v2.0 issue569) (#726)
* [Time] Moved time related code to separate file

* [AutoDST] Added Auto DST

Preliminary support for Auto DST, as requested in #569
Also did a little refactorin of time related code, with #698 in mind.
All time related code is split into a few files based on its function.

The currently selected DST will start on Last Sunday March 2am and end on Last Sunday October 3am.
This is the most frequently used DST, according to https://en.wikipedia.org/wiki/Daylight_saving_time_by_country

To change it, currently the code has to be changed in the function applyTimeZone(). Several examples are given right below that function.
Problem is where to store the information of the timezone, how to use it in the web interface and how convenient it is to set by hand.
The UTC offset in minutes still has to be entered and whether or not DST should be enabled.
2018-01-15 21:51:15 +01:00
ESPEasy release bot 0833029c82 automaticly updated release notes for mega-20180114 2018-01-14 05:00:08 +01:00
s0170071andDatuX 71cf207bf7 preparations for lwip2 (#707) 2018-01-13 12:22:32 +01:00
ESPEasy release bot f7ea185f80 automaticly updated release notes for v2.0-20180113 2018-01-13 05:00:20 +01:00
ESPEasy release bot 3d3a035822 automaticly updated release notes for mega-20180113 2018-01-13 05:00:10 +01:00
Edwin Eefting 11a94aae25 testsuite: working on generic http/mqtt controller emulatior receiving 2018-01-13 03:21:09 +01:00
Edwin Eefting af3bf5217d fix version number 2018-01-13 03:07:38 +01:00
Edwin Eefting 11f47f26e6 Merge branch 'v2.0' into mega 2018-01-13 03:04:33 +01:00
Edwin Eefting 57c6fbbaab ESPEasy v2.0 only supports compiling under arduino core 2.3.0 to prevent issues like #705 when people use Arduino IDE to compile with arduino core 2.4.0 2018-01-13 02:53:15 +01:00
Edwin Eefting f7b37306aa automaticly updated release notes for mega-20180112 2018-01-12 02:05:49 +01:00
Edwin Eefting 8b3d8f6ad4 Merge branch 'v2.0' into mega 2018-01-12 02:03:58 +01:00
Edwin Eefting 7a9726063d dont make same release twice 2018-01-12 02:02:43 +01:00
Edwin Eefting d6680b604f dont make same release twice 2018-01-12 02:02:27 +01:00
Edwin Eefting 25ef1803e0 release bot fixes 2018-01-12 01:59:03 +01:00
Edwin Eefting 2bc72151bc automaticly updated release notes for v2.0-20180112 2018-01-12 01:56:54 +01:00
Edwin Eefting 93ceae3bef fixed releasebot issues with multiple branches 2018-01-12 01:56:34 +01:00
Edwin Eefting b5cad22afd Merge branch 'v2.0' into mega 2018-01-12 01:41:13 +01:00
Edwin Eefting 2bf31a1985 testsuite requirements 2018-01-12 01:40:20 +01:00
Gijs NoorlanderandDatuX 5796f50439 [v2.0 #470] Do not send invalid values to a controller (#701)
Prevent sending of invalid values (NaN, inf) to any controller.
Simple test is to output any plugin value with formula set to "%value%/0" and try to send it to any controller.
Is a fix for #470 and #693
2018-01-12 01:06:36 +01:00
Edwin Eefting 36415d424e first http domoticz test works 2018-01-12 01:04:47 +01:00
Edwin Eefting 76be5dd8d9 added http server emulation and domotics http to testsuite 2018-01-12 00:50:45 +01:00
Edwin Eefting 407dae03ca merged v2.0 changes 2018-01-11 23:00:15 +01:00
Gijs NoorlanderandDatuX 6e760cd25b [Issue 699] Incorrect shown device name (#700)
And some improvements in readability and performance of webserver.
2018-01-11 22:45:50 +01:00
ESPEasy release bot 69c03cafb9 automaticly updated release notes for v2.0-20180111 2018-01-11 05:00:18 +01:00
ESPEasy release bot c17e683834 automaticly updated release notes for mega-20180111 2018-01-11 05:00:08 +01:00
Edwin Eefting 311abeabd0 Merge branch 'v2.0' into mega 2018-01-11 03:27:25 +01:00
Edwin Eefting b20d4a10ba working on http mocker for test suite 2018-01-11 03:26:30 +01:00
Edwin Eefting 548bf8b867 added frame oled test 2018-01-11 01:49:57 +01:00
Edwin Eefting 0b68e16894 test suite fixes 2018-01-11 01:35:32 +01:00
Edwin Eefting 33e46addbb analysed some code and added comments 2018-01-11 00:54:19 +01:00
Edwin Eefting 04f27e0d03 Merge branch 'v2.0' into mega 2018-01-11 00:52:36 +01:00
Edwin Eefting 628ff925b7 Merge branch 'v2.0' of github.com:letscontrolit/ESPEasy into v2.0 2018-01-11 00:48:44 +01:00
Edwin Eefting 6fddf25a39 copied test-stuff from mega to v2.0 to do some testing 2018-01-11 00:48:24 +01:00
Gijs NoorlanderandDatuX 84e58285af [v2.0_kamstrup] Plugin configuration does not load (#697)
Could not change the device settings. The PLUGIN_WEBFORM_LOAD case was not handled.
2018-01-10 23:22:40 +01:00
Edwin Eefting fc5103de8d oops...somehow git did made some changes :( 2018-01-10 22:34:36 +01:00
Edwin Eefting 14b6345277 no changes, just merge the v2.0 branch 2018-01-10 22:22:29 +01:00
Gijs NoorlanderandDatuX 9a70037e32 Merge/v2.0 dev13 to mega (#695)
* [switch] Fixed switch behavior and default settings. (#675)

As described in #673 .
The problem was partly related to the default values stored in flash ("0"), which was not a valid value for the switch type.

When upgrading from an older version of ESPeasy, make sure to check the switch type (normal switch or dimmer) and save the settings for the switch device again, even when nothing was changed.
Default configuration and new added switches will now work like intended.

When a controller is enabled (e.g. Domoticz MQTT or -HTTP) and the button is pressed multiple times, the ESP may reboot. See issue #674.

* ABC calibration feature added (#606)

* [Flash info] Detailed flash information (#678)

Last few days a number of issues and forum topic was about the type of flash used on the ESP boards.

This is an extension of the detailed information page.

Perhaps also merge with the newer and more clear layout of pull request #624?
That pull request was only merged to the mega branch.
I kept the changes local, but perhaps they should be placed in the "Storage" section introduced with #624.
Maybe also that pull request should get merged into the v2.0 branch.

* Bugfix/v2.0 crash switch (#682)

* [crashes] Added constructors to initialize all members in structs

Numerous structs are defined, but none of them have default constructors and there is no guarantee the members will be set when used. 
With these default constructors, the parameters at least have an initialized value.

* [PubSubClient] Add bound checks on the internal buffer

Not sure if this was really causing an issue, but proper bound checks are always a good thing.

* [Crash Switch] Disabled delayBackground and added yield() calls

Something really fishy is going on with the delayBackground function, which will result in crashes when pressing the switch multiple times, with Domoticz MQTT enabled as first controller.
Disabled for now and delay(1) added to give background tasks a chance to do their work and make sure the watchdog doesn't perform a reset.

* [CI build errors] Commented out some unused variables

Travis considers them as error and fails the checks.

* [CI check] Out-of-bounds check fix

* actually ignore MQTT messages that are too big.

* moved mqtt stuff outside of backgroundtasks(). fixes #683 in my test scenario

* [Adafruit MPR121] Change deprecated name setThreshholds to setThresholds (#685)

See #684

* fixed plugin id of "Communication - Kamstrup Multical 401". (accidental octal notation)

* changed devicecombobox handling to save a lot of memory on device page. fixes #654 #676 and could be triggered by #683 in some cases.

* [CPPcheck] v2.0 ControllerSettingsStruct some variables not initialized (#692)

Fixing these cppcheck errors:
101.43s$ cppcheck --enable=warning src/*.ino -q --force -I src --include=src/ESPEasy.ino --error-exitcode=1
[src/ESPEasy.ino:500]: (warning) Member variable 'ControllerSettingsStruct::HostName' is not initialized in the constructor.
[src/ESPEasy.ino:500]: (warning) Member variable 'ControllerSettingsStruct::Publish' is not initialized in the constructor.
[src/ESPEasy.ino:500]: (warning) Member variable 'ControllerSettingsStruct::Subscribe' is not initialized in the constructor.
2018-01-10 21:51:42 +01:00
Edwin Eefting 3a8323faab Merge branch 'v2.0' of github.com:letscontrolit/ESPEasy into v2.0 2018-01-10 19:19:57 +01:00
Edwin Eefting fe1944922c changed devicecombobox handling to save a lot of memory on device page. fixes #654 #676 and could be triggered by #683 in some cases. 2018-01-10 19:19:48 +01:00
Gijs NoorlanderandDatuX 7ea0c767fa [CPPcheck] v2.0 ControllerSettingsStruct some variables not initialized (#692)
Fixing these cppcheck errors:
101.43s$ cppcheck --enable=warning src/*.ino -q --force -I src --include=src/ESPEasy.ino --error-exitcode=1
[src/ESPEasy.ino:500]: (warning) Member variable 'ControllerSettingsStruct::HostName' is not initialized in the constructor.
[src/ESPEasy.ino:500]: (warning) Member variable 'ControllerSettingsStruct::Publish' is not initialized in the constructor.
[src/ESPEasy.ino:500]: (warning) Member variable 'ControllerSettingsStruct::Subscribe' is not initialized in the constructor.
2018-01-10 19:15:35 +01:00
Edwin Eefting ec18e5c530 updates version numbering documentation 2018-01-10 16:34:58 +01:00
ESPEasy release bot 885781850b automaticly updated release notes for v2.0-20180110 2018-01-10 16:14:23 +01:00
ESPEasy release bot 443b46f383 added releasebot to v2.0 branch 2018-01-10 16:13:24 +01:00
GrovkillenandGitHub 8ce1aa0092 Update README.md
Re-arranged the date format to = the current code standard.
2018-01-10 16:01:27 +01:00
Edwin Eefting 801a591282 fixed plugin id of "Communication - Kamstrup Multical 401". (accidental octal notation) 2018-01-10 15:09:10 +01:00
Gijs NoorlanderandDatuX 740efcb763 [Adafruit MPR121] Change deprecated name setThreshholds to setThresholds (#685)
See #684
2018-01-10 02:45:50 +01:00
Edwin Eefting 67fa39f4ed moved mqtt stuff outside of backgroundtasks(). fixes #683 in my test scenario 2018-01-10 02:25:01 +01:00
Edwin Eefting 7a8bb7c0e0 actually ignore MQTT messages that are too big. 2018-01-10 01:56:05 +01:00
Gijs NoorlanderandDatuX 961b1106aa Bugfix/v2.0 crash switch (#682)
* [crashes] Added constructors to initialize all members in structs

Numerous structs are defined, but none of them have default constructors and there is no guarantee the members will be set when used. 
With these default constructors, the parameters at least have an initialized value.

* [PubSubClient] Add bound checks on the internal buffer

Not sure if this was really causing an issue, but proper bound checks are always a good thing.

* [Crash Switch] Disabled delayBackground and added yield() calls

Something really fishy is going on with the delayBackground function, which will result in crashes when pressing the switch multiple times, with Domoticz MQTT enabled as first controller.
Disabled for now and delay(1) added to give background tasks a chance to do their work and make sure the watchdog doesn't perform a reset.

* [CI build errors] Commented out some unused variables

Travis considers them as error and fails the checks.

* [CI check] Out-of-bounds check fix
2018-01-10 00:49:47 +01:00
Gijs NoorlanderandDatuX 9dc549e62d [Flash info] Detailed flash information (#678)
Last few days a number of issues and forum topic was about the type of flash used on the ESP boards.

This is an extension of the detailed information page.

Perhaps also merge with the newer and more clear layout of pull request #624?
That pull request was only merged to the mega branch.
I kept the changes local, but perhaps they should be placed in the "Storage" section introduced with #624.
Maybe also that pull request should get merged into the v2.0 branch.
2018-01-10 00:35:27 +01:00
chunter1andDatuX c1a11ff6e4 ABC calibration feature added (#606) 2018-01-05 17:11:29 +01:00
Gijs NoorlanderandDatuX 151bf18cc6 [switch] Fixed switch behavior and default settings. (#675)
As described in #673 .
The problem was partly related to the default values stored in flash ("0"), which was not a valid value for the switch type.

When upgrading from an older version of ESPeasy, make sure to check the switch type (normal switch or dimmer) and save the settings for the switch device again, even when nothing was changed.
Default configuration and new added switches will now work like intended.

When a controller is enabled (e.g. Domoticz MQTT or -HTTP) and the button is pressed multiple times, the ESP may reboot. See issue #674.
2018-01-05 17:03:44 +01:00
ESPEasy release bot d2e2522c07 automaticly updated release notes for mega-20180104 2018-01-04 03:13:01 +00:00
ESPEasy release bot 4a212302e0 changed date format of nightly builds 2018-01-03 14:51:40 +00:00
ESPEasy release bot 993dd7ade3 automaticly updated release notes for mega-01032018 2018-01-03 04:00:06 +00:00
Edwin Eefting e4d68b9d0e readme updates 2018-01-03 01:32:02 +01:00
Edwin Eefting b5e093bc80 changed readme title 2018-01-03 01:06:48 +01:00
Edwin Eefting d544fc84e8 changed readme to reflect mega branch and automated builds 2018-01-03 01:04:18 +01:00
Edwin Eefting e6dba4456c Merge branch 'v2.0' into mega 2018-01-03 00:52:03 +01:00
Edwin Eefting a0a0c31a49 updated travis link to reflect v2.0 2018-01-03 00:51:56 +01:00
Edwin Eefting d2777a9b15 updated travis link to reflect v2.0 2018-01-03 00:50:49 +01:00
Edwin Eefting c7d12bb798 Merge branch 'v2.0' into mega 2018-01-03 00:48:13 +01:00
Edwin Eefting 901d87ad1d updated readme to reflect new binary names 2018-01-03 00:47:35 +01:00
ESPEasy release bot ef912a4484 automaticly updated release notes for mega-01022018 2018-01-02 23:32:50 +00:00
ESPEasy release bot b4debd9559 created releasebot script 2018-01-02 23:30:53 +00:00
Edwin Eefting d7277649dd merged v2.0 branch. disabled memory checker (takes too long, perhaps enable it via a commit keyword?) 2018-01-03 00:28:22 +01:00
Edwin Eefting f177ff9e11 automaticly updated release notes for v2.0.0-dev13 2018-01-02 17:41:19 +01:00
Edwin Eefting 53a2008a0a still trying to fix travis release scripts.. 2018-01-02 17:41:06 +01:00
Edwin Eefting 2525b0e502 automaticly updated release notes for v2.0.0-dev13 2018-01-02 14:24:08 +01:00
Edwin Eefting b7e7c0bb0b release all binaries by doing the full compile step as last 2018-01-02 14:21:21 +01:00
Edwin Eefting a397796188 automaticly updated release notes for v2.0.0-dev13 2018-01-02 13:25:28 +01:00
Edwin Eefting 33ec7e5240 Merge branch 'v2.0' into mega 2018-01-02 12:49:55 +01:00
Gijs NoorlanderandDatuX d62b692b3b [SDS011] Allow the sensor to sleep to extend sensor lifetime (#668)
* [SDS011] Add send commands to sensor

In the library used to communicate to the SDS011 sensor was only support to receive data from the sensor and not query the sensor or set another mode.
This is needed for #499 , to let the sensor sleep.

N.B. code is not yet tested, only implemented while reading the datasheet "Laser Dust Sensor Control Protocol V1.3"

* [SDS011] Lessen load on ESP by polling less frequent and use SoftSerial

The default setting were to set the delay to 0 and use an own software serial implementation.
This caused frequent timeouts on the web interface, WiFi reconnects, etc.
Now the already present SoftSerial is being used. This will gather all the data from the serial port and thus there is no need to poll 50 times a second.
Now the ESP is much more responsive.

* [SDS011] Allow the sensor to sleep to extend sensor lifetime

The internal laser of the SDS011 only will last for about 1 year when ran continuously.
When the RX of the sensor is connected, it can be set to sleep for N minutes between measurements. This will extend the lifetime of the sensor and reduce power consumption.
This sleep time is stored inside the flash of the sensor, so it can be set once and then the RX on the sensor could be disconnected again to be used for other purposes.
2018-01-02 12:22:57 +01:00
paulv888andDatuX 493bfd56b9 usesID = true (#666)
fixes #646
2018-01-02 11:41:01 +01:00
Gijs NoorlanderandDatuX 0f0bc30052 [PubSubClient] Bug in handling domainname (#660)
As discussed in pull request #629 and the new issue #658 and also on https://github.com/knolleary/pubsubclient/issues/375
In short, the PubSubClient does not store the domainname used to connect to, but only a pointer to the string.
However, PubSubClient should not expect this pointer to remain valid, since it is outside its scope. So PubSubClient should keep the domainname stored in its own variables.

This fixes the problem where the MQTT broker is no longer reachable after a while when using DNS instead of IP.
2017-12-31 15:51:21 +01:00
krikkandDatuX abbfa24ca6 added support for the TSL2591 Sensor based on Adafruit Library (#661)
* initial support for TSL2591 sensor

* return lux, visible, ir and full light separately

* better plugin init

* check sensor initialization before reading it..

* incorporated a few pending fixes for the adafruit library

* minor typo
2017-12-31 15:35:44 +01:00
Gijs NoorlanderandDatuX fae1edc859 [Security] Add IP-based filtering to web interface and http-commands. (#653)
* [mega] Detect client IP for SysInfo page and some cleanup

Added formatIP functions for readability and add client IP to SystemInfo page as preparation to detect origin just to get an idea of possibilities for #647.
Also added some reserve() statements to Strings to prevent heap fragmentation.

* [mega] Cleanup formatIP calls

* [security] #647 Add IP filtering to web interface and commands

As discussed in #647:
In the Config tab, a "Client IP filtering" section is added.
This allows for 3 levels of IP filtering:
* "Allow All" - does not imply any filtering based on IP address of the client.
* "Allow Local Subnet" - Allow only clients from within the local subnet, based on IP and subnetmask of the ESP.
* "Allow IP range" - Allow only clients within a range of IP-addresses.

Settings like these are very likely to lock out the rightful owner, so there are also two commands added, which can be sent via the serial connection.
* accessinfo
* clearaccessblock

The first one just displays the current active IP filtering.
The "clearaccessblock" command will temporarily disable the access filtering. This allows the user to login and reset the access filtering.

"Allow Local Subnet" is set as factory default.
Only when first loading a new firmware with this feature and existing configuration, the "All Allowed" is active (the old default)
2017-12-31 15:31:20 +01:00
s0170071andDatuX a9a741f775 fix chunking (#649)
* change chunking 

so that manual chunking is only done with core 2.3.0. 2.4.0rc2 and later do chunking web transfer implicitly

* Update WebServer.ino
2017-12-28 20:16:03 +01:00
Edwin Eefting c0d482e4fc merged v2.0 fixes 2017-12-28 19:01:16 +01:00
Gijs NoorlanderandDatuX 2b256389dd [WiFi] Avoid timeouts when not connected to WiFi (#639)
* [DNS/IP] Obey UseDNS setting for all controllers

As described in #381 #261 and #521
A first attempt to let all controllers use the same logic to connect to external hosts.

* [WiFi] Avoid timeouts when not connected to WiFi

As discussed in #589
Stil needed to actively disconnect network services when network was disconnected.

* [WiFi] Actively ignore network services when disconnected

All controllers now stop sending when WiFi disconnected.
Also add NTP update directly after connection was made.

Delay with waiting for unavailable network is now about 30 seconds, then normal boot continues. Every 60 seconds the WiFi will be polled again.
2017-12-28 18:31:19 +01:00
Bartłomiej ZimońandDatuX b5cabdc775 Update _C002.ino (#645)
related to #636
2017-12-18 23:14:11 +01:00
Gijs NoorlanderandDatuX e103cc38f7 [>49.7 days uptime overflow] Use separate function to compute time differences (#621)
* [time overflow] Use separate function to compute time differences

As discussed in #594
The timeOut() function had already a remark that it was behaving fishy.

It is now split into a timeDiff function and two convenience functions:
- timeOutReached
- timePassedSince

The timeDiff function may be a bit more elaborate than strictly needed, but it is very important to do it right and the original notation was very hard to read and understand.

Almost all locations in the code where millis() was used to compute a time difference or check for timeouts now use these functions.
Potentially all of these locations could cause issues when the timer wraps.

* [time overflow] Fix for a one-off error

2^31-1 can be casted to a long value.
Thus changed "<" into "<="
2017-12-18 22:54:43 +01:00
Gijs NoorlanderandDatuX c71a43c3a6 Reduce iRAM usage for plugins using SoftwareSerial (#631)
* [addLib] Added SoftwareSerial library

Added latest version from: https://github.com/plerup/espsoftwareserial

* [renLib] Renamed files to avoid conflicts with existing code

* [renLib] Changed include according to rename

* [renLib] Renamed all occurences and includes and removed unused pins

Renamed to make sure all plugins use the 'new' ESPeasySoftwareSerial.
Also added pinToIndex function to reduce memory footprint with about 150 Bytes, as described in issue #630

* [unused pins] Adjust indices in object list

Forgot to change the indices in the object list of SoftwareSerial

* Simple patch for timeouts

As mentioned in this issue: https://github.com/plerup/espsoftwareserial/issues/54

* [SoftSerial] Set ObjList static

Set the object list static to share all SoftwareSerial iRAM used as described in #630

* [revertLib] Revert to old version lib, since new version uses more iram

Just to test with old version, originally available in 2.3.0 library, to see if memory usage improves.

* [test] Reduce number of ports to 1 and lower buffer size to 18 for MHZ19

Just as a test, to see what happens to the iRAM usage, lower the number of concurrent softserial ports to 1.
Also the default buffer size = 64 Bytes. The MH-Z19 sensor can do with less, since a response will be up to 9 bytes, a 18-byte buffer allows for 2 messages to be stored.

* Enable usage of up to 10 concurrent softserial and reduce variable sizes

Re-enable use of up to 10 concurrent software serials.
Also reduce the variable sizes to smaller ranges. (e.g. uint8 instead of int)

* [test] Limit number of concurrent software serial devices

Earlier tests show the amount of iRAM used is somewhat related to the maximum number of allowed software serial ports.
In this test it is set to 3 and they are assigned through first come first served a slot.
2017-12-18 22:02:53 +01:00
Edwin Eefting cd01283ac6 Merge branch 'v2.0' into mega 2017-12-18 21:26:06 +01:00
M0ebiu5andDatuX 7ce1077bd6 P022_PCA9685 added change frequency - P038_NeoPixel added RGBW strips (SK6812) (#638)
* added change frequency

* rgbw test

* PCA9685 change frequency

* Cleanup RGBW implementation

* Added instructions
2017-12-18 21:18:39 +01:00
DaMandDatuX f9701d1c7b [Domoticz HTTP] Compatibility fix for BMP280 (#636) 2017-12-18 21:13:34 +01:00
GrovkillenandDatuX e764830113 Updated "/pinstates" page: Made the plugin number column display "P001" instead of "1" and "P012" instead of "12". 2017-12-18 21:11:00 +01:00
Gijs NoorlanderandDatuX 28eceffedf [v2.0] Add more characters to the list not to escape in URLs (#635)
As discussed in #634.
2017-12-18 21:04:59 +01:00
Gijs NoorlanderandDatuX 57a1b0dd6f [DNS/IP] Obey UseDNS setting for all controllers (#629)
As described in #381 #261 and #521
A first attempt to let all controllers use the same logic to connect to external hosts.
2017-12-08 14:31:51 +01:00
GHolliandDatuX 9646457b50 Cosmetics: fixing typos. (#628)
* Optimisation: save RAM.

* Another RAM optimisation (freeing RAM by moving static data from RAM to program memory).

* Fixing user-visible typos.

* Fixing typos in variables and comments.

* Fixing typos in comments.

* Revert changes of other pull request.
2017-12-08 14:18:24 +01:00
GrovkillenandDatuX 7346e55e0d Updated ESPTOOLS.exe from 0.4.6 to 0.4.12 (#627)
* Add files via upload

* Add files via upload

* Updated ESPTOOLS.exe from 0.4.6 to 0.4.12

See releases here: https://github.com/igrr/esptool-ck/releases
2017-12-08 13:57:04 +01:00
fensoftandDatuX ae38a8cb4f added #define FEATURE_SD (permit a flash size reduction of ~10k) (#568) 2017-12-08 13:56:13 +01:00
Sen HaerensandDatuX df46a4a5fc Enhanced system info layout (#624)
* Enhance sysinfo page layout

* Added hex notation for chip IDs

* Fixed comment
2017-12-08 13:48:17 +01:00
Gijs NoorlanderandDatuX a0b546e416 Move CO2 MH-Z19 plugin from "testing" to "normal" (#618)
As discussed in #616
2017-12-04 22:08:37 +01:00
GrovkillenandDatuX 7c6797a141 Move "TTP229 keypad" and "Encoder" plugin from "testing" to "normal" (#619)
* Add files via upload

* Add files via upload
2017-12-04 21:58:25 +01:00
tedenda 0d17c099e9 Merge remote-tracking branch 'origin/mega' into mega 2017-12-03 17:37:53 +01:00
mvdbro 83abac8c5e Fix #599 2017-12-03 15:13:29 +01:00
s0170071andDatuX 5ba6b2f335 split IP addrress (#605)
The system variable %ip% truncates the last octet or so when printed on small displays. Now there are four new variables %ip1%, %ip2%... so that the octet printout can be distibuted across two lines.
2017-11-23 19:04:59 +01:00
Edwin Eefting 64caeac9ee fix #588. parseTemplate() now only checks enabled taskes for [] macros 2017-11-22 03:38:06 +01:00
Edwin Eefting 0d4ba7c6f1 testing for ds18b20 2017-11-22 03:35:29 +01:00
Edwin Eefting a1fc351183 fix #588. parseTemplate() now only checks enabled taskes for [] macros 2017-11-22 03:33:34 +01:00
GrovkillenandEdwin Eefting 3131a075f5 Changed bin file names to be more descriptive. (#597)
* Changed bin file names to be more descriptive.

* Fixed TRAVIS check
2017-11-21 23:42:10 +01:00
GrovkillenandDatuX 33a6c39fc4 Changed bin file names to be more descriptive. (#597)
* Changed bin file names to be more descriptive.

* Fixed TRAVIS check
2017-11-21 23:40:19 +01:00
papperoneandDatuX f853f6ef25 deleted GPIO notes referring to 75HC595 not supported (#591) 2017-11-20 22:52:01 +01:00
Edwin Eefting 7a2d114360 fix illegal string manipulations in PLUGIN_WRITE for some plugins. fixes #347 and #460 2017-11-16 03:01:14 +01:00
Edwin Eefting 0157f387ee Merge branch 'v2.0' into mega 2017-11-16 02:02:22 +01:00
Edwin Eefting 3418f2b708 set lcd to NULL by default. #584 2017-11-16 01:18:51 +01:00
Gijs NoorlanderandEdwin Eefting 5a0f588344 [LCD plugin] Added check of LCD object before dereferencing it (#584)
Possible fix for #581.
Just looking at the description of the problem, this may be causing the crashes,since the commands may be trying to dereference the LCD pointer while it still is NULL.
2017-11-16 01:18:16 +01:00
GrovkillenandEdwin Eefting d362446451 Added categories... (#552) 2017-11-16 01:16:39 +01:00
sakinitandDatuX c23be231e1 Fix p1 wifi gateway module (#587)
* Fix receiving illegal characters using Domoticz

* Update P1GatewayServer life-cycle
2017-11-16 00:24:34 +01:00
Gijs NoorlanderandDatuX 00f5c36919 [P039 Thermocouple] Handling negative values and proper error logging (#586)
Cppcheck warned for 'suspicious code':
[src\_P039_Thermocouple.ino:254]: (warning) Suspicious code: sign conversion of -1 in calculation because '-1' has a negative value

I agree with cppcheck that the code is at least suspicious and probably compiler dependent.
So in order to let cppcheck no longer output a warning and make it a bit more readable, I made this change.

Also added logs to indicate errors reported by the sensor.
2017-11-16 00:05:23 +01:00
Edwin Eefting c960175ec1 set lcd to NULL by default. #584 2017-11-15 23:57:01 +01:00
Gijs NoorlanderandDatuX e456604436 [LCD plugin] Added check of LCD object before dereferencing it (#584)
Possible fix for #581.
Just looking at the description of the problem, this may be causing the crashes,since the commands may be trying to dereference the LCD pointer while it still is NULL.
2017-11-15 23:55:29 +01:00
GrovkillenandDatuX ac4657e77f Added categories... (#552) 2017-11-14 21:28:53 +01:00
papperoneandDatuX 3817427e79 Update _P073_7DGT.ino (#553) 2017-11-13 00:49:28 +01:00
Edwin Eefting 0200b3c63e fix travis build errors. disable cpp checking for now 2017-11-13 00:26:21 +01:00
Edwin Eefting 972a1a5703 Merge branch 'mega' of github.com:letscontrolit/ESPEasy into mega 2017-11-12 23:10:27 +01:00
mvdbro 73c22176b8 ESP32 fixed chunked HTTP transfer 2017-11-05 09:19:26 +01:00
mvdbro 4db036f350 ESP32 fix UDP instability 2017-11-04 17:15:24 +01:00
mvdbro 52223f0a20 ESP32 Enabled OTA 2017-11-04 10:38:14 +01:00
mvdbro 907ad0faf6 ESP32 fix FreeRAM reporting 2017-10-29 14:34:46 +01:00
mvdbro 887e10c947 ESP32 Rules/ADC/PWM 2017-10-28 16:07:00 +02:00
mvdbro b4c463e452 ESP32 IRAM/Deepsleep 2017-10-27 17:04:45 +02:00
mvdbro 66ba9b1f46 First preparations for ESP32 2017-10-25 16:10:16 +02:00
Edwin Eefting 7db50811ba esptest stuff 2017-10-23 20:44:23 +02:00
Edwin Eefting 17d20705ff smooth out testing code 2017-10-23 00:44:00 +02:00
Edwin Eefting e3bd782a42 test fixes 2017-10-22 23:20:07 +02:00
tedenda 85da10ef24 Merge branch 'letscontrolit/mega' into mega 2017-10-17 20:14:00 +02:00
tedenda 7f91ec2852 Merge branch 'mega' into letscontrolit/mega 2017-10-17 20:13:20 +02:00
Edwin Eefting b073379fff fixed bug in oled upstream lib 2017-10-16 17:29:26 +02:00
Edwin Eefting b89d8ff946 fix warnings 2017-10-16 17:19:48 +02:00
Gijs NoorlanderandDatuX 22ad971c8e Support both SSD1306 and SH1106 OLED in OLED_Framed plugin (#509)
* [SSD1306] Upgrade library to version 3.0

The library at https://github.com/squix78/esp8266-oled-ssd1306 has to be initialized differently in version 3.0

Known issue: The font for 3 lines is not working, so temporary used the same font as for 4 ilnes. The online font generator is currently unavailable at http://oleddisplay.squix.ch/

* OLED framed improve header footer

The header now has better visible WiFi bars indicator and alternates the device name and the connected WiFi SSID.

The bottom part now only shows dots for the pages with visible data instead of the maximum number of pages possible.

* [SSD1306] Upgrade library to version 3.2.7

Forgot to commit deletion of obsolete files in previous commit.

* [SSD1306] Added 12pt font for version 3.x of the library

The font generator is online again: http://oleddisplay.squix.ch/#/home 
Added Dialog Plain 12 font for the 3-line display mode.

* [OLED_Framed] Allow to use either SSD1306 or SH1106

The new OLED library  allows to use SH1106 and SSD1306 controler.
Added support for both with an selector to select the available controler.

* [OLED_Framed] Only destruct and construct display object when changed

* [OLED Framed] Add contrast setting to display

Both SSD1306 and SH1106 support setting the contrast.

* Update _P036_FrameOLED.ino
2017-10-16 16:55:22 +02:00
Edwin Eefting ab06cc3703 merged v2.0 fix for MHZ19 (was already fixed in a different way) 2017-10-16 01:54:37 +02:00
Edwin Eefting 8a5cc5f2bd fix plugin id (starting with a 0 makes it octal in c++ :( ) 2017-10-16 01:47:57 +02:00
papperoneandDatuX 6919baf23c Plugin 073 - 7-segment display plugin TM1637/MAX7219 2017-10-16 01:44:56 +02:00
Gijs NoorlanderandDatuX ddedb215c4 [MH-Z19] Allow for B-version and add filtering (#525)
* [MH-Z19] Allow for B-version and add filtering

The "B" version of the sensor does not output an S value, but does internally apply a dynamic response filter on the samples based on the amount of fluctiation in the data.
The implemented filter does something similar for the "A" version and for both adds the option for an extra delay filter to smooth the data.

Default filter setting ("off") is the old behavior, where only stable values are allowed.

* [MH-Z19] Improve label texts and logging

The first commit for the filtering had some confusing text labels.
Also it would be nice to see the effect of filtering in the logs.
2017-10-16 01:36:43 +02:00
Edwin Eefting 3dc5f1e160 Simple fix for MH-Z19 B version. #529 2017-10-16 01:33:34 +02:00
Tomasz TorczandDatuX 08d4d817f6 retain MQTT LWT messages (#516)
Retaining will messages allows monitoring agent to receive full info about clients state.
Without retaining, the monitoring agent will only be informed about events (connect/connection lost) happening during agent's connection to broker. Any reconnect would cause monitoring agent to lose state.
2017-10-16 01:18:45 +02:00
Edwin Eefting e8bdcfbaf2 keep TASKS_PER_PAGE at default value of 4 2017-10-16 01:16:55 +02:00
Edwin Eefting 743fb4494e improvement: Configurable number of tasks for "Devices" page #510
(by hexenmeister)
2017-10-16 01:15:34 +02:00
MichaelandDatuX 0a4bc7fad6 src/Hardware.ino: make it possible to use GPIO-0 (D3) as Pin_sd_cs (#508) 2017-10-16 01:04:12 +02:00
MichaelandDatuX 49d0b16324 WebServer.ino: enhance handle_SDfilelist() (#507) 2017-10-16 01:03:42 +02:00
Gijs NoorlanderandDatuX de479d6188 [SSD1306] Feature/oled 1306 library upgrade (#501)
* [SSD1306] Upgrade library to version 3.0

The library at https://github.com/squix78/esp8266-oled-ssd1306 has to be initialized differently in version 3.0

Known issue: The font for 3 lines is not working, so temporary used the same font as for 4 ilnes. The online font generator is currently unavailable at http://oleddisplay.squix.ch/

* OLED framed improve header footer

The header now has better visible WiFi bars indicator and alternates the device name and the connected WiFi SSID.

The bottom part now only shows dots for the pages with visible data instead of the maximum number of pages possible.

* [SSD1306] Upgrade library to version 3.2.7

Forgot to commit deletion of obsolete files in previous commit.

* [SSD1306] Added 12pt font for version 3.x of the library

The font generator is online again: http://oleddisplay.squix.ch/#/home 
Added Dialog Plain 12 font for the 3-line display mode.
2017-10-16 01:00:30 +02:00
Gijs NoorlanderandDatuX 3fd3e13dc7 OLED framed improve header footer (#495)
The header now has better visible WiFi bars indicator and alternates the device name and the connected WiFi SSID.

The bottom part now only shows dots for the pages with visible data instead of the maximum number of pages possible.
2017-10-16 00:55:25 +02:00
BadWolf42andDatuX d7d913d439 Dallas Plugin enhanced : no more "delay()" (#488)
* Enhanced Dallas pooling to avoid use of delay(800)

DS_readTemp has been split in 2: DS_convertTemp and DS_readonlyTemp.
DS_convertTemp is first called after DS_setResolution.
Then DS_convertTemp is called after temp has been read.
DS_readTemp has been kept for compatibility.
The only downside is that you read the temperature of previous query (value set by Timer/TDT option).

* typo

* Moved to Environment + code cleaning

- Moved Plugin from Temperature to Environment
- Modified Plugin_004_DS_crc8 to check CRC8, not return it
- Renamed Plugin_004_DS_convertTemp to Plugin_004_DS_startConvertion and removed useless vars in it
- Removed unneed braces and empty lines
- Added comments
2017-10-16 00:51:05 +02:00
SightofSilenceandDatuX 5c4ae3820b Add System Variable for day, month and year / Fix for "Calculate" function to recognize minus-sign (#485)
* Add files via upload

* Update Misc.ino

* Add files via upload
2017-10-16 00:47:58 +02:00
Gijs NoorlanderandDatuX 38774a20c6 Single function for format to user defined number decimals (#482)
* Single function for format to user defined number decimals

In a number of files the same long definition was cut and paste a lot to format  values to a user defined number of decimals.

Now a new simple function is added to Misc to perform this formatting, which results in more clean code, less prone to errors and a reduction in use of resources.

* Single function for format to user defined number decimals

In a number of files the same long definition was cut and paste a lot to format  values to a user defined number of decimals.

Now a new simple function is added to Misc to perform this formatting, which results in more clean code, less prone to errors and a reduction in use of resources.
2017-10-16 00:42:14 +02:00
Gijs NoorlanderandDatuX 9fc58bb4df P028 to support both BME280 and BMP280 to reduce resource usage (#481)
* P028 now supports both BME280 and BMP280

Both plugins P028 and P030 had a lot of code duplication. This takes up resources and is hard to maintain.
Now the P028 plugin can detect and use both sensors so P030 may be removed.

Only caveat is that the BMP280 does not measure humidity and thus actually is a 2-value sensor. The Domotics MQTT controller did not distinguish between them, but other controllers may do so.
When needed, the P030 plugin can still be a mere stub for the output and plugin definition and still share all code with P028.

* [BME280] Add temperature offset and improve read stability

The BME280/BMP280 may heat up internally if read too often and too long.
Also when built in a small container along with other sensors and the ESP, the sensor may read values which are too high.
To compensate for these higher readings, a constant offset may be applied in the device parameters.
This value is a signed integer value representing the offset in 1/10th degree Celsius.

Since the humidity is a relative value, depending on the temperature, this should be adjusted also.

Only this computed dew point temperature is also too high, due to the fact the sensor is warmer than the air and thus the perceived humidity is off.
To correct for this, half the offset temperature is being used to compute the dew point temperature.

The other improvement is the routine to read the sensor.

Using this routine, the sensor is only active for about 1.6 seconds each minute.
This prevents the sensor to heat up from its own readings and also allows stable readings using some filtering. (slamming a door does not affect the readings)

* [BMx280] Auto detect connected chip ID and show in Device config tab

Detect connected chip (BME280/BMP280) automatically and show detected device immediately in the Device config page next to the I2C address selection.

* [BME/BMP280] Perform reset at init

Just to make the reading a bit more stable when the sensor stops responding.
This is also done in the "official" Bosch github: https://github.com/BoschSensortec/BME280_driver

* [BMx280] Allow for more than one sensor 

As suggested in #491 for another sensor, its I2Caddress was handled incorrectly. The same applied to this plugin.
2017-10-16 00:27:04 +02:00
SloMustiandDatuX ca936ca42f implemewnted web activity timer tracker (#462) 2017-10-16 00:23:05 +02:00
Edwin Eefting 840fb6b647 Merge branch 'v2.0' into mega 2017-10-16 00:16:25 +02:00
Edwin Eefting 34f54c51e4 Merge branch 'v2.0' of github.com:letscontrolit/ESPEasy into v2.0 2017-10-16 00:16:10 +02:00
Edwin Eefting cda973a54f test library stuff 2017-10-16 00:15:43 +02:00
Edwin Eefting 8d77c29d75 update branching info 2017-10-16 00:15:28 +02:00
denisfrenchandDatuX c80b5d6d78 Set MQTT clientid to %sysname% +/- Settings.Unit (#431) (#436) 2017-10-16 00:12:09 +02:00
Gijs NoorlanderandDatuX 0454926d68 [INA219_v2.0] Improve logs for multiple devices (#546)
And added comments in the code about how to use multiple devices.
Also renamed the plugin to match existing "Energy" category as discussed in #542
2017-10-16 00:09:17 +02:00
hatzlhofferandDatuX 40067c514f added new display size 128x32 (#545)
added font size optimization
2017-10-16 00:06:59 +02:00
Edwin Eefting 77e5d8f00e working on test stuff 2017-10-15 23:09:14 +02:00
Edwin Eefting e33f9c1709 cleaner errors 2017-10-13 01:31:17 +02:00
Edwin Eefting 31ba3aad85 examples for the lone wanderer 2017-10-13 01:28:49 +02:00
Edwin Eefting 3c591f146e refactored and added automated test stuff 2017-10-13 01:19:35 +02:00
Edwin Eefting 35f82ea616 warnings are treated as errors now, by travis 2017-10-12 22:09:45 +02:00
Edwin Eefting 60f5bdb069 cleaned up notification stuff. fixed #502 2017-10-12 21:48:27 +02:00
Edwin Eefting 7be9f321a2 fixes 2017-10-12 21:34:04 +02:00
sassod eee55a92d9 Merge remote-tracking branch 'refs/remotes/letscontrolit/mega' into mega 2017-10-11 07:21:45 +02:00
Edwin Eefting 00998a8d3e worked around error caused by upstream libraries 2017-10-02 00:54:26 +02:00
Edwin Eefting 1f5d0f1968 travis fix 2017-10-02 00:38:30 +02:00
Edwin Eefting ec83cf39cd Merge branch 'mega' of github.com:letscontrolit/ESPEasy into mega 2017-10-02 00:36:11 +02:00
Edwin Eefting 7c8487632d now using PRAGMA to enable warnings, so that we dont get warnings from core libraries. also warnings will be treated as errors in Travis, this makes approving pull requests less work for me. 2017-10-02 00:36:01 +02:00
NeoandDatuX e6bd9adc03 [HT16K33_LED] Brightness control (#523)
Add command for controlling the LED display's brightness. Uses the function already available in the HT16K33 library.
2017-10-01 23:18:11 +02:00
Edwin Eefting 6f0c10dcd7 Merge branch 'mega' of github.com:letscontrolit/ESPEasy into mega 2017-10-01 23:15:29 +02:00
Edwin Eefting ddb3d1a0dd cleaned up more warnings and fixed a few real bug along the way. #235 2017-10-01 23:14:26 +02:00
Gijs NoorlanderandDatuX c187e7edc3 [INA219] Allow for multiple instances on the same controller (#519)
As described in #491.
The calibration settings are now stored per instance and the I2C address is now taken from the taskvalue array and no longer a global variable.
2017-10-01 01:46:44 +02:00
Edwin Eefting 9735e33e51 enabled warnings and started fixing all the warnings to reduce the noise. (because warnings where disabled wasted about 3 hours debugging a simple no-return bug) 2017-10-01 01:32:39 +02:00
Edwin Eefting 4eeb22110d solution for better error and warning highlighting when compiling with platformio 2017-09-30 23:50:41 +02:00
Edwin Eefting b190a43e7e cleaned up buildflags and created common build variable 2017-09-28 00:16:12 +02:00
Edwin Eefting 20b95c425e always define PLUGIN_BUILD_NORMAL so normal plugins are compiled 2017-09-28 00:06:21 +02:00
Edwin Eefting 5ba05ff769 fixed obscure crash caused by not returning a value in #235. we need to adjust compiler flags to detect these kinds of issues. 2017-09-24 00:54:55 +02:00
sassod 21398fbf8a Merge remote-tracking branch 'refs/remotes/letscontrolit/mega' into mega 2017-09-23 20:05:30 +02:00
Edwin Eefting 051f7c9f52 final fixes for #235, untested. all spiffs errors should be handled now and also show up in logs and webinterface 2017-09-23 16:19:22 +02:00
Edwin Eefting 0fa7817b2a more fixes for #235 2017-09-23 15:58:17 +02:00
mvdbro 95d5dd3c68 Bugfix: %eventvalue% parsing on literal strings
%eventvalue% parsing didn't correctly process literal strings (that
start with '!'). It tried to extract the value from the righthand of
'=', where it should parse the entire string.
2017-09-23 09:59:49 +02:00
Edwin Eefting 56fd1e0203 automaticly updated release notes for v2.0.0-dev12 2017-09-22 01:25:29 +02:00
Edwin Eefting 890487fcae fixed release-notes bug 2017-09-22 01:25:17 +02:00
Edwin Eefting 9b9dce0aaf automaticly updated release notes for 2.0.0-dev12 2017-09-22 01:07:19 +02:00
Alexander Schulz 139ae36d3e improvement: Configurable number of tasks for "Devices" page (TASKS_P…
…ER_PAGE)
2017-09-16 23:24:15 +02:00
beicandDatuX da6edeab86 Moving from Temperature to Environment naming (#506)
Moving from Temperature to Environment naming
2017-09-16 22:16:01 +02:00
JeroenandDatuX cdcf041073 Create _P071_Kamstrup401.ino (#504)
* Create _P070_Kamstrup401.ino

* Update and rename _P070_Kamstrup401.ino to _P071_Kamstrup401.ino

* Update _P071_Kamstrup401.ino

accidentally inserted a line break...

* Added [TESTING] to plugin name
2017-09-15 18:01:37 +02:00
papperoneandDatuX ec99795c1e HDC1080 plugin (#497)
* P010 plugin optimization

optimized code in P010 plugin (probably leftovers od previous versions)

* P010 Optimization

* HDC1080 plugin

HDC1080 plugin

* HDC1080 support

HDC1080 support

* Changed Plugin Number to 072

as 070 was used by another pull-request I renamed this to 072

* Update plugin name to fulfill developping guidelines
2017-09-15 18:00:27 +02:00
Edwin Eefting 0bc8570b4a plugin is not generic enough, so its disabled by default 2017-09-14 22:06:37 +02:00
Ovidiu SchiopuandDatuX 2d8e14eb87 Added _P070_NeoPixel_Clock.ino (#489)
* NeoPixel ring clock

A clock that uses a ring of 60 NeoPixel LEDs as display for a classic
clock.
The hours are RED, the minutes are GREEN, the seconds are BLUE and the
hour marks are WHITE.
The brightness of the clock hands and the hour marks can be set in the
device page, or can be set by HTTP  or Rules commands. The format is as
follows:
Clock,1,128,32 → 1=enable display, 128=hand brightness, 32=mark
brightness
Clock,0,, → 0=disable display, without changing the saved values of the
brightness
Clock,,65, → change only the brightness of the clock hands
Clock,,,10  → change only the brightness of the hour marks

* - The plugin declaration was cleaned up
- The commands are working
- Correction of offset

* Update _P070_NeoPixel_Clock.ino

* Fix

* Update _P070_NeoPixel_Clock.ino

* Changed the name of the plugin

Changed the name of the plugin to "Output - NeoPixel Ring Clock [TESTING]"

* GlobalSyncOption not needed

GlobalSyncOption not needed, therefore set to false.
2017-09-14 22:02:40 +02:00
beicandDatuX 4917dab1d3 Moving from Temperature to Environment naming (#492)
Moving from Temperature to Environment naming
2017-09-14 21:51:30 +02:00
SightofSilenceandDatuX 42e1eb33ef Add files via upload (#493) 2017-09-14 21:49:41 +02:00
Edwin Eefting c2fdd50655 fixes bug #486 in counter-plugin 2017-09-14 21:46:54 +02:00
Gijs NoorlanderandDatuX a643596c48 [MH-Z19] Add 'ABC disable' option to web config (#472)
* [MH-Z19] Add 'ABC disable' option to web config

As discussed in #466.
The default setting is the current behavior.
When changing the setting, it will be applied as soon as there is a stable reading.

* [MH-Z19] Read settings first before determine must apply flag.
2017-09-14 20:32:26 +02:00
Gerben MeijerandDatuX 04465454f4 Add SENSOR_TYPE_TRIPLE support to Domoticz MQTT (#468) 2017-09-13 19:36:09 +02:00
Edwin Eefting 190783f382 missed return after setting event buffer 2017-09-04 00:49:04 +02:00
mvdbro e51c5d8504 Moved HTML template logging to level LOG_LEVEL_DEBUG_DEV 2017-08-27 08:53:00 +02:00
mvdbro 3849befeaf Fixed a tasksettings load bug that was introduced with commit dcfc1e3 on july 18th. 2017-08-10 10:02:42 +02:00
mvdbro 05c61879f9 Finished work on Level Control & config 2017-08-08 18:46:59 +02:00
mvdbro 71f6b58dd7 Custom WEB page handler (SPIFFS) 2017-08-07 16:51:46 +02:00
Daniel TedenljungandDatuX c30074afc5 This plugin is tested and working good. (#428)
* This plugin is tested and working good.

* Renamed plugin

Renamed the plugin as @jkDesignDE and @Grovkillen suggested.
2017-07-30 01:09:18 +02:00
Jochen KrapfandDatuX 5aef196306 Fixed HTML text box length for controller settings - Issue #453 (#455) 2017-07-30 00:51:37 +02:00
Jochen KrapfandDatuX e09f5ca0a1 Rework of Plugin _P056_SDS011-Dust (#451)
* First rework

* Moved classes to library

* Finished rework
2017-07-30 00:49:10 +02:00
Jochen KrapfandDatuX 716ae30d9d Descriptive GPIO-Names (#448)
Changes:

Added PLUGIN_GET_DEVICEGPIONAMES to retreive GPIO-names from plugins

Changed Webserver to ask for GPIO-names (backward compatibility for old plugins)

Added GPIO-names to plugins
 - Chiming
 - Encoder
 - TTP229_KeyPad
 - DRF0299_MP3
 - HX711_Load_Cell
 - (more will follow)

Changed GPIO-names in hardware-page for uniformity

And because it was on the way:
Added PLUGIN_EXIT and prepared to unload members and memory from deselected device plugins
2017-07-20 14:06:25 +02:00
Jochen KrapfandDatuX 116c653db5 Added Plugins for SHT3x and LM75A - Issue #433 (#442)
* Added Plugins for SHT3x and LM75A - Issue #433

* Added I2C addresses to the I2C Scanner

* Added CONFIG define
2017-07-19 17:52:19 +02:00
Edwin Eefting dcfc1e3689 first set of changes for #235. added spiffs error checking and loging, and cleaner flashguarding code. next change will show feedback in web interface as well. also need to cleanup loose SPIFFS filehandling at other places in webserver.ino (create a save-function for all those things and use FLASH_GUARD) 2017-07-18 00:50:59 +02:00
Edwin Eefting 7ba981eaea automaticly updated release notes for v2.0.0-dev11 2017-07-17 00:55:29 +02:00
Jochen KrapfandDatuX ede5ed8b0d Plugin HX711 - Added Tare function (#419)
* Plugin HX711 - Added Tare function

* Added command "tare"
2017-07-16 19:35:27 +02:00
Jochen KrapfandDatuX b8877c53ed Plugin65 MP3 - volume updated in device menu - issue #424 (#438) 2017-07-16 19:34:04 +02:00
Edwin Eefting 296271007b added note to inverse logic to fix #318 2017-07-16 17:27:15 +02:00
Edwin Eefting d49a91c4a2 imlemented setting name, unit and password via serial. implements #317 2017-07-16 17:07:32 +02:00
Edwin Eefting 2b567f5578 gave some html logging debug-level 2017-07-16 16:50:11 +02:00
Edwin Eefting 8469188f75 Merge branch 'mega' of github.com:letscontrolit/ESPEasy into mega 2017-07-16 16:42:17 +02:00
Edwin Eefting 2409df4f5b made mdns a feature. consitent use of hostname for both mdns and dhcp client. hostname now is name_unitnumber, with spaces replaced by - 2017-07-16 16:42:07 +02:00
mvdbro c5c33cf6b6 Merge branch 'mega' of https://github.com/letscontrolit/ESPEasy into mega 2017-07-16 15:49:18 +02:00
mvdbro cea1d8b825 Revert to default ESP Easy colorscheme 2017-07-16 15:48:00 +02:00
SloMustiandDatuX 982ed4d677 added mDNS implementation (#418) 2017-07-16 15:47:34 +02:00
Edwin Eefting d424803cac more details AP mode serial output 2017-07-16 15:36:31 +02:00
SloMustiandDatuX 6cd3f514a6 Implemented a better WiFI AP naming strategy. ESP_Easy has replaced the newdevice text as the default name and now the name is used as and AP SSID (#410) 2017-07-16 15:09:54 +02:00
Edwin Eefting b5d4b96f14 Merge branch 'mega' of github.com:letscontrolit/ESPEasy into mega 2017-07-14 01:43:05 +02:00
Edwin Eefting f9ce235b32 fix HTTP chunked transfer encoding, since WebServer class doesnt support it. this fixes the 2 second delay in some browsers. (we where out of spec.) 2017-07-14 01:42:50 +02:00
Jochen KrapfandDatuX 491fa5c0a2 Added Value Logger on SD Card (#429) 2017-07-13 21:22:14 +02:00
Daniel TedenljungandDatuX 1bbbaa18f7 Renamed command to be unique. (#427) 2017-07-11 22:30:10 +02:00
Jochen KrapfandDatuX eff68b2173 Fixed multiline define bug on CRLF (#416)
Because of compiler-bug (multiline defines gives an error if file ending is CRLF) the define is striped to a single line
2017-07-07 14:42:44 +02:00
Jochen KrapfandDatuX 8b6adac269 Added Plugin for HX711 Load Cell - Request #408 (#415)
* First draft

* Added Plugin for HX711 Load Cell

* Typo
2017-07-07 14:38:54 +02:00
Jochen KrapfandDatuX e0edd56413 Added Plugin for Color Sensor VEML6040 (#412)
* First draft

* Added Plugin for Color Sensor VEML6040
2017-07-05 11:58:18 +02:00
Jochen KrapfandDatuX c95d04aa6b Added Plugin for Gesture Sensor APDS9960 (#409)
* First draft

* Work release

* work release

* Working release

Known BUG: While performing a gesture the reader function blocks rest of ESPEasy processing!!! (Feel free to fix...)
2017-07-05 11:55:12 +02:00
Jochen KrapfandDatuX 9a88269e28 Minor corrections and documentation (#404) 2017-07-05 11:53:34 +02:00
papperoneandDatuX d5847f9ea1 P010 plugin optimization (#403)
* P010 plugin optimization

optimized code in P010 plugin (probably leftovers od previous versions)

* P010 Optimization
2017-07-03 21:43:07 +02:00
mvdbro b3a75c0105 Merge branch 'mega' of https://github.com/letscontrolit/ESPEasy into mega 2017-07-02 16:07:04 +02:00
mvdbro 3ba2f38408 Update checkRAM function 2017-07-02 16:06:02 +02:00
Jochen KrapfandDatuX b455a676d8 Added Plugin for MP3 module (#402)
* Added Plugin for MP3 module

* Added [Testing] to name

* Documentation and cleanup

* Renaming to WTV020

* Documentation and corrections
2017-07-02 12:06:57 +02:00
Daniel TedenljungandDatuX e5dbb3c680 Added relay control from commands (#395) 2017-07-01 22:36:47 +02:00
Daniel TedenljungandDatuX 7d236e8564 Reading error code in other way (#394)
* Updated the way errorcodes are handled.

* Update of code after taliking with Trieb. Implemented function getBitOfInt(int reg, int pos).

* Read all bits

* Small update

Changed the way mask was defined
2017-07-01 22:36:05 +02:00
Gustavo SpadariandDatuX ae18a47bc9 Adding comments on RAW code (#386) (#393)
* Adding comments on RAW code (#386)

* Add some other comments
2017-06-29 23:39:06 +02:00
PieVoandDatuX 5dd4d49517 Update P053 (PMSx003) to support software serial and minor cleanup (#390)
* PMSx003: fix typo in description

* PMSx003: remove unused variable

* P053_PMSx003: make preparations for supporting hw and sw serial, read on plugin_read only

* P053_PMSx003: fix build and buffer reading (hw serial tested, sw not yet)

* P053_PMSx003: move serial reading to 10x sec, add debug levels, fix empty buffer read

* P053_PMSx003: drop log message in read, already posted as EVENT
2017-06-28 22:29:18 +02:00
Jochen KrapfandDatuX d708d6a057 Check plugin-array size on init - issue #119 (#389)
very nice! another issue fixed:)
2017-06-27 23:57:59 +02:00
imthemichiandDatuX c3db03ea5e Plugin_008-RFID extended with wiegand 34-bits and key-pad (#387)
* Plugin_008-RFID extended with wiegand 34-bits and key-pad (4-bits per key) support

* removed millis from interupt-handler and volatile from keyBuffer because of high IRAM usage
2017-06-26 10:07:02 +02:00
mvdbroandGitHub b65812ebf3 Merge pull request #385 from jkDesignDE/menu3
Reenabled javascript for device-selector
2017-06-24 09:49:15 +02:00
mvdbroandGitHub 698299f918 Merge pull request #384 from papperone/mega
P038 - optimization
2017-06-24 09:49:00 +02:00
JK 277d12205d Reenabled javascript for device-selector 2017-06-23 18:00:20 +02:00
papperone 52b3c2e962 P038 - optimization
deleted unneded parsing line in the WRITE function and used only the
event->Par1/5 variables already available
2017-06-22 22:41:30 +02:00
mvdbroandGitHub f6cadc43f3 Merge pull request #383 from jkDesignDE/menu2
Fine tuning of CSS and menu
2017-06-22 18:57:03 +02:00
mvdbroandGitHub e393d66283 Merge pull request #382 from tedenda/C011_Rename_constants
Renamed constants
2017-06-22 18:56:27 +02:00
JK 10e33de018 Fine tuning of CSS and menu 2017-06-22 13:20:13 +02:00
tedenda 842dc38805 Missed one... 2017-06-22 13:07:27 +02:00
tedenda 52ef5c06fd Renamed Prefix from P011 to C011 2017-06-22 12:57:41 +02:00
Edwin Eefting 1c63589b3d upgraded IRremoteESP8266 from v1.0.2 to v1.2.0. fixes #188 2017-06-21 17:17:21 +02:00
Jochen KrapfandDatuX 3e230310b9 Step back to style-based-css for speed up + pimp menu (#376)
* Renaming

* Fixed DEVICES_MAX for testing and dev

* Experiments with delivering HTML

* Step back to style-based-css for speed up

* pimp menu

* pimp menu
2017-06-21 01:52:39 +02:00
SloMustiandDatuX ce249aaa4a fixed deep sleep, such that it can be enabled from Rules (#375) 2017-06-21 01:50:28 +02:00
Jochen KrapfandDatuX bd216674d4 Fixed DEVICES_MAX for testing and dev (#374) 2017-06-20 13:16:27 +02:00
Edwin Eefting 32c4b1d614 add caching headers to static content 2017-06-20 00:30:59 +02:00
Edwin Eefting 1847746077 serial now no longer resonds to empty commands 2017-06-19 22:41:19 +02:00
Edwin Eefting 56741b425c fix #372 2017-06-19 22:31:13 +02:00
DatuXandGitHub 4f3a8e6acb Update issue_template.md 2017-06-19 21:10:54 +02:00
DatuXandGitHub f40d8c3cf4 Update issue_template.md 2017-06-19 21:10:35 +02:00
mvdbroandGitHub d7a3c74ad9 Merge pull request #370 from jkDesignDE/TTP229
Added Plugin for Touch KeyPad Chip TTP229
2017-06-19 20:02:17 +02:00
JK b5049cd9ca Added Plugin for Touch KeyPad Chip TTP229 2017-06-19 19:42:38 +02:00
mvdbroandGitHub 55536cc4b3 Merge pull request #366 from papperone/mega
Fixed Broken P038
2017-06-19 19:41:00 +02:00
mvdbroandGitHub cbbec517d6 Merge pull request #364 from jkDesignDE/ChunkedSend
Send web page as junked data - issue #352
2017-06-19 19:39:07 +02:00
mvdbroandGitHub db2624d49d Merge pull request #368 from jkDesignDE/CRLF
Accept CR and LF at serial commands
2017-06-19 19:33:27 +02:00
JK d7116735e9 First draft 2017-06-19 15:19:49 +02:00
papperone 43ba235e68 reverted some changes due to bug fixed in the "webserver.ino #348" 2017-06-18 23:10:50 +02:00
papperone 2c3c8f6e0d Merge remote-tracking branch 'refs/remotes/letscontrolit/mega' into mega 2017-06-18 23:07:51 +02:00
JK 6dc816869f Merge remote-tracking branch 'base/mega' into CRLF 2017-06-18 06:57:40 +02:00
mvdbro 5fff3c6ce7 Added pin state buffer table page (mainly for debugging) 2017-06-17 22:51:34 +02:00
JK fe85b0908c Accept CR and LF at serial commands 2017-06-17 22:36:29 +02:00
papperone 612742f669 p038
BugFixing
2017-06-17 18:55:55 +02:00
mvdbro 8d2303db5f Fix default controller settings (#360) 2017-06-17 16:41:52 +02:00
JK 97b90a09db Send web page as junked data 2017-06-16 09:19:10 +02:00
papperone dcdf095575 Fixed Broken P038
Fixed GUI of plugin adding correct GPIO request
Fixed code for "NeoPixelAll" command
Tested on ESP8266 and WemosD1Mini with various WS2812 configuration
hardware
2017-06-16 07:42:19 +02:00
JK 9ecfce472d First draft 2017-06-16 02:52:49 +02:00
Jochen KrapfandDatuX 20e5bc0081 Write default CSS to SPIFFS on boot (#357)
* Write CSS to SPIFFS on boot

* Fixed DEFINE bug

In CPPCHECK:
-> error: 'CPLUGIN_ID_002' was not declared in this scope

@mvdbro: please take a look
2017-06-15 09:06:14 +02:00
Edwin Eefting 5136d4757c accidently enabled FEATURE_ARDUINO_OTA 2017-06-12 23:03:13 +02:00
Edwin Eefting 2729e341c8 saved ~800 bytes ram in handle_devices(), issue #352. left old code commented for reference, in case i created bugs. will remove later 2017-06-12 22:55:42 +02:00
Jochen KrapfandDatuX 6d0399c6c7 Increase DEVICES_MAX for more testing and dev plugins (#353) 2017-06-12 13:25:31 +02:00
krikkandDatuX 72d07bc303 implemented a measurement type selection to retain backward compability to Domoticz... hope this works... (#351) 2017-06-11 21:58:18 +02:00
Daniel TedenljungandDatuX c55bb28038 Senseair update (#333)
* New company name

* New sensor: Relay Status

* New sensor: Temperature adjustment

* Small update of log messages

* Some renaming
2017-06-11 21:57:20 +02:00
Jochen KrapfandDatuX 0a746d017e Added plugins for HT16K33 LED matrix driver and key pad scanner (#328)
* First draft

* work release

* work release

* Work release

* Work release

* Work release

* Work release

* rename file

* Work release (not working)

* Rework with library

* Working LED plugin with Clock

* Added plugins for HT16K33 LED matrix driver and key pad scanner

* Fixed typing of Arduino.h

* Documentation
2017-06-11 21:56:07 +02:00
mvdbro de4517f614 Fix incorrect ADC GPIO display 2017-06-11 09:39:10 +02:00
mvdbro 0dcd89a653 MQTT Controller enable/disable fix (#287) 2017-06-10 22:52:01 +02:00
mvdbro f70970c6f3 Enlarge MQTT buffer for Domoticz MQTT controller 2017-06-10 22:34:55 +02:00
mvdbro 4d28d2b837 Fix Domoticz helper plugin #330 2017-06-10 22:31:55 +02:00
Jochen KrapfandDatuX b63e76adfe Fixed issue #348 (#349) 2017-06-10 14:31:59 +02:00
Jochen KrapfandDatuX 77eedf5d6c Added Plugin _P062_MPR121_KeyPad (#346) 2017-06-10 14:28:19 +02:00
Jochen KrapfandDatuX 01ff98be05 Fixed issues #308 #305 (#345)
* Formula option for  _P013_HCSR04 plugin #343

* First draft

* Fixed issues #308 #305
2017-06-10 14:27:32 +02:00
Jochen KrapfandDatuX 6222041a30 Formula option for _P013_HCSR04 plugin issue #343 #313 (#344)
* Formula option for  _P013_HCSR04 plugin #343

* Minor fixes to #313
2017-06-10 14:25:07 +02:00
Jochen KrapfandDatuX 302e0d7fa7 Added Plugin _P060_MCP3221 (#342)
* First draft

* Working release
2017-06-10 13:57:32 +02:00
krikkandDatuX 894e9c3ff6 added local ip to sysinfo plugin, due to limitation of return type float, i had to split up the ip in its octets... fixes issue #228 (#341) 2017-06-10 13:56:15 +02:00
Jochen KrapfandDatuX 66bda6d531 Added Plugin _P061_KeyPad (#340) 2017-06-10 13:53:46 +02:00
krikkandDatuX f3c7c68248 seconds were displayed without leading zero issue #337 (#338) 2017-06-10 13:52:28 +02:00
krikkandDatuX 093767f2b1 delay option should be displayed even if the SendDataOption is false, because the delay option also controls the refresh rate of the oled display... fixes issue #336 (#339) 2017-06-10 13:31:16 +02:00
Jochen KrapfandDatuX 50f6c403e8 Added Plugin for Quadrature Encoder Interface (Rotary Encoder) (#335)
* First draft

* Functional QEI plugin

* Corrected spelling of limits.h
2017-06-10 13:11:49 +02:00
Edwin Eefting 3c41155ee4 backup 2017-06-06 23:57:23 +02:00
Edwin Eefting dcc2dbf0c6 converted all commands to python 2017-06-06 23:26:00 +02:00
Edwin Eefting fd1da876a4 dont want wifi passwords on github 2017-06-06 23:03:53 +02:00
Edwin Eefting 93fc1b6140 dont want wifi passwords on github 2017-06-06 23:01:26 +02:00
Edwin Eefting 80fb17ca05 esptesting framework 2017-06-06 22:58:21 +02:00
Edwin Eefting ee0069ffa4 Merge branch 'mega' of github.com:letscontrolit/ESPEasy into mega 2017-06-06 19:46:12 +02:00
Edwin Eefting b1bd7d63f6 working on test framework 2017-06-06 19:46:01 +02:00
DatuXandGitHub ef8059cf56 Update README.md 2017-06-06 15:15:29 +02:00
Edwin Eefting 8d246947c1 Merge branch 'mega' of github.com:letscontrolit/ESPEasy into mega 2017-06-06 00:32:28 +02:00
Edwin Eefting 8bcf29fa11 Fixed variable naming bug in FEATURE_ADC_VCC 2017-06-06 00:32:23 +02:00
elucas2uyandDatuX 4b900daa67 FIX Pass and Index on handle_controllers() (#331)
* FIX Pass and Index on handle_controllers()

* Update WebServer.ino
2017-06-05 17:43:53 +02:00
Edwin Eefting a84567c14e Fixed crashbug in email notification 2017-06-04 22:36:02 +02:00
Edwin Eefting d4420b9e36 better rtc error logging 2017-06-04 12:15:51 +02:00
Daniel TedenljungandDatuX 6daa9a1e3c Fixed decimal values (#329) 2017-06-04 01:51:38 +02:00
Edwin Eefting 6a4f8a6942 added option do deepsleep on connection failures. had to change boot order a bit, so the rebooted/warmboot message is the first one now. (this also makes more sense). issue #206 2017-06-02 17:56:45 +02:00
Edwin Eefting 41974d12e5 prevent recursion when processing background tasks. might help with issue #117 2017-06-02 17:05:41 +02:00
Edwin Eefting ea5168c08a large changes to wifi handling. code cleanup, more efficent connecting, only one connect retry in deepsleep. better serial logging for connections and APmode. always enable ap mode when wifi is disconnected 2017-06-02 02:02:19 +02:00
Edwin Eefting d07bb3574a started working on regression testing scripts for The Rig 2017-06-01 20:43:47 +02:00
Edwin Eefting fb83badfce cleaned up RTC initialisation. fixed some fuzzy issues after flashing/factory reset. improved flash-counter messages and added powercycle tips 2017-06-01 01:38:19 +02:00
Jochen KrapfandDatuX 1a9eedc6d6 Added _P056_SDS011-Dust (#324)
* Added _P056_SDS011-Dust

* removed SDS-lib as submodule

* added SDS-lib as files
2017-05-31 01:02:04 +02:00
Jochen KrapfandDatuX b26b4a1a93 Added _P055_Chiming (#323) 2017-05-31 00:57:33 +02:00
krikkandDatuX f3e7dffec4 changed the ina219 plugin so that is always sends 3 values, voltage, current, power... like a normal plugin should do... (#325)
also added measurement range selection
2017-05-31 00:54:13 +02:00
Jochen KrapfandDatuX 9341bde0da Added _P054_DMX512 (#322) 2017-05-31 00:53:35 +02:00
Edwin Eefting e10a6e6f55 automaticly updated release notes for v2.0.0-dev10 2017-05-29 22:53:54 +02:00
krikkandDatuX f0ed209ba6 reverted change, this fix seems to have exactly opposite outcome than expected... with the fix applied i get errors, without is i get no errors... (#320) 2017-05-29 22:31:28 +02:00
Jochen KrapfandDatuX 2672558bfe Rework of plugin ADC (#319)
Minor changes of ADS1115
2017-05-29 22:30:14 +02:00
DatuXandGitHub ffe2f3f775 Update README.md 2017-05-28 23:52:55 +02:00
Edwin Eefting 92816f1a9f automaticly updated release notes for v2.0.0-dev9 2017-05-28 15:16:00 +02:00
Edwin Eefting 43ef90f688 also distribute ESP8285 binaries 2017-05-28 15:15:06 +02:00
Jochen KrapfandDatuX 2c6096dd31 Rework of plugin ADS1115 (#315)
* Fixed some minor HTML syntax bugs

* Fixed some minor HTML syntax bugs

* Rework of plugin ADS1115
2017-05-28 12:06:52 +02:00
krikkandDatuX 1cefa5eb1b AM2320: negative temperature fix... (#312)
* switched the library, now uses a library which correctly handles negative temperatures

* minor change
2017-05-27 17:55:13 +02:00
DatuXandGitHub a8e39b1899 Update README.md 2017-05-27 16:45:17 +02:00
DatuXandGitHub b1a47e4c3a Update README.md 2017-05-27 16:08:19 +02:00
Jochen KrapfandDatuX b7d881d136 Fixed some minor HTML syntax bugs (#310)
* Fixed some minor HTML syntax bugs

* Fixed some minor HTML syntax bugs
2017-05-26 11:14:06 +02:00
Alex Schwantes 67c3a166f5 Implemented use of addFormSelector methods to _P004_Dallas plugin.
Changed the device select box to show the one wire address for each connected sensor instead of just a number.
Added a blank option to the device address select box so that in the event that multiple devices are present and the configured device is not currently available, the select box will be blank instead of selecting a different device.
2017-05-23 03:41:13 +02:00
Jochen KrapfandDatuX 060b72e88b Pimp device-GUI and optimized HTML (#306)
* First draft

* work release

* work release (not working)

* optimized css

* Pimp device-GUI and optimized HTML

* Handle cppcheck error

* Round help button

* Minor bug fixes
2017-05-22 23:31:58 +02:00
Edwin Eefting 36550511f5 fixing cpp check 2017-05-18 23:00:29 +02:00
Edwin Eefting fb8188b14b fixing cpp check 2017-05-18 22:44:20 +02:00
Edwin Eefting 436564ba51 fixing cpp check 2017-05-18 22:39:48 +02:00
Edwin Eefting 9016f1b53e fixing cpp check 2017-05-18 22:25:46 +02:00
Edwin Eefting 0404a871f2 fixed a few out of bounds bugs in Misc.ino _P023_OLED.ino _P035_IRTX.ino _P037_MQTTImport.ino with cppcheck. also added cppcheck to travis to prevent such cases in the future 2017-05-18 22:21:01 +02:00
krikkandDatuX 1413c92678 do a dns lookup on every request, solves issue #261 (#302) 2017-05-16 21:13:06 +02:00
PieVoandDatuX 28208ac7a2 Plantower (#300)
* + pmsx005: add all values as output

* - PMSx005: remove additional measurements from values

* + PMSx005: fix return values for plugin function

* * PMSx003: rename filename to match devices (PMS3003, 5003, 7003, A003)

* * PMSx003: fix valuecount and prevent sending to controllen when nothing recveid yet

* * PMSx003: rename _P050 to _P053

* + PMSx003: add PLUGIN_BUILD_TESTING

* - PMSx003: remove old _P050 that made place for _P053
2017-05-14 19:47:04 +02:00
DatuXandGitHub 168a2c343c Update CONTRIBUTING.md 2017-05-14 11:53:06 +02:00
Jochen KrapfandDatuX a873e920d4 Fixed rules bug #297 (#299) 2017-05-14 11:42:27 +02:00
beicandDatuX 10838d544c Some little description corrections (#297) 2017-05-13 23:45:38 +02:00
Daniel TedenljungandDatuX ab48fc0dfd New look on Tools page (#296)
* New look on Tools page

* Smal adjustment
2017-05-13 23:01:15 +02:00
Jochen KrapfandDatuX bcf6521ef9 Added HTML templates for customization (#290)
* First draft of templates

* Added templates for customization

* Fixed dept_onchange(frmselect)

* Moved javascript to sendWebPage()

* moved javascript to template var

* Preparation for selected menus

and bugfix if 2 vars are stand near together

* removed libs from prev. commit

* rework of menu

* Some cleanup
2017-05-13 22:56:28 +02:00
krikkandDatuX 6f8d7d1ada i don't like hidden features, added a json button to the tools menu, next to the advanced button (#292) 2017-05-13 09:37:03 +02:00
Daniel TedenljungandDatuX c6f03551c5 addSubmitButton function added (#289) 2017-05-11 15:13:48 +02:00
Edwin Eefting b2a9679488 nicer sleep messages 2017-05-11 02:18:45 +02:00
Edwin Eefting b66d983060 bugfix in rtc checksum 2017-05-11 01:59:27 +02:00
Edwin Eefting 2b16ddedbf reboot and wifidisconnect should be handled by / 2017-05-11 01:54:44 +02:00
Daniel TedenljungandDatuX dbd89deb7b GUI touchup on Tools (#286)
* GUI touchup on Tools

I added some space between settings-firmware and firmware-filesystem to
make it look nicer (my opinion).

* Implemented addButton function
2017-05-11 00:40:30 +02:00
Jochen KrapfandDatuX 6c52721ed1 Limits to NumericBox and a bit of security to PasswordBox (#281)
* Limits to NumericBox and a bit of security to PasswordBox

* Limits to NumericBox and a bit of security to PasswordBox

Password handling: Deliver "*****" to password box accept changes if not equal to "*****"

* solved merge conflicts
2017-05-11 00:39:33 +02:00
Blair ThompsonandDatuX 03fbe8fcca Added Par4 and Par5 Variables (#248)
I am working on an RGBW lightbulb plugin and 3 variables are not enough
to control it.  Rather than add variables in the plugin (like neopixel
does) i think it is better to add them to EventStruct.  I only needed 4,
but neopixel uses 5
2017-05-11 00:14:28 +02:00
krikkandDatuX 9e0af20343 DHT plugin fix 'NaN' issue (#285)
issue https://github.com/letscontrolit/ESPEasy/issues/284 seems valid to me, implemented...
2017-05-10 23:40:26 +02:00
Daniel TedenljungandDatuX aa0b4d0fce P052: More descriptive log messages (#283)
* Better log messages

* Missed semicolon...
2017-05-10 23:38:47 +02:00
krikkandDatuX a9f6605065 addHelpButton Function and a new Help Button for the Rules and Hardware Page (#282) 2017-05-10 23:36:39 +02:00
krikkandDatuX 26b073ba34 make the Settings - Save. Filename more descriptive... (#273)
* make the Settings - Save. Filename more descriptive, didn't like this also. solves issue: #241

* added getDateString + getTimeString + getDateTimeString Functions and replaced dublicate code with the new functions...

* more comments :)
2017-05-10 23:34:40 +02:00
Jochen KrapfandDatuX 27bba1b628 Fixed readUserVarFromRTC() #265 (#280)
Uses checksum to verify user var buffer and fill with zero
2017-05-09 20:50:15 +02:00
Jochen KrapfandDatuX 6131ebca73 Replaced HTML code with addFormSelector() in all plugins (#278)
and added function addFormSelectorI2C()

Note: not all plugins can be tested :(
2017-05-09 20:47:05 +02:00
krikkandDatuX 01b42a6dfb addFormNumeric with min and max & More Form-Function replacements (#272)
* add getFormItemFloat, because we have some float input also

* more form-functions optimizations...

* addFormNumeric with min and max parameters

* ...and more formFunctions replacements

* ...and more formFunctions replacements

* ...and more formFunctions replacements

* ...and more formFunctions replacements

* ...so first round done...  will do another round when addFormSelector is merged...

* and a few controller text boxes can be replaced also...

* one char to much...
2017-05-09 00:19:03 +02:00
Jochen KrapfandDatuX 23be929f72 Preliminary final draft of bugfix #264 (#271)
Group name can be changed during merge in... ;)
2017-05-09 00:16:01 +02:00
Jochen KrapfandDatuX b536770a07 Added function addFormSelector (#270)
* Added function addFormSelector

usage:
        const String options[] = { F("DHT 11"), F("DHT 22"), F("DHT 12") };
        int indices[] = { 11, 22, 12 };

        addFormSelector(string, F("DHT Type"), F("plugin_005_dhttype"), 3, options, indices, choice );

or with zero based index:
        String options[4] = { F("Delta"), F("Delta/Total/Time"), F("Total"), F("Delta/Total") };

        addFormSelector(string, F("Counter Type"), F("plugin_003_countertype"), 4, options, NULL, choice );

+ minor HTML fixes in addFormSubHeader and addFormSeparator

* additional params to addSelector()

* replaced more HTML with Selector functions
2017-05-09 00:12:41 +02:00
Daniel TedenljungandDatuX 792982262b Updated wrong plugin number. (#269)
* Moving plugin from playground

I am now moving this plugin from playground to main repo. It is tested
for long time and works fine.

* Forgot #endif

* Exclude readme.

* Wrong plugin number
2017-05-05 00:12:43 +02:00
krikkandDatuX 541d50e6bb bug fix wrong return type + form function fixes (#266)
* seems to be a type, but return type must be int!

* for form-function optimizations

* even more form-functions....

* even more form-functions + type fix

* lots of form-functions...
2017-05-05 00:05:33 +02:00
Bartlomiej ZimonandEdwin Eefting c8d88140f7 Add backup Wifi network to Settings command 2017-05-04 16:54:38 +02:00
Bartlomiej ZimonandEdwin Eefting d3fdf27746 Add WifiSSID2,WifiKey2 commands 2017-05-04 16:53:53 +02:00
Bartlomiej ZimonandEdwin Eefting afb6860156 Push ProtocolIndex and ControllerIndex into CPLUGIN_WEBFORM_SAVE/LOAD 2017-05-04 16:52:42 +02:00
Bartlomiej ZimonandEdwin Eefting 48563bade6 Custom Controller Settings - add controller index 2017-05-04 16:50:47 +02:00
Bartlomiej ZimonandEdwin Eefting 017019e122 - Misc: typo 2017-05-04 16:06:32 +02:00
Edwin Eefting 8e0d78af7b Merge branch 'mega' of github.com:letscontrolit/ESPEasy into mega 2017-05-04 15:46:48 +02:00
Edwin Eefting 66531d46bd comments. checkudp only in backgroundtasks() 2017-05-04 15:46:38 +02:00
tedendaandDatuX 83dbb63d13 Moving plugin from Playground into main repo. (#262)
* Moving plugin from playground

I am now moving this plugin from playground to main repo. It is tested
for long time and works fine.

* Forgot #endif
2017-05-04 01:21:09 +02:00
krikkandDatuX 771f981c13 replaced static html code with the new addForm* Functions 2017-05-03 23:10:44 +02:00
JKandDatuX 9d5afd1e2a Fixed #196 and rework of IDX display 2017-05-03 11:52:26 +02:00
DatuXandGitHub 33ac272804 Update issue_template.md 2017-05-02 23:53:35 +02:00
DatuXandGitHub 30a1e4c7c3 Update README.md 2017-05-02 21:24:29 +02:00
Jochen KrapfandDatuX 1d97f08b34 Added addForm*-functions for easy web-interface and pimp GUI (#259)
* first draft

* work release

* work release

* work release

* work release

* work release

* work release

* Added addForm*-functions for easy web-interface and pimp GUI

Changes many HTML-code to function calls for less code and more readability. More changes are coming soon.
Some groupings in Web-Interface.
2017-05-02 21:10:54 +02:00
Edwin Eefting 752a741e60 input box fix on setting pages 2017-05-02 20:30:20 +02:00
krikkandDatuX 9eaf88abad another fix to http advanced...
never do code changes without testing it... fixed http get, but broke http post, now its working again
2017-05-02 08:39:22 +02:00
krikkandDatuX f5ffcf5454 use the new addCheckBox function and better display of device config page 2017-05-02 02:11:58 +02:00
Edwin Eefting e8c5a02ead timer boundschecker was off by one. fixed memanalyser total 2017-05-02 01:27:53 +02:00
Edwin Eefting 5c9d00c0a9 publish MQTT Connected message 2017-05-02 00:47:04 +02:00
Edwin Eefting 9b8d5bba4c cosmetic buildlog fix 2017-05-02 00:18:49 +02:00
Edwin Eefting 5f8e2a70d0 more details in memory analyser. run memory analyser via Travis 2017-05-02 00:10:03 +02:00
Edwin Eefting 19b1316205 fixed issue #253 (memory leaks/crashes) 2017-05-01 23:00:24 +02:00
krikkandDatuX b9f47d3cf2 i2c Temperatur & Humidity Sensor Am2320 (#251)
* add support for i2c am2320 temperature and humidity sensor based on this https://github.com/hibikiledo/AM2320 library

* add i2cScanner detection of AM2320 Sensor

* minor
2017-05-01 11:58:13 +02:00
krikkandDatuX 75067cd33f http advanced controller, correct passing of hostname (#250)
* http advanced controller, correct passing of hostname

fixes an error reported by mikrom in the forum: https://www.letscontrolit.com/forum/viewtopic.php?f=4&t=2973

* http request must close mit double newline...

wrong newline in case of get request without body
the request ends with a double newline, each in the form of a carriage return followed by a line feed
2017-04-30 12:54:37 +02:00
JKandDatuX 25477a1232 solved my commit mismatch 2017-04-27 11:20:44 +02:00
JKandDatuX 4b9b3f5a37 fine tuning of status LED and pimp hardware web site 2017-04-27 11:20:44 +02:00
JKandDatuX c0d147f3df added checkbox for status LED inversed 2017-04-27 11:20:44 +02:00
JKandDatuX 228f782762 added functions addCheckBox and addNumericBox 2017-04-27 11:04:52 +02:00
Edwin Eefting e952bb8731 cleaned up messagedelay: use the same function everywhere. and do serial processing as well during the messagedelay 2017-04-24 22:19:26 +02:00
Edwin Eefting 32dc1e69e5 automaticly updated release notes for v2.0.0-dev8 2017-04-24 13:21:32 +02:00
Edwin Eefting 9e53288ca4 fixed #239 due to improper PSTR. cleaned up string handling 2017-04-24 01:13:47 +02:00
Edwin Eefting 6ca0e5416c properly escape html in C011 generic http advanced. 2017-04-24 00:54:48 +02:00
Edwin Eefting 686d862024 escape html in the rules page, so that strings like &param do not cause problems. fixes issue #231 2017-04-24 00:36:19 +02:00
Edwin Eefting 60f1c79e2a dont use arduino OTA in the dev env 2017-04-24 00:33:04 +02:00
Edwin Eefting 25240591a3 Revert "Plugin_008-RFID extended with wiegand 34-bits and key-pad (4-bits per key) support". Now uses too much IRAM.
This reverts commit 7a197f516c.
2017-04-24 00:12:26 +02:00
Edwin Eefting 75b28225a6 select env 2017-04-23 23:56:32 +02:00
JKandDatuX 4e3fa4243a added union to TaskDevicePin1..3
use classic usage with single varables:
        if (Settings.TaskDevicePin1[event->TaskIndex] >= 0)
          pinMode(Settings.TaskDevicePin1[event->TaskIndex], OUTPUT);
        if (Settings.TaskDevicePin2[event->TaskIndex] >= 0)
          pinMode(Settings.TaskDevicePin2[event->TaskIndex], OUTPUT);
        if (Settings.TaskDevicePin3[event->TaskIndex] >= 0)
          pinMode(Settings.TaskDevicePin3[event->TaskIndex], OUTPUT);

or use in a more compact way as array:
        for (byte i=0; i<3; i++)
          if (Settings.TaskDevicePin[i][event->TaskIndex] >= 0)
            pinMode(Settings.TaskDevicePin[i][event->TaskIndex], OUTPUT);

or use in combination simultaneously (memory for single vars and array overlaps)
2017-04-23 21:21:17 +02:00
JKandDatuX 56a313f941 Using 3 I/O-pins consequently 2017-04-23 21:20:25 +02:00
imthemichiandDatuX 7a197f516c Plugin_008-RFID extended with wiegand 34-bits and key-pad (4-bits per key) support 2017-04-23 21:18:06 +02:00
tedendaandDatuX 48497a0786 Update _P049_MHZ19.ino 2017-04-23 21:16:20 +02:00
DatuXandGitHub 9badfe8fed Update README.md 2017-04-23 21:11:08 +02:00
Edwin Eefting 8f67ebe16f oops moved lib/Adafruit_TCS34725 to wrong place 2017-04-23 21:01:14 +02:00
Edwin Eefting b52c5a884f now no longer a submodule. lib/IRremoteESP8266 upstream version v1.0.2 2017-04-23 20:50:37 +02:00
Edwin Eefting 24e4f8c1fd now no longer a submodule. lib/ArduinoJson upstream version v5.6.4 2017-04-23 20:49:39 +02:00
Edwin Eefting 84c50f4863 now no longer a submodule, lib/Adafruit_TCS34725 upstream version 1.0.1-13-g12be4c6 2017-04-23 20:48:21 +02:00
Edwin Eefting 4d7e602155 now no longer a submodule. lib/Adafruit_NeoPixel, upstream version v1.0.6 2017-04-23 20:46:02 +02:00
Edwin Eefting 8d47f10519 now no longer a submodule lib/AS_BH1750, upstream version 092f0b1c5fa74eb2abe3d1b2925190d066e9506d 2017-04-23 20:44:26 +02:00
Edwin Eefting 3c616348f7 converted submodule to normal directory. lib/Adafruit_Motor_Shield_V2 upstream commit ee4c4d334f498d54cdf80c9cc6f5bdec2533f8bf 2017-04-23 20:39:26 +02:00
Edwin Eefting abe5ccec5d improved statusled handling in background tasks 2017-04-23 19:23:21 +02:00
Edwin Eefting 916de7909f fixed stability issues in c009. probably caused by illegal PSTR usage, but i completly cleaned up all string handling 2017-04-23 19:03:52 +02:00
Edwin Eefting ff720188f7 starting working on stability reporting function 2017-04-23 18:13:40 +02:00
Edwin Eefting d1180e4e47 replaced all readstringuntil() with safeReadStringUntil() 2017-04-16 18:57:28 +02:00
Dirk MoellerandDatuX 4e52fdeaab fix typo 2017-04-15 18:53:11 +02:00
Dirk MoellerandDatuX 67e2cff541 new function, Plugin_004_DS_setResolution und Plugin_004_DS_getResolution 2017-04-15 18:53:11 +02:00
beicandDatuX 1d9286419a Added detection for the SI1145 to I2C scenner
Added detection for the UV Index Sensor SI1145 to I2C scenner
2017-04-15 18:51:59 +02:00
beicandDatuX b6c1510365 Naming correction by Datasheet
According to manufacturer datasheet, it's nothing to do with "Ambient", they call it "Digital Infrared Thermometer"
https://www.melexis.com/-/media/files/documents/datasheets/mlx90614-datasheet-melexis.pdf
2017-04-13 00:39:31 +02:00
Edwin Eefting 323255143e added issue template to get cleaner bug reports 2017-04-13 00:03:29 +02:00
Edwin Eefting d0eedce248 fixed lots of common issues that might cause crashes in c011. also see https://github.com/letscontrolit/ESPEasy/issues/117#issuecomment-293713370 2017-04-12 23:35:01 +02:00
beicandDatuX 76fca12d1a Little naming correction
Little naming correction added "&" instead of "+" and changed letter "a" to be Uppercase.
2017-04-12 21:46:16 +02:00
beicandDatuX 70f7888905 Environment naming will better fit in...
"Environment" naming will better fit in instead of the long "Temperature & Pressure", and we will get a few char space more to use and it will fit nicely into the drop-down combo box too, otherwise is way to long!
2017-04-12 21:45:53 +02:00
beicandDatuX 1f65f16d09 Environment naming will better fit in...
"Environment" naming will better fit in instead of the long "Temperature & Humidity", and we will get a few char space more to use and it will fit nicely into the drop-down combo box too, otherwise is way to long!
2017-04-12 21:45:42 +02:00
beicandDatuX 541bc4e868 Environment naming will better fit in...
"Environment" naming will better fit in instead of the long "Temperature & Humidity", and we will get a few char space more to use and it will fit nicely into the drop-down combo box too, otherwise is way to long!
2017-04-12 21:45:30 +02:00
beicandDatuX bd3310ab0c Environment naming will better fit in...
"Environment" naming will better fit in instead of the long "Temperature & Pressure", and we will get a few char space more to use and it will fit nicely into the drop-down combo box too, otherwise is way to long!
2017-04-12 21:45:19 +02:00
beicandDatuX 8054930597 Environment naming will better fit in...
"Environment" naming will better fit in instead of the long "Temperature & Pressure", and we will get a few char space more to use and it will fit nicely into the drop-down combo box too, otherwise is way to long!
2017-04-12 21:45:08 +02:00
beicandDatuX b51d65c8cd Environment naming will better fit in... + naming
"Environment" naming will better fit in instead of the long "Temperature & Humidity", and we will get a few char space more to use and it will fit nicely into the drop-down combo box too, otherwise is way to long, plus added sensor naming like DHT11/12/22!
2017-04-12 21:44:55 +02:00
beicandDatuX e49c32ea01 Environment naming will better fit in + HTU21D
"Environment" naming will better fit in instead of the long "Temperature & Humidity", and we will get a few char space more to use and it will fit nicely into the drop-down combo box too, otherwise is way to long!
2017-04-12 21:44:41 +02:00
beicandDatuX 73a0136556 Environment naming will better fit in...
"Environment" naming will better fit in instead of the long "Temperature & Humidity & Pressure", and we will get a few char space more to use and it will fit nicely into the drop-down combo box too, otherwise is way to long!
2017-04-12 21:44:23 +02:00
krikkandDatuX 27ee456413 removed all unnecessary Strings due to new addLog with FlashStringHelper (#223) 2017-04-12 21:39:48 +02:00
Edwin Eefting 6f1a0c8dc7 fixed crashes caused by large MQTT packets 2017-04-12 00:43:04 +02:00
beicandDatuX 93710e2268 Added detection for the HTU21D to I2C scenner
Added HTU21D to I2C scenner as is on the 0x40 addresse
2017-04-10 22:44:36 +02:00
Edwin Eefting 14fb8e9738 avoid unneccesary string conversions and static buffers in c001 2017-04-10 22:42:17 +02:00
Edwin Eefting 24a2b62840 removed unneccesay delays from c001 2017-04-10 22:20:05 +02:00
Edwin Eefting d35889f9ae avoid static buffers in c001. addLog now also supports F(), so we dont need all those temporary variable definitions 2017-04-10 21:58:25 +02:00
Edwin Eefting 29fd1312cd fixed crash in C001 (when opening /controllers) 2017-04-10 20:13:36 +02:00
JKandDatuX 9a13b3cbdd More informative and intuitive status LED 2017-04-10 16:26:35 +02:00
DatuXandGitHub 5b90077df0 Update CONTRIBUTING.md 2017-04-09 16:05:39 +02:00
DatuXandGitHub fdb755a9c4 Update CONTRIBUTING.md 2017-04-09 15:51:01 +02:00
Edwin Eefting 39edb76ee0 contributing guidelines 2017-04-09 15:36:58 +02:00
Edwin Eefting 1e70ce91e7 Merge branch 'mega' of github.com:letscontrolit/ESPEasy into mega 2017-04-09 14:35:27 +02:00
Edwin Eefting bafee423b2 recuded number of pulsecounters from 8 to 4 to save IRAM 2017-04-09 14:34:38 +02:00
DatuXandGitHub d2a38c5f34 Update README.md 2017-04-09 13:52:52 +02:00
DatuXandGitHub 73d3be972d Update README.md 2017-04-09 13:52:21 +02:00
krikkandDatuX 01be80ca8c Bh1750: enhance to check for valid value (#208) 2017-04-09 13:43:03 +02:00
Emmanuel TattoandDatuX 6d9c7de7c0 getBearing should be outside the FEATURE_ARDUINO_OTA condition (#207) 2017-04-09 13:41:03 +02:00
krikkandDatuX 64c6970696 Httpadvanced crashfix + patch method (#204) 2017-04-09 13:36:35 +02:00
krikkandDatuX 7fa3150921 _P047_i2c-soil-moisture-sensor: allow change of sensor address (#201) 2017-04-09 13:35:52 +02:00
krikkandDatuX 268f99c5e3 Support for Tcs34725 RGB Color Sensor (#195) 2017-04-09 13:35:19 +02:00
beicandDatuX 988d0bbcb2 Menu correction, added BMP180 (#199)
Temperature & Pressure - BMP085/BMP180
2017-04-09 13:33:56 +02:00
DatuXandGitHub 2268a2115b Update README.md 2017-04-04 22:41:00 +02:00
krikkandDatuX f624c5737a Motorshield plugin string fixes (#200) (reduced memory usage) 2017-04-04 22:08:52 +02:00
Edwin Eefting 9c66f83fab cleaned up servo stuff 2017-04-04 00:30:41 +02:00
Edwin Eefting 65b78ee753 reduce memory usage N001 N002 2017-04-04 00:07:46 +02:00
Edwin Eefting 6097708952 reduced ram usage C003 ... C011 2017-04-03 23:52:10 +02:00
Edwin Eefting 7941bc6158 reduced mem C001 C002 2017-04-03 23:32:26 +02:00
Edwin Eefting d15139501c reduced memory usage _C001 2017-04-03 23:11:22 +02:00
Edwin Eefting d9674925d0 initial memory analyser and results 2017-04-03 20:34:34 +02:00
Edwin Eefting 027313872c make the IRTX plugin work without the IR plugin 2017-04-02 19:01:58 +02:00
Edwin Eefting 57c351a4d3 moved arduinojson and liquidcrytal includes to correct plugins. reanbled IR-modules to solve memory issues 2017-04-02 18:07:37 +02:00
Edwin Eefting 07b6642823 initial version of memory analyser 2017-04-02 17:51:13 +02:00
Edwin Eefting e44464f532 temporary disabled IR plugins, because of iram1_0_seg issues 2017-04-02 01:38:27 +02:00
David ConranandDatuX 43c8317c99 update sendSony() call to use repeats.
The SONY IR protocol calls for the remote code to be sent >= 3 times for it to work. Thus you should probably call this with a repeat=2.
Note however, don't merge this until you've updated easyesp to use the correct IRremoteESP8266 library (#188 #189) which implements the repeat feature.
2017-04-01 22:07:36 +02:00
David ConranandDatuX 16aceaac73 Update IRremoteESP8266 library url in .gitmodules
Replace the url to the old un-maintained fork of the IRremoteESP8266 library to its upstream canonical (and maintained) library.

This might explain why we've had some odd non-reproducible reports of our (IRremoteESP8266) library not working as expected.
2017-04-01 22:07:19 +02:00
krikkandDatuX cbf7ba59d4 added i2c address selection to ino219 plugin (#192) 2017-04-01 22:05:43 +02:00
jbaumannandDatuX 1464c00fb0 Addition of ESP8285 targets (#187)
* Addition of ESP8285 targets

In addition to the normal ESP8266 targets there are now targets for
normal_8285, test_8285 and dev_8285. Each of these targets provides an
additional build flag with -DESP8285

* Added ESP8285 build targets with correct flash size

Correction of the build modification done before, now with correct flash
siez of 1M

* Provide different GPIO dropdown lists for 8266 and 8285

The ESP8266 and ESP8285 expose different sets of GPIOs. This new version
of the web server provides different dropdown lists depending on the
build flag -DESP8285 (which is set in the new targets for building
ESP8285 fw).
2017-04-01 22:04:40 +02:00
krikkandDatuX 3f489fd32b cppcheck style fixes... (#186) 2017-04-01 22:02:04 +02:00
krikkandDatuX 6534d89cd7 rewrote bh1750 sensor based on better library... (#182) 2017-03-31 18:40:31 +02:00
krikkandDatuX 5d56d00fa2 Pulsecounter minor fix (#184) 2017-03-27 19:41:43 +02:00
krikkandDatuX 2cabe08eb8 I2csoilmoisture fixed bug with sleep mode (#178)
* added missing sensor types: LONG & WIND

* did a bit of code cleanup, like you suggested... removed a lot of code, and works as before! :)

* fixed typo

* added date to the time displays... changed password fields to type=password

* motorshield library should be a submodule, enhanced the motorshield plugin, with better command parsing, but still work to do..

* fully implemented steppers and DCMotors

* add replacement variable for systime, vcc, ip, sysload, uptime

* fixed bug with sleep mode

* 20 ms delay to wakeup should be enough
2017-03-23 17:24:37 +01:00
Jochen KrapfandDatuX 1e5a43ae6d Added function isDeepSleepEnabled() (#177)
Added function isDeepSleepEnabled()


Deep sleep time is limited to 32 bit (~1.2h)
2017-03-23 17:22:44 +01:00
krikkandDatuX fbd7fa83b6 Tsl2561 rewrite (#174)
complete rewrite, now has better support for lower lux values, also better handling of higher values, add ability to change gain and sleep mode, based on sparkfun library
2017-03-23 17:19:06 +01:00
krikkandDatuX 6de51645b3 re-did old pull requests (#172)
re-did the following pull requests to mega repository:
#89 Fix url link to setup after the first WiFi setup
#93 Allow use it with rain gauge

setting hostname on arduinoOTA
warning to not change filename on setting save/load (had the issue myself)
2017-03-23 17:12:41 +01:00
adb76andDatuX cfc3af3510 BME280: Ensure sensor is in sleep mode to set the config, fix small typo
Based on the specification it is necessary that the sensor is in sleep
mode when the configuration registers are changed. So the call with the
config registers should also be the last call since we are leaving the
sleep mode and are changing to the forced mode.
2017-03-19 14:24:19 +01:00
krikkandDatuX a4f8e0178f corrected name for TSL2561, add option to use different sensor adress (#170) 2017-03-18 17:15:30 +01:00
krikkandDatuX b3edbdf225 http advanced: add replacement variable for systime, vcc, ip, sysload, uptime (#167)
* added missing sensor types: LONG & WIND

* did a bit of code cleanup, like you suggested... removed a lot of code, and works as before! :)

* fixed typo

* added date to the time displays... changed password fields to type=password

* motorshield library should be a submodule, enhanced the motorshield plugin, with better command parsing, but still work to do..

* fully implemented steppers and DCMotors

* add replacement variable for systime, vcc, ip, sysload, uptime
2017-03-18 17:07:07 +01:00
adb76andDatuX 1d1d69a13f Set BME280 to recommended values for climate / weather sensor
According to Bosch Sensortec the suggested settings for climate /
weather monitoring are:

Sensor mode:  forced mode, 1 sample / minute
Oversampling settings: pressure ×1, temperature ×1, humidity ×1
IIR filter settings: filter off

To measure new values in the forced mode a write to the
"BME280_REGISTER_CONTROL" is necessary, which I added to the temperature
reading.
2017-03-18 16:15:15 +01:00
DatuXandGitHub dca6871a4e Merge pull request #168 from infernix/mega-mhz19update
Extend MH-Z19 sensor support
2017-03-18 04:39:51 +01:00
Gerben Meijer 9d3b119448 Extend MH-Z19 sensor support
* Added commands to set the measurement range to 1000/2000/3000/5000ppm.
* Added command to do sensor zero calibration (actually 400ppm
  calibration)
* Added command to en/disable Automatic Background Calibration
* Added command to reset sensor
* Ignore (but log) any sensor boot time values
* Ignore (but log) any sensor values where stability isn't optimal
* Report undocumented U value (minimum CO2 per time period for ABC?) to log and MQTT
* Much more verbose logginga
* Shifts serial read buffer upon CRC errors (usually happens when sensor
  restarts during operation, or timing is off at device boot)
2017-03-18 01:17:08 +01:00
krikkandDatuX 45ad68cd61 motorshield library should be a submodule, enhanced the motorshield plugin... (#162)
* added missing sensor types: LONG & WIND

* did a bit of code cleanup, like you suggested... removed a lot of code, and works as before! :)

* fixed typo

* added date to the time displays... changed password fields to type=password

* motorshield library should be a submodule, enhanced the motorshield plugin, with better command parsing, but still work to do..

* fully implemented steppers and DCMotors
2017-03-16 21:58:03 +01:00
dev0andDatuX 9402fb73a9 _C009.ino: RFC conformity and removed obsolet code (#163)
I have changed http request from GET to POST as already suggested by @mvdbro to fulfill RFC compliance. Furthermore the obsolte commands from url were removed and I added build information to JSON data.
2017-03-15 11:38:59 +01:00
Edwin Eefting 853ddb0d38 automaticly updated release notes for v2.0.0-dev7 2017-03-15 01:42:15 +01:00
Edwin Eefting fbdc78e46d fix in release-script (forgot to commit it last time) 2017-03-15 01:40:47 +01:00
Edwin Eefting c0da3a1831 automaticly updated release notes for v2.0.0-dev7 2017-03-15 01:32:29 +01:00
Edwin Eefting d7f32b1cb1 fixed Arduino IDE compilebug and added help to enable plugin sets in Arduino IDE 2017-03-15 01:26:18 +01:00
Edwin Eefting e9aec70ba9 added i2scanner via serial. removed spaces from Adafruit Motor Shield library so it works with arduino IDE 2017-03-15 01:20:40 +01:00
krikkandDatuX 750658be10 show date in webinterface, and changed password fields to type=password (#161) 2017-03-14 17:52:58 +01:00
Edwin Eefting 510bd22533 timers can be disabled by setting them to 0 now. cleaned up event output logging. added timer out-of-bounds checks 2017-03-14 01:12:53 +01:00
krikkandDatuX 85de1ba4ac code cleanup for HTTP advanced controller 2017-03-13 22:55:56 +01:00
Edwin Eefting 3bdabc8974 automaticly updated release notes for v2.0.0-dev6 2017-03-13 11:54:41 +01:00
Edwin Eefting bb45183df3 automaticly updated release notes for v2.0.0-dev6 2017-03-13 11:52:02 +01:00
Jochen KrapfandDatuX 0a1f9d5e47 cancel deep sleep loop by pulling the pin GPIO16(D0) to GND (#158)
recommended wiring: 3-pin-header with 1=RST, 2=D0, 3=GND
short 1-2 for normal deep sleep / wakeup loop
short 2-3 to cancel sleep loop for modifying settings
2017-03-13 11:51:28 +01:00
Edwin Eefting 1a92890e4e added plugin to testing. remove useless value variable 2017-03-13 01:03:03 +01:00
GeraldandDatuX bfc0dbc131 added missing sensor type, to fix problem with i2c soilmoisture sensor... (#157) 2017-03-13 00:46:26 +01:00
GeraldandDatuX 05bde80ffd HTTP Advanced, enhanced, so that only one http request is sent for one sensor (#156) 2017-03-13 00:44:16 +01:00
Edwin Eefting b3aa5f4bc6 major change: changed the timing of the first sensor read after initial boot. cleaned up and improved deep sleeping code. 2017-03-12 20:04:52 +01:00
Edwin Eefting 80ae38e196 cold boot startup delay 2017-03-12 19:07:15 +01:00
Edwin Eefting 9535482dbf enabled Arduino OTA for dev-firmware only, to ease developing. minor output-tweaks 2017-03-12 17:17:55 +01:00
Edwin Eefting e2862cef05 Implemented speaker and tone functions from https://www.letscontrolit.com/forum/viewtopic.php?f=4&t=343&hilit=speaker&start=10 2017-03-12 15:45:52 +01:00
Edwin Eefting 8b97538382 use sizeof instead of magic numbers 2017-03-12 14:19:20 +01:00
Edwin Eefting cc4addec9f enable status light as soon as wifi is connected 2017-03-12 14:18:50 +01:00
dzikusandDatuX 0461f5bd96 Added BMP280_CONFIG_SETTING to reduce the temperature of sensor and use oversampling filter (#155)
Added BMP280_CONFIG_SETTING to reduce the temperature of sensor and use oversampling filter
2017-03-12 13:23:37 +01:00
Edwin Eefting 09e95cd1ff do hardwareinit() earlier so that outputs are set immeadiatly instead of waiting for connect. fixes https://github.com/letscontrolit/ESPEasy/issues/114 2017-03-12 02:28:09 +01:00
Edwin Eefting 8a02f2cbd2 remove artificial sensor startup delays. (now all sensors are send immediatly after booting and wifi-connecting) 2017-03-12 02:21:40 +01:00
Edwin Eefting 63f1bb9a9e added NDIR CO2 Sensor MH-Z19 plugin to TESTING plugin set 2017-03-12 02:12:52 +01:00
Edwin Eefting ea1c033402 bug fix: plugin_id should not start with a 0. (compiler interprets this as octal!) 2017-03-12 02:07:28 +01:00
Edwin Eefting ce1f35e5ff Revert "bug fix: plugin_id should not start with a 0. (compiler interprets this as octal!)"
This reverts commit b5131b3fac.
2017-03-12 02:00:00 +01:00
Edwin Eefting b5131b3fac bug fix: plugin_id should not start with a 0. (compiler interprets this as octal!) 2017-03-11 23:58:16 +01:00
Edwin Eefting 66852bdc8d created script to assist in creating releases 2017-03-11 18:35:50 +01:00
Edwin Eefting 611c695cd2 automaticly updated release notes for v2.0.0-dev5 2017-03-11 18:15:59 +01:00
Edwin Eefting fe74ef7a04 automaticly updated release notes for v2.0.0-dev5 2017-03-11 18:08:49 +01:00
Edwin Eefting 451e78c1fa use TRAVIS_TAG when building releases 2017-03-11 17:38:55 +01:00
Edwin Eefting fc2ae2e18e BUILD_GIT is now defined via environement variables 2017-03-11 17:33:33 +01:00
Edwin Eefting c51aaf5789 updated release notes for test1 2017-03-11 14:42:58 +01:00
Edwin Eefting 364dffbd86 created release notes from R148 to v2.0.0-dev4 2017-03-11 14:40:29 +01:00
GeraldandDatuX 0d9bc92690 add missing features from "Generic HTTP" Plugin to "Generic HTTP Advanced" Plugin (#151)
* minor fix, shared variable name with bme280, not good :)

* added authentication and missing sensortypes
2017-03-11 08:03:24 +01:00
krikkandDatuX b6dff4fb15 added function to enable/disable sleep mode and version check 2017-03-10 22:35:43 +01:00
krikkandDatuX d218962abd new plugin for adafruit motorshield v2, still needs a library and only support DC Motors up till now... still room for improvement 2017-03-08 22:45:36 +01:00
krikkandDatuX 883a58b92c variable name collision with adafruit motorshield v2 library, no functional change 2017-03-08 22:45:36 +01:00
Gustavo SpadariandDatuX 2520420bba IR RAW Code implementation 2017-03-08 22:40:46 +01:00
Gustavo SpadariandDatuX 54bd2fb3b5 Rename tmpString to cmdCode for clarity 2017-03-08 22:40:46 +01:00
Gustavo SpadariandDatuX 4a99773c5c Adding IR received code extra info 2017-03-08 22:40:46 +01:00
krikkandDatuX b7be7dd431 minor fix, shared variable name with bme280, not good :) 2017-03-08 22:21:50 +01:00
Edwin Eefting 6bcbd1fbb6 Merge branch 'mega' of github.com:letscontrolit/ESPEasy into mega 2017-03-07 18:57:49 +01:00
Edwin Eefting d3a81927ac simplified string handling and fixed buffer overflow 2017-03-07 18:57:43 +01:00
JustMe-NLandDatuX 255274b9e0 Update WebServer.ino
Bugfix #139
Controller selection already had a question mark next to it pointing to the wiki so explanation of the missing MQTT can be done there.
2017-03-07 18:29:57 +01:00
DatuXandGitHub a897ced63f Update README.md 2017-03-07 15:20:04 +01:00
NonflammableandDatuX 3055583706 Extend functionality of P038
Added new commands:
NeoPixelAll - set all LEDs to specified color (eg. NeoPixelAll,255,255,255)
NeoPixelLine - set color LED between <start led nr> and <stop led nr> to specified color (eg. NeoPixelLine,1,6,255,255,255)
2017-03-04 20:08:51 +01:00
krikkandDatuX df5e7b04e8 added measurement mode selection 2017-03-04 20:07:15 +01:00
krikkandDatuX 868e6323c6 version check to detect if sensor is present, optimized address handling 2017-03-04 17:32:47 +01:00
DatuXandGitHub a383b0b250 Update README.md 2017-03-04 11:46:23 +01:00
DatuXandGitHub 8a7ef77f58 Update README.md 2017-03-04 11:45:56 +01:00
DatuXandGitHub 32ee4a943e Update README.md 2017-03-04 11:45:41 +01:00
JustMe-NLandDatuX d4885405e1 Fix broken Domoticz MQTT helper
The Output - Domoticz MQTT Helper (plugin 29) was broken in ESPEasy
mega because of the additional controllers.
2017-03-04 11:14:22 +01:00
JustMe-NLandDatuX c2dc6b1a3d Fix Windspeed values
Domoticz expects the windspeed to be send in m/s multiplied by 10. To
keep the plugin compatible with other controllers who expect the wind
speed to be m/s the default values are defined by ten and are
multiplied by ten in de C001 and C002 sensor handling.
2017-03-03 14:24:22 +01:00
JustMe-NLandDatuX b986a0b387 Fix double define
Both plugins declared BUFFER_SIZE. Changed both declares by adding a
prefix “PXXX_”.

P1WifiGateway used a backslash which caused a escape character warning
in the compiler, changed this two double backslash.
2017-03-03 14:24:22 +01:00
psy0rztestandDatuX 067b65b30e Removed !echo, because its not supported in Windows. 2017-03-02 13:52:48 -08:00
GeraldandDatuX 6d8cedd736 one newline to much
there should be no empty line, it breaks my connection to the influx db http api
2017-03-02 13:11:52 -08:00
GeraldandDatuX d547826020 Update _P047_i2c-soil-moisture-sensor.ino
its working and i think its ready for testing, not so much new code, just another i2c sensor :)
2017-03-02 12:02:42 -08:00
krikkandDatuX 1091c88a9d new Plugin for SoilMoisturesensor from Tindie (https://www.tindie.com/products/miceuz/i2c-soil-moisture-sensor/)
minor fixes in http advanced to allow sensor type triple and http response 2xx not 200 only
2017-03-02 12:02:42 -08:00
Edwin Eefting 7997ca20b4 deploy in platformio format 2017-03-02 19:11:04 +01:00
DatuXandGitHub 0127a83014 Update README.md 2017-03-02 15:22:35 +01:00
805 changed files with 139907 additions and 13496 deletions
+22
View File
@@ -0,0 +1,22 @@
# cmd: "cd {PROJECT_PATH}; platformio"
cmd: "platformio"
name: "Build with error highlighting (dev_ESP8266_4096)"
args:
- run --environment dev_ESP8266_4096
sh: true
cwd: "{PROJECT_PATH}"
# env:
# VARIABLE1: "VALUE1"
# VARIABLE2: "VALUE2"
errorMatch:
- "(?<file>[\\/0-9a-zA-Z\\._]+):(?<line>\\d+):(?<col>\\d+):\\s+error:\\s+(?<message>.+)"
warningMatch:
- "(?<file>[\\/0-9a-zA-Z\\._]+):(?<line>\\d+):(?<col>\\d+):\\s+warning:\\s+(?<message>.+)"
# keymap: <keymap string>
# atomCommandName: namespace:command
# targets:
# extraTargetName:
# cmd: "<command to execute>"
# args:
# # (any previous options are viable here except `targets` itself)
+33
View File
@@ -0,0 +1,33 @@
# Contributing to ESPEasy
:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:
## Issue tracker
* The issue tracker is NOT a support forum. For support questions go to our forum: https://www.letscontrolit.com/forum/viewforum.php?f=1
* Only post an issue if you're 100% sure you've hit a bug. If your not sure, post on the forum first to see if anyone can confirm it.
This way we keep the issue tracker as short as possible, which saves our developers a lot of time.
Also there are more people on the forum that can help you with support.
## Pull requests
* Make sure your code compiles.
* Make sure your code does not have warnings. (Warnings will be treated as errors by our Travis system.)
* Try to create different pull requests for different features/fixes.
* Dont combine a lot of different stuff in one huge pull request.
* The v2.0 branch should get only fixes, new stuff should go into the mega-branch. (We will merge those fixes from v2.0 to mega)
* Incomplete or unstable plugins should have a PLUGIN_BUILD_DEV #ifdef around them. Also add [DEVELOPMENT] to the name.
* Do not modify any of the variables passed to your PLUGIN_WRITE handler.
* New plugins that seem to be working correctly should have a PLUGIN_BUILD_TESTING around until they are tested enough. Also add [TESTING] to the name
* Also see our general guidelines at: https://www.letscontrolit.com/wiki/index.php/ESPEasyDevelopmentGuidelines
+68
View File
@@ -0,0 +1,68 @@
### Checklist
- [ ] The title of this issue is "to the point" and descriptive.
- [ ] This issue describes what is happening.
- [ ] This issue describes what components are affected (e.g. name of plugin/controller)
- [ ] This issue describes how to reproduce it.
- [ ] This issue describes when it was introduced (when known) and what version is now showing the problem.
### I have...
- [ ] searched the [issue tracker](https://github.com/letscontrolit/ESPEasy/issues) or the [forum](https://www.letscontrolit.com/forum/viewforum.php?f=1) for a similar issue. (include links when applicable)
- [ ] entered a system description using "Copy info to clipboard" on the sysinfo page. (when possible)
- [ ] entered the full filename of the used version (e.g. `ESP_Easy_mega-20181001_test_ESP8266_4096_VCC.bin` )
- [ ] given a list of active plugins or controllers when applicable.
- [ ] filled out all applicable fields below.
### Steps already tried...
- [ ] Tried a clean install (empty `.bin` files are included in the ZIP)
- [ ] Tested previous/other build (mention which one already tested)
- [ ] Tested on other node to make sure hardware isn't defective.
- [ ] Verified if the problem is limited to a single plugin/controller
### If you self compile, please state this and PLEASE try to ONLY REPORT ISSUES WITH OFFICIAL BUILDS! ###
<!--- If you self compile, please state this and PLEASE try to ONLY REPORT ISSUES WITH OFFICIAL BUILDS! --->
<!--- NOTE: This is not a support forum! For questions and support go here: --->
<!--- https://www.letscontrolit.com/forum/viewforum.php?f=1 --->
<!--- Remove topics that are not applicable to your feature request of issue --->
<!--- Remember to have a "to the point" TITLE --->
### Summarize of the problem/feature request
<!--- Describe the problem or feature request --->
YOUR TEXT GOES HERE
### Expected behavior
<!--- Tell us what should happen? --->
YOUR TEXT GOES HERE
### Actual behavior
<!--- Tell us what happens instead? --->
YOUR TEXT GOES HERE
### Steps to reproduce
<!--- How can we trigger this problem? --->
1.
2.
3.
<!--- Does the problem persists after powering off and on? (just resetting isn't enough sometimes) --->
<!--- Please document if you have restarted the unit and if the problem is then gone etc. etc. --->
### System configuration
<!--- Please add as much information and screenshots as possible --->
Hardware:
<!--- You should also provide links to hardware pages etc where we can find more info --->
<!--- If you self compile, please state this and PLEASE try to ONLY REPORT ISSUES WITH OFFICIAL BUILDS! --->
ESP Easy version:
<!--- In order to have a better readablity of your issue then you should place screenshots here --->
<!--- Simply drag and drop them onto this template, move the text string below the "ESP Easy settings/screenshots" topic --->
ESP Easy settings/screenshots:
### Rules or log data
<!--- place your code/rules between the two ``` rows --->
<!--- remove if not applicable! --->
```
```
+22
View File
@@ -1,4 +1,26 @@
## OS Specific Hidden Files ####
# MacOSX Finder *****
.DS_Store
# Fuse FileSystem ***
.fuse_hidden*
## PlatformIO ##################
.pioenvs
.clang_complete
.gcc-flags.json
.piolibdeps
## Project #####################
lib/readme.txt
src/Custom.h
/ESPEasy
test/output_export.cpp
.vscode
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
docs/build/
-9
View File
@@ -1,9 +0,0 @@
[submodule "lib/Adafruit_NeoPixel"]
path = lib/Adafruit_NeoPixel
url = https://github.com/adafruit/Adafruit_NeoPixel.git
[submodule "lib/ArduinoJson"]
path = lib/ArduinoJson
url = https://github.com/bblanchon/ArduinoJson.git
[submodule "lib/IRremoteESP8266"]
path = lib/IRremoteESP8266
url = https://github.com/sebastienwarin/IRremoteESP8266.git
+29 -3
View File
@@ -1,15 +1,41 @@
language: python
python:
- '2.7'
- '2.7'
#we want a newer cppcheck, so use trusty
dist: trusty
sudo: false
cache:
directories:
- "~/.platformio"
- "./.pioenvs"
addons:
apt:
packages:
- cppcheck
install:
- pip install -U platformio
- pip install -U platformio sphinx recommonmark sphinx_bootstrap_theme
script:
- platformio run
# - bash ./preflight.sh # make sure input files are OK before wasting time with prereqs
# - cppcheck --enable=warning src/*.ino -q --force -I src --include=src/ESPEasy.ino --error-exitcode=1
# - ./memanalyzer.py ~/.platformio/packages/toolchain-xtensa/bin/xtensa-lx106-elf-objdump
- PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run
- PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run
# patch platformio core libs for PUYA bug (https://github.com/letscontrolit/ESPEasy/issues/650)
- cd patches; ./check_puya_patch; cd ..
- PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -s --environment dev_ESP8266PUYA_1024
- PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -s --environment dev_ESP8266PUYA_1024
before_deploy:
- ./before_deploy
+8
View File
@@ -0,0 +1,8 @@
The scripts in this directory are so called GIT hooks.
Purpose is to do automatic changes after merge, commit and checkout.
Those files are for a Linux-like environment with basic tools ln, grep, sed and bash.
Windows users can see them as template.
To use them simply copy those files into your ESPEasy/.git/hooks directory.
+43 -4
View File
@@ -1,7 +1,46 @@
# ESPEasy (mega branch)
|Latest Nightly | Build Status | Patreon | Ko-Fi | PayPal |
|-------|-------|-------|-------|-------|
| [![GitHub version](https://img.shields.io/github/release/letscontrolit/ESPEasy/all.svg)](https://github.com/letscontrolit/ESPEasy/releases/latest) | [![Build Status](https://travis-ci.org/letscontrolit/ESPEasy.svg?branch=mega)](https://travis-ci.org/letscontrolit/ESPEasy) | [![donate](https://img.shields.io/badge/donate-Patreon-blue.svg)](https://www.patreon.com/GrovkillenTDer) | [![donate](https://img.shields.io/badge/donate-KoFi-blue.svg)](https://ko-fi.com/grovkillentder) | [![donate](https://img.shields.io/badge/donate-PayPal-blue.svg)](https://www.paypal.me/espeasy) |
This is the development branch for the next upcoming release (2.0.0). This is also known as ESPEasyMega.
For ways to *support* us, see [this announcement on the forum](https://www.letscontrolit.com/forum/viewtopic.php?f=14&t=5787), or have a look at the [Patreon](https://www.patreon.com/GrovkillenTDer), [Ko-Fi](https://ko-fi.com/grovkillentder) or [PayPal](https://www.paypal.me/espeasy) links above.
Binary development releases are here: https://github.com/letscontrolit/ESPEasy-platformio/releases
# ESPEasy (development branch)
More details on the forum: http://www.letscontrolit.com/forum/viewtopic.php?f=18&t=2257&p=13600#p13600
Introduction and wiki: https://www.letscontrolit.com/wiki/index.php/ESPEasy#Introduction
**MEGA**
:warning:This is the development branch of ESPEasy. All new untested features go into this branch. If you want to do a bugfix, do it on the stable branch, we will merge the fix to the development branch as well.:warning:
Next stable branch: https://github.com/letscontrolit/ESPEasy/tree/v2.0 (bug fixes only, since oct 2017))
Check here to learn how to use this branch and help us improving ESPEasy: http://www.letscontrolit.com/wiki/index.php/ESPEasy#Source_code_development
## Automated binary releases
Every night our build-bot will build a new binary release: https://github.com/letscontrolit/ESPEasy/releases
The releases are named something like 'mega-20180102' (last number is the build date)
Depending on your needs, we release different types of files:
Firmware name | Hardware | Included plugins |
----------------------------------------------|-------------------------|-----------------------------|
ESPEasy_mega-20180102_normal_ESP8266_1024.bin | ESP8266 with 1Mb flash | Stable |
ESPEasy_mega-20180102_test_ESP8266_1024.bin | ESP8266 with 1Mb flash | Stable + Test |
ESPEasy_mega-20180102_dev_ESP8266_1024.bin | ESP8266 with 1Mb flash | Stable + Test + Development |
ESPEasy_mega-20180102_normal_ESP8266_4096.bin | ESP8266 with 4Mb flash | Stable |
ESPEasy_mega-20180102_test_ESP8266_4096.bin | ESP8266 with 4Mb flash | Stable + Test |
ESPEasy_mega-20180102_dev_ESP8266_4096.bin | ESP8266 with 4Mb flash | Stable + Test + Development |
ESPEasy_mega-20180102_normal_ESP8285_1024.bin | ESP8285 with 1Mb flash | Stable |
ESPEasy_mega-20180102_test_ESP8285_1024.bin | ESP8285 with 1Mb flash | Stable + Test |
ESPEasy_mega-20180102_dev_ESP8285_1024.bin | ESP8285 with 1Mb flash | Stable + Test + Development |
## More info
Details and discussion are on the Experimental forum: https://www.letscontrolit.com/forum/viewforum.php?f=18
Automated builds of the (new) documentation can be found at [ESPEasy.readthedocs.io](https://espeasy.readthedocs.io/en/latest/)
We're also on IRC: #ESPEasy @freenode
+44 -14
View File
@@ -1,25 +1,55 @@
#!/bin/bash
VERSION=$(git describe)
echo "Creating release archives for $VERSION ..."
#binaries
# cp .pioenvs/mini_512/firmware.bin dist/"ESPEasy_$VERSION""_mini_512.bin"
cp .pioenvs/normal_1024/firmware.bin dist/"ESPEasy_$VERSION""_normal_1024.bin"
cp .pioenvs/normal_4096/firmware.bin dist/"ESPEasy_$VERSION""_normal_4096.bin"
#Naming convention:
# ESP_Easy_[github version]_[plugin set]_[chip type]_[flash memory].bin
cp .pioenvs/test_1024/firmware.bin dist/"ESPEasy_$VERSION""_test_1024.bin"
cp .pioenvs/test_4096/firmware.bin dist/"ESPEasy_$VERSION""_test_4096.bin"
cp .pioenvs/dev_1024/firmware.bin dist/"ESPEasy_$VERSION""_dev_1024.bin"
cp .pioenvs/dev_4096/firmware.bin dist/"ESPEasy_$VERSION""_dev_4096.bin"
for ENV in \
normal_ESP8266_1024 \
normal_ESP8266_4096 \
normal_ESP8285_1024 \
normal_IR_ESP8266_4096 \
normal_core_241_ESP8266_1024 \
normal_core_241_ESP8266_4096 \
test_ESP8266_1024\
test_ESP8266_4096\
test_ESP8266_4096_VCC\
test_ESP8285_1024\
dev_ESP8266_1024\
dev_ESP8266_4096\
dev_ESP8285_1024\
dev_ESP8266PUYA_1024\
dev_ESP8266PUYA_1024_VCC\
hard_SONOFF_POW\
hard_SONOFF_POW_R2_4M\
hard_Shelly_1\
esp32dev\
esp32test_1M8_partition;\
do
echo
echo "### Deploying environment $ENV for version $VERSION"
BIN=.pioenvs/${ENV}/ESP_Easy_${VERSION}_${ENV}.bin
cp .pioenvs/${ENV}/firmware.bin $BIN
python2 crc2.py $BIN
mv $BIN "dist/bin/ESP_Easy_${VERSION}_${ENV}.bin"
done
#create a source structure that is the same as the original ESPEasy project (and works with the howto on the wiki)
rm -rf dist/Source 2>/dev/null
mkdir dist/Source
cp -r lib dist/Source/Libraries
cp -r src dist/Source/ESPEasy
rm dist/Source/Libraries/readme.txt
#rm -rf dist/Source 2>/dev/null
rm -rf dist/Docs 2>/dev/null
mkdir -p dist/Source
#mkdir -p dist/Docs
cp -r lib dist/Source/
cp -r src dist/Source/
#cp -r docs/build/ dist/Docs/
cp platformio.ini dist/Source/
cd dist
echo
echo "### Creating zip archive"
zip ../ESPEasy_$VERSION.zip -r .
+116
View File
@@ -0,0 +1,116 @@
import sys
import binascii
import struct
import md5
import os
MD5DUMMY = "MD5_MD5_MD5_MD5_BoundariesOfTheSegmentsGoHere..." #48 chars
FILENAMEDUMMY = "ThisIsTheDummyPlaceHolderForTheBinaryFilename64ByteLongFilenames" #64 chars
MemorySegmentStart,MemorySegmentEnd,MemoryContent=[],[],[]
##################################################################
# this subroutine shows the segments of a part
##################################################################
def showSegments (fileContent,offset):
global MemorySegmentStart, MemorySegmentEnd, MemoryContent
header = struct.unpack("ii", fileContent[offset:offset+8])
herestr =""
herestr2 =""
MemorySegmentStart.append(struct.pack("I",header[0]))
MemorySegmentEnd.append(struct.pack("I",header[0]+header[1]))
MemoryContent.append(fileContent[offset+8:offset+8+header[1]])
if fileContent.find( MD5DUMMY, offset+8, offset+8+header[1]) >0 :
herestr= " <-- CRC is here."
if fileContent.find( FILENAMEDUMMY, offset+8, offset+8+header[1]) >0 :
herestr2= " <-- filename is here."
print ("SEGMENT "+ str(len(MemorySegmentStart)-1)+ ": memory position: " + hex(header[0])+" to " + hex(header[0]+header[1]) + " length: " + hex(header[1])+herestr+herestr2)
#print ("first byte positoin in file: " + hex( offset+8))
#print ("last byte postion in file: " + hex(offset+8+header[1]-1))
return (8+offset+ header[1]); # return start of next segment
##################################################################
# this subroutine shows the parts of a binary file
##################################################################
def showParts(fileContent, offset):
header = struct.unpack("BBBBi", fileContent[offset:offset+8])
print ('\n\nBINARY PART\nSegments: ') + (hex(header[1]))
nextpos =offset+8
for x in range (0,header[1]):
nextpos = showSegments(fileContent,nextpos)
nextSegmentOffset = (fileContent.find("\xe9", nextpos))
return nextSegmentOffset
##################################################################
# MAIN
##################################################################
#if len(sys.argv) !=2 :
# print ("please give a filename")
# k=input("press close to exit")
# sys.exit(1)
FileName = sys.argv[1]#"C:/ArduinoPortable/sketchbooks/build/sketch_jan15a.ino.bin"
#FileName = "C:/ArduinoPortable/sketchbooks/build/sketch_jan15a.ino.bin"
print( "\n\nReplacing dummy MD5 checksum in .bin file")
with open(FileName, mode='rb') as file: # b is important -> binary
nextpos =0;
fileContent = file.read()
while nextpos >=0:
nextpos = showParts(fileContent,nextpos)
startArray,endArray,hashString = "","",""
includeStr = "hash includes segments:"
# memory sections:
# 0: bootloader (not readable)
# 1: program memory (SPI flash)
# 2: unknown but stable
# 3: RAM (initialized by bin file. Can be read but changes as you go :-( )
# 4: RAM
for i in (1,2 ): # use only stable segments, must be 4 in total. We use 2.
startArray =startArray + MemorySegmentStart[i]
endArray = endArray + MemorySegmentEnd[i]
hashString =hashString + MemoryContent[i]
with open(FileName+str(i), mode='wb') as file: # b is important -> binary
file.write(MemoryContent[i])
includeStr = includeStr +" "+ str(i)
print (includeStr)
# IMPORTANT: pad array with zeros if you use only 3 segments (see above)
while len(startArray) < 16 :
startArray =startArray + struct.pack("I",0)
endArray = endArray + struct.pack("I",0)
# debug print (binascii.hexlify(startArray))
# debug print (binascii.hexlify(endArray))
if (len(endArray) + len (startArray)) != 32 :
print("ERROR: please make sure you add / remove padding if you change the semgents.")
BinaryFileName = "";
if fileContent.find( FILENAMEDUMMY) < 0:
print("ERROR: FILENAMEDUMMY dummy not found in binary")
else:
BinaryFileName=os.path.basename(FileName) +"\0"
if len(BinaryFileName) >64: # check that filename is <48 chars
BinaryFileName=BinaryFileName[0:64] # truncate if necessary. 49th char in ESP is zero already
else:
BinaryFileName= BinaryFileName.ljust(64,'\0'); # pad with zeros.
if fileContent.find( MD5DUMMY) < 0:
print("ERROR: MD5 dummy not found in binary")
else:
hashString=hashString.replace (MD5DUMMY,"",1)
m = md5.new()
m.update (hashString) #use segment 1
md5hash = m.digest()
print("MD5 hash: "+ m.hexdigest())
print("\nwriting output file:\n" + FileName)
fileContent=fileContent.replace(MD5DUMMY,md5hash+startArray+endArray)
fileContent=fileContent.replace(FILENAMEDUMMY,BinaryFileName)
with open(FileName, mode='wb') as file: # b is important -> binary
file.write(fileContent)
#k=input("press close to exit")
BIN
View File
Binary file not shown.
+63
View File
@@ -0,0 +1,63 @@
plugin |cache IRAM |init RAM |r.o. RAM |uninit RAM |Flash ROM
src/_C001.ino |0 |0 |272 |0 |3520
src/_C002.ino |0 |4 |528 |32 |6064
src/_C003.ino |0 |0 |64 |0 |1072
src/_C004.ino |0 |0 |56 |8 |1280
src/_C005.ino |0 |4 |56 |8 |1424
src/_C006.ino |0 |0 |64 |0 |1296
src/_C007.ino |0 |4 |32 |0 |1664
src/_C008.ino |0 |0 |80 |0 |2272
src/_C009.ino |0 |4 |352 |16 |4896
src/_C010.ino |0 |0 |48 |0 |1136
src/_C011.ino |0 |0 |152 |8 |5248
src/_N001_Email.ino |0 |0 |72 |8 |1808
src/_N002_Buzzer.ino |288 |12 |8 |264 |1184
src/_P001_Switch.ino |1028 |8 |104 |280 |7248
src/_P002_ADC.ino |0 |0 |16 |0 |336
src/_P003_Pulse.ino |167 |0 |144 |192 |2544
src/_P004_Dallas.ino |0 |0 |64 |16 |2496
src/_P005_DHT.ino |0 |0 |56 |8 |1520
src/_P006_BMP085.ino |0 |4 |48 |8 |2112
src/_P007_PCF8591.ino |0 |0 |8 |8 |400
src/_P008_RFID.ino |101 |0 |56 |8 |624
src/_P009_MCP.ino |0 |0 |104 |24 |3232
src/_P010_BH1750.ino |0 |0 |56 |8 |2688
src/_P011_PME.ino |0 |4 |96 |0 |3040
src/_P012_LCD.ino |0 |4 |120 |8 |3520
src/_P013_HCSR04.ino |90 |0 |64 |16 |1552
src/_P014_SI7021.ino |0 |4 |48 |0 |1824
src/_P015_TSL2561.ino |0 |0 |56 |8 |3488
src/_P016_IR.ino |288 |0 |72 |480 |3600
src/_P017_PN532.ino |0 |0 |88 |72 |2016
src/_P018_Dust.ino |0 |0 |56 |8 |512
src/_P019_PCF8574.ino |0 |0 |104 |24 |2848
src/_P020_Ser2Net.ino |0 |0 |88 |40 |3456
src/_P021_Level.ino |0 |4 |136 |24 |1872
src/_P022_PCA9685.ino |0 |4 |32 |0 |1216
src/_P023_OLED.ino |0 |4 |80 |0 |4448
src/_P024_MLX90614.ino |0 |4 |56 |8 |992
src/_P025_ADS1115.ino |0 |0 |72 |8 |1184
src/_P026_Sysinfo.ino |0 |0 |72 |8 |864
src/_P027_INA219.ino |0 |0 |56 |24 |1840
src/_P028_BME280.ino |128 |0 |48 |80 |3488
src/_P029_Output.ino |0 |4 |8 |8 |256
src/_P030_BMP280.ino |128 |0 |48 |48 |3024
src/_P031_SHT1X.ino |0 |0 |100 |0 |2176
src/_P032_MS5611.ino |0 |4 |88 |56 |2592
src/_P033_Dummy.ino |0 |4 |48 |0 |1168
src/_P034_DHT12.ino |0 |0 |16 |0 |656
src/_P035_IRTX.ino |0 |4 |64 |-8 |3840
src/_P036_FrameOLED.ino |0 |4 |96 |0 |33600
src/_P037_MQTTImport.ino |0 |0 |24 |40 |3536
src/_P038_NeoPixel.ino |128 |0 |56 |8 |1712
src/_P039_Thermocouple.ino |0 |0 |104 |8 |1536
src/_P040_ID12.ino |0 |4 |72 |8 |640
src/_P041_NeoClock.ino |128 |4 |128 |0 |3344
src/_P042_Candle.ino |128 |8 |160 |32 |8048
src/_P043_ClkOutput.ino |0 |0 |80 |0 |1456
src/_P044_P1WifiGateway.ino |0 |0 |80 |64 |4032
src/_P045_MPU6050.ino |0 |4 |216 |72 |4496
src/_P046_VentusW266.ino |325 |4 |184 |88 |3920
src/_P047_i2c-soil-moisture-so|0 |4 |216 |8 |2144
src/_P048_Motorshield_v2.ino |0 |32 |208 |0 |5952
src/_P049_MHZ19.ino |380 |80 |184 |88 |3792
+62
View File
@@ -0,0 +1,62 @@
_____ ____ ____
| ____/ ___|| _ \ ___ __ _ ___ _ _
| _| \___ \| |_) / _ \/ _` / __| | | |
| |___ ___) | __/ __/ (_| \__ \ |_| |
|_____|____/|_| \___|\__,_|___/\__, |
|___/
This is the distribution folder for ESPeasy.
In here you will find a flash tool to program the ESP module.
Also a number of binary images is included.
The filename is quite descriptive:
ESP_Easy_mega-<date>_<buildType>_<chip>_<memorySize>.bin
Build type can be: (differ in included plugins)
- normal => Only Stable plugins and controllers
- test => Stable + Testing
- dev => Stable + Testing + Development
There is also a number of special builds:
- normal_IR => "Normal" + IR receiver/transmitter plugins and library
- hard_xxxxx => Special builds for some off-the-shelf hardware.
- normal_core_241 => "Normal" using core 2.4.1, since 2.4.2 has issues with PWM
Chip can be:
- ESP8266 => Most likely option
- ESP8285 => Used in some Sonoff modules
- ESP32 => Experimental support at this moment
- ESP8266PUYA => For ESP modules with a flash chip labeled "PUYA" (often 1 MB)
The "PUYA" version deserves a bit more attention.
If you cannot save settings, better try to see if the flash chip has "PUYA" written on it.
If so, try the "PUYA" build.
MemorySize can be:
- 1024 => 1 MB flash modules (e.g. almost all Sonoff modules)
- 2048 => 2 MB flash modules (e.g. Shelly1/WROOM02)
- 4096 => 4 MB flash modules (e.g. NodeMCU/ESP32)
ESP32 now has 2 builds:
- esp32dev Using the default partition layout (1.4 MB for the sketch)
- esp32test_1M8_partition Larger sketch partition (1.8MB) smaller SPIFFS (316 kB)
Please note that changing between those versions will destroy the settings!
The SPIFFS partition will be lost and that contains all settings.
To help recover from a bad flash, there are also blank images included.
- blank_1MB.bin
- blank_2MB.bin
- blank_4MB.bin
When the wrong image is flashed, or the module behaves unstable, or is in a reboot loop,
flash these images first and then the right image for the module.
Another great flash tool can be found here: (Windows only)
https://github.com/Grovkillen/ESP_Easy_Flasher
For more information, see: https://github.com/letscontrolit/ESPEasy
Or our forum: https://www.letscontrolit.com/forum/
+3979
View File
File diff suppressed because it is too large Load Diff
+1
View File
File diff suppressed because one or more lines are too long
+1
View File
File diff suppressed because one or more lines are too long
+1
View File
File diff suppressed because one or more lines are too long
BIN
View File
Binary file not shown.
+19
View File
@@ -0,0 +1,19 @@
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SOURCEDIR = source
BUILDDIR = build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
+35
View File
@@ -0,0 +1,35 @@
@ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build
if "%1" == "" goto help
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
:end
popd
+3
View File
@@ -0,0 +1,3 @@
recommonmark
Sphinx
sphinx-bootstrap-theme
+66
View File
@@ -0,0 +1,66 @@
Controller
**********
A controller is a component to enable a plugin to send data elsewhere.
- Up-to 3 controllers can be active in ESPEasy.
- Per plugin up-to 3 active controllers can be selected.
- For some controllers an additional parameter can be given.
For example, Domoticz needs an 'IDX' value to identify the configured entry in
Domoticz for which new data is sent.
Controller Parameters
=====================
Generic fields
--------------
- **Protocol** - The type of controller (e.g. ThingSpeak/OpenHAB MQTT/etc.)
- **Locate Controller** - Selection between hostname/IP
- **Controller Hostname/IP** - The address to reach the selected service
- **Controller Port** - TCP/UDP Port number (0...65536)
- **Enabled** - Whether or not the controller is active.
Send queue parameters
---------------------
Controllers have a queue to keep unsent messages.
This queue is used to handle message bursts and also store messages which are recorded
before WiFi connection is made or during lost connection.
- **Minimum Send Interval** - Minimum time between two messages in msec.
- **Max Queue Depth** - Maximum length of the buffer queue to keep unsent messages.
- **Max Retries** - Maximum number of retries to send a message.
- **Full Queue Action** - How to handle when queue is full, ignore new or delete oldest message.
- **Client Timeout** - Timeout in msec for an network connection used by the controller.
- **Check Reply** - When set to false, a sent message is considered always successful.
Sample ThingSpeak configuration
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Some controllers, like ThingSpeak, need a specific configuration.
ThingSpeak only allows a message every 15 seconds for the free accounts.
- **Minimum Send Interval** - 15000 msec
- **Max Queue Depth** - 1 (only report the last value)
- **Max Retries** - 2
- **Full Queue Action** - Delete Oldest
- **Client Timeout** - 500 msec (server is online, so timeout must be a bit longer)
Controller user credentials
---------------------------
- **Controller User** - User name (optional)
- **Controller Password** - Password (optional)
MQTT related settings
---------------------
- **Controller Subscribe** - Subscribe to the given topic.
- **Controller Publish** - Publish to the given topic.
- **Controller lwl topic** - Topic to which LWT (Last Will Testament) messages should be sent.
- **LWT Connect Message** - Connection established message.
- **LWT Disconnect Message** - Connection lost message (sent to broker during connect and published by broker when connection is lost)
+2
View File
@@ -0,0 +1,2 @@
About Us
********
+2
View File
@@ -0,0 +1,2 @@
ESPEasy Function Blocks
***********************
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

+35
View File
@@ -0,0 +1,35 @@
Documentation
*************
For documentation we use Sphinx and this will be read by ReadTheDocs.
We use the `Sphinx Bootstrap Theme <https://github.com/ryan-roemer/sphinx-bootstrap-theme>`_
This documentation is included in the GitHub repository.
It allows us to create documentation per version of ESPEasy.
See also the `ESPEasy wiki <https://www.letscontrolit.com/wiki/index.php/ESPEasy>`_
for more documentation which has not been moved here.
Needed Python packages::
pip install sphinx recommonmark sphinx_bootstrap_theme
PlatformIO with Atom
====================
With the ESPEasy project open in Atom, open the PIO terminal in Atom.
Install dependencies::
cd docs
pip install ... (see needed Python packages above)
Build on Windows::
cd docs
.\make.bat html
Build on Linux/Mac::
cd docs
./make html
+2
View File
@@ -0,0 +1,2 @@
Plugins
*******
+2
View File
@@ -0,0 +1,2 @@
Command Reference
*****************
+2
View File
@@ -0,0 +1,2 @@
System Variables
****************
+2
View File
@@ -0,0 +1,2 @@
Rules
*****
+25
View File
@@ -0,0 +1,25 @@
WiFi
****
WiFi disconnect reasons
=======================
Beacon timeout (200)
--------------------
For more information on the Beacon frame, see `Wikipedia <https://en.wikipedia.org/wiki/Beacon_frame>`_.
In short, the access point sends periodically a packet containing information about the network.
This interval is typically 100 TU (102.4 msec).
The ESP module is trying to listen to this beacon every time, but for a number of reasons it may
miss a beacon frame.
The timeout is longer than 100 TU, so it must miss a number of these beacon frames
to report a beacon timeout.
Reasons to miss such a beacon frame are:
- too busy processing other blocking tasks (very likely)
- access point not sending a beacon due to high traffic demands of others (depending on brand/model/settings)
- RF disturbances (not likely given how often this occurs)
- clock drift (not really likely)
So the "beacon timeout" is happening every now and then on the ESP nodes and ESPeasy will try to reconnect.
+286
View File
@@ -0,0 +1,286 @@
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
from recommonmark.parser import CommonMarkParser
import sphinx_bootstrap_theme
# -- Project information -----------------------------------------------------
project = u'ESPEasy'
copyright = u'2018, ESPEasy'
author = u'Many'
# The short X.Y version
version = u''
# The full version, including alpha/beta/rc tags
release = u'2.1b1'
# -- General configuration ---------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.imgmath',
'sphinx.ext.imgconverter',
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
source_parsers = {
'.md': CommonMarkParser,
}
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
source_suffix = ['.rst', '.md']
#source_suffix = '.rst'
# The master toctree document.
master_doc = 'index'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = None
# -- Options for HTML output -------------------------------------------------
html_logo = 'ESPEasy/espeasy_logo.png'
html_favicon = 'ESPEasy/favicon.ico'
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
#html_theme = 'sphinx_rtd_theme'
html_theme = 'bootstrap'
html_theme_path = sphinx_bootstrap_theme.get_html_theme_path()
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}
#html_theme_options = {
# 'canonical_url': '',
# 'analytics_id': '',
# 'logo_only': False,
# 'display_version': True,
# 'prev_next_buttons_location': 'bottom',
# 'style_external_links': False,
# # Toc options
# 'collapse_navigation': True,
# 'sticky_navigation': True,
# 'navigation_depth': 4,
# 'includehidden': True,
# 'titles_only': False
#}
html_theme_options = {
# Navigation bar title. (Default: ``project`` value)
'navbar_title': "ESPEasy",
# Tab name for entire site. (Default: "Site")
'navbar_site_name': "Site",
# A list of tuples containing pages or urls to link to.
# Valid tuples should be in the following forms:
# (name, page) # a link to a page
# (name, "/aa/bb", 1) # a link to an arbitrary relative url
# (name, "http://example.com", True) # arbitrary absolute url
# Note the "1" or "True" value above as the third argument to indicate
# an arbitrary url.
'navbar_links': [
("Rules", "rules"),
("Forum", "https://www.letscontrolit.com/forum/viewforum.php?f=1", True),
],
# Render the next and previous page links in navbar. (Default: true)
'navbar_sidebarrel': True,
# Render the current pages TOC in the navbar. (Default: true)
'navbar_pagenav': True,
# Tab name for the current pages TOC. (Default: "Page")
'navbar_pagenav_name': "Page",
# Global TOC depth for "site" navbar tab. (Default: 1)
# Switching to -1 shows all levels.
'globaltoc_depth': 2,
# Include hidden TOCs in Site navbar?
#
# Note: If this is "false", you cannot have mixed ``:hidden:`` and
# non-hidden ``toctree`` directives in the same page, or else the build
# will break.
#
# Values: "true" (default) or "false"
'globaltoc_includehidden': "true",
# HTML navbar class (Default: "navbar") to attach to <div> element.
# For black navbar, do "navbar navbar-inverse"
'navbar_class': "navbar navbar-inverse",
# Fix navigation bar to top of page?
# Values: "true" (default) or "false"
'navbar_fixed_top': "true",
# Location of link to source.
# Options are "nav" (default), "footer" or anything else to exclude.
'source_link_position': "none",
# Bootswatch (http://bootswatch.com/) theme.
#
# Options are nothing (default) or the name of a valid theme
# such as "cosmo" or "sandstone".
#
# The set of valid themes depend on the version of Bootstrap
# that's used (the next config option).
#
# Currently, the supported themes are:
# - Bootstrap 2: https://bootswatch.com/2
# - Bootstrap 3: https://bootswatch.com/3
'bootswatch_theme': "cerulean",
# Choose Bootstrap version.
# Values: "3" (default) or "2" (in quotes)
'bootstrap_version': "3",
}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# The default sidebars (for documents that don't match any pattern) are
# defined by theme itself. Builtin themes are using these templates by
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
# 'searchbox.html']``.
#
# html_sidebars = {}
# -- Options for HTMLHelp output ---------------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = 'ESPEasydoc'
# -- Options for LaTeX output ------------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'ESPEasy.tex', u'ESPEasy Documentation',
u'Many', 'manual'),
]
# -- Options for manual page output ------------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'espeasy', u'ESPEasy Documentation',
[author], 1)
]
# -- Options for Texinfo output ----------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'ESPEasy', u'ESPEasy Documentation',
author, 'ESPEasy', 'ESP82xx/ESP32 firmware to connect people with any level of experience to system automation.',
'Miscellaneous'),
]
# -- Options for Epub output -------------------------------------------------
# Bibliographic Dublin Core info.
epub_title = project
# The unique identifier of the text. This can be a ISBN number
# or the project homepage.
#
# epub_identifier = ''
# A unique identification for the text.
#
# epub_uid = ''
# A list of files that should not be packed into the epub file.
epub_exclude_files = ['search.html']
# -- Extension configuration -------------------------------------------------
# -- Options for intersphinx extension ---------------------------------------
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
# -- Options for todo extension ----------------------------------------------
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True
+39
View File
@@ -0,0 +1,39 @@
.. ESPEasy documentation master file, created by
sphinx-quickstart on Sat Oct 06 22:34:34 2018.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to ESPEasy's documentation!
===================================
.. toctree::
:maxdepth: 2
:caption: Table of Contents
ESPEasy/AboutUs.rst
ESPEasy/FunctionBlocks.rst
Controller/Controller.rst
Plugin/Plugin.rst
Rules/Rules.rst
WiFi/WiFi.rst
.. raw:: latex
\appendix
.. toctree::
:caption: Appendix
Participate/Documentation.rst
Reference/Command.rst
Reference/SystemVariable.rst
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
+7
View File
@@ -0,0 +1,7 @@
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x5000,
otadata, data, ota, 0xe000, 0x2000,
app0, app, ota_0, 0x10000, 0x140000,
app1, app, ota_1, 0x150000,0x140000,
eeprom, data, 0x99, 0x290000,0x1000,
spiffs, data, spiffs, 0x291000,0x16F000,
1 # Name Type SubType Offset Size Flags
2 nvs data nvs 0x9000 0x5000
3 otadata data ota 0xe000 0x2000
4 app0 app ota_0 0x10000 0x140000
5 app1 app ota_1 0x150000 0x140000
6 eeprom data 0x99 0x290000 0x1000
7 spiffs data spiffs 0x291000 0x16F000
+7
View File
@@ -0,0 +1,7 @@
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x5000,
otadata, data, ota, 0xe000, 0x2000,
app0, app, ota_0, 0x10000, 0x1D0000,
app1, app, ota_1, 0x1E0000,0x1D0000,
eeprom, data, 0x99, 0x3B0000,0x1000,
spiffs, data, spiffs, 0x3B1000,0x4F000,
1 # Name Type SubType Offset Size Flags
2 nvs data nvs 0x9000 0x5000
3 otadata data ota 0xe000 0x2000
4 app0 app ota_0 0x10000 0x1D0000
5 app1 app ota_1 0x1E0000 0x1D0000
6 eeprom data 0x99 0x3B0000 0x1000
7 spiffs data spiffs 0x3B1000 0x4F000
+11
View File
@@ -0,0 +1,11 @@
#!/bin/bash
# purpose: GIT post-commit
# change value of BUILD_GIT macro
#
WORKDIR=src
CUSTOM_H=${WORKDIR}/Custom.h
GLOBAL_H=${WORKDIR}/ESPEasy-Globals.h
# update BUILD_GIT on branch checkout
[[ $3 == 1 && -f ${CUSTOM_H} ]] && \
sed -i.bak -e "s/\(#define BUILD_GIT\).*/\1 \"$(git log -1 --pretty=format:%h HEAD)\"/" ${CUSTOM_H}
+10
View File
@@ -0,0 +1,10 @@
#!/bin/bash
# purpose: GIT post-commit
# change value of BUILD_GIT macro
#
WORKDIR=src
CUSTOM_H=${WORKDIR}/Custom.h
GLOBAL_H=${WORKDIR}/ESPEasy-Globals.h
[[ -f ${CUSTOM_H} ]] && \
sed -i.bak -e "s/\(#define BUILD_GIT\).*/\1 \"$(git log -1 --pretty=format:%h HEAD)\"/" ${CUSTOM_H}
+21
View File
@@ -0,0 +1,21 @@
#!/bin/bash
# build an include file to select plugins
#
WORKDIR=ESPEasy
CUSTOM_H=${WORKDIR}/Custom.h
GLOBAL_H=${WORKDIR}/ESPEasy-Globals.h
[[ -L ${WORKDIR} ]] || (
ln -s src ${WORKDIR}
)
# we expect that ${CUSTOM_H} always contains a "#define BUILD_GIT" macro
[[ -f ${CUSTOM_H} ]] && (
echo "post_merge: change BUILD_GIT"
sed -i.bak -e "s/\(#define BUILD_GIT\).*/\1 \"$(git log -1 --pretty=format:%h HEAD)\"/" ${CUSTOM_H}
)
# uncomment if you don't want to use the Custom.h include
grep -q "^#define USE_CUSTOM_H" ${GLOBAL_H} || (
sed -i -e "/[ \t]*#define ESPEASY_GLOBALS_H_/a #define USE_CUSTOM_H" ${GLOBAL_H}
)
+59
View File
@@ -0,0 +1,59 @@
#include "AM2320.h"
#include <Wire.h>
//
// AM2321 Temperature & Humidity Sensor library for Arduino
// Сделана Тимофеевым Е.Н. из AM2320-master
unsigned int CRC16(byte *ptr, byte length)
{
unsigned int crc = 0xFFFF;
uint8_t s = 0x00;
while(length--) {
crc ^= *ptr++;
for(s = 0; s < 8; s++) {
if((crc & 0x01) != 0) {
crc >>= 1;
crc ^= 0xA001;
} else crc >>= 1;
}
}
return crc;
}
AM2320::AM2320()
{
}
int AM2320::Read()
{
byte buf[8];
for(int s = 0; s < 8; s++) buf[s] = 0x00;
Wire.beginTransmission(AM2320_address);
Wire.endTransmission();
// запрос 4 байт (температуры и влажности)
Wire.beginTransmission(AM2320_address);
Wire.write(0x03);// запрос
Wire.write(0x00); // с 0-го адреса
Wire.write(0x04); // 4 байта
if (Wire.endTransmission(true) != 0) return 1;
delayMicroseconds(1600); //>1.5ms
// считываем результаты запроса
Wire.requestFrom(AM2320_address, 0x08);
for (int i = 0; i < 0x08; i++) buf[i] = Wire.read();
// CRC check
unsigned int Rcrc = buf[7] << 8;
Rcrc += buf[6];
if (Rcrc == CRC16(buf, 6)) {
unsigned int temperature = ((buf[4] & 0x7F) << 8) + buf[5];
t = temperature / 10.0;
t = ((buf[4] & 0x80) >> 7) == 1 ? t * (-1) : t;
unsigned int humidity = (buf[2] << 8) + buf[3];
h = humidity / 10.0;
return 0;
}
return 2;
}
+17
View File
@@ -0,0 +1,17 @@
#ifndef AM2320_H
#define AM2320_H
#include <Arduino.h>
#define AM2320_address (0xB8 >> 1)
class AM2320
{
public:
AM2320();
float t;
float h;
int Read(void);
};
#endif
@@ -0,0 +1,29 @@
#include <Wire.h>
#include <AM2320.h>
AM2320 th;
void setup() {
Serial.begin(9600);
Wire.begin();
}
void loop() {
switch(th.Read()) {
case 2:
Serial.println("CRC failed");
break;
case 1:
Serial.println("Sensor offline");
break;
case 0:
Serial.print("humidity: ");
Serial.print(th.h);
Serial.print("%, temperature: ");
Serial.print(th.t);
Serial.println("*C");
break;
}
delay(200);
}
+4
View File
@@ -0,0 +1,4 @@
AM2320 KEYWORD1
getTemperature KEYWORD2
getHumidity KEYWORD2
CRCCheck KEYWORD2
+13
View File
@@ -0,0 +1,13 @@
# Compiled Object files
*.slo
*.lo
*.o
# Compiled Dynamic libraries
*.so
*.dylib
# Compiled Static libraries
*.lai
*.la
*.a
+476
View File
@@ -0,0 +1,476 @@
/*
This is a (Arduino) library for the BH1750FVI Digital Light Sensor.
Description:
http://www.rohm.com/web/global/products/-/product/BH1750FVI
Datasheet:
http://rohmfs.rohm.com/en/products/databook/datasheet/ic/sensor/light/bh1750fvi-e.pdf
Copyright (c) 2013 Alexander Schulz. All right reserved.
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.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "AS_BH1750.h"
// Debug-Flag
#define BH1750_DEBUG 0
/**
* Constructor.
* Erlaubt die I2C-Adresse des Sensors zu ändern.
* Standardadresse: 0x23, Alternativadresse: 0x5C.
* Es sind entsprechende Konstanten definiert: BH1750_DEFAULT_I2CADDR und BH1750_SECOND_I2CADDR.
* Bei Nichtangabe wird die Standardadresse verwendet.
* Um die Alternativadresse zu nutzen, muss der Sensorpin 'ADR' des Chips auf VCC gelegt werden.
*/
AS_BH1750::AS_BH1750(uint8_t address) {
_address = address;
_hardwareMode = 255;
}
/**
* Führt die anfängliche Initialisierung des Sensors.
* Mögliche Parameter:
* - Modus für die Sensorauflösung:
* -- RESOLUTION_LOW: Physische Sensormodus mit 4 lx Auflösung. Messzeit ca. 16ms. Bereich 0-54612.
* -- RESOLUTION_NORMAL: Physische Sensormodus mit 1 lx Auflösung. Messzeit ca. 120ms. Bereich 0-54612.
* -- RESOLUTION_HIGH: Physische Sensormodus mit 0,5 lx Auflösung. Messzeit ca. 120ms. Bereich 0-54612.
* (Die Messbereiche können durch Änderung des MTreg verschoben werden.)
* -- RESOLUTION_AUTO_HIGH: Die Werte im MTreg werden je nach Helligkeit automatisch so angepasst,
* dass eine maximalmögliche Auflösung und Messbereich erziehlt werden.
* Die messbaren Werte fangen von 0,11 lx und gehen bis über 100000 lx.
* (ich weis nicht, wie genau die Werte in Grenzbereichen sind,
* besonders bei hohen Werte habe ich da meine Zweifel.
* Die Werte scheinen jedoch weitgehend linear mit der steigenden Helligkeit zu wachsen.)
* Auflösung im Unteren Bereich ca. 0,13 lx, im mittleren 0,5 lx, im oberen etwa 1-2 lx.
* Die Messzeiten verlängern sich durch mehrfache Messungen und
* die Änderungen von Measurement Time (MTreg) bis max. ca. 500 ms.
*
* - AutoPowerDown: true = Der Sensor wird nach der Messung in den Stromsparmodus versetzt.
* Das spätere Aufwecken wird ggf. automatisch vorgenommen, braucht jedoch geringfügig mehr Zeit.
*
* Defaultwerte: RESOLUTION_AUTO_HIGH, true
*
*/
bool AS_BH1750::begin(sensors_resolution_t mode, bool autoPowerDown) {
#if BH1750_DEBUG == 1
Serial.print(" sensors_resolution_mode (virtual): ");
Serial.println(mode, DEC);
#endif
_virtualMode = mode;
_autoPowerDown = autoPowerDown;
//Wire.begin(); called in ESPEasy framework
defineMTReg(BH1750_MTREG_DEFAULT); // eigentlich normalerweise unnötig, da standard
// Hardware-Modus zum gewünschten VitrualModus ermitteltn
switch (_virtualMode) {
case RESOLUTION_LOW:
_hardwareMode = autoPowerDown?BH1750_ONE_TIME_LOW_RES_MODE:BH1750_CONTINUOUS_LOW_RES_MODE;
break;
case RESOLUTION_NORMAL:
_hardwareMode = autoPowerDown?BH1750_ONE_TIME_HIGH_RES_MODE:BH1750_CONTINUOUS_HIGH_RES_MODE;
break;
case RESOLUTION_HIGH:
_hardwareMode = autoPowerDown?BH1750_ONE_TIME_HIGH_RES_MODE_2:BH1750_CONTINUOUS_HIGH_RES_MODE_2;
break;
case RESOLUTION_AUTO_HIGH:
_hardwareMode = BH1750_CONTINUOUS_LOW_RES_MODE;
break;
default:
// darf eigentlich nicht passieren...
_hardwareMode = 255;
break;
}
#if BH1750_DEBUG == 1
Serial.print("hardware mode: ");
Serial.println(_hardwareMode, DEC);
#endif
if(_hardwareMode==255) {
return false;
}
// Versuchen, den gewählten Hardwaremodus zu aktivieren
if(selectResolutionMode(_hardwareMode)){
#if BH1750_DEBUG == 1
Serial.print("hardware mode defined successfully");
Serial.println(_hardwareMode, DEC);
#endif
return true;
}
// Initialisierung fehlgeschlagen
#if BH1750_DEBUG == 1
Serial.print("failure to aktivate hardware mode ");
Serial.println(_hardwareMode, DEC);
#endif
_hardwareMode = 255;
return false;
}
/**
* Erlaub eine Prüfung, ob ein (ansprechbarer) BH1750-Sensor vorhanden ist.
*/
bool AS_BH1750::isPresent() {
// Check I2C Adresse
Wire.beginTransmission(_address);
if(Wire.endTransmission()!=0) {
return false;
}
// Check device: ist es ein BH1750
if(!isInitialized()) {
// zuvor inaktiv, daher zu Testen schnelltes einmal-Mode aktivieren
//write8(BH1750_POWER_ON);
selectResolutionMode(BH1750_ONE_TIME_LOW_RES_MODE);
_hardwareMode=255;
}
else {
// falls einmal-modus aktiv war, muss der Sensor geweckt werden
powerOn();
}
// Prüfen, ob Werte auch wirklich geliefert werden (letztes Modus, ggf. wird auto-PowerDown ausgeführt)
return (readLightLevel()>=0);
}
/**
* Weckt ein im PowerDown-Modus befindlichen Sensor auf (schadet auch dem 'wachen' Sensor nicht).
* Funktionier nur, wenn der Sensor bereits initialisiert wurde.
*/
void AS_BH1750::powerOn() {
if(!isInitialized()) {
#if BH1750_DEBUG == 1
Serial.println("sensor not initialized");
#endif
return;
}
_valueReaded=false;
//write8(BH1750_POWER_ON); //
//fDelayPtr(10); // Nötig?
// Scheinbar reicht das Setzen von HardwareMode auch ohne PowerON-Befehl aus
selectResolutionMode(_hardwareMode); // letzten Modus wieder aktivieren
}
/**
* Schickt den Sensor in Stromsparmodus.
* Funktionier nur, wenn der Sensor bereits initialisiert wurde.
*/
void AS_BH1750::powerDown() {
if(!isInitialized()) {
#if BH1750_DEBUG == 1
Serial.println("sensor not initialized");
#endif
return;
}
write8(BH1750_POWER_DOWN);
}
/**
* Sendet zum Sensor ein Befehl zum Auswahl von HardwareMode.
*
* Parameter:
* - mode: s.o.
* - DelayFuncPtr: delay(n) Möglichkeit, eigene Delay-Funktion mitzugeben (z.B. um sleep-Modus zu verwenden).
*
* Defaultwerte: delay()
*
*/
bool AS_BH1750::selectResolutionMode(uint8_t mode, DelayFuncPtr fDelayPtr) {
#if BH1750_DEBUG == 1
Serial.print("selectResolutionMode: ");
Serial.println(mode, DEC);
#endif
if(!isInitialized()) {
return false;
#if BH1750_DEBUG == 1
Serial.println("sensor not initialized");
#endif
}
_hardwareMode=mode;
_valueReaded=false;
// Prüfen, ob ein valides Modus vorliegt und im positiven Fall das gewünschte Modus aktivieren
switch (mode) {
case BH1750_CONTINUOUS_HIGH_RES_MODE:
case BH1750_CONTINUOUS_HIGH_RES_MODE_2:
case BH1750_CONTINUOUS_LOW_RES_MODE:
case BH1750_ONE_TIME_HIGH_RES_MODE:
case BH1750_ONE_TIME_HIGH_RES_MODE_2:
case BH1750_ONE_TIME_LOW_RES_MODE:
// Modus aktivieren
if(write8(mode)) {
// Kurze pause nötig, sonst wird das Modus nicht sicher Aktiviert
// (z.B. liefert Sensor im AutoHigh Modus abwechselnd übersteuerte Werte, etwa so: 54612.5, 68123.4, 54612.5, 69345.3,..)
fDelayPtr(5);
return true;
}
break;
default:
// Invalid measurement mode
#if BH1750_DEBUG == 1
Serial.println("Invalid measurement mode");
#endif
break;
}
return false;
}
/**
* Liefert aktuell gemessenen Wert für Helligkeit in lux (lx).
* Falls sich der Sensorf in Stromsparmodus befindet, wird er automatisch geweckt.
*
* Wurde der Sensor (noch) nicht initialisiert (begin), wird der Wert -1 geliefert.
*/
float AS_BH1750::readLightLevel(DelayFuncPtr fDelayPtr) {
#if BH1750_DEBUG == 1
Serial.print("call: readLightLevel. virtualMode: ");
Serial.println(_virtualMode, DEC);
#endif
if(!isInitialized()) {
#if BH1750_DEBUG == 1
Serial.println("sensor not initialized");
#endif
return -1;
}
// ggf. PowerOn
if(_autoPowerDown && _valueReaded){
powerOn();
}
// Das Automatische Modus benötigt eine Sonderbehandlung.
// Zuerst wird die Helligkeit im LowRes-Modus gelesen,
// je nach Bereich (dunkel, normal, sehr hell) werden die Werte von MTreg gesetzt und
// danach wird die eigentliche Messung vorgenommen.
/*
Die feste Grenzwerte verursachen möglicherweise einen 'Sprung' in der Messkurve.
In diesem Fall wäre eine laufende Anpassung von MTreg in Grenzbereichen vermutlich besser.
Für meine Zwecke ist das jedoch ohne Bedeutung.
*/
if(_virtualMode==RESOLUTION_AUTO_HIGH) {
defineMTReg(BH1750_MTREG_DEFAULT);
selectResolutionMode(BH1750_CONTINUOUS_LOW_RES_MODE, fDelayPtr);
fDelayPtr(16); // Lesezeit in LowResMode
uint16_t level = readRawLevel();
#if BH1750_DEBUG == 1
Serial.print("AutoHighMode: check level read: ");
Serial.println(level, DEC);
#endif
if(level<10) {
#if BH1750_DEBUG == 1
Serial.println("level 0: dark");
#endif
// Dunkel, Empfindlichkeit auf Maximum.
// Der Wert ist zufällig. Ab ca. 16000 wäre diese Vorgehnsweise möglich.
// Ich brauche diese Genauigkeit aber nur in den ganz dunklen Bereichen (zu erkennen, wann wirklich 'dunkel' ist).
defineMTReg(BH1750_MTREG_MAX);
selectResolutionMode(_autoPowerDown?BH1750_ONE_TIME_HIGH_RES_MODE_2:BH1750_CONTINUOUS_HIGH_RES_MODE_2, fDelayPtr);
fDelayPtr(120*3.68); // TODO: Wert prüfen
//fDelayPtr(122);
}
else if(level<32767) {
#if BH1750_DEBUG == 1
Serial.println("level 1: normal");
#endif
// Bis hierher reicht die 0,5 lx Modus. Normale Empfindlichkeit.
defineMTReg(BH1750_MTREG_DEFAULT);
selectResolutionMode(_autoPowerDown?BH1750_ONE_TIME_HIGH_RES_MODE_2:BH1750_CONTINUOUS_HIGH_RES_MODE_2, fDelayPtr);
fDelayPtr(120); // TODO: Wert prüfen
}
else if(level<60000) {
#if BH1750_DEBUG == 1
Serial.println("level 2: bright");
#endif
// hoher Bereich, 1 lx Modus, normale Empfindlichkeit. Der Wert von 60000 ist mehr oder weniger zufällig, es mus einfach ein hoher Wert, nah an der Grenze sein.
defineMTReg(BH1750_MTREG_DEFAULT);
selectResolutionMode(_autoPowerDown?BH1750_ONE_TIME_HIGH_RES_MODE:BH1750_CONTINUOUS_HIGH_RES_MODE, fDelayPtr);
fDelayPtr(120); // TODO: Wert prüfen
}
else {
#if BH1750_DEBUG == 1
Serial.println("level 3: very bright");
#endif
// sehr hoher Bereich, Empfindlichkeit verringern
defineMTReg(32); // Min+1, bei dem Minimum aus Doku spielt der Sensor (zumindest meiner) verrückt: Die Werte sind ca. 1/10 von den Erwarteten.
selectResolutionMode(_autoPowerDown?BH1750_ONE_TIME_HIGH_RES_MODE:BH1750_CONTINUOUS_HIGH_RES_MODE, fDelayPtr);
fDelayPtr(120); // TODO: Wert prüfen
}
}
// Hardware Wert lesen und in Lux umrechnen.
uint16_t raw = readRawLevel();
if(raw==65535) {
// Wert verdächtig hoch. Sensor prüfen.
// Check I2C Adresse
Wire.beginTransmission(_address);
if(Wire.endTransmission()!=0) {
return -1;
}
}
return convertRawValue(raw);
}
/**
* Roh-Wert der Helligkeit auslesen.
* Wertebereich 0-65535.
*/
uint16_t AS_BH1750::readRawLevel(void) {
uint16_t level;
Wire.beginTransmission(_address);
Wire.requestFrom(_address, 2);
#if (ARDUINO >= 100)
level = Wire.read();
level <<= 8;
level |= Wire.read();
#else
level = Wire.receive();
level <<= 8;
level |= Wire.receive();
#endif
if(Wire.endTransmission()!=0) {
#if BH1750_DEBUG == 1
Serial.println("I2C read error");
#endif
return 65535; // Error marker
}
#if BH1750_DEBUG == 1
Serial.print("Raw light level: ");
Serial.println(level);
#endif
_valueReaded=true;
return level;
}
/**
* Rechnet Roh-Werte in Lux um.
*/
float AS_BH1750::convertRawValue(uint16_t raw) {
// Basisumrechnung
float flevel = raw/1.2;
#if BH1750_DEBUG == 1
Serial.print("convert light level (1): ");
Serial.println(flevel);
#endif
// MTreg-Einfluss berechnen
if(_MTreg!=BH1750_MTREG_DEFAULT) { // bei 69 ist der Faktor = 1
flevel = flevel * _MTregFactor;
#if BH1750_DEBUG == 1
Serial.print("convert light level (2): ");
Serial.println(flevel);
#endif
}
// je nach Modus ist eine weitere Umrechnung nötig
switch (_hardwareMode) {
case BH1750_CONTINUOUS_HIGH_RES_MODE_2:
case BH1750_ONE_TIME_HIGH_RES_MODE_2:
flevel = flevel/2;
#if BH1750_DEBUG == 1
Serial.print("convert light level (3): ");
Serial.println(flevel);
#endif
break;
default:
// nothing to do
break;
}
#if BH1750_DEBUG == 1
Serial.print("Light level: ");
Serial.println(flevel);
#endif
return flevel;
}
/**
* MTreg setzen. Definiert Empfindlichkeit des Sensors.
* Min.Wert (BH1750_MTREG_MIN) = 31 (Empfindlichkeit: default*0,45)
* Max.Wert (BH1750_MTREG_MAX) = 254 (Empfindlichkeit: default*3,68)
* Default (BH1750_MTREG_DEFAULT) = 69.
* Mit der Empfindlichkeit verändert sich die Lesezeit (höhere Empfindlichkeit bedeutet längere Zeitspanne).
*/
void AS_BH1750::defineMTReg(uint8_t val) {
if(val<BH1750_MTREG_MIN) {
val = BH1750_MTREG_MIN;
}
if(val>BH1750_MTREG_MAX) {
val = BH1750_MTREG_MAX;
}
if(val!=_MTreg) {
_MTreg = val;
_MTregFactor = (float)BH1750_MTREG_DEFAULT / _MTreg;
// Change Measurement time
// Übertragung in zwei Schritten: 3 Bit und 5 Bit, jeweils mit einem Prefix.
// High bit: 01000_MT[7,6,5]
// Low bit: 011_MT[4,3,2,1,0]
uint8_t hiByte = val>>5;
hiByte |= 0b01000000;
#if BH1750_DEBUG == 1
Serial.print("MGTreg high byte: ");
Serial.println(hiByte, BIN);
#endif
write8(hiByte);
//fDelayPtr(10);
// Pause nötig?
uint8_t loByte = val&0b00011111;
loByte |= 0b01100000;
#if BH1750_DEBUG == 1
Serial.print("MGTreg low byte: ");
Serial.println(loByte, BIN);
#endif
write8(hiByte);
//fDelayPtr(10);
}
}
/**
* Gibt an, ob der Sensor initialisiert ist.
*/
bool AS_BH1750::isInitialized() {
return _hardwareMode!=255;
}
/**
* Schreibt ein Byte auf I2C Bus (auf die Adresse des Sensors).
*/
bool AS_BH1750::write8(uint8_t d) {
Wire.beginTransmission(_address);
#if (ARDUINO >= 100)
Wire.write(d);
#else
Wire.send(d);
#endif
return (Wire.endTransmission()==0);
}
+183
View File
@@ -0,0 +1,183 @@
/*
This is a (Arduino) library for the BH1750FVI Digital Light Sensor.
Description:
http://www.rohm.com/web/global/products/-/product/BH1750FVI
Datasheet:
http://rohmfs.rohm.com/en/products/databook/datasheet/ic/sensor/light/bh1750fvi-e.pdf
Copyright (c) 2013 Alexander Schulz. All right reserved.
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.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AS_BH1750_h
#define AS_BH1750_h
#if (ARDUINO >= 100)
#include <Arduino.h>
#else
#include <WProgram.h>
#endif
#include "Wire.h"
// Mögliche I2C Adressen
#define BH1750_DEFAULT_I2CADDR 0x23
#define BH1750_SECOND_I2CADDR 0x5C
// MTreg Werte
// Default
#define BH1750_MTREG_DEFAULT 69
// Sensitivity : default = 0.45
#define BH1750_MTREG_MIN 31
// Sensitivity : default = 3.68
#define BH1750_MTREG_MAX 254
// Hardware Modi
// No active state
#define BH1750_POWER_DOWN 0x00
// Wating for measurment command
#define BH1750_POWER_ON 0x01
// Reset data register value - not accepted in POWER_DOWN mode
#define BH1750_RESET 0x07
// Start measurement at 1lx resolution. Measurement time is approx 120ms.
#define BH1750_CONTINUOUS_HIGH_RES_MODE 0x10
// Start measurement at 0.5lx resolution. Measurement time is approx 120ms.
#define BH1750_CONTINUOUS_HIGH_RES_MODE_2 0x11
// Start measurement at 4lx resolution. Measurement time is approx 16ms.
#define BH1750_CONTINUOUS_LOW_RES_MODE 0x13
// Start measurement at 1lx resolution. Measurement time is approx 120ms.
// Device is automatically set to Power Down after measurement.
#define BH1750_ONE_TIME_HIGH_RES_MODE 0x20
// Start measurement at 0.5lx resolution. Measurement time is approx 120ms.
// Device is automatically set to Power Down after measurement.
#define BH1750_ONE_TIME_HIGH_RES_MODE_2 0x21
// Start measurement at 1lx resolution. Measurement time is approx 120ms.
// Device is automatically set to Power Down after measurement.
#define BH1750_ONE_TIME_LOW_RES_MODE 0x23
/** Virtual Modi */
typedef enum
{
RESOLUTION_LOW = (1), /** 4lx resolution. Measurement time is approx 16ms. */
RESOLUTION_NORMAL = (2), /** 1lx resolution. Measurement time is approx 120ms. */
RESOLUTION_HIGH = (3), /** 0,5lx resolution. Measurement time is approx 120ms. */
RESOLUTION_AUTO_HIGH = (99) /** 0,11-1lx resolution. Measurement time is above 250ms. */
}
sensors_resolution_t;
typedef void (*DelayFuncPtr)(unsigned long);
typedef unsigned long (*TimeFuncPtr)(void);
/**
* BH1750 driver class.
*/
class AS_BH1750 {
public:
/**
* Constructor.
* Erlaubt die I2C-Adresse des Sensors zu ändern.
* Standardadresse: 0x23, Alternativadresse: 0x5C.
* Es sind entsprechende Konstanten definiert: BH1750_DEFAULT_I2CADDR und BH1750_SECOND_I2CADDR.
* Bei Nichtangabe wird die Standardadresse verwendet.
* Um die Alternativadresse zu nutzen, muss der Sensorpin 'ADR' des Chips auf VCC gelegt werden.
*/
AS_BH1750(uint8_t address = BH1750_DEFAULT_I2CADDR);
/**
* Führt die anfängliche Initialisierung des Sensors.
* Mögliche Parameter:
* - Modus für die Sensorauflösung:
* -- RESOLUTION_LOW: Physische Sensormodus mit 4 lx Auflösung. Messzeit ca. 16ms. Bereich 0-54612.
* -- RESOLUTION_NORMAL: Physische Sensormodus mit 1 lx Auflösung. Messzeit ca. 120ms. Bereich 0-54612.
* -- RESOLUTION_HIGH: Physische Sensormodus mit 0,5 lx Auflösung. Messzeit ca. 120ms. Bereich 0-54612.
* (Die Messbereiche können durch Änderung des MTreg verschoben werden.)
* -- RESOLUTION_AUTO_HIGH: Die Werte im MTreg werden je nach Helligkeit automatisch so angepasst,
* dass eine maximalmögliche Auflösung und Messbereich erziehlt werden.
* Die messbaren Werte fangen von 0,11 lx und gehen bis über 100000 lx.
* (ich weis nicht, wie genau die Werte in Grenzbereichen sind,
* besonders bei hohen Werte habe ich meine Zweifel.)
* Auflösung im Unteren Bereich 0,13 lx, im mittleren 0,5 lx, im oberen 1-2 lx.
* Die Messzeiten verlängern sich durch mehrfache Messungen und
* die Änderungen von Measurement Time (MTreg) bis max. ca. 500 ms.
*
* - AutoPowerDown: true = Der Sensor wird nach der Messung in den Stromsparmodus versetzt.
* Das spätere Aufwecken wird ggf. automatisch vorgenommen, braucht jedoch geringfügig mehr Zeit.
*
* Defaultwerte: RESOLUTION_AUTO_HIGH, true, delay()
*
*/
bool begin(sensors_resolution_t mode = RESOLUTION_AUTO_HIGH, bool autoPowerDown = true);
/**
* Erlaub eine Prüfung, ob ein (ansprechbarer) BH1750-Sensor vorhanden ist.
*/
bool isPresent(void);
/**
* Liefert aktuell gemessenen Wert für Helligkeit in lux (lx).
* Falls sich der Sensorf in Stromsparmodus befindet, wird er automatisch geweckt.
*
* Wurde der Sensor (noch) nicht initialisiert (begin), wird der Wert -1 geliefert.
*
* Mögliche Parameter:
*
* - DelayFuncPtr: delay(n) Möglichkeit, eigene Delay-Funktion mitzugeben (z.B. um sleep-Modus zu verwenden).
*
* Defaultwerte: delay()
*
*/
float readLightLevel(DelayFuncPtr fDelayPtr = &delay);
/**
* Schickt den Sensor in Stromsparmodus.
* Funktionier nur, wenn der Sensor bereits initialisiert wurde.
*/
void powerDown(void);
private:
int _address;
uint8_t _hardwareMode;
uint8_t _MTreg;
float _MTregFactor;
sensors_resolution_t _virtualMode;
bool _autoPowerDown;
bool _valueReaded;
bool selectResolutionMode(uint8_t mode, DelayFuncPtr fDelayPtr = &delay);
void defineMTReg(uint8_t val);
void powerOn(void);
void reset(void);
uint16_t readRawLevel(void);
float convertRawValue(uint16_t raw);
bool isInitialized();
bool write8(uint8_t data);
};
#endif
+705
View File
@@ -0,0 +1,705 @@
/*
This is a (Arduino) library for the BH1750FVI Digital Light Sensor.
Description:
http://www.rohm.com/web/global/products/-/product/BH1750FVI
Datasheet:
http://rohmfs.rohm.com/en/products/databook/datasheet/ic/sensor/light/bh1750fvi-e.pdf
Copyright (c) 2013 Alexander Schulz. All right reserved.
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.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "AS_BH1750A.h"
// Debug-Flag
#define BH1750_DEBUG 0
/**
* Constructor.
* Erlaubt die I2C-Adresse des Sensors zu ändern.
* Standardadresse: 0x23, Alternativadresse: 0x5C.
* Es sind entsprechende Konstanten definiert: BH1750_DEFAULT_I2CADDR und BH1750_SECOND_I2CADDR.
* Bei Nichtangabe wird die Standardadresse verwendet.
* Um die Alternativadresse zu nutzen, muss der Sensorpin 'ADR' des Chips auf VCC gelegt werden.
*/
AS_BH1750A::AS_BH1750A(uint8_t address) {
_address = address;
_hardwareMode = 255;
}
/**
* Führt die anfängliche Initialisierung des Sensors.
* Mögliche Parameter:
* - Modus für die Sensorauflösung:
* -- RESOLUTION_LOW: Physische Sensormodus mit 4 lx Auflösung. Messzeit ca. 16ms. Bereich 0-54612.
* -- RESOLUTION_NORMAL: Physische Sensormodus mit 1 lx Auflösung. Messzeit ca. 120ms. Bereich 0-54612.
* -- RESOLUTION_HIGH: Physische Sensormodus mit 0,5 lx Auflösung. Messzeit ca. 120ms. Bereich 0-54612.
* (Die Messbereiche können durch Änderung des MTreg verschoben werden.)
* -- RESOLUTION_AUTO_HIGH: Die Werte im MTreg werden je nach Helligkeit automatisch so angepasst,
* dass eine maximalmögliche Auflösung und Messbereich erziehlt werden.
* Die messbaren Werte fangen von 0,11 lx und gehen bis über 100000 lx.
* (ich weis nicht, wie genau die Werte in Grenzbereichen sind,
* besonders bei hohen Werte habe ich da meine Zweifel.
* Die Werte scheinen jedoch weitgehend linear mit der steigenden Helligkeit zu wachsen.)
* Auflösung im Unteren Bereich ca. 0,13 lx, im mittleren 0,5 lx, im oberen etwa 1-2 lx.
* Die Messzeiten verlängern sich durch mehrfache Messungen und
* die Änderungen von Measurement Time (MTreg) bis max. ca. 500 ms.
*
* - AutoPowerDown: true = Der Sensor wird nach der Messung in den Stromsparmodus versetzt.
* Das spätere Aufwecken wird ggf. automatisch vorgenommen, braucht jedoch geringfügig mehr Zeit.
*
* Defaultwerte: RESOLUTION_AUTO_HIGH, true
*
*/
bool AS_BH1750A::begin(sensors_resolution_t mode, bool autoPowerDown) {
#if BH1750_DEBUG == 1
Serial.print(" sensors_resolution_mode (virtual): ");
Serial.println(mode, DEC);
#endif
_virtualMode = mode;
_autoPowerDown = autoPowerDown;
Wire.begin();
defineMTReg(BH1750_MTREG_DEFAULT); // eigentlich normalerweise unnötig, da standard
// Hardware-Modus zum gewünschten VitrualModus ermitteltn
switch (_virtualMode) {
case RESOLUTION_LOW:
_hardwareMode = autoPowerDown?BH1750_ONE_TIME_LOW_RES_MODE:BH1750_CONTINUOUS_LOW_RES_MODE;
break;
case RESOLUTION_NORMAL:
_hardwareMode = autoPowerDown?BH1750_ONE_TIME_HIGH_RES_MODE:BH1750_CONTINUOUS_HIGH_RES_MODE;
break;
case RESOLUTION_HIGH:
_hardwareMode = autoPowerDown?BH1750_ONE_TIME_HIGH_RES_MODE_2:BH1750_CONTINUOUS_HIGH_RES_MODE_2;
break;
case RESOLUTION_AUTO_HIGH:
_hardwareMode = BH1750_CONTINUOUS_LOW_RES_MODE;
break;
default:
// darf eigentlich nicht passieren...
_hardwareMode = 255;
break;
}
#if BH1750_DEBUG == 1
Serial.print("hardware mode: ");
Serial.println(_hardwareMode, DEC);
#endif
if(_hardwareMode==255) {
return false;
}
// Versuchen, den gewählten Hardwaremodus zu aktivieren
if(selectResolutionMode(_hardwareMode)){
#if BH1750_DEBUG == 1
Serial.print("hardware mode defined successfully");
Serial.println(_hardwareMode, DEC);
#endif
return true;
}
// Initialisierung fehlgeschlagen
#if BH1750_DEBUG == 1
Serial.print("failure to aktivate hardware mode ");
Serial.println(_hardwareMode, DEC);
#endif
_hardwareMode = 255;
return false;
}
/**
* Erlaub eine Prüfung, ob ein (ansprechbarer) BH1750-Sensor vorhanden ist.
*/
bool AS_BH1750A::isPresent() {
// Check I2C Adresse
Wire.beginTransmission(_address);
if(Wire.endTransmission()!=0) {
return false;
}
// Check device: ist es ein BH1750
if(!isInitialized()) {
// zuvor inaktiv, daher zu Testen schnelltes einmal-Mode aktivieren
//write8(BH1750_POWER_ON);
selectResolutionMode(BH1750_ONE_TIME_LOW_RES_MODE);
delay(5);// Hier muss man in jedem Fall warten, daher die kurze Pause erstmal ok
_hardwareMode=255;
}
else {
// falls einmal-modus aktiv war, muss der Sensor geweckt werden
powerOn();
unsigned long dd = getModeDelay(); if(dd>0) {delay(dd);}
//delay(getModeDelay()); // s.o.
}
// Prüfen, ob Werte auch wirklich geliefert werden (letztes Modus, ggf. wird auto-PowerDown ausgeführt)
return (readLightLevel()>=0);
}
/**
* Weckt ein im PowerDown-Modus befindlichen Sensor auf (schadet auch dem 'wachen' Sensor nicht).
* Funktionier nur, wenn der Sensor bereits initialisiert wurde.
*/
void AS_BH1750A::powerOn() {
if(!isInitialized()) {
#if BH1750_DEBUG == 1
Serial.println("sensor not initialized");
#endif
return;
}
_valueReaded=false;
//write8(BH1750_POWER_ON); //
//fDelayPtr(10); // Nötig?
// Scheinbar reicht das Setzen von HardwareMode auch ohne PowerON-Befehl aus
selectResolutionMode(_hardwareMode); // letzten Modus wieder aktivieren
}
/**
* Schickt den Sensor in Stromsparmodus.
* Funktionier nur, wenn der Sensor bereits initialisiert wurde.
*/
void AS_BH1750A::powerDown() {
if(!isInitialized()) {
#if BH1750_DEBUG == 1
Serial.println("sensor not initialized");
#endif
return;
}
write8(BH1750_POWER_DOWN);
}
/**
* Sendet zum Sensor ein Befehl zum Auswahl von HardwareMode.
*
* Parameter:
* - mode: s.o.
* - DelayFuncPtr: delay(n) Möglichkeit, eigene Delay-Funktion mitzugeben (z.B. um sleep-Modus zu verwenden).
*
* Defaultwerte: delay()
*
*/
bool AS_BH1750A::selectResolutionMode(uint8_t mode) {
#if BH1750_DEBUG == 1
Serial.print("selectResolutionMode: ");
Serial.println(mode, DEC);
#endif
if(!isInitialized()) {
return false;
#if BH1750_DEBUG == 1
Serial.println("sensor not initialized");
#endif
}
_hardwareMode=mode;
_valueReaded=false;
// Prüfen, ob ein valides Modus vorliegt und im positiven Fall das gewünschte Modus aktivieren
switch (mode) {
case BH1750_CONTINUOUS_HIGH_RES_MODE:
case BH1750_CONTINUOUS_HIGH_RES_MODE_2:
case BH1750_CONTINUOUS_LOW_RES_MODE:
case BH1750_ONE_TIME_HIGH_RES_MODE:
case BH1750_ONE_TIME_HIGH_RES_MODE_2:
case BH1750_ONE_TIME_LOW_RES_MODE:
// Modus aktivieren
if(write8(mode)) {
// Kurze pause nötig, sonst wird das Modus nicht sicher Aktiviert
// (z.B. liefert Sensor im AutoHigh Modus abwechselnd übersteuerte Werte, etwa so: 54612.5, 68123.4, 54612.5, 69345.3,..)
//fDelayPtr(5); => Aufrufer soll 5ms extra warten
return true;
}
break;
default:
// Invalid measurement mode
#if BH1750_DEBUG == 1
Serial.println("Invalid measurement mode");
#endif
break;
}
return false;
}
/**
* Liefert aktuell gemessenen Wert für Helligkeit in lux (lx).
* Falls sich der Sensorf in Stromsparmodus befindet, wird er automatisch geweckt.
*
* Wurde der Sensor (noch) nicht initialisiert (begin), wird der Wert -1 geliefert.
*/
/*float AS_BH1750A::readLightLevel_alt(DelayFuncPtr fDelayPtr) {
#if BH1750_DEBUG == 1
Serial.print("call: readLightLevel. virtualMode: ");
Serial.println(_virtualMode, DEC);
#endif
if(!isInitialized()) {
#if BH1750_DEBUG == 1
Serial.println("sensor not initialized");
#endif
return -1;
}
// ggf. PowerOn
if(_autoPowerDown && _valueReaded){
powerOn();
unsigned long dd = getModeDelay(); if(dd>0) {delay(dd);}
}
// Das Automatische Modus benötigt eine Sonderbehandlung.
// Zuerst wird die Helligkeit im LowRes-Modus gelesen,
// je nach Bereich (dunkel, normal, sehr hell) werden die Werte von MTreg gesetzt und
// danach wird die eigentliche Messung vorgenommen.
// Die feste Grenzwerte verursachen möglicherweise einen 'Sprung' in der Messkurve.
// In diesem Fall wäre eine laufende Anpassung von MTreg in Grenzbereichen vermutlich besser.
// Für meine Zwecke ist das jedoch ohne Bedeutung.
if(_virtualMode==RESOLUTION_AUTO_HIGH) {
defineMTReg(BH1750_MTREG_DEFAULT);
selectResolutionMode(BH1750_CONTINUOUS_LOW_RES_MODE);
//fDelayPtr(16+5); // Lesezeit in LowResMode
fDelayPtr(getModeDelay());
uint16_t level = readRawLevel();
#if BH1750_DEBUG == 1
Serial.print("AutoHighMode: check level read: ");
Serial.println(level, DEC);
#endif
if(level<10) {
#if BH1750_DEBUG == 1
Serial.println("level 0: dark");
#endif
// Dunkel, Empfindlichkeit auf Maximum.
// Der Wert ist zufällig. Ab ca. 16000 wäre diese Vorgehnsweise möglich.
// Ich brauche diese Genauigkeit aber nur in den ganz dunklen Bereichen (zu erkennen, wann wirklich 'dunkel' ist).
defineMTReg(BH1750_MTREG_MAX);
selectResolutionMode(_autoPowerDown?BH1750_ONE_TIME_HIGH_RES_MODE_2:BH1750_CONTINUOUS_HIGH_RES_MODE_2);
//fDelayPtr(120*3.68+5); // TODO: Wert prüfen
fDelayPtr(getModeDelay());
//fDelayPtr(122);
}
else if(level<32767) {
#if BH1750_DEBUG == 1
Serial.println("level 1: normal");
#endif
// Bis hierher reicht die 0,5 lx Modus. Normale Empfindlichkeit.
defineMTReg(BH1750_MTREG_DEFAULT);
selectResolutionMode(_autoPowerDown?BH1750_ONE_TIME_HIGH_RES_MODE_2:BH1750_CONTINUOUS_HIGH_RES_MODE_2);
//fDelayPtr(120+5); // TODO: Wert prüfen
fDelayPtr(getModeDelay());
}
else if(level<60000) {
#if BH1750_DEBUG == 1
Serial.println("level 2: bright");
#endif
// hoher Bereich, 1 lx Modus, normale Empfindlichkeit. Der Wert von 60000 ist mehr oder weniger zufällig, es mus einfach ein hoher Wert, nah an der Grenze sein.
defineMTReg(BH1750_MTREG_DEFAULT);
selectResolutionMode(_autoPowerDown?BH1750_ONE_TIME_HIGH_RES_MODE:BH1750_CONTINUOUS_HIGH_RES_MODE);
//fDelayPtr(120+5); // TODO: Wert prüfen
fDelayPtr(getModeDelay());
}
else {
#if BH1750_DEBUG == 1
Serial.println("level 3: very bright");
#endif
// sehr hoher Bereich, Empfindlichkeit verringern
defineMTReg(32); // Min+1, bei dem Minimum aus Doku spielt der Sensor (zumindest meiner) verrückt: Die Werte sind ca. 1/10 von den Erwarteten.
selectResolutionMode(_autoPowerDown?BH1750_ONE_TIME_HIGH_RES_MODE:BH1750_CONTINUOUS_HIGH_RES_MODE);
//fDelayPtr(120+5); // TODO: Wert prüfen
fDelayPtr(getModeDelay());
}
}
// Hardware Wert lesen und in Lux umrechnen.
uint16_t raw = readRawLevel();
if(raw==65535) {
// Wert verdächtig hoch. Sensor prüfen.
// Check I2C Adresse
Wire.beginTransmission(_address);
if(Wire.endTransmission()!=0) {
return -1;
}
}
return convertRawValue(raw);
}*/
/**
* Roh-Wert der Helligkeit auslesen.
* Wertebereich 0-65535.
*/
uint16_t AS_BH1750A::readRawLevel(void) {
uint16_t level;
Wire.beginTransmission(_address);
Wire.requestFrom(_address, 2);
#if (ARDUINO >= 100)
level = Wire.read();
level <<= 8;
level |= Wire.read();
#else
level = Wire.receive();
level <<= 8;
level |= Wire.receive();
#endif
if(Wire.endTransmission()!=0) {
#if BH1750_DEBUG == 1
Serial.println("I2C read error");
#endif
return 65535; // Error marker
}
#if BH1750_DEBUG == 1
Serial.print("Raw light level: ");
Serial.println(level);
#endif
_valueReaded=true;
return level;
}
/**
* Rechnet Roh-Werte in Lux um.
*/
float AS_BH1750A::convertRawValue(uint16_t raw) {
// Basisumrechnung
float flevel = raw/1.2;
#if BH1750_DEBUG == 1
Serial.print("convert light level (1): ");
Serial.println(flevel);
#endif
// MTreg-Einfluss berechnen
if(_MTreg!=BH1750_MTREG_DEFAULT) { // bei 69 ist der Faktor = 1
flevel = flevel * _MTregFactor;
#if BH1750_DEBUG == 1
Serial.print("convert light level (2): ");
Serial.println(flevel);
#endif
}
// je nach Modus ist eine weitere Umrechnung nötig
switch (_hardwareMode) {
case BH1750_CONTINUOUS_HIGH_RES_MODE_2:
case BH1750_ONE_TIME_HIGH_RES_MODE_2:
flevel = flevel/2;
#if BH1750_DEBUG == 1
Serial.print("convert light level (3): ");
Serial.println(flevel);
#endif
break;
default:
// nothing to do
break;
}
#if BH1750_DEBUG == 1
Serial.print("Light level: ");
Serial.println(flevel);
#endif
return flevel;
}
/**
* MTreg setzen. Definiert Empfindlichkeit des Sensors.
* Min.Wert (BH1750_MTREG_MIN) = 31 (Empfindlichkeit: default*0,45)
* Max.Wert (BH1750_MTREG_MAX) = 254 (Empfindlichkeit: default*3,68)
* Default (BH1750_MTREG_DEFAULT) = 69.
* Mit der Empfindlichkeit verändert sich die Lesezeit (höhere Empfindlichkeit bedeutet längere Zeitspanne).
*/
void AS_BH1750A::defineMTReg(uint8_t val) {
if(val<BH1750_MTREG_MIN) {
val = BH1750_MTREG_MIN;
}
if(val>BH1750_MTREG_MAX) {
val = BH1750_MTREG_MAX;
}
if(val!=_MTreg) {
_MTreg = val;
_MTregFactor = (float)BH1750_MTREG_DEFAULT / _MTreg;
// Change Measurement time
// Übertragung in zwei Schritten: 3 Bit und 5 Bit, jeweils mit einem Prefix.
// High bit: 01000_MT[7,6,5]
// Low bit: 011_MT[4,3,2,1,0]
uint8_t hiByte = val>>5;
hiByte |= 0b01000000;
#if BH1750_DEBUG == 1
Serial.print("MGTreg high byte: ");
Serial.println(hiByte, BIN);
#endif
write8(hiByte);
//fDelayPtr(10);
// Pause nötig?
uint8_t loByte = val&0b00011111;
loByte |= 0b01100000;
#if BH1750_DEBUG == 1
Serial.print("MGTreg low byte: ");
Serial.println(loByte, BIN);
#endif
write8(hiByte);
//fDelayPtr(10);
}
}
/**
* Gibt an, ob der Sensor initialisiert ist.
*/
bool AS_BH1750A::isInitialized() {
return _hardwareMode!=255;
}
/**
* Schreibt ein Byte auf I2C Bus (auf die Adresse des Sensors).
*/
bool AS_BH1750A::write8(uint8_t d) {
Wire.beginTransmission(_address);
#if (ARDUINO >= 100)
Wire.write(d);
#else
Wire.send(d);
#endif
return (Wire.endTransmission()==0);
}
float AS_BH1750A::readLightLevel(DelayFuncPtr fDelayPtr, TimeFuncPtr fTimePtr) {
startMeasurementAsync(fTimePtr);
while(!isMeasurementReady()) {
fDelayPtr(_nextDelay);
}
return readLightLevelAsync();
}
/*float AS_BH1750A::checkAndReadLightLevelAsync(TimeFuncPtr fTimePtr) {
//Serial.print("--stage: ");
//Serial.println(_stage);
if(_stage==0 || _stage>=100) {
if(startMeasurementAsync(fTimePtr)) return -100;
return -1; // Marker "nicht vorhanden"
} else if(_stage==99) {
_stage=100;
return readLightLevelAsync();
}
return readLightLevelAsync();
}*/
unsigned long AS_BH1750A::nextDelay(void) {
return _nextDelay;
}
//void AS_BH1750A::reset(void) {
//_stage==0;
//}
bool AS_BH1750A::startMeasurementAsync(TimeFuncPtr fTimePtr) {
_fTimePtr = fTimePtr;
_stage = 0;
_nextDelay = 0;
int _lastResult = -1;
_lastTimestamp=fTimePtr();
return readLightLevelAsync()!=-1;
}
bool AS_BH1750A::isMeasurementReady(void) {
return readLightLevelAsync() >= -1; // -1 ist 'not initialized'-Marker (prevent hangs)
}
bool AS_BH1750A::delayExpired() {
unsigned long timestamp = _fTimePtr();
// Zeitdifferenz
unsigned long delayTime = 0;
// Auf Ueberlauf pruefen
if (timestamp < _lastTimestamp)
{
// Ueberlauf: Delay ist Zeit zum MaxWert plus Zeit ab Null
delayTime = MAX_U_LONG - _lastTimestamp + timestamp;
} else {
// Kein Ueberlauf: einfache Differenz
delayTime = timestamp - _lastTimestamp;
}
return (delayTime >= _nextDelay);
}
float AS_BH1750A::readLightLevelAsync() {
if(_stage>=99) return _lastResult;
if(_stage==0) {
#if BH1750_DEBUG == 1
Serial.print("call: readLightLevel. virtualMode: ");
Serial.println(_virtualMode, DEC);
#endif
if(!isInitialized()) {
#if BH1750_DEBUG == 1
Serial.println("sensor not initialized");
#endif
return -1;
}
// ggf. PowerOn
if(_autoPowerDown && _valueReaded){
powerOn();
_nextDelay = getModeDelay();
// TEST delay(getModeDelay());_stage=99;
return -100;
} else {
_nextDelay = 0;
}
_stage++;
}
// Das Automatische Modus benötigt eine Sonderbehandlung.
// Zuerst wird die Helligkeit im LowRes-Modus gelesen,
// je nach Bereich (dunkel, normal, sehr hell) werden die Werte von MTreg gesetzt und
// danach wird die eigentliche Messung vorgenommen.
/*
Die feste Grenzwerte verursachen möglicherweise einen 'Sprung' in der Messkurve.
In diesem Fall wäre eine laufende Anpassung von MTreg in Grenzbereichen vermutlich besser.
Für meine Zwecke ist das jedoch ohne Bedeutung.
*/
if(_virtualMode==RESOLUTION_AUTO_HIGH) {
selectAutoMode();
} else {
if(delayExpired()) {_stage=99;} // Fertig
}
if(_stage<99) return -100; // Marker: wait for next step
// Hardware Wert lesen und in Lux umrechnen.
uint16_t raw = readRawLevel();
if(raw==65535) {
// Wert verdächtig hoch. Sensor prüfen.
// Check I2C Adresse
Wire.beginTransmission(_address);
if(Wire.endTransmission()!=0) {
return -1;
}
}
_lastResult = convertRawValue(raw);
return _lastResult;
}
void AS_BH1750A::selectAutoMode() {
//if(!delayExpired()) return;
if(_stage==1) {
defineMTReg(BH1750_MTREG_DEFAULT);
selectResolutionMode(BH1750_CONTINUOUS_LOW_RES_MODE);
//fDelayPtr(16+5); // Lesezeit in LowResMode
//fDelayPtr(getModeDelay());
_nextDelay=getModeDelay();
_stage++;
return;
}
if(!delayExpired()) return;
if(_stage==2) {
uint16_t level = readRawLevel();
#if BH1750_DEBUG == 1
Serial.print("AutoHighMode: check level read: ");
Serial.println(level, DEC);
#endif
if(level<10) {
#if BH1750_DEBUG == 1
Serial.println("level 0: dark");
#endif
// Dunkel, Empfindlichkeit auf Maximum.
// Der Wert ist zufällig. Ab ca. 16000 wäre diese Vorgehnsweise möglich.
// Ich brauche diese Genauigkeit aber nur in den ganz dunklen Bereichen (zu erkennen, wann wirklich 'dunkel' ist).
defineMTReg(BH1750_MTREG_MAX);
selectResolutionMode(_autoPowerDown?BH1750_ONE_TIME_HIGH_RES_MODE_2:BH1750_CONTINUOUS_HIGH_RES_MODE_2);
//fDelayPtr(120*3.68+5); // TODO: Wert prüfen
//fDelayPtr(getModeDelay());
_nextDelay=getModeDelay();
//fDelayPtr(122);
} else if(level<32767) {
#if BH1750_DEBUG == 1
Serial.println("level 1: normal");
#endif
// Bis hierher reicht die 0,5 lx Modus. Normale Empfindlichkeit.
defineMTReg(BH1750_MTREG_DEFAULT);
selectResolutionMode(_autoPowerDown?BH1750_ONE_TIME_HIGH_RES_MODE_2:BH1750_CONTINUOUS_HIGH_RES_MODE_2);
//fDelayPtr(120+5); // TODO: Wert prüfen
//fDelayPtr(getModeDelay());
_nextDelay=getModeDelay();
} else if(level<60000) {
#if BH1750_DEBUG == 1
Serial.println("level 2: bright");
#endif
// hoher Bereich, 1 lx Modus, normale Empfindlichkeit. Der Wert von 60000 ist mehr oder weniger zufällig, es mus einfach ein hoher Wert, nah an der Grenze sein.
defineMTReg(BH1750_MTREG_DEFAULT);
selectResolutionMode(_autoPowerDown?BH1750_ONE_TIME_HIGH_RES_MODE:BH1750_CONTINUOUS_HIGH_RES_MODE);
//fDelayPtr(120+5); // TODO: Wert prüfen
//fDelayPtr(getModeDelay());
_nextDelay=getModeDelay();
} else {
#if BH1750_DEBUG == 1
Serial.println("level 3: very bright");
#endif
// sehr hoher Bereich, Empfindlichkeit verringern
defineMTReg(32); // Min+1, bei dem Minimum aus Doku spielt der Sensor (zumindest meiner) verrückt: Die Werte sind ca. 1/10 von den Erwarteten.
selectResolutionMode(_autoPowerDown?BH1750_ONE_TIME_HIGH_RES_MODE:BH1750_CONTINUOUS_HIGH_RES_MODE);
//fDelayPtr(120+5); // TODO: Wert prüfen
//fDelayPtr(getModeDelay());
_nextDelay=getModeDelay();
}
_stage++;
return;
}
_stage = 99; // fertig
}
unsigned long AS_BH1750A::getModeDelay() {
float ml;
if(_MTreg<=BH1750_MTREG_MIN+1) { ml = 0.45; }
else if(_MTreg<=BH1750_MTREG_DEFAULT+1) { ml = 1.0; }
else { ml = 3.68; }
switch (_hardwareMode) {
case BH1750_CONTINUOUS_HIGH_RES_MODE:
case BH1750_ONE_TIME_HIGH_RES_MODE:
return ml*120+5;
case BH1750_ONE_TIME_HIGH_RES_MODE_2:
case BH1750_CONTINUOUS_HIGH_RES_MODE_2:
return ml*120+5;
case BH1750_CONTINUOUS_LOW_RES_MODE:
case BH1750_ONE_TIME_LOW_RES_MODE:
return ml*16+5;
default:
return 0;
}
}
+207
View File
@@ -0,0 +1,207 @@
/*
This is a (Arduino) library for the BH1750FVI Digital Light Sensor.
Description:
http://www.rohm.com/web/global/products/-/product/BH1750FVI
Datasheet:
http://rohmfs.rohm.com/en/products/databook/datasheet/ic/sensor/light/bh1750fvi-e.pdf
Copyright (c) 2013 Alexander Schulz. All right reserved.
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.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AS_BH1750A_h
#define AS_BH1750A_h
#if (ARDUINO >= 100)
#include <Arduino.h>
#else
#include <WProgram.h>
#endif
#include "Wire.h"
// Mögliche I2C Adressen
#define BH1750_DEFAULT_I2CADDR 0x23
#define BH1750_SECOND_I2CADDR 0x5C
// MTreg Werte
// Default
#define BH1750_MTREG_DEFAULT 69
// Sensitivity : default = 0.45
#define BH1750_MTREG_MIN 31
// Sensitivity : default = 3.68
#define BH1750_MTREG_MAX 254
// Hardware Modi
// No active state
#define BH1750_POWER_DOWN 0x00
// Wating for measurment command
#define BH1750_POWER_ON 0x01
// Reset data register value - not accepted in POWER_DOWN mode
#define BH1750_RESET 0x07
// Start measurement at 1lx resolution. Measurement time is approx 120ms.
#define BH1750_CONTINUOUS_HIGH_RES_MODE 0x10
// Start measurement at 0.5lx resolution. Measurement time is approx 120ms.
#define BH1750_CONTINUOUS_HIGH_RES_MODE_2 0x11
// Start measurement at 4lx resolution. Measurement time is approx 16ms.
#define BH1750_CONTINUOUS_LOW_RES_MODE 0x13
// Start measurement at 1lx resolution. Measurement time is approx 120ms.
// Device is automatically set to Power Down after measurement.
#define BH1750_ONE_TIME_HIGH_RES_MODE 0x20
// Start measurement at 0.5lx resolution. Measurement time is approx 120ms.
// Device is automatically set to Power Down after measurement.
#define BH1750_ONE_TIME_HIGH_RES_MODE_2 0x21
// Start measurement at 1lx resolution. Measurement time is approx 120ms.
// Device is automatically set to Power Down after measurement.
#define BH1750_ONE_TIME_LOW_RES_MODE 0x23
#define MAX_U_LONG 4294967295;
/** Virtual Modi */
typedef enum
{
RESOLUTION_LOW = (1), /** 4lx resolution. Measurement time is approx 16ms. */
RESOLUTION_NORMAL = (2), /** 1lx resolution. Measurement time is approx 120ms. */
RESOLUTION_HIGH = (3), /** 0,5lx resolution. Measurement time is approx 120ms. */
RESOLUTION_AUTO_HIGH = (99) /** 0,11-1lx resolution. Measurement time is above 250ms. */
}
sensors_resolution_t;
typedef void (*DelayFuncPtr)(unsigned long);
typedef unsigned long (*TimeFuncPtr)(void);
/**
* BH1750 driver class.
*/
class AS_BH1750A {
public:
/**
* Constructor.
* Erlaubt die I2C-Adresse des Sensors zu ändern.
* Standardadresse: 0x23, Alternativadresse: 0x5C.
* Es sind entsprechende Konstanten definiert: BH1750_DEFAULT_I2CADDR und BH1750_SECOND_I2CADDR.
* Bei Nichtangabe wird die Standardadresse verwendet.
* Um die Alternativadresse zu nutzen, muss der Sensorpin 'ADR' des Chips auf VCC gelegt werden.
*/
AS_BH1750A(uint8_t address = BH1750_DEFAULT_I2CADDR);
/**
* Führt die anfängliche Initialisierung des Sensors.
* Mögliche Parameter:
* - Modus für die Sensorauflösung:
* -- RESOLUTION_LOW: Physische Sensormodus mit 4 lx Auflösung. Messzeit ca. 16ms. Bereich 0-54612.
* -- RESOLUTION_NORMAL: Physische Sensormodus mit 1 lx Auflösung. Messzeit ca. 120ms. Bereich 0-54612.
* -- RESOLUTION_HIGH: Physische Sensormodus mit 0,5 lx Auflösung. Messzeit ca. 120ms. Bereich 0-54612.
* (Die Messbereiche können durch Änderung des MTreg verschoben werden.)
* -- RESOLUTION_AUTO_HIGH: Die Werte im MTreg werden je nach Helligkeit automatisch so angepasst,
* dass eine maximalmögliche Auflösung und Messbereich erziehlt werden.
* Die messbaren Werte fangen von 0,11 lx und gehen bis über 100000 lx.
* (ich weis nicht, wie genau die Werte in Grenzbereichen sind,
* besonders bei hohen Werte habe ich meine Zweifel.)
* Auflösung im Unteren Bereich 0,13 lx, im mittleren 0,5 lx, im oberen 1-2 lx.
* Die Messzeiten verlängern sich durch mehrfache Messungen und
* die Änderungen von Measurement Time (MTreg) bis max. ca. 500 ms.
*
* - AutoPowerDown: true = Der Sensor wird nach der Messung in den Stromsparmodus versetzt.
* Das spätere Aufwecken wird ggf. automatisch vorgenommen, braucht jedoch geringfügig mehr Zeit.
*
* Defaultwerte: RESOLUTION_AUTO_HIGH, true, delay()
*
*/
bool begin(sensors_resolution_t mode = RESOLUTION_AUTO_HIGH, bool autoPowerDown = true);
/**
* Erlaub eine Prüfung, ob ein (ansprechbarer) BH1750-Sensor vorhanden ist.
*/
bool isPresent(void);
/**
* Liefert aktuell gemessenen Wert für Helligkeit in lux (lx).
* Falls sich der Sensorf in Stromsparmodus befindet, wird er automatisch geweckt.
*
* Wurde der Sensor (noch) nicht initialisiert (begin), wird der Wert -1 geliefert.
*
* Mögliche Parameter:
*
* - DelayFuncPtr: delay(n) Möglichkeit, eigene Delay-Funktion mitzugeben (z.B. um sleep-Modus zu verwenden).
*
* Defaultwerte: delay()
*
*/
float readLightLevel(DelayFuncPtr fDelayPtr = &delay, TimeFuncPtr fTimePtr = &millis);
bool startMeasurementAsync(TimeFuncPtr fTimePtr = &millis);
bool isMeasurementReady(void);
float readLightLevelAsync();
//float checkAndReadLightLevelAsync(TimeFuncPtr fTimePtr);
//void reset(void);
unsigned long nextDelay(void);
/**
* Schickt den Sensor in Stromsparmodus.
* Funktionier nur, wenn der Sensor bereits initialisiert wurde.
*/
void powerDown(void);
//bool delayExpired(); // TEST
private:
int _address;
uint8_t _hardwareMode;
uint8_t _MTreg;
float _MTregFactor;
sensors_resolution_t _virtualMode;
bool _autoPowerDown;
bool _valueReaded;
bool selectResolutionMode(uint8_t mode);
void defineMTReg(uint8_t val);
void powerOn();
//void reset(void);
uint16_t readRawLevel(void);
float convertRawValue(uint16_t raw);
bool isInitialized();
bool write8(uint8_t data);
TimeFuncPtr _fTimePtr;
int _stage = 0;
int _nextDelay = 0;
int _lastTimestamp = 0;
float _lastResult = -100;
bool delayExpired();
void selectAutoMode();
// TEST
//float readLightLevel_alt(DelayFuncPtr fDelayPtr = &delay);
unsigned long getModeDelay();
};
#endif
+502
View File
@@ -0,0 +1,502 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
a (Arduino) library for the BH1750FVI Digital Light Sensor
Copyright (C) 2013 Alex Hexenmeister
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.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
{signature of Ty Coon}, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!
+37
View File
@@ -0,0 +1,37 @@
AS_BH1750
=========
a (Arduino) library for the BH1750FVI Digital Light Sensor.
(http://s6z.de/joomla3/index.php/arduino/sensoren/15-umgebungslichtsensor-bh1750)
Features:
- unterstützt beide möglichen I2C-Adressen des Sensors:
Standardadresse: 0x23, Alternativadresse: 0x5C.
Es sind entsprechende Konstanten definiert: BH1750_DEFAULT_I2CADDR und BH1750_SECOND_I2CADDR.
- alle Hardware-Auflösungsmodi:
* RESOLUTION_LOW: Physische Sensormodus mit 4 lx Auflösung. Messzeit ca. 16ms. Bereich 0-54612.
* RESOLUTION_NORMAL: Physische Sensormodus mit 1 lx Auflösung. Messzeit ca. 120ms. Bereich 0-54612.
* RESOLUTION_HIGH: Physische Sensormodus mit 0,5 lx Auflösung. Messzeit ca. 120ms. Bereich 0-54612.
- Virtueller Modus:
* RESOLUTION_AUTO_HIGH: Die Werte im MTreg ('Measurement Time'-Register) werden je nach Helligkeit
automatisch so angepasst, dass eine maximalmögliche Auflösung
und Messbereich erziehlt werden.
Die messbaren Werte fangen von 0,11 lx und gehen bis über 100000 lx.
(ich weis nicht, wie genau die Werte in Grenzbereichen sind,
besonders bei hohen Werte habe ich da meine Zweifel.
Die Werte scheinen jedoch weitgehend linear mit der steigenden Helligkeit zu wachsen.)
Auflösung im Unteren Bereich ca. 0,13 lx, im mittleren 0,5 lx, im oberen etwa 1-2 lx.
Die Messzeiten verlängern sich durch mehrfache Messungen und
die Änderungen von Measurement Time (MTreg) bis max. ca. 500 ms.
- Methode zur Änderung von 'Measurement Time'-Registers. Damit kann die Empfindlichkeit beeinflusst werden.
- auto power down: Der Sensor wird nach der Messung in den Stromsparmodus versetzt.
Das spätere Aufwecken wird ggf. automatisch vorgenommen, braucht jedoch geringfügig mehr Zeit.
Defaultwerte: Modus = RESOLUTION_AUTO_HIGH, AutoPowerDown = true
@@ -0,0 +1,68 @@
/*
* Example of AS_BH1750 library usage.
*
* This example initalises the BH1750 object using the default
* adaptive auto-high-resolution mode and then makes
* a light level reading about every second.
* (the sensitivity and resolution are automatically adapted
* the current light conditions)
*
* Wiring:
* VCC-5v
* GND-GND
* SCL-SCL(analog pin 5)
* SDA-SDA(analog pin 4)
* ADD-NC or GND
*
* Copyright (c) 2013 Alexander Schulz. All right reserved.
*
* 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/>.
*/
#include <Wire.h>
#include <AS_BH1750.h>
AS_BH1750 sensor;
void setup(){
Serial.begin(9600);
delay(50);
// for normal sensor resolution (1 lx resolution, 0-65535 lx, 120ms, no PowerDown) use: sensor.begin(RESOLUTION_NORMAL, false);
// Initialize sensor. if sensor is not present, false is returned
if(sensor.begin()) {
Serial.println("Sensor initialized");
}
else {
Serial.println("Sensor not present");
}
/*
// to check the sensor present
if(sensor.isPresent()) {
Serial.println("Sensor present");
}
else {
Serial.println("Sensor not present");
}*/
}
void loop() {
float lux = sensor.readLightLevel();
Serial.print("Light level: ");
Serial.print(lux);
Serial.println(" lx");
delay(1000);
}
@@ -0,0 +1,96 @@
#include <Wire.h>
#include <AS_BH1750.h>
#include <LiquidCrystal.h>
/*
* LightMeter_LCD
*
* Version 1.2
* Datum: 05.08.2013
*
* Das Programm benutzt den BH1750 (Umgebiungslichtsensor)
* und zeigt die Werte in Lux auf einem 16x2-Symbol-LCD.
*
* Verdrahtung (UNO, Nano...)
*
* BH1750:
* Sensor SCL pin an A5
* Sensor SDA pin an A4
* Sensor VDD pin an 5V
* Sensor GND pin an GND
* Sensor ADDR pin frei
*
* LCD in 4-Bit-Modus:
* LCD RS pin an digital pin 8
* LCD RW pin an digital pin 13
* LCD Enable pin an digital pin 9
* LCD D4 pin an digital pin 4
* LCD D5 pin an digital pin 5
* LCD D6 pin an digital pin 6
* LCD D7 pin an digital pin 7
*
*
* Copyright (c) 2013 Alexander Schulz. All right reserved.
*
* 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/>.
*/
AS_BH1750 lightMeter;
// Setup LCD-Shield
LiquidCrystal lcd(8, 13, 9, 4, 5, 6, 7);
void setup() {
// Display initialisieren
lcd.clear();
lcd.begin(16, 2); // 16x2 Zeichen
lcd.setCursor(0,0);
lcd.print("LightMeter v1.0");
lcd.setCursor(0,1);
lcd.print("Initializing...");
delay(1000);
lcd.clear();
if(!lightMeter.begin()){
// Prüfen, ob Sensor vorhanden ist
lcd.clear();
lcd.setCursor(0,0);
lcd.print("BH1750 not found");
lcd.setCursor(0,1);
lcd.print("check wiring!");
while (1) {
delay(1000);
}
}
}
void loop() {
char clux[9];
// Werte auslesen und aufbereiten
float lux = lightMeter.readLightLevel();
dtostrf(lux, 8, 1, clux);
lcd.setCursor(0,0);
lcd.print("Light level: ");
lcd.setCursor(5,1);
lcd.print(clux);
lcd.print(" lx");
delay(500);
}
+30
View File
@@ -0,0 +1,30 @@
#######################################
# Syntax Coloring Map For BH1750
#######################################
#######################################
# Datatypes (KEYWORD1)
#######################################
AS_BH1750 KEYWORD1
sensors_resolution_t KEYWORD1
#######################################
# Methods and Functions (KEYWORD2)
#######################################
begin KEYWORD2
isPresent KEYWORD2
readLightLevel KEYWORD2
powerDown KEYWORD2
#######################################
# Instances (KEYWORD2)
#######################################
#######################################
# Constants (LITERAL1)
#######################################
+132
View File
@@ -0,0 +1,132 @@
/***************************************************
This is a library for the MPR121 I2C 12-chan Capacitive Sensor
Designed specifically to work with the MPR121 sensor from Adafruit
----> https://www.adafruit.com/products/1982
These sensors use 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/Ladyada for Adafruit Industries.
BSD license, all text above must be included in any redistribution
****************************************************/
#include "Adafruit_MPR121.h"
Adafruit_MPR121::Adafruit_MPR121() {
}
boolean Adafruit_MPR121::begin(uint8_t i2caddr) {
//Wire.begin(); called in ESPEasy framework
_i2caddr = i2caddr;
// soft reset
writeRegister(MPR121_SOFTRESET, 0x63);
delay(1);
for (uint8_t i=0; i<0x7F; i++) {
// Serial.print("$"); Serial.print(i, HEX);
// Serial.print(": 0x"); Serial.println(readRegister8(i));
}
writeRegister(MPR121_ECR, 0x0);
uint8_t c = readRegister8(MPR121_CONFIG2);
if (c != 0x24) return false;
setThresholds(12, 6);
writeRegister(MPR121_MHDR, 0x01);
writeRegister(MPR121_NHDR, 0x01);
writeRegister(MPR121_NCLR, 0x0E);
writeRegister(MPR121_FDLR, 0x00);
writeRegister(MPR121_MHDF, 0x01);
writeRegister(MPR121_NHDF, 0x05);
writeRegister(MPR121_NCLF, 0x01);
writeRegister(MPR121_FDLF, 0x00);
writeRegister(MPR121_NHDT, 0x00);
writeRegister(MPR121_NCLT, 0x00);
writeRegister(MPR121_FDLT, 0x00);
writeRegister(MPR121_DEBOUNCE, 0);
writeRegister(MPR121_CONFIG1, 0x10); // default, 16uA charge current
writeRegister(MPR121_CONFIG2, 0x20); // 0.5uS encoding, 1ms period
// writeRegister(MPR121_AUTOCONFIG0, 0x8F);
// writeRegister(MPR121_UPLIMIT, 150);
// writeRegister(MPR121_TARGETLIMIT, 100); // should be ~400 (100 shifted)
// writeRegister(MPR121_LOWLIMIT, 50);
// enable all electrodes
writeRegister(MPR121_ECR, 0x8F); // start with first 5 bits of baseline tracking
return true;
}
void Adafruit_MPR121::setThreshholds(uint8_t touch, uint8_t release) {
setThresholds(touch, release);
}
void Adafruit_MPR121::setThresholds(uint8_t touch, uint8_t release) {
for (uint8_t i=0; i<12; i++) {
writeRegister(MPR121_TOUCHTH_0 + 2*i, touch);
writeRegister(MPR121_RELEASETH_0 + 2*i, release);
}
}
uint16_t Adafruit_MPR121::filteredData(uint8_t t) {
if (t > 12) return 0;
return readRegister16(MPR121_FILTDATA_0L + t*2);
}
uint16_t Adafruit_MPR121::baselineData(uint8_t t) {
if (t > 12) return 0;
uint16_t bl = readRegister8(MPR121_BASELINE_0 + t);
return (bl << 2);
}
uint16_t Adafruit_MPR121::touched(void) {
uint16_t t = readRegister16(MPR121_TOUCHSTATUS_L);
return t & 0x0FFF;
}
/*********************************************************************/
uint8_t Adafruit_MPR121::readRegister8(uint8_t reg) {
Wire.beginTransmission(_i2caddr);
Wire.write(reg);
Wire.endTransmission(false);
while (Wire.requestFrom(_i2caddr, 1) != 1);
return ( Wire.read());
}
uint16_t Adafruit_MPR121::readRegister16(uint8_t reg) {
Wire.beginTransmission(_i2caddr);
Wire.write(reg);
Wire.endTransmission(false);
while (Wire.requestFrom(_i2caddr, 2) != 2);
uint16_t v = Wire.read();
v |= ((uint16_t) Wire.read()) << 8;
return v;
}
/**************************************************************************/
/*!
@brief Writes 8-bits to the specified destination register
*/
/**************************************************************************/
void Adafruit_MPR121::writeRegister(uint8_t reg, uint8_t value) {
Wire.beginTransmission(_i2caddr);
Wire.write((uint8_t)reg);
Wire.write((uint8_t)(value));
Wire.endTransmission();
}
+94
View File
@@ -0,0 +1,94 @@
/***************************************************
This is a library for the MPR121 12-Channel Capacitive Sensor
Designed specifically to work with the MPR121 breakout from Adafruit
----> https://www.adafruit.com/products/1982
These sensors use 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/Ladyada for Adafruit Industries.
BSD license, all text above must be included in any redistribution
****************************************************/
#ifndef ADAFRUIT_MPR121_H
#define ADAFRUIT_MPR121_H
#if (ARDUINO >= 100)
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
#include <Wire.h>
// The default I2C address
#define MPR121_I2CADDR_DEFAULT 0x5A
#define MPR121_TOUCHSTATUS_L 0x00
#define MPR121_TOUCHSTATUS_H 0x01
#define MPR121_FILTDATA_0L 0x04
#define MPR121_FILTDATA_0H 0x05
#define MPR121_BASELINE_0 0x1E
#define MPR121_MHDR 0x2B
#define MPR121_NHDR 0x2C
#define MPR121_NCLR 0x2D
#define MPR121_FDLR 0x2E
#define MPR121_MHDF 0x2F
#define MPR121_NHDF 0x30
#define MPR121_NCLF 0x31
#define MPR121_FDLF 0x32
#define MPR121_NHDT 0x33
#define MPR121_NCLT 0x34
#define MPR121_FDLT 0x35
#define MPR121_TOUCHTH_0 0x41
#define MPR121_RELEASETH_0 0x42
#define MPR121_DEBOUNCE 0x5B
#define MPR121_CONFIG1 0x5C
#define MPR121_CONFIG2 0x5D
#define MPR121_CHARGECURR_0 0x5F
#define MPR121_CHARGETIME_1 0x6C
#define MPR121_ECR 0x5E
#define MPR121_AUTOCONFIG0 0x7B
#define MPR121_AUTOCONFIG1 0x7C
#define MPR121_UPLIMIT 0x7D
#define MPR121_LOWLIMIT 0x7E
#define MPR121_TARGETLIMIT 0x7F
#define MPR121_GPIODIR 0x76
#define MPR121_GPIOEN 0x77
#define MPR121_GPIOSET 0x78
#define MPR121_GPIOCLR 0x79
#define MPR121_GPIOTOGGLE 0x7A
#define MPR121_SOFTRESET 0x80
//.. thru to 0x1C/0x1D
class Adafruit_MPR121 {
public:
// Hardware I2C
Adafruit_MPR121(void);
boolean begin(uint8_t i2caddr = MPR121_I2CADDR_DEFAULT);
uint16_t filteredData(uint8_t t);
uint16_t baselineData(uint8_t t);
uint8_t readRegister8(uint8_t reg);
uint16_t readRegister16(uint8_t reg);
void writeRegister(uint8_t reg, uint8_t value);
uint16_t touched(void);
// Add deprecated attribute so that the compiler shows a warning
__attribute__((deprecated)) void setThreshholds(uint8_t touch, uint8_t release);
void setThresholds(uint8_t touch, uint8_t release);
private:
int8_t _i2caddr;
};
#endif // ADAFRUIT_MPR121_H
+32
View File
@@ -0,0 +1,32 @@
# Adafruit_MPR121_Library
<!-- START COMPATIBILITY TABLE -->
## Compatibility
MCU | Tested Works | Doesn't Work | Not Tested | Notes
------------------ | :----------: | :----------: | :---------: | -----
Atmega328 @ 16MHz | X | | |
Atmega328 @ 12MHz | X | | |
Atmega32u4 @ 16MHz | X | | |
Atmega32u4 @ 8MHz | X | | |
ESP8266 | | X | |
Atmega2560 @ 16MHz | X | | |
ATSAM3X8E | | X | |
ATSAM21D | X | | |
ATtiny85 @ 16MHz | | | X |
ATtiny85 @ 8MHz | | | X |
Intel Curie @ 32MHz | | | X |
STM32F2 | | | X |
* ATmega328 @ 16MHz : Arduino UNO, Adafruit Pro Trinket 5V, Adafruit Metro 328, Adafruit Metro Mini
* ATmega328 @ 12MHz : Adafruit Pro Trinket 3V
* ATmega32u4 @ 16MHz : Arduino Leonardo, Arduino Micro, Arduino Yun, Teensy 2.0
* ATmega32u4 @ 8MHz : Adafruit Flora, Bluefruit Micro
* ESP8266 : Adafruit Huzzah
* ATmega2560 @ 16MHz : Arduino Mega
* ATSAM3X8E : Arduino Due
* ATSAM21D : Arduino Zero, M0 Pro
* ATtiny85 @ 16MHz : Adafruit Trinket 5V
* ATtiny85 @ 8MHz : Adafruit Gemma, Arduino Gemma, Adafruit Trinket 3V
<!-- END COMPATIBILITY TABLE -->
+25
View File
@@ -0,0 +1,25 @@
This is a library for the MPR121 12-channel Capacitive touch sensor
Designed specifically to work with the MPR121 Breakout in the Adafruit shop
----> https://www.adafruit.com/products/1982
These sensors use I2C communicate, at least 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/Ladyada for Adafruit Industries.
BSD license, all text above must be included in any redistribution
Check out the links above for our tutorials and wiring diagrams
To download. click the ZIP button, and rename the uncompressed folder Adafruit_MPR121
Check that the Adafruit_MPR121 folder contains Adafruit_MPR121.cpp and Adafruit_MPR121.h
Place the Adafruit_MPR121 library folder your arduinosketchfolder/libraries/ folder.
You may need to create the libraries subfolder if its your first library. Restart the IDE.
We also have a great tutorial on Arduino library installation at:
http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use
@@ -0,0 +1,83 @@
/*********************************************************
This is a library for the MPR121 12-channel Capacitive touch sensor
Designed specifically to work with the MPR121 Breakout in the Adafruit shop
----> https://www.adafruit.com/products/
These sensors use I2C communicate, at least 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/Ladyada for Adafruit Industries.
BSD license, all text above must be included in any redistribution
**********************************************************/
#include <Wire.h>
#include "Adafruit_MPR121.h"
// You can have up to 4 on one i2c bus but one is enough for testing!
Adafruit_MPR121 cap = Adafruit_MPR121();
// Keeps track of the last pins touched
// so we know when buttons are 'released'
uint16_t lasttouched = 0;
uint16_t currtouched = 0;
void setup() {
Serial.begin(9600);
while (!Serial) { // needed to keep leonardo/micro from starting too fast!
delay(10);
}
Serial.println("Adafruit MPR121 Capacitive Touch sensor test");
// Default address is 0x5A, if tied to 3.3V its 0x5B
// If tied to SDA its 0x5C and if SCL then 0x5D
if (!cap.begin(0x5A)) {
Serial.println("MPR121 not found, check wiring?");
while (1);
}
Serial.println("MPR121 found!");
}
void loop() {
// Get the currently touched pads
currtouched = cap.touched();
for (uint8_t i=0; i<12; i++) {
// it if *is* touched and *wasnt* touched before, alert!
if ((currtouched & _BV(i)) && !(lasttouched & _BV(i)) ) {
Serial.print(i); Serial.println(" touched");
}
// if it *was* touched and now *isnt*, alert!
if (!(currtouched & _BV(i)) && (lasttouched & _BV(i)) ) {
Serial.print(i); Serial.println(" released");
}
}
// reset our state
lasttouched = currtouched;
// comment out this line for detailed data from the sensor!
return;
// debugging info, what
Serial.print("\t\t\t\t\t\t\t\t\t\t\t\t\t 0x"); Serial.println(cap.touched(), HEX);
Serial.print("Filt: ");
for (uint8_t i=0; i<12; i++) {
Serial.print(cap.filteredData(i)); Serial.print("\t");
}
Serial.println();
Serial.print("Base: ");
for (uint8_t i=0; i<12; i++) {
Serial.print(cap.baselineData(i)); Serial.print("\t");
}
Serial.println();
// put a delay so it isn't overwhelming
delay(100);
}
+6
View File
@@ -0,0 +1,6 @@
Adafruit_MPR121 KEYWORD1
begin KEYWORD2
filteredData KEYWORD2
baselineData KEYWORD2
touched KEYWORD2
setThresholds KEYWORD2
+9
View File
@@ -0,0 +1,9 @@
name=Adafruit MPR121
version=1.0.0
author=Adafruit <info@adafruit.com>
maintainer=Adafruit <info@adafruit.com>
sentence=Arduino library for the MPR121-based capacitive sensors in the Adafruit shop.
paragraph=Designed specifically to work with the MPR121 Breakout in the Adafruit shop.
category=Sensors
url=https://github.com/adafruit/Adafruit_MPR121
architectures=*
+46
View File
@@ -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,397 @@
/******************************************************************
This is the library for the Adafruit Motor Shield V2 for Arduino.
It supports DC motors & Stepper motors with microstepping as well
as stacking-support. It is *not* compatible with the V1 library!
It will only work with https://www.adafruit.com/products/1483
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/Ladyada for Adafruit Industries.
BSD license, check license.txt for more information.
All text above must be included in any redistribution.
******************************************************************/
#if (ARDUINO >= 100)
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
#include <Wire.h>
#include "Adafruit_MotorShield.h"
#include <Adafruit_MS_PWMServoDriver.h>
#if defined(ARDUINO_SAM_DUE)
#define WIRE Wire1
#else
#define WIRE Wire
#endif
#if (MICROSTEPS == 8)
uint8_t microstepcurve[] = {0, 50, 98, 142, 180, 212, 236, 250, 255};
#elif (MICROSTEPS == 16)
uint8_t microstepcurve[] = {0, 25, 50, 74, 98, 120, 141, 162, 180, 197, 212, 225, 236, 244, 250, 253, 255};
#endif
Adafruit_MotorShield::Adafruit_MotorShield(uint8_t addr) {
_addr = addr;
_pwm = Adafruit_MS_PWMServoDriver(_addr);
}
void Adafruit_MotorShield::begin(uint16_t freq) {
// init PWM w/_freq
//Wire.begin(); called in ESPEasy framework
_pwm.begin();
_freq = freq;
_pwm.setPWMFreq(_freq); // This is the maximum PWM frequency
for (uint8_t i=0; i<16; i++)
_pwm.setPWM(i, 0, 0);
}
void Adafruit_MotorShield::setPWM(uint8_t pin, uint16_t value) {
if (value > 4095) {
_pwm.setPWM(pin, 4096, 0);
} else
_pwm.setPWM(pin, 0, value);
}
void Adafruit_MotorShield::setPin(uint8_t pin, boolean value) {
if (value == LOW)
_pwm.setPWM(pin, 0, 0);
else
_pwm.setPWM(pin, 4096, 0);
}
Adafruit_DCMotor *Adafruit_MotorShield::getMotor(uint8_t num) {
if (num > 4) return NULL;
num--;
if (dcmotors[num].motornum == 0) {
// not init'd yet!
dcmotors[num].motornum = num;
dcmotors[num].MC = this;
uint8_t pwm, in1, in2;
if (num == 0) {
pwm = 8; in2 = 9; in1 = 10;
} else if (num == 1) {
pwm = 13; in2 = 12; in1 = 11;
} else if (num == 2) {
pwm = 2; in2 = 3; in1 = 4;
} else if (num == 3) {
pwm = 7; in2 = 6; in1 = 5;
}
dcmotors[num].PWMpin = pwm;
dcmotors[num].IN1pin = in1;
dcmotors[num].IN2pin = in2;
}
return &dcmotors[num];
}
Adafruit_StepperMotor *Adafruit_MotorShield::getStepper(uint16_t steps, uint8_t num) {
if (num > 2) return NULL;
num--;
if (steppers[num].steppernum == 0) {
// not init'd yet!
steppers[num].steppernum = num;
steppers[num].revsteps = steps;
steppers[num].MC = this;
uint8_t pwma, pwmb, ain1, ain2, bin1, bin2;
if (num == 0) {
pwma = 8; ain2 = 9; ain1 = 10;
pwmb = 13; bin2 = 12; bin1 = 11;
} else if (num == 1) {
pwma = 2; ain2 = 3; ain1 = 4;
pwmb = 7; bin2 = 6; bin1 = 5;
}
steppers[num].PWMApin = pwma;
steppers[num].PWMBpin = pwmb;
steppers[num].AIN1pin = ain1;
steppers[num].AIN2pin = ain2;
steppers[num].BIN1pin = bin1;
steppers[num].BIN2pin = bin2;
}
return &steppers[num];
}
/******************************************
MOTORS
******************************************/
Adafruit_DCMotor::Adafruit_DCMotor(void) {
MC = NULL;
motornum = 0;
PWMpin = IN1pin = IN2pin = 0;
}
void Adafruit_DCMotor::run(uint8_t cmd) {
switch (cmd) {
case FORWARD:
MC->setPin(IN2pin, LOW); // take low first to avoid 'break'
MC->setPin(IN1pin, HIGH);
break;
case BACKWARD:
MC->setPin(IN1pin, LOW); // take low first to avoid 'break'
MC->setPin(IN2pin, HIGH);
break;
case RELEASE:
MC->setPin(IN1pin, LOW);
MC->setPin(IN2pin, LOW);
break;
}
}
void Adafruit_DCMotor::setSpeed(uint8_t speed) {
MC->setPWM(PWMpin, speed*16);
}
/******************************************
STEPPERS
******************************************/
Adafruit_StepperMotor::Adafruit_StepperMotor(void) {
revsteps = steppernum = currentstep = 0;
}
/*
uint16_t steps, Adafruit_MotorShield controller) {
revsteps = steps;
steppernum = 1;
currentstep = 0;
if (steppernum == 1) {
latch_state &= ~_BV(MOTOR1_A) & ~_BV(MOTOR1_B) &
~_BV(MOTOR2_A) & ~_BV(MOTOR2_B); // all motor pins to 0
// enable both H bridges
pinMode(11, OUTPUT);
pinMode(3, OUTPUT);
digitalWrite(11, HIGH);
digitalWrite(3, HIGH);
// use PWM for microstepping support
MC->setPWM(1, 255);
MC->setPWM(2, 255);
} else if (steppernum == 2) {
latch_state &= ~_BV(MOTOR3_A) & ~_BV(MOTOR3_B) &
~_BV(MOTOR4_A) & ~_BV(MOTOR4_B); // all motor pins to 0
// enable both H bridges
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
digitalWrite(5, HIGH);
digitalWrite(6, HIGH);
// use PWM for microstepping support
// use PWM for microstepping support
MC->setPWM(3, 255);
MC->setPWM(4, 255);
}
}
*/
void Adafruit_StepperMotor::setSpeed(uint16_t rpm) {
//Serial.println("steps per rev: "); Serial.println(revsteps);
//Serial.println("RPM: "); Serial.println(rpm);
usperstep = 60000000 / ((uint32_t)revsteps * (uint32_t)rpm);
}
void Adafruit_StepperMotor::release(void) {
MC->setPin(AIN1pin, LOW);
MC->setPin(AIN2pin, LOW);
MC->setPin(BIN1pin, LOW);
MC->setPin(BIN2pin, LOW);
MC->setPWM(PWMApin, 0);
MC->setPWM(PWMBpin, 0);
}
void Adafruit_StepperMotor::step(uint16_t steps, uint8_t dir, uint8_t style) {
uint32_t uspers = usperstep;
uint8_t ret = 0;
if (style == INTERLEAVE) {
uspers /= 2;
}
else if (style == MICROSTEP) {
uspers /= MICROSTEPS;
steps *= MICROSTEPS;
#ifdef MOTORDEBUG
Serial.print("steps = "); Serial.println(steps, DEC);
#endif
}
while (steps--) {
//Serial.println("step!"); Serial.println(uspers);
ret = onestep(dir, style);
delayMicroseconds(uspers);
yield(); // required for ESP8266
}
}
uint8_t Adafruit_StepperMotor::onestep(uint8_t dir, uint8_t style) {
uint8_t a, b, c, d;
uint8_t ocrb, ocra;
ocra = ocrb = 255;
// next determine what sort of stepping procedure we're up to
if (style == SINGLE) {
if ((currentstep/(MICROSTEPS/2)) % 2) { // we're at an odd step, weird
if (dir == FORWARD) {
currentstep += MICROSTEPS/2;
}
else {
currentstep -= MICROSTEPS/2;
}
} else { // go to the next even step
if (dir == FORWARD) {
currentstep += MICROSTEPS;
}
else {
currentstep -= MICROSTEPS;
}
}
} else if (style == DOUBLE) {
if (! (currentstep/(MICROSTEPS/2) % 2)) { // we're at an even step, weird
if (dir == FORWARD) {
currentstep += MICROSTEPS/2;
} else {
currentstep -= MICROSTEPS/2;
}
} else { // go to the next odd step
if (dir == FORWARD) {
currentstep += MICROSTEPS;
} else {
currentstep -= MICROSTEPS;
}
}
} else if (style == INTERLEAVE) {
if (dir == FORWARD) {
currentstep += MICROSTEPS/2;
} else {
currentstep -= MICROSTEPS/2;
}
}
if (style == MICROSTEP) {
if (dir == FORWARD) {
currentstep++;
} else {
// BACKWARDS
currentstep--;
}
currentstep += MICROSTEPS*4;
currentstep %= MICROSTEPS*4;
ocra = ocrb = 0;
if ( (currentstep >= 0) && (currentstep < MICROSTEPS)) {
ocra = microstepcurve[MICROSTEPS - currentstep];
ocrb = microstepcurve[currentstep];
} else if ( (currentstep >= MICROSTEPS) && (currentstep < MICROSTEPS*2)) {
ocra = microstepcurve[currentstep - MICROSTEPS];
ocrb = microstepcurve[MICROSTEPS*2 - currentstep];
} else if ( (currentstep >= MICROSTEPS*2) && (currentstep < MICROSTEPS*3)) {
ocra = microstepcurve[MICROSTEPS*3 - currentstep];
ocrb = microstepcurve[currentstep - MICROSTEPS*2];
} else if ( (currentstep >= MICROSTEPS*3) && (currentstep < MICROSTEPS*4)) {
ocra = microstepcurve[currentstep - MICROSTEPS*3];
ocrb = microstepcurve[MICROSTEPS*4 - currentstep];
}
}
currentstep += MICROSTEPS*4;
currentstep %= MICROSTEPS*4;
#ifdef MOTORDEBUG
Serial.print("current step: "); Serial.println(currentstep, DEC);
Serial.print(" pwmA = "); Serial.print(ocra, DEC);
Serial.print(" pwmB = "); Serial.println(ocrb, DEC);
#endif
MC->setPWM(PWMApin, ocra*16);
MC->setPWM(PWMBpin, ocrb*16);
// release all
uint8_t latch_state = 0; // all motor pins to 0
//Serial.println(step, DEC);
if (style == MICROSTEP) {
if ((currentstep >= 0) && (currentstep < MICROSTEPS))
latch_state |= 0x03;
if ((currentstep >= MICROSTEPS) && (currentstep < MICROSTEPS*2))
latch_state |= 0x06;
if ((currentstep >= MICROSTEPS*2) && (currentstep < MICROSTEPS*3))
latch_state |= 0x0C;
if ((currentstep >= MICROSTEPS*3) && (currentstep < MICROSTEPS*4))
latch_state |= 0x09;
} else {
switch (currentstep/(MICROSTEPS/2)) {
case 0:
latch_state |= 0x1; // energize coil 1 only
break;
case 1:
latch_state |= 0x3; // energize coil 1+2
break;
case 2:
latch_state |= 0x2; // energize coil 2 only
break;
case 3:
latch_state |= 0x6; // energize coil 2+3
break;
case 4:
latch_state |= 0x4; // energize coil 3 only
break;
case 5:
latch_state |= 0xC; // energize coil 3+4
break;
case 6:
latch_state |= 0x8; // energize coil 4 only
break;
case 7:
latch_state |= 0x9; // energize coil 1+4
break;
}
}
#ifdef MOTORDEBUG
Serial.print("Latch: 0x"); Serial.println(latch_state, HEX);
#endif
if (latch_state & 0x1) {
// Serial.println(AIN2pin);
MC->setPin(AIN2pin, HIGH);
} else {
MC->setPin(AIN2pin, LOW);
}
if (latch_state & 0x2) {
MC->setPin(BIN1pin, HIGH);
// Serial.println(BIN1pin);
} else {
MC->setPin(BIN1pin, LOW);
}
if (latch_state & 0x4) {
MC->setPin(AIN1pin, HIGH);
// Serial.println(AIN1pin);
} else {
MC->setPin(AIN1pin, LOW);
}
if (latch_state & 0x8) {
MC->setPin(BIN2pin, HIGH);
// Serial.println(BIN2pin);
} else {
MC->setPin(BIN2pin, LOW);
}
return currentstep;
}
@@ -0,0 +1,102 @@
/******************************************************************
This is the library for the Adafruit Motor Shield V2 for Arduino.
It supports DC motors & Stepper motors with microstepping as well
as stacking-support. It is *not* compatible with the V1 library!
It will only work with https://www.adafruit.com/products/1483
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/Ladyada for Adafruit Industries.
BSD license, check license.txt for more information.
All text above must be included in any redistribution.
******************************************************************/
#ifndef _Adafruit_MotorShield_h_
#define _Adafruit_MotorShield_h_
#include <inttypes.h>
#include <Wire.h>
#include "utility/Adafruit_MS_PWMServoDriver.h"
//#define MOTORDEBUG
#define MICROSTEPS 16 // 8 or 16
#define MOTOR1_A 2
#define MOTOR1_B 3
#define MOTOR2_A 1
#define MOTOR2_B 4
#define MOTOR4_A 0
#define MOTOR4_B 6
#define MOTOR3_A 5
#define MOTOR3_B 7
#define FORWARD 1
#define BACKWARD 2
#define BRAKE 3
#define RELEASE 4
#define SINGLE 1
#define DOUBLE 2
#define INTERLEAVE 3
#define MICROSTEP 4
class Adafruit_MotorShield;
class Adafruit_DCMotor
{
public:
Adafruit_DCMotor(void);
friend class Adafruit_MotorShield;
void run(uint8_t);
void setSpeed(uint8_t);
private:
uint8_t PWMpin, IN1pin, IN2pin;
Adafruit_MotorShield *MC;
uint8_t motornum;
};
class Adafruit_StepperMotor {
public:
Adafruit_StepperMotor(void);
friend class Adafruit_MotorShield;
void step(uint16_t steps, uint8_t dir, uint8_t style = SINGLE);
void setSpeed(uint16_t);
uint8_t onestep(uint8_t dir, uint8_t style);
void release(void);
uint32_t usperstep;
private:
uint8_t PWMApin, AIN1pin, AIN2pin;
uint8_t PWMBpin, BIN1pin, BIN2pin;
uint16_t revsteps; // # steps per revolution
uint8_t currentstep;
Adafruit_MotorShield *MC;
uint8_t steppernum;
};
class Adafruit_MotorShield
{
public:
Adafruit_MotorShield(uint8_t addr = 0x60);
friend class Adafruit_DCMotor;
void begin(uint16_t freq = 1600);
void setPWM(uint8_t pin, uint16_t val);
void setPin(uint8_t pin, boolean val);
Adafruit_DCMotor *getMotor(uint8_t n);
Adafruit_StepperMotor *getStepper(uint16_t steps, uint8_t n);
private:
uint8_t _addr;
uint16_t _freq;
Adafruit_DCMotor dcmotors[4];
Adafruit_StepperMotor steppers[2];
Adafruit_MS_PWMServoDriver _pwm;
};
#endif
+47
View File
@@ -0,0 +1,47 @@
# Adafruit Motor Shield v2 Library
This is the library for the Adafruit Motor Shield V2 for Arduino.
It supports DC motors & Stepper motors with microstepping as well
as stacking-support. It is *not* compatible with the V1 library!
It will only work with https://www.adafruit.com/products/1438
<!-- START COMPATIBILITY TABLE -->
## Compatibility
MCU | Tested Works | Doesn't Work | Not Tested | Notes
------------------ | :----------: | :----------: | :---------: | -----
Atmega328 @ 16MHz | X | | |
Atmega328 @ 12MHz | X | | |
Atmega32u4 @ 16MHz | X | | |
Atmega32u4 @ 8MHz | X | | |
ESP8266 | | | X |
Atmega2560 @ 16MHz | X | | |
ATSAM3X8E | | X | |
ATSAM21D | | X | |
ATtiny85 @ 16MHz | | | X |
ATtiny85 @ 8MHz | | | X |
Intel Curie @ 32MHz | | | X |
STM32F2 | | | X |
* ATmega328 @ 16MHz : Arduino UNO, Adafruit Pro Trinket 5V, Adafruit Metro 328, Adafruit Metro Mini
* ATmega328 @ 12MHz : Adafruit Pro Trinket 3V
* ATmega32u4 @ 16MHz : Arduino Leonardo, Arduino Micro, Arduino Yun, Teensy 2.0
* ATmega32u4 @ 8MHz : Adafruit Flora, Bluefruit Micro
* ESP8266 : Adafruit Huzzah
* ATmega2560 @ 16MHz : Arduino Mega
* ATSAM3X8E : Arduino Due
* ATSAM21D : Arduino Zero, M0 Pro
* ATtiny85 @ 16MHz : Adafruit Trinket 5V
* ATtiny85 @ 8MHz : Adafruit Gemma, Arduino Gemma, Adafruit Trinket 3V
<!-- END COMPATIBILITY TABLE -->
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/Ladyada for Adafruit Industries.
BSD license, check license.txt for more information.
All text above must be included in any redistribution.
@@ -0,0 +1,52 @@
// ConstantSpeed.pde
// -*- mode: C++ -*-
//
// Shows how to run AccelStepper in the simplest,
// fixed speed mode with no accelerations
// Requires the Adafruit_Motorshield v2 library
// https://github.com/adafruit/Adafruit_Motor_Shield_V2_Library
// And AccelStepper with AFMotor support
// https://github.com/adafruit/AccelStepper
// This tutorial is for Adafruit Motorshield v2 only!
// Will not work with v1 shields
#include <AccelStepper.h>
#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_MS_PWMServoDriver.h"
// Create the motor shield object with the default I2C address
Adafruit_MotorShield AFMS = Adafruit_MotorShield();
// Or, create it with a different I2C address (say for stacking)
// Adafruit_MotorShield AFMS = Adafruit_MotorShield(0x61);
// Connect a stepper motor with 200 steps per revolution (1.8 degree)
// to motor port #2 (M3 and M4)
Adafruit_StepperMotor *myStepper1 = AFMS.getStepper(200, 2);
// you can change these to DOUBLE or INTERLEAVE or MICROSTEP!
void forwardstep1() {
myStepper1->onestep(FORWARD, SINGLE);
}
void backwardstep1() {
myStepper1->onestep(BACKWARD, SINGLE);
}
AccelStepper Astepper1(forwardstep1, backwardstep1); // use functions to step
void setup()
{
Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println("Stepper test!");
AFMS.begin(); // create with the default frequency 1.6KHz
//AFMS.begin(1000); // OR with a different frequency, say 1KHz
Astepper1.setSpeed(50);
}
void loop()
{
Astepper1.runSpeed();
}
@@ -0,0 +1,90 @@
// Shows how to run three Steppers at once with varying speeds
//
// Requires the Adafruit_Motorshield v2 library
// https://github.com/adafruit/Adafruit_Motor_Shield_V2_Library
// And AccelStepper with AFMotor support
// https://github.com/adafruit/AccelStepper
// This tutorial is for Adafruit Motorshield v2 only!
// Will not work with v1 shields
#include <AccelStepper.h>
#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_MS_PWMServoDriver.h"
Adafruit_MotorShield AFMSbot(0x61); // Rightmost jumper closed
Adafruit_MotorShield AFMStop(0x60); // Default address, no jumpers
// Connect two steppers with 200 steps per revolution (1.8 degree)
// to the top shield
Adafruit_StepperMotor *myStepper1 = AFMStop.getStepper(200, 1);
Adafruit_StepperMotor *myStepper2 = AFMStop.getStepper(200, 2);
// Connect one stepper with 200 steps per revolution (1.8 degree)
// to the bottom shield
Adafruit_StepperMotor *myStepper3 = AFMSbot.getStepper(200, 2);
// you can change these to DOUBLE or INTERLEAVE or MICROSTEP!
// wrappers for the first motor!
void forwardstep1() {
myStepper1->onestep(FORWARD, SINGLE);
}
void backwardstep1() {
myStepper1->onestep(BACKWARD, SINGLE);
}
// wrappers for the second motor!
void forwardstep2() {
myStepper2->onestep(FORWARD, DOUBLE);
}
void backwardstep2() {
myStepper2->onestep(BACKWARD, DOUBLE);
}
// wrappers for the third motor!
void forwardstep3() {
myStepper3->onestep(FORWARD, INTERLEAVE);
}
void backwardstep3() {
myStepper3->onestep(BACKWARD, INTERLEAVE);
}
// Now we'll wrap the 3 steppers in an AccelStepper object
AccelStepper stepper1(forwardstep1, backwardstep1);
AccelStepper stepper2(forwardstep2, backwardstep2);
AccelStepper stepper3(forwardstep3, backwardstep3);
void setup()
{
AFMSbot.begin(); // Start the bottom shield
AFMStop.begin(); // Start the top shield
stepper1.setMaxSpeed(100.0);
stepper1.setAcceleration(100.0);
stepper1.moveTo(24);
stepper2.setMaxSpeed(200.0);
stepper2.setAcceleration(100.0);
stepper2.moveTo(50000);
stepper3.setMaxSpeed(300.0);
stepper3.setAcceleration(100.0);
stepper3.moveTo(1000000);
}
void loop()
{
// Change direction at the limits
if (stepper1.distanceToGo() == 0)
stepper1.moveTo(-stepper1.currentPosition());
if (stepper2.distanceToGo() == 0)
stepper2.moveTo(-stepper2.currentPosition());
if (stepper3.distanceToGo() == 0)
stepper3.moveTo(-stepper3.currentPosition());
stepper1.run();
stepper2.run();
stepper3.run();
}
@@ -0,0 +1,68 @@
/*
This is a test sketch for the Adafruit assembled Motor Shield for Arduino v2
It won't work with v1.x motor shields! Only for the v2's with built in PWM
control
For use with the Adafruit Motor Shield v2
----> http://www.adafruit.com/products/1438
*/
#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_MS_PWMServoDriver.h"
// Create the motor shield object with the default I2C address
Adafruit_MotorShield AFMS = Adafruit_MotorShield();
// Or, create it with a different I2C address (say for stacking)
// Adafruit_MotorShield AFMS = Adafruit_MotorShield(0x61);
// Select which 'port' M1, M2, M3 or M4. In this case, M1
Adafruit_DCMotor *myMotor = AFMS.getMotor(1);
// You can also make another motor on port M2
//Adafruit_DCMotor *myOtherMotor = AFMS.getMotor(2);
void setup() {
Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println("Adafruit Motorshield v2 - DC Motor test!");
AFMS.begin(); // create with the default frequency 1.6KHz
//AFMS.begin(1000); // OR with a different frequency, say 1KHz
// Set the speed to start, from 0 (off) to 255 (max speed)
myMotor->setSpeed(150);
myMotor->run(FORWARD);
// turn on motor
myMotor->run(RELEASE);
}
void loop() {
uint8_t i;
Serial.print("tick");
myMotor->run(FORWARD);
for (i=0; i<255; i++) {
myMotor->setSpeed(i);
delay(10);
}
for (i=255; i!=0; i--) {
myMotor->setSpeed(i);
delay(10);
}
Serial.print("tock");
myMotor->run(BACKWARD);
for (i=0; i<255; i++) {
myMotor->setSpeed(i);
delay(10);
}
for (i=255; i!=0; i--) {
myMotor->setSpeed(i);
delay(10);
}
Serial.print("tech");
myMotor->run(RELEASE);
delay(1000);
}
@@ -0,0 +1,84 @@
/*
This is a test sketch for the Adafruit assembled Motor Shield for Arduino v2
It won't work with v1.x motor shields! Only for the v2's with built in PWM
control
For use with the Adafruit Motor Shield v2
----> http://www.adafruit.com/products/1438
This sketch creates a fun motor party on your desk *whiirrr*
Connect a unipolar/bipolar stepper to M3/M4
Connect a DC motor to M1
Connect a hobby servo to SERVO1
*/
#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_MS_PWMServoDriver.h"
#include <Servo.h>
// Create the motor shield object with the default I2C address
Adafruit_MotorShield AFMS = Adafruit_MotorShield();
// Or, create it with a different I2C address (say for stacking)
// Adafruit_MotorShield AFMS = Adafruit_MotorShield(0x61);
// Connect a stepper motor with 200 steps per revolution (1.8 degree)
// to motor port #2 (M3 and M4)
Adafruit_StepperMotor *myStepper = AFMS.getStepper(200, 2);
// And connect a DC motor to port M1
Adafruit_DCMotor *myMotor = AFMS.getMotor(1);
// We'll also test out the built in Arduino Servo library
Servo servo1;
void setup() {
Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println("MMMMotor party!");
AFMS.begin(); // create with the default frequency 1.6KHz
//AFMS.begin(1000); // OR with a different frequency, say 1KHz
// Attach a servo to pin #10
servo1.attach(10);
// turn on motor M1
myMotor->setSpeed(200);
myMotor->run(RELEASE);
// setup the stepper
myStepper->setSpeed(10); // 10 rpm
}
int i;
void loop() {
myMotor->run(FORWARD);
for (i=0; i<255; i++) {
servo1.write(map(i, 0, 255, 0, 180));
myMotor->setSpeed(i);
myStepper->step(1, FORWARD, INTERLEAVE);
delay(3);
}
for (i=255; i!=0; i--) {
servo1.write(map(i, 0, 255, 0, 180));
myMotor->setSpeed(i);
myStepper->step(1, BACKWARD, INTERLEAVE);
delay(3);
}
myMotor->run(BACKWARD);
for (i=0; i<255; i++) {
servo1.write(map(i, 0, 255, 0, 180));
myMotor->setSpeed(i);
myStepper->step(1, FORWARD, DOUBLE);
delay(3);
}
for (i=255; i!=0; i--) {
servo1.write(map(i, 0, 255, 0, 180));
myMotor->setSpeed(i);
myStepper->step(1, BACKWARD, DOUBLE);
delay(3);
}
}
@@ -0,0 +1,76 @@
/*
This is a test sketch for the Adafruit assembled Motor Shield for Arduino v2
It won't work with v1.x motor shields! Only for the v2's with built in PWM
control
For use with the Adafruit Motor Shield v2
----> http://www.adafruit.com/products/1438
*/
#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_MS_PWMServoDriver.h"
Adafruit_MotorShield AFMSbot(0x61); // Rightmost jumper closed
Adafruit_MotorShield AFMStop(0x60); // Default address, no jumpers
// On the top shield, connect two steppers, each with 200 steps
Adafruit_StepperMotor *myStepper2 = AFMStop.getStepper(200, 1);
Adafruit_StepperMotor *myStepper3 = AFMStop.getStepper(200, 2);
// On the bottom shield connect a stepper to port M3/M4 with 200 steps
Adafruit_StepperMotor *myStepper1 = AFMSbot.getStepper(200, 2);
// And a DC Motor to port M1
Adafruit_DCMotor *myMotor1 = AFMSbot.getMotor(1);
void setup() {
while (!Serial);
Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println("MMMMotor party!");
AFMSbot.begin(); // Start the bottom shield
AFMStop.begin(); // Start the top shield
// turn on the DC motor
myMotor1->setSpeed(200);
myMotor1->run(RELEASE);
}
int i;
void loop() {
myMotor1->run(FORWARD);
for (i=0; i<255; i++) {
myMotor1->setSpeed(i);
myStepper1->onestep(FORWARD, INTERLEAVE);
myStepper2->onestep(BACKWARD, DOUBLE);
myStepper3->onestep(FORWARD, MICROSTEP);
delay(3);
}
for (i=255; i!=0; i--) {
myMotor1->setSpeed(i);
myStepper1->onestep(BACKWARD, INTERLEAVE);
myStepper2->onestep(FORWARD, DOUBLE);
myStepper3->onestep(BACKWARD, MICROSTEP);
delay(3);
}
myMotor1->run(BACKWARD);
for (i=0; i<255; i++) {
myMotor1->setSpeed(i);
myStepper1->onestep(FORWARD, DOUBLE);
myStepper2->onestep(BACKWARD, INTERLEAVE);
myStepper3->onestep(FORWARD, MICROSTEP);
delay(3);
}
for (i=255; i!=0; i--) {
myMotor1->setSpeed(i);
myStepper1->onestep(BACKWARD, DOUBLE);
myStepper2->onestep(FORWARD, INTERLEAVE);
myStepper3->onestep(BACKWARD, MICROSTEP);
delay(3);
}
}
@@ -0,0 +1,51 @@
/*
This is a test sketch for the Adafruit assembled Motor Shield for Arduino v2
It won't work with v1.x motor shields! Only for the v2's with built in PWM
control
For use with the Adafruit Motor Shield v2
----> http://www.adafruit.com/products/1438
*/
#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_MS_PWMServoDriver.h"
// Create the motor shield object with the default I2C address
Adafruit_MotorShield AFMS = Adafruit_MotorShield();
// Or, create it with a different I2C address (say for stacking)
// Adafruit_MotorShield AFMS = Adafruit_MotorShield(0x61);
// Connect a stepper motor with 200 steps per revolution (1.8 degree)
// to motor port #2 (M3 and M4)
Adafruit_StepperMotor *myMotor = AFMS.getStepper(200, 2);
void setup() {
Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println("Stepper test!");
AFMS.begin(); // create with the default frequency 1.6KHz
//AFMS.begin(1000); // OR with a different frequency, say 1KHz
myMotor->setSpeed(10); // 10 rpm
}
void loop() {
Serial.println("Single coil steps");
myMotor->step(100, FORWARD, SINGLE);
myMotor->step(100, BACKWARD, SINGLE);
Serial.println("Double coil steps");
myMotor->step(100, FORWARD, DOUBLE);
myMotor->step(100, BACKWARD, DOUBLE);
Serial.println("Interleave coil steps");
myMotor->step(100, FORWARD, INTERLEAVE);
myMotor->step(100, BACKWARD, INTERLEAVE);
Serial.println("Microstep steps");
myMotor->step(50, FORWARD, MICROSTEP);
myMotor->step(50, BACKWARD, MICROSTEP);
}
+40
View File
@@ -0,0 +1,40 @@
#######################################
# Syntax Coloring Map for AFMotor
#######################################
#######################################
# Datatypes (KEYWORD1)
#######################################
Adafruit_MotorShield KEYWORD1
Adafruit_DCMotor KEYWORD1
Adafruit_StepperMotor KEYWORD1
#######################################
# Methods and Functions (KEYWORD2)
#######################################
enable KEYWORD2
run KEYWORD2
setSpeed KEYWORD2
step KEYWORD2
onestep KEYWORD2
release KEYWORD2
getMotor KEYWORD2
getStepper KEYWORD2
setPin KEYWORD2
setPWM KEYWORD2
#######################################
# Constants (LITERAL1)
#######################################
MICROSTEPPING LITERAL1
FORWARD LITERAL1
BACKWARD LITERAL1
BRAKE LITERAL1
RELEASE LITERAL1
SINGLE LITERAL1
DOUBLE LITERAL1
INTERLEAVE LITERAL1
MICROSTEP LITERAL1
@@ -0,0 +1,9 @@
name=Adafruit Motor Shield V2 Library
version=1.0.4
author=Adafruit
maintainer=Adafruit <info@adafruit.com>
sentence=Library for the Adafruit Motor Shield V2 for Arduino. It supports DC motors & stepper motors with microstepping as well as stacking-support.
paragraph=Library for the Adafruit Motor Shield V2 for Arduino. It supports DC motors & stepper motors with microstepping as well as stacking-support.
category=Device Control
url=https://github.com/adafruit/Adafruit_Motor_Shield_V2_Library
architectures=*
+25
View File
@@ -0,0 +1,25 @@
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,113 @@
/***************************************************
This is a library for our Adafruit 16-channel PWM & Servo driver
Pick one up today in the adafruit shop!
------> http://www.adafruit.com/products/815
These displays use I2C to communicate, 2 pins are required to
interface. For Arduino UNOs, thats SCL -> Analog 5, SDA -> Analog 4
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/Ladyada for Adafruit Industries.
BSD license, all text above must be included in any redistribution
****************************************************/
#include <Adafruit_MS_PWMServoDriver.h>
#include <Wire.h>
#if defined(ARDUINO_SAM_DUE)
#define WIRE Wire1
#else
#define WIRE Wire
#endif
Adafruit_MS_PWMServoDriver::Adafruit_MS_PWMServoDriver(uint8_t addr) {
_i2caddr = addr;
}
void Adafruit_MS_PWMServoDriver::begin(void) {
//Wire.begin(); called in ESPEasy framework
reset();
}
void Adafruit_MS_PWMServoDriver::reset(void) {
write8(PCA9685_MODE1, 0x0);
}
void Adafruit_MS_PWMServoDriver::setPWMFreq(float freq) {
//Serial.print("Attempting to set freq ");
//Serial.println(freq);
freq *= 0.9; // Correct for overshoot in the frequency setting (see issue #11).
float prescaleval = 25000000;
prescaleval /= 4096;
prescaleval /= freq;
prescaleval -= 1;
//Serial.print("Estimated pre-scale: "); Serial.println(prescaleval);
uint8_t prescale = floor(prescaleval + 0.5);
//Serial.print("Final pre-scale: "); Serial.println(prescale);
uint8_t oldmode = read8(PCA9685_MODE1);
uint8_t newmode = (oldmode&0x7F) | 0x10; // sleep
write8(PCA9685_MODE1, newmode); // go to sleep
write8(PCA9685_PRESCALE, prescale); // set the prescaler
write8(PCA9685_MODE1, oldmode);
delay(5);
write8(PCA9685_MODE1, oldmode | 0xa1); // This sets the MODE1 register to turn on auto increment.
// This is why the beginTransmission below was not working.
// Serial.print("Mode now 0x"); Serial.println(read8(PCA9685_MODE1), HEX);
}
void Adafruit_MS_PWMServoDriver::setPWM(uint8_t num, uint16_t on, uint16_t off) {
//Serial.print("Setting PWM "); Serial.print(num); Serial.print(": "); Serial.print(on); Serial.print("->"); Serial.println(off);
WIRE.beginTransmission(_i2caddr);
#if ARDUINO >= 100
WIRE.write(LED0_ON_L+4*num);
WIRE.write(on);
WIRE.write(on>>8);
WIRE.write(off);
WIRE.write(off>>8);
#else
WIRE.send(LED0_ON_L+4*num);
WIRE.send((uint8_t)on);
WIRE.send((uint8_t)(on>>8));
WIRE.send((uint8_t)off);
WIRE.send((uint8_t)(off>>8));
#endif
WIRE.endTransmission();
}
uint8_t Adafruit_MS_PWMServoDriver::read8(uint8_t addr) {
WIRE.beginTransmission(_i2caddr);
#if ARDUINO >= 100
WIRE.write(addr);
#else
WIRE.send(addr);
#endif
WIRE.endTransmission();
WIRE.requestFrom((uint8_t)_i2caddr, (uint8_t)1);
#if ARDUINO >= 100
return WIRE.read();
#else
return WIRE.receive();
#endif
}
void Adafruit_MS_PWMServoDriver::write8(uint8_t addr, uint8_t d) {
WIRE.beginTransmission(_i2caddr);
#if ARDUINO >= 100
WIRE.write(addr);
WIRE.write(d);
#else
WIRE.send(addr);
WIRE.send(d);
#endif
WIRE.endTransmission();
}
@@ -0,0 +1,61 @@
/***************************************************
This is a library for our Adafruit 16-channel PWM & Servo driver
Pick one up today in the adafruit shop!
------> http://www.adafruit.com/products/815
These displays use I2C to communicate, 2 pins are required to
interface. For Arduino UNOs, thats SCL -> Analog 5, SDA -> Analog 4
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/Ladyada for Adafruit Industries.
BSD license, all text above must be included in any redistribution
****************************************************/
#ifndef _Adafruit_MS_PWMServoDriver_H
#define _Adafruit_MS_PWMServoDriver_H
#if ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
#define PCA9685_SUBADR1 0x2
#define PCA9685_SUBADR2 0x3
#define PCA9685_SUBADR3 0x4
#define PCA9685_MODE1 0x0
#define PCA9685_PRESCALE 0xFE
#define LED0_ON_L 0x6
#define LED0_ON_H 0x7
#define LED0_OFF_L 0x8
#define LED0_OFF_H 0x9
#define ALLLED_ON_L 0xFA
#define ALLLED_ON_H 0xFB
#define ALLLED_OFF_L 0xFC
#define ALLLED_OFF_H 0xFD
class Adafruit_MS_PWMServoDriver {
public:
Adafruit_MS_PWMServoDriver(uint8_t addr = 0x40);
void begin(void);
void reset(void);
void setPWMFreq(float freq);
void setPWM(uint8_t num, uint16_t on, uint16_t off);
private:
uint8_t _i2caddr;
uint8_t read8(uint8_t addr);
void write8(uint8_t addr, uint8_t d);
};
#endif
@@ -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.
+46
View File
@@ -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**
+26
View File
@@ -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.
+11
View File
@@ -0,0 +1,11 @@
language: c
sudo: false
before_install:
- source <(curl -SLs https://raw.githubusercontent.com/adafruit/travis-ci-arduino/master/install.sh)
script:
- build_main_platforms
- build_platform trinket
notifications:
email:
on_success: change
on_failure: change
File diff suppressed because it is too large Load Diff
+181
View File
@@ -0,0 +1,181 @@
/*--------------------------------------------------------------------
This file is part of the Adafruit NeoPixel library.
NeoPixel 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 3 of
the License, or (at your option) any later version.
NeoPixel 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.
You should have received a copy of the GNU Lesser General Public
License along with NeoPixel. If not, see
<http://www.gnu.org/licenses/>.
--------------------------------------------------------------------*/
#ifndef ADAFRUIT_NEOPIXEL_H
#define ADAFRUIT_NEOPIXEL_H
#if (ARDUINO >= 100)
#include <Arduino.h>
#else
#include <WProgram.h>
#include <pins_arduino.h>
#endif
// The order of primary colors in the NeoPixel data stream can vary
// among device types, manufacturers and even different revisions of
// the same item. The third parameter to the Adafruit_NeoPixel
// constructor encodes the per-pixel byte offsets of the red, green
// and blue primaries (plus white, if present) in the data stream --
// the following #defines provide an easier-to-use named version for
// each permutation. e.g. NEO_GRB indicates a NeoPixel-compatible
// device expecting three bytes per pixel, with the first byte
// containing the green value, second containing red and third
// containing blue. The in-memory representation of a chain of
// NeoPixels is the same as the data-stream order; no re-ordering of
// bytes is required when issuing data to the chain.
// Bits 5,4 of this value are the offset (0-3) from the first byte of
// a pixel to the location of the red color byte. Bits 3,2 are the
// green offset and 1,0 are the blue offset. If it is an RGBW-type
// device (supporting a white primary in addition to R,G,B), bits 7,6
// are the offset to the white byte...otherwise, bits 7,6 are set to
// the same value as 5,4 (red) to indicate an RGB (not RGBW) device.
// i.e. binary representation:
// 0bWWRRGGBB for RGBW devices
// 0bRRRRGGBB for RGB
// RGB NeoPixel permutations; white and red offsets are always same
// Offset: W R G B
#define NEO_RGB ((0 << 6) | (0 << 4) | (1 << 2) | (2))
#define NEO_RBG ((0 << 6) | (0 << 4) | (2 << 2) | (1))
#define NEO_GRB ((1 << 6) | (1 << 4) | (0 << 2) | (2))
#define NEO_GBR ((2 << 6) | (2 << 4) | (0 << 2) | (1))
#define NEO_BRG ((1 << 6) | (1 << 4) | (2 << 2) | (0))
#define NEO_BGR ((2 << 6) | (2 << 4) | (1 << 2) | (0))
// RGBW NeoPixel permutations; all 4 offsets are distinct
// Offset: W R G B
#define NEO_WRGB ((0 << 6) | (1 << 4) | (2 << 2) | (3))
#define NEO_WRBG ((0 << 6) | (1 << 4) | (3 << 2) | (2))
#define NEO_WGRB ((0 << 6) | (2 << 4) | (1 << 2) | (3))
#define NEO_WGBR ((0 << 6) | (3 << 4) | (1 << 2) | (2))
#define NEO_WBRG ((0 << 6) | (2 << 4) | (3 << 2) | (1))
#define NEO_WBGR ((0 << 6) | (3 << 4) | (2 << 2) | (1))
#define NEO_RWGB ((1 << 6) | (0 << 4) | (2 << 2) | (3))
#define NEO_RWBG ((1 << 6) | (0 << 4) | (3 << 2) | (2))
#define NEO_RGWB ((2 << 6) | (0 << 4) | (1 << 2) | (3))
#define NEO_RGBW ((3 << 6) | (0 << 4) | (1 << 2) | (2))
#define NEO_RBWG ((2 << 6) | (0 << 4) | (3 << 2) | (1))
#define NEO_RBGW ((3 << 6) | (0 << 4) | (2 << 2) | (1))
#define NEO_GWRB ((1 << 6) | (2 << 4) | (0 << 2) | (3))
#define NEO_GWBR ((1 << 6) | (3 << 4) | (0 << 2) | (2))
#define NEO_GRWB ((2 << 6) | (1 << 4) | (0 << 2) | (3))
#define NEO_GRBW ((3 << 6) | (1 << 4) | (0 << 2) | (2))
#define NEO_GBWR ((2 << 6) | (3 << 4) | (0 << 2) | (1))
#define NEO_GBRW ((3 << 6) | (2 << 4) | (0 << 2) | (1))
#define NEO_BWRG ((1 << 6) | (2 << 4) | (3 << 2) | (0))
#define NEO_BWGR ((1 << 6) | (3 << 4) | (2 << 2) | (0))
#define NEO_BRWG ((2 << 6) | (1 << 4) | (3 << 2) | (0))
#define NEO_BRGW ((3 << 6) | (1 << 4) | (2 << 2) | (0))
#define NEO_BGWR ((2 << 6) | (3 << 4) | (1 << 2) | (0))
#define NEO_BGRW ((3 << 6) | (2 << 4) | (1 << 2) | (0))
// Add NEO_KHZ400 to the color order value to indicate a 400 KHz
// device. All but the earliest v1 NeoPixels expect an 800 KHz data
// stream, this is the default if unspecified. Because flash space
// is very limited on ATtiny devices (e.g. Trinket, Gemma), v1
// NeoPixels aren't handled by default on those chips, though it can
// be enabled by removing the ifndef/endif below -- but code will be
// bigger. Conversely, can disable the NEO_KHZ400 line on other MCUs
// to remove v1 support and save a little space.
#define NEO_KHZ800 0x0000 // 800 KHz datastream
#ifndef __AVR_ATtiny85__
#define NEO_KHZ400 0x0100 // 400 KHz datastream
#endif
// If 400 KHz support is enabled, the third parameter to the constructor
// requires a 16-bit value (in order to select 400 vs 800 KHz speed).
// If only 800 KHz is enabled (as is default on ATtiny), an 8-bit value
// is sufficient to encode pixel color order, saving some space.
#ifdef NEO_KHZ400
typedef uint16_t neoPixelType;
#else
typedef uint8_t neoPixelType;
#endif
class Adafruit_NeoPixel {
public:
// Constructor: number of LEDs, pin number, LED type
Adafruit_NeoPixel(uint16_t n, uint8_t p=6, neoPixelType t=NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel(void);
~Adafruit_NeoPixel();
void
begin(void),
show(void),
setPin(uint8_t p),
setPixelColor(uint16_t n, uint8_t r, uint8_t g, uint8_t b),
setPixelColor(uint16_t n, uint8_t r, uint8_t g, uint8_t b, uint8_t w),
setPixelColor(uint16_t n, uint32_t c),
setBrightness(uint8_t),
clear(),
updateLength(uint16_t n),
updateType(neoPixelType t);
uint8_t
*getPixels(void) const,
getBrightness(void) const;
int8_t
getPin(void) { return pin; };
uint16_t
numPixels(void) const;
static uint32_t
Color(uint8_t r, uint8_t g, uint8_t b),
Color(uint8_t r, uint8_t g, uint8_t b, uint8_t w);
uint32_t
getPixelColor(uint16_t n) const;
inline bool
canShow(void) { return (micros() - endTime) >= 50L; }
private:
boolean
#ifdef NEO_KHZ400 // If 400 KHz NeoPixel support enabled...
is800KHz, // ...true if 800 KHz pixels
#endif
begun; // true if begin() previously called
uint16_t
numLEDs, // Number of RGB LEDs in strip
numBytes; // Size of 'pixels' buffer below (3 or 4 bytes/pixel)
int8_t
pin; // Output pin number (-1 if not yet set)
uint8_t
brightness,
*pixels, // Holds LED color values (3 or 4 bytes each)
rOffset, // Index of red byte within each 3- or 4-byte pixel
gOffset, // Index of green byte
bOffset, // Index of blue byte
wOffset; // Index of white byte (same as rOffset if no white)
uint32_t
endTime; // Latch timing reference
#ifdef __AVR__
volatile uint8_t
*port; // Output PORT register
uint8_t
pinMask; // Output PORT bitmask
#endif
};
#endif // ADAFRUIT_NEOPIXEL_H
+165
View File
@@ -0,0 +1,165 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
+11
View File
@@ -0,0 +1,11 @@
# Adafruit NeoPixel Library [![Build Status](https://travis-ci.org/adafruit/Adafruit_NeoPixel.svg?branch=master)](https://travis-ci.org/adafruit/Adafruit_NeoPixel)
Arduino library for controlling single-wire-based LED pixels and strip such as the [Adafruit 60 LED/meter Digital LED strip][strip], the [Adafruit FLORA RGB Smart Pixel][flora], the [Adafruit Breadboard-friendly RGB Smart Pixel][pixel], the [Adafruit NeoPixel Stick][stick], and the [Adafruit NeoPixel Shield][shield].
After downloading, rename folder to 'Adafruit_NeoPixel' and install in Arduino Libraries folder. Restart Arduino IDE, then open File->Sketchbook->Library->Adafruit_NeoPixel->strandtest sketch.
[flora]: http://adafruit.com/products/1060
[strip]: http://adafruit.com/products/1138
[pixel]: http://adafruit.com/products/1312
[stick]: http://adafruit.com/products/1426
[shield]: http://adafruit.com/products/1430
+67
View File
@@ -0,0 +1,67 @@
// This is a mash-up of the Due show() code + insights from Michael Miller's
// ESP8266 work for the NeoPixelBus library: github.com/Makuna/NeoPixelBus
// Needs to be a separate .c file to enforce ICACHE_RAM_ATTR execution.
#ifdef ESP8266
#include <Arduino.h>
#include <eagle_soc.h>
static uint32_t _getCycleCount(void) __attribute__((always_inline));
static inline uint32_t _getCycleCount(void) {
uint32_t ccount;
__asm__ __volatile__("rsr %0,ccount":"=a" (ccount));
return ccount;
}
void ICACHE_RAM_ATTR espShow(
uint8_t pin, uint8_t *pixels, uint32_t numBytes, boolean is800KHz) {
#define CYCLES_800_T0H (F_CPU / 2500000) // 0.4us
#define CYCLES_800_T1H (F_CPU / 1250000) // 0.8us
#define CYCLES_800 (F_CPU / 800000) // 1.25us per bit
#define CYCLES_400_T0H (F_CPU / 2000000) // 0.5uS
#define CYCLES_400_T1H (F_CPU / 833333) // 1.2us
#define CYCLES_400 (F_CPU / 400000) // 2.5us per bit
uint8_t *p, *end, pix, mask;
uint32_t t, time0, time1, period, c, startTime, pinMask;
pinMask = _BV(pin);
p = pixels;
end = p + numBytes;
pix = *p++;
mask = 0x80;
startTime = 0;
#ifdef NEO_KHZ400
if(is800KHz) {
#endif
time0 = CYCLES_800_T0H;
time1 = CYCLES_800_T1H;
period = CYCLES_800;
#ifdef NEO_KHZ400
} else { // 400 KHz bitstream
time0 = CYCLES_400_T0H;
time1 = CYCLES_400_T1H;
period = CYCLES_400;
}
#endif
for(t = time0;; t = time0) {
if(pix & mask) t = time1; // Bit high duration
while(((c = _getCycleCount()) - startTime) < period); // Wait for bit start
GPIO_REG_WRITE(GPIO_OUT_W1TS_ADDRESS, pinMask); // Set high
startTime = c; // Save start time
while(((c = _getCycleCount()) - startTime) < t); // Wait high duration
GPIO_REG_WRITE(GPIO_OUT_W1TC_ADDRESS, pinMask); // Set low
if(!(mask >>= 1)) { // Next bit/byte
if(p >= end) break;
pix = *p++;
mask = 0x80;
}
}
while((_getCycleCount() - startTime) < period); // Wait for last bit
}
#endif // ESP8266
@@ -0,0 +1,263 @@
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif
#define PIN 6
#define NUM_LEDS 60
#define BRIGHTNESS 50
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LEDS, PIN, NEO_GRBW + NEO_KHZ800);
int gamma[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2,
2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5,
5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10,
10, 10, 11, 11, 11, 12, 12, 13, 13, 13, 14, 14, 15, 15, 16, 16,
17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 24, 24, 25,
25, 26, 27, 27, 28, 29, 29, 30, 31, 32, 32, 33, 34, 35, 35, 36,
37, 38, 39, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 50,
51, 52, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 66, 67, 68,
69, 70, 72, 73, 74, 75, 77, 78, 79, 81, 82, 83, 85, 86, 87, 89,
90, 92, 93, 95, 96, 98, 99,101,102,104,105,107,109,110,112,114,
115,117,119,120,122,124,126,127,129,131,133,135,137,138,140,142,
144,146,148,150,152,154,156,158,160,162,164,167,169,171,173,175,
177,180,182,184,186,189,191,193,196,198,200,203,205,208,210,213,
215,218,220,223,225,228,231,233,236,239,241,244,247,249,252,255 };
void setup() {
Serial.begin(115200);
// This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket
#if defined (__AVR_ATtiny85__)
if (F_CPU == 16000000) clock_prescale_set(clock_div_1);
#endif
// End of trinket special code
strip.setBrightness(BRIGHTNESS);
strip.begin();
strip.show(); // Initialize all pixels to 'off'
}
void loop() {
// Some example procedures showing how to display to the pixels:
colorWipe(strip.Color(255, 0, 0), 50); // Red
colorWipe(strip.Color(0, 255, 0), 50); // Green
colorWipe(strip.Color(0, 0, 255), 50); // Blue
colorWipe(strip.Color(0, 0, 0, 255), 50); // White
whiteOverRainbow(20,75,5);
pulseWhite(5);
// fullWhite();
// delay(2000);
rainbowFade2White(3,3,1);
}
// Fill the dots one after the other with a color
void colorWipe(uint32_t c, uint8_t wait) {
for(uint16_t i=0; i<strip.numPixels(); i++) {
strip.setPixelColor(i, c);
strip.show();
delay(wait);
}
}
void pulseWhite(uint8_t wait) {
for(int j = 0; j < 256 ; j++){
for(uint16_t i=0; i<strip.numPixels(); i++) {
strip.setPixelColor(i, strip.Color(0,0,0, gamma[j] ) );
}
delay(wait);
strip.show();
}
for(int j = 255; j >= 0 ; j--){
for(uint16_t i=0; i<strip.numPixels(); i++) {
strip.setPixelColor(i, strip.Color(0,0,0, gamma[j] ) );
}
delay(wait);
strip.show();
}
}
void rainbowFade2White(uint8_t wait, int rainbowLoops, int whiteLoops) {
float fadeMax = 100.0;
int fadeVal = 0;
uint32_t wheelVal;
int redVal, greenVal, blueVal;
for(int k = 0 ; k < rainbowLoops ; k ++){
for(int j=0; j<256; j++) { // 5 cycles of all colors on wheel
for(int i=0; i< strip.numPixels(); i++) {
wheelVal = Wheel(((i * 256 / strip.numPixels()) + j) & 255);
redVal = red(wheelVal) * float(fadeVal/fadeMax);
greenVal = green(wheelVal) * float(fadeVal/fadeMax);
blueVal = blue(wheelVal) * float(fadeVal/fadeMax);
strip.setPixelColor( i, strip.Color( redVal, greenVal, blueVal ) );
}
//First loop, fade in!
if(k == 0 && fadeVal < fadeMax-1) {
fadeVal++;
}
//Last loop, fade out!
else if(k == rainbowLoops - 1 && j > 255 - fadeMax ){
fadeVal--;
}
strip.show();
delay(wait);
}
}
delay(500);
for(int k = 0 ; k < whiteLoops ; k ++){
for(int j = 0; j < 256 ; j++){
for(uint16_t i=0; i < strip.numPixels(); i++) {
strip.setPixelColor(i, strip.Color(0,0,0, gamma[j] ) );
}
strip.show();
}
delay(2000);
for(int j = 255; j >= 0 ; j--){
for(uint16_t i=0; i < strip.numPixels(); i++) {
strip.setPixelColor(i, strip.Color(0,0,0, gamma[j] ) );
}
strip.show();
}
}
delay(500);
}
void whiteOverRainbow(uint8_t wait, uint8_t whiteSpeed, uint8_t whiteLength ) {
if(whiteLength >= strip.numPixels()) whiteLength = strip.numPixels() - 1;
int head = whiteLength - 1;
int tail = 0;
int loops = 3;
int loopNum = 0;
static unsigned long lastTime = 0;
while(true){
for(int j=0; j<256; j++) {
for(uint16_t i=0; i<strip.numPixels(); i++) {
if((i >= tail && i <= head) || (tail > head && i >= tail) || (tail > head && i <= head) ){
strip.setPixelColor(i, strip.Color(0,0,0, 255 ) );
}
else{
strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255));
}
}
if(millis() - lastTime > whiteSpeed) {
head++;
tail++;
if(head == strip.numPixels()){
loopNum++;
}
lastTime = millis();
}
if(loopNum == loops) return;
head%=strip.numPixels();
tail%=strip.numPixels();
strip.show();
delay(wait);
}
}
}
void fullWhite() {
for(uint16_t i=0; i<strip.numPixels(); i++) {
strip.setPixelColor(i, strip.Color(0,0,0, 255 ) );
}
strip.show();
}
// Slightly different, this makes the rainbow equally distributed throughout
void rainbowCycle(uint8_t wait) {
uint16_t i, j;
for(j=0; j<256 * 5; j++) { // 5 cycles of all colors on wheel
for(i=0; i< strip.numPixels(); i++) {
strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255));
}
strip.show();
delay(wait);
}
}
void rainbow(uint8_t wait) {
uint16_t i, j;
for(j=0; j<256; j++) {
for(i=0; i<strip.numPixels(); i++) {
strip.setPixelColor(i, Wheel((i+j) & 255));
}
strip.show();
delay(wait);
}
}
// Input a value 0 to 255 to get a color value.
// The colours are a transition r - g - b - back to r.
uint32_t Wheel(byte WheelPos) {
WheelPos = 255 - WheelPos;
if(WheelPos < 85) {
return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3,0);
}
if(WheelPos < 170) {
WheelPos -= 85;
return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3,0);
}
WheelPos -= 170;
return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0,0);
}
uint8_t red(uint32_t c) {
return (c >> 8);
}
uint8_t green(uint32_t c) {
return (c >> 16);
}
uint8_t blue(uint32_t c) {
return (c);
}
@@ -0,0 +1,165 @@
// This is a demonstration on how to use an input device to trigger changes on your neo pixels.
// You should wire a momentary push button to connect from ground to a digital IO pin. When you
// press the button it will change to a new pixel animation. Note that you need to press the
// button once to start the first animation!
#include <Adafruit_NeoPixel.h>
#define BUTTON_PIN 2 // Digital IO pin connected to the button. This will be
// driven with a pull-up resistor so the switch should
// pull the pin to ground momentarily. On a high -> low
// transition the button press logic will execute.
#define PIXEL_PIN 6 // Digital IO pin connected to the NeoPixels.
#define PIXEL_COUNT 16
// Parameter 1 = number of pixels in strip, neopixel stick has 8
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
// NEO_RGB Pixels are wired for RGB bitstream
// NEO_GRB Pixels are wired for GRB bitstream, correct for neopixel stick
// NEO_KHZ400 400 KHz bitstream (e.g. FLORA pixels)
// NEO_KHZ800 800 KHz bitstream (e.g. High Density LED strip), correct for neopixel stick
Adafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL_COUNT, PIXEL_PIN, NEO_GRB + NEO_KHZ800);
bool oldState = HIGH;
int showType = 0;
void setup() {
pinMode(BUTTON_PIN, INPUT_PULLUP);
strip.begin();
strip.show(); // Initialize all pixels to 'off'
}
void loop() {
// Get current button state.
bool newState = digitalRead(BUTTON_PIN);
// Check if state changed from high to low (button press).
if (newState == LOW && oldState == HIGH) {
// Short delay to debounce button.
delay(20);
// Check if button is still low after debounce.
newState = digitalRead(BUTTON_PIN);
if (newState == LOW) {
showType++;
if (showType > 9)
showType=0;
startShow(showType);
}
}
// Set the last button state to the old state.
oldState = newState;
}
void startShow(int i) {
switch(i){
case 0: colorWipe(strip.Color(0, 0, 0), 50); // Black/off
break;
case 1: colorWipe(strip.Color(255, 0, 0), 50); // Red
break;
case 2: colorWipe(strip.Color(0, 255, 0), 50); // Green
break;
case 3: colorWipe(strip.Color(0, 0, 255), 50); // Blue
break;
case 4: theaterChase(strip.Color(127, 127, 127), 50); // White
break;
case 5: theaterChase(strip.Color(127, 0, 0), 50); // Red
break;
case 6: theaterChase(strip.Color( 0, 0, 127), 50); // Blue
break;
case 7: rainbow(20);
break;
case 8: rainbowCycle(20);
break;
case 9: theaterChaseRainbow(50);
break;
}
}
// Fill the dots one after the other with a color
void colorWipe(uint32_t c, uint8_t wait) {
for(uint16_t i=0; i<strip.numPixels(); i++) {
strip.setPixelColor(i, c);
strip.show();
delay(wait);
}
}
void rainbow(uint8_t wait) {
uint16_t i, j;
for(j=0; j<256; j++) {
for(i=0; i<strip.numPixels(); i++) {
strip.setPixelColor(i, Wheel((i+j) & 255));
}
strip.show();
delay(wait);
}
}
// Slightly different, this makes the rainbow equally distributed throughout
void rainbowCycle(uint8_t wait) {
uint16_t i, j;
for(j=0; j<256*5; j++) { // 5 cycles of all colors on wheel
for(i=0; i< strip.numPixels(); i++) {
strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255));
}
strip.show();
delay(wait);
}
}
//Theatre-style crawling lights.
void theaterChase(uint32_t c, uint8_t wait) {
for (int j=0; j<10; j++) { //do 10 cycles of chasing
for (int q=0; q < 3; q++) {
for (int i=0; i < strip.numPixels(); i=i+3) {
strip.setPixelColor(i+q, c); //turn every third pixel on
}
strip.show();
delay(wait);
for (int i=0; i < strip.numPixels(); i=i+3) {
strip.setPixelColor(i+q, 0); //turn every third pixel off
}
}
}
}
//Theatre-style crawling lights with rainbow effect
void theaterChaseRainbow(uint8_t wait) {
for (int j=0; j < 256; j++) { // cycle all 256 colors in the wheel
for (int q=0; q < 3; q++) {
for (int i=0; i < strip.numPixels(); i=i+3) {
strip.setPixelColor(i+q, Wheel( (i+j) % 255)); //turn every third pixel on
}
strip.show();
delay(wait);
for (int i=0; i < strip.numPixels(); i=i+3) {
strip.setPixelColor(i+q, 0); //turn every third pixel off
}
}
}
}
// Input a value 0 to 255 to get a color value.
// The colours are a transition r - g - b - back to r.
uint32_t Wheel(byte WheelPos) {
WheelPos = 255 - WheelPos;
if(WheelPos < 85) {
return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
}
if(WheelPos < 170) {
WheelPos -= 85;
return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
}
WheelPos -= 170;
return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
}
@@ -0,0 +1,47 @@
// NeoPixel Ring simple sketch (c) 2013 Shae Erisson
// released under the GPLv3 license to match the rest of the AdaFruit NeoPixel library
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif
// Which pin on the Arduino is connected to the NeoPixels?
// On a Trinket or Gemma we suggest changing this to 1
#define PIN 6
// How many NeoPixels are attached to the Arduino?
#define NUMPIXELS 16
// When we setup the NeoPixel library, we tell it how many pixels, and which pin to use to send signals.
// Note that for older NeoPixel strips you might need to change the third parameter--see the strandtest
// example for more information on possible values.
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
int delayval = 500; // delay for half a second
void setup() {
// This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket
#if defined (__AVR_ATtiny85__)
if (F_CPU == 16000000) clock_prescale_set(clock_div_1);
#endif
// End of trinket special code
pixels.begin(); // This initializes the NeoPixel library.
}
void loop() {
// For a set of NeoPixels the first NeoPixel is 0, second is 1, all the way up to the count of pixels minus one.
for(int i=0;i<NUMPIXELS;i++){
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
pixels.setPixelColor(i, pixels.Color(0,150,0)); // Moderately bright green color.
pixels.show(); // This sends the updated pixel color to the hardware.
delay(delayval); // Delay for a period of time (in milliseconds).
}
}
@@ -0,0 +1,134 @@
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif
#define PIN 6
// Parameter 1 = number of pixels in strip
// Parameter 2 = Arduino pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)
// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)
// NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products)
Adafruit_NeoPixel strip = Adafruit_NeoPixel(60, PIN, NEO_GRB + NEO_KHZ800);
// IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across
// pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input
// and minimize distance between Arduino and first pixel. Avoid connecting
// on a live circuit...if you must, connect GND first.
void setup() {
// This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket
#if defined (__AVR_ATtiny85__)
if (F_CPU == 16000000) clock_prescale_set(clock_div_1);
#endif
// End of trinket special code
strip.begin();
strip.show(); // Initialize all pixels to 'off'
}
void loop() {
// Some example procedures showing how to display to the pixels:
colorWipe(strip.Color(255, 0, 0), 50); // Red
colorWipe(strip.Color(0, 255, 0), 50); // Green
colorWipe(strip.Color(0, 0, 255), 50); // Blue
//colorWipe(strip.Color(0, 0, 0, 255), 50); // White RGBW
// Send a theater pixel chase in...
theaterChase(strip.Color(127, 127, 127), 50); // White
theaterChase(strip.Color(127, 0, 0), 50); // Red
theaterChase(strip.Color(0, 0, 127), 50); // Blue
rainbow(20);
rainbowCycle(20);
theaterChaseRainbow(50);
}
// Fill the dots one after the other with a color
void colorWipe(uint32_t c, uint8_t wait) {
for(uint16_t i=0; i<strip.numPixels(); i++) {
strip.setPixelColor(i, c);
strip.show();
delay(wait);
}
}
void rainbow(uint8_t wait) {
uint16_t i, j;
for(j=0; j<256; j++) {
for(i=0; i<strip.numPixels(); i++) {
strip.setPixelColor(i, Wheel((i+j) & 255));
}
strip.show();
delay(wait);
}
}
// Slightly different, this makes the rainbow equally distributed throughout
void rainbowCycle(uint8_t wait) {
uint16_t i, j;
for(j=0; j<256*5; j++) { // 5 cycles of all colors on wheel
for(i=0; i< strip.numPixels(); i++) {
strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255));
}
strip.show();
delay(wait);
}
}
//Theatre-style crawling lights.
void theaterChase(uint32_t c, uint8_t wait) {
for (int j=0; j<10; j++) { //do 10 cycles of chasing
for (int q=0; q < 3; q++) {
for (uint16_t i=0; i < strip.numPixels(); i=i+3) {
strip.setPixelColor(i+q, c); //turn every third pixel on
}
strip.show();
delay(wait);
for (uint16_t i=0; i < strip.numPixels(); i=i+3) {
strip.setPixelColor(i+q, 0); //turn every third pixel off
}
}
}
}
//Theatre-style crawling lights with rainbow effect
void theaterChaseRainbow(uint8_t wait) {
for (int j=0; j < 256; j++) { // cycle all 256 colors in the wheel
for (int q=0; q < 3; q++) {
for (uint16_t i=0; i < strip.numPixels(); i=i+3) {
strip.setPixelColor(i+q, Wheel( (i+j) % 255)); //turn every third pixel on
}
strip.show();
delay(wait);
for (uint16_t i=0; i < strip.numPixels(); i=i+3) {
strip.setPixelColor(i+q, 0); //turn every third pixel off
}
}
}
}
// Input a value 0 to 255 to get a color value.
// The colours are a transition r - g - b - back to r.
uint32_t Wheel(byte WheelPos) {
WheelPos = 255 - WheelPos;
if(WheelPos < 85) {
return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
}
if(WheelPos < 170) {
WheelPos -= 85;
return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
}
WheelPos -= 170;
return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
}
+29
View File
@@ -0,0 +1,29 @@
#######################################
# Syntax Coloring Map For Adafruit_NeoPixel
#######################################
# Class
#######################################
Adafruit_NeoPixel KEYWORD1
#######################################
# Methods and Functions
#######################################
setPixelColor KEYWORD2
setPin KEYWORD2
setBrightness KEYWORD2
numPixels KEYWORD2
getPixelColor KEYWORD2
Color KEYWORD2
#######################################
# Constants
#######################################
NEO_GRB LITERAL1
NEO_COLMASK LITERAL1
NEO_KHZ800 LITERAL1
NEO_SPDMASK LITERAL1
NEO_RGB LITERAL1
NEO_KHZ400 LITERAL1
+9
View File
@@ -0,0 +1,9 @@
name=Adafruit NeoPixel
version=1.0.6
author=Adafruit
maintainer=Adafruit <info@adafruit.com>
sentence=Arduino library for controlling single-wire-based LED pixels and strip.
paragraph=Arduino library for controlling single-wire-based LED pixels and strip.
category=Display
url=https://github.com/adafruit/Adafruit_NeoPixel
architectures=*
+154
View File
@@ -0,0 +1,154 @@
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software< /span>
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* Update by K. Townsend (Adafruit Industries) for lighter typedefs, and
* extended sensor support to include color, voltage and current */
#ifndef _ADAFRUIT_SENSOR_H
#define _ADAFRUIT_SENSOR_H
#if ARDUINO >= 100
#include "Arduino.h"
#include "Print.h"
#else
#include "WProgram.h"
#endif
/* Intentionally modeled after sensors.h in the Android API:
* https://github.com/android/platform_hardware_libhardware/blob/master/include/hardware/sensors.h */
/* Constants */
#define SENSORS_GRAVITY_EARTH (9.80665F) /**< Earth's gravity in m/s^2 */
#define SENSORS_GRAVITY_MOON (1.6F) /**< The moon's gravity in m/s^2 */
#define SENSORS_GRAVITY_SUN (275.0F) /**< The sun's gravity in m/s^2 */
#define SENSORS_GRAVITY_STANDARD (SENSORS_GRAVITY_EARTH)
#define SENSORS_MAGFIELD_EARTH_MAX (60.0F) /**< Maximum magnetic field on Earth's surface */
#define SENSORS_MAGFIELD_EARTH_MIN (30.0F) /**< Minimum magnetic field on Earth's surface */
#define SENSORS_PRESSURE_SEALEVELHPA (1013.25F) /**< Average sea level pressure is 1013.25 hPa */
#define SENSORS_DPS_TO_RADS (0.017453293F) /**< Degrees/s to rad/s multiplier */
#define SENSORS_GAUSS_TO_MICROTESLA (100) /**< Gauss to micro-Tesla multiplier */
/** Sensor types */
typedef enum
{
SENSOR_TYPE_ACCELEROMETER = (1), /**< Gravity + linear acceleration */
SENSOR_TYPE_MAGNETIC_FIELD = (2),
SENSOR_TYPE_ORIENTATION = (3),
SENSOR_TYPE_GYROSCOPE = (4),
SENSOR_TYPE_LIGHT = (5),
SENSOR_TYPE_PRESSURE = (6),
SENSOR_TYPE_PROXIMITY = (8),
SENSOR_TYPE_GRAVITY = (9),
SENSOR_TYPE_LINEAR_ACCELERATION = (10), /**< Acceleration not including gravity */
SENSOR_TYPE_ROTATION_VECTOR = (11),
SENSOR_TYPE_RELATIVE_HUMIDITY = (12),
SENSOR_TYPE_AMBIENT_TEMPERATURE = (13),
SENSOR_TYPE_VOLTAGE = (15),
SENSOR_TYPE_CURRENT = (16),
SENSOR_TYPE_COLOR = (17)
} sensors_type_t;
/** struct sensors_vec_s is used to return a vector in a common format. */
typedef struct {
union {
float v[3];
struct {
float x;
float y;
float z;
};
/* Orientation sensors */
struct {
float roll; /**< Rotation around the longitudinal axis (the plane body, 'X axis'). Roll is positive and increasing when moving downward. -90°<=roll<=90° */
float pitch; /**< Rotation around the lateral axis (the wing span, 'Y axis'). Pitch is positive and increasing when moving upwards. -180°<=pitch<=180°) */
float heading; /**< Angle between the longitudinal axis (the plane body) and magnetic north, measured clockwise when viewing from the top of the device. 0-359° */
};
};
int8_t status;
uint8_t reserved[3];
} sensors_vec_t;
/** struct sensors_color_s is used to return color data in a common format. */
typedef struct {
union {
float c[3];
/* RGB color space */
struct {
float r; /**< Red component */
float g; /**< Green component */
float b; /**< Blue component */
};
};
uint32_t rgba; /**< 24-bit RGBA value */
} sensors_color_t;
/* Sensor event (36 bytes) */
/** struct sensor_event_s is used to provide a single sensor event in a common format. */
typedef struct
{
int32_t version; /**< must be sizeof(struct sensors_event_t) */
int32_t sensor_id; /**< unique sensor identifier */
int32_t type; /**< sensor type */
int32_t reserved0; /**< reserved */
int32_t timestamp; /**< time is in milliseconds */
union
{
float data[4];
sensors_vec_t acceleration; /**< acceleration values are in meter per second per second (m/s^2) */
sensors_vec_t magnetic; /**< magnetic vector values are in micro-Tesla (uT) */
sensors_vec_t orientation; /**< orientation values are in degrees */
sensors_vec_t gyro; /**< gyroscope values are in rad/s */
float temperature; /**< temperature is in degrees centigrade (Celsius) */
float distance; /**< distance in centimeters */
float light; /**< light in SI lux units */
float pressure; /**< pressure in hectopascal (hPa) */
float relative_humidity; /**< relative humidity in percent */
float current; /**< current in milliamps (mA) */
float voltage; /**< voltage in volts (V) */
sensors_color_t color; /**< color in RGB component values */
};
} sensors_event_t;
/* Sensor details (40 bytes) */
/** struct sensor_s is used to describe basic information about a specific sensor. */
typedef struct
{
char name[12]; /**< sensor name */
int32_t version; /**< version of the hardware + driver */
int32_t sensor_id; /**< unique sensor identifier */
int32_t type; /**< this sensor's type (ex. SENSOR_TYPE_LIGHT) */
float max_value; /**< maximum value of this sensor's value in SI units */
float min_value; /**< minimum value of this sensor's value in SI units */
float resolution; /**< smallest difference between two values reported by this sensor */
int32_t min_delay; /**< min delay in microseconds between events. zero = not a constant rate */
} sensor_t;
class Adafruit_Sensor {
public:
// Constructor(s)
Adafruit_Sensor() {}
virtual ~Adafruit_Sensor() {}
// These must be defined by the subclass
virtual void enableAutoRange(bool enabled) {};
virtual bool getEvent(sensors_event_t*) = 0;
virtual void getSensor(sensor_t*) = 0;
private:
bool _autoRange;
};
#endif
+221
View File
@@ -0,0 +1,221 @@
# Adafruit Unified Sensor Driver #
Many small embedded systems exist to collect data from sensors, analyse the data, and either take an appropriate action or send that sensor data to another system for processing.
One of the many challenges of embedded systems design is the fact that parts you used today may be out of production tomorrow, or system requirements may change and you may need to choose a different sensor down the road.
Creating new drivers is a relatively easy task, but integrating them into existing systems is both error prone and time consuming since sensors rarely use the exact same units of measurement.
By reducing all data to a single **sensors\_event\_t** 'type' and settling on specific, **standardised SI units** for each sensor family the same sensor types return values that are comparable with any other similar sensor. This enables you to switch sensor models with very little impact on the rest of the system, which can help mitigate some of the risks and problems of sensor availability and code reuse.
The unified sensor abstraction layer is also useful for data-logging and data-transmission since you only have one well-known type to log or transmit over the air or wire.
## Unified Sensor Drivers ##
The following drivers are based on the Adafruit Unified Sensor Driver:
**Accelerometers**
- [Adafruit\_ADXL345](https://github.com/adafruit/Adafruit_ADXL345)
- [Adafruit\_LSM303DLHC](https://github.com/adafruit/Adafruit_LSM303DLHC)
- [Adafruit\_MMA8451\_Library](https://github.com/adafruit/Adafruit_MMA8451_Library)
**Gyroscope**
- [Adafruit\_L3GD20\_U](https://github.com/adafruit/Adafruit_L3GD20_U)
**Light**
- [Adafruit\_TSL2561](https://github.com/adafruit/Adafruit_TSL2561)
- [Adafruit\_TSL2591\_Library](https://github.com/adafruit/Adafruit_TSL2591_Library)
**Magnetometers**
- [Adafruit\_LSM303DLHC](https://github.com/adafruit/Adafruit_LSM303DLHC)
- [Adafruit\_HMC5883\_Unified](https://github.com/adafruit/Adafruit_HMC5883_Unified)
**Barometric Pressure**
- [Adafruit\_BMP085\_Unified](https://github.com/adafruit/Adafruit_BMP085_Unified)
- [Adafruit\_BMP183\_Unified\_Library](https://github.com/adafruit/Adafruit_BMP183_Unified_Library)
**Humidity & Temperature**
- [DHT-sensor-library](https://github.com/adafruit/DHT-sensor-library)
**Orientation**
- [Adafruit_BNO055](https://github.com/adafruit/Adafruit_BNO055)
## How Does it Work? ##
Any driver that supports the Adafruit unified sensor abstraction layer will implement the Adafruit\_Sensor base class. There are two main typedefs and one enum defined in Adafruit_Sensor.h that are used to 'abstract' away the sensor details and values:
**Sensor Types (sensors\_type\_t)**
These pre-defined sensor types are used to properly handle the two related typedefs below, and allows us determine what types of units the sensor uses, etc.
```
/** Sensor types */
typedef enum
{
SENSOR_TYPE_ACCELEROMETER = (1),
SENSOR_TYPE_MAGNETIC_FIELD = (2),
SENSOR_TYPE_ORIENTATION = (3),
SENSOR_TYPE_GYROSCOPE = (4),
SENSOR_TYPE_LIGHT = (5),
SENSOR_TYPE_PRESSURE = (6),
SENSOR_TYPE_PROXIMITY = (8),
SENSOR_TYPE_GRAVITY = (9),
SENSOR_TYPE_LINEAR_ACCELERATION = (10),
SENSOR_TYPE_ROTATION_VECTOR = (11),
SENSOR_TYPE_RELATIVE_HUMIDITY = (12),
SENSOR_TYPE_AMBIENT_TEMPERATURE = (13),
SENSOR_TYPE_VOLTAGE = (15),
SENSOR_TYPE_CURRENT = (16),
SENSOR_TYPE_COLOR = (17)
} sensors_type_t;
```
**Sensor Details (sensor\_t)**
This typedef describes the specific capabilities of this sensor, and allows us to know what sensor we are using beneath the abstraction layer.
```
/* Sensor details (40 bytes) */
/** struct sensor_s is used to describe basic information about a specific sensor. */
typedef struct
{
char name[12];
int32_t version;
int32_t sensor_id;
int32_t type;
float max_value;
float min_value;
float resolution;
int32_t min_delay;
} sensor_t;
```
The individual fields are intended to be used as follows:
- **name**: The sensor name or ID, up to a maximum of twelve characters (ex. "MPL115A2")
- **version**: The version of the sensor HW and the driver to allow us to differentiate versions of the board or driver
- **sensor\_id**: A unique sensor identifier that is used to differentiate this specific sensor instance from any others that are present on the system or in the sensor network
- **type**: The sensor type, based on **sensors\_type\_t** in sensors.h
- **max\_value**: The maximum value that this sensor can return (in the appropriate SI unit)
- **min\_value**: The minimum value that this sensor can return (in the appropriate SI unit)
- **resolution**: The smallest difference between two values that this sensor can report (in the appropriate SI unit)
- **min\_delay**: The minimum delay in microseconds between two sensor events, or '0' if there is no constant sensor rate
**Sensor Data/Events (sensors\_event\_t)**
This typedef is used to return sensor data from any sensor supported by the abstraction layer, using standard SI units and scales.
```
/* Sensor event (36 bytes) */
/** struct sensor_event_s is used to provide a single sensor event in a common format. */
typedef struct
{
int32_t version;
int32_t sensor_id;
int32_t type;
int32_t reserved0;
int32_t timestamp;
union
{
float data[4];
sensors_vec_t acceleration;
sensors_vec_t magnetic;
sensors_vec_t orientation;
sensors_vec_t gyro;
float temperature;
float distance;
float light;
float pressure;
float relative_humidity;
float current;
float voltage;
sensors_color_t color;
};
} sensors_event_t;
```
It includes the following fields:
- **version**: Contain 'sizeof(sensors\_event\_t)' to identify which version of the API we're using in case this changes in the future
- **sensor\_id**: A unique sensor identifier that is used to differentiate this specific sensor instance from any others that are present on the system or in the sensor network (must match the sensor\_id value in the corresponding sensor\_t enum above!)
- **type**: the sensor type, based on **sensors\_type\_t** in sensors.h
- **timestamp**: time in milliseconds when the sensor value was read
- **data[4]**: An array of four 32-bit values that allows us to encapsulate any type of sensor data via a simple union (further described below)
**Required Functions**
In addition to the two standard types and the sensor type enum, all drivers based on Adafruit_Sensor must also implement the following two functions:
```
bool getEvent(sensors_event_t*);
```
Calling this function will populate the supplied sensors\_event\_t reference with the latest available sensor data. You should call this function as often as you want to update your data.
```
void getSensor(sensor_t*);
```
Calling this function will provide some basic information about the sensor (the sensor name, driver version, min and max values, etc.
**Standardised SI values for sensors\_event\_t**
A key part of the abstraction layer is the standardisation of values on SI units of a particular scale, which is accomplished via the data[4] union in sensors\_event\_t above. This 16 byte union includes fields for each main sensor type, and uses the following SI units and scales:
- **acceleration**: values are in **meter per second per second** (m/s^2)
- **magnetic**: values are in **micro-Tesla** (uT)
- **orientation**: values are in **degrees**
- **gyro**: values are in **rad/s**
- **temperature**: values in **degrees centigrade** (Celsius)
- **distance**: values are in **centimeters**
- **light**: values are in **SI lux** units
- **pressure**: values are in **hectopascal** (hPa)
- **relative\_humidity**: values are in **percent**
- **current**: values are in **milliamps** (mA)
- **voltage**: values are in **volts** (V)
- **color**: values are in 0..1.0 RGB channel luminosity and 32-bit RGBA format
## The Unified Driver Abstraction Layer in Practice ##
Using the unified sensor abstraction layer is relatively easy once a compliant driver has been created.
Every compliant sensor can now be read using a single, well-known 'type' (sensors\_event\_t), and there is a standardised way of interrogating a sensor about its specific capabilities (via sensor\_t).
An example of reading the [TSL2561](https://github.com/adafruit/Adafruit_TSL2561) light sensor can be seen below:
```
Adafruit_TSL2561 tsl = Adafruit_TSL2561(TSL2561_ADDR_FLOAT, 12345);
...
/* Get a new sensor event */
sensors_event_t event;
tsl.getEvent(&event);
/* Display the results (light is measured in lux) */
if (event.light)
{
Serial.print(event.light); Serial.println(" lux");
}
else
{
/* If event.light = 0 lux the sensor is probably saturated
and no reliable data could be generated! */
Serial.println("Sensor overload");
}
```
Similarly, we can get the basic technical capabilities of this sensor with the following code:
```
sensor_t sensor;
sensor_t sensor;
tsl.getSensor(&sensor);
/* Display the sensor details */
Serial.println("------------------------------------");
Serial.print ("Sensor: "); Serial.println(sensor.name);
Serial.print ("Driver Ver: "); Serial.println(sensor.version);
Serial.print ("Unique ID: "); Serial.println(sensor.sensor_id);
Serial.print ("Max Value: "); Serial.print(sensor.max_value); Serial.println(" lux");
Serial.print ("Min Value: "); Serial.print(sensor.min_value); Serial.println(" lux");
Serial.print ("Resolution: "); Serial.print(sensor.resolution); Serial.println(" lux");
Serial.println("------------------------------------");
Serial.println("");
```
+9
View File
@@ -0,0 +1,9 @@
name=Adafruit Unified Sensor
version=1.0.2
author=Adafruit <info@adafruit.com>
maintainer=Adafruit <info@adafruit.com>
sentence=Required for all Adafruit Unified Sensor based libraries.
paragraph=A unified sensor abstraction layer used by many Adafruit sensor libraries.
category=Sensors
url=https://github.com/adafruit/Adafruit_Sensor
architectures=*
+46
View File
@@ -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**

Some files were not shown because too many files have changed in this diff Show More