Problem with two I2C displays and sending remote values

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Calade
New user
Posts: 6
Joined: 14 Jan 2024, 19:39

Problem with two I2C displays and sending remote values

#1 Post by Calade » 23 Jan 2024, 18:45

Hello,

I have a weird problem with a Wemos D1 / ESP Easy rel. mega-20231225 Energy, named Energy_2 with ID 2 and displays.

I have first wired a single SSD1306 0.9’’ OLED display named « OLED », that displays a local DHT22’s values as well as remote sensor’s values from a similar configuration (hw/sw) named Energy_1 with ID 1 where the Rule is :
On BME280#TEMP Do
//oledcmd,clear
SendTo 2,OLED,4,1,Bureau T[BME280#TEMP]° H[BME280#HUMI]%
SendTo 2,OLED,5,1,Bureau [BME280#PRES]mB
Endon


STEP2
So far, so good. I have added a second larger 2.42’’ display named « OLED2 », seemed equipped with SSD1309 chip similar to SSD1306 that other ESPEasy users have used without problems. Configured as I2C detected as 0x3d, so there shouldn’t be any interference with « OLED » at 0x3c.
Both displays behave correctly, displaying each values : local/remote on « OLED » and local values on lines1,2,3 of « OLED2 ». The problem arise when I want to send remote values from Energy_1 on « OLED2 » with added Rule :
SendTo 2,OLED2,3,1,[PZEM#U]VAC
The PZEM Voltage is NOT DISPLAYED on line 3 of Energy_2 ? It’s serial console indicates « Command unknown: OLED2,3,1,232.1VAC »
Same disappointment with an ESP01 sending DS18B20 temperature on line 3 :
On DS1820#TEMP Do
SendTo 2,OLED2,3,1,DS1820:[DS1820#TEMP]°C
endon

Nothing displayed on line 3 on « OLED2 » ! Nor any other line if changed…

STEP3
I have physically removed first display « OLED », « OLED2 » still as 0x3d AND NOW… it is showing on lines 3 & 4 the values, those that SHOULD be on first I2C display « OLED » ( disabled and physically removed !!!) BUT still not displaying the remote PZEM Voltage…
AND also DS1820#TEMP from ESP01 is yet displayed alternately on line 3 !!! (Although serial messages : Command unknown: OLED2,3,1,DS1820:23.00°C)

Changed « OLED2 » display address from 0x3d to 0x3c (confirmed by I2C Scan) : still showing same messages as before.
I have tried to change the 2.42’’ display name as « SSD1309 » without any improvement. I know that the SSD1309 display is not officially supported, but it displays correctly local sensor’s values or simple text, and has been succesfully used by others ?

STEP4
I have ordered another OLED 1,3" SSH1106 display, changed I2C to 0x3d replacing SSD1309 at OLED2, OLED present and enabled. Same problems, no trace of remote values on OLED2, whatever the remote ESP they come.

ON OLED, I noticed a glitch regarding the rules ; if I write on Energey_1 :
On… Do
SendTo 2,OLED,6,1,[PZEM#U]VAC
SendTo 2,OLED,7,1,[PZEM#I]Amp
SendTo 2,OLED,8,1,[PZEM#P]Wat
SendTo 2,OLED2,6,1,[PZEM#U]VAC
SendTo 2,OLED2,7,1,[PZEM#I]Amp
SendTo 2,OLED2,8,1,[PZEM#P]Wat
Endon

Then the 3 values V,I,P of PZEM are displayed on OLED (but NOT on OLED2…)
Else if I write :
On… Do
SendTo 2,OLED,6,1,[PZEM#U]VAC
SendTo 2,OLED2,6,1,[PZEM#U]VAC
SendTo 2,OLED,7,1,[PZEM#I]Amp
SendTo 2,OLED2,7,1,[PZEM#I]Amp
SendTo 2,OLED,8,1,[PZEM#P]Wat
SendTo 2,OLED2,8,1,[PZEM#P]Wat
Endon

Then only the first V value of PZEM is on OLED, not the I, P and nothing on OLED2 ; seems the : SendTo 2,OLED2… rule is blocking.
What a mess… Maybe I misuse the rules or a bug with the use of two displays in I2C, or...

So I’m stuck now with my tests, if anyone can help to correct me or solve this please ?
Thanks,

User avatar
Ath
Normal user
Posts: 3520
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Problem with two I2C displays and sending remote values

#2 Post by Ath » 23 Jan 2024, 19:54

You're close, but no cigar ;)

There is no command OLED2 (that's what the error messages says), but there is a command OLED.
To address a second OLed display, using 2 tasks with the same plugin (P023 in this case), you can address the desired task by prefixing the command with the task name and a period (no spaces), so to address the task named OLED2, the command will be:

Code: Select all

  SendTo,2,'OLED2.OLED,4,1,"Bureau T[BME280#TEMP]{D} H[BME280#HUM]%"'
As the command has commas and spaces, it should best be wrapped in quotes, and also the data to put on the display should best be wrapped in (different) quotes (both the SendTo command and this plugin do not require that, but most other commands and plugins do), like in my example.

- If there are 2 (or more) tasks using the same plugin, using simply the OLED command will address the first, enabled, task using that plugin, and not the second (or third, fourth, etc. for plugins that allow more than 2 instances/addresses).
- When the task named OLED2 is the only one enabled (when the I2C hardware is not found at init, the task will be disabled automatically), both commands will end up on the same display.
/Ton (PayPal.me)

Calade
New user
Posts: 6
Joined: 14 Jan 2024, 19:39

Re: Problem with two I2C displays and sending remote values

#3 Post by Calade » 24 Jan 2024, 17:50

Thanks for your fast reply !
That does not work as I supposed, but that's clever, I will try this soon and let you know...
Where can I find information about this syntax in the documentation, with examples if possible ?

Thanks again,
CS


Calade
New user
Posts: 6
Joined: 14 Jan 2024, 19:39

Re: Problem with two I2C displays and sending remote values

#5 Post by Calade » 29 Jan 2024, 18:26

Thanks for the info about instances, that was what I was missing !
All the best,

Post Reply

Who is online

Users browsing this forum: No registered users and 31 guests