Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    A tutorial for successfully using the SD Card Reader in any of the expansion modules.

    Scheduled Pinned Locked Moved Guides
    1 Posts 1 Posters 68 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • V Offline
      VST Admin
      last edited by

      Forgive me, but I have literally been searching for hours. I have a need to create a small datalogger and I was following the examples at https://docs.pycom.io/firmwareapi/pycom/machine/sd/. The SINGLE example does not seem to work. the f.readall() method completely fails with an "AttributeError: 'TextIOWrapper' opbject as not attribute 'readall'

      from machine import SD
      import os
      
      sd = SD()
      os.mount(sd, '/sd')
      
      # check the content
      os.listdir('/sd')
      
      # try some standard file operations
      f = open('/sd/test.txt', 'w')
      f.write('Testing SD card write operations')
      f.close()
      f = open('/sd/test.txt', 'r')
      f.readall()
      f.close()
      

      I have literally wasted an entire day working on this. Can someone point me to a comprehensive documentation of the SD card API and its usage? There is no reason for simple things to be this hard. We have come from Particle.io in search of a better product and I am finding the documentation to be a hopeless morass of blind alleys.

      Thanks in advance!

      1 Reply Last reply Reply Quote 1

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      • 1 / 1
      • First post
        Last post

      Pycom on Twitter

      Pycom