Commit Graph
38 Commits
Author SHA1 Message Date
TD-er 4917ff92e3 [MQTT-TLS] Improve stability of MQTT connection while serving JSON pages 2024-09-30 23:01:11 +02:00
TD-er 3685d15211 [MQTT] Fix disconnect when broker sends keepalive ping before client 2024-06-24 11:02:54 +02:00
TD-er dd8f4e0a65 [Memory] Make special memory allocations more robust 2024-06-23 14:22:00 +02:00
TD-er 0cfa99dbd2 [MQTT] Set timeout also for connecting to the MQTT broker 2024-06-23 12:06:09 +02:00
TD-er 77efc6b4d5 [MQTT] Send keep-alive ping at 2/3rd of MQTT_KEEPALIVE 2024-06-22 22:11:19 +02:00
TD-er 1f9118d2b0 [MQTT] Fix some extreme timeouts when broker is unresponsive (#5075)
Fixes: #5075
2024-06-22 12:52:20 +02:00
TD-er 36f873d4fb [OLED Framed] Use double buffer for update only changed pixels 2023-11-20 00:59:26 +01:00
TD-er 71067fa29a [Cleanup] Free up 1k of RAM when not using MQTT controller
Only allocate this buffer when really used.
2023-11-19 16:09:24 +01:00
TD-er 7bccf03f11 [2nd Heap] Tweak 2nd heap stability + set as ESP8266 regular 2023-11-18 01:46:12 +01:00
TD-er 4ed72ed0c7 [RAM] Move MQTT buffer and OLED frame buffer to 2nd heap 2023-11-17 17:35:35 +01:00
TD-er 541f3822d1 [PubSubClient] Speedup publish calls by direct writing to client 2023-01-04 23:23:40 +01:00
TD-er 0990d8c6f8 [Cache Reader] Add sending task names + fix upload all files 2022-12-29 10:51:59 +01:00
TD-er 4365836085 [Cleanup] Speedup dumpcache page serving 2022-12-20 13:56:54 +01:00
TD-er 4b20300ab5 [PubSubClient] Apply fixes related to crashes on connect to broker
Patches suggested in several PRs on original pubsubclient repository.
2021-05-18 21:51:43 +02:00
TD-er 40d347936c [MQTT] Fix rejecting QoS=0 messages with 0 or 1 byte length 2021-02-20 14:52:31 +01:00
TD-er bdef2b3ad9 [MQTT] PubSubClient checks when callback + publish happen simultaneous
After discussion with @arjenhiemstra on issue: https://github.com/knolleary/pubsubclient/issues/832
2021-02-20 02:07:11 +01:00
Gijs Noorlander 8d5b44ca1c [MQTT] Fix change in client.connected() behavior for pubsubclient
See this issue where the changes in behavior for wificlient.connected() is discussed: https://github.com/esp8266/Arduino/issues/6701

A change dating back to April 2018 ( https://github.com/esp8266/Arduino/pull/4626 ) does have some implications on how to interpret the client.connected() result.
It is very well possible there is still data in the buffers waiting to be read.
So the loop() function of pubsubclient should first try to empty the received data and then decide what to do with the connected state.

So reading is fine, if there is data available, but writing needs an extra check.
2019-12-10 10:11:14 +01:00
Gijs Noorlander bb688514d1 [pubSubClient] Fix signed/unsigned compare warning 2019-11-13 13:15:29 +01:00
TD-er eddc6924c6 [pubsubclient] Fix bug in publish
Change I made which was incorrect.
As spotted here: https://github.com/letscontrolit/ESPEasy/pull/2728#issuecomment-552925267
2019-11-13 13:07:00 +01:00
TD-er 3c31a30af9 [MQTT] Improve update MQTT client connected status
Checking the MQTT connected status can alter connected status, so update connected status when it could have changed.
2019-11-13 13:07:00 +01:00
TD-er e25ff7410b [PubSubClient] Only update lastOutActivity when write is successful 2019-11-13 13:07:00 +01:00
TD-er 59c6445eea [PubSubClient] Fix check for domain string 2019-11-13 13:07:00 +01:00
Gijs Noorlander 0ed12601f2 [PubSubClient] Check for valid initialized _client
Especially on disconnect, there should be a check for a valid `_client` pointer.
2019-05-21 21:49:58 +02:00
Gijs Noorlander b2d471f7f5 [PubSubClient] Fix publish() for payload == nullptr (528)
See PR [528](https://github.com/knolleary/pubsubclient/pull/528/files)
2019-05-21 20:56:27 +02:00
Gijs Noorlander 0f80893901 [PubSubClient] Add delay() calls in connect() and write()
Based on PR [567](https://github.com/knolleary/pubsubclient/pull/567/files)
2019-05-21 20:50:46 +02:00
Gijs Noorlander e4c79db8e1 [PubSubClient] Support pre-connected client
Pull Request [571](https://github.com/knolleary/pubsubclient/pull/571/files)
2019-05-21 20:45:55 +02:00
Gijs Noorlander 244b3059fe [PubSubClient] Removed an unused variable 618
Pull request [618](https://github.com/knolleary/pubsubclient/pull/618/files)
2019-05-21 20:32:57 +02:00
Gijs Noorlander 734d0562be [PubSubClient] Fix Publish_P return value
PR from [PubSubClient PR 600](https://github.com/knolleary/pubsubclient/pull/600)

N.B. we had this fix already present in ESPeasy before update to 2.7
2019-05-21 20:30:47 +02:00
TD-er a115415df2 [PubSubClient] Upgrade to 2.7 2019-05-21 20:18:24 +02:00
TD-er 82358574ba [PubSubClient] Increase MQTT_MAX_PACKET_SIZE from 384 to 1024 2019-02-01 10:53:08 +01: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
TD-er 8f23048f18 [MQTT] PubSubClient Add checks for connectivity
Taken from master branch of PubSubClient
2018-08-22 21:56:05 +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
Gijs Noorlander 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 Noorlander 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 Noorlander 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
mvdbro f70970c6f3 Enlarge MQTT buffer for Domoticz MQTT controller 2017-06-10 22:34:55 +02:00
Edwin Eefting b13bb3857a add libraries we slightly modified or that i cant find the repositorys for 2017-03-01 22:47:18 +01:00