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

    Pybytes stale file data

    Scheduled Pinned Locked Moved Support & Troubleshooting
    5 Posts 2 Posters 57 Views 2 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.
    • D Offline
      dnear1
      last edited by

      This problem seems to keep popping up.
      I have my devices loaded with the current firmware. 1.20.2.r0

      I've been provisioning new devices using Pybytes.
      First, I load a file to main.py that creates all of the library files by writing to /flash/lib/

      files=['bme680.py','constants.py','lorakeys.py','nets.py','si11xx.py','i2c.py']
      for c in files:
        fn='/flash/lib/' + c
        f=open(fn,'w')
        f.write('#hello')
        f.close()
      

      After that, I overwrite main.py with my actual normal main.py
      After I upload all of the correct files to the ones created in /flash/lib/ everything seems to be working. It's publishing data to the pybytes signals and sending data over LoRa.
      But if I close/reopen the browser and go look at pybytes again, all of those files are showing stale (#Hello) yet the correct library files have to be in there, since the device is running and utilizing all of these libraries.
      I've tried using the "Refresh Hierarchy" button and that doesn't seem to change anything.
      I've also tried re-writing all of these files a second time, and that does seem to 'fix it' But it would be nice if this would actually get fixed, so I don't have to waste dozens of minutes per device..

      1 Reply Last reply Reply Quote 0
      • G Offline
        Gijs
        last edited by

        That indeed sounds like a bug to me. As Pymakr online is still quite new, we are still working on adding new features and fixes. I will take a more in-depth look at this tomorrow!
        Gijs

        1 Reply Last reply Reply Quote 0
        • G Offline
          Gijs
          last edited by Gijs

          @dnear1 said in Pybytes stale file data:

          files=['bme680.py','constants.py','lorakeys.py','nets.py','si11xx.py','i2c.py']
          for c in files:
          fn='/flash/lib/' + c
          f=open(fn,'w')
          f.write('#hello')
          f.close()

          What you could do instead of this, is rightclick on a folder in Pymakr Online or on the device name, and click 'add folder' or 'add file' to add the files you need. I do think your solution is quite creative!

          After I upload the file-creating main.py, It will automatically reset and refresh the hierarchy when it comes back online.

          Edit: the Pymakr online does not work after calling os.fsformat("/flash"), ill add that to the buglist :)

          D 1 Reply Last reply Reply Quote 0
          • D Offline
            dnear1 @Gijs
            last edited by

            @Gijs I didn't know about the 'add file' option.. I don't remember seeing it there previously.

            I tried deleting a file that way then re-creating it... When recreated, pybytes seems to restore it from the garbage bin with the same stale data.

            I also did some testing using FTP to upload to my LoPy4's. I started out with a fresh unit I just purchased, flashed it to the latest firmware 1.20.2.r1 and FTP'ed all the files over. Pybytes still doesn't seem to accurately reflect what's stored in flash.

            1 Reply Last reply Reply Quote 0
            • G Offline
              Gijs
              last edited by

              The feature is indeed relatively new, which might explain the bug you found, I will put that forward.

              1 Reply Last reply Reply Quote 0

              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