ArduinoGeneral

FireBeetle Covers ePaper Black&White only works in Arduino IDE and not in PlatformIO

userHead oli.gafner28 2020-05-25 20:36:34 1803 Views5 Replies
I work on a project with a Firebeetle ESP32 and the E-Ink display in PlatformIO and somehow the display renders objects and lines but not text when I compile the example code from https://wiki.dfrobot.com/FireBeetle_Cov ... 1#target_4 in PlatformIO. When I compile the same code in Arduino IDE shapes, lines AND TEXT get displayed as it should. I've included the same libraries. The output from PlatformIO is as follows:
Code: Select all
> Executing task: C:\Users\User\.platformio\penv\Scripts\platformio.exe run --target upload <

Processing firebeetle32 (platform: espressif32; board: firebeetle32; framework: arduino)
----------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/firebeetle32.html
PLATFORM: Espressif 32 1.12.1 > FireBeetle-ESP32
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
 - framework-arduinoespressif32 3.10004.200129 (1.0.4)
 - tool-esptoolpy 1.20600.0 (2.6.0)
 - tool-mkspiffs 2.230.0 (2.30)
 - toolchain-xtensa32 2.50200.80 (5.2.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 29 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <Tiny BME280> 1.0.2
|   |-- <SPI> 1.0
|   |-- <Wire> 1.0.1
|-- <DFRobot_ePaper-master>
|   |-- <DFRobot_Display-master>
|   |   |-- <SPI> 1.0
|   |   |-- <Wire> 1.0.1
|   |-- <Wire> 1.0.1
|   |-- <SPI> 1.0
Building in release mode
Compiling .pio\build\firebeetle32\src\main.cpp.o
src\main.cpp: In function 'void setup()':
src\main.cpp:25:39: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
     epaper.disString(0,0,1,"SPI",BLACK);
                                       ^
src\main.cpp:73:43: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
     epaper.disString(215,12, 2,"pic",BLACK);
                                           ^
src\main.cpp:74:45: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
     epaper.disString(215,78, 2,"shape",BLACK);
                                             ^
Linking .pio\build\firebeetle32\firmware.elf
Building .pio\build\firebeetle32\firmware.bin
Retrieving maximum program size .pio\build\firebeetle32\firmware.elf
Checking size .pio\build\firebeetle32\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   5.0% (used 16260 bytes from 327680 bytes)
Flash: [==        ]  18.5% (used 242647 bytes from 1310720 bytes)
esptool.py v2.6
Configuring upload protocol...
AVAILABLE: esp-prog, espota, esptool, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa
CURRENT: upload_protocol = esptool
Looking for upload port...
Use manually specified: COM9
Uploading .pio\build\firebeetle32\firmware.bin
esptool.py v2.6
Serial port COM9
Connecting....
Chip is ESP32D0WDQ5 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
MAC: c8:2b:96:99:5f:18
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Auto-detected Flash size: 16MB
Flash params set to 0x0240
Compressed 15872 bytes to 10319...

Writing at 0x00001000... (100 %)
Wrote 15872 bytes (10319 compressed) at 0x00001000 in 0.2 seconds (effective 533.5 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 128...

Writing at 0x00008000... (100 %)
Wrote 3072 bytes (128 compressed) at 0x00008000 in 0.0 seconds (effective 4093.7 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...

Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 16440.1 kbit/s)...
Hash of data verified.
Compressed 242768 bytes to 125066...

Writing at 0x00010000... (12 %)
Writing at 0x00014000... (25 %)
Writing at 0x00018000... (37 %)
Writing at 0x0001c000... (50 %)
Writing at 0x00020000... (62 %)
Writing at 0x00024000... (75 %)
Writing at 0x00028000... (87 %)
Writing at 0x0002c000... (100 %)
Wrote 242768 bytes (125066 compressed) at 0x00010000 in 2.9 seconds (effective 679.3 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
=========================================================== [SUCCESS] Took 18.04 seconds ===========================================================
The code looks as follows:
Code: Select all
#include "Arduino.h"
#include "DFRobot_IL3895_SPI.h"

DFRobot_IL3895_SPI epaper;

#define D3 26
#define D6 10
#define D8 5
#define D7 13

#define EPAPER_CS  D3
#define Font_CS  D6
#define EPAPER_DC  D8
#define EPAPER_BUSY     D7

void setup(void)
{
    Serial.begin(115200);
    epaper.begin(EPAPER_CS, Font_CS, EPAPER_DC, EPAPER_BUSY); //Select the corresponding pins
    epaper.fillScreen(WHITE);//Clear the screen and display white
    epaper.flush(FULL);  //Refresh screen display
    /*Displays a string, black font*/
    epaper.disString(0,0,1,"SPI",BLACK);
    epaper.flush(PART);

    /*Let me draw a red dot*/
    for(uint8_t x=12,y=12; y<110; y+=3)
    {
        epaper.drawPixel(x,y,BLACK);
    }
    epaper.flush(PART);

    /*Draw two lines*/
    epaper.drawLine(24,12, 36,110,BLACK);
    epaper.drawLine(36,12, 24,110,BLACK);
    epaper.flush(PART);

    /*Draw a red rectangle*/
    epaper.drawRect(48,12, 40,98,BLACK);
    epaper.flush(PART);

    /*Fill a rectangle with black*/
    epaper.fillRect(55,19, 26,84,BLACK);
    epaper.flush(PART);

    /*Draw a hollow circle*/
    epaper.drawCircle(122,37, 25,BLACK);
    epaper.flush(PART);

    /*Draw a solid circle*/
    epaper.fillCircle(122,37, 18,BLACK);
    epaper.flush(PART);

    /*Draw a rounded rectangle*/
    epaper.drawRoundRect(97,67, 50,43, 10,BLACK);
    epaper.flush(PART);

    /*Fill in a rounded rectangle*/
    epaper.fillRoundRect(102,72, 40,33, 8,BLACK);
    epaper.flush(PART);

    /*Draw a triangle*/
    epaper.drawTriangle(180,12, 155,110, 205,110,BLACK);
    epaper.flush(PART);

    /*Fill in a triangle*/
    epaper.fillTriangle(180,23, 162,105, 198,105,BLACK);
    epaper.flush(PART);

    /*Prompt characters*/
    epaper.disString(215,12, 2,"pic",BLACK);
    epaper.disString(215,78, 2,"shape",BLACK);
    epaper.flush(PART);
}

void loop(void)
{
    delay(8000);
}
Here is a look at my platformio.ini flie:
Code: Select all
; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env:firebeetle32]
platform = espressif32
board = firebeetle32
framework = arduino
upload_port = COM9
monitor_port = COM9
monitor_speed = 115200

lib_deps =
    Tiny BME280
Any ideas why the text gets only rendered when compiled with Arduino IDE and not in PlatformIO
2020-06-26 05:25:43 Thanks Christophe and Nana

The commenting of the "supportChineseFont();" line does the trick for me since I don't plan on using chinese font any time soon ;) . Thanks for sharing your insights with me.
userHeadPic oli.gafner28
2020-06-13 17:28:30 Hello,

I have exactly the same problem with PlateformIO, the texts are not displayed. Same configuration as Oli and same sources. I found a solution by commenting the line "supportChinesFont ()" on the class DFRobot_IL3895_SPI :: disStringIL3895SPI

void DFRobot_IL3895_SPI::disStringIL3895SPI(uint8_t x, uint8_t y, uint8_t size, char *ch, uint8_t color)
{
DFR_W21_CS_1;
GT30L_setCSPin(DFR_GT30_CS);
setTextSize(size);
//supportChineseFont();
setTextColor(color);
setCursor(x,y);
print(ch);
}

Christophe
userHeadPic cnale
2020-06-04 03:37:45 Thanks for the Help, let me know when you find something. Looks like the libraries are not the same somehow... userHeadPic oli.gafner28