logo elektroda
logo elektroda
X
logo elektroda

ESP32 and OLED: How to display data from Domoticz? Problem with the SSD1306 (SH1106) HTTP command

sznickers 288 9
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 21413322
    sznickers
    Level 11  
    Hello,
    I'm trying to display something from Domoticz on an oled display connected to an ESP32 board, but I have a problem- it doesn't want to display Hello World. I want to establish communication with my SSD1306 (SH1106) display first and then it will fly. What is wrong in my command line :

    192.168.0.180/control?cmd=oledcmd,page0.t2.txt="Hello world"

    In Esp on line 5 I typed:

    page0.t2.txt="%lcltime%"

    Browser error indicating unknown command for OLED. .
    Screenshot of the ESP Easy Mega interface with display settings. .
    Screenshot of the ESP Easy Mega interface showing a list of devices connected to ESP32. .

    https://cdn.velleman.eu/downloads/29/infosheets/sh1106_datasheet.pdf

    I use the forums;
    https://blog.jokielowie.com/en/blog/domoticz-...emperatura-wilgotnosc-swiatlo-stacja-pogodowa
    https://elty.pl/blog/zastosowanie-wyswietlacz...n-w-systemie-inteligentnego-domu-domoticz-cz2
  • ADVERTISEMENT
  • #3 21415109
    sznickers
    Level 11  
    Good morning, of course you need to read with understanding. I didn't mix anything up, my display is OLED and I'm aware of that, and I'm learning from the Nextion example. I already typed such a command and it rejected.

    http://192.168.0.180/control?cmd=oledcmd,5,1,%22Hello%20world%22

    192.168.0.180/control?cmd=oledcmd,5,1,"Hello world"

    Is this 4.1 or 5.1 the 5th line in the ESP on the OLED device?

    Web page displaying error message Command unknown: oledcmd,5,1,'Hello world'.
  • ADVERTISEMENT
  • Helpful post
    #4 21415515
    starob
    Level 29  
    sznickers wrote:
    of course you have to read with understanding
    .

    The best way is to look at the official documentation for the final version of the software.
    https://www.letscontrolit.com/wiki/index.php/OLEDDisplay
    Learning from an inadequate (old) guide will give you the results w/w :) .
    SSD works on I2C and Nextion on serial - they are radically different drivers.

    From what's in the documentation the command should look like this

    http://192.168.0.180/control?cmd=OLED,4,1,Hello

    I don't have this display so I don't know if the lines are counted from 0 or 1 so I suggest you use 4.
    When trying to do this, try to avoid spaces in the text ( because space in URLs can be different).

    This looks like a good tutorial

    https://espeasy.readthedocs.io/en/latest/Plugin/P036.html

    https://github.com/letscontrolit/ESPEasy/issues/1690
  • ADVERTISEMENT
  • #5 21416059
    sznickers
    Level 11  
    Starob thank you, it worked :) , and now I will try to make a lua script to show me any value from domoticz on the display.

    Added after 25 [minutes]: .

    As a matter of reading comprehension I did a similar operation for the LCD display and it works and is happy:) :

    https://www.letscontrolit.com/wiki/index.php/OLEDDisplay
    Table showing commands for controlling an OLED display.

    192.168.0.161/control?cmd=LCD,1,1,czesc

    Added after 1 [hour] 32 [minutes]: .

    A complete success, as if anyone needs- here you go,
    We can display some data from domoticz on the display.
    Script in Domoticz, Lua, All, :

    commandArray = {}

    -- loop through all the changed devices
    for deviceName,deviceValue in pairs(devicechanged) do

    if (deviceName=='Qw') then
    commandArray['OpenURL']='http://192.168.0.161/control?cmd=LCD,1,1,'..tostring(deviceValue)...'_W'
    end

    if (deviceName=='V1') then
    commandArray['OpenURL']='http://192.168.0.161/control?cmd=LCD,2,1,'..tostring(deviceValue)...'_l/min'
    end

    end

    return commandArray
  • ADVERTISEMENT
  • #7 21456830
    starob
    Level 29  
    There is no such command. Once again you are trying to combine two devices in an incomprehensible way.
    Do you even understand the principle of operation and the purpose of the two boards (mcp, tm)?
    You have only one option - to connect the display directly to the ESP
  • #8 21456836
    sznickers
    Level 11  
    It's a lime. I've already connected one display to the ESP board and that works for me, but I wanted to connect several TM1637 displays to one board.
  • #9 21456860
    starob
    Level 29  
    >>21456836 .
    You could try cascading these displays - from the output of one to the inputs of the other and select 8 digital. This could be an interesting experiment.
    I guess you can add another display in the devices tab on other pins?
  • #10 21456893
    sznickers
    Level 11  
    I'm banging this in the dark. This is what it looks like in esp easy:


    .
    Screenshot of device settings in ESP Easy showing display configuration. .
    If it doesn't work out then plan B is to do it in Arduino

Topic summary

The discussion addresses the issue of displaying text from Domoticz on an OLED display connected to an ESP32, specifically problems with using HTTP commands for SSD1306 and SH1106 displays. The initial command used was intended for Nextion displays and not compatible with SSD1306/SH1106 OLEDs. Correct command syntax for SSD1306 involves specifying line and column numbers, e.g., http://192.168.0.180/control?cmd=OLED,4,1,Hello, with attention to URL encoding and line indexing. The SSD1306 display communicates via I2C, unlike Nextion which uses serial communication, requiring different drivers and commands. Official ESPEasy documentation and wiki pages provide accurate command formats and usage examples. A Lua script example was shared to fetch and display Domoticz device values on the OLED via HTTP commands. Additional discussion touched on attempts to control TM1637 displays via MCP23017 I/O expanders, with advice that direct connection to ESP is preferable due to command incompatibilities. Suggestions included cascading TM1637 displays or adding multiple devices on different pins, with fallback plans to use Arduino if ESP Easy proves insufficient.
Summary generated by the language model.
ADVERTISEMENT