Welcome! Log In Create A New Profile

Advanced

can marlin share an SD card via WIFI on skr-2 board

Posted by mtraven 
can marlin share an SD card via WIFI on skr-2 board
January 17, 2025 11:09PM
I have an skr2 with an esp32u (BTT) add on wifi module. Got it connected as a simple serial setup, thats fine. But what I would really like to be able to do is send files to the esp32 and have it write them to a shared SD card. From studying the pinouts, it really seems like I should be able to setup and spi connection to my sd card. Ideally that would be the one in my LCD, but I could live with it being the on board one too. So is this even possible?

here is what has led me to believe it might be:

from the adv config file:
/**
 * Native ESP32 board with WiFi or add-on ESP32 WiFi-101 module
 */
//#define WIFISUPPORT         // Marlin embedded WiFi management. Not needed for simple WiFi serial port.
//#define ESP3D_WIFISUPPORT   // ESP3D Library WiFi management (https://github.com/luc-github/ESP3DLib)

this confuses me slightly....seems like "...or add on ESP21 WIFI module" is my case? But maybe thats for and esp32 mb running esp32 wifi add on?

I waanted to enable that because it brings some variables into play:
#if ENABLED(WIFISUPPORT)
  //
  // WIFI
  //

  /**
   *                      -------
   *            GND | 9  |       | 8 | 3.3V
   *  (ESP-CS) PB12 | 10 |       | 7 | PB15 (ESP-MOSI)
   *           3.3V | 11 |       | 6 | PB14 (ESP-MISO)
   * (ESP-IO0) PB10 | 12 |       | 5 | PB13 (ESP-CLK)
   * (ESP-IO4) PB11 | 13 |       | 4 | --
   *             -- | 14 |       | 3 | 3.3V (ESP-EN)
   *  (ESP-RX)  PD8 | 15 |       | 2 | --
   *  (ESP-TX)  PD9 | 16 |       | 1 | PC14 (ESP-RST)
   *                      -------
   *                       WIFI
   */
  #define ESP_WIFI_MODULE_COM                  3  // Must also set either SERIAL_PORT or SERIAL_PORT_2 to this
  #define ESP_WIFI_MODULE_BAUDRATE      BAUDRATE  // Must use same BAUDRATE as SERIAL_PORT & SERIAL_PORT_2
  #define ESP_WIFI_MODULE_RESET_PIN         PC14
  #define ESP_WIFI_MODULE_GPIO0_PIN         PB10
  #define ESP_WIFI_MODULE_GPIO4_PIN         PB11
#endif

Unfortunately, I cant get by the errors it throws when I turn wifiSupport on(working on that tonight).
Now, esp3d allows for an sd card connection and requires the pin assignments shown in the attached image. The second image in the pinout of my wifi board.

So the CS, SCK, MISO & MOSI pins seem pretty straight forward. But I cant figure out the sd detect pin or the shared disk flag(if there is one).
Of the remaining pins, I know its not RST, TX or RX. That leaves IO0(PB10 @ STM32) and IO4(PB11 @STM32) as candidates for the detect pin.

I have tried both of those options, as well as "none"...no success yet. Conceptually, it seems like I need to do something in marlin to connect the "detect pin" to the esp32, but I haven't the slightest clue how do make that happen. Was kinda hoping that wifiSupport might do it for me....

Any help would be appreciated, thanks so much!
Attachments:
open | download - esp3d - options.jpg (98.3 KB)
open | download - esp32U - btt -pinout.jpg (68.6 KB)
Re: can marlin share an SD card via WIFI on skr-2 board
January 18, 2025 01:37AM
no...

Wifi port has
ESP-CS PB12
ESP-MOSI PB15
ESP-MISO PB14
ESP-CLK PB13

There are all directly connected to the MPU SPI2 port io pins

The sdcard on the screen is

#define SD_SS_PIN PA4
#define SD_SCK_PIN PA5
#define SD_MISO_PIN PA6
#define SD_MOSI_PIN PA7

This is directly connected to the MPU SPI1 port io pins

The onboard motherboard SDCARD uses SPIO not SPI, and is also directly connected to the MPU

Edited 1 time(s). Last edit at 01/18/2025 01:38AM by Dust.
Re: can marlin share an SD card via WIFI on skr-2 board
January 18, 2025 03:09PM
lemmy see if I understand this right: to do what I want, the MPU would have to be connected to the same SPI as the screen (spi1) ?
and since they are direct connections to physical pins, that cant be changed, right?

There must be a reason those pins were included with the WIFI port, what is it? How is that meant to be used?


Thanks again...you really seem to do a lot of heavy lifting in this forum, much appreciated.
Re: can marlin share an SD card via WIFI on skr-2 board
January 18, 2025 06:17PM
reprapfirmware [www.reprapfirmware.org] uses the SPI port with their own esp wifi code.

Edited 1 time(s). Last edit at 01/18/2025 06:18PM by Dust.
Re: can marlin share an SD card via WIFI on skr-2 board
January 18, 2025 11:12PM
any plans for marlin to do the same in the future?
Re: can marlin share an SD card via WIFI on skr-2 board
January 19, 2025 01:44AM
Marlin developers are all individuals, 'we' only find out what they are working on when they create a PR to request it to be added to Marlin
Re: can marlin share an SD card via WIFI on skr-2 board
January 19, 2025 04:08PM
interesting, I'm really not familiar with how open source development works behind the scenes. So someone has to write the feature first, then it can get added?
Sorry, only registered users may post in this forum.

Click here to login