@ImLunchtime 有建议欢迎多提~
Posts made by yuyun2000
-
RE: [Tab5] How to de-init the touch panel?
@ImLunchtime chatbot是否解决了你的问题? 他的回复有什么帮助?
-
RE: Ayuda con latencia Bluetooth en proyecto de control para Game Android
@samantha_martin Hola Samantha. El M5StickC Plus (SKU:K016-P) utiliza el chip ESP32-PICO-D4, que integra Bluetooth LE. Para reducir la latencia en la transmisión HID, puedes probar las siguientes acciones:
Optimizar la frecuencia de envío de datos: En las librerías ESP32-BLE-Keyboard o BleGamepad, ajusta el intervalo de notificación BLE a un valor más bajo (por ejemplo, 10-20 ms). Algunas librerías permiten configurar esto al inicializar el dispositivo HID.
Minimizar el código en el loop(): Asegúrate de que no haya delays innecesarios ni tareas bloqueantes (como impresiones Serial) que ralenticen la detección de botones y el envío de comandos.
Configurar el modo BLE de bajo consumo: Aunque el ESP32-PICO-D4 es eficiente, verifica que no se encuentre en modos de suspensión prolongada. Asegúrate de que el dispositivo BLE esté configurado para enviar notificaciones inmediatamente al detectar una pulsación.
Actualizar el firmware del ESP32: Usa la última versión del core ESP32 en Arduino IDE, ya que a menudo incluyen optimizaciones en el stack BLE.
Verificar la configuración de Android: En el menú de configuración de Bluetooth de tu teléfono, desactiva opciones como "Ahorro de batería" para el dispositivo M5StickC Plus, ya que pueden restringir la frecuencia de actualizaciones HID.
-
RE: Finding the right stepper motor driver
@Jesse25 The DRV8825-based module you linked is suitable for NEMA 17 motors (59Ncm) as it supports adjustable microstepping (up to 1/32) and can handle typical NEMA 17 current requirements.
M5Stack offers compatible options:Module13.2 GRBL (SKU:M035) with DRV8825, 1.5A max current, 1/32 microstepping via dip switches, and stackable for multi-axis control.
Atomic Stepmotor Base (SKU:A132) with DRV8825, 1.2A max current, and adjustable microstepping via dip switch, designed for ATOM series controllers.Both support adjustable microstepping and balance performance with cost-effectiveness for multiple units.
https://chat.m5stack.com/ -
RE: Tensile test machine?
@killernils Your project is feasible with UIflow2 (MicroPython). Here's the breakdown:
Hardware Compatibility:
CoreS3 (SKU:K128) supports both Unit Weight-I2C and Module13.2 Stepmotor Driver v1.1 (SKU:M039-V11) via I2C
Stepper driver provides precise control with microstepping (FULL to 1/32 step) and step counting
Weight unit offers calibration, tare function, and filter settings through UIflow2 blocksRequired Functions Implementation:
Load Cell Calibration: Use WEIGHT_I2CUnit.set_calibration() with known weights
Tare Function: Implement via WEIGHT_I2CUnit.set_reset_offset()
Stepper Control: Utilize StepMotorDriverModule methods for direction, microstepping, and PWM frequency control
Position Tracking: Count steps using motor control commands and convert to displacement based on T8x4 rod (4mm per revolution)
Data Logging: Use UIflow2's file system blocks to save CSV data to internal storage
HMI Interface: Create buttons and plots using CoreS3's display blocksImplementation Considerations:
Ensure proper power supply (9-24V) for the stepper driver
Implement step delay logic for smooth motor movement
Add error handling for load cell over-range conditions
Use filter functions on weight readings for stable measurements -
RE: paper s3 Get mac failed
@jahaan2311 The "GET mac failed" error when burning UIFlow 2.0 firmware to your PaperS3 (SKU:C139) typically relates to communication issues during the flashing process. Here are the recommended steps to resolve this:
Ensure Correct Download Mode: When connecting the PaperS3 to your Mac, make sure the device enters download mode properly. The screen should remain blank after connecting, indicating it's in programming mode.
Verify M5Burner Setup:
Confirm you have the latest M5Burner version installed for macOS
Select the correct PaperS3 firmware in M5Burner
Double-check the USB port selection matches your connected deviceCheck USB Connection:
Try using a different USB-C cable (preferably a data cable, not charging-only)
Connect directly to your Mac's USB port instead of using a hub
Avoid using USB-C adapters if possibleReconfigure Burning Settings:
In M5Burner, click "Configure" before burning
Verify all Wi-Fi settings are correctly entered
Ensure the baud rate is set to the recommended value (typically 115200)macOS Specific Considerations:
Ensure you have the necessary USB drivers installed
Check System Preferences > Security & Privacy for any blocked developer extensions
Try restarting your Mac and the PaperS3 device before retryingIf the issue persists after these steps, please try burning the factory firmware first using the PaperS3 Factory Firmware and then attempt the UIFlow 2.0 firmware again.
-
RE: Tab5 USBHIDKeyboard
@jalmalogni To debug the USB keyboard issue with your Tab5 (SKU:C145/K145), please try the following steps:
Verify USB OTG Configuration: Ensure your code correctly initializes USB OTG mode. Add these build flags to your PlatformIO configuration:
build_flags =
-DARDUINO_USB_CDC_ON_BOOT=1
-DARDUINO_USB_MODE=1Check USB Initialization Order: Modify the initialization sequence in setup():
USB.begin(); // Initialize USB first
delay(1000); // Add delay before keyboard initialization
Keyboard.begin();Monitor USB Enumeration: Connect via WebTerminal through UiFlow2 to check if the USB device is recognized. Navigate to the serial monitor and look for USB HID initialization messages.
Test Hardware Connection: Ensure you're using the USB-C port (labeled as USB 2.0 OTG) on Tab5, not the USB-A host port. Try different USB cables known to work with data transfer.
Simplify Test Code: Use this minimal example to isolate the issue:
#include <M5Unified.h>
#include "USB.h"
#include "USBHIDKeyboard.h"USBHIDKeyboard Keyboard;
void setup() {
M5.begin();
USB.begin();
delay(2000);
Keyboard.begin();
M5.Lcd.print("USB HID Ready");
}void loop() {
M5.update();
if (M5.BtnA.wasPressed()) {
Keyboard.print("Hello");
Keyboard.write(KEY_RETURN);
}
}Check Power Management: Ensure Tab5 is sufficiently powered (use external power if battery level is low). USB HID functionality may be disabled under low power conditions.
-
RE: カードピュータ1.1をラズベリーパイのbleキーボードとして使いたいのですが、ブルートゥースでペアリングができません。
@deardeer Cardputer v1.1 (SKU:K132-V11)をBLEキーボードとして使用する際のペアリング問題について、以下の解決方法をご提案します。
ファームウェアの更新Cardputer v1.1の公式ファームウェアを最新版に更新してください。不具合修正や互換性改善が含まれている可能性があります。更新方法はCardputer v1.1 UiFlow2クイックスタートを参照してください。
BLE設定のリセットCardputerの電源を入れ直した後、既存のペアリング情報を削除してください。Raspberry Pi Zero 2 WとAndroid端末側でも「既知のデバイス」からCardputerを削除し、再度ペアリングを試行してください。
ペアリング手順の確認CardputerをBLEキーボードモードで起動し、ペアリングモードに入る必要があります。デフォルトでは特定のキーコンビネーション(例:FN + Enter)でペアリングモードを有効にする場合があります。詳細は製品マニュアルをご確認ください。
Raspberry PiのBluetooth設定Raspbian Bullseyeでは、BlueZのバージョンによってBLE互換性が異なる場合があります。以下のコマンドでBluetoothサービスを再起動し、デバイスを再スキャンしてください:
sudo systemctl restart bluetooth
bluetoothctl scan onAndroid端末の設定Android 15では、位置情報を有効にしてBluetoothスキャンを許可する必要がある場合があります。設定 > アプリ > Bluetooth > 権限で「位置情報」を有効にしてください。
-
RE: Help with UNIT IR and NanoC6 in Uiflow2
The "invalid Timer number" error occurs because the IRUnit is trying to use a hardware timer that's either unavailable or already in use on your M5 device. ESP32-based boards have limited hardware timers (usually 4, IDs 0-3), and the default timer allocation in the IR library might conflict with other system functions.
Solution:Explicitly specify a valid timer ID when initializing the IRUnit. Modify your setup code to include the timer_id parameter with a value between 0-3:
ir_0 = IRUnit((1, 2), timer_id=1) # Try timer IDs 0, 1, 2, or 3Troubleshooting Tips:
Test different timer IDs (0-3) if the first attempt fails
Ensure no other libraries/features are using the same timer (e.g., PWM, other sensors)
Verify your M5 device's firmware is up-to-date via UIFlow2 -
RE: No RGB LED unit for UIFLOW 2.0?
@montanaman Although the specific "RGB LED" unit for the SK6812 LED strip in UIFlow 1.x might not be directly available in UIFlow 2.0, UIFlow 2.0 still supports controlling SK6812 LEDs. There are several M5Stack units that integrate SK6812 LEDs and can be used in UIFlow 2.0, such as:
Unit Key (SKU: U144): Embedded with one programmable RGB LED - SK6812, supports 256 level brightness.
Unit Fader (SKU: U123): Comes with 14x SK6812 programmable RGB lights.
Unit RGB LED Strip (SKU: A093): A programmable light strip using SK6812 LEDs, supporting digital addressing to control the color and brightness of each LED.
Unit RGB LED (SKU: A035 A035 - B A035 - C A035 - D A035 - E): Another programmable light strip using SK6812 LEDs.
Unit Encoder (SKU: U135): Equipped with 2x SK6812 programmable RGB LEDs.
Unit HEX (SKU: A045): Has 37 SK6812 RGB LEDs.
Unit ACSSR (SKU: U139): Features a programmable SK6812 RGB LED.
Unit DCSSR (SKU: U140): Also comes with a programmable SK6812 RGB LED.You can use these units to achieve similar functionality in UIFlow 2.0.
-
RE: Why have switch and button widgets been removed from uiflow
@ph0sgene At present, only the function information has been input into LLM, so it may not have the ability to plan programs, and explaining functions may be more useful
-
RE: M5StamPLC and Serial1
The issue you're experiencing with the M5StamPLC.begin() function interfering with Serial1 is likely due to the library initializing or reconfiguring the hardware UART pins used by Serial1. Here's how you can resolve it:
Solution:Check Pin Mapping:
Ensure that the pins you're using for Serial1 (RX_PIN and TX_PIN) are not being reconfigured by the M5StamPLC.begin() function. The M5StamPLC library might initialize its own UART or other peripherals on the same pins.
Explicitly Reinitialize Serial1 After M5StamPLC.begin():
Call Serial1.begin() again after M5StamPLC.begin() to ensure the UART settings are restored:void setup() {
M5StamPLC.begin();
Serial1.begin(38400, SERIAL_8N1, RX_PIN, TX_PIN);
}Use Alternative UART Pins:
If the issue persists, try using a different UART (e.g., Serial2) if your hardware supports it. For example:Serial2.begin(38400, SERIAL_8N1, RX_PIN_2, TX_PIN_2);
Review M5StamPLC Library Documentation:
The M5StamPLC library might have specific requirements or conflicts with certain pins. Refer to the official documentation for details.
Debugging:
Add debug prints to verify if Serial1 is being initialized correctly:void setup() {
Serial.begin(115200); // For debugging
M5StamPLC.begin();
Serial1.begin(38400, SERIAL_8N1, RX_PIN, TX_PIN);
Serial.println("Serial1 initialized");
}Additional Notes:
If the problem is related to the M5StamPLC library's internal UART configuration, you may need to modify the library or contact M5Stack support (support@m5stack.com) for further assistance.
-
RE: timescamps of the photos taken by V-training
@naofuruta The issue with the timestamp being set to 2075 on photos taken with V-Training is likely due to a firmware or configuration problem. Here’s how you can fix it:
Steps to Resolve:Update Firmware:
Ensure your M5StickV or the device running V-Training has the latest firmware installed. Outdated firmware can cause incorrect timestamps.
Download the latest firmware from the M5Stack official website.Check RTC (Real-Time Clock):
The device’s RTC might not be properly set. Use the following steps to sync the time:
Connect the device to Wi-Fi (if supported) to sync the time automatically.
Manually set the RTC using the device’s configuration menu or via a script.Reconfigure V-Training:
Reset the V-Training application settings to default and reconfigure it.
Ensure the timestamp settings in the app are correctly configured.Verify SD Card:
A corrupted or improperly formatted SD card can cause timestamp issues. Format the SD card to FAT32 and try again.
Factory Reset:
If the issue persists, perform a factory reset on the device and reinstall the firmware and V-Training application.
Additional Notes:
If the problem continues, contact support@m5stack.com for further assistance.
Provide details such as the device model, firmware version, and steps you’ve already tried.
https://chat.m5stack.com/ -
RE: Core2 cannot be burned as Public and is not active in UI2Flow
To resolve the issue with your M5Stack Core2 not switching to "Public" mode in UIFlow 2.0, follow these steps:
Steps to Fix:Reconfigure in M5Burner:
Open M5Burner and ensure you are using the latest firmware for Core2.
Select the correct port and click Configure.
Choose Public mode in the configuration options before burning the firmware.Check Account Binding:
Ensure the device is bound to the same account used in UIFlow 2.0. Log in to UiFlow2 with the same credentials as M5Burner.
If the device is still "Private," unbind it from your account and rebind it.Wi-Fi Connection:
Ensure the Core2 is connected to Wi-Fi. A stable connection is required for online control.
Reset and Reburn:
Perform a factory reset on the Core2.
Reburn the firmware, ensuring Public mode is selected.Verify in UIFlow 2.0:
After reburning, check the device status in UIFlow 2.0 under Select Device. It should now appear as "Public."
Additional Notes:
If the issue persists, contact support@m5stack.com for further assistance.
Ensure no conflicting configurations (e.g., API keys) are interfering with the mode switch. -
RE: AtomS3R: sleep + wake up on IMU acceleration?
Yes, it is possible to put the AtomS3R into deep or light sleep mode and wake it up using the accelerometer, but this functionality is not directly available through the UIFlow 2.0 API. However, you can achieve this using Arduino by leveraging the ESP32's low-power features and the accelerometer's interrupt capabilities.
Steps to Implement in Arduino:Deep/Light Sleep Setup:
Use the esp_sleep_enable_ext0_wakeup() or esp_sleep_enable_ext1_wakeup() functions to configure the wake-up source from the accelerometer's interrupt pin.
The accelerometer's INT pin is connected to XTAL_32K_N (as you noted), which can be used as a wake-up trigger.Accelerometer Configuration:
Configure the accelerometer (e.g., MPU6886 or similar) to generate an interrupt when a significant acceleration is detected.
Set the threshold for acceleration to trigger the interrupt.Putting the Device to Sleep:
Call esp_deep_sleep_start() for deep sleep or esp_light_sleep_start() for light sleep.
Example Code (Arduino):
#include <M5AtomS3.h>void setup() {
M5.begin(); // Initialize M5AtomS3
M5.Imu.Init(); // Initialize the IMU (accelerometer)// Configure accelerometer interrupt
M5.Imu.setIntEnable(1); // Enable interrupt
M5.Imu.setWakeOnMotionThreshold(10); // Set threshold (adjust as needed)
M5.Imu.setWakeOnMotionEnabled(true); // Enable wake-on-motion// Configure wake-up from accelerometer interrupt
esp_sleep_enable_ext0_wakeup(GPIO_NUM_X, HIGH); // Replace X with the correct GPIO for XTAL_32K_NSerial.println("Going to sleep...");
delay(100);
esp_deep_sleep_start(); // Enter deep sleep
}void loop() {
// This will not run after deep sleep
}Notes:
UIFlow 2.0 Limitation: UIFlow 2.0 does not currently expose APIs for configuring sleep modes or accelerometer-based wake-up. You must use Arduino for this functionality.
GPIO Pin: You need to identify the correct GPIO pin connected to XTAL_32K_N (check the AtomS3R schematic or documentation).
Power Consumption: Deep sleep significantly reduces power consumption, while light sleep retains some peripherals (like Wi-Fi) but consumes more power.Alternative Approach:
If you prefer UIFlow, you might need to use a workaround (e.g., periodic wake-up and check accelerometer values), but this is less efficient than hardware-triggered wake-up. -
RE: SizeOf Structure M5Stack Core2 vs NANO
@SirMichael
The issue you're encountering is due to differences in data alignment and padding between the Arduino NANO (AVR architecture) and the M5Stack Core2 (ESP32 architecture). Here's why the sizeof your structure differs and how to fix it:Why the Size Differs
Data Alignment:
The ESP32 (Core2) aligns data to 4-byte boundaries by default for performance reasons, while the AVR (NANO) does not.
This causes the compiler to insert padding bytes between struct members to meet alignment requirements.Double Precision (double):
On AVR, double is typically 4 bytes (same as float).
On ESP32, double is 8 bytes (true IEEE 754 double precision).
This alone explains part of the size difference.Padding:
The ESP32 compiler may insert padding after uint16_t members to align the double to an 8-byte boundary.
How to Fix It
To ensure the struct has the same size and layout on both platforms, you can:Use #pragma pack:
Force the compiler to use 1-byte alignment (no padding) for the struct:#pragma pack(push, 1) // Disable padding
struct AmpStruct {
uint8_t bMode;
uint16_t iBand;
float dVolts; // Use float instead of double for consistency
uint16_t iAmpTemp;
uint16_t iFanOutput;
uint16_t iFwdPower;
uint16_t iRefPower;
};
#pragma pack(pop) // Restore default alignmentNote: Replace double with float to ensure consistency (4 bytes on both platforms).
Manually Pad the Struct:
If you must use double, manually add padding to match the ESP32 layout:struct AmpStruct {
uint8_t bMode;
uint8_t _pad1; // Manual padding
uint16_t iBand;
double dVolts;
uint16_t iAmpTemp;
uint16_t iFanOutput;
uint16_t iFwdPower;
uint16_t iRefPower;
};Use Serialization:
Instead of sending the raw struct, serialize it into a byte array with fixed sizes:uint8_t buffer[24]; // Adjust size as needed
buffer[0] = AmpData.bMode;
memcpy(&buffer[1], &AmpData.iBand, 2);
memcpy(&buffer[3], &AmpData.dVolts, 8); // Or use float
// ... repeat for other members
Serial.write(buffer, sizeof(buffer));Key Takeaways
Use float instead of double unless you need the extra precision.
Force 1-byte alignment with #pragma pack to avoid padding.
Test the struct size on both platforms after changes:Serial.print("Size of AmpStruct: ");
Serial.println(sizeof(AmpStruct)); -
RE: UHF RFID on M5Stack Core S3
The error you're encountering (fatal error: esp32/rom/rtc.h: No such file or directory) typically occurs when the Arduino IDE is not properly configured with the correct ESP32 board support package (BSP) or when there's a mismatch between the installed libraries and the board you're targeting (Core S3 in this case).
Here are the steps to resolve the issue:- Install or Update the ESP32 Board Support Package
Open the Arduino IDE.
Go to File > Preferences.
In the "Additional Boards Manager URLs" field, ensure you have the following URL:https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.jsonIf it's not there, add it and click "OK."
Go to Tools > Board > Boards Manager.
Search for esp32 and install or update the esp32 package by Espressif Systems.- Select the Correct Board
After installing the ESP32 BSP, go to Tools > Board and select M5Stack CoreS3 (or the closest match if "CoreS3" isn't listed explicitly).
Ensure the Flash Mode, Partition Scheme, and other settings are appropriate for the Core S3.- Check the M5Stack Library Version
The error suggests a conflict with the M5Stack library. Ensure you're using the latest version of the M5Stack library compatible with the Core S3.
Go to Sketch > Include Library > Manage Libraries.
Search for M5Stack and install the latest version.
If you already have it installed, try uninstalling and reinstalling it.- Verify the Example Code
The example you're using includes M5Stack.h and M5CoreS3.h. Ensure these headers are compatible with your setup.
If the example is from an older version of the library, it might not work with the Core S3. Look for updated examples in the latest library documentation.- Check the Serial Port and Upload Settings
Ensure the correct serial port is selected under Tools > Port.
If uploading fails, try pressing the reset button on the Core S3 just before uploading.- Clean the Sketch Folder
Sometimes, leftover files from previous builds can cause issues. Try creating a new sketch and copying the code into it.
- Debugging Further
If the issue persists, share the exact steps you followed to set up the Arduino IDE and install the libraries. This will help pinpoint the problem.
-
RE: M5 Dial V1.1 CAN bus
@davidrubixbattery
The compilation errors you're encountering are related to the ESP32CAN library in the Arduino IDE. Specifically, the errors indicate that certain registers and definitions (DPORT_PERIP_CLK_EN_REG, CAN_TX_IDX, CAN_RX_IDX, and ETS_CAN_INTR_SOURCE) are not declared in the current version of the ESP32 Arduino core library you're using.
Steps to Resolve the Issue:Update the ESP32 Arduino Core:
Ensure you are using the latest version of the ESP32 Arduino core. Open the Arduino IDE, go to Tools > Board > Boards Manager, search for "esp32", and update to the latest version.
Check the ESP32CAN Library:
The ESP32CAN library might not be compatible with the latest ESP32 Arduino core. Try using the M5Stack CAN library instead, as it is tailored for M5Stack products.
Alternative Library:
If the issue persists, consider using the ESP32 TWAI (CAN) API directly in your Arduino sketch. The TWAI API is the newer and recommended way to handle CAN communication on ESP32.
Verify Hardware Connections:
Ensure the Dial and Isolated CAN bus unit are correctly connected to the specified port (Port A) and that the pins are properly configured in your code.
Example Code for M5Stack CAN:
Here’s a basic example for initializing CAN on an M5Stack device:
#include <M5Stack.h>
#include "esp32_can.h"void setup() {
M5.begin();
CAN_init(0, GPIO_NUM_5, GPIO_NUM_4); // Example pins for CAN TX and RX
}void loop() {
// Your CAN communication logic here
}Additional Resources:
M5Stack CAN Unit Documentation
ESP32 TWAI API Reference -
RE: QRCode2 is hot
@glabasnat
The Atomic QRCode2 Base (SKU: A133-B) typically draws a working current of around 174.18 mA at 5V when connected to an Atom-Lite. Your observation of 170 mA is within the expected range, so this behavior is normal.
However, if the device is heating up significantly, you can try the following to reduce power consumption:Use Pulse Mode: Ensure you are using the TRIGGER_MODE_PULSE mode to minimize continuous power draw.
Adjust Lighting: Reduce the brightness of the fill light (set_fill_light_brightness) or turn it off when not needed (FILL_LIGHT_OFF).
Limit Continuous Operation: Avoid prolonged continuous scanning by using shorter decode delays (set_decode_delay).If the issue persists, check for firmware updates or ensure proper ventilation around the device.
-
RE: Why have switch and button widgets been removed from uiflow
@ph0sgene
To create custom buttons using touch coordinates and visual elements (like rectangles or images) in UIFlow 2 for your Paper S3 (SKU: C139), you can follow these steps:Use Touch Coordinates:
The Paper S3 has a touchscreen, and you can detect touch events by checking the coordinates where the screen is touched.
Example code snippet in MicroPython:import M5
from M5 import Widgetsdef on_touch(x, y):
if 100 <= x <= 200 and 100 <= y <= 200: # Define your button area
print("Button pressed!")M5.begin()
Widgets.fillScreen(0x222222)
label = Widgets.Label("Touch the screen", 50, 50, 1.0, 0xffffff, 0x222222, Widgets.FONTS.DejaVu24)while True:
if M5.Touch.getTouch():
x, y = M5.Touch.getX(), M5.Touch.getY()
on_touch(x, y)
M5.update()Visual Elements:
You can draw rectangles or images to represent buttons on the screen.
Example to draw a rectangle as a button:import M5
from M5 import WidgetsM5.begin()
Widgets.fillScreen(0x222222)
button = Widgets.Rectangle(100, 100, 100, 50, 0x00ff00, 0x222222) # Green rectanglewhile True:
if M5.Touch.getTouch():
x, y = M5.Touch.getX(), M5.Touch.getY()
if 100 <= x <= 200 and 100 <= y <= 150: # Check if touch is within the rectangle
print("Button pressed!")
M5.update()Images as Buttons:
You can also use images as buttons by loading an image and checking if the touch coordinates fall within the image bounds.
Additional Notes:
The above examples are simplified. You may need to adjust the coordinates and logic based on your specific requirements.
For more advanced features, refer to the Paper S3 documentation.reply with https://chat.m5stack.com/