Skip to content
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

Sensors DS18B20 #157

Closed
C-arsten opened this issue Oct 13, 2021 · 17 comments
Closed

Sensors DS18B20 #157

C-arsten opened this issue Oct 13, 2021 · 17 comments
Labels
bug Something isn't working

Comments

@C-arsten
Copy link

I connected 11 Dallas DS18B20 Sensors to the Board via JST.
10 Sensors show the right ID and Temp. The 11 doesnt show ID and Temp.
Telnet -> Show -> all 11 Sensors are named with right ID and show the right Temp.
The Sensor are all working fine also in ESP_Easy.
Dashboard
Telnet

@C-arsten C-arsten added the question Question about something label Oct 13, 2021
@proddy proddy added bug Something isn't working and removed question Question about something labels Oct 13, 2021
@proddy
Copy link
Contributor

proddy commented Oct 13, 2021

Wow, I never tested with more than 3!

Reason is that the json buffer being sent to the Web is too small.

@MichaelDvP we could obviously up the size in

AsyncJsonResponse * response = new AsyncJsonResponse(false, EMSESP_JSON_SIZE_LARGE_DYN);

or better still use shorter names like obj["o"] instead of obj["offset"]. Better still, using msgpack() to compress the output will also reduce the payload size by about 20%. What do you think?

@MichaelDvP
Copy link
Contributor

I use 7 sensors, but it also depends on number of devcies.
Increasing the buffer to XLARGE should be sufficient, but also increase the name-storage in WebSettingsService.h line 31.
Use msgpack() needs some more changes. Short names is less readable and should be commented in EMSESPtypes.ts. But i think both is a good idea.

@proddy
Copy link
Contributor

proddy commented Oct 14, 2021

ok, I'll make the change. I'll add msgpack() as the default in the new hooks implementation which re-writes the rest controller.

@proddy
Copy link
Contributor

proddy commented Oct 14, 2021

please re-test

@C-arsten
Copy link
Author

i want to install the new firmware, but in the WebUi on Firmware upload, it loads the .bin file an then it says
"Problem uploading: Invalid status code: 500"

@proddy
Copy link
Contributor

proddy commented Oct 14, 2021

oh, let me check....

@proddy proddy reopened this Oct 14, 2021
@proddy
Copy link
Contributor

proddy commented Oct 14, 2021

I don't get that error. If you're coming from an older version try removing the cache. So Ctrl-Shift-R on the web page

@MichaelDvP
Copy link
Contributor

MichaelDvP commented Oct 14, 2021

I also don't get this error, but now the the FSPersistence-buffer is to small and settings are not read after restart.
Maybe don't use the DEFAULT_BUFFER_SIZE and introduce an new FS_BUFFER_SIZE in StatefulService.h.

@proddy
Copy link
Contributor

proddy commented Oct 14, 2021

That would explain it. In

for (uint8_t i = 0; i < NUM_SENSOR_NAMES; i++) {
char buf[20];
snprintf_P(buf, sizeof(buf), PSTR("sensor_id%d"), i);
root[buf] = settings.sensor[i].id;
snprintf_P(buf, sizeof(buf), PSTR("sensor_name%d"), i);
root[buf] = settings.sensor[i].name;
snprintf_P(buf, sizeof(buf), PSTR("sensor_offset%d"), i);
root[buf] = settings.sensor[i].offset;
}

we're creating dummy settings for 20 sensors that probably aren't used. Here it should only create the ones that are present.

@MichaelDvP
Copy link
Contributor

But the buffer should be large enough to hold all possible sensors. And disconnected sensors should not be removed from list, maybe it's only a bad contact and the sensor comes back on next read. Then it makes no/little difference if writing all 20 sensors or only the used ones.

@C-arsten
Copy link
Author

i am coming from v.3.2.1
i did Ctrl-Shift-R -> nothing
1
2
3

@MichaelDvP
Copy link
Contributor

Maybe the downloaded file is corrupted, try download again.

@C-arsten
Copy link
Author

i can uplaod the stable v3.2.1 but not the v3.2.2b11

@proddy
Copy link
Contributor

proddy commented Oct 14, 2021

i can uplaod the stable v3.2.1 but not the v3.2.2b11

try the old fashioned way using a USB cable and https://github.com/Jason2866/ESP_Flasher/releases/tag/v.1.3

@C-arsten
Copy link
Author

i tried to flash my MH-ET Live with different PC´s, Cables and USB Ports. There is no chance to flash it. The only way i can install ems-esp is to flash ESP web tool and do an update with the ems-esp bin file. but if i load the v3.2.2b11 it says there is not enough space. the 3.2.1 is working

@proddy
Copy link
Contributor

proddy commented Oct 21, 2021

@C-arsten did you finally get it working?

@proddy
Copy link
Contributor

proddy commented Oct 22, 2021

assuming so. This will be added to the next stable release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants