🤖Have you ever tried Chat.M5Stack.com before asking??😎
  • DC Motor AKA Lego+ not working in uiFlow?

    3
    0 Votes
    3 Posts
    6k Views
    H
    @felmue That actually worked. Not an ideal situation as I cannot use the newer units, but for now the Lego motors turn again which is awesome! Thanks a lot! I downgraded the UI, but it never occured to me that I should downgrade the firmware too.
  • Grbl13.2 Functions

    2
    0 Votes
    2 Posts
    3k Views
    No one has replied
  • M5Paper, using canvas in procedure

    m5paper
    2
    0 Votes
    2 Posts
    5k Views
    world101W
    @powersoft Do you only have 1 canvas? Try canvas instead of canvas1. BTW, you can enclose your code in three back ticks (```) to make it easier for us to read, like this... this text has three back ticks before and after it
  • I want to make a door sensor.

    1
    0 Votes
    1 Posts
    4k Views
    No one has replied
  • M5core 12 channel Server Module not work.

    1
    0 Votes
    1 Posts
    4k Views
    No one has replied
  • GoPlus2 Module and M5Stack Fire - how to charge ?

    5
    1 Votes
    5 Posts
    8k Views
    R
    Hello felmue, it's no problem - i've ordered one and will have it by the end of the week. I looked to the scematics too ( - a little, I'm no specialist) and I found what you said. And I found more things that make me problems. I think the voltage from the external input is converted to 5V DC like the USB power. So I cannot use my DC12V motors unfortunately - I have to change to 5V types. (Now I unterstand, why they are rotating with so less power and slow.) Thank you and regards K.D
  • M5StickC Plus and Joystick HAT Problem

    2
    0 Votes
    2 Posts
    3k Views
    felmueF
    Hello @Volos have you tried the official Joystick hat example? Thanks Felix
  • [M5Paper] pushImage()

    m5paper
    2
    0 Votes
    2 Posts
    6k Views
    world101W
    @powersoft Have you tried this tool yet? https://github.com/m5stack/M5EPD/tree/main/tools/image2gray It takes a jpg/png/bmp image and converts the image to a 4bit grayscale array.
  • How to get API key for M5Paper?

    4
    0 Votes
    4 Posts
    4k Views
    ZontexZ
    Unfortuntely as @ajb2k3 said it's not yet supported but hopefully will in the near future :)
  • I want to communicate data with M5stack Core2 and COM.Sigfox.

    core2 sigfox
    9
    0 Votes
    9 Posts
    19k Views
    T
    @felmue While I was writing to Core 2, I pressed the power button for a long time and the writing was successful. Thank you.
  • NFC PN532 grove v1.1 - M5PAPER

    2
    0 Votes
    2 Posts
    4k Views
    ZontexZ
    Hello, the NFC PN532 is a grove sensor and not an M5Stck sensor thus we don't support it and not familiar with the way their product works, I suggest you to contact seed studio regarding this issue. Where did you get the software? I can see it's m5 combined with the seeedstudio sensor, did you made it yourself?
  • PROTO HAT PCB

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • RFID RC522 Panel for M5 Faces - without screws?

    3
    0 Votes
    3 Posts
    4k Views
    M
    It would be nice if M5Stack can include those screws in the package. Nothing much you can do with a "Faces RFID" than screw it on a "Faces II Bottom Board". The "Standing Base" also includes the required screws to make it functional.
  • Controlling 12v solenoid

    4
    0 Votes
    4 Posts
    5k Views
    D
    If you need to PWM the output, you can use a mosfet module. You can find a cheap one on eBay or AliExpress. [image: 1610017285350-4cf5d38c-ba95-4ae3-886d-db7c5321ab59-image-resized.png]
  • 0 Votes
    1 Posts
    2k Views
    No one has replied
  • m5stack core + batterie module + lan module base

    3
    0 Votes
    3 Posts
    5k Views
    F
    This code is tested and work fine. 1 jan 2021 /* ================================================================================================== projet SWID_M5 ( Switch ID pour M5Stack) version 0.3 date debut : 1 aout 2020 MODIF : 2 aout 2020 modif : 16-18 dec 2020 modif ethernet2 serveur tester et fonctionnel programmation: Francois Blais Montreal QC capture de trame pour la decouverte de commutateur (lldp) materiels M5stack core 4meg prog 1.2 meg ram ecran affichage avec un OLED integer au bibli m5stack (esp32) M5.LCD.println(); 3 bouton 1 haut parleur module battery module lan_w5500 ethernet2.h rj45 bibliotheques chemin de bibli shield w5500 lecture en mode raw C:\Users\fblai\Documents\Arduino\libraries\Ethernet\src\utility C:\Users\fblai\Documents\Arduino\libraries problèmes constatés 1- bibliotherque doit etre celle fournie par m5stack dans la section module/w5500 sinon erreur manque var 2- pour utiliser le serveur test de m5stack dans la section module/w5500 il faut prendre ladresse 192.168.0.177 pour ce conformer a la plage disponible sur mon routeur 3- il faut serrer les trois modules car probleme de connection physique sinon led power clignote 4- il faut mettre dans le w5500.init(CS) qui est CS=26 au lieu de celui par defaut qui est 10 5- utilisation des socket a partir de lobjet w5500.execCmdSn(s,sock_open ou close ou recv ) utilisation de m5stack bouton de power sur le coté peser une fois sur le power pour le demarrer ou le reinitialier peser 2 fois sur le power pour le fermer ==================================================== */ /* ==================================================== bibli ==================================================== */ #include <M5Stack.h> //------------------- ethernet2 w5500 lan rj45 #include <SPI.h> #include <Ethernet2.h> #include <utility/w5500.h> // doit etre sous <Ethernet2.h> #define SCK 18 // adaptation pour m5stack #define MISO 19 #define MOSI 23 #define CS 26 // Enter a MAC address and IP address for your controller below. // The IP address will be dependent on your local network: FB:AD:BE:EF:FE:FB 192.168.0.177 byte mac[] = { 0xFB, 0xAD, 0xBE, 0xEF, 0xFE, 0xFB }; SOCKET s; // RAW mode int rbuflen ; byte trame[335]; int NBR = 0; int position[12]; /* ==================================================== affichage ==================================================== */ String LCD_data[7]; void presentation(String L1,String L2,String L3,String L4,String L5,String L6,String L7,String L8){ M5.Lcd.clear(); M5.Lcd.setCursor(70, 20, 4); M5.Lcd.println(L1); M5.Lcd.setCursor(70, 60, 4); M5.Lcd.println(L2); M5.Lcd.setCursor(70, 80, 4); M5.Lcd.println(L3); M5.Lcd.setCursor(70, 100, 4); M5.Lcd.println(L4); M5.Lcd.setCursor(70, 120, 4); M5.Lcd.println(L5); M5.Lcd.setCursor(70, 140, 4); M5.Lcd.println(L6); M5.Lcd.setCursor(70, 160, 4); M5.Lcd.println(L7); M5.Lcd.setCursor(70, 180, 4); M5.Lcd.println(L8); } /* ==================================================== declaration de mes fonctions ==================================================== */ bool si_lldp(); void lldp(); String decoupe( unsigned int local ); int trouve( const byte rech[] ); String decoupevlan( unsigned int local ); int* trouvetlv(); String decompte; void matrame(); String x2i(String monhexa); // ======================================================================================================== // =============== fonctionne au debut du script seulement one shot ======================================= // ======================================================================================================== void setup() { Serial.begin(115200); M5.begin(true, false, true); M5.Power.begin(); M5.Lcd.setTextFont(4); M5.Lcd.setCursor(50, 100, 4); // ============ initialise lecran oled =================== presentation( "SWID-M5 v0.3 " , " " ,"Capteur Ethernet", "" ,"Trame LLDP " ," "," ","F.Blais MTL 2020" ); delay(5000); // ============ initialise ethernet en mode raw brodcast =================== SPI.begin(SCK, MISO, MOSI, -1); w5500.init(CS); w5500.writeSnMR(s, SnMR::MACRAW); w5500.execCmdSn(s, Sock_OPEN); } // ===================================================================================================== // ==================== en boucle continue ============================================================== // ===================================================================================================== void loop() { NBR++; // ===================== info sur la switch ======================= Serial.println(decompte); rbuflen = w5500.getRXReceivedSize(s); if(rbuflen>0) { if(rbuflen > sizeof(trame)) rbuflen = sizeof(trame); w5500.recv_data_processing(s, trame, rbuflen); w5500.execCmdSn(s, Sock_RECV); } decompte = " b:" + String(NBR) + " g:" + String(rbuflen) ; if ( rbuflen > 0 ) { if (si_lldp()) { lldp(); presentation( "" , LCD_data[0],LCD_data[1] ,LCD_data[2] ,LCD_data[3] , LCD_data[4] ,LCD_data[5], LCD_data[6]); delay(30000); } } } // =============================================================================================== // ================================== mes fonctions ==================================== // =============================================================================================== void lldp(){ int local=0; String partie; trouvetlv(); // description partie = decoupe( position[5] ) ; LCD_data[1] = partie.substring(1,14); LCD_data[2] = partie.substring(15,partie.length() ); // ============== // equivalent Unit/port LCD_data[4] = decoupe(position[4] ) ; LCD_data[4].trim(); // =============== // equivalent 00-80-c2-01 signature de la ligne vlan pos:187 0x0bfc = 3068 byte vlan[]={0x00,0x80,0xc2,0x01}; local = trouve(vlan); if ( local < 330 ) LCD_data[6] = "Vlan:" + decoupevlan(local) ; else LCD_data[6] = " pas Vlan" ; } // ============================================= bool si_lldp() { if( trame[2] == 1 && trame[3] == 128 && trame[4] == 194 && trame[7] == 14 ) { matrame(); return true; } else return false; } //=========================================================== void matrame() { for(int x = 0 ; x< 334 ; x++) { Serial.print(trame[x]); Serial.print(" "); } Serial.println(""); for(int x = 0 ; x< 334 ; x++) { Serial.print(trame[x],HEX); } Serial.println(""); } // ======================================================== // // EXTRAIT UN MORCEAU EN HEXA ET LE RENVOI EN STRING String decoupe( unsigned int local ) { unsigned int i; int grandeur = trame[local+1] ; String texte=" "; for ( i = ( local + 2 ) ; i < (local + grandeur + 2) ; i++ ) texte += (char)trame[i] ; return texte; } // ======================================================== // // EXTRAIT UN MORCEAU EN HEXA ET LE RENVOI EN STRING String decoupevlan( unsigned int local ) { unsigned int i; int grandeur = trame[local-1] ; grandeur = grandeur - 4 ; String texte ; for ( i = (local+4) ; i< ( (local+4) + ( grandeur) ) ; i++ ) texte += String(trame[i],HEX); texte = x2i(texte); texte.trim(); return texte; } // ======================================================== // // RECHERCHE UN MORCEAU SPECIFIQUE DANS LA TRAME // // ======================================================= int trouve(const byte rech[] ) { unsigned int i = 0; for ( i = 0 ; i < 330 ; i++ ) { if (trame[i] == rech[0]) if( (trame[i+1] == rech[1]) and (trame[i+2] == rech[2]) and (trame[i+3] == rech[3]) ) return i; } return 0; } // ================================================================= // trouve les deplacements // int* trouvetlv(){ int nbr; int pos = 16; position[0]=0; position[1]=16; for ( nbr = 2 ; nbr < 9 ; nbr++ ) { position[nbr] = ( (pos + 2) + trame[pos+1] ); pos = position[nbr]; } return position ; } // ====================================================================== String print_ip(const byte a[], unsigned int offset, unsigned int length) { String ip; for (unsigned int i = offset; i < offset + length; i++) { // if(i>offset) Serial.print('.'); // Serial.print(a[i], DEC); if (i > offset) ip = ip + '.'; ip = ip + String (a[i]); } return ip; } // ====================================================================== String print_mac(const byte a[], unsigned int offset, unsigned int length) { String Mac; LCD_data[1] = ""; for (unsigned int i = offset; i < offset + length; ++i) { if (i > offset) { // LCD_data[1] = LCD_data[1] + Mac + ':'; Mac = Mac + ':'; } if (a[i] < 0x10) { Mac = Mac + '0'; // LCD_data[1] = LCD_data[1] + Mac + '0'; } Mac = Mac + String (a[i], HEX); } LCD_data[1] = LCD_data[1] + Mac; return Mac; } // ==================================================== // // converti hexa vers dec en type string // // ==================================================== String x2i(String monhexa) { int x = 0; int nbr; for(nbr=0 ; nbr < monhexa.length() ; nbr++) { if (monhexa[nbr] >= '0' && monhexa[nbr] <= '9') { x *= 16; x += monhexa[nbr] - '0'; } else if (monhexa[nbr] >= 'A' && monhexa[nbr] <= 'F') { x *= 16; x += (monhexa[nbr] - 'A') + 10; } else if (monhexa[nbr] >= 'a' && monhexa[nbr] <= 'f') { x *= 16; x += (monhexa[nbr] - 'a') + 10; } else break; } return String(x,DEC); } // ================= fin script ===================================================================================================== // ================= fin script ===================================================================================================== // ================= fin script =====================================================================================================
  • LAN Module: Reading RAW-packets

    4
    0 Votes
    4 Posts
    9k Views
    F
    This code is tested and work fine. 1 jan 2021 /* ================================================================================================== projet SWID_M5 ( Switch ID pour M5Stack) version 0.3 date debut : 1 aout 2020 MODIF : 2 aout 2020 modif : 16-18 dec 2020 modif ethernet2 serveur tester et fonctionnel programmation: Francois Blais Montreal QC capture de trame pour la decouverte de commutateur (lldp) materiels M5stack core 4meg prog 1.2 meg ram ecran affichage avec un OLED integer au bibli m5stack (esp32) M5.LCD.println(); 3 bouton 1 haut parleur module battery module lan_w5500 ethernet2.h rj45 bibliotheques chemin de bibli shield w5500 lecture en mode raw C:\Users\fblai\Documents\Arduino\libraries\Ethernet\src\utility C:\Users\fblai\Documents\Arduino\libraries problèmes constatés 1- bibliotherque doit etre celle fournie par m5stack dans la section module/w5500 sinon erreur manque var 2- pour utiliser le serveur test de m5stack dans la section module/w5500 il faut prendre ladresse 192.168.0.177 pour ce conformer a la plage disponible sur mon routeur 3- il faut serrer les trois modules car probleme de connection physique sinon led power clignote 4- il faut mettre dans le w5500.init(CS) qui est CS=26 au lieu de celui par defaut qui est 10 5- utilisation des socket a partir de lobjet w5500.execCmdSn(s,sock_open ou close ou recv ) utilisation de m5stack bouton de power sur le coté peser une fois sur le power pour le demarrer ou le reinitialier peser 2 fois sur le power pour le fermer ==================================================== */ /* ==================================================== bibli ==================================================== */ #include <M5Stack.h> //------------------- ethernet2 w5500 lan rj45 #include <SPI.h> #include <Ethernet2.h> #include <utility/w5500.h> // doit etre sous <Ethernet2.h> #define SCK 18 // adaptation pour m5stack #define MISO 19 #define MOSI 23 #define CS 26 // Enter a MAC address and IP address for your controller below. // The IP address will be dependent on your local network: FB:AD:BE:EF:FE:FB 192.168.0.177 byte mac[] = { 0xFB, 0xAD, 0xBE, 0xEF, 0xFE, 0xFB }; SOCKET s; // RAW mode int rbuflen ; byte trame[335]; int NBR = 0; int position[12]; /* ==================================================== affichage ==================================================== */ String LCD_data[7]; void presentation(String L1,String L2,String L3,String L4,String L5,String L6,String L7,String L8){ M5.Lcd.clear(); M5.Lcd.setCursor(70, 20, 4); M5.Lcd.println(L1); M5.Lcd.setCursor(70, 60, 4); M5.Lcd.println(L2); M5.Lcd.setCursor(70, 80, 4); M5.Lcd.println(L3); M5.Lcd.setCursor(70, 100, 4); M5.Lcd.println(L4); M5.Lcd.setCursor(70, 120, 4); M5.Lcd.println(L5); M5.Lcd.setCursor(70, 140, 4); M5.Lcd.println(L6); M5.Lcd.setCursor(70, 160, 4); M5.Lcd.println(L7); M5.Lcd.setCursor(70, 180, 4); M5.Lcd.println(L8); } /* ==================================================== declaration de mes fonctions ==================================================== */ bool si_lldp(); void lldp(); String decoupe( unsigned int local ); int trouve( const byte rech[] ); String decoupevlan( unsigned int local ); int* trouvetlv(); String decompte; void matrame(); String x2i(String monhexa); // ======================================================================================================== // =============== fonctionne au debut du script seulement one shot ======================================= // ======================================================================================================== void setup() { Serial.begin(115200); M5.begin(true, false, true); M5.Power.begin(); M5.Lcd.setTextFont(4); M5.Lcd.setCursor(50, 100, 4); // ============ initialise lecran oled =================== presentation( "SWID-M5 v0.3 " , " " ,"Capteur Ethernet", "" ,"Trame LLDP " ," "," ","F.Blais MTL 2020" ); delay(5000); // ============ initialise ethernet en mode raw brodcast =================== SPI.begin(SCK, MISO, MOSI, -1); w5500.init(CS); w5500.writeSnMR(s, SnMR::MACRAW); w5500.execCmdSn(s, Sock_OPEN); } // ===================================================================================================== // ==================== en boucle continue ============================================================== // ===================================================================================================== void loop() { NBR++; // ===================== info sur la switch ======================= Serial.println(decompte); rbuflen = w5500.getRXReceivedSize(s); if(rbuflen>0) { if(rbuflen > sizeof(trame)) rbuflen = sizeof(trame); w5500.recv_data_processing(s, trame, rbuflen); w5500.execCmdSn(s, Sock_RECV); } decompte = " b:" + String(NBR) + " g:" + String(rbuflen) ; if ( rbuflen > 0 ) { if (si_lldp()) { lldp(); presentation( "" , LCD_data[0],LCD_data[1] ,LCD_data[2] ,LCD_data[3] , LCD_data[4] ,LCD_data[5], LCD_data[6]); delay(30000); } } } // =============================================================================================== // ================================== mes fonctions ==================================== // =============================================================================================== void lldp(){ int local=0; String partie; trouvetlv(); // description partie = decoupe( position[5] ) ; LCD_data[1] = partie.substring(1,14); LCD_data[2] = partie.substring(15,partie.length() ); // ============== // equivalent Unit/port LCD_data[4] = decoupe(position[4] ) ; LCD_data[4].trim(); // =============== // equivalent 00-80-c2-01 signature de la ligne vlan pos:187 0x0bfc = 3068 byte vlan[]={0x00,0x80,0xc2,0x01}; local = trouve(vlan); if ( local < 330 ) LCD_data[6] = "Vlan:" + decoupevlan(local) ; else LCD_data[6] = " pas Vlan" ; } // ============================================= bool si_lldp() { if( trame[2] == 1 && trame[3] == 128 && trame[4] == 194 && trame[7] == 14 ) { matrame(); return true; } else return false; } //=========================================================== void matrame() { for(int x = 0 ; x< 334 ; x++) { Serial.print(trame[x]); Serial.print(" "); } Serial.println(""); for(int x = 0 ; x< 334 ; x++) { Serial.print(trame[x],HEX); } Serial.println(""); } // ======================================================== // // EXTRAIT UN MORCEAU EN HEXA ET LE RENVOI EN STRING String decoupe( unsigned int local ) { unsigned int i; int grandeur = trame[local+1] ; String texte=" "; for ( i = ( local + 2 ) ; i < (local + grandeur + 2) ; i++ ) texte += (char)trame[i] ; return texte; } // ======================================================== // // EXTRAIT UN MORCEAU EN HEXA ET LE RENVOI EN STRING String decoupevlan( unsigned int local ) { unsigned int i; int grandeur = trame[local-1] ; grandeur = grandeur - 4 ; String texte ; for ( i = (local+4) ; i< ( (local+4) + ( grandeur) ) ; i++ ) texte += String(trame[i],HEX); texte = x2i(texte); texte.trim(); return texte; } // ======================================================== // // RECHERCHE UN MORCEAU SPECIFIQUE DANS LA TRAME // // ======================================================= int trouve(const byte rech[] ) { unsigned int i = 0; for ( i = 0 ; i < 330 ; i++ ) { if (trame[i] == rech[0]) if( (trame[i+1] == rech[1]) and (trame[i+2] == rech[2]) and (trame[i+3] == rech[3]) ) return i; } return 0; } // ================================================================= // trouve les deplacements // int* trouvetlv(){ int nbr; int pos = 16; position[0]=0; position[1]=16; for ( nbr = 2 ; nbr < 9 ; nbr++ ) { position[nbr] = ( (pos + 2) + trame[pos+1] ); pos = position[nbr]; } return position ; } // ====================================================================== String print_ip(const byte a[], unsigned int offset, unsigned int length) { String ip; for (unsigned int i = offset; i < offset + length; i++) { // if(i>offset) Serial.print('.'); // Serial.print(a[i], DEC); if (i > offset) ip = ip + '.'; ip = ip + String (a[i]); } return ip; } // ====================================================================== String print_mac(const byte a[], unsigned int offset, unsigned int length) { String Mac; LCD_data[1] = ""; for (unsigned int i = offset; i < offset + length; ++i) { if (i > offset) { // LCD_data[1] = LCD_data[1] + Mac + ':'; Mac = Mac + ':'; } if (a[i] < 0x10) { Mac = Mac + '0'; // LCD_data[1] = LCD_data[1] + Mac + '0'; } Mac = Mac + String (a[i], HEX); } LCD_data[1] = LCD_data[1] + Mac; return Mac; } // ==================================================== // // converti hexa vers dec en type string // // ==================================================== String x2i(String monhexa) { int x = 0; int nbr; for(nbr=0 ; nbr < monhexa.length() ; nbr++) { if (monhexa[nbr] >= '0' && monhexa[nbr] <= '9') { x *= 16; x += monhexa[nbr] - '0'; } else if (monhexa[nbr] >= 'A' && monhexa[nbr] <= 'F') { x *= 16; x += (monhexa[nbr] - 'A') + 10; } else if (monhexa[nbr] >= 'a' && monhexa[nbr] <= 'f') { x *= 16; x += (monhexa[nbr] - 'a') + 10; } else break; } return String(x,DEC); } // ================= fin script ===================================================================================================== // ================= fin script ===================================================================================================== // ================= fin script =====================================================================================================
  • PLC Proto Industrial, USB cable for programming

    2
    0 Votes
    2 Posts
    5k Views
    felmueF
    Hello @Leo05 have a look at the schematics of M5Stack Core and PLC. I do not have the PLC module but I do have the LAN module which is similar in that respect and I do have both 12V and USB connected at the same time while programming the M5Stack Core, but not permanently. Both power sources produce 5 volts but there might be a slight difference in the voltage which would mean one power source is feeding a small current into the other, but I don't think it will damage anything. Nevertheless, use at your own risk. The full project, M5Stack Core and PLC module will work fine from USB only. Unless you add something in the PLC module which requires 12 volts. According to the PLC module schematics the BAT pin is not connected / used. But it will show the battery voltage from the stacked M5Stack Core. No, the battery in M5Stack Core will not charge when only 12V is applied. Only USB can charge the battery. Thanks Felix
  • Wrong COM.X UART configuration stops Fire from turning on.

    1
    0 Votes
    1 Posts
    3k Views
    No one has replied
  • GoPlus motor rotates only one direction

    goplus
    1
    0 Votes
    1 Posts
    4k Views
    No one has replied