issalig / toshiba_air_cond

AB protocol decoder for toshiba air conditioners
37 stars 9 forks source link

JSON is not correct #3

Closed issalig closed 2 years ago

issalig commented 3 years ago

The following json is received in the browser. dht_t should have 144 elements but it has 307.

First 144 values are correct, but then it is a mix of timestamp array.

I have checked the loop where this information is filled https://github.com/issalig/toshiba_air_cond/blob/65f02f590d16f2cff462b4d96bc436c0cb8167de/air/process_request.hpp#L42 and it seems to be ok. Thus, maybe information is corrupted in posterior places but I do not know how to debug this without valgrind.

Server: {"id":"timeseries","n":144,"val":"dht_t","dht_t":[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,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25.9,25.3,25.9,25.9,25.8,25.5,25.3,25.1,25.2,25,25.1,25,25,24.9,25,24.8,24.8,24.8,24.9,24.4,25,24.5,25.4,25.5,25.7,25.8,25.8,25.9,25.9,25.9,26,26,26,26,26,26.1,26.1,26.1,26.1,26.1,26.1,26.1,26.2,26.2,26.3,26.3,26.3,26.4,26.5,26.6,26.7,26.7,26.8,26.8,26.9,27,27,27.1,27.1,27.1,27.2,27.5,27.5,27.5,27.5,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,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1104098099,1103783526,1104098099,1104098099,1104045670,1103888384,1103783526,1103678669,1103731098,1103626240,1103678669,1103626240,1103626240,1103573811,1103626240,1103521382,1103521382,1103521382,1103573811,1103311667,1103626240,1103364096,1103835955,1103888384,1103993242,1104045670,1104045670,1104098099,1104098099,1104098099,1104150528,1104150528,1104150528,1104150528,1104150528,1104202957,1104202957,1104202957,1104202957,1104202957,1104202957,1104202957,1104255386,1104255386,1104307814,1104307814,1104307814,1104360243,1104412672,1104465101,1104517530,1104517530,1104569958,1104569958,1104622387,1104674816,1104674816,1104727245,1104727245,1104727245,1104779674,1104936960,1104936960,1104936960,1104936960,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}

issalig commented 2 years ago

Here it is similar value 145 and after are wrong " ... 144,2320,0 ... "

Server: {"id":"timeseries","n":144,"val":"ac_sensor_t","ac_sensor_t":[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,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,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,0,0,0,0,0,0,0,0,0,0,0,0,0,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,20.5,144,2320,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}

issalig commented 2 years ago

144,2320 was introduced by me, the rest of 0 values no.

issalig commented 2 years ago

Not sure if this is related to issue #6