Home/Support/Support Forum/Create and Write File in flash memory

Create and Write File in flash memory

0 votes
Hey everyone!!!

I am using an Digi Xbee 3 Zigbee and I would like to ask how can I create a file and write/read in/from it using MicroPython?
My attempt was to import uio module and then use the class uio.BytesIO in example. Everything seems to work but the file doesn't seem to exist somewhere inside the flash memory...

Do you have any better idea of doing it or maybe an explanation why is that happening(maybe this file is created only in RAMs space)?

Thank you in advance!
asked Sep 30 in XBee3 ZigBee by manos New to the Community (2 points)

Please log in or register to answer this question.

2 Answers

0 votes
Try using the File System example that is located in the XBee Py Charm plugin. It should give you the data you are looking for.
answered Sep 30 by mvut Veteran of the Digi Community (13,472 points)
0 votes
Thanks for your answer!

uio.BytesIO class seems to write the contents to a file, in an in-memory buffer. In other words a chunk of RAM.
So, the open method (suggested in the example that mvut suggested) is the way to write files in flash.
answered Oct 5 by manos New to the Community (2 points)