Python Forum
Access Network SMB Share on a NAS
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Access Network SMB Share on a NAS
#1
Hi there,
total NOOB here.Trying to learn some Pyhton starting from "basic" automation tasks.
What I'd like to do is telling a podcast app to update and d\l new episodes and move them to a NAS share folder. The first step is complete. What I'm having a hard time with is accessing my WD MyCloud server. I'm using Python3 on a raspberry PI 4. I've tried the following code with success to access two other shares. One is an Ubuntu machine and the other a debian antix based machine.
I can't access the NAS no way. This is the code
from smb.SMBConnection import SMBConnection

host: str = "192.160.0.8"  # ip or domain name
username = ""
password = ""
conn: SMBConnection=SMBConnection(username,password,"","",use_ntlm_v2 = False)
result = conn.connect(host, 445)


localFile=open("/home/delta/Storage/file","rb")
conn.storeFile("System4", "testfile", localFile)
localFile.close()
IF i try that code to access the NAS server I've been given the
smb.smb_structs.ProtocolError: Server does not support any of the pysmb dialects. Please email pysmb to add in support for your OS
error.
After long googleing I see the pysmb only supports SMB1\2 while my WD NAS Server should run the SMB3 version. I don't know whether that's the issue, nonetheless I've tried to use smbprotocol or smbclient, but, after installing the modules, I get a <no module named smbclient or smbprotocol> when running the script.

Hope to find some help here guys..
Reply


Messages In This Thread
Access Network SMB Share on a NAS - by deltapy - Oct-30-2020, 08:10 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Timestamp of file changes if a share mapped to a server…. tester_V 34 4,009 Jul-04-2023, 05:19 AM
Last Post: tester_V
  access is denied error 5 for network drive mapping ? ahmedbarbary 2 1,825 Aug-17-2022, 10:09 PM
Last Post: ahmedbarbary
  access share attributed among several class methods drSlump 0 1,072 Nov-18-2021, 03:02 PM
Last Post: drSlump
  How to share a numpy array between 2 processes on Windows? qstdy 0 2,171 Jan-29-2021, 04:24 AM
Last Post: qstdy
  "could not access network location _\" MrMiyagi 0 2,080 Aug-04-2020, 06:47 PM
Last Post: MrMiyagi
  Multiprocessing share variable catosp 0 2,151 Jul-15-2020, 10:45 AM
Last Post: catosp
  SHARE PYTHON FILE ambush 1 2,861 Jan-28-2019, 04:04 AM
Last Post: snippsat
  Copy info of 2 files with share information AngelRuizM 1 2,684 Aug-14-2017, 07:31 PM
Last Post: buran
  Properly share logger objects CardBoy 2 3,181 Jun-27-2017, 08:33 PM
Last Post: Ofnuts

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020