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

    I want to communicate data with M5stack Core2 and COM.Sigfox.

    Modules
    core2 sigfox
    2
    9
    15.3k
    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.
    • T
      takero
      last edited by takero

      Hello. I bought M5stack Core2 and COM.Sigfox. I want to use this for data communication.
      I was able to register the module in the sigfox backend. But I can't communicate or call back.
      When I use M5stack Basic and COM.Sigfox,I can do data communication and callbacks.
      Is there something wrong with my sketch?

      #include <M5Core2.h>
      
      void setup() {
       M5.begin(true, false, true);
       Serial2.begin(9600, SERIAL_8N1, 13, 14);
       Serial.begin(9600);
       }
      
      void loop() {
       int val = 11223344;
       String msg = String(val, HEX);
       Serial.print( msg);  Serial.println(" msg ");
       Serial2.print("AT$SF=" + msg);
       Serial.print("AT$SF=" + msg);  Serial.println(" AT$SF= msg ");
       delay(15*1000);
      }
      
      1 Reply Last reply Reply Quote 0
      • felmueF
        felmue
        last edited by

        Hello @takero

        in this example sending a command uses Serial2.write("AT$SF=00FFEE\r\n"); instead of print(). In another example I found println() was used.

        I have a feeling the COM.Sigfox module would like a \r\n as a line end. (But that is just a guess as I don't have that module and cannot test myself.)

        Good luck!
        Felix

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

        T 1 Reply Last reply Reply Quote 0
        • T
          takero @felmue
          last edited by

          @felmue
          Thank you for suggestion Felix. And Sorry for my late reply.
          I tried Serial2.println("AT$SF=" + msg );.
          or Serial2.println("AT$SF= + msg ");.

          and Serial2.write("AT$SF= + msg ");.
          or Serial2.write("AT$SF=" + msg );.

          But I couldn't communicate.
          If you have new tips, I would love to try.

          Thank you.

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

            Hello @takero

            have you tried the example I've mentioned? This should read and display the SigfoxID and PACNumber and if successful would tell you the hardware is ok.

            Note: for M5Core2 you'll need to adapt rxPin to 13 and txPin to 14 as before.

            Thanks
            Felix

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

            T 1 Reply Last reply Reply Quote 0
            • T
              takero @felmue
              last edited by

              @felmue Thank you.
              I tried your sample. I succeeded in compiling.
              But I can't write to core2 since yesterday.

              Displayed "A fatal error occurred: Failed to connect to ESP32: Timed out Waiting for packet header"

              Both of the Core2 I have are like that. Did my Core 2 break?
              I just wrote a sketch.

              Thank you.

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

                Hello @takero

                sorry to hear. It's very unlikely that both of your M5Core2 devices just broke like that. Some suggestions:

                • Have you tried a different USB cable?
                • Have you tried a different USB port?
                • Have you tried closing and reopening your software?
                • Have you tried to reboot your computer?

                Thanks
                Felix

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

                T 1 Reply Last reply Reply Quote 0
                • T
                  takero @felmue
                  last edited by

                  Thank you @felmue .I have tried your suggestion.

                  Have you tried a different USB cable? :Yes I did.
                  Have you tried a different USB port? :Yes I did.
                  Have you tried closing and reopening your software? :Yes I did.
                  Have you tried to reboot your computer? :Yes I did.

                  However, I got an error. Isn't my Core 2 broken ?

                  I tried another sketch and the result was the same.
                  At that time, I connected the actual sensor.
                  DHT22 to GPIO72.
                  DS18B20 to GPIO26.
                  Analog sensor to GPIO36.
                  Is that not good?
                  Thank you.

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

                    Hello @takero

                    until you have figured out the issue regarding flashing a sketch (any sketch) onto your M5Core2, I'd do the following:

                    • only connect the USB cable to your computer
                    • disconnect everything else
                    • try flashing a sketch
                      If that doesn't work, then maybe your M5Core2 has been damaged (still very unlikely though).
                      Thanks
                      Felix

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

                    T 1 Reply Last reply Reply Quote 0
                    • T
                      takero @felmue
                      last edited by

                      @felmue
                      While I was writing to Core 2, I pressed the power button for a long time and the writing was successful.

                      Thank you.

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