B4R Question SH1106 LCD Display and ESP2688 Issues

Cableguy

Expert
Licensed User
Longtime User
Hi Guys

This is my Code:
B4X:
Sub Process_Globals
    Public Serial1 As Serial
    Private LCD As AdafruitSH1106  
    Private ESP As ESP8266
    Public RegistrationStatus As Bool
End Sub

Private Sub AppStart
    Serial1.Initialize(115200) 'This is the Hardware Serial used by the IDE for Logging
    LCD.InitializeI2C(4, 0x3c)
End Sub

And Here is what it logs:
B4X:
B4R Version: 2.20
Parsing code.    (0.00s)
Compiling code.    (0.01s)
Building project    (0.11s)
Compiling & deploying Ino project (WeMos D1 R2 & mini - COM4)    Error
Loading configuration...
Initialising packages...
Preparing boards...
Verifying...
E:\B4X\LaserControler\Objects\bin\sketch\Adafruit_SH1106.cpp:29:26: fatal error: avr/pgmspace.h: No such file or directory
 #include <avr/pgmspace.h>
                          ^
compilation terminated.
exit status 1

This seems to be a Lib problem (as opposed to code).
The SSD1306 lib does not produce any errors!
So.... HELP???
 
Last edited:

Cableguy

Expert
Licensed User
Longtime User
The difference between the two of them is that they use different "drivers" and thus require different libs... a quick search in the forum using only "1306" as keyword will get you all the info you need
 
Upvote 0

rabbitBUSH

Well-Known Member
Licensed User
Upvote 0

rabbitBUSH

Well-Known Member
Licensed User
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
Did ESP work for you with the SH1106? 🙏
So, after a few pulled from my head by my own hands, uncontrollable by my brain... I got to the conclusion that the SH1106 lib has somehow become uncompatible with newer versions of B4R. Why? It simply doesn't compile... how ever, using SS1306 lib, and of course, corresponding LCD, does compile AND work!
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
I will try to further investigate...
InB4R IDE, selecting new->Esp never compiled (tested with NodeMCU and Wemos R1 mini), but if selected new->arduino, it compiled ok...
It had been a while si ce I touched my ESP8266 boards... so I thought I was doing something wrong, until I just pulled out an .in file and uploaded from arduino and it worked...
I guess the b4r libs need re-testing
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
So, my findings, for what they're worth....

B4R has a very hard time getting the COMs ports open/working... and no info status whatsoever about it...
After a few ( a lot) of tries with my 2 ESP8266 boards, where NodeMCU did compile, but I couldn't find the right pins for the I2C, and my Wemos R1 mini never got the dahm COM port open, I decided to try my ESP32 DEV KIT.

The SSD1306 did work as expected, and I have video to prove it!

 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
The SH1106 lib seems to have some issues, specially this one:
IC:\\Users\\psapg\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6/tools/sdk/include/esp-face" "-IC:\\Users\\psapg\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6/tools/sdk/include/fb_gfx" -std=gnu++11 -Os -g3 -Wpointer-arith -fexceptions -fstack-protector -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -w -Wno-error=maybe-uninitialized -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-missing-field-initializers -Wno-sign-compare -fno-rtti -c -w -x c++ -E -CC -DF_CPU=240000000L -DARDUINO=10813 -DARDUINO_ESP32_DEV -DARDUINO_ARCH_ESP32 "-DARDUINO_BOARD=\"ESP32_DEV\"" "-DARDUINO_VARIANT=\"esp32\"" -DESP32 -DCORE_DEBUG_LEVEL=0 "-IC:\\Users\\psapg\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\cores\\esp32" "-IC:\\Users\\psapg\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\variants\\esp32" "-IC:\\Users\\psapg\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\libraries\\SPI\\src" "C:\\Users\\psapg\\DOWNLO~1\\BOUNCI~1\\B4R\\Objects\\bin\\sketch\\src.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE
"C:\\Users\\psapg\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\xtensa-esp32-elf-gcc\\1.22.0-97-gc752ad5-5.2.0/bin/xtensa-esp32-elf-g++" -DESP_PLATFORM "-DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\"" -DHAVE_CONFIG_H -DGCC_NOT_5_2_0=0 -DWITH_POSIX "-IC:\\Users\\psapg\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6/tools/sdk/include/config" "-IC:\\Users\\psapg\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6/tools/sdk/include/fb_gfx" -std=gnu++11 -Os -g3 -Wpointer-arith -fexceptions -fstack-protector -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -w -Wno-error=maybe-uninitialized -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-missing-field-initializers -Wno-sign-compare -fno-rtti -c -w -x c++ -E -CC -DF_CPU=240000000L -DARDUINO=10813 -DARDUINO_ESP32_DEV -DARDUINO_ARCH_ESP32 "-DARDUINO_BOARD=\"ESP32_DEV\"" "-DARDUINO_VARIANT=\"esp32\"" -DESP32 -DCORE_DEBUG_LEVEL=0 "-IC:\\Users\\psapg\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\cores\\esp32" "-IC:\\Users\\psapg\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\variants\\esp32" "-IC:\\Users\\psapg\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\libraries\\SPI\\src" "C:\\Users\\psapg\\DOWNLO~1\\BOUNCI~1\\B4R\\Objects\\bin\\sketch\\Adafruit_GFX.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE
"C:\\Users\\psapg\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\xtensa-esp32-elf-gcc\\1.22.0-97-gc752ad5-5.2.0/bin/xtensa-esp32-elf-g++" -DESP_PLATFORM "-DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\"" -DHAVE_CONFIG_H -DGCC_NOT_5_2_0=0 -DWITH_POSIX "-IC:\\Users\\psapg\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6/tools/sdk/include/config" "-IC:\\Users\\psapg\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6/tools/sdk/include/esp-face" "-IC:\\Users\\psapg\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6/tools/sdk/include/fb_gfx" -std=gnu++11 -Os -g3 -Wpointer-arith -fexceptions -fstack-protector -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -w -Wno-error=maybe-uninitialized -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-missing-field-initializers -Wno-sign-compare -fno-rtti -c -w -x c++ -E -CC -DF_CPU=240000000L -DARDUINO=10813 -DARDUINO_ESP32_DEV -DARDUINO_ARCH_ESP32 "-DARDUINO_BOARD=\"ESP32_DEV\"" "-DARDUINO_VARIANT=\"esp32\"" -DESP32 -DCORE_DEBUG_LEVEL=0 "-IC:\\Users\\psapg\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\cores\\esp32" "-IC:\\Users\\psapg\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\variants\\esp32" "-IC:\\Users\\psapg\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\libraries\\SPI\\src" "C:\\Users\\psapg\\DOWNLO~1\\BOUNCI~1\\B4R\\Objects\\bin\\sketch\\Adafruit_SH1106.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE
Adafruit_SH1106.cpp:29:26: fatal error: avr/pgmspace.h: No such file or directory
compilation terminated.
Alternatives for avr/pgmspace.h: []
ResolveLibrary(avr/pgmspace.h)
-> candidates: []
Using library SPI at version 1.0 in folder: C:\Users\psapg\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\SPI
exit status 1
DEBUG StatusLogger Stopping LoggerContext[name=1e6f5c3, org.apache.logging.log4j.core.LoggerContext@dd7b39]
DEBUG StatusLogger Stopping LoggerContext[name=1e6f5c3, org.apache.logging.log4j.core.LoggerContext@dd7b39]...
TRACE StatusLogger Unregistering 1 MBeans: [org.apache.logging.log4j2:type=1e6f5c3]
TRACE StatusLogger Unregistering 1 MBeans: [org.apache.logging.log4j2:type=1e6f5c3,component=StatusLogger]
TRACE StatusLogger Unregistering 1 MBeans: [org.apache.logging.log4j2:type=1e6f5c3,component=ContextSelector]
 
Upvote 0
Top