🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Core2 with PoE Base

    PRODUCTS
    just
    2
    7
    3.4k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      PaulB
      last edited by

      Hi All,

      I have just purchased myself a Core2 and a PoE Base. New to M5Stack but 5 years experience on ESP32's.

      I am battling to get the Core2 to "see" the W5500 on the PoE Base with no luck, I have tried the M5-Ethernet WebClient.ino and I keep seeing "Failed to configure Ethernet using DHCP, Ethernet shield was not found. Sorry can't run without hardware. :(

      What am I missing something? I am using the stock M5 Arduino library's, do I need to adjust some #define's?

      Thanking you in advance, any assistance will much appreciated.

      Regards
      Paul

      1 Reply Last reply Reply Quote 0
      • felmueF
        felmue
        last edited by

        Hello @PaulB

        I can get it to work when I include M5Core2.h at the top, set the correct CS pin and initialize the M5Core2 LCD, Serial etc. at the top of setup(), e.g.

        #include <M5Core2.h>
        ...
        void setup() {
          Ethernet.init(GPIO_NUM_26);
          M5.begin();
        
        //  // Open serial communications and wait for port to open:
        //  Serial.begin(115200);
        //  while (!Serial) {
        //    ; // wait for serial port to connect. Needed for native USB port only
        //  }
        

        Thanks
        Felix

        GPIO translation table M5Stack / M5Core2
        Information about various M5Stack products.
        Code examples

        1 Reply Last reply Reply Quote 0
        • P
          PaulB
          last edited by

          Thank you so much, it works

          1 Reply Last reply Reply Quote 0
          • P
            PaulB
            last edited by PaulB

            Next question...

            How do I force my Core2 to be powered only from the PoE Base, I have tried this and it still needs the USB cable plugged for a power source.

            M5.begin(true, true, true, false, kMBusModeInput);

            1 Reply Last reply Reply Quote 0
            • felmueF
              felmue
              last edited by

              Hello @PaulB

              this should work automatically when you power from PoE exclusivly. The code (see here) checks if external power (e.g. on the M5 bus) is available and switches to use that. (But I think that only works if USB wasn't already plugged in.)

              Note: kMBusMode* is no longer used.

              Thanks
              Felix

              GPIO translation table M5Stack / M5Core2
              Information about various M5Stack products.
              Code examples

              1 Reply Last reply Reply Quote 0
              • P
                PaulB
                last edited by

                I have also tried just M5.begin(); same result as M5.begin(true, true, true, false, kmBusModeInput); where LCD briefly "flashes" (which appears like its trying initialize), internal Green Led flashes and both LCD and Green Led then go off, only difference is the speaker has a low volume "sequel" that is produced with just M5.begin(); the entire time there after, with the other M5.begin(.....) command the speaker is quiet.

                I can only get functionality from the Core2 if USB is plugged in.

                What should my setup look like?

                Here is my code so far... I don't know how to indicate code in a post, so sorry if this is not the correct way to do this.

                #include <M5Core2.h>
                #include <SPI.h>
                #include <M5_Ethernet.h>

                byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
                char server[] = "www.google.com"; // name address for Google (using DNS)

                IPAddress ip(192, 168, 0, 177);
                IPAddress myDns(192, 168, 0, 1);

                EthernetClient client;

                void setup {
                M5.begin(true, true, true, false, kmBusModeInput);
                Ethernet.init(GPIO_NUM_26);
                M5.Lcd.setTextSize(2);
                M5.Lcd.setTextColor(TFT_WHITE, TFT_BLACK);
                M5.Lcd.println("Ethernet Test!");

                M5.Lcd.println("Initialize Ethernet with DHCP:");
                if (Ethernet.begin(mac) == 0) {
                M5.Lcd.println("Failed to configure Ethernet using DHCP");
                // Check for Ethernet hardware present
                if (Ethernet.hardwareStatus() == EthernetNoHardware) {
                M5.Lcd.println("Ethernet shield was not found. Sorry, can't run without hardware. :(");
                while (true) {
                delay(1); // do nothing, no point running without Ethernet hardware
                }
                }
                if (Ethernet.linkStatus() == LinkOFF) {
                M5.Lcd.println("Ethernet cable is not connected.");
                }
                // try to congifure using IP address instead of DHCP:
                Ethernet.begin(mac, ip, myDns);
                } else {
                M5.Lcd.print(" DHCP assigned IP ");
                }
                // give the Ethernet shield a second to initialize:
                delay(1000);
                M5.Lcd.print("Connecting to ");
                M5.Lcd.print(server);
                M5.Lcd.println("...");

                // if you get a connection, report back via serial:
                if (client.connect(server, 80)) {
                M5.Lcd.print("Connected");
                } else {
                // if you didn't get a connection to the server:
                M5.Lcd.println("Connection failed");
                }

                }

                void loop() {

                }

                Is the sequence of commands critical?

                Is there a command to force the Axp to use MBus seeing that kmBusMode* is no longer used

                1 Reply Last reply Reply Quote 0
                • P
                  PaulB
                  last edited by

                  Just a heads up I can get this to work if I use M5Unified.h instead of M5Core2.h

                  1 Reply Last reply Reply Quote 1
                  • First post
                    Last post