logo elektroda
logo elektroda
X
logo elektroda

[Solved] How to configure OLED 0.66 I2C with esp8266_deauther on WeMos D1 mini?

Ch4ist0 3972 34
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 17988650
    Ch4ist0
    Level 6  
    Hello, I have a problem with the OLED 0.66" I2C display dedicated to the Wemos D1 mini, it is connected under Pin D1 - SCL, Pin D2 - SDA. The display itself works but the soft I am using is under 0.96" and does not display everything correctly....

    Layout is:[url=]https://nettigo.pl/products/modul-wifi-wemos-d1-mini-pro[/url] .
    Screen:[url=]https://nettigo.pl/products/wyswietlacz-oled-0-66-i2c-dedykowany-do-wemos-d1-mini[/url] .
    I am using the software esp8266_deauther 2.1.0 (deauther_2.1.0_4mb.bin)
    [url=]https://github.com/spacehuhn/esp8266_deauther/releases[/url] .

    I read that you need U8G support enabled with the parameter "ssd1306_64x48_i2c"
    I don't know if there is U8G in this sofet and how to add it or edit the configurations to make the screen display correctly....

    Please help.

    I know that the configuration file is "esp8266_deauther/A_config.h"
    [url=]https://github.com/spacehuhn/esp8266_deauther/blob/master/configs/Default/A_config.h[/url] .
    Its contents are:
    Code: C / C++
    Log in, to see the code
    .
  • ADVERTISEMENT
  • ADVERTISEMENT
  • #3 17988805
    Ch4ist0
    Level 6  
    kaczakat wrote:
    First you add libraries for 4 different oled, you should determine what driver you actually have and only include that in the project.
    Here is the library that supports 64x48: https://github.com/mcauser/Adafruit_SSD1306/, according to the example you specify the screen parameters in the file Adafruit_SSD1306.h.
    .

    The driver I have is SSD1306, it is supposed to be U8G with the parameter "ssd1306_64x48_i2c" as stated by the manufacturer on the website [url=]https://nettigo.pl/products/wyswietlacz-oled-0-66-i2c-dedykowany-do-wemos-d1-mini[/url] .

    How to add these libraries ? and how then to compile it to a .bin file
    Sorce Code Softu:[url=]https://github.com/spacehuhn/esp8266_deauther/archive/v2.1.0.zip[/url]

    Display type: OLED
    Pixel colour: white
    Resolution: 64 × 48
    Size: 0.66"
    Supply voltage: 3.3 V
    Controller: SSD1306
    Interface: I2C
    I2C address: 0x3C or 0x3D

    Added after 35 [minutes]: .

    kaczakat wrote:
    This is the library that supports 64x48: https://github.com/mcauser/Adafruit_SSD1306/, according to the example you specify the screen parameters in the file Adafruit_SSD1306.h.
    .

    And this is acct 128x32 but cool, thanks for the clue....

    BTW. how to compile the project into a *.bin file ? so that it is ready for flashing....
  • Helpful post
    #4 17988885
    khoam
    Level 42  
    Ch4ist0 wrote:
    how to compile the project into a *.bin file ? so that it is ready to flash...
    .
    Sketch > Export compiled Binary

    How to configure OLED 0.66 I2C with esp8266_deauther on WeMos D1 mini?

    Added after 4 [minutes]:

    Ch4ist0 wrote:
    I have read that you need U8G support enabled with the parameter "ssd1306_64x48_i2c"
    .
    U8G is the library that can handle your display:
    https://github.com/olikraus/u8g2/wiki
  • ADVERTISEMENT
  • #5 17988911
    Ch4ist0
    Level 6  
    ok ok. Could you describe to me step by step what to do? Which files should I copy into the project, which should I edit and what should I add ... because I am already lost ...
  • #6 17988914
    khoam
    Level 42  
    Ch4ist0 wrote:
    And could you describe to me what and how step by step ? What files should I copy to the project, what should I edit and what should I add
    .
    First install the U8G library in the Arduino IDE, following the instructions that are on the page from post #4.
  • #7 17988916
    kaczakat
    Level 34  
    In Arduino you can immediately upload the compiled code to WEMOS, just select in the project settings which board you have connected, on which COM port and click the right arrow (upload).
    Helpful post? Buy me a coffee.
  • #8 17989050
    Ch4ist0
    Level 6  
    Quote:
    Arduino:1.8.9 (Windows Store 1.8.21.0) (Windows 10), Board: "WEMOS D1 mini, 160 MHz, 80MHz, DIO, 115200, 4M (1M SPIFFS)"
    .

    Code: C / C++
    Log in, to see the code
    .
  • ADVERTISEMENT
  • #10 17989076
    Ch4ist0
    Level 6  
    and now bb473f16b exit status 1
    Arduino:1.8.9 (Windows Store 1.8.21.0) (Windows 10), Board: "WEMOS D1 mini, 160 MHz, 80MHz, DIO, 115200, 1M (256K SPIFFS)"



    ssd1306_64x48_i2c:59:6: error: redefinition of 'void setup()'

    void setup() {

    ^

    esp8266_deauther:78:6: error: 'void setup()' previously defined here

    void setup() {

    ^



    ssd1306_64x48_i2c:172:6: error: redefinition of 'void loop()'

    void loop() {

    ^

    esp8266_deauther:172:6: error: 'void loop()' previously defined here

    void loop() {

    ^



    ssd1306_64x48_i2c:253:59: error: 'min' was not declared in this scope

    for (int16_t i=0; i<min(display.width(),display.height())/2; i+=5) {

    ^

    C:\Users\Ch4ist0\Desktop\esp8266_deauther-2.1.0\esp8266_deauther\ssd1306_64x48_i2c.ino:253:59: note: suggested alternative:

    In file included from c:\users\ch4ist0\documents\arduinodata\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\c++\4.8.2\memory:62:0,

    from C:\nDocumentsArduinoDataPackages.h:25,

    from sketchfunctions.h:5,

    from C:\Users\Ch4ist0\Desktop\esp8266_deauther-2.1.0\esp8266_deauther\esp8266_deauther.ino:46:

    c:\users\ch4ist0\documents\arduinodata\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\c++\4.8.2\bits\stl_algobase.h:239:5: note: 'std::min'

    min(const _Tp& __a, const _Tp& __b, _Compare __comp)

    ^



    ssd1306_64x48_i2c:264:54: error: 'min' was not declared in this scope

    for (int16_t i=min(display.width(),display.height())/2; i>0; i-=5) {

    ^

    C:\Users\Ch4ist0\Desktop\esp8266_deauther-2.1.0\esp8266_deauther\ssd1306_64x48_i2c.ino:264:54: note: suggested alternative:

    In file included from c:\users\ch4ist0\documents\arduinodata\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\c++\4.8.2\memory:62:0,

    from C:\nDocumentsArduinoDataPackages.h:25,

    from sketchfunctions.h:5,

    from C:\Users\Ch4ist0\Desktop\esp8266_deauther-2.1.0\esp8266_deauther\esp8266_deauther.ino:46:

    c:\users\ch4ist0\documents\arduinodata\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\c++\4.8.2\bits\stl_algobase.h:239:5: note: 'std::min'

    min(const _Tp& __a, const _Tp& __b, _Compare __comp)

    ^

    exit status 1
    redefinition of 'void setup()'.

    This report should contain more information if in
    File -> Preferences the option "Show
    detailed information during compilation"
    .
  • #12 17989081
    khoam
    Level 42  
    Ch4ist0 wrote:
    and now exit status 1
    .
    And now you need to show what your .ino file looks like
    I don't know what you're compiling, but it looks like you're trying to compile two open .ino files at the same time, each with a setup() and a loop(). This is unlikely to work.
  • #13 17989116
    Ch4ist0
    Level 6  
    khoam wrote:
    Ch4ist0 wrote:
    and now exit status 1
    .
    And now you need to show what your .ino file looks like
    I don't know what you're compiling, but it looks like you're trying to compile two open .ino files at the same time, each with a setup() and a loop(). This is unlikely to work.
    .

    Well yes actually there are two because I downloaded some Adafruit_SSD1306_esp8266_64x48 Modified libraries and tried to add that....

    How do I do it correctly on this software ? what to add and how, I have downloaded the u8g libraries ...

    my .ino file is:
    Code: C / C++
    Log in, to see the code
  • #14 17989125
    khoam
    Level 42  
    And if you deleted the redundant ino file, does it now compile? "Delete" means close in the Arduino IDE.

    You should only be left with esp8266_deauther.ino
  • #15 17989215
    kaczakat
    Level 34  
    If you go deeper into the link from #post 2 you can see an example for this screen: https://github.com/mcauser/Adafruit_SSD1306/tree/esp8266-64x48/examples. Just go back to the top, download the library, unzip it and upload it to a directory or add it as a zip library, restart the Arduino, open the example and upload it. The header file (h) defines an address of 0x3C and a screen of 64x48. For this to work, the Adafruit_GFX library must still be uploaded.
    Helpful post? Buy me a coffee.
  • #16 17989272
    Ch4ist0
    Level 6  
    kaczakat wrote:
    As you go deeper into the link from #post 2 you can see an example for this screen: https://github.com/mcauser/Adafruit_SSD1306/tree/esp8266-64x48/examples. Just go back to the top, download the library, unzip it and upload it to a directory or add it as a zip library, restart Arduino, open the example and upload it. The header file (h) defines an address of 0x3C and a screen of 64x48. For it to work the Adafruit_GFX library must still be uploaded.
    .

    OK. so I open the file "esp8266_deauther.ino" in arduino, add the Adafruit library, save, open again, compile and that's enough ? or do I have to change something in the A_Config.h file after adding the library ???
  • Helpful post
    #17 17989280
    Maciej_1985
    Level 2  
    Hey,
    I've been messing around with this lately too, the only thing that worked was the esp8266-OLED library - in the zip attachment - extract it and place it in the
    c:\Users\uzytkwnik\Documents\Arduino\libraries\
    .
    then just run the example
    Good luck :) .
  • #18 17989329
    khoam
    Level 42  
    Maciej_1985 wrote:
    I've also been playing around with this recently, the only thing that worked was the esp8266-OLED library
    .
    What does this library have to do with the ESP8266 Deauther application that the Author is trying to compile? Please do not give such "cosmic" advice.

    The A_config.h file of the ESP8266 Deauther application shows that:
    Code: C / C++
    Log in, to see the code
    .
    These are header files from the ThingPulse ESP8266 OLED SSD1306 library:
    https://github.com/ThingPulse/esp8266-oled-ssd1306
    And unfortunately this particular library should be installed.

    Further in the file A_config.h it says:
    Code: C / C++
    Log in, to see the code
    .
    so you need to select the correct display type and verify which SDA/SCL pins it is connected to.

    Finally, it would be good to read to the end what is on the main page of the ESP8266 Deauther project: .
    Code: HTML, XML
    Log in, to see the code
    .
    You need to have the above three libraries installed in order to properly build the ESP8266 Deauther application. Nothing more than that.
  • #19 17989335
    kaczakat
    Level 34  
    Ch4ist0 wrote:
    OK. i.e. i open the file "esp8266_deauther.ino" in arduino
    i don't know where you got this from. You can see on github that there are examples like this inside:
    How to configure OLED 0.66 I2C with esp8266_deauther on WeMos D1 mini? .
    Well then, after downloading this library (others from Adafruit to this screen you have to hide/replace or overwrite those for now) you are supposed to see the same thing in the examples:
    How to configure OLED 0.66 I2C with esp8266_deauther on WeMos D1 mini? .
    Helpful post? Buy me a coffee.
  • #20 17989336
    Ch4ist0
    Level 6  
    Tell me how exactly to add this library to which tab in Arduino, to A_Config.h or to the main one ? Because I don't understand...
  • #21 17989340
    khoam
    Level 42  
    kaczakat wrote:
    Well, after downloading this library (others from Adafruit for this screen you have to hide/replace or overwrite those for now) you are supposed to see the same thing in the examples:
    .
    No Adafruit library is needed for the ESP8266 Deauther application - see post #18.
  • #22 17989352
    Ch4ist0
    Level 6  
    Quote:
    Arduino:1.8.9 (Windows Store 1.8.21.0) (Windows 10), Board: "WEMOS D1 mini, 160 MHz, 80MHz, DIO, 115200, 1M (256K SPIFFS)"

    In file included from sketch_config.h:1:0,

    from sketch_LED.h:9,

    from sketch\LED.cpp:1:



    #define BLACK 0

    ^



    BLACK = 0,

    ^



    #define BLACK 0

    ^



    BLACK = 0,

    ^



    #define BLACK 0

    ^



    BLACK = 0,

    ^



    from sketch_config.h:9,

    from sketch\LED.h:9,

    from sketch\LED.cpp:1:

    C:C:C:C4ist0DocumentsArduinoDatapackages-authored-libraries-oled-ssd1306-4.0.0.0-deauthored-libraries-oled-ssd1306-4.0.0.0/OLEDDisplay.h:98:1: error: expected declaration before '}' token

    };

    ^

    In file included from sketch\A_config.h:1:0,

    from sketchDisplayUI.h:5,

    from sketchDisplayUI.cpp:1:

    C:C:\4ist0DocumentsArduino_libraries_Adafruit_SSD1306_Wemos_Mini_OLED/Adafruit_SSD1306.h:51:15: error: expected identifier before numeric constant

    #define BLACK 0

    ^



    BLACK = 0,

    ^



    #define BLACK 0

    ^



    BLACK = 0,

    ^



    #define BLACK 0

    ^



    BLACK = 0,

    ^

    .0.0-deauther\libraries\esp8266-oled-ssd1306-4.0.0\src/SH1106Wire.h:34:0,

    from sketch_config.h:9,

    from sketchDisplayUI.h:5,

    from sketchDisplayUI.cpp:1:

    C:C:Users4ist0DocumentsArduinoDataPackages2.0.0-deauthenticating-libraries8266-oled-ssd1306-4.0.0/OLEDDisplay.h:98:1: error: expected declaration before '}' token

    };

    ^

    Multiple libraries found in "SH1106Wire.h"
    Used: C:C:C4ist0DocumentsArduinoDataPackages2.0.0-deauthored-libraries-esp8266-oled-ssd1306-4.0.0
    Unused: C:C:\4ist0DocumentsArduino_libraries_ESP8266_and_ESP32_Oled_Driver_for_SSD1306_display
    exit status 1
    In file included from sketch\A_config.h:1:0,

    from sketch.h:11,

    from sketchCLI.cpp:1:



    #define BLACK 0

    ^



    BLACK = 0,

    ^



    #define BLACK 0

    ^



    BLACK = 0,

    ^



    #define BLACK 0

    ^



    BLACK = 0,

    ^



    from sketch_config.h:9,

    from sketch_config.h:11,

    from sketchCLI.cpp:1:

    C:C:C4ist0DocumentsArduinoDatapackages.html:2.0.0-deauthored-libraries.html-oled-ssd1306-4.0.0.0/OLEDDisplay.h:98:1: error: expected declaration before '}' token

    };

    ^

    In file included from sketch\A_config.h:1:0,

    from sketchSettings.h:11,

    from sketchSIDs.h:13,

    from sketchScan.h:8,

    from sketch\Scan.cpp:1:



    #define BLACK 0

    ^



    BLACK = 0,

    ^



    #define BLACK 0

    ^

    C:C:C:C4ist0DocumentsArduinoDataPackages..0.0-deautherlibraries-esp8266-oled-ssd1306-4.0.0/OLEDDisplay.h:95:3: note: in expansion of macro 'BLACK'

    BLACK = 0,

    ^



    #define BLACK 0

    ^



    BLACK = 0,

    ^



    from sketch_config.h:9,

    from sketch\Settings.h:11,

    from sketchSIDs.h:13,

    from sketchScan.h:8,

    from sketch\Scan.cpp:1:



    };

    ^

    In file included from sketch\A_config.h:1:0,

    from sketchSettings.h:11,

    from sketch\Settings.cpp:1:



    #define BLACK 0

    ^



    BLACK = 0,

    ^



    #define BLACK 0

    ^



    BLACK = 0,

    ^



    #define BLACK 0

    ^



    BLACK = 0,

    ^



    from sketch_config.h:9,

    from sketch\Settings.h:11,

    from sketch\Settings.cpp:1:

    C:C:C:C4ist0DocumentsArduinoDatapackages-authored-libraries8266-oled-ssd1306-4.0.0.0/OLEDDisplay.h:98:1: error: expected declaration before '}' token

    };

    ^

    In file included from sketch\A_config.h:1:0,

    from sketchSettings.h:11,

    from sketchSIDs.h:13,

    from sketch\SSIDs.cpp:1:



    #define BLACK 0

    ^

    C:C:C:C4ist0DocumentsArduinoDataPackages..0.0-deautherlibraries-esp8266-oled-ssd1306-4.0.0/OLEDDisplay.h:95:3: note: in expansion of macro 'BLACK'

    BLACK = 0,

    ^



    #define BLACK 0

    ^



    BLACK = 0,

    ^



    #define BLACK 0

    ^



    BLACK = 0,

    ^



    from sketch_config.h:9,

    from sketch\Settings.h:11,

    from sketchSIDs.h:13,

    from sketch\SSIDs.cpp:1:



    };

    ^

    In file included from sketch\A_config.h:1:0,

    from sketchSettings.h:11,

    from sketchSIDs.h:13,

    from sketchAttack.h:12,

    from sketch\Attack.cpp:1:



    #define BLACK 0

    ^



    BLACK = 0,

    ^



    #define BLACK 0

    ^



    BLACK = 0,

    ^



    #define BLACK 0

    ^



    BLACK = 0,

    ^



    from sketch_config.h:9,

    from sketch\Settings.h:11,

    from sketchSIDs.h:13,

    from sketchAttack.h:12,

    from sketch\Attack.cpp:1:

    .0.0/OLEDDisplay.h:98:1: error: expected declaration before '}' token

    };

    ^

    In file included from C:\Users\Ch4ist0\Desktop\esp8266_deauther-2.1.0\esp8266_deauther-2.1.0\esp8266_deauther\esp8266_deauther.ino:1:0:

    C:\nC:\nDocumentsArduino_braries_Adafruit_SSD1306_Wemos_Mini_OLED/Adafruit_SSD1306.h:51:15: error: expected identifier before numeric constant

    #define BLACK 0

    ^



    BLACK = 0,

    ^



    #define BLACK 0

    ^



    BLACK = 0,

    ^



    #define BLACK 0

    ^



    BLACK = 0,

    ^



    from sketch_config.h:9,

    from sketch\Settings.h:11,

    from C:\Users\Ch4ist0\Desktop\esp8266_deauther-2.1.0\esp8266_deauther-2.1.0\esp8266_deauther\esp8266_deauther.ino:29:



    };

    ^

    Compilation error for WEMOS D1 mini board.
    Incorrect library found in C:\nCh4ist0DocumentsArduino\nlibraries\nmcauser-64x48-O LED-SSD1306-library-master: header files missing (.
    Invalid library found in C:\nUsers4ist0\nDocumentsArduino\nmcauser-64x48-O LED-SSD1306-library-master: header files missing (.
    Invalid library found in C:\nUsers4ist0\nDocumentsArduino\nmcauser-64x48-O LED-SSD1306-library-master: header files missing (.

    This report should contain more information if in
    File -> Preferences the option "Show
    detailed information during compilation"
    .
  • Helpful post
    #23 17989415
    kaczakat
    Level 34  
    A good library was actually given to you by @khoam the third time, i.e. in post #18. Good insofar as it is recommended by the project author esp8266_deauther.
    How to configure OLED 0.66 I2C with esp8266_deauther on WeMos D1 mini? .

    Anyway, you must have had it installed, otherwise you wouldn't have seen anything on the screen, even the incorrectly displayed stuff. The program would simply not compile.
    Unfortunately this library does not support oled 64x48. Which is strange, because in the library description this screen is mentioned, unfortunately in the OLEDDisplay.h file it is only:
    Code: C / C++
    Log in, to see the code
    .
    That's why I've thrown you an example with a working library, you fire up the example, check that it works properly and by editing yours you can add support for your screen. You can actually add any screen with any library, just there is a lot of re-editing in the sources, translating oled library commands into functions from the "deauther" project.
    Back on topic, where you initialise the screen to work on I2C you also specify the screen geometry, e.g. :
    Code: C / C++
    Log in, to see the code
    .
    but this obviously doesn't work, because as you can see above there is no such geometry defined.
    How to configure OLED 0.66 I2C with esp8266_deauther on WeMos D1 mini? .
    When you specify defined in the library, everything compiles correctly:
    How to configure OLED 0.66 I2C with esp8266_deauther on WeMos D1 mini? .
    You can add support for this geometry yourself, but there is no guarantee that this will work properly, the texts may be too long, the number of lines may also look funny.
    If you will edit something manually in the libraries use Notepad2 or Notepad++.
    Add geometry to start with:
    Code: C / C++
    Log in, to see the code
    .

    And then in the OLEDDisplay.cpp file wherever it is used you must add options to select it:
    Code: C / C++
    Log in, to see the code
    .
    Where else you need to mix things up and whether it works I won't check, because I don't have such a screen. But I wish you the best of luck.
    Helpful post? Buy me a coffee.
  • #24 17991130
    Ch4ist0
    Level 6  
    Where do you see this file "LEDDisplay.h/.cap" I don't see it in the project "esp8266_deauther", there is only "DisplayUI" and its contents are:
    ddbbd5eaf .


    This Deauther project in my Arduino looks like this:
    esp8266_de...-2.1.0.zip Download (1.28 MB) .
    How to configure OLED 0.66 I2C with esp8266_deauther on WeMos D1 mini?Bez tyt...png Download (67.26 kB) .

    Do I understand correctly the libraries I have to add to the tab/file A_Config.h ????
    How to configure OLED 0.66 I2C with esp8266_deauther on WeMos D1 mini?Bez tytu..2.png Download (92.36 kB)


    Where should I change the screen geometry if I don't have the "LEDDisplay.h" file ?
  • #26 17991337
    Ch4ist0
    Level 6  
    OK. I give up. Please if someone can do for me what I need to do with this soft:

    "deauther_2.1.0_4mb.bin" ---->[url=]https://github.com/spacehuhn/esp8266_deauther/releases/download/v2.1.0/deauther_2.1.0_4mb.bin[/url] .

    I have the WeMos D1 Mini Pro chip from the website --->[url=]https://nettigo.pl/products/modul-wifi-wemos-d1-mini-pro[/url] .

    And an OLED 0.66" I2C screen --->[url=]https://nettigo.pl/products/wyswietlacz-oled-0-66-i2c-dedykowany-do-wemos-d1-mini[/url]

    The problem is that the soft works normally but on the screen you can't see the whole thing, it cuts off most of it and you can't do anything from the screen....

    If you could send me modified Deauther 2.1.0.bin or project for arduino I will flash it and let you know if it works, I don't have the strength anymore... ;/
  • #27 17991549
    kaczakat
    Level 34  
    It takes a bit of effort to become a soft deauther hacker. You had the library for the OLED added correctly, since you compiled it, uploaded it and it displays something.
    You probably have it in the Arduino/libraries/ directory - find the SSD1306Wire.h file used in A_config.h, next to it are the files that need editing LEDDisplay.h and OLEDDisplay.cpp.
    Just because you add support for a smaller screen doesn't mean it won't cut off something on the screen.
    Helpful post? Buy me a coffee.
  • #28 17991825
    Ch4ist0
    Level 6  
    This is my first time with Arduino, at the beginning I used WeMos D1 mini chip (ESP8266) with uploaded deauther software from .bin file using another flashing program, everything is fine deauther works as it should, but I would like to attach the screen, after connecting and enabling the functions in the software, the screen displays, but not as needed, I have not edited anything in the software, only need to attach libraries and configure, but I do not have such knowledge and experience. I will continue to try and I am waiting for clearer tips or if someone wants to play with it on the ready :)
  • Helpful post
    #29 17991974
    kaczakat
    Level 34  
    You find the LEDDisplay.h file on the disk, right-click, select edit with Notepad++ (you must have it installed), make the above described corrections, analogously the second file, start Arduino, in the tab of the A_config.h file you change about 69 lines to such a notation:
    #define DEAUTHER_DISPLAY SSD1306Wire display = SSD1306Wire(0x3c, 5, 4,GEOMETRY_64_48); // for 0.96" OLED
    You compile, upload and wonder what else is wrong.
    Maybe being a hacker is not your calling?
    Helpful post? Buy me a coffee.
  • Helpful post
    #30 17993036
    rb401
    Level 39  
    Ch4ist0 wrote:
    The problem is that the soft works normally but on the screen you can't see the whole thing, it cuts off most of it and you can't do anything from the screen....


    I've looked in the sources and I can clearly see that in this program the display is rigidly written for 128x64 resolution. It is mainly about the DisplayUI.h file.
    That's why it will cut you off and without a thorough rewrite of that (and possibly DisplayUI.cpp) you won't do it with one magic move. Because it simply wasn't intended by the author.
    He wrote under 128x64 and you want to display it on 64x48.
    So cursorily looking at the sources, I'm not saying it can't be done (especially when it comes to menus). But you also have to experiment a bit and possibly accept compromises.
    The main difficulty lies in fitting the content in.
    The author has chosen a font to fit about 5 lines of 18 characters each in a fixed width font:
    How to configure OLED 0.66 I2C with esp8266_deauther on WeMos D1 mini? .

    and now while I find it realistic to achieve five lines on the display with D1 e.g. character height 8 plus 1 for spacing and using characters that don't "stick down" like j, q, p, y etc. . Which, by the way, the author has taken into account because he uses, as far as I can see, only capital letters for the menu on the OLED.

    But fitting 18 characters on a 64pix line is hardly feasible, as it would be less than 4 pixels per character, i.e. completely unreadable. It would be possible to use a proportional font, but then the number of possible characters per line would depend on the content of a particular inscription. That is, whether there are more narrow letters such as I, J or wide letters such as W, M. But this does not save much.

    When it comes to the menu itself, for example, reducing the number of characters per line is not a problem. For example, there is no need for the item "PACKET MONITOR", as this name can be easily shortened.
    It is worse with a list where there could be longer subtitles, e.g. a list of SSIDs or something like that, but I do not know, I have not looked at the sources and I have not seen this design in person. Maybe truncating such content would not be a tragedy and maybe it would be possible to break longer lines (this library from OLED has such functionality). But this already needs to be assessed in the context of a working device.


    So that's it in a nutshell. To make this device support the display from D1 you need at least:

    - set the esp8266-oled-ssd1306 library correctly to work with a resolution of 64x48.
    It is possible that you already have this done, as I look above here.

    - Realign the constants in the DisplayUI.h file to the new resolution. At least the highlighted ones, e.g. lineHeight should be 9 to keep five lines:

    How to configure OLED 0.66 I2C with esp8266_deauther on WeMos D1 mini? .

    - generate another font using the method given in the library for OLED, instead of the DejaVu_Sans_Mono_12 used. Smaller in height and width and still readable (but it's a matter of experimentation) e.g. Roboto_Mono_Thin_10 and change the calls in DisplayUI.cpp (by the way, change the reference to the built-in font ArialMT_Plain_24 to e.g. ArialMT_Plain_10, as it may not fit either).

    - shorten long names that may appear on the display like "PACKET MONITOR" etc. . These names are in the language.h file. However, only some of the subtitles defined there are related to the OLED display (certainly the ones starting with "D_" and some other ones that may appear on the OLED indirectly, e.g. specifying some parameters, e.g. "WPA2") and need to be shortened (so that they do not fit into the file). ) and need to be abbreviated (so that, for example, you do not touch the chicken).
  • Topic summary

    The discussion revolves around configuring a 0.66" OLED I2C display with the esp8266_deauther software on a WeMos D1 mini. The user encountered issues with display compatibility, as the software was designed for a 0.96" display, leading to incorrect rendering of information. Participants suggested using the U8G library and the Adafruit_SSD1306 library to support the 64x48 resolution of the OLED. The user was guided on how to install libraries, modify the A_config.h file, and compile the project. Ultimately, the user decided to switch to a 0.96" OLED display, which is natively supported by the software, to avoid the complexities of modifying the code for the smaller screen.
    Summary generated by the language model.
    ADVERTISEMENT