Update
Enabled Battery Monitoring
390mAh@3.7V
Add needed section to variant.h to enable battery montiroing
#define BATTERY_PIN 35
#define ADC_CHANNEL ADC1_GPIO35_CHANNEL
// https://github.com/m5stack/M5Core-Ink/blob/master/examples/Basics/FactoryTest/FactoryTest.ino#L58
// VBAT
// |
// R83 (3K)
// +
// R86 (11K)
// |
// GND
// https://github.com/m5stack/M5Core-Ink/blob/master/examples/Basics/FactoryTest/FactoryTest.ino#L58
#define ADC_MULTIPLIER 5 // Just a guess for now... more detailed getBatVoltage above
// https://embeddedexplorer.com/esp32-adc-esp-idf-tutorial/
Log output
DEBUG | 14:42:16 4724 [Power] Battery: usbPower=0, isCharging=0, batMv=4165, batPct=96
DEBUG | 14:42:36 4744 [Power] Battery: usbPower=0, isCharging=0, batMv=4150, batPct=94
DEBUG | 14:42:56 4764 [Power] Battery: usbPower=0, isCharging=0, batMv=4150, batPct=94
DEBUG | 14:43:16 4784 [Power] Battery: usbPower=0, isCharging=0, batMv=4170, batPct=96
DEBUG | 14:43:36 4804 [Power] Battery: usbPower=0, isCharging=0, batMv=4170, batPct=96
DEBUG | 14:43:56 4824 [Power] Battery: usbPower=0, isCharging=0, batMv=4170, batPct=96
DEBUG | 14:44:16 4844 [Power] Battery: usbPower=0, isCharging=0, batMv=4170, batPct=96
DEBUG | 14:44:36 4864 [Power] Battery: usbPower=0, isCharging=0, batMv=4175, batPct=97
DEBUG | 14:44:56 4884 [Power] Battery: usbPower=0, isCharging=0, batMv=4170, batPct=96
DEBUG | 14:45:16 4904 [Power] Battery: usbPower=0, isCharging=0, batMv=4170, batPct=96
DEBUG | 14:45:36 4924 [Power] Battery: usbPower=0, isCharging=0, batMv=4170, batPct=96
DEBUG | 14:45:56 4944 [Power] Battery: usbPower=0, isCharging=0, batMv=4170, batPct=96
DEBUG | 14:46:16 4964 [Power] Battery: usbPower=0, isCharging=0, batMv=4170, batPct=96
DEBUG | 14:46:36 4984 [Power] Battery: usbPower=0, isCharging=0, batMv=4170, batPct=96
DEBUG | 14:46:56 5004 [Power] Battery: usbPower=0, isCharging=0, batMv=4160, batPct=95
DEBUG | 14:47:16 5024 [Power] Battery: usbPower=0, isCharging=0, batMv=4175, batPct=97
DEBUG | 14:47:36 5044 [Power] Battery: usbPower=0, isCharging=0, batMv=4165, batPct=96
DEBUG | 14:47:56 5064 [Power] Battery: usbPower=0, isCharging=0, batMv=4175, batPct=97
DEBUG | 14:48:16 5084 [Power] Battery: usbPower=0, isCharging=0, batMv=4160, batPct=95
DEBUG | 14:48:36 5104 [Power] Battery: usbPower=0, isCharging=0, batMv=4170, batPct=96
DEBUG | 14:48:56 5124 [Power] Battery: usbPower=0, isCharging=0, batMv=4175, batPct=97
DEBUG | 14:49:16 5144 [Power] Battery: usbPower=0, isCharging=0, batMv=4170, batPct=96
DEBUG | 14:49:36 5164 [Power] Battery: usbPower=0, isCharging=0, batMv=4180, batPct=97
DEBUG | 14:49:56 5184 [Power] Battery: usbPower=0, isCharging=0, batMv=4180, batPct=97
DEBUG | 14:50:16 5204 [Power] Battery: usbPower=0, isCharging=0, batMv=4175, batPct=97
DEBUG | 14:50:36 5224 [Power] Battery: usbPower=0, isCharging=0, batMv=4180, batPct=97
DEBUG | 14:50:56 5244 [Power] Battery: usbPower=0, isCharging=0, batMv=4155, batPct=95
DEBUG | 14:51:16 5264 [Power] Battery: usbPower=0, isCharging=0, batMv=4165, batPct=96
DEBUG | 14:51:36 5284 [Power] Battery: usbPower=0, isCharging=0, batMv=4175, batPct=97
DEBUG | 14:51:56 5304 [Power] Battery: usbPower=0, isCharging=0, batMv=4170, batPct=96
DEBUG | 14:52:16 5324 [Power] Battery: usbPower=0, isCharging=0, batMv=4170, batPct=96
DEBUG | 14:52:36 5344 [Power] Battery: usbPower=0, isCharging=0, batMv=4180, batPct=97
DEBUG | 14:52:56 5364 [Power] Battery: usbPower=0, isCharging=0, batMv=4170, batPct=96
DEBUG | 14:53:16 5384 [Power] Battery: usbPower=0, isCharging=0, batMv=4175, batPct=97
DEBUG | 14:53:36 5404 [Power] Battery: usbPower=0, isCharging=0, batMv=4175, batPct=97
DEBUG | 14:53:56 5424 [Power] Battery: usbPower=0, isCharging=0, batMv=4170, batPct=96
DEBUG | 14:54:16 5444 [Power] Battery: usbPower=0, isCharging=0, batMv=4170, batPct=96
Also tested SX1280 OK but SX1262 failed init -2
//\ E S H T /\ S T / C
INFO | ??:??:?? 0 Booted, wake cause 0 (boot count 1), reset_reason=reset
DEBUG | ??:??:?? 0 Filesystem files (16384/1048576 Bytes):
DEBUG | ??:??:?? 0 /prefs/channels.proto (53 Bytes)
DEBUG | ??:??:?? 0 /prefs/config.proto (92 Bytes)
DEBUG | ??:??:?? 0 /prefs/db.proto (266 Bytes)
[ 120][I][esp32-hal-i2c.c:75] i2cInit(): Initialising I2C Master: sda=21 scl=22 freq=100000
DEBUG | ??:??:?? 0 Using analog input 35 for battery level
INFO | ??:??:?? 0 ADCmod: ADC characterization based on reference voltage stored in eFuse
INFO | ??:??:?? 0 Scanning for i2c devices...
[ 147][W][Wire.cpp:301] begin(): Bus already started in Master Mode.
DEBUG | ??:??:?? 0 Scanning for i2c devices on port 1
DEBUG | ??:??:?? 0 I2C device found at address 0x51
INFO | ??:??:?? 0 PCF8563 RTC found
INFO | ??:??:?? 0 1 I2C devices found
DEBUG | ??:??:?? 0 acc_info = 0
INFO | ??:??:?? 0 Meshtastic hwvendor=42, swver=2.1.18.5c34e36b
DEBUG | ??:??:?? 0 Setting random seed 4067771156
DEBUG | ??:??:?? 0 Total heap: 177824
DEBUG | ??:??:?? 0 Free heap: 143976
DEBUG | ??:??:?? 0 Total PSRAM: 0
DEBUG | ??:??:?? 0 Free PSRAM: 0
DEBUG | ??:??:?? 0 NVS: UsedEntries 70, FreeEntries 560, AllEntries 630, NameSpaces 3
DEBUG | ??:??:?? 0 Setup Preferences in Flash Storage
DEBUG | ??:??:?? 0 Number of Device Reboots: 10
ESP_ERROR_CHECK_WITHOUT_ABORT failed: esp_err_t 0x105 (ESP_ERR_NOT_FOUND) at 0x40096daf
file: "src/platform/esp32/BleOta.cpp" line 16
func: static const esp_partition_t* BleOta::findEspOtaAppPartition()
expression: esp_ota_get_partition_description(part, &app_desc)
ESP_ERROR_CHECK_WITHOUT_ABORT failed: esp_err_t 0x102 (ESP_ERR_INVALID_ARG) at 0x40096daf
file: "src/platform/esp32/BleOta.cpp" line 30
func: static String BleOta::getOtaAppVersion()
expression: esp_ota_get_partition_description(part, &app_desc)
DEBUG | ??:??:?? 0 No OTA firmware available
INFO | ??:??:?? 0 Initializing NodeDB
INFO | ??:??:?? 0 Loading /prefs/db.proto
INFO | ??:??:?? 0 Loaded saved devicestate version 20
INFO | ??:??:?? 0 Loading /prefs/config.proto
INFO | ??:??:?? 0 Loaded saved config version 20
[ 320][E][vfs_api.cpp:105] open(): /littlefs/prefs/module.proto does not exist, no permits for creation
INFO | ??:??:?? 0 No /prefs/module.proto preferences found
INFO | ??:??:?? 0 Installing default ModuleConfig
INFO | ??:??:?? 0 Loading /prefs/channels.proto
INFO | ??:??:?? 0 Loaded saved channelFile version 20
[ 363][E][vfs_api.cpp:105] open(): /littlefs/oem/oem.proto does not exist, no permits for creation
INFO | ??:??:?? 0 No /oem/oem.proto preferences found
DEBUG | ??:??:?? 0 Number of Device Reboots: 10
DEBUG | ??:??:?? 0 Expanding short PSK #0
INFO | ??:??:?? 0 Wanted region 13, using LORA_24
DEBUG | ??:??:?? 0 region=13, NODENUM=0x25979364, dbsize=0
INFO | ??:??:?? 0 Saving /prefs/db.proto
[ 519][D][Tone.cpp:124] tone(): _pin=2, frequency=185 Hz, duration=125 ms
[ 520][D][Tone.cpp:31] tone_task(): Task received from queue TONE_START: _pin=2, frequency=185 Hz, duration=125 ms
[ 526][D][Tone.cpp:33] tone_task(): Setup LED controll on channel 0
E (1594) ledc: ledc_get_duty(739): LEDC is not initialized
[ 682][D][Tone.cpp:124] tone(): _pin=2, frequency=233 Hz, duration=125 ms
[ 682][D][Tone.cpp:31] tone_task(): Task received from queue TONE_START: _pin=2, frequency=233 Hz, duration=125 ms
[ 688][D][Tone.cpp:33] tone_task(): Setup LED controll on channel 0
[ 844][D][Tone.cpp:124] tone(): _pin=2, frequency=277 Hz, duration=250 ms
[ 844][D][Tone.cpp:31] tone_task(): Task received from queue TONE_START: _pin=2, frequency=277 Hz, duration=250 ms
[ 850][D][Tone.cpp:33] tone_task(): Setup LED controll on channel 0
DEBUG | ??:??:?? 1 Read RTC time from PCF8563 as 1691241813
WARN | 13:23:33 1 No GPS found - running without GPS
INFO | 13:23:33 1 External Notification Module Disabled
INFO | 13:23:33 1 Doing EInk init
E (2251) gpio: gpio_set_level(226): GPIO output gpio_num error
[ 1190][E][esp32-hal-gpio.c:102] __pinMode(): Invalid pin selected
INFO | 13:23:33 1 Turning on screen
DEBUG | 13:23:33 1 Updating E-Paper... _PowerOn : 144000
_Update_Full : 902000
_Update_Part : 317000
_PowerOff : 61000
done
DEBUG | 13:23:34 2 Module wants a UI Frame
DEBUG | 13:23:34 2 Module wants a UI Frame
WARN | 13:23:34 2 SX128xInterface(cs=14, irq=25, rst=26, busy=13)
INFO | 13:23:34 2 Starting meshradio init...
DEBUG | 13:23:34 2 (bw=812, sf=11, cr=4/8) packet symLen=2 ms, payloadSize=0, time 71 ms
DEBUG | 13:23:34 2 (bw=812, sf=11, cr=4/8) packet symLen=2 ms, payloadSize=253, time 998 ms
INFO | 13:23:34 2 Radio freq=2404.469, config.lora.frequency_offset=0.000
INFO | 13:23:34 2 Set radio: region=LORA_24, name=LongFast, config=0, ch=5, power=13
INFO | 13:23:34 2 Radio myRegion->freqStart -> myRegion->freqEnd: 2400.000000 -> 2483.500000 (83.500000 mhz)
INFO | 13:23:34 2 Radio myRegion->numChannels: 102 x 812.500kHz
INFO | 13:23:34 2 Radio channel_num: 6
INFO | 13:23:34 2 Radio frequency: 2404.468750
INFO | 13:23:34 2 Slot time: 42 msec
INFO | 13:23:34 2 Set radio: final power level=13
INFO | 13:23:34 2 SX128x init result 0
INFO | 13:23:34 2 Frequency set to 2404.468750
INFO | 13:23:34 2 Bandwidth set to 812.500000
INFO | 13:23:34 2 Power output set to 13
INFO | 13:23:34 2 SX1280 Radio init succeeded, using SX1280 radio
INFO | 13:23:34 2 Not using WIFI
DEBUG | 13:23:34 2 (bw=812, sf=11, cr=4/8) packet symLen=2 ms, payloadSize=237, time 930 ms
DEBUG | 13:23:34 2 LoRA bitrWꪢr²ÊÊåÑÍ/ sec
INFO | 13:23:34 2 PowerFSM init, USB power=1
DEBUG | 13:23:34 2 Enter state: BOOT
[ 2863][D][esp32-hal-cpu.c:244] setCpuFrequencyMhz(): PLL: 320 / 4 = 80 Mhz, APB: 80000000 Hz
DEBUG | 13:23:34 2 [Power] Battery: usbPower=0, isCharging=0, batMv=0, batPct=0
DEBUG | 13:23:34 2 [Screen] Screen: Started...
DEBUG | 13:23:34 2 [Screen] Updating E-Paper... _PowerOn : 144001
_Update_Part : 317001
_Update_Part : 317001
_PowerOff : 61001
done
INFO | 13:23:35 3 [RangeTestModule] Range Test Module - Disabled
DEBUG | 13:23:36 4 [Screen] Updating E-Paper... _PowerOn : 144001
_Update_Part : 317001
_Update_Part : 317001
_PowerOff : 61001
done
DEBUG | 13:23:37 5 [PowerFSM] Enter state: POWER
INFO | 13:23:37 5 [PowerFSM] Initialise the NimBLE bluetooth module
DEBUG | 13:23:38 6 [Screen] Updating E-Paper... _PowerOn : 144001
_Update_Part : 317001
_Update_Part : 317001
_PowerOff : 61001
done
INFO | 13:23:40 8 [Screen] Done with boot screen...
DEBUG | 13:23:40 8 [Screen] showing standard frames
DEBUG | 13:23:40 8 [Screen] Showing 0 module frames
DEBUG | 13:23:40 8 [Screen] Total frame count: 83
DEBUG | 13:23:40 8 [Screen] Added modules. numframes: 0
DEBUG | 13:23:40 8 [Screen] Finished building frames. numframes: 4