Go Down

Topic: Recover an .ino file (Read 193 times) previous topic - next topic

RodMoody

Yesterday I made big changes to my .ino file, this compiled and uploaded to the board successfully.
Today, on restarting my computer I find that the .ino file is the previous unchanged version, so seemingly the IDE failed to save the changes when I uploaded. Is the any hope of recovering the latest .ino file, could it have been saved in some obscure location?

Ballscrewbob

That depends on what setting you have in the preferences file.

If you have it set for save and verify and did not change the file name then it changed your original to the one you say is bad.

If you dont have save and verify then the original should be intact

Its a lesson we all learned mostly the hard way..
I always add V1, V2 etc at the end of any changed sketch and add WORKING COPY if its one I dont want to change
It may not be the answer you were looking for but its the one I am giving based on either experience, educated guess, google or the fact that you gave nothing to go with in the first place so I used my wonky crystal ball.

DrAzzy

 
Its a lesson we all learned mostly the hard way..
I always add V1, V2 etc at the end of any changed sketch and add WORKING COPY if its one I dont want to change

Why not just use github or other source control tool?
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

Ballscrewbob

Github is a learning curve for a lot of people and certainly not so easy when you have your first ever encounter with programming and just want to run before you can walk.
That said...

Once people realise all the best libs are on GH and settle into programming Arduinos (or other things) it becomes more natural.

For some like me I just became more used to doing versions OFF web.

It may not be the answer you were looking for but its the one I am giving based on either experience, educated guess, google or the fact that you gave nothing to go with in the first place so I used my wonky crystal ball.

pert

could it have been saved in some obscure location?
Which version of the Arduino IDE are you using?

For some like me I just became more used to doing versions OFF web.
You can use git or GitHub desktop with repositories stored on your computer. There's no need to upload them to the GitHub site if you don't want to. I agree that expecting the average Arduino beginner to also take on learning how to use a source control tool will probably be counterproductive but once you get to your level it's so worth the effort.

jts33

I don't think that you lost the changed sketch as Arduino IDE always save the last sketch as default. Can you go to File -> Preferences and look at whether "Save when verifying or uploading" is tick or not. If it's tick (as default), your changed sketch could be somewhere, try finding it gain. Good luck

RodMoody

Wow, this is my first time on this forum, and I'm well impressed with all the responses, my sincere thanks to all who responded. As it turns out I found the solution to the problem myself:- The Arduino IDE had saved my source.ino file exactly as it should. The problem was that I had run a System Restore and that restored my source.ino file back to its state when the restore point was set. I proved this resolved the problem by undoing the System Restore, retrieving my latest version of source.ino, saving it to an external driven, re-invoked the System Restore (I needed to do this for other unrelated reasons) and then copied my source.ino file from the external drive back to its place on the PC. What amazes me is that System Restore would mess with my source.ino file. It's "my data" and has nothing to do with the Windows operating system. Even if it was compiled it could not be executed by Windows! I'm using Windows 10 and my sourse.ino is held in a subfolder of Documents, Arduino IDE is 1.6.6.

threegreens

I have just had exactly the same problem with Win7.  Somehow .ino files are seen as system files.

Fortunately, I found a good tip somewhere else on this forum that saved me a lot of work:

Went to the %temp% folder and found the temporary cpp file created during the last compilation, still intact. I opened it with Wordpad and was able to copy/paste my latest changes into the obsolete .ino file.

I hope this helps.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy