神刀安全网

One month development report on porting MicroPython to ESP8266 WiFi SoC

pfalcon wrote: Ok, let’s try to find an answer together. @deshipu mentioned "There is a filesystem object in the os module". How could he possibly know? Well, just by looking at the source of "os" module: https://github.com/micropython/micropyt … uos.c#L116 . Or even easier: by doing "dir(os)" after "import os", or just trying tab completion on "os.".

Ok we found out that there’s "os.VfsFat", which is not exactly "os.mount" which is described for PyBoard but looks pretty close. Still, what to do next? Knowing that MicroPython is open-source project, there must be discussion about it somewhere on the project. The project is hosted on github, so let’s search there: https://github.com/micropython/micropyt … 3&q=VfsFat . What we immediately see is a hit for tests/extmod/vfs_fat_ramdisk.py which gives full usage example (and test!) for VfsFat. Don’t stop there though, click on "Issues" tab on the left – you’ll see the whole development history of this feature! It first was mentioned on Feb 6, and then finally implemented on Feb 13. The tickets linked provide extensive discussion and background behind introducing os.VfsFat as well as future plans regarding it.

@pfalcon – thanks for the gentle introduction on how to utilize GitHub’s search features. Unfortunately, I suspect I was not alone in being unaware of the general direction and roadmap for the VfsFat module. I only started to closely follow Micropython after the recent ESP8266 Kickstarter (to which I contributed) so it’s not surprising I missed this. After reading the development thread things are clearer but what isn’t entirely clear is whether there is an existing flash-based back-end for VfsFat to utilize. The example shows a RAM back-end but given the scarcity (and volatility) of RAM on the ESP8266 that isn’t an optimal solution. Does one exist that we can already leverage or is the expectation that everyone develops one themselves using the primitive flash functions Espressif provides (in their C library) and integrating it into the ESP8266 variant of Micropython? I realize this port is still under heavy development so perhaps the plan is the provide this at some point. In this case I’ll be patient and wait for further developments. If not, then although a suitable framework seems to be provided (e.g. VfsFat/FatFS), what currently exists in the public repository appears to fall short of what might be expected if a working (flash-based) back-end already existed. Have I missed something or or am I just being over-eager in my attempts to test/utilize this module using a persistent back-end?

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » One month development report on porting MicroPython to ESP8266 WiFi SoC

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
分享按钮