Problem wih Oled and MLX90614
Moderators: grovkillen, Stuntteam, TD-er
Problem wih Oled and MLX90614
Hi . I made custom build using latest sources and included "P024_MLX90614" and 'P036_FrameOLED". Both using I2C bus. Upload to LiLon NodeMCU V3. Changed I2C clock speed to 100 kHz so MLX90614 can work correct.
Each of devices work OK , but when enable it together P024 stop reading temperature and show: 1037.5 grad C.
When I go to "Hardware" page and press "Submit" button -P024_MLX90614 start to read correct temperature until next restart of ESP8266 or when I make any changes to settings for OLED device.
Each of devices work OK , but when enable it together P024 stop reading temperature and show: 1037.5 grad C.
When I go to "Hardware" page and press "Submit" button -P024_MLX90614 start to read correct temperature until next restart of ESP8266 or when I make any changes to settings for OLED device.
Re: Problem wih Oled and MLX90614
I hope you got the latest sources from github?
When using a Normal build of ESPEasy, both plugins P024 and P036 are included, so no need to make a custom build for that
Latest releases (compiled binaries and matching source code) can always be found here: https://github.com/letscontrolit/ESPEasy/releases
When checking the output from the I2C Scan, what devices are shown there?
When using a Normal build of ESPEasy, both plugins P024 and P036 are included, so no need to make a custom build for that
Latest releases (compiled binaries and matching source code) can always be found here: https://github.com/letscontrolit/ESPEasy/releases
When checking the output from the I2C Scan, what devices are shown there?
/Ton (PayPal.me)
Re: Problem wih Oled and MLX90614
I think the used library of the OLED does set the I2C frequency.
I will have a look at it to see if I can disable it and just focus on the set I2C clock frequency in the ESPEasy settings.
I will have a look at it to see if I can disable it and just focus on the set I2C clock frequency in the ESPEasy settings.
Re: Problem wih Oled and MLX90614
Good catch. The MLX90614 is a low speed device (100KHz max). The OLED plugin is most likely initializing the i2c bus to the default 700KHz.I think the used library of the OLED does set the I2C frequency.
- Thomas
Re: Problem wih Oled and MLX90614
It is my mistake ( at first time in the rush I didn't see plugin in normal build) .Ath wrote: ↑11 Aug 2020, 17:19 I hope you got the latest sources from github?
When using a Normal build of ESPEasy, both plugins P024 and P036 are included, so no need to make a custom build for that
Latest releases (compiled binaries and matching source code) can always be found here: https://github.com/letscontrolit/ESPEasy/releases
When checking the output from the I2C Scan, what devices are shown there?
I flashed with : ESP_Easy_mega_20200801_normal_ESP8266_4M1M and situation are identical with custom build. The same issue with readings. Thanks
Re: Problem wih Oled and MLX90614
Yes.. The I2C speed is defined in SSD1306Wire.h at line 52 : Wire.setClock(700000);
When I changed to Wire.setClock(100000); the issue is gone.
Re: Problem wih Oled and MLX90614
So that line should be removed from the OLED library.
The 700 kHz was not possible on ESP82xx, so it was forced to 400 kHz anyway, but still a library should not set parameters for a shared bus.
The 700 kHz was not possible on ESP82xx, so it was forced to 400 kHz anyway, but still a library should not set parameters for a shared bus.
Re: Problem wih Oled and MLX90614
In that case there are a few ways to resolve this:
a) Remove the Wire.setClock(700000) setting and let it run at the configured speed (though that may influence the screen-update speed). It is only set on initial setup of the display. Already in PR #3208
or
b) Reset Wire.setClock(Settings.I2C_clockSpeed) after calling any function there
or
c) Set Wire.setClock(Settings.I2C_clockSpeed) before any PLUGIN_* call to an I2C device
or
d) Add a setting for each I2C device to configure a specific bus speed, and set it before calling that device (when > 0).
or
e) Add Wire.setClock(100000) in the MLX90614 plugin before every I2C call (could be an optional setting to force the bus speed to an acceptable value), and reset to Settings.I2C_clockSpeed after the call. (And maybe add the 'feature' to all I2C devices that are having bus-speed issues like this device)
what solution would be the most robust?
Edit: One vote for solution a) already
a) Remove the Wire.setClock(700000) setting and let it run at the configured speed (though that may influence the screen-update speed). It is only set on initial setup of the display. Already in PR #3208
or
b) Reset Wire.setClock(Settings.I2C_clockSpeed) after calling any function there
or
c) Set Wire.setClock(Settings.I2C_clockSpeed) before any PLUGIN_* call to an I2C device
or
d) Add a setting for each I2C device to configure a specific bus speed, and set it before calling that device (when > 0).
or
e) Add Wire.setClock(100000) in the MLX90614 plugin before every I2C call (could be an optional setting to force the bus speed to an acceptable value), and reset to Settings.I2C_clockSpeed after the call. (And maybe add the 'feature' to all I2C devices that are having bus-speed issues like this device)
what solution would be the most robust?
Edit: One vote for solution a) already
Last edited by Ath on 12 Aug 2020, 11:49, edited 2 times in total.
/Ton (PayPal.me)
Re: Problem wih Oled and MLX90614
I added a reminder for me on Github: https://github.com/letscontrolit/ESPEasy/issues/3207
Re: Problem wih Oled and MLX90614
And I PR'd https://github.com/letscontrolit/ESPEasy/pull/3208 to implement suggestion a) from my list above.TD-er wrote: ↑12 Aug 2020, 11:27 I added a reminder for me on Github: https://github.com/letscontrolit/ESPEasy/issues/3207
Other options are still viable, IMHO, but this one seems eminent.
/Ton (PayPal.me)
Who is online
Users browsing this forum: No registered users and 26 guests