🤖Have you ever tried Chat.M5Stack.com before asking??😎

Subcategories

  • 551 Topics
    2k Posts
    H
    @Danieldsouza I prefer to use KiCAD for schematic and PCB design. The software is open source It runs on Windows, Linux, Mac there is a strong community there is a ton of libraries for thousands of components some part distributor and assembling factories provide their own library or allow symbol and footprint download making your own symbols and footprints is very easy design rule checking I am not an advanced user but managed to make a 4-layer PCB after watching a few tutorial videos. Independend of the EDA Tool make sure you avoid the common tripping hazard like missing blocking caps or unwanted ground loops.
  • When you meet problems using M5Stack, we help you solve it.

    200 Topics
    989 Posts
    robskiR
    @johnericsutton hard to believe that unit is designed in such way to report value only when measured source is above 0...
  • 505 Topics
    2k Posts
    D
    Hopefully I can shed a little light on this topic. The AIN4-20mA unit uses a STM32 processor to handle the I2C interface in software. For some reason, the timing is not wholly compatible with the Raspberry Pi kernel I2C drivers. However, the Espressif I2C implementation is a lot more tolerant and flexible and works just fine. That's why it works with the M5 controllers. There was a an update to the github repo for this unit's firmware (https://github.com/m5stack/M5Module-4-20mA-Internal-FW) which changed the I2C library that was used. It's possible that this will fix it, but I haven't bothered to set up a STM32 development system to try it. If you really want to use a Pi or other Linux host board, you could use any inexpensive ESP device (like an M5Stamp) as a go-between. Another option is to use something like the Arduino UNO Q, which runs Linux on the main processor and allows you to run C++ code on the STM32 microcontroller to talk to I2C devices. It's really better to run real-time control on a separate microcontroller anyway.
  • 1k Topics
    6k Posts
    ShawnHymelS
    @felmue That helps a lot, thank you!
  • 55 Topics
    203 Posts
    J
    I have been able to get a program to work that uses the M5EchoBase library but no luck using the unified library. For example the simple program below doesn't work. #include <M5Unified.h> void setup() { // 1. Initialize M5Unified delay(1000); // Delay for a moment to allow the system to stabilize. auto cfg = M5.config(); cfg.serial_baudrate = 115200; M5.begin(cfg); // 2. Configure the Speaker for the Atomic Audio Base (ES8311) // We access the speaker configuration directly via M5.Speaker.config() auto spk_cfg = M5.Speaker.config(); // Set pins for Atomic Audio Base (ES8311) spk_cfg.pin_bck = 8; // BCLK spk_cfg.pin_ws = 6; // LRCK (WS) spk_cfg.pin_data_out = 5; // DAC (DOUT) spk_cfg.i2s_port = I2S_NUM_0; // Configure for external codec (not internal DAC) spk_cfg.use_dac = false; spk_cfg.sample_rate = 44100; // Apply the configuration M5.Speaker.config(spk_cfg); // 3. Start the speaker M5.Speaker.begin(); // 4. Set volume (0-255) M5.Speaker.setVolume(128); } void loop() { M5.update(); // Play a 1000 Hz tone for 1000 milliseconds (1 second) M5.Speaker.tone(1000, 1000); // Wait for the tone to finish delay(1000); // Small delay before next loop delay(1000); } Is there no way to set up the ES8311 codec without using M5EchoBase? strangely if I run the program below then load the above program the tone works? But I can't stick the M5.Speaker.tone(1000, 1000); command in the program below and have it work. Does anyone know how to play a tone using only the Unified library from an AtomS3R into a Atomic Audio Base (ES8311 codec)? #include <M5Unified.h> #include <M5EchoBase.h> #if defined(CONFIG_IDF_TARGET_ESP32S3) #define RECORD_SIZE (1024 * 400) #elif defined(CONFIG_IDF_TARGET_ESP32) #define RECORD_SIZE (1024 * 400) #endif #if (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)) M5EchoBase echobase; #else M5EchoBase echobase(I2S_NUM_0); #endif static uint8_t *buffer = nullptr; // Pointer to hold the audio buffer. void setup() { delay(1000); // Delay for a moment to allow the system to stabilize. auto cfg = M5.config(); cfg.serial_baudrate = 115200; M5.begin(cfg); // Initialize the EchoBase with ATOMS3 pinmap. #if defined(CONFIG_IDF_TARGET_ESP32S3) if (!echobase.init(44100 /*Sample Rate*/, 38 /*I2C SDA*/, 39 /*I2C SCL*/, 7 /*I2S DIN*/, 6 /*I2S WS*/, 5 /*I2S DOUT*/, 8 /*I2S BCK*/, Wire) != 0) { Serial.println("Failed to initialize EchoBase!"); while (true) { delay(1000); } } #elif defined(CONFIG_IDF_TARGET_ESP32) // Initialize the EchoBase with ATOM pinmap. if (!echobase.init(44100 /*Sample Rate*/, 25 /*I2C SDA*/, 21 /*I2C SCL*/, 23 /*I2S DIN*/, 19 /*I2S WS*/, 22 /*I2S DOUT*/, 33 /*I2S BCK*/, Wire) != 0) { Serial.println("Failed to initialize EchoBase!"); while (true) { delay(1000); } } #endif echobase.setSpeakerVolume(80); // Set speaker volume to 70%. echobase.setMicGain(ES8311_MIC_GAIN_0DB); // Set microphone gain to 0dB. buffer = (uint8_t *)malloc(RECORD_SIZE); // Allocate memory for the record buffer. // Check if memory allocation was successful. if (buffer == nullptr) { // If memory allocation fails, enter an infinite loop. while (true) { Serial.println("Failed to allocate memory :("); delay(1000); } } Serial.println("EchoBase ready, start recording and playing!"); // M5.Speaker.tone(2000, 2000); // delay(2000); } void loop() { Serial.println("Start recording..."); // Recording echobase.setMute(false); echobase.record(buffer, RECORD_SIZE); // Record audio into buffer. delay(100); Serial.println("Start playing..."); // Playing echobase.setMute(false); delay(10); echobase.play(buffer, RECORD_SIZE); // Play audio from buffer. //M5.Speaker.playRaw(buffer, RECORD_SIZE, 44100, false, 1, 0); delay(100); }
  • For topics on the M5Stack Atom.

    260 Topics
    849 Posts
    K
    After a lot of testing and searching it became apparent that the M5Atom controller did not work properly (never had this type of problem before). This, outdated software and some wrong suggestions by both ChatGPT and the AI bot from M5Stack (with the knowledge base available) made it a bit of struggle. However, after all updates and testing different hardware it finally works again. So thanks to anyone that spent time on this!
  • PbHub 1.1 on STAMPLC - Couldn't find Pbhub on PortA

    6
    0 Votes
    6 Posts
    3k Views
    B
    @Slarck Thank you. Just check and add delay before and after pbhub.begin(), the program with only this library is very stable. However, the program with complete library set was not working. I tried to remove it ne by one. Finally, I found somthing : Every time have M5StamPLC.update(); the program cannot read data from Pbhub I tried to add delay before and after every M5StamPLC.update(), pbhub.begin() Pbhub.analogRead(0), the situation is not solved. I guess there is some trick while using pbhub together with SD card, StamPLC display , Digital Input scan. However, at this moment I still cannot make everything working at the same time.
  • eagle lib...

    2
    0 Votes
    2 Posts
    2k Views
    H
    Hi! As of now, there isn’t an official Eagle library specifically for the M5StampS3. You can try using a generic ESP32-S3 footprint or create a custom library based on the unit’s datasheet. Hopefully, M5Stack or the community will release official libraries soon.
  • How to Display an Animated GIF on M5Stack Screens Using Arduino C?

    4
    0 Votes
    4 Posts
    4k Views
    V
    @Juan-Carlos-Climent said in How to Display an Animated GIF on M5Stack Screens Using Arduino C?: @kuriko I've checked the link you sent me and adapted it to display an animated GIF. I used the Python script from M5 ( bin2code.py ) to generate a .h file and modified the example from M5GFX ( drawImageData.ino ). It works perfectly! Thanks a lot! @Juan-Carlos-Climent Can you please share the code?
  • UHF RFID on M5Stack Core S3

    4
    0 Votes
    4 Posts
    2k Views
    D
    @yuyun2000 This is the sketch i'm using. /* * SPDX-FileCopyrightText: 2024 M5Stack Technology CO LTD * * SPDX-License-Identifier: MIT */ #include <M5GFX.h> #include <M5CoreS3.h> #include <FastLED.h> #include "UNIT_UHF_RFID.h" M5GFX display; M5Canvas canvas(&display); Unit_UHF_RFID uhf; #define LED_PIN 35 // GPIO pin for the NeoPixel LED #define NUM_LEDS 1 // Number of LEDs (1 for Core S3) CRGB leds[NUM_LEDS]; // Define the LED array String info = ""; void setup() { M5.begin(); // Init M5Core. 初始化 M5Core // Serial2.begin(unsigned long baud, uint32_t config, int8_t rxPin, int8_t // txPin, bool invert) uhf.begin(HardwareSerial *serial = &Serial2, int // baud=115200, uint8_t RX = 16, uint8_t TX = 17, bool debug = false); Serial2.begin(115200, SERIAL_8N1, 17, 18); uhf.begin(&Serial2, 115200, 17, 18, false); // uhf.begin(); while (1) { info = uhf.getVersion(); if (info != "ERROR") { Serial.println(info); break; } } String info = uhf.getVersion(); if (info != "ERROR") { Serial.println("UHF Module Connected. Version: " + info); } else { Serial.println("Failed to communicate with UHF Module!"); } // Initialize the NeoPixel LED FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, NUM_LEDS); // Set the LED to green leds[0] = CRGB::Green; FastLED.show(); // max: 26dB uhf.setTxPower(2600); display.begin(); canvas.setColorDepth(1); // mono color canvas.setFont(&fonts::efontCN_14); canvas.createSprite(display.width(), display.height()); canvas.setTextSize(2); canvas.setPaletteColor(1, GREEN); canvas.setTextScroll(true); canvas.println(info); canvas.println("1.BtnB Polling Card EPC"); canvas.println("2.BtnC Select Card EPC"); canvas.println("3.BtnA Write or Read Card Info"); canvas.pushSprite(0, 0); Serial.println("Display initialized"); } uint8_t write_buffer[] = {0xab, 0xcd, 0xef, 0xdd}; uint8_t reade_buffer[4] = {0}; void log(String info) { Serial.println("Write Data..."); canvas.println(info); canvas.pushSprite(0, 0); } void loop() { if (M5.BtnA.wasPressed()) { log("Write Data..."); // uhf.writeCard(uint8_t *data, size_t size, uint8_t membank, uint16_t // sa, uint32_t access_password = 0); if (uhf.writeCard(write_buffer, sizeof(write_buffer), 0x04, 0, 0x00000000)) { log("Write OK"); } else { log("Write ERROR"); } delay(1000); log("Read Data..."); // uhf.readCard(uint8_t *data, size_t size, uint8_t membank, uint16_t // sa, uint32_t access_password = 0); if (uhf.readCard(reade_buffer, sizeof(reade_buffer), 0x04, 0, 0x00000000)) { log("Read OK"); log("Data Content"); for (uint8_t i = 0; i < sizeof(reade_buffer); i++) { Serial.printf("%x", reade_buffer[i]); canvas.printf("%x", reade_buffer[i]); } canvas.pushSprite(0, 0); } else { log("Read ERROR"); } } if (M5.BtnB.wasPressed()) { log("polling once"); uint8_t result = uhf.pollingOnce(); // polling 10 times // uint8_t result = uhf.pollingMultiple(20); Serial.printf("scan result: %d\r\n", result); if (result > 0) { for (uint8_t i = 0; i < result; i++) { log("pc: " + uhf.cards[i].pc_str); log("rssi: " + uhf.cards[i].rssi_str); log("epc: " + uhf.cards[i].epc_str); log("-----------------"); delay(10); } } } if (M5.BtnC.wasPressed()) { if (uhf.select(uhf.cards[0].epc)) { log("Select OK"); } else { log("Select ERROR"); } log("Current Select EPC:"); log(uhf.selectInfo()); } M5. The sketch compiles perfectly fine and uploads to the device without error. this is the output. Sketch uses 796606 bytes (25%) of program storage space. Maximum is 3145728 bytes. Global variables use 37948 bytes (11%) of dynamic memory, leaving 289732 bytes for local variables. Maximum is 327680 bytes. esptool.py v4.8.1 Serial port COM4 Connecting... Chip is ESP32-S3 (QFN56) (revision v0.2) Features: WiFi, BLE Crystal is 40MHz MAC: 24:ec:4a:38:34:98 Uploading stub... Running stub... Stub running... Changing baud rate to 921600 Changed. Configuring flash size... Flash will be erased from 0x00000000 to 0x00004fff... Flash will be erased from 0x00008000 to 0x00008fff... Flash will be erased from 0x0000e000 to 0x0000ffff... Flash will be erased from 0x00010000 to 0x000d2fff... Compressed 20208 bytes to 13058... Writing at 0x00000000... (100 %) Wrote 20208 bytes (13058 compressed) at 0x00000000 in 0.2 seconds (effective 865.4 kbit/s)... Hash of data verified. Compressed 3072 bytes to 144... Writing at 0x00008000... (100 %) Wrote 3072 bytes (144 compressed) at 0x00008000 in 0.0 seconds (effective 980.9 kbit/s)... Hash of data verified. Compressed 8192 bytes to 47... Writing at 0x0000e000... (100 %) Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 1299.6 kbit/s)... Hash of data verified. Compressed 796752 bytes to 486375... Writing at 0x00010000... (3 %) Writing at 0x0001c618... (6 %) Writing at 0x0002181a... (10 %) Writing at 0x00026c91... (13 %) Writing at 0x0002c065... (16 %) Writing at 0x00031626... (20 %) Writing at 0x00036cfa... (23 %) Writing at 0x0003c073... (26 %) Writing at 0x00041262... (30 %) Writing at 0x000464a9... (33 %) Writing at 0x0004bdf3... (36 %) Writing at 0x00050f48... (40 %) Writing at 0x00056163... (43 %) Writing at 0x0005b41c... (46 %) Writing at 0x00061b58... (50 %) Writing at 0x00078b12... (53 %) Writing at 0x0007eb7e... (56 %) Writing at 0x00084ad7... (60 %) Writing at 0x0008a5e3... (63 %) Writing at 0x0008fa40... (66 %) Writing at 0x0009554d... (70 %) Writing at 0x0009ad33... (73 %) Writing at 0x000a05f6... (76 %) Writing at 0x000a5df1... (80 %) Writing at 0x000ab922... (83 %) Writing at 0x000b14ca... (86 %) Writing at 0x000b8d06... (90 %) Writing at 0x000c2507... (93 %) Writing at 0x000c86ae... (96 %) Writing at 0x000ce386... (100 %) Wrote 796752 bytes (486375 compressed) at 0x00010000 in 4.1 seconds (effective 1536.0 kbit/s)... Hash of data verified. Leaving... Hard resetting with RTC WDT... When the upload has completed the device does nothing. No screen activity at all, it's powered on but just a blank display. I've tried everything, obviously i'm missing something, i just don't know what it is.
  • Problem M5Touch hostname, transport base, mqtt_cliente anda M5Thing

    2
    1
    0 Votes
    2 Posts
    940 Views
    Y
    @Jose-Manuel The error you're encountering (getaddrinfo() returns 202) typically indicates a DNS resolution issue, meaning the M5Tough is unable to resolve the hostname uiflow2.m5stack.com. Here are some steps to troubleshoot and resolve the issue: Check Network Connection Ensure the M5Tough is connected to a stable Wi-Fi network. Verify the Wi-Fi credentials (SSID and password) are correctly configured. Verify DNS Settings If the device is unable to resolve the hostname, try using a different DNS server (e.g., Google's DNS: 8.8.8.8 or 8.8.4.4). You can configure this in the Wi-Fi settings or DHCP settings of your router. Test Connectivity Use a tool like ping or nslookup to check if the hostname uiflow2.m5stack.com is resolvable from another device on the same network. MQTT Configuration Ensure the MQTT broker settings (hostname, port, client ID, etc.) are correctly configured in your code. If the broker requires authentication, verify the username and password. Firmware Update Ensure the M5Tough is running the latest firmware. Outdated firmware might have bugs related to network connectivity. Debugging Add debug prints in your code to check the Wi-Fi and MQTT connection status before attempting to send messages. Example:print("Wi-Fi connected:", wifi.isconnected()) print("MQTT connected:", mqtt.isconnected()) Alternative MQTT Broker Temporarily switch to a public MQTT broker (e.g., test.mosquitto.org) to rule out issues with the uiflow2.m5stack.com server. Example Code for MQTT Connection (MicroPython) from umqtt.simple import MQTTClient import network Wi-Fi Configuration wifi = network.WLAN(network.STA_IF) wifi.active(True) wifi.connect("YOUR_SSID", "YOUR_PASSWORD") Wait for Wi-Fi connection while not wifi.isconnected(): pass print("Wi-Fi connected:", wifi.isconnected()) MQTT Configuration mqtt = MQTTClient("client_id", "test.mosquitto.org", port=1883) mqtt.connect() print("MQTT connected:", mqtt.isconnected()) Suggested Next Steps If the issue persists, you can contact M5Stack support at support@m5stack.com for further assistance. reply with https://chat.m5stack.com/
  • T-Lite: how to keep it awake ?

    4
    2
    0 Votes
    4 Posts
    2k Views
    J
    The soft reset seems to do the job (12 hours of measurements uninterrupted) [image: 1749888873979-0f4b244c-ff68-470e-8f51-d139e7485082-image.png]
  • This topic is deleted!

    2
    3
    0 Votes
    2 Posts
    4 Views
  • PaperS3

    5
    0 Votes
    5 Posts
    2k Views
    felmueF
    Hello @paydogs my M5PaperS3 running the factory test shows about 4.19 V when fully charged and still on USB-C. When I remove external power it drops to about 4.12 V. Thanks Felix
  • Hardware issues

    2
    1 Votes
    2 Posts
    2k Views
    J
    Update on DAC module: found probable root cause from within my system setup. Failure point on the module is the +5V input - only a few ohms vs GND. I found the +5Vdc supply transient of -4V relative to GND for 200µs. Most ICs don't do well with anything below -0.3V relative to GND. (the transient is caused by design depending on a great deal of Grove wiring as a GND path, combined with relatively high voltage/current on other rails in the system. One solution is redesign for low-ohm, low impedance GNDs)
  • 0 Votes
    2 Posts
    2k Views
    S
    Hi! Yes, the M5Stack Battery Module works with the M5Stack Fire 2.7. M5Stack's stackable header-pin design allows you to simply add modules like this one without needing to solder. Use M2 screws (22mm or longer) and M2 brass spacers to securely assemble everything. This maintains the modules securely packed, which is ideal for preventing inadvertent disassembly, particularly in client-facing installations. If you are in India, check out Robocraze. They are an approved M5Stack distributor, providing accessories and assistance for clean, professional builds. Hope this helps!
  • Bills of Materials

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • [SOLVED} PaperS3 Touch Screen Latency

    2
    0 Votes
    2 Posts
    2k Views
    W
    @wsanders This problem was caused by a reference to an uninitialized variable in that drawSomeTextOnScreen() function. As usual, the invalid reference caused weird behavior that was unrelated to the actual problem.
  • Anybody get drawJpgFile to work with M5 PaperS3?

    4
    0 Votes
    4 Posts
    3k Views
    W
    @wsanders Bump. For future reference, the easiest way to get a static image into Arduino IDE code is to convert the image into an XBM with Gimp and use M5.Display.drawXBitmap. More here: https://github.com/wsanders/M5PaperS3-Stuff
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • This topic is deleted!

    2
    1
    0 Votes
    2 Posts
    184 Views
  • Bar graph demo application is running extremely slowly on Paper S3

    2
    0 Votes
    2 Posts
    2k Views
    kurikoK
    @mwwalker PaperS3 do have a slow refresh rate. maybe the BarGraph demo isn't very suitable for test, you should try the rtc example: https://docs.m5stack.com/en/arduino/m5papers3/rtc
  • 0 Votes
    8 Posts
    5k Views
    R
    @RadghKris said in NEED HELP: No screen, PaperS3 beeps and returns Serial monitor communication....: flags I went and deleted this argument/variable from the library. May not have been the best thing to do, but it worked! I got the bar graph to work!! So, I have one program that will display the screen, and one program that will beep the buzzer and communicate with the serial monitor. Progress. Still not perfect, but progress.
  • Running ENV III Hat and SGP30 Unit Simultaneously on M5StickC Plus2

    2
    2
    0 Votes
    2 Posts
    2k Views
    S
    [image: 1743894726696-uiflow.jpg]
  • PaperS3 Bluetooth?

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • M5 stack paper stop storing data in preferences?

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