Git Product home page Git Product logo

m5epd's Introduction

M5Paper Library

Arduino Compile Arduino Lint Clang Format

English | 中文

m5paper_pic_01

Description

M5Paper is M5Stacks latest core device with a touch enabled E-ink display. Powered by the ESP32-D0WDQ6-V3 this is our first device to integrate a super sized 540*960 @4.7" E-ink display,which supports 16 grayscale levels. The display is a GT911 capacitive touch screen,which supports two point touch and a variety of gesture controls . Compared to a regular LCD,E-ink displays are easier on the eyes, which makes them a great choice for reading or viewing for longer periods. Other benefits are the low power consumption and the ability to retain the image even if power to the display is terminated. Integrated in the CoreInk are an multi-function button for operation, SHT30 temperature and moisture sensor, physical buttons and an TF card port for data storage.

Additionally the FM24C02 internal eeprom chip(256KB-EEPROM)can be used to store vital data even when the device is off. A 1150mAh lipo battery keeps the device going for long periods and battery life can be further preserved by using the RTC(BM8563)to set the device into deep sleep and wake it up again when needed。Three HY2.0-4P expansion ports are included which allow for building complex projects using the existing sensors in the M5Stack ecosystem.

?>Warning: Do not expose to ultraviolet rays for a long time, otherwise it may cause irreversible damage to the ink screen.

PinMap

E-INK & TF Card

Resolution:540*960

ESP32 ChipGPIO13GPIO12GPIO14GPIO15GPIO4
IT8951MISOMOSISCKCS/
TF CardMISOMOSISCK/CS

Multi-function button

ESP32 ChipGPIO37GPIO38GPIO39
Multi-function buttonRightBTN/PWRLeft

Internal I2C Connection

ESP32 ChipGPIO21GPIO22GPIO36
GT911SDASCLINT
SHT30SDASCL/
BM8563SDASCL/
FM24C02SDASCL/

USB Serial

ESP32 ChipGPIO1GPIO3
CP2104RXDTXD

M5Paper-HY2.0 4P Port

PORT PIN Protocol:
PORT.A G25,G32 I2C
PORT.B G26,G33 DAC/ADC
PORT.C G18,G19 UART

ESP32 ADC/DAC Mappable Pins

ADC1 ADC2 DAC1 DAC2
8 Channel 10 Channel 2 Channel 2 Channel
G32-39 G0/2/4/12-15/25-27 G25 G26

For more info on specific pin functions refer to the official ESP32 DocsESP32 datasheet

How to compile it

For Windows

  1. Install ESP-IDF v4.4. For further info, read: ESP-IDF Getting Started for Windows

    • Either the Online or Offline version shoud work
    • When asked which components to install, don't change anything. Default options are Ok.
    • When asked whether ESP can modify the system, answer "Yes"
  2. Launch the "ESP-IDF v4.4 CMD" (type that in the Windows search box)

  3. From the ESP-IDF cmd, clone the template

    git clone --recursive https://github.com/m5stack/M5EPD.git my_project
  4. Compile it

    # Compile it
    cd my_project
    idf.py build
    
    # Flash + open debug terminal
    idf.py flash monitor

For Linux / macOS

  1. Requirements and permissions

    Install ESP-IDF dependencies (taken from here):

    # For Ubuntu / Debian
    sudo apt-get install git wget flex bison gperf python3 python3-pip python3-setuptools cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0

    And in case you don't have permissions to open /dev/ttyUSB0, do: (taken from here)

    # You MUST logout/login (or in some cases reboot Linux) after running this command
    sudo usermod -a -G dialout $USER
  2. Install and setup ESP-IDF

    # Needs to be done just once
    # Clone the ESP-IDF git repo
    mkdir ~/esp && cd ~/esp
    git clone -b release/v4.4 --recursive https://github.com/espressif/esp-idf.git
    
    # Then install the toolchain
    cd ~/esp/esp-idf
    ./install.sh
  3. Compile the template

    Clone the template:

    # Do it everytime you want to start a new project
    # Clone the template somewhere
    mkdir ~/src && cd ~/src
    git clone --recursive https://github.com/m5stack/M5EPD.git my_project

    Export the ESP-IDF environment variables in your shell:

    # Do it everytime you open a new shell
    # Optional: add it in your ~/.bashrc or ~/.profile
    source ~/esp/esp-idf/export.sh

    And finally compile and install your project.

    # Compile it
    cd ~/src/my_project
    idf.py build
    
    # Flash + open debug terminal
    idf.py flash monitor

Using 3rd party Arduino libraries

To include 3rd party Arduino libraries in your project, you have to:

  • Add them to the components folder.
  • Add a file component.mk and/or CMakeLists.txt inside the component's folder

component.mk is needed if you use make to compile it. And CMakeLists.txt is needed if you use idf.py to compile it.

Let's use a real case as example:

Example: Adding ESP32Servo

Suppose you want to use ESP32Servo project. The first thing to notice is that the source files are placed in the src folder. We have to create a component.mk and/or CMakeLists.txt files that tells the ESP-IDF to look for the sources in the src folder.

Example:

# 1) We clone ESP32Servo into components folder
cd components
git clone https://github.com/madhephaestus/ESP32Servo.git
cd ESP32Servo

And now create create these files files inside components/ESP32Servo folder:

# 2) Create component.mk file
# Only needed if you use "make" to compile the project
# Copy & paste the following lines to the terminal:
cat << EOF > component.mk
COMPONENT_ADD_INCLUDEDIRS := src
COMPONENT_SRCDIRS := src
EOF
# 3) Create CMakeLists.txt file
# Only needed if you use "idf.py" to compile the project
# Copy & paste the following lines to the terminal:
cat << EOF > CMakeLists.txt
idf_component_register(SRC_DIRS "src"
                    INCLUDE_DIRS "src"
                    REQUIRES "arduino")
EOF

Finally, if you use idf.py, you have to update the dependencies in the main/CMakeLists.txt. E.g:

# Needed if you use "idf.py" to compile the project
cd main
edit CMakeLists.txt

...and append ESP32Servo to REQUIRES. The main/CMakeLists.txt should look like this:

idf_component_register(SRCS "${srcs}"
                    INCLUDE_DIRS "."
                    REQUIRES "${requires}" "ESP32Servo")

And that's it. Now you can include ESP32Servo from your code. E.g:

// Add this include in your arduino_main.cpp file
#include <ESP32Servo.h>

IDE

Arduino IDE is not supported, but you can use Visual Studio Code + ESP-IDF plugin.

You can do:

  • All the regular Visual Studio Code regular features
  • ...plus configure, build, flash and monitor your project
  • ...and much more

ide

Subjective opinion: VSCode + ESP-IDF plugin is muuuuuch better than Arduino IDE. Highly recommended!

Related Link

This detailed compilation instruction comes from this awesome repository: Bluepad32 for Arduino

Schematic

m5epd's People

Contributors

3110 avatar bluejazzchn avatar chipguyhere avatar estshorter avatar felmue avatar forairaaaaa avatar gitshaoxiang avatar icyqwq avatar ikedam avatar majo-icutech avatar majormajors avatar neocat avatar staberas avatar tinyu-zhao avatar zontex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

m5epd's Issues

GT911 - Interrupt disabling causes target reset

I am checking M5EPD with sample code but target reset right after boot. It's seem to be issue with the Interrupt disabling in GT911 ISR. According to the note from esp32 which states ESP32xx runs FreeRTOS... disabling interrupts can lead to issues, such as Watchdog Timeout. Since when I was disable the interrupt disabling as bellow, the target didn't reset anymore, kindly check if we can do something better?

void ICACHE_RAM_ATTR ___GT911IRQ___()
{
    // noInterrupts();
    gt911_irq_trigger = 1;
    // interrupts();
}

M5paper stuck in - M5EPD initializing...OK - loop

Describe the bug

I tested some examples from this library(Touch, Button ...) and always see the same issue with my M5Paper board. It constantly restarts and is stuck in a loop printing "M5EPD initializing...OK" The full verbose output can be found below:

[ 2856][W][sd_diskio.cpp:174] sdCommand(): no token received
[ 2957][E][sd_diskio.cpp:199] sdCommand(): Card Failed! cmd: 0x00
[ 2957][W][sd_diskio.cpp:516] ff_sd_initialize(): GO_IDLE_STATE failed
[ 2958][E][sd_diskio.cpp:802] sdcard_mount(): f_mount failed: (3) The physical drive cannot work
[ 2967][W][sd_diskio.cpp:174] sdCommand(): no token received
[ 3072][W][sd_diskio.cpp:174] sdCommand(): no token received
[ 3173][W][sd_diskio.cpp:174] sdCommand(): no token received
[ 3274][E][sd_diskio.cpp:199] sdCommand(): Card Failed! cmd: 0x00
[ 3274][D][GT911.cpp:35] begin(): GT911: Initialization
[ 3274][I][esp32-hal-i2c.c:75] i2cInit(): Initialising I2C Master: sda=21 scl=22 freq=100000
OK
[ 5][D][esp32-hal-cpu.c:244] setCpuFrequencyMhz(): PLL: 480 / 2 = 240 Mhz, APB: 80000000 Hz
[ 453][I][esp32-hal-psram.c:96] psramInit(): PSRAM enabled

To reproduce

This happens with every project. I selected the M5paper as board (see image)
image

I also tried to upload the example with Platform IO with the following configuration:

[env:next-dev]
platform = espressif32
board = esp32dev
framework = arduino
upload_speed = 2000000
monitor_speed = 115200
upload_port = /dev/cu.wchusbserial537A0111951
lib_deps = m5stack/M5EPD@^0.1.4

Expected behavior

I haven't change a single line of code so just wanted to run the example. The M5Burner works for me, I have tested this :)

Screenshots

No response

Environment

  • OS:
  • IDE &IDE Version:
  • Tested with Arduino IDE and PIO in Vscode, both in the latest version
  • Repository Version:

Additional context

  • Can you help me, why is the board restarting all the time?
  • What is the right platform-io configuration?

Thanks and best regards,
Nils

Issue checklist

  • I searched for previous reports in the issue tracker
  • My report contains all necessary details

QR Code - Core 1 panic : when size > 26.


#include <M5EPD.h>

M5EPD_Canvas canvas(&M5.EPD);

int size = 300;

void setup() {
  M5.begin();
  M5.EPD.SetRotation(0);
  M5.EPD.Clear(true);
  canvas.createCanvas(960, 540);
  canvas.qrcode("Test", (960 - size) >> 1, 0, size, 27); // 7 to 40 (over 26 crashes)
  canvas.pushCanvas(0, 0, UPDATE_MODE_DU4);
}

void loop() {
  M5.update();
  delay(100);
}

Guru Meditation Error: Core 1 panic'ed (Unhandled debug exception)
Debug exception reason: Stack canary watchpoint triggered (loopTask)
0x400d38d1: qrcode_initBytes at F:\sarah\Documents\Arduino\libraries\M5EPD\src\utility\qrcode.c line 199
0x400d420a: qrcode_initText at F:\sarah\Documents\Arduino\libraries\M5EPD\src\utility\qrcode.c line 849
0x400d1c49: M5EPD_Canvas::qrcode(char const*, unsigned short, unsigned short, unsigned short, unsigned char) at F:\sarah\Documents\Arduino\libraries\M5EPD\src\M5EPD_Canvas.cpp line 451

File qrcode.c:

static void bb_initGrid(BitBucket *bitGrid, uint8_t *data, uint8_t size) {
  bitGrid->bitOffsetOrWidth = size;
  bitGrid->capacityBytes = bb_getGridSizeBytes(size);
  bitGrid->data = data;
  memset(data, 0, bitGrid->capacityBytes);  <<< Line 199
}

It looks like a memory issue.
We've got 8MB of useable PSRAM on the machine, can someone do some ps_alloc's?

Add compilation instructions

The project is missing compilation instructions.

I'd like to add some more functionality to the library, e.g. adding libzip, and fribidi, but without compilation instructions, it is not clear how to do that.

Deep sleep support

Is there any way when running on the battery to keep the device powered on when going into deep sleep?

I want to run some ULP code and currently as soon as I call esp_deep_sleep_start the device seems to power off completely.

Loading a ttf font to the M5paper from the sdcard causes error "but zero-sized"

What I did:

  1. Mounted a 16GB sd card to my desktop
  2. Created the directory /ttf in the root directory
  3. Copied over the font DejaVuSans.ttf to the sdcard to the directory /ttf
  4. Wrote an arduino sketch with the following code snippet in setup()
esp_err_t ret = cnv.loadFont("/ttf/DejaVuSans.ttf", SD);
  1. Compiled uploaded, opened serial monitor.
  2. Result: Get the following message in the serial monitor:
FT_Stream_Open: opened `/ttf/DejaVuSerif.ttf' but zero-sized

m5EPD version: 0.1.0

Confusion about power modes

Hi,

I want to use this device to get data from a server every 10 minutes update the display and then sleep.

This is all working fine, but I need to be able to put the device in config mode to set up the device connections etc.

What I ideally want to do is to have a user press the button on the side of the device to wake it up in config mode, but I can't figure out how the functionality of the device is supposed to work. The sleep seems to behave differently depending on if its plugged in or not. There isn't a way to detect if its main power or not (except I've noticed the battery voltage seems to read 284 when its plugged in?)

should the button on the side (the jog button) wake the device up even if its put to sleep on a timer?

sometimes I find that it just seems to get stuck, like I've somehow turned it off using this button. is it possible to turn it off using this button?

Many thanks,

Rob Smart

the shutdown() function isn't working for me.

Im using PlatformIO to work on a project with the M5 Paper and whenever I call the shutdown() function it just skips it as if it wasn't there.

As PlatformIO doesn't have M5Paper as a board option I'm using M5Stack-Core2 as my board.

Hope someone can help :)

Software license issue

I think SHT3x.h and SHT3x.cpp are derived from https://github.com/Risele/SHT3x which is licensed under the GPL-3.0. If I understand the GPL correctly, this repository must be licensed under the GPL-3.0 too.

Also, Button.h and Button.cpp are licensed under CC BY-SA 3.0, which means that this repository must be licensed under the CC BY-SA 3.0.

CommUtil.h and M5Timer.h are licensed under LGPL-2.1 (strictly speaking, LGPL-2.1-only and LGPL-2.1-or-later). They cannot be distributed under MIT license.

Note: I love M5Stack products, but everyone must obey the software license...

BM8563 wakeup from time

I have test the following cannot wakeup from specific time

    wakeuptime.hour = 10;
    wakeuptime.min = 34;
    wakeuptime.sec = 00;
    M5.shutdown(wakeuptime);

How to use unified library and power functions with Paper EPD

Describe the bug

I have made a project using the M5 Unified stack. Everything is good, and now I want to use the shutdown(n) and RTC wakeup features.

This porting guide is not very specific: http://docs.m5stack.com/en/quick_start/m5unified/migration

From the same site, there is: http://docs.m5stack.com/en/api/m5paper/rtc
but like most documentation for the M5 Paper, it assumes use of the M5EPD library.
However, this library can not work with the unified library.

http://docs.m5stack.com/en/api/m5paper/rtc

has example code, but the first line is
#include <M5Core2.h>

Do I need to install the library m5core2? It has many, many dependencies.
I did that, but compiling failed with this error:

In file included from /home/tim/Arduino/libraries/M5Core2/src/M5Core2.h:76,
from /home/tim/Arduino/bus_timetable/bus_timetable.ino:21:
/home/tim/Arduino/libraries/M5Core2/src/M5Display.h:90:16: error: reference to 'jpeg_div_t' is ambiguous

and others. So it seems this is not supposed to be used with the M5Unified library.
What to do?

To reproduce

Visit the documentation and see what I see,

Expected behavior

If M5 unified is to be used, then other documentation should be consistent. Power management with the Unified library for the Paper is not documented anywhere.

Screenshots

No response

Environment

  • OS: Linux
  • IDE &IDE Version: Arduino 2
  • Repository Version:

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • My report contains all necessary details

font_render.c ERROR on Arduino 1.8.12

font_render.c.o:(.literal.font_face_init+0x4): undefined reference to FT_New_Memory_Face' font_render.c.o:(.literal.font_face_init+0x8): undefined reference to FT_Init_FreeType'
font_render.c.o:(.literal.font_face_destroy+0x0): undefined reference to FT_Done_Face' font_render.c.o:(.literal.font_face_set_pixel_size+0x0): undefined reference to FT_Set_Pixel_Sizes'
font_render.c.o:(.literal.font_render_glyph+0x0): undefined reference to FT_Get_Char_Index' font_render.c.o:(.literal.font_render_glyph+0x4): undefined reference to FT_Load_Glyph'
font_render.c.o:(.literal.font_render_glyph+0x8): undefined reference to FT_Render_Glyph' font_render.c.o: In function font_face_init':
font_render.c:188: undefined reference to FT_New_Memory_Face' font_render.c:188: undefined reference to FT_Init_FreeType'
font_render.c.o: In function font_face_destroy': font_render.c:188: undefined reference to FT_Done_Face'
font_render.c.o: In function font_face_set_pixel_size': font_render.c:188: undefined reference to FT_Set_Pixel_Sizes'
font_render.c.o: In function font_render_glyph': font_render.c:210: undefined reference to FT_Get_Char_Index'
font_render.c:213: undefined reference to FT_Load_Glyph' font_render.c:219: undefined reference to FT_Render_Glyph'

my only solution up to now: patching font_render.c

How to get/calculate battery status?

In M5Stack I saw M5.Power.getBatteryLevel(), in this library there are getBatteryVoltage and getBatteryRaw, but how to get a power level (battery charge in percents)?

Arduino Compile Errors

What libraries, etc are required to get this to build?

Currently have libraries: Time, Moonrise, M5GFX, M5EPD, ArduinoJson, Wifi

Using Arduino IDE 1.8.6 on MacOS

/Users/bfaist/Documents/Arduino/libraries/M5EPD/src/M5EPD.cpp: In member function 'void M5EPD::BatteryADCBegin()':
/Users/bfaist/Documents/Arduino/libraries/M5EPD/src/M5EPD.cpp:5:25: error: 'ADC1_GPIO35_CHANNEL' was not declared in this scope
#define BAT_ADC_CHANNEL ADC1_GPIO35_CHANNEL
^~~~~~~~~~~~~~~~~~~
/Users/bfaist/Documents/Arduino/libraries/M5EPD/src/M5EPD.cpp:90:31: note: in expansion of macro 'BAT_ADC_CHANNEL'
adc1_config_channel_atten(BAT_ADC_CHANNEL, ADC_ATTEN_DB_11);
^~~~~~~~~~~~~~~
/Users/bfaist/Documents/Arduino/libraries/M5EPD/src/M5EPD.cpp:5:25: note: suggested alternative: 'ADC1_CHANNEL_7'
#define BAT_ADC_CHANNEL ADC1_GPIO35_CHANNEL
^~~~~~~~~~~~~~~~~~~
/Users/bfaist/Documents/Arduino/libraries/M5EPD/src/M5EPD.cpp:90:31: note: in expansion of macro 'BAT_ADC_CHANNEL'
adc1_config_channel_atten(BAT_ADC_CHANNEL, ADC_ATTEN_DB_11);
^~~~~~~~~~~~~~~
/Users/bfaist/Documents/Arduino/libraries/M5EPD/src/M5EPD.cpp: In member function 'uint32_t M5EPD::getBatteryRaw()':
/Users/bfaist/Documents/Arduino/libraries/M5EPD/src/M5EPD.cpp:5:25: error: 'ADC1_GPIO35_CHANNEL' was not declared in this scope
#define BAT_ADC_CHANNEL ADC1_GPIO35_CHANNEL
^~~~~~~~~~~~~~~~~~~
/Users/bfaist/Documents/Arduino/libraries/M5EPD/src/M5EPD.cpp:100:25: note: in expansion of macro 'BAT_ADC_CHANNEL'
return adc1_get_raw(BAT_ADC_CHANNEL);
^~~~~~~~~~~~~~~
/Users/bfaist/Documents/Arduino/libraries/M5EPD/src/M5EPD.cpp:5:25: note: suggested alternative: 'ADC1_CHANNEL_7'
#define BAT_ADC_CHANNEL ADC1_GPIO35_CHANNEL
^~~~~~~~~~~~~~~~~~~
/Users/bfaist/Documents/Arduino/libraries/M5EPD/src/M5EPD.cpp:100:25: note: in expansion of macro 'BAT_ADC_CHANNEL'
return adc1_get_raw(BAT_ADC_CHANNEL);
^~~~~~~~~~~~~~~
/Users/bfaist/Documents/Arduino/libraries/M5EPD/src/M5EPD.cpp: In member function 'uint32_t M5EPD::getBatteryVoltage()':
/Users/bfaist/Documents/Arduino/libraries/M5EPD/src/M5EPD.cpp:5:25: error: 'ADC1_GPIO35_CHANNEL' was not declared in this scope
#define BAT_ADC_CHANNEL ADC1_GPIO35_CHANNEL
^~~~~~~~~~~~~~~~~~~
/Users/bfaist/Documents/Arduino/libraries/M5EPD/src/M5EPD.cpp:111:39: note: in expansion of macro 'BAT_ADC_CHANNEL'
adc_raw_value += adc1_get_raw(BAT_ADC_CHANNEL);
^~~~~~~~~~~~~~~
/Users/bfaist/Documents/Arduino/libraries/M5EPD/src/M5EPD.cpp:5:25: note: suggested alternative: 'ADC1_CHANNEL_7'
#define BAT_ADC_CHANNEL ADC1_GPIO35_CHANNEL
^~~~~~~~~~~~~~~~~~~
/Users/bfaist/Documents/Arduino/libraries/M5EPD/src/M5EPD.cpp:111:39: note: in expansion of macro 'BAT_ADC_CHANNEL'
adc_raw_value += adc1_get_raw(BAT_ADC_CHANNEL);
^~~~~~~~~~~~~~~

Wrong Password error on wifi connection

I've tried connecting to 2.4g wifi and get wrong Password error after entering correct password. I've change the access point names and passwords and still get error.

(I really like this hardware. Nice job!)

M5EPD_Canvas copy / assignment causes crash.

I have observed that non trivial construction of the M5EPD_Canvas class leads to crashes. Due to the rather shallow documentation, I'm not sure what the desired behavior is. The following behavior causes a crash, but draws the right thing on the display.

#include <Arduino.h>
#include <M5EPD.h>

void __attribute__ ((noinline)) doesNotCrash(M5EPD_Canvas* c2) {
  c2->drawString("Welt", 50, 100);
}

void __attribute__ ((noinline)) crash(M5EPD_Canvas c2) {
  c2.drawString("Crash", 50, 150);
}


void setup() {
  M5.begin();
  M5.EPD.SetRotation(90);
  M5.TP.SetRotation(90);
  M5.EPD.Clear(true);
  M5.RTC.begin();

  M5EPD_Canvas c(&M5.EPD);
  c.createCanvas(400, 400);
  c.setTextSize(4);
  c.setTextColor(15);
  c.drawString("Hallo", 50, 50);

  // Obviously using a pointer does not crash
  // doesNotCrash(&c);
  // Copy constructor called during the parameter assignment causes crash.
  crash(c);
  c.pushCanvas(0, 0, UPDATE_MODE_GC16);
}

void loop() {
}

The backtrace produced by the code above is as follows:

➜  M5PaperUi git:(main) ✗ /Users/magrund/.platformio/packages/toolchain-xtensa32/bin/xtensa-esp32-elf-addr2line -e .pio/build/m5stack-fire/firmware.elf 0x4008edb4:0x3ffb1be0 0x4008efe5:0x3ffb1c00 0x400e4e2b:0x3ffb1c20 0x4008ea41:0x3ffb1c50 0x4008730a:0x3ffb1c70 0x40087711:0x3ffb1c90 0x4000bec7:0x3ffb1cb0 0x400d853e:0x3ffb1cd0 0x400d1f88:0x3ffb1cf0 0x400d1cbd:0x3ffb1d10 0x400db05f:0x3ffb1fb0 0x4008b4f1:0x3ffb1fd0
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c:707
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c:707
/Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdlib/../../../.././newlib/libc/stdlib/assert.c:63 (discriminator 8)
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/heap/multi_heap_poisoning.c:301
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/heap/heap_caps.c:268
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/newlib/syscalls.c:42
??:0
/Users/magrund/Development/2020/M5PaperUI/M5PaperUi/.pio/libdeps/m5stack-fire/M5EPD/src/utility/Sprite.cpp:833 (discriminator 1)
/Users/magrund/Development/2020/M5PaperUI/M5PaperUi/.pio/libdeps/m5stack-fire/M5EPD/src/M5EPD_Canvas.cpp:1420
/Users/magrund/Development/2020/M5PaperUI/M5PaperUi/src/main.cpp:20
/Users/magrund/.platformio/packages/framework-arduinoespressif32/cores/esp32/main.cpp:14
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c:355 (discriminator 1)

The stack itself seems to be misleading since it points to an assertion that is triggered by the line M5EPD_Canvas c(&M5.EPD); but if I comment out the line crash(c) the program does not crash anymore.

It seems that something messes up the internal state of the canvas. Please let me know if I can provide any more details.

M5EPD_Canvas::setDriver does not initialise correctly

M5EPD_Canvas::M5EPD_Canvas(M5EPD_Driver *driver) set _bpp to 4, overriding the default value of 16 from TFT_eSprite.

Neither M5EPD_Canvas::M5EPD_Canvas() nor M5EPD_Canvas::setDriver set _bpp.

(They also do not set _bytewidth, _last_push_x or _last_push_y, leaving them uninitialised.)

That means that

M5EPD_Canvas Canvas;
Canvas.setDriver(&M5.EPD);

Does not work in the same way that

M5EPD_Canvas Canvas(&M5.EPD);

Does.

M5EPD.cpp error

My used Arduino IDE environment:

Version: 2.0.0-rc3
Date: 2021-12-22T15:46:56.004Z
CLI Version: 0.20.2 [13783819]
Copyright © 2022 Arduino SA

Hardware:
M5PAPER

I get various error messages that I can't explain.
I ask for a solution, following the small program and the error messages:

#include <M5EPD.h>

M5EPD_Canvas canvas(&M5.EPD);

void setup()
{
M5.begin();
M5.EPD.SetRotation(90);
M5.EPD.Clear(true);
M5.RTC.begin();
canvas.createCanvas(540, 960);
canvas.setTextSize(3);
canvas.drawString("Hello World", 45, 350);
canvas.pushCanvas(0,0,UPDATE_MODE_DU4);
}

void loop()
{

}

IC:\Users\User\AppData\Local\Arduino15\packages\m5stack\hardware\esp32\2.0.1/tools/sdk/esp32/include/fb_gfx/include" -mlongcalls -Wno-frame-address -ffunction-sections -fdata-sections -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -ggdb -Os -freorder-blocks -Wwrite-strings -fstack-protector -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -fno-jump-tables -fno-tree-switch-conversion -std=gnu++11 -fexceptions -fno-rtti -MMD -c -DF_CPU=240000000L -DARDUINO=10607 -DARDUINO_M5Stack_Paper -DARDUINO_ARCH_ESP32 "-DARDUINO_BOARD="M5Stack_Paper"" "-DARDUINO_VARIANT="m5stack_paper"" -DARDUINO_PARTITION_default_16MB -DESP32 -DCORE_DEBUG_LEVEL=0 -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue -mfix-esp32-psram-cache-strategy=memw -DARDUINO_USB_CDC_ON_BOOT=0 "@C:\Users\User\AppData\Local\Temp\arduino-sketch-3C88A513D33701B45A959B337E7998AF/build_opt.h" "-IC:\Users\User\AppData\Local\Arduino15\packages\m5stack\hardware\esp32\2.0.1\cores\esp32" "-IC:\Users\User\AppData\Local\Arduino15\packages\m5stack\hardware\esp32\2.0.1\variants\m5stack_paper" "-Ic:\Users\User\Documents\Arduino\libraries\M5EPD\src" "-IC:\Users\User\AppData\Local\Arduino15\packages\m5stack\hardware\esp32\2.0.1\libraries\Wire\src" "-IC:\Users\User\AppData\Local\Arduino15\packages\m5stack\hardware\esp32\2.0.1\libraries\SPI\src" "-IC:\Users\User\AppData\Local\Arduino15\packages\m5stack\hardware\esp32\2.0.1\libraries\FS\src" "-IC:\Users\User\AppData\Local\Arduino15\packages\m5stack\hardware\esp32\2.0.1\libraries\SD\src" "-IC:\Users\User\AppData\Local\Arduino15\packages\m5stack\hardware\esp32\2.0.1\libraries\SPIFFS\src" "-IC:\Users\User\AppData\Local\Arduino15\packages\m5stack\hardware\esp32\2.0.1\libraries\HTTPClient\src" "-IC:\Users\User\AppData\Local\Arduino15\packages\m5stack\hardware\esp32\2.0.1\libraries\WiFi\src" "-IC:\Users\User\AppData\Local\Arduino15\packages\m5stack\hardware\esp32\2.0.1\libraries\WiFiClientSecure\src" "c:\Users\User\Documents\Arduino\libraries\M5EPD\src\ffsupport.cpp" -o "C:\Users\User\AppData\Local\Temp\arduino-sketch-3C88A513D33701B45A959B337E7998AF\libraries\M5EPD\ffsupport.cpp.o"
c:\Users\User\Documents\Arduino\libraries\M5EPD\src\M5EPD.cpp: In member function 'void M5EPD::begin(bool, bool, bool, bool, bool)':
c:\Users\User\Documents\Arduino\libraries\M5EPD\src*M5EPD.cpp:66:34: error:* call of overloaded 'begin(int, int, int)' is ambiguous
Wire.begin(21, 22, 400000);
^
In file included from c:\Users\User\Documents\Arduino\libraries\M5EPD\src\M5EPD.h:5,
from c:\Users\User\Documents\Arduino\libraries\M5EPD\src\M5EPD.cpp:1:
C:\Users\User\AppData\Local\Arduino15\packages\m5stack\hardware\esp32\2.0.1\libraries\Wire\src/Wire.h:79:10: note: candidate: 'bool TwoWire::begin(int, int, uint32_t)'
bool begin(int sda=-1, int scl=-1, uint32_t frequency=0); // returns true, if successful init of i2c bus
^~~~~
C:\Users\User\AppData\Local\Arduino15\packages\m5stack\hardware\esp32\2.0.1\libraries\Wire\src/Wire.h:80:10: note: candidate: 'bool TwoWire::begin(uint8_t, int, int, uint32_t)'
bool begin(uint8_t slaveAddr, int sda=-1, int scl=-1, uint32_t frequency=0);
^~~~~
c:\Users\User\Documents\Arduino\libraries\M5EPD\src\M5EPD.cpp: In member function 'void M5EPD::BatteryADCBegin()':
c:\Users\User\Documents\Arduino\libraries\M5EPD\src\M5EPD.cpp:5:25: error: 'ADC1_GPIO35_CHANNEL' was not declared in this scope
#define BAT_ADC_CHANNEL ADC1_GPIO35_CHANNEL
^~~~~~~~~~~~~~~~~~~
c:\Users\User\Documents\Arduino\libraries\M5EPD\src\M5EPD.cpp:90:31: note: in expansion of macro 'BAT_ADC_CHANNEL'
adc1_config_channel_atten(BAT_ADC_CHANNEL, ADC_ATTEN_DB_11);
^~~~~~~~~~~~~~~
c:\Users\User\Documents\Arduino\libraries\M5EPD\src\M5EPD.cpp:5:25: note: suggested alternative: 'ADC1_CHANNEL_7'
#define BAT_ADC_CHANNEL ADC1_GPIO35_CHANNEL
^~~~~~~~~~~~~~~~~~~
c:\Users\User\Documents\Arduino\libraries\M5EPD\src\M5EPD.cpp:90:31: note: in expansion of macro 'BAT_ADC_CHANNEL'
adc1_config_channel_atten(BAT_ADC_CHANNEL, ADC_ATTEN_DB_11);
^~~~~~~~~~~~~~~
c:\Users\User\Documents\Arduino\libraries\M5EPD\src\M5EPD.cpp: In member function 'uint32_t M5EPD::getBatteryRaw()':
c:\Users\User\Documents\Arduino\libraries\M5EPD\src\M5EPD.cpp:5:25: error: 'ADC1_GPIO35_CHANNEL' was not declared in this scope
#define BAT_ADC_CHANNEL ADC1_GPIO35_CHANNEL
^~~~~~~~~~~~~~~~~~~
c:\Users\User\Documents\Arduino\libraries\M5EPD\src\M5EPD.cpp:100:25: note: in expansion of macro 'BAT_ADC_CHANNEL'
return adc1_get_raw(BAT_ADC_CHANNEL);
^~~~~~~~~~~~~~~
c:\Users\User\Documents\Arduino\libraries\M5EPD\src\M5EPD.cpp:5:25: note: suggested alternative: 'ADC1_CHANNEL_7'
#define BAT_ADC_CHANNEL ADC1_GPIO35_CHANNEL
^~~~~~~~~~~~~~~~~~~
c:\Users\User\Documents\Arduino\libraries\M5EPD\src\M5EPD.cpp:100:25: note: in expansion of macro 'BAT_ADC_CHANNEL'
return adc1_get_raw(BAT_ADC_CHANNEL);
^~~~~~~~~~~~~~~
c:\Users\User\Documents\Arduino\libraries\M5EPD\src\M5EPD.cpp: In member function 'uint32_t M5EPD::getBatteryVoltage()':
c:\Users\User\Documents\Arduino\libraries\M5EPD\src\M5EPD.cpp:5:25: error: 'ADC1_GPIO35_CHANNEL' was not declared in this scope
#define BAT_ADC_CHANNEL ADC1_GPIO35_CHANNEL
^~~~~~~~~~~~~~~~~~~
c:\Users\User\Documents\Arduino\libraries\M5EPD\src\M5EPD.cpp:111:39: note: in expansion of macro 'BAT_ADC_CHANNEL'
adc_raw_value += adc1_get_raw(BAT_ADC_CHANNEL);
^~~~~~~~~~~~~~~
c:\Users\User\Documents\Arduino\libraries\M5EPD\src\M5EPD.cpp:5:25: note: suggested alternative: 'ADC1_CHANNEL_7'
#define BAT_ADC_CHANNEL ADC1_GPIO35_CHANNEL
^~~~~~~~~~~~~~~~~~~
c:\Users\User\Documents\Arduino\libraries\M5EPD\src\M5EPD.cpp:111:39: note: in expansion of macro 'BAT_ADC_CHANNEL'
adc_raw_value += adc1_get_raw(BAT_ADC_CHANNEL);
^~~~~~~~~~~~~~~
Using library M5EPD at version 0.1.0 in folder: C:\Users\User\Documents\Arduino\libraries\M5EPD
Using library Wire at version 2.0.0 in folder: C:\Users\User\AppData\Local\Arduino15\packages\m5stack\hardware\esp32\2.0.1\libraries\Wire
Using library SPI at version 2.0.0 in folder: C:\Users\User\AppData\Local\Arduino15\packages\m5stack\hardware\esp32\2.0.1\libraries\SPI
Using library FS at version 2.0.0 in folder: C:\Users\User\AppData\Local\Arduino15\packages\m5stack\hardware\esp32\2.0.1\libraries\FS
Using library SD at version 2.0.0 in folder: C:\Users\User\AppData\Local\Arduino15\packages\m5stack\hardware\esp32\2.0.1\libraries\SD
Using library SPIFFS at version 2.0.0 in folder: C:\Users\User\AppData\Local\Arduino15\packages\m5stack\hardware\esp32\2.0.1\libraries\SPIFFS
Using library HTTPClient at version 2.0.0 in folder: C:\Users\User\AppData\Local\Arduino15\packages\m5stack\hardware\esp32\2.0.1\libraries\HTTPClient
Using library WiFi at version 2.0.0 in folder: C:\Users\User\AppData\Local\Arduino15\packages\m5stack\hardware\esp32\2.0.1\libraries\WiFi
Using library WiFiClientSecure at version 2.0.0 in folder: C:\Users\User\AppData\Local\Arduino15\packages\m5stack\hardware\esp32\2.0.1\libraries\WiFiClientSecure
Compilation error: exit status 1}

hello world example

hello
if i launch hello world example the screen is blank

the screen is blank when the resolution is : createCanvas(960, 540);

the button example is ok only if i press a button
what is the problem ?

Q: What is the correct BMP bitmap format?

Hi,

I am currently working on a map too for the M5 Paper. However, I am struggling to convert the tiles into the right format. It all works using PNG map tiles, but I'd like to preprocess the tiles to BMP to improve rendering performance.

I'd really appreciate if someone has a hit and possible improve the documentation, to make it simpler for others.

Thanks!
Joe

Image2gray.py alternative version with more "features"

Please add this as alternative to your image2gray.py Python script as it is not very good (at least I had to rewrite half of it).
It adds option to select image_folder path, add black borders around images, creates single image=single file or ImageResource.h with all images it finds.
images2gray.zip

Build failure with the latest framework-arduinoespressif32 (idf-release/v4.2 branch)

Following compilation error occurs when using the latest framework-arduinoespressif32 (idf-release/v4.2 branch) and PlatformIO.
This is because driver/adc.h does not include soc/adc_channel.h in EPS-IDF v4.2.

See driver/adc.h in v3.3 and v4.2.

I'll create a PR to fix this issue.

Error

.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp: In member function 'void M5EPD::BatteryADCBegin()':
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:6:25: error: 'ADC1_GPIO35_CHANNEL' was not declared in this scope
 #define BAT_ADC_CHANNEL ADC1_GPIO35_CHANNEL
                         ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:90:31: note: in expansion of macro 'BAT_ADC_CHANNEL'
     adc1_config_channel_atten(BAT_ADC_CHANNEL, ADC_ATTEN_DB_11);
                               ^~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:6:25: note: suggested alternative: 'ADC1_CHANNEL_7'
 #define BAT_ADC_CHANNEL ADC1_GPIO35_CHANNEL
                         ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:90:31: note: in expansion of macro 'BAT_ADC_CHANNEL'
     adc1_config_channel_atten(BAT_ADC_CHANNEL, ADC_ATTEN_DB_11);
                               ^~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp: In member function 'uint32_t M5EPD::getBatteryRaw()':
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:6:25: error: 'ADC1_GPIO35_CHANNEL' was not declared in this scope
 #define BAT_ADC_CHANNEL ADC1_GPIO35_CHANNEL
                         ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:100:25: note: in expansion of macro 'BAT_ADC_CHANNEL'
     return adc1_get_raw(BAT_ADC_CHANNEL);
                         ^~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:6:25: note: suggested alternative: 'ADC1_CHANNEL_7'
 #define BAT_ADC_CHANNEL ADC1_GPIO35_CHANNEL
                         ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:100:25: note: in expansion of macro 'BAT_ADC_CHANNEL'
     return adc1_get_raw(BAT_ADC_CHANNEL);
                         ^~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp: In member function 'uint32_t M5EPD::getBatteryVoltage()':
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:6:25: error: 'ADC1_GPIO35_CHANNEL' was not declared in this scope
 #define BAT_ADC_CHANNEL ADC1_GPIO35_CHANNEL
                         ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:111:39: note: in expansion of macro 'BAT_ADC_CHANNEL'
         adc_raw_value += adc1_get_raw(BAT_ADC_CHANNEL);
                                       ^~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:6:25: note: suggested alternative: 'ADC1_CHANNEL_7'
 #define BAT_ADC_CHANNEL ADC1_GPIO35_CHANNEL
                         ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:111:39: note: in expansion of macro 'BAT_ADC_CHANNEL'
         adc_raw_value += adc1_get_raw(BAT_ADC_CHANNEL);
                                       ^~~~~~~~~~~~~~~
*** [.pio\build\m5paper-test\lib22e\M5EPD\M5EPD.cpp.o] Error 1

Code example

platformio.ini

[platformio]
packages_dir = .pio/packages

[env:m5paper-test]
platform = espressif32
board = m5stack-fire
framework = arduino
platform_packages =
    toolchain-xtensa32 @ https://bintray.com/platformio/tool-packages/download_file?file_path=53bcf98-toolchain-xtensa32-windows-2.80400.2020.tar.gz
    framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#idf-release/v4.2
build_flags =
    -DESP32=1
    -DARDUINO_ARCH_ESP32=1
lib_deps =
  m5stack/M5EPD

src/main.cpp

#include <M5EPD.h>

void setup(void)
{
}

void loop(void)
{
}

Build log for pio run

PS C:\Users\estshorter\src\esp> pio run
Processing m5paper-test (platform: espressif32; board: m5stack-fire; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/m5stack-fire.html
PLATFORM: Espressif 32 (2.1.0) > M5Stack FIRE
HARDWARE: ESP32 240MHz, 6.25MB RAM, 16MB 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 0.0.0+sha.7d3f499
 - tool-esptoolpy 1.30000.201119 (3.0.0)
 - toolchain-xtensa32 2.80400.2020 (8.4.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 30 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <M5EPD> 0.1.0
|   |-- <FS> 1.0
|   |-- <SD(esp32)> 1.0.5
|   |   |-- <FS> 1.0
|   |   |-- <SPI> 1.0
|   |-- <SPIFFS> 1.0
|   |   |-- <FS> 1.0
|   |-- <SPI> 1.0
|   |-- <HTTPClient> 1.2
|   |   |-- <WiFi> 1.0
|   |   |-- <WiFiClientSecure> 1.0
|   |   |   |-- <WiFi> 1.0
|   |-- <Wire> 1.0.1
Building in release mode
Compiling .pio\build\m5paper-test\lib22e\M5EPD\M5EPD.cpp.o
Compiling .pio\build\m5paper-test\FrameworkArduino\StreamString.cpp.o
Compiling .pio\build\m5paper-test\FrameworkArduino\USB.cpp.o
Compiling .pio\build\m5paper-test\FrameworkArduino\USBCDC.cpp.o
Compiling .pio\build\m5paper-test\FrameworkArduino\WMath.cpp.o
Compiling .pio\build\m5paper-test\FrameworkArduino\WString.cpp.o
Compiling .pio\build\m5paper-test\FrameworkArduino\base64.cpp.o
Compiling .pio\build\m5paper-test\FrameworkArduino\cbuf.cpp.o
Compiling .pio\build\m5paper-test\FrameworkArduino\esp32-hal-adc.c.o
Compiling .pio\build\m5paper-test\FrameworkArduino\esp32-hal-bt.c.o
Compiling .pio\build\m5paper-test\FrameworkArduino\esp32-hal-cpu.c.o
Compiling .pio\build\m5paper-test\FrameworkArduino\esp32-hal-dac.c.o
Compiling .pio\build\m5paper-test\FrameworkArduino\esp32-hal-gpio.c.o
Compiling .pio\build\m5paper-test\FrameworkArduino\esp32-hal-i2c.c.o
Compiling .pio\build\m5paper-test\FrameworkArduino\esp32-hal-ledc.c.o
Compiling .pio\build\m5paper-test\FrameworkArduino\esp32-hal-matrix.c.o
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp: In member function 'void M5EPD::BatteryADCBegin()':
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:6:25: error: 'ADC1_GPIO35_CHANNEL' was not declared in this scope
 #define BAT_ADC_CHANNEL ADC1_GPIO35_CHANNEL
                         ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:90:31: note: in expansion of macro 'BAT_ADC_CHANNEL'
     adc1_config_channel_atten(BAT_ADC_CHANNEL, ADC_ATTEN_DB_11);
                               ^~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:6:25: note: suggested alternative: 'ADC1_CHANNEL_7'
 #define BAT_ADC_CHANNEL ADC1_GPIO35_CHANNEL
                         ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:90:31: note: in expansion of macro 'BAT_ADC_CHANNEL'
     adc1_config_channel_atten(BAT_ADC_CHANNEL, ADC_ATTEN_DB_11);
                               ^~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp: In member function 'uint32_t M5EPD::getBatteryRaw()':
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:6:25: error: 'ADC1_GPIO35_CHANNEL' was not declared in this scope
 #define BAT_ADC_CHANNEL ADC1_GPIO35_CHANNEL
                         ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:100:25: note: in expansion of macro 'BAT_ADC_CHANNEL'
     return adc1_get_raw(BAT_ADC_CHANNEL);
                         ^~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:6:25: note: suggested alternative: 'ADC1_CHANNEL_7'
 #define BAT_ADC_CHANNEL ADC1_GPIO35_CHANNEL
                         ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:100:25: note: in expansion of macro 'BAT_ADC_CHANNEL'
     return adc1_get_raw(BAT_ADC_CHANNEL);
                         ^~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp: In member function 'uint32_t M5EPD::getBatteryVoltage()':
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:6:25: error: 'ADC1_GPIO35_CHANNEL' was not declared in this scope
 #define BAT_ADC_CHANNEL ADC1_GPIO35_CHANNEL
                         ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:111:39: note: in expansion of macro 'BAT_ADC_CHANNEL'
         adc_raw_value += adc1_get_raw(BAT_ADC_CHANNEL);
                                       ^~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:6:25: note: suggested alternative: 'ADC1_CHANNEL_7'
 #define BAT_ADC_CHANNEL ADC1_GPIO35_CHANNEL
                         ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\m5paper-test\M5EPD\src\M5EPD.cpp:111:39: note: in expansion of macro 'BAT_ADC_CHANNEL'
         adc_raw_value += adc1_get_raw(BAT_ADC_CHANNEL);
                                       ^~~~~~~~~~~~~~~
*** [.pio\build\m5paper-test\lib22e\M5EPD\M5EPD.cpp.o] Error 1

Environment

  • PlatformIO IDE v2.2.1
  • VS Code 1.52.1
  • Win 10 20H2

Issues are closed without being handled

There was recently a purge of all open issues without any commenting or explanation for why they were closed.

If you are no longer interested in community contributions then you should clearly state that is the case. But letting the community add issues and then arbitrarily closing them is very dishonest.

Let's see how long time it takes for you to close this issue (without comment) as well.

TextWrap doesn't seem to work

What am I doing wrong

M5.begin();
M5.EPD.SetRotation(90);
M5.EPD.Clear(true);
M5.RTC.begin();
canvas.createCanvas(540, 960);
canvas.setTextSize(5);
canvas.drawString("Connected to WiFi! Test text wrap", 10, 50);
canvas.pushCanvas(0,0,UPDATE_MODE_DU4);

Random crash when drawing PNG at src/utility/pngle.c:859

Hi, I am using PlatformIO core 5.1.0 home 3.3.3, M5EPD 0.1.1
Source code is here https://github.com/huksley/m5panel

Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.
Core 1 register dump:
PC      : 0x400e160d  PS      : 0x00060a30  A0      : 0x800db238  A1      : 0x3ffb1670  
A2      : 0x00000000  A3      : 0x3ffb177c  A4      : 0x00000132  A5      : 0x00000000  
A6      : 0x3ffd9118  A7      : 0xff000000  A8      : 0x80193df2  A9      : 0x3ffb16e0  
A10     : 0x00000132  A11     : 0x3ffb177c  A12     : 0x00000400  A13     : 0x00000000  
A14     : 0x3ffd8fd4  A15     : 0x00000000  SAR     : 0x00000018  EXCCAUSE: 0x0000001c  
EXCVADDR: 0x00000024  LBEG    : 0x4000c2e0  LEND    : 0x4000c2f6  LCOUNT  : 0x00000000  

Backtrace

Backtrace: 0x400e160d:0x3ffb1670 0x400db235:0x3ffb1720 0x400d4f92:0x3ffb1ba0 0x400d6db9:0x3ffb1c30 0x400d7565:0x3ffb1f60 0x400f5fef:0x3ffb1fb0 0x4008bcd5:0x3ffb1fd0
  #0  0x400e160d:0x3ffb1670 in pngle_feed at .pio/libdeps/m5stack-fire/M5EPD/src/utility/pngle.c:859
  #1  0x400db235:0x3ffb1720 in M5EPD_Canvas::drawPngFile(fs::FS&, char const*, unsigned short, unsigned short, unsigned short, unsigned short, unsigned short, unsigned short, double, unsigned char) at .pio/libdeps/m5stack-fire/M5EPD/src/M5EPD_Canvas.cpp:1308
  #2  0x400d4f92:0x3ffb1ba0 in M5PanelWidget::draw(m5epd_update_mode_t) at src/M5PanelWidget.cpp:32
  #3  0x400d6db9:0x3ffb1c30 in updateSiteMap(int) at /Users/user/.platformio/packages/framework-arduinoespressif32/cores/esp32/WString.h:85
  #4  0x400d7565:0x3ffb1f60 in setup() at /Users/user/.platformio/packages/framework-arduinoespressif32/cores/esp32/WString.h:85
  #5  0x400f5fef:0x3ffb1fb0 in loopTask(void*) at /Users/user/.platformio/packages/framework-arduinoespressif32/cores/esp32/main.cpp:14
  #6  0x4008bcd5:0x3ffb1fd0 in vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c:355 (discriminator 1)

Powering on after calling shutdown()

I struggle with powering the M5Paper after turning it off by executing shutdown() with no delay nor date/time.

Here's the code I'm running:

void setup()
{
    M5.begin();
    M5.EPD.SetRotation(90);
    M5.EPD.Clear(true);
    M5.RTC.begin();
    M5.BatteryADCBegin();

    canvas.createCanvas(WIDTH, HEIGHT);

    render(canvas, date, tasks, notes, getBatteryLevel());

    M5.shutdown();
}

void loop()
{
}

render() just draws on the canvas and pushes it out.

After the final shutdown() is called, I can see the display as normal and it uses no power at all. However I can't manage to reboot the device. The reset button on the back doesn't seem to be doing anything, and after pressing the button on the side of the device for two seconds, the screen goes blank and stays in that state. The device only resets after connecting/disconnecting from USB-C power source.

What do I miss to make it possible to boot the device up after shutting it down?
Thanks!

Mac OS Big Sur serial issue tracked down to USB controller: NOT CP2104 but CH9102

My unit sourced via BangGood came in a few weeks ago.
I finally had time to try it and since the serial port was listed as /dev/cu.usbmodemxxxx I just went on and tried to upload a Sketch.
I got a message cannot upload stub - write to RAM error 0107...

I could not really find an answer on Google so I took the unit apart.
At the back it clearly states CP2104 which is a Silicon Labs USB<>Serial controller working out of the box on many systems.
My unit has a CH9102 which is the poster child of the infamous CH340 so many have had issues with on Mac, Windows and Linux.

I looked that up and could basically not track down the driver from a manufacturer,
but ended up on this thread which bares no solution (yet still valuable information)
https://community.m5stack.com/topic/2175/new-m5stack-failed-to-write-to-target-ram-result-was-01070000/7

and later on this one
Xinyuan-LilyGO/LilyGo-T-Call-SIM800#139 (comment)

There's a link to download what might look like a sketchy driver but it does indeed work.
Requires authorising Mac OS to run it from the Privacy panel and has text in Chinese.

It does work, so if anyone ends up here and they're on Big Sur you can probably fix your issue like this.
Still not using the CP2104 and not giving hints about it is sketchier than the driver I installed today.

Please make amends on the README adding the chip and a possible driver download.
I was able to track down a possible page from the manufacturer but the driver for Mac does not seem to exist on their page (being it in Chinese I cannot find it myself) but the user in the issue linked above says they received it from the manufacturer

Peace ✌🏼

The README should describe the purpose of this repository

Describe the bug

I opened an issue #15 requesting compilation instructions for this repository, and it was closed as not planned. Which makes me wonder what is the purpose of this repository? The README.md does not explain why the repository exists, but is more a product and usage description of the M5 EPD hardware (which is not really the purpose of README.md in github).

I therefore suggest to add to at least to the top the README.md a description of the the purpose of this repo.

To reproduce

Open the repo on github and read the README.md file

Expected behavior

As a comparison of a good description see e.g.:

https://github.com/MHeironimus/ArduinoJoystickLibrary

Which starts with "This library can be used...", and continues with "installation instructions".

Screenshots

No response

Environment

  • OS:
  • IDE &IDE Version:
  • Repository Version:

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • My report contains all necessary details

NFC PN532 grove v1.1

hello
i try to connect the nfc PN532 grove v1.1 to my M5paper board. I successfully installed the library and compiled the ReadTag example but i have this error : Didn’t find PN53x board
i plugged the NFC module to the port C ( UART )
what’s wrong with my setup ?
thanks

doc :
https://wiki.seeedstudio.com/Grove_NFC/

Cannot do simple stuff like invert text or create touch button

Describe the bug

Please add the possibility of creating a touch button and invert the text required for a menu. or create a sketch that shows these features as examples. i think this is the main use of these devices

To reproduce

nothing to reproduce, is not there!

Expected behavior

should have been in the examples

Screenshots

No response

Environment

  • OS:
  • IDE &IDE Version:
  • Repository Version:

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • My report contains all necessary details

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.