-
Notifications
You must be signed in to change notification settings - Fork 635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DOMOTICZ] Error parsing data #2166
Comments
How can I reproduce domoticz installation? (config files, os etc.) |
Hi, Domoticz Version: 4.11740 Thanks |
nvm, I have installed beta domoticz. but, I don't see the issue described here when setting up dummy switch. What is the MQTT broker domoticz connects to? Does running any other client (on phone, |
Ok I'll try but I don't think I'll be very successful, ... |
Hi, finally I got some time to test this. It happens with all devices, at least all that I have checked. For example in one with DHT11 this is what I got from the DEBUG:
while this what I got from the broker: and this is a tcpdump in the broker: Apparently there is nothing in the neither in the json file nor in the tcpdump file, ... Could you tell me next step? |
Could you modify diff --git a/code/espurna/mqtt.ino b/code/espurna/mqtt.ino
index 06c79f67..109f72e3 100644
--- a/code/espurna/mqtt.ino
+++ b/code/espurna/mqtt.ino
@@ -975,6 +975,11 @@ void mqttSetup() {
_mqttOnDisconnect();
});
_mqtt.onMessage([](char* topic, char* payload, AsyncMqttClientMessageProperties properties, size_t len, size_t index, size_t total) {
+ DEBUG_MSG_P(PSTR("[MQTT] %s pkt:%u:%c:%c msg:%u:%u:%u\n"),
+ topic,
+ properties.qos, (properties.dup ? 'y' : 'n'), (properties.retain ? 'y' : 'n'),
+ len, index, total
+ );
_mqttOnMessage(topic, payload, len);
});
_mqtt.onSubscribe([](uint16_t packetId, uint8_t qos) { I think the issue is on our side. We don't check for total length of the packet from the current batch, see packets №29 and №31 from the capture. If we were to check that, we would notice that the MQTT And I would expect to see two consecutive logs about domoticz/out showing different index but the same total, at least that would allow us to properly parse things by buffering the previous part. |
then do you need me to take a new tcpdump, here you have the output from the console:
and here you have the output from the broker:
here you have the file kind regards and thanks a lot for your help! |
Hi I just found this:
So it is not always the problem appear and just in case you would like to compare |
Thanks! tcpdump (as previous one) & show the problem:
I just need to think a bit what exactly makes sense here as API wrapper. We should not cache everything based on |
Hi Max, the fact that "Some checks were not successful - 1 failing and 1 successful checks" is preventing me from testing this, do you still are expecting me to do it? thanks |
Looking at Codacy again:
Is a "non issue", since MQTT_MAX_PACKET_SIZE flag is provided by the platformio.ini config: Line 79 in 032f921
I would make changes to expose it as custom.h config though, but you should be fine testing it as-is. |
ok, I'll do that |
Hi There is a bug, at least for me, in mqtt.ino it appears
while in platformio.ini:
that solves the problem of 'MQTT_MAX_PACKET_SIZE' but there is still one issue
which I do not know how to fix..... |
Have you cherry-picked the buffering commit? The issue in mqttInfo is fixed in the subsequent commit, I kind of expected you to checkout the full patch list. I have reworked configuration a bit and forcepushed new version. Please check it out again either by
|
Excuse me Max, |
Hi there, I think I'll wait for you to push the changes to the dev branch unless you tell me otherwise |
What do you mean by 'undo'? Can you use my branch directly or did you add some more commits on top of you own? You can simply roll the branch back to an older commit [1]:
[1] https://git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell |
Hi Max, sorry but I'm a newbie here and I do not know how to manage with versions. The thing is I have added some stuff of mine on top of standard. going back, could you please tell me what I'm doing wrong?
thanks again! |
Ok, let's just use the repo approach then. Issue is that the remote url should be
Intent here is that later down the line you can always use |
Hi,I think smething is not working, I'll explain myself, this is what I'm receiving at the DUT:
while this is what I'm receiving in another device
shouldn't I be receiving something from the other nodes at the same time as well? |
Log is just missing. If you were to publish something manually on $ mosquitto_pub -t 'domoticz/out' -m '1' On the device:
|
I'm getting this in the device
but nothing in the broker..... |
I'll restore the log asap, but it is harmless though? Sensors data that you receive are not used by the device, its just logging them |
okay, I don't know if I made it clear enough but I were receiving this
for a while and then I stopped receiving it, then after sending |
See the latest commit, pull etc. I may have added off-by-one issue because of index, but it seems to be at the correct offset (meaning msg[len + index] = '\0' part) |
it seems to be working now:
|
I think this one was the one to blame:
Am I right? do you think it fits? |
Looks like it is working. |
Yes, I agree |
I think you can close this issue |
Before creating a new issue please check that you have:
Fulfilling this template will help developers and contributors to address the issue. Try to be as specific and extensive as possible. If the information provided is not enough the issue will likely be closed.
You can now remove this line and the above ones. Text in italic is meant to be replaced by your own words. If any of the sections below are not relevant to the issue (for instance, the screenshots) then you can delete them.
Bug description
Error parsing data keeps on appearing with DOMOTICZ:
It also happens in another device with an analog sensor:
Steps to reproduce
It just happens
Expected behavior
[DOMOTICZ] Error parsing data
Screenshots
If applicable, add screenshots to help explain your problem.
Device information
[000178] [MAIN] ESPURNA 1.14.2.PA5-dev (200219)
[000178] [MAIN] xose.perez@gmail.com
[000178] [MAIN] http://tinkerman.cat
[000180] [MAIN] CPU chip ID: 0x8E1600
[000183] [MAIN] CPU frequency: 80 MHz
[000186] [MAIN] SDK version: 2.2.2-dev(38a443e)
[000191] [MAIN] Core version: 2.6.3
[000194] [MAIN] Core revision: 3d128e5c
[000197] [MAIN] Build time: 1582416957
[000200]
[000202] [MAIN] Flash chip ID: 0x146085
[000205] [MAIN] Flash speed: 40000000 Hz
[000208] [MAIN] Flash mode: DOUT
[000211]
[000212] [MAIN] Flash size (CHIP) : 1048576 bytes / 256 sectors ( 0 to 255)
[000219] [MAIN] Flash size (SDK) : 1048576 bytes / 256 sectors ( 0 to 255)
[000226] [MAIN] Reserved : 4096 bytes / 1 sectors ( 0 to 0)
[000234] [MAIN] Firmware size : 569376 bytes / 140 sectors ( 1 to 140)
[000241] [MAIN] Max OTA size : 450560 bytes / 110 sectors ( 141 to 250)
[000248] [MAIN] EEPROM size : 4096 bytes / 1 sectors ( 251 to 251)
[000255] [MAIN] Reserved : 16384 bytes / 4 sectors ( 252 to 255)
[000262]
[000264] [MAIN] EEPROM sectors: 251, 250
[000267] [MAIN] EEPROM current: 250
[000270]
[000271] [MAIN] EEPROM: 4096 bytes initially | 1302 bytes used (31%) | 2794 bytes free (68%)
[000279] [MAIN] Heap : 40984 bytes initially | 5280 bytes used (12%) | 35704 bytes free (87%)
[000288] [MAIN] Stack : 4096 bytes initially | 1232 bytes used (30%) | 2864 bytes free (69%)
[000296]
[000297] [MAIN] Boot version: 31
[000300] [MAIN] Boot mode: 1
[000302] [MAIN] Last reset reason: External System
[000307] [MAIN] Last reset info: Fatal exception:0 flag:6 (EXT_SYS_RST) epc1:0x00000000 epc2:0x00000000 epc3:0x00000000 excvaddr:0x00000000 depc:0x00000000
[000320]
[000322] [MAIN] Board: GENERIC_ESP01S_DHT11_10
[000325] [MAIN] Support: ALEXA API BROKER BUTTON DEBUG_SERIAL DEBUG_TELNET DEBUG_WEB DOMOTICZ HOMEASSISTANT LED MDNS_SERVER MQTT NTP SCHEDULER SENSOR TELNET TERMINAL THINGSPEAK WEB
[000341] [MAIN] OTA: ARDUINO ASYNCTCP WEB
[000345] [MAIN] Sensors: DHTXX
[000347] [MAIN] WebUI image: SENSOR
[000350]
[000352] [MAIN] Power: 2454 mV
[000354] [MAIN] WiFi Sleep Mode: MODEM
[000357]
If you cannot get this info from the device, please answer this questions:
Core version: 2.6.3
ESPURNA 1.14.2.dev
curl and esptool
GENERIC_ESP01S_DHT11_10
Tools used
Ubuntu 19.10
Firefox 73.0.1 (64-bit)
PlatformIO Home 3.1.0·Core 4.2.1
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: