firmware
                                
                                 firmware copied to clipboard
                                
                                    firmware copied to clipboard
                            
                            
                            
                        Add M5Paper support
New device: M5Paper
I've had a few of these lying around for a long time, and given the form factor, I thought they'd be perfect for Meshtastic.
Sadly, the official M5Stack LoRaWAN Unit, which uses the ASR6501 radio over UART, can't be supported, so I'm a bit stuck on what kind of LoRa radio to attach to this.
Nonetheless I thought it would be nice to get some initial reviews on the parts I did finish.
Notes
- This will obviously not boot as-is due to the hard requirement for a LoRa radio. To work this around, any reviewer will need to change this line and replace it with a non-critical log (e.g. LOG_DEBUG("LoRa Radio not found!\n");). I've started a thread on the forum to hunt for a module that could be used.
- I still haven't gotten the touch screen to work, as the appropriate bits of code are in the TFTDisplay class. I'd like to propose moving all commonly shared display bits to a separate BaseDisplayclass that both TFTDisplay and EInkDisplay can inherit from, thereby working around this limitation - but that is way out of scope for this PR and needs proper planning.
- For now, both LORA and GPS definitions are commented out - I will be enabling these once I have a solid approach to them.
- The display is barely readable, as there's no scaling for physical size in the current GUI framework. This, as well as handling of a partial window (the M5Paper's display runs to the edges, and since Meshtastic draws to the very edge of the screen, this makes some parts hard to read, even at appropriate scaling), would be needed for proper support of the M5Paper.
- Currently, this is using my fork of GxEPD2 as ZinggMJ refuses to merge any PRs or include any display they don't own. As such, I will be keeping that tag up to date (though I doubt any further changes will be needed as the display works just fine).
- There's a weird invalid pinerror during initial boot:
INFO  | 17:38:13 1 External Notification Module Disabled
INFO  | 17:38:13 1 Doing EInk init
[  1737][E][esp32-hal-gpio.c:102] __pinMode(): Invalid pin selected
E (1732) gpio: gpio_set_level(226): GPIO output gpio_n_IT8951SetVCOM : 430955
set VCOM = -2.30
GetIT8951SystemInfo : 6001
Panel(W,H) = (960, 540)
which I can't place. It interrupts, and gets interrupted, by the EINK init sequence, so the logs are a bit garbled, making it hard to debug. Any advice regarding this would be appreciated!
maybe talk to @markbirss he has don work with m5paper before. His idea was to interface a generic lora radio through the sd card slot.
@caveman99 I was thinking of using two of the three Grove ports to provide a second SPI interface (see the forum thread) - an SX126/7/8X radio could work over 4 pins, and that leaves one of the Grove ports free for a GPS module.
@caveman99 I was thinking of using two of the three Grove ports to provide a second SPI interface (see the forum thread) - an SX126/7/8X radio could work over 4 pins, and that leaves one of the Grove ports free for a GPS module.
Hi, I tried hard before but just could not get both display and lora working
I tried the tf breakout but those pins must have resistors inline or something
Sadly the new yet tobe released esp32-s3 m5paper version lacks gpio breakout from the initial pictures I have seen
I have been much more successful with the m5stack coreink
Let me have a look at the changes you made if it was similar what I did before as it was tricky to get gxepd2 to use the m5paper e-eink at the time
Oh i also had the same garbled uart issue with m5stack coreink but it went better after esp32 bsp update
maybe talk to @markbirss he has don work with m5paper before. His idea was to interface a generic lora radio through the sd card slot.
Ok I see you added your own m5paper support to GxEPD2 .
At the time I found a pin combination and modified existing other display just modifying resolution
@markbirss thanks for the info! Could you by any chance link to the new gen M5Paper pictures you've seen?
I doubt M5 will add a proper GPIO header, the M5Paper is meant to be a handheld. But if they got rid of the IT8951, that alone will free up resources that could make it more viable (not to mention the improved power profile).
Oh i also had the same garbled uart issue with m5stack coreink but it went better after esp32 bsp update
What BSP update?
Ok I see you added your own added m5paper support to GxEPD2 .
Yep, I did many trials and the default IT8951E IT60 approach worked quite well, although needed some tinkering with the timings and the order of commands (the M5Paper's approach is to bring the MCU online, set VCOM and other settings and only then request the IC info - any other order and the chip simply stops responding). But my fork of GxEPD2 works just fine, tested it in depth myself.
@fonix232
https://twitter.com/M5Stack/status/1620371661433475075?t=G4QzN5tZQgbEOs6O7wBq6g&s=19
This is a new picture that maybe show some pins on the side, previous pictures did not show
It the espressif board support version upgrade at the time when I added n5stack coreink
At first it not allowed me to use the python cli over serial
If you are a discord member we can chat more there
@markbirss thanks for the info! Could you by any chance link to the new gen M5Paper pictures you've seen?
I doubt M5 will add a proper GPIO header, the M5Paper is meant to be a handheld. But if they got rid of the IT8951, that alone will free up resources that could make it more viable (not to mention the improved power profile).
Oh i also had the same garbled uart issue with m5stack coreink but it went better after esp32 bsp update
What BSP update?
Ok I see you added your own added m5paper support to GxEPD2 .
Yep, I did many trials and the default IT8951E IT60 approach worked quite well, although needed some tinkering with the timings and the order of commands (the M5Paper's approach is to bring the MCU online, set VCOM and other settings and only then request the IC info - any other order and the chip simply stops responding). But my fork of GxEPD2 works just fine, tested it in depth myself.
Well I'm not saying it could not work at all, it possible you approach is different so you could try like I tried the broken out tf/sdcard pins again