WIP: M5 Stack CoreInk - HopeRF RF95W SX1276 LoRa Radio support

I have started with initial support for the M5 Stack CoreInk with RFM95 LoRa Radio

RFM95 SPI LoRa Radio is connected to the rear MI-BUS and Expansion port

First Meshtastic ESP32 device with e-Ink screen ?

ESP32 with 1.54" e-Ink Display (200x200)



Thank you to @caveman99 for some guidance and help

Working

  • HopeRF RFM95W SX1276
  • User button
  • Reset button
  • WiFi/Bluetooth
  • E-ink with fast partial updates (GDEW0154M09)
  • Meshtastic-cli configuration via SoftAP ( thanks @caveman99 )

Currently not working

  • serial meshtastic-cli support - hardware issue ?
    GPIO0 is wired from E-Ink RESET to the UART (This is what i believe is to be the issue)

Still Todo

  • Real Time Clock (might be already supported ? BM8563) - Tested with 1.3.12 firmware
  • Buzzer ( @caveman99 already has this with the M5 Core)
  • Battery Monitoring ? - Does not have an actual pin for this

You can connect via Bluetooth (Phone App) or Wireless to the SoftAP (http://192.168.42.1)

  • Keep user button pressed on startup ( thanks @caveman99 )
6 Likes

RTC PCF8563 is supported in 1.3 - i assume it’s the same thing?

I will have a look, thank you

If it’s the same chip, simply add the following to your variants.h for support in 1.3 - 1.2 will simply ignore it.

// PCF8563 RTC Module
#define PCF8563_RTC 0x51
1 Like

Im still working on this and plan to submit support soon enough

1 Like

Just tried it out with 1.3 needed the include and library for RTC

Boot log

//\ E S H T /\ S T / C

??:??:?? 0 booted, wake cause 0 (boot count 1), reset_reason=reset
??:??:?? 0 Filesystem files:
??:??:?? 0 I2C device found at address 0x51
??:??:?? 0 PCF8563 RTC found
??:??:?? 0 1 I2C devices found
??:??:?? 0 Meshtastic hwvendor=255, swver=1.3.12.b9f25eb8-d
??:??:?? 0 Setting random seed 1828722595
??:??:?? 0 Total heap: 241400
??:??:?? 0 Free heap: 209488
??:??:?? 0 Total PSRAM: 0
??:??:?? 0 Free PSRAM: 0
??:??:?? 0 NVS: UsedEntries 225, FreeEntries 405, AllEntries 630, NameSpaces 6
??:??:?? 0 Setup Preferences in Flash Storage
??:??:?? 0 Number of Device Reboots: 452
??:??:?? 0 Initial packet id 2090911980, numPacketId 4294967295
??:??:?? 0 Setting default channel and radio preferences!
??:??:?? 0 Expanding short PSK #1
??:??:?? 0 Wanted region 0, using Unset
[E][vfs_api.cpp:64] open(): /littlefs/prefs/db.proto does not exist
??:??:?? 0 No /prefs/db.proto preferences found
??:??:?? 0 Setting default channel and radio preferences!
??:??:?? 0 Expanding short PSK #1
??:??:?? 0 Wanted region 0, using Unset
[E][vfs_api.cpp:64] open(): /littlefs/prefs/config.proto does not exist
??:??:?? 0 No /prefs/config.proto preferences found
??:??:?? 0 Expanding short PSK #1
??:??:?? 0 Wanted region 0, using Unset
[E][vfs_api.cpp:64] open(): /littlefs/prefs/module.proto does not exist
??:??:?? 0 No /prefs/module.proto preferences found
[E][vfs_api.cpp:64] open(): /littlefs/prefs/channels.proto does not exist
??:??:?? 0 No /prefs/channels.proto preferences found
??:??:?? 0 Number of Device Reboots: 452
??:??:?? 0 Setting default channel and radio preferences!
??:??:?? 0 Expanding short PSK #1
??:??:?? 0 Wanted region 0, using Unset
??:??:?? 0 region=0, NODENUM=0x25979d88, dbsize=1
??:??:?? 0 Read RTC time from PCF8563 as 775700689
00:24:49 0 Warning: No GPS found - running without GPS

platformio.ini

lib_deps = 
  ${esp32_base.lib_deps}
  zinggjm/GxEPD2@^1.4.5
  lewisxhe/PCF8563_Library@^0.0.1

variant.h

#include "pcf8563.h"
// PCF8563 RTC Module
#define PCF8563_RTC 0x51

Just submitted PR for this device - here

1 Like

The support has been merged, i will post more details on the actual connection of the LoRa Module in more detail soon

Mine currently is just connected to the rear MI-BUS port

I have made a small bug fix as the E-Ink display would not always power up on reset.

On reset holding the user button is required to get the SoftAP meshtastic.local started (required for configuration)

Here is a video of the startup (it takes a while at first startup to create the SSL certificate)
Sorry the video was taken with my mobile phone

I have ordered some Adafruit RFM95W LoRa Radio Transceiver Breakout modules but locally only 1 is available and have ordered some more from Amazon US

No stock anymore

Here is some more detailed wiring notes: (only 8 wires used)

The M5 CoreInk MI-BUS connector is a 2 x 8 2.54 mm port on the rear of the M5 CoreInk

Adafruit RFM9X connection to M5 CoreInk MI-BUS

M5 CoreInk MI-BUS Pintout Connection:

MI-BUS Connector Pinout:

1 Like

So before I try to cram the Adafruit RFM95X into the M5 CoreInk Proto board box, i wanted to make another working prototype.

NOTE: use flux and flux cleaner after you soldered.

Made a break-out board with added Reset button connected to RST and GND

With the CoreInk Proto Borad boxes on the back of the M5 CoreInk the provided reset button wont be accessible, and will need another reset button

Soldered a SMA Antenna Connector and pin Headers to Adafruit RMF95X




Added Reset Button


NOTE: my RFM95X is replaceable.

Connected Antenna and USB-C cable, Flashed and startup it up

3 Likes

So with a final PR1257 to supply correct Pins_Arduino.h and being added to the build matrix github CI

https://github.com/meshtastic/artifacts/blob/device/pr/pr1527-firmware-1.3.20.90b3660.zip?raw=true

Flash

./device-install.sh -p /dev/ttyACM0 -f firmware-m5stack-coreink-1.3.20.90b3660.bin
Trying to flash firmware-m5stack-coreink-1.3.20.90b3660.bin, but first erasing and writing system information
esptool.py v3.3.1
Serial port /dev/ttyACM0
Connecting....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting.......
Detecting chip type... ESP32
Chip is ESP32-PICO-D4 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, Embedded Flash, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 4c:75:25:97:9d:88
Uploading stub...
Running stub...
Stub running...
Erasing flash (this may take a while)...
Chip erase completed successfully in 4.4s
Hard resetting via RTS pin...
esptool.py v3.3.1
Serial port /dev/ttyACM0
Connecting....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting....
Detecting chip type... ESP32
Chip is ESP32-PICO-D4 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, Embedded Flash, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 4c:75:25:97:9d:88
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Flash will be erased from 0x00001000 to 0x0000ffff...
Compressed 61440 bytes to 11950...
Wrote 61440 bytes (11950 compressed) at 0x00001000 in 1.5 seconds (effective 331.4 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
esptool.py v3.3.1
Serial port /dev/ttyACM0
Connecting....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting....
Detecting chip type... ESP32
Chip is ESP32-PICO-D4 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, Embedded Flash, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 4c:75:25:97:9d:88
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Flash will be erased from 0x00390000 to 0x003fffff...
Compressed 458752 bytes to 221351...
Wrote 458752 bytes (221351 compressed) at 0x00390000 in 19.7 seconds (effective 186.4 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
esptool.py v3.3.1
Serial port /dev/ttyACM0
Connecting.....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting....
Detecting chip type... ESP32
Chip is ESP32-PICO-D4 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, Embedded Flash, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 4c:75:25:97:9d:88
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Flash will be erased from 0x00010000 to 0x001b0fff...
Compressed 1705968 bytes to 1001292...
Wrote 1705968 bytes (1001292 compressed) at 0x00010000 in 88.7 seconds (effective 153.8 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

First boot

user@ws:~$ tio /dev/ttyACM0
[tio 08:54:48] tio v1.32
[tio 08:54:48] Press ctrl-t q to quit
[tio 08:54:48] Connected
E (651) spiram: SPI RAM enabled but initialization failed. Bailing out.
��H??:??:?? 0 

//\ E S H T /\ S T / C

??:??:?? 0 booted, wake cause 0 (boot count 1), reset_reason=reset
??:??:?? 0 Filesystem files:
??:??:?? 0   /static/Files.svg.gz (3360 Bytes)
??:??:?? 0   /static/Files_Dark.svg.gz (3382 Bytes)
??:??:?? 0   /static/Logo_Black.svg.gz (592 Bytes)
??:??:?? 0   /static/Logo_White.svg.gz (600 Bytes)
??:??:?? 0   /static/View_Code.svg.gz (2361 Bytes)
??:??:?? 0   /static/View_Code_Dark.svg.gz (2359 Bytes)
??:??:?? 0   /static/icon.svg.gz (842 Bytes)
??:??:?? 0   /static/index.b96e5a1a.js.gz (188283 Bytes)
??:??:?? 0   /static/index.bedff635.css.gz (10107 Bytes)
??:??:?? 0   /static/index.html.gz (573 Bytes)
??:??:?? 0   /static/manifest.webmanifest.gz (230 Bytes)
??:??:?? 0   /static/robots.txt.gz (42 Bytes)
??:??:?? 0   /static/safari-tab.svg.gz (549 Bytes)
??:??:?? 0   /static/site.webmanifest.gz (196 Bytes)
??:??:?? 0   /static/sw.js.gz (755 Bytes)
??:??:?? 0   /static/workbox-4ee7f24a.js.gz (5199 Bytes)
??:??:?? 0 I2C device found at address 0x51
??:??:?? 0 PCF8563 RTC found
??:??:?? 0 1 I2C devices found
??:??:?? 0 Meshtastic hwvendor=44, swver=1.3.20.90b3660-d
??:??:?? 0 Setting random seed 1700225922
??:??:?? 0 Total heap: 237756
??:??:?? 0 Free heap: 206240
??:??:?? 0 Total PSRAM: 0
??:??:?? 0 Free PSRAM: 0
??:??:?? 0 NVS: UsedEntries 77, FreeEntries 553, AllEntries 630, NameSpaces 2
??:??:?? 0 Setup Preferences in Flash Storage
??:??:?? 0 Number of Device Reboots: 1
??:??:?? 0 Initial packet id 1422670064, numPacketId 4294967295
??:??:?? 0 Setting default channel and radio preferences!
??:??:?? 0 Expanding short PSK #1
??:??:?? 0 Wanted region 0, using Unset
[E][vfs_api.cpp:64] open(): /littlefs/prefs/db.proto does not exist
??:??:?? 0 No /prefs/db.proto preferences found
??:??:?? 0 Setting default channel and radio preferences!
??:??:?? 0 Expanding short PSK #1
??:??:?? 0 Wanted region 0, using Unset
[E][vfs_api.cpp:64] open(): /littlefs/prefs/config.proto does not exist
??:??:?? 0 No /prefs/config.proto preferences found
??:??:?? 0 Expanding short PSK #1
??:??:?? 0 Wanted region 0, using Unset
[E][vfs_api.cpp:64] open(): /littlefs/prefs/module.proto does not exist
?:??:?? 0 No /prefs/module.proto preferences found
[E][vfs_api.cpp:64] open(): /littlefs/prefs/channels.proto does not exist
:??:?? 0 No /prefs/channels.proto preferences found
??:??:?? 0 Number of Device Reboots: 1
??:??:?? 0 Setting default channel and radio preferences!
??:??:?? 0 Expanding short PSK #1
??:??:?? 0 Wanted region 0, using Unset
??:??:?? 0 region=0, NODENUM=0x25979d88, dbsize=1
??:??:?? 0 Read RTC time from PCF8563 as 776454782
17:53:02 0 Warning: No GPS found - running without GPS
[E][vfs_api.cpp:64] op�17:53:02 1 Turning on screen
17:53:02 1 Updating E-Paper... _PowerOn : 146999
_Update_Full : 935000
_Update_Part : 328000
_PowerOff : 63000
done
17:53:04 2 Updating E-Paper... _PowerOn : 147000
_Update_Part : 327999
_Update_Part : 328000
_PowerOff : 62999
done
17:53:05 3 Module wants a UI Frame
17:53:05 3 Starting meshradio init...
17:53:05 3 Set radio: name=LongFast, config=0, ch=19, power=30
17:53:05 3 Radio myRegion->freqStart / myRegion->freqEnd: 902.000000 -> 928.000000 (26.000000 mhz)
17:53:05 3 Radio myRegion->numChannels: 104
17:53:05 3 Radio channel_num: 19
17:53:05 3 Radio frequency: 904.375000
17:53:05 3 Slot time: 42 msec
17:53:05 3 Set radio: final power level=20
17:53:05 3 Current limit set to 100.000000
17:53:05 3 Current limit set result 0
17:53:05 3 RF95 init result -19
17:53:05 3 Current limit set to 100.000000
17:53:05 3 Current limit set result 0
17:53:05 3 RF95 Radio init succeeded, using RF95 radio
17:53:05 3 Not using WIFI
17:53:05 3 (bw=250, sf=11, cr=4/8) packet symLen=8 ms, payloadSize=237, time 3188 ms
17:53:05 3 myNodeInfo.bitrate = 74.341286 bytes / sec
17:53:05 3 PowerFSM init, USB power=1
17:53:05 3 Enter state: BOOT
17:53:05 3 [Screen] Screen: Started...
17:53:05 4 [Screen] Updating E-Paper... _PowerOn : 145999
_Update_Part : 327999
_Update_Part : 327997
_PowerOff : 63004
done
17:53:06 5 [DeviceTelemetryModule] Device Telemetry: Initializing
17:53:06 5 [DeviceTelemetryModule] -----------------------------------------
17:53:06 5 [DeviceTelemetryModule] Device Telemetry: Read data
17:53:06 5 [DeviceTelemetryModule] Telemetry->time: 776454786
17:53:06 5 [DeviceTelemetryModule] Telemetry->air_util_tx: 0.000000
17:53:06 5 [DeviceTelemetryModule] Telemetry->battery_level: 0
17:53:06 5 [DeviceTelemetryModule] Telemetry->channel_utilization: 0.000000
17:53:06 5 [DeviceTelemetryModule] Telemetry->voltage: 0.000000
17:53:06 5 [DeviceTelemetryModule] Device Telemetry: Sending packet to mesh
17:53:06 5 [DeviceTelemetryModule] Update DB node 0x25979d88, rx_time=0
17:53:06 5 [DeviceTelemetryModule] handleReceived(LOCAL) (id=0x54cc38f4 Fr0x88 To0xff, WantAck0, HopLim3 Ch0x0 Portnum=67)
17:53:06 5 [DeviceTelemetryModule] No modules interested in portnum=67, src=LOCAL
17:53:06 5 [DeviceTelemetryModule] Add packet record (id=0x54cc38f4 Fr0x88 To0xff, WantAck0, HopLim3 Ch0x0 Portnum=67)
17:53:06 5 [DeviceTelemetryModule] Should encrypt MQTT?: 1
17:53:06 5 [DeviceTelemetryModule] Expanding short PSK #1
17:53:06 5 [DeviceTelemetryModule] Using AES128 key!
17:53:06 5 [DeviceTelemetryModule] ESP32 crypt fr=25979d88, num=54cc38f4, numBytes=11!
17:53:06 5 [DeviceTelemetryModule] enqueuing for send (id=0x54cc38f4 Fr0x88 To0xff, WantAck0, HopLim3 Ch0x8 encrypted)
17:53:06 5 [DeviceTelemetryModule] txGood=0,rxGood=0,rxBad=0
17:53:06 5 [DeviceTelemetryModule] updateTelemetry LOCAL
17:53:06 5 [DeviceTelemetryModule] Node status update: 0 online, 1 total
17:53:06 5 [SerialModule] Serial Module Disabled
17:53:06 5 [StoreForwardModule] Store & Forward Module - Disabled
17:53:06 5 [RangeTestModule] Range Test Module - Disabled
17:53:06 5 [RadioIf] Starting low level send (id=0x54cc38f4 Fr0x88 To0xff, WantAck0, HopLim3 Ch0x8 encrypted priority=64)
17:53:06 5 [RadioIf] (bw=250, sf=11, cr=4/8) packet symLen=8 ms, payloadSize=27, time 690 ms
17:53:06 5 [RadioIf] AirTime - Packet transmitted : 690ms
17:53:07 6 [Screen] Updating E-Paper... _PowerOn : 145998
_Update_Part : 328005
_Update_Part : 328001
_PowerOff : 62999
done
17:53:08 7 [RadioIf] Completed sending (id=0x54cc38f4 Fr0x88 To0xff, WantAck0, HopLim3 Ch0x8 encrypted priority=64)
17:53:08 7 [PowerFSM] Enter state: POWER
17:53:08 7 [PowerFSM] Initialise the ESP32 bluetooth module
17:53:08 7 [PowerFSM] Configuring the Device Information Service
17:53:08 7 [PowerFSM] Configuring the Mesh bluetooth service
I NimBLEDevice: "BLE Host Task Started"
I NimBLEDevice: "NimBle host synced."
D NimBLEDevice: ">> setPower: 7 (type: 11)"
D NimBLEDevice: "<< setPower"
D NimBLEDevice: "Setting bonding: 1, mitm: 1, sc: 1"
D (8142) NimBLE: Controller not ready to receive packets
D (8146) NimBLE: Controller not ready to receive packets
17:53:09 8 [Screen] Screen: Powered...
17:53:09 8 [Screen] Updating E-Paper... _PowerOn : 146001
_Update_Part : 327997
_Update_Part : 328003
_PowerOff : 63001
done
17:53:11 10 [Screen] Done with boot screen...
17:53:11 10 [Screen] showing standard frames
17:53:11 10 [Screen] Showing 0 module frames
17:53:11 10 [Screen] Total frame count: 83
17:53:11 10 [Screen] Added modules.  numframes: 0
17:53:11 10 [Screen] Finished building frames. numframes: 2
17:53:11 10 [Screen] Setting fast framerate
17:53:11 10 [Screen] Setting idle framerate
17:53:12 10 [Screen] Updating E-Paper... _PowerOn : 146997
_Update_Part : 328001
_Update_Part : 327999
_PowerOff : 63003
done
17:53:29 27 [Button] Initialise the ESP32 bluetooth module
17:53:29 27 [Button] Configuring the Device Information Service
17:53:29 27 [Button] Configuring the Mesh bluetooth service
D NimBLEDevice: ">> setPower: 7 (type: 11)"
D NimBLEDevice: "<< setPower"
D NimBLEDevice: "Setting bonding: 1, mitm: 1, sc: 1"
D (27669) NimBLE: Controller not ready to receive packets
D (27674) NimBLE: Controller not ready to receive packets
17:53:29 27 [Button] Enter state: POWER
17:53:29 27 [Button] Initialise the ESP32 bluetooth module
17:53:29 27 [Button] Configuring the Device Information Service
17:53:29 27 [Button] Configuring the Mesh bluetooth service
D NimBLEDevice: ">> setPower: 7 (type: 11)"
D NimBLEDevice: "<< setPower"
D NimBLEDevice: "Setting bonding: 1, mitm: 1, sc: 1"
D (27716) NimBLE: Controller not ready to receive packets
D (27720) NimBLE: Controller not ready to receive packets
17:53:29 27 [Screen] Screen: Unpowered...
17:53:29 27 [Screen] Setting LastScreenTransition
17:53:29 27 [Screen] Setting fast framerate
17:53:29 27 [Screen] Screen: Powered...
17:53:29 28 [Screen] Setting idle framerate
17:53:29 28 [Screen] Updating E-Paper... _PowerOn : 146000
_Update_Part : 328001
_Update_Part : 327998
_PowerOff : 63000
done
17:53:32 30 [NodeInfoModule] Sending our nodeinfo to mesh (wantReplies=1)
17:53:32 30 [NodeInfoModule] sending owner !25979d88/Meshtastic 9d88/9d88
17:53:32 30 [NodeInfoModule] Update DB node 0x25979d88, rx_time=0
17:53:32 30 [NodeInfoModule] handleReceived(LOCAL) (id=0x54cc38f5 Fr0x88 To0xff, WantAck0, HopLim3 Ch0x0 Portnum=4 WANTRESP priority=10)
17:53:32 30 [NodeInfoModule] No modules interested in portnum=4, src=LOCAL
17:53:32 30 [NodeInfoModule] Add packet record (id=0x54cc38f5 Fr0x88 To0xff, WantAck0, HopLim3 Ch0x0 Portnum=4 WANTRESP priority=10)
17:53:32 30 [NodeInfoModule] Should encrypt MQTT?: 1
17:53:32 30 [NodeInfoModule] Expanding short PSK #1
17:53:32 30 [NodeInfoModule] Using AES128 key!
17:53:32 30 [NodeInfoModule] ESP32 crypt fr=25979d88, num=54cc38f5, numBytes=50!
17:53:32 30 [NodeInfoModule] enqueuing for send (id=0x54cc38f5 Fr0x88 To0xff, WantAck0, HopLim3 Ch0x8 encrypted priority=10)
17:53:32 30 [NodeInfoModule] txGood=1,rxGood=0,rxBad=0
17:53:32 30 [RadioIf] Starting low level send (id=0x54cc38f5 Fr0x88 To0xff, WantAck0, HopLim3 Ch0x8 encrypted priority=10)
17:53:32 30 [RadioIf] (bw=250, sf=11, cr=4/8) packet symLen=8 ms, payloadSize=66, time 1148 ms
17:53:32 30 [RadioIf] AirTime - Packet transmitted : 1148ms
17:53:33 32 [RadioIf] Completed sending (id=0x54cc38f5 Fr0x88 To0xff, WantAck0, HopLim3 Ch0x8 encrypted priority=10)
1 Like