U8g2 Serial Monitor on ESP8266 MOD oled 0.96

I'm using the program called Minigotchi on an "IdeaSpark" Esp 8266 Mod with a 0.96 OLED display. Minigotchi prints its information on the Serial and my intent is to print this information on the OLED. I'm having quite a few problems finding the right command.
This is the main code, modified by adding the U8G2 library, but with no success.
The OLED doesn't show anything.
Thank you for your help.

My board: https://www.amazon.com/Development-Wireless-Micropython-Programming-Soldered/dp/B0BVM3H46B
This in Minigothi Github rep: GitHub - Pwnagotchi-Unofficial/minigotchi: an even smaller pwnagotchi. maintained by @dj1ch

#include <Arduino.h>
#include "config.h"
#include "minigotchi.h"

#include <U8g2lib.h>
#ifdef U8X8_HAVE_HW_SPI
#include <SPI.h>
#endif
#ifdef U8X8_HAVE_HW_I2C
#include <Wire.h>
#endif
U8G2_SSD1306_128X64_NONAME_F_SW_I2C u8g2(U8G2_R0, /* clock=*/ 14, /* data=*/ 12, /* reset=*/ U8X8_PIN_NONE);   // ESP32 Thing, pure SW emulated I2C



Config config;
Minigotchi minigotchi;


void setup(void) {
    Serial.begin(config.baud);
    u8g2.begin();
    u8g2.enableUTF8Print();
    
    //u8g2log.setRedrawMode(1);
    minigotchi.boot();
}

/** developer note: 
 *
 * everything should have been moved to minigotchi.cpp
 * as the program becomes more complicated, it gets easier to maintain all the main features in one file
 * 
*/

void loop(void) {
    char c;
    if (Serial.available() > 0) {	
      c = Serial.read();
      u8g2.setFont(u8g2_font_profont12_tf);	// choose a suitable font
      u8g2.setFontDirection(0);
      u8g2.clearBuffer();
      u8g2.setCursor(0,30);
      u8g2.print(c);
      u8g2.sendBuffer();
      delay(1000);
    
    }

   
    // cycle channels at start of loop
    minigotchi.cycle();
    delay(5000);

    // the longer we are on this channel, the more likely we're gonna see a pwnagotchi on this channel
    // get local payload from local pwnagotchi, send raw frame if one is found
    minigotchi.detect();
    delay(5000);

    // ugly hack: remove all these lines containing the words "delay(5000);" or comment them out with a "//" slash.
    // doing so will make the loop a lot faster. plus this might overheat the board and stuff but its worth a try.

    // deauth random access point
    minigotchi.deauth();
    delay(5000);
}

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.