Best way to add LoRa to the M5Paper?

So, I’ve brought up a bare minimum device support PR for the M5Stack M5Paper. It’s a pretty solid, albeit older device, with a 960x540 e-ink display, GT911 touchscreen, SD card slot, temp/humidity sensor, overall a great handheld unit. In theory, perfect for Meshtastic use.

One shortcoming though: there’s no external SPI port (not to mention that SPI is already busy with the display and SD card reader, not sure if a LoRa radio could be tacked on safely). There are, however, three standard M5 Grove ports, each providing 2 GPIO pins, 5V and GND.

One of these would be occupied by the GPS module I’m planning to attach, which, luckily, works over UART.

However, I can’t seem to find a supported LoRa radio that could be connected over 4, or, ideally, 2 GPIO pins. Is there really no such hardware on the market? Should I maybe try with an I2C ↔ SPI bridge?

Small sidenote: I’ve managed to get pretty much everything working, except for the touch screen (touch is limited to TFT displays at the moment and I did not feel like refactoring half the screen management to get it working). But the display, the SHT30 sensor, the BM8563 RTC all work, so does the SD card reader, battery status, PSRAM, etc. - so soon I’ll be pushing a PR for official support :slight_smile:

An SX127X LoRa device can be operated with SCK, MOSI, MISO and NSS.

The LoRa RX and TX complete, normally read via DIO0, can be read from a register and NRESET can be left not connected, the LoRa device will reset on power up.

Sparkfun do a QWIIC (I2C) LoRa board, but the software to drive it is very different to the SPI type interface used by the Meshtastic software.

NXP do some I2C to SPI bridge ICs, never tried one with a LoRa device however.

Given the the changes needed to the Meshtastic software, perhaps adapting it for one on the several UART (RX,TX) fronted LoRa modules could be more worthwhile.

If your setup already uses I2C (the RTC ?) you can access a GPS over the I2C bus, so no need for serperate serial RX and TX pins.

The M5Paper is an enclosed unit, so unfortunately we can’t just willy-nilly add devices on whatever pins. The goal would be supporting this variant with essentially “plug and play” approach, even if one has to wire their own Grove connectors.

Both the RTC and a separate CMOS NVRAM (an FM24C02) are on the I2C bus, on pins 21 and 22, whereas the three Grove ports provide access to pins 25+32, 26+33 and 18+19.

I guess the best way to go would be to connect to two of these with the bare minimum SCK/MOSI/MISO/NSS pins.

Reading a GPS only needs the RX pin.

You do realise that GPS modules need AT commands to function, and such, need both Tx and Rx?

For sure if you want to change the configuration of a GPS you need to write characters to its RX pin.

But for just standard location fix information, most all GPSs will provide the appropriate NMEA sentences as supplied, no need to configure them.