Hey I have the Display Module 13.2, and whilst I have gotten the output to work, I can't get ethernet to work at the same time. If I fire up ethernet at the start of sketch it is all working, but as soon as I run this command "M5.begin(cfg);" to start the display, ethernet no longer has IP address and no longer functions.
Any help appreciated.
#include <Arduino.h>
#include <M5ModuleDisplay.h>
#include <M5Unified.h>
#include <SPI.h>
#include <Ethernet2.h>
#define SCK 18
#define MISO 19
#define MOSI 23
#define CS 26
byte mac[] = { 0xAA, 0x4D, 0xBE, 0xEF, 0xFE, 0xED };
int udpPort = 9090;
void setup() {
auto cfg = M5.config();
SPI.begin(SCK, MISO, MOSI, -1);
Ethernet.init(CS);
Ethernet.begin(mac);
Serial.begin(115200); // Initialize serial communication
Serial.println(" ");
Serial.print("Local IP ");
Serial.println(Ethernet.localIP());
Serial.print("Gateway ");
Serial.println(Ethernet.gatewayIP());
cfg.external_speaker.module_display = true;
cfg.external_display.module_display = true;
Serial.println(" ");
Serial.print("Local IP ");
Serial.println(Ethernet.localIP());
Serial.print("Gateway ");
Serial.println(Ethernet.gatewayIP());
// If you want to change the resolution, uncomment the following lines and
// adjust the values
cfg.module_display.logical_width = 640;
cfg.module_display.logical_height = 360;
cfg.module_display.refresh_rate = 50;
Serial.println(" ");
Serial.print("Local IP ");
Serial.println(Ethernet.localIP());
Serial.print("Gateway ");
Serial.println(Ethernet.gatewayIP());
M5.begin(cfg);
Serial.println(" ");
Serial.print("Local IP ");
Serial.println(Ethernet.localIP());
Serial.print("Gateway ");
Serial.println(Ethernet.gatewayIP());