• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

ESP32 with U8g2 Examples problem

Q&A Forum › Category: ESP32 › ESP32 with U8g2 Examples problem
0 Vote Up Vote Down
Chuck Ziegler asked 2 years ago

Hi, Using Board “ESP32 Dev Module” board in Arduino IDE 1.8.13, none of the “U8g2/full buffer/…” Examples will compile, e.g. the simple “Hello World”. 
Used the U8g2lib.h.
I am using display:
U8G2_ST7920_128X64_F_SW_SPI u8g2(U8G2_R0, /* clock=*/ 18, /* data=*/ 23, /* CS=*/ 5, /* reset=*/ 22);
every compile Example produces this error:
exit status 1
Error compiling for board ESP32 Dev Module.
If anyone can get these U8g2 examples with an ST7920 board, , please let me know how you did it.

Question Tags: ESP32, U8g2
8 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Hi.
I never tried that library.
But, what is exactly the error that you’re getting? Can you copy the complete error?
Regards,
Sara

0 Vote Up Vote Down
Chuck Ziegler answered 2 years ago

Thanks for the response Sarah. I may be making the question too confusing.
More simply, I want to drive an LCD 128×64 display screen of the type “ST7920”.
I can make it work with an Arduino Nano but not an ESP32. I used this: https://github.com/olikraus/u8glib
for the Nano.
My goal is to use this display, or else a similar display with the ESP32.
Perhaps a suggestion/reccomendation for an alternative ESP32-friendly Display would help me. Size has to be at lease 70mmx40mm display area.
Thanks.
https://photos.app.goo.gl/USukUAehEqKWuwnJ6

https://photos.app.goo.gl/xpjEFk2FC8xMk7NWA

0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Hello there!
I’ve just noticed that there is a new version of that library available. Have you had a chance to try it out yet? You can find it here: https://github.com/olikraus/u8g2.
But what is exactly the error that you get with the ESP32?
Regards,
Sara
 

0 Vote Up Vote Down
Chuck Ziegler answered 2 years ago

I’ll try again with your suggestion with U8g2 and get back to you. I suspect I may have put the library “.h” files in the wrong location.
Thanks

0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Ok.
Then, let me know.
Regards,
Sara

0 Vote Up Vote Down
Chuck Ziegler answered 2 years ago

Hi Sarah,  Finally got it working. Thanks for your interest.
After I repaired my “libraries” location (I keep it on Google Drive with the Arduino Sketches) I experimented by using the ESP32 HSPI interface instead of the VSPI. Better. Then with the oscope I realised the ESP32 CS pin (chip select) was selecting incorrectly so I attached it to 3.3V (permanently on). The the U8g2 library examples all functioned properly. Hooray!

(I will study the ESP32 to learn the difference between HSPI and VSPI now. Any hints welcome)

0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Hi.
I’m glad you found the issue.
If you want to learn more about SPI, we have this guide: https://randomnerdtutorials.com/esp32-spi-communication-arduino/
 
I’ll mark this issue as resolved. If you need further help, you just need to open a new question in our forum.
Regards,
Sara

0 Vote Up Vote Down
Chuck Ziegler answered 2 years ago

Thanks, I also decided to move from Arduino 1.8 to Arduino IDE 2.1.1 and clean up the libraries. That problem led to some improvement.

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.