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

    Problem compiling with Include M5Stack.h

    FAQS
    5
    7
    24.8k
    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.
    • Z
      Zathras0
      last edited by

      If I try and compile in Arduino IDE and sketch that has the #include M5Stack.h, even on Example code in the "examples from Custom Library - M5Stack - Basic - Hello World, I get an compiling error.

      Here is the error I get for Hello World with display to the TFT:
      C:\Users\█████\Documents\Arduino\libraries\M5Stack\src\M5Stack.cpp: In member function 'void M5Stack::powerOFF()':

      C:\Users\█████\Documents\Arduino\libraries\M5Stack\src\M5Stack.cpp:65:62: error: 'esp_sleep_enable_ext0_wakeup' was not declared in this scope

       esp_sleep_enable_ext0_wakeup((gpio_num_t)_wakeupPin , LOW);
      

      Now I I have updated the library with GIT.

      Arduino: 1.8.5 (Windows Store 1.8.10.0) (Windows 10), Board: "M5Stack-Core-ESP32

      I can compile and run others like ResetReason.

      So guidance would be helpful to resolve this

      1 Reply Last reply Reply Quote 0
      • P
        PépéMax
        last edited by

        hi, Zathras0
        Why you use Arduino IDE, work rather with PlatformIO it's easier to use.
        And I think that your function was not declared above in your code or from what I saw this function and made for an ESP.

        Did you know that select M5Stack in your board from the menu <tool>

        and I start in C++ so I tell you about my problems that I met

        Z 1 Reply Last reply Reply Quote 0
        • Z
          Zathras0 @PépéMax
          last edited by

          @pépémax
          I will give PlatformIO a go. Might give me more direction of where the issue is. Trying via VScode, supposed to be easier for casual programer like myself

          In response to what you said, the M5Stack at its core is a ESP32.

          The statement it complains about is in the M5Stack.h itself for the power off function.

          1 Reply Last reply Reply Quote 0
          • P
            PépéMax
            last edited by

            @Zathras0
            I know that the MStack is an ESP32 but you should know that some function of the ESP32 does not work yet for the M5Stack library like analogWrite(), I saw this morning on a forum if I find the link I give it to you.
            And I think it's your function that is not handled by the M5Stack librairy

            1 Reply Last reply Reply Quote 0
            • ajb2k3A
              ajb2k3
              last edited by

              please see my post here:
              http://forum.m5stack.com/topic/237/compilation-errors-in-arduino-1-6-5

              Try this and let me know as I have just been fighting with the GUI.

              UIFlow, so easy an adult can learn it!
              If I don't know it, be patient!
              I've ether not learned it or am too drunk to remember it!
              Author of the WIP UIFlow Handbook!
              M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

              JJJ 1 Reply Last reply Reply Quote 0
              • JJJ
                JJ @ajb2k3
                last edited by

                Hi @Zathras0,
                That seems a weird error to get from running M5Stack's simple Hello sketch which does not include a poweroff function. (?).
                Also I don't know the "ResetReason" sketch that you referred to. Where did you find this ?

                (1)OK it seems you have the M5Stack library installed in the correct place.

                (2) Is the Espressif ESP32 library installed ? Check: C:\Users\█████\Documents\Arduino\Hardware\espressif\esp32\libraries . If you don't have files there go to M5Stack setup guide and install them.

                (3) As PépéMax suggested, in the Arduino IDE, check that the M5Stack is selected as the board that you are using with the IDE. On the Arduino menu go to /Tools/Board . The M5Stack should be set here as the board you are using.

                @PépéMax

                '...some function of the ESP32 does not work yet for the M5Stack library like analogWrite()

                Just to clarify, as I understand it, the issue is that not all functions available on Arduino or ESP8266 boards are available at present on ESP32 boards in general - eg: analogWrite();. That is, the problem is not specific to M5Stack boards - it effects all ESP32 boards. Referenced here

                1 Reply Last reply Reply Quote 0
                • C
                  cepics
                  last edited by

                  same problem!!!

                  solved on commenting out

                  gpio_deep_sleep_hold_dis();

                  in

                  Documents/Arduino/libraries/M5Stack/src/utility/Power.cpp

                  I don't know why, but now arduino compile

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