Jump to content

Read/Write NFC Tags


xperiment

Recommended Posts

Posted (edited) · Read/Write NFC Tags

I finally spent some time looking into adding the ability to write the remaining weight to the tag in addition to the total through the UI. Originally, the UI would write the new total and remaining as the same value. Once I familiarized myself with the NFCSpool.py code, I realized that the functionality of writing the remaining amount was already coded into the MyFilamentSpool class. This was set to a default of None and if it is none, it will write it the same as the total.

Therefore I modified the NFCSPool.py, SpoolMaker.py, and gui.ui file to be able to write the remaining weight to the tag. The defaults are set to 1000000mg for each. I have attached all 3 files to this post. I don't have a github, so if someone wants to update these on there, they are more than welcome to.

 

Eventually I want to integrate this with a usb scale so that I can weigh a spool and write that weight in one, easy to use device. This is worth it for us because in a busy fall semester, we can burn through 2 spools a day and we are constantly moving materials around to 8 different Ultimaker material stations.

 

image.thumb.png.4746fa5a7c1e4cf9c561fb18c63c1757.png

SpoolMaker.zip

Edited by alkekmakerspace
  • Like 2
Link to post
Share on other sites

Posted (edited) · Read/Write NFC Tags

Big thank you to Dale Osborn and Frans Grotepass for supplying the code/program to alter the NFC tags.

 

For some reason Cura is not listed in my Windows 11 registry at the locations probed by the python code.

Maybe since I installed it via the Windows Store instead of an 'installer'.

I had to 'hardcode' the path location and version number variable for getting it to work.

 

Now awaiting the arrival of the NFC reader/writer...

Edited by Worfje
  • Heart 1
Link to post
Share on other sites

Posted · Read/Write NFC Tags

Sorry, my mistake. Cura must have been installed via an 'installer' and not via the Windows Store.

I was thinking out loud on why Cura's file/path location isn't visible in my windows registry.

  • Link to post
    Share on other sites

    Posted · Read/Write NFC Tags
    On 9/4/2024 at 8:46 PM, Worfje said:

    Big thank you to Dale Osborn and Frans Grotepass for supplying the code/program to alter the NFC tags.

     

    For some reason Cura is not listed in my Windows 11 registry at the locations probed by the python code.

    Maybe since I installed it via the Windows Store instead of an 'installer'.

    I had to 'hardcode' the path location and version number variable for getting it to work.

     

    Now awaiting the arrival of the NFC reader/writer...

    Thanks, man! It's a pleasure. Unfortunately I'm not too focussed to debug any Windows issues. My stuff all runs Linux.

  • Link to post
    Share on other sites

    Posted · Read/Write NFC Tags
    On 8/30/2024 at 6:05 PM, alkekmakerspace said:

    I finally spent some time looking into adding the ability to write the remaining weight to the tag in addition to the total through the UI. Originally, the UI would write the new total and remaining as the same value. Once I familiarized myself with the NFCSpool.py code, I realized that the functionality of writing the remaining amount was already coded into the MyFilamentSpool class. This was set to a default of None and if it is none, it will write it the same as the total.

    Therefore I modified the NFCSPool.py, SpoolMaker.py, and gui.ui file to be able to write the remaining weight to the tag. The defaults are set to 1000000mg for each. I have attached all 3 files to this post. I don't have a github, so if someone wants to update these on there, they are more than welcome to.

     

    Eventually I want to integrate this with a usb scale so that I can weigh a spool and write that weight in one, easy to use device. This is worth it for us because in a busy fall semester, we can burn through 2 spools a day and we are constantly moving materials around to 8 different Ultimaker material stations.

     

    image.thumb.png.4746fa5a7c1e4cf9c561fb18c63c1757.png

    SpoolMaker.zip 8.95 kB · 6 downloads

    I'll check out the changes and incorporate it where possible.

    • Like 1
    Link to post
    Share on other sites

    Posted · Read/Write NFC Tags

    Just so people here know. A number of pull requests were submitted to Dale Osborne but they were not inspected and/or merged. I'll maintain my fork for now. It includes a filter for filament diameter and a filter for filament on text sub-string. There was a stage during one of the upgrades where a directory was added (can't remember which right now) that broke the tool. Will look exactly what that was, as this was also tweaked in the current version. It would be great if someone is willing to help maintain the MAC and Windows branches of the tool as this is not my joy in life.

    • Like 1
    Link to post
    Share on other sites

    Posted · Read/Write NFC Tags

    I am sure I can help out with the Windows branches. 


    FYI: I just received the NFC reader (ACS ACR122U) today and just tested it and it worked flawlessly! 

  • Link to post
    Share on other sites

    Posted · Read/Write NFC Tags

    I can also help with the windows side of things. I use this almost every day to rewrite tags. We also maintain the material profiles on 5 computers and 8 printers. You can see our filament usage metrics on our webpage if you scroll down to the power BI dashboard that shows patron demographics. The filament info is on page 4 of 8: https://www.library.txst.edu/spaces-technology/space-types/alkek-one/maker-space.html

  • Link to post
    Share on other sites

    Posted · Read/Write NFC Tags
    24 minutes ago, alkekmakerspace said:

    I can also help with the windows side of things. I use this almost every day to rewrite tags. We also maintain the material profiles on 5 computers and 8 printers. You can see our filament usage metrics on our webpage if you scroll down to the power BI dashboard that shows patron demographics. The filament info is on page 4 of 8: https://www.library.txst.edu/spaces-technology/space-types/alkek-one/maker-space.html

    Wow! Awesome setup you've got rolling there! It would be good if the small problems in the Windows version can be fixed.

     

  • Link to post
    Share on other sites

    Posted · Read/Write NFC Tags
    6 minutes ago, NTwoO said:

    Wow! Awesome setup you've got rolling there! It would be good if the small problems in the Windows version can be fixed.

     

    I'm not sure what the small issues are. The version I have running is working fine. I know when I first try to compile the exe there is an issue and I have to run a different command.

     

    This is what worked on my computer:

    python -m PyInstaller SpoolMaker.py --onefile --windowed --icon=.\icon.ico --add-data="icon.ico;." --add-data="gui.ui;."

     

    The readme files says this:

    pyinstaller.exe --onefile --windowed --icon=.\icon.ico --add-data="icon.ico;." --add-data="gui.ui;." .\SpoolMaker.py

     

  • Link to post
    Share on other sites

    Posted (edited) · Read/Write NFC Tags
    On 8/30/2024 at 6:05 PM, alkekmakerspace said:

    I finally spent some time looking into adding the ability to write the remaining weight to the tag in addition to the total through the UI. Originally, the UI would write the new total and remaining as the same value. Once I familiarized myself with the NFCSpool.py code, I realized that the functionality of writing the remaining amount was already coded into the MyFilamentSpool class. This was set to a default of None and if it is none, it will write it the same as the total.

    Therefore I modified the NFCSPool.py, SpoolMaker.py, and gui.ui file to be able to write the remaining weight to the tag. The defaults are set to 1000000mg for each. I have attached all 3 files to this post. I don't have a github, so if someone wants to update these on there, they are more than welcome to.

     

    Eventually I want to integrate this with a usb scale so that I can weigh a spool and write that weight in one, easy to use device. This is worth it for us because in a busy fall semester, we can burn through 2 spools a day and we are constantly moving materials around to 8 different Ultimaker material stations.

     

    image.thumb.png.4746fa5a7c1e4cf9c561fb18c63c1757.png

    SpoolMaker.zip 8.95 kB · 7 downloads

    Doesn't it make more sense to make the "weight current" read/write? That way is is not more clutter. In the past I changed the Total value to tune this... It might also be handy to add a config file for the tool, so default new weight (and possible filters I have in my version) can be saved between launches.

     

    My branch now has the remaining field read/write and this is used similar to how you added it. The UI is a rearranged somewhat to have a better layout. I can't tune or change the original version and pull requests are not accepted, so it would be good if the Windows version also works on my branch.

    Edited by NTwoO
  • Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

    • Our picks

      • UltiMaker Cura 5.8 Stable released 🎉
        In the Cura 5.8 stable release, everyone can now tune their Z seams to look better than ever. Method series users get access to new material profiles, and the base Method model now has a printer profile, meaning the whole Method series is now supported in Cura!
        • 4 replies
      • Introducing the UltiMaker Factor 4
        We are happy to announce the next evolution in the UltiMaker 3D printer lineup: the UltiMaker Factor 4 industrial-grade 3D printer, designed to take manufacturing to new levels of efficiency and reliability. Factor 4 is an end-to-end 3D printing solution for light industrial applications
          • Thanks
          • Like
        • 3 replies
    ×
    ×
    • Create New...