Save programming to NAS Harddrive

Your 2.3.4 won't save to a windows mapped drive(NAS), nor will the IDE open a file when double clicked on. I changed the Network host name to my NAS name, 2.3.4 wouldn't open(I changed it back), just the heart beat for 20 minutes. what is the fix for this? Also the save location seems to change, I found the program I had been working on located in the Libraries folder????

Do these issues occur with IDE 1.x?

This is not my experience with 2.x.

3 Likes

Not my experience, works fine on networked storage.

Hi @unLike.

The Arduino IDE developers are tracking this bug here:

If you have a GitHub account, you can subscribe to that thread to get notifications of any new developments related to this subject:


:exclamation: Please only comment on the GitHub issue thread if you have new technical information that will assist with the resolution. General discussion and support requests are always welcome here on the Arduino Forum.


Note that it actually does save the file. It is just that it can't open the file from the new path after saving. So the code of the sketch you saved is still present at the path you saved to.

The workaround is to map the network share to a drive on your computer. Then make sure to open the sketches from that drive instead of from the network location. You can learn how to map the share to a drive from this tutorial:

I'm going to ask you to provide some additional information that might help us to identify the problem.


:exclamation: This procedure is not intended to solve the problem. The purpose is to gather more information.


Please do this:

  1. Close all Arduino IDE windows if the IDE is already running.
  2. Start Windows "File Explorer".
  3. Open the Arduino IDE installation folder.
    The default installation location is at one of the following paths:
    • C:\Program Files\Arduino IDE
      
    • C:\Users\<username>\AppData\Local\Programs\Arduino IDE
      
      (where <username> is your Windows username)
      :exclamation: If looking for it with your file manager or command line, note that the AppData folder is hidden by default. On Windows "File Explorer", you can make it visible by opening the "View" menu, then checking the box next to "☐ Hidden items".
  4. In the folder listing of the Arduino IDE installation folder, hold the Shift key while clicking the right hand button on the mouse.
    A context menu will open
  5. Select "Open PowerShell window here" from the menu.
    Windows PowerShell will now open with the current directory set to the Arduino IDE installation folder.
  6. Type the following command:
    & ".\Arduino IDE"
    
  7. Press the Enter key.
    Debug output should now be printed to the PowerShell window as Arduino IDE starts.
  8. Wait until you are sure the IDE startup has gone into the hang state
    (as indicated by no additional output being printed to the terminal).
  9. Switch back to the PowerShell window if the Arduino IDE window took the focus.
  10. Press the Ctrl+Shift+A keyboard shortcut.
    This will select all the text in the PowerShell window.
  11. Press the Ctrl+C keyboard shortcut.
    This will copy the contents of the PowerShell window to the clipboard.
  12. Open a forum reply here by clicking the "Reply" button.
  13. Click the <CODE/> icon on the post composer toolbar.
    This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
  14. Press the Ctrl+V keyboard shortcut.
    This will paste the output into the code block.
  15. Move the cursor outside of the code block markup before you add any additional text to your reply.
  16. Click the "Reply" button to post the output.

Please let me know if you have any questions or problems while following those instructions.

1 Like

IDE 1.x works fine for remote files, IDE 1.x will open and save remote files. Someone should port that 1.x code over to 2.X, or at least take a hard look at how it's been done in 1.x. Sometimes it's better not to re-invent things that work.

I’ve had similar issues with network drives before. It sounds like the IDE might be having trouble properly saving to the NAS. When I had this happen, I found that mapping the drive again and making sure it had the right permissions helped a lot. As for the file opening issue, double-check your file associations and make sure the IDE is looking at the right path. I’ve also had files mysteriously save to random locations, and it turned out to be a setting in the IDE that defaulted to the Libraries folder. You might want to check your save location preferences and reset them to where you want them to be.

As I stated in my opening comment, that windows mapped the drive as shared. My NAS is a dedicated fan less computer running windows 10 pro, I have mapped all four usb drives as shared for my home network. I have been using IDE 1.x because of the file saving and opening problems in IDE 2.x. I have multiple computers that use this remote drive system using IDE 1.x.. I want to use IDE 2.x to program STM projects since IDE 1.x doesn't really support the STM boards and others. So it is important to me to find a way to resolve this issue.

I doubt it would be an efficient way to fix the problem. They are written in two different programming languages and there are very significant architectural differences between the two applications.

But you or any other interested party are welcome to give it a try. I'm sure the developers of the free open source Eclipse Theia IDE framework that provides the sketch opening capability for Arduino IDE 2.x would welcome a high quality pull request that fixes the bug. The bug is tracked in the Eclipse Theia issue tracker here:

There is information about contributing to the Eclipse Theia codebase here:

https://github.com/eclipse-theia/theia/blob/master/CONTRIBUTING.md#pull-requests

When you save the sketch, are you selecting a path under that drive (e.g., X:\MySketch), or are you instead selecting the path under the network location (e.g., \\some-host\MySketch)?

It works fine for me as long as I select the path under the mapped drive when saving and opening sketches.

I found what my issue is: a corrupted "preferences file" the corrupted file was 40k big, my other computers had 4k size files. After replacing the file with one from another computer, things started to work better, still had to re-setup my NAS drive but now IDE 2.x seems to be working now.

Thanks for taking the time to post an update. I'm glad it is working now.

Regards, Per

Found this because I am having the same issue. Saving to networked drive at work results in the IDE restarting, changing the name of the sketch to the default new sketch name and date, and the sketch is blank. Saves fine to the C drive. Tried to copy paste the correctly saved sketch to the networked drive and open it from there, no luck. Brings up a new blank sketch only. I NEED to have this functionality for others to use the sketches I create, so the current workaround is to save the code as a .txt file on the network drive which can then be copy / pasted onto their local computer's IDE.

Hi @rpc1986. Did you map the network drive?:

Make sure you select the mapped path of the drive instead of the network location in the save and open dialogs.

I was starting to trust IDE 2.3.4 then it didn't save a large file to my NAS , now my trust is ZERO in using this IDE 2.3.4 to save on my NAS. I do like some of the other things about 2.3.4 but trusting that the IDE saved my work is a biggie. I don't know for sure but the saving seems to hang a bit before it saves, so closing the app right after you press save could be the reason. IDE 1.18 won't close until it completes the save. The TEAM my feel otherwise thought.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.