apollo80 / wireless-klipper

Firmware for MKS Robin WiFi (esp8266) - organizing a klipper <-> wifi <-> mcu bridge
GNU General Public License v3.0
21 stars 2 forks source link

MCU shutdown #4

Open thecrow159 opened 9 months ago

thecrow159 commented 9 months ago

Hi apollo80, thank you for your great work.

I was able to flash your code but very often (10 minutes for example) during a print and even while not printing I get a "MCU shutdown. Timer too close" error. I can attach pictures of the error. My MKS WiFi is connected to my router in STA mode that I enabled in your Arduino code. My printer is a Flsun Q5, all parts are original. The mcu is a Mks Robin Nano v1.2.

Inside the file "wireless_klipper_sta.ino" I changed those lines for my wifi connection to happen:

struct settings_t moduleSettings
{
    /// @brief firmware version
    .version = { 0, 0, 2, 3 },

    /// @brief wifi point name
    "FlsunQ5",

    /// @brief wifi SSID
    "My WiFi SSID",

    /// @brief wifi password
    "My WiFi passowrd",

    /// @brief wifi mode
    .wifi_use_sta = true,

    // default values for the serial port
    .serialPort_baud = 250000,

    .serialPort_rxBuffSize = 256,

    /// @brief port of tcp2serial server
    .tcpServer_port = 8888,

    // buffer size for receiving/transmitting data
    .tcpServer_buffSize = 256,

    /// @brief
    .use_static_ip = true,

    /// @brief
    .static_IPaddress = { 192, 168, 1, 90 },

    /// @brief
    .static_netmask = { 255, 255, 255, 0 },

    /// @brief
    .static_gateway = { 192, 168, 1, 1 },
};

Then I patched klipper source to enable wifi.

My host is a Raspberry Pi 2, I can attach system usages too.

Bye, Emiliano

IMG_20240114_112441_256

IMG_20240114_112438_419

apollo80 commented 4 months ago

Hi. After searching for the problem for a long time and rewriting the code for different SDKs, I finally found the problem.

During the interaction, something happens to the WiFi subsystem and an error is displayed in the UART, which spoils the entire operation of the MCU.

A issue to the SDK developers has been opened - https://github.com/espressif/ESP8266_RTOS_SDK/issues/1282 We'll be watching.