Access shared folder from micropython

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
Posts: 1
Joined: Sat Oct 07, 2017 8:01 pm

Access shared folder from micropython

Post by unclenorton » Sat Oct 07, 2017 8:07 pm

I tried opening a text file from a shared folder in python on my PC with [code]f = open("//JOHNPC/Shared/test.txt", 'r').read()[/code] and it works perfectly, but when i try to execute exactle the same command on an esp8266 with micropython installed and connected to the exact same wifi network as my PC it gives me this error: [code]OSError: [Errno 2] ENOENT[/code]. Does anybody know how to make it work?

User avatar
Posts: 1334
Joined: Thu May 28, 2015 5:54 pm

Re: Access shared folder from micropython

Post by deshipu » Sat Oct 07, 2017 10:37 pm

It would take a considerable amount of work. First you need to reverse-engineer the SMB protocol that Windows uses to share the drives. Then you would need to implement it with MicroPython's limited resources. All in all, for a team of 10 very experienced programmers, I would say it's a project for 2-3 years of work.

Posts: 281
Joined: Thu Apr 24, 2014 9:13 am

Re: Access shared folder from micropython

Post by stijn » Sun Oct 08, 2017 7:42 am

The open source solutions both for accessing and producing SMB-compatible network locations already exist. So at least the reverse engineering part has been done where needed. The real problem is 'just' the porting of that that code to whatever microcontroller. Which might simply be undoable (infinite years of work if you will) because of the lack of resources. But if there would be, I doubt it would take years for multiple programmers.

User avatar
Posts: 3134
Joined: Fri Jul 18, 2014 8:01 am
Location: UK

Re: Access shared folder from micropython

Post by pythoncoder » Sun Oct 08, 2017 5:18 pm

@unclenorton I'd look at the problem in a different way. You want to be able to communicate between an ESP8266 and a PC across a WiFi network. This requires a communications protocol. Options supported by MicroPython - either officially or unofficially - are FTP, HTTP, MQTT, Telnet and probably others.

Rather than tackle an unsupported protocol I'd consider the problem you're trying to solve and figure out which supported protocol provides the best fit. We can probably help if you tell us more.
Peter Hinch

Post Reply