nopnop2002 / esp-idf-smb-client

SMB client example for esp-idf
MIT License
20 stars 8 forks source link
esp-idf esp32 samba smb smbclient

esp-idf-smb-client

SMB client example for esp-idf.
"SMB (Server Message Block)" is a standard file sharing protocol in Windows networks.
You can access Windows shared folder from esp32.
This project use SMB2/3 userspace client.

Software requirements

ESP-IDF V4.4/V5.x.
ESP-IDF V5.0 is required when using ESP32-C2.
ESP-IDF V5.1 is required when using ESP32-C6.

Installation

git clone https://github.com/nopnop2002/esp-idf-smb-client
cd esp-idf-smb-client
git clone https://github.com/sahlberg/libsmb2 components/libsmb2
cd smb2-ls
idf.py set-target {esp32/esp32s2/esp32s3/esp32c2/esp32c3/esp32c6}
idf.py menuconfig
idf.py flash

Configuration

You have to set this config value with menuconfig.

config-main config-app-1

When a password is required to access the shared folder.

config-app-2

Specify the SMB Host in one of the following formats.

config-app3

Examples

smbclient

You can check the services provided by the host using smbclient.

$ smbclient -L LANDISK-HDL-AA1.local -U admin
Enter WORKGROUP\admin's password:

        Sharename       Type      Comment
        ---------       ----      -------
        LAN DISK Log    Disk      HDL-AA Share for Log files
        disk1           Disk      HDL-AA RAID share
        IPC$            IPC       IPC Service (HDL-AA series)
SMB1 disabled -- no workgroup available