Hi,
I'm using a Adafruit Feather M0 with RFM95 LoRa Radio - 900MHz - RadioFruit
and I'm looking to write data into files located in my computer (the feather is connected to the computer).
I tried :
fichier = open("/home/user/data.txt", "a")
fichier.write("Hello world")
fichier.close()
in my main.py file but I get "OSError: [Errno 30]" error (seems to be read only).
Is it possible to write into files ?
Thanks
Writing on external file
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- tannewt
- Posts: 3304
- Joined: Thu Oct 06, 2016 8:48 pm
Re: Writing on external file
Its totally possible but requires you to change the drive to writable from circuitpython and read-only from the computer. This reduces the risk of corrupting the filesystem.
Check out this guide for details: https://learn.adafruit.com/cpu-temperat ... n?view=all
Check out this guide for details: https://learn.adafruit.com/cpu-temperat ... n?view=all
- raspadafruit
- Posts: 62
- Joined: Mon Aug 13, 2018 6:00 am
Re: Writing on external file
Thank you so much ! I will try it tomorrow and get back if there is any issues !
Thanks
Thanks
- raspadafruit
- Posts: 62
- Joined: Mon Aug 13, 2018 6:00 am
Re: Writing on external file
Hi,
Just to be sure, the tutorial shows how to write files in the device and read it from the computer, however, is it possible de write files directly located in the computer (to avoid memory issues)?
Thanks
Just to be sure, the tutorial shows how to write files in the device and read it from the computer, however, is it possible de write files directly located in the computer (to avoid memory issues)?
Thanks
- danhalbert
- Posts: 4653
- Joined: Tue Aug 08, 2017 12:37 pm
Re: Writing on external file
No, there's no way to write a host computer file directly. You could send the data to the host over UART or similar and have a program on the host read the data and write it to a file.
- raspadafruit
- Posts: 62
- Joined: Mon Aug 13, 2018 6:00 am
Re: Writing on external file
Ok, thanks !!
Please be positive and constructive with your questions and comments.