Welcome! Log In Create A New Profile

Advanced

firmware backup

Posted by isacat 
firmware backup
April 21, 2016 02:56AM
Hi all, I purchase a second hand Prusa I3 printer.

Now I want to fine tune it, like adding auto leveling on 4 points instead of one in the middle now.
For this I need to redo the firmware from scratch because I don't have the configuration.h file, and I don't know the manufacturer of this printer.
I searched the internet and I find this command line "avrdude -p m644p -P com4 -c arduino -b 38400 -F -U flash:r:factory_gen5.hex:i"
Now my question:
1. in this command you see -p m644p this is the partno parameter, how can I find the one that my printer is using?
2. also in the command you see -c arduino this is the programmer id, how can I find the one that my printer is using?

hopefully someone can help me out here to make a backup of the working marlin firmware.
Re: firmware backup
April 21, 2016 03:23AM
-p m644p is the processor

You should be able to see this number on the main chip

it could be a 644p or 1284p or 2560 (or a few others)

Sadly you didn’t post a image of the controller, but it looks like it may be a ramps, so it will most likely be a 2560 on the lower board

Also note that these printers have eeproms, you may want to dump that also, at the very least send a m503 to the printer and capture the settings

-c arduino is your only option as other options require 3rd party avr isp programmer boards (EDIT: oops forgot about stk500v2, also boot loader based)

See page 9 of [www.cs.ou.edu]
Though it doesn’t mention arduino only hardware programmers

NB you cant extract thermistor types from anywhere... you just need to know what that is... If your lucky its a type 1. New firmware will read incorrect temperatures with wrong settings

Edited 5 time(s). Last edit at 04/21/2016 04:49AM by Dust.
Re: firmware backup
April 21, 2016 03:55AM
@Dust, thanks for your fast answer

I have this picture on my smartphone of the ramp
My printer is using a Adruino Mega 2560
My com port is 3 and BaudRate is 250000
So if I can follow your advise I need to enter " avrdude -p m2560 -P com3 -c arduino -b 250000 -F -U flash:r:factory_gen5.hex:i "
is that correct?
Re: firmware backup
April 21, 2016 04:45AM
That is defiantly a ramps, which is good (ie its not some unknown random board)

I suspect the baud rate is the baud rate of the boot loader witch is independent of the reprap firmware ie it will be 115200

also the boot loader is probably -c stk500v2

so try "avrdude -p m2560 -P com3 -c stk500v2 -b 115200 -F -U flash:r:factory_gen5.hex:i"

the earlier processors such as the 644p and the 1280 used -c arduino

Edited 1 time(s). Last edit at 04/21/2016 04:47AM by Dust.
Re: firmware backup
April 21, 2016 05:16AM
Ok, but when I need to connect to the printer via pronterface I have to enter COM3 and 250000 baud rate
So do I need to enter 115200 or do I use 250000 instead?

Yesterday I did my first test and see here the result

the first command I enter " arduino " and get message " not in sync: resp=0x73
the second command I enter " stk500v2 " like you suggest and I received this message " timeout "
I cannot test it now because I am at work for the moment ;-)

What is the locating where the file will be saved?

@Dust, I really appreciate your help
Re: firmware backup
April 21, 2016 05:31AM
If I read the errors correct, message ("not in sync" and "timeout") is because of the baud rate of 250000. So I would try the 115200 like [Dust] proposed.

Edited 1 time(s). Last edit at 04/21/2016 05:31AM by Frans@France.
Re: firmware backup
April 21, 2016 05:39AM
you should specify a full path where you want to save it. (will probably write to same directory you run avrdude from otherwise)

eg -U flash:r:C:\users\example_user\Desktop\prusa.hex:i

Edited 2 time(s). Last edit at 04/21/2016 05:42AM by Dust.
Re: firmware backup
April 21, 2016 05:52AM
I had this problem when I bought a second hand i3 too. Whilst you could possibly copy the machine's memory i.e. the hex file I am not sure how much use this is. You cannot, as far as I understand, decompile it, so you cannot do anything useful with it, except restore the machine to its default supplied state - which is often far from the level of tune you might achieve if you start tinkering with it. Its okay if it works perfectly when you get it - but no 3d printer works perfectly.

This is easy to say with hindsight but - when you buy a 3d printer especially second hand, there are two things that have to come with it.
1) the STL files for the printed parts (less relevant if it has few/no printed parts) but without them you have no base files to begin with and there are so many variants and versions of so many printers its the minimum a printer builder/manufacturer can do to help you.
2) The un-compiled firmware i.e. the Marlin folder with the configuration.h configuration_adv.h and any other custom config files, that were uploaded to the printer. Then you essentially have a "backup" that you can adjust, recompile and upload when you need to. Or upgrade to a newer version and know what the settings are you need to move across.

Go back to whoever you bought it form and ask for these things, they only have to email them to you.

That being said when I bought my i3 second hand nearly a year ago, it had none of this and I had to work it all out from scratch. Which is good as I had to learn a lot of stuff. Now the prospect of starting with an unknown machine and configuring it is not so daunting.


Simon Khoury

Co-founder of [www.precisionpiezo.co.uk] Accurate, repeatable, versatile Z-Probes
Published:Inventions
Re: firmware backup
April 21, 2016 07:11AM
Quote
DjDemonD
That being said when I bought my i3 second hand nearly a year ago, it had none of this and I had to work it all out from scratch. Which is good as I had to learn a lot of stuff. Now the prospect of starting with an unknown machine and configuring it is not so daunting.

I have the same situation, the guy who sold me the printer doesn't have any information or even the configuration.h file, he even didn't know the manufacturer :-(.
So I also need to start from scratch.

@DjDemonD what is your advice to me to start from scratch without any info or knowledge? how did you start?, did you use a kind of manual explaining all the entries you need to change that are mandatory?
Quote
Dust
NB you can’t extract thermistor types from anywhere... you just need to know what that is... If you’re lucky it’s a type 1. New firmware will read incorrect temperatures with wrong settings
Like Dust already explained here, I don't know the thermistors, how did you find out?
Re: firmware backup
April 21, 2016 08:26AM
You test everything from first principles. Get the latest stable release of marlin. Go through the config line by line. Some of it you can leave some needs changing. Thermistors try each thermistor table and see which one gets you closest to the correct temperature. Or buy a new thermistor or two, they're pennies.

Its a slow process but I'd say having bought a ready made machine with nothing with it like yours, then bought a ready made machine with everything properly supplied and having bought a kit and built it, the first machine taught me the most.

Reprap wiki is good, if not always completely up to date. Watch Tom Sanladerer's videos on YouTube he cover some basics.


Simon Khoury

Co-founder of [www.precisionpiezo.co.uk] Accurate, repeatable, versatile Z-Probes
Published:Inventions
Re: firmware backup
April 21, 2016 01:52PM
I try the command line like [Dust] proposed " avrdude -p m2560 -P com3 -c stk500v2 -b 115200 -F -U flash:r:factory_gen5.hex:i " I get a time out messages.
If I connect with Pronterface with baud rate 115200 is not working, 256000 it connects.
Changed the baud rate to 256000 in the command line like " avrdude -p m2560 -P com3 -c stk500v2 -b 256000 -F -U flash:r:factory_gen5.hex:i " I get the same result "time out"
any suggestions?
Re: firmware backup
April 21, 2016 03:23PM
It works !!!
I searched the forum I found this topic link
there [RNJ] explaned " 2. now hold the reset button on the mega board and release it simultaneously with executing the avrdude command line (else you will get a timeout error) "
So I removed the arduino from the ramps so I can press the reset button.
Then I started the command line and ...

So I have a backup and I can start to reprogram my adruino with the latest Marlin firmware
Re: firmware backup
April 21, 2016 05:42PM
You shouldn't have to do that.... the computer can reset the mega by toggling the virtual DTR serial line.
But they might have disabled this...

Regardless of that well done.
Re: firmware backup
April 22, 2016 02:12AM
Quote
Dust
You shouldn't have to do that.... the computer can reset the mega by toggling the virtual DTR serial line.
But they might have disabled this...

Regardless of that well done.

This file is only about 700k large, is this normal?
now I want upgrade marlin and configure it from scratch, if I mess it up I want to restore from that file, will this work with the new firmware?
Thx Dust but it's because your help that I succeed to create a backup thumbs up
Re: firmware backup
April 22, 2016 03:54AM
I know this seems very important to you right now, but if I can be honest you're wasting your time. You would be better off spending it configuring a new version of marlin for your printer.

The hex file is normally around 130Kb.

Seriously even if you manage to back it up the backup will have almost no value unless the printer in its current state is working perfectly, in which case you don't need to change anything. Just enjoy printing some stuff. If its not working very well or you bought it to tinker and adjust then the default config (which you can't get from your backup) is useful but will be quickly made obsolete as you change things.

You'd be better off buying another arduino they cost about £7, and putting the original aside as the backup.


Simon Khoury

Co-founder of [www.precisionpiezo.co.uk] Accurate, repeatable, versatile Z-Probes
Published:Inventions
Re: firmware backup
April 22, 2016 03:57AM
The mega2560 has 256k of flash rom, convert that to ASCII + formatting, 700k sounds good

Don't forget to dump the eeprom also eg avrdude -p m2560 -P com3 -c stk500v2 -b 115200 -F -U eeprom:r:dump.hex:i


The way you created this backup is via the boot loader, you can't overwrite or damage the bootloader without a AVR ISP programmer hardware (its locked down at a hardware level)
Ie you will always be able to restore it.

nb you can verify your backup if you want.

avrdude -p m2560 -P com3 -c stk500v2 -b 115200 -F -U eeprom:v:flash.hex:i

Edited 2 time(s). Last edit at 04/22/2016 04:07AM by Dust.
Re: firmware backup
April 22, 2016 06:59AM
Quote
DjDemonD

You'd be better off buying another arduino they cost about £7, and putting the original aside as the backup.
Yes that's a very good idea and maybe the best solution for me in case I screw up.

I found on this website the firmware for their model, they use also a arduino Mega 2560 + ramps. Prusa I3 rework 1.5
The guy who sold me the printer told me that it was a Prusa I3 rework 1.5 . but I am not sure if this is correct.
Can I use the firmware from there website? is there any arm if I try it?

@DjDemonD @Dust Guys, I really appreciate your help and time in helping me with my questions thumbs upthumbs upthumbs up
Re: firmware backup
April 22, 2016 07:10AM
You're welcome I was a noob not long ago. It's better to spend time understanding things and its a steep learning curve. I wasnt trying to be negative earlier but the time spent doing this backup which will have little value is better spent messing with marlin settings and seeing what happens.


Simon Khoury

Co-founder of [www.precisionpiezo.co.uk] Accurate, repeatable, versatile Z-Probes
Published:Inventions
Re: firmware backup
April 22, 2016 07:26AM
As for which printer this is the 1.5 rework: [www.thingiverse.com] it's mainly tr8 leadscrews rather than m5 or m8 threaded rods.

The rework was using 10mm threaded rods not 8mm.

If you want my config, mine is a 1.5 rework then you're welcome. You'll need to change some things which I can highlight for you and some other things which you'll have to work out.

Im not at home but maybe later on today.


Simon Khoury

Co-founder of [www.precisionpiezo.co.uk] Accurate, repeatable, versatile Z-Probes
Published:Inventions
Re: firmware backup
April 22, 2016 07:55AM
Yes please,
That will really help me further, thanks a lot.
This evening I will check what threaded rods my printer has.
The reason why I want to upgrade my firmware is because the auto leveling, now it check only in the middle (one point). I want to change it to 9point or 5 because my print bed is not leveled.
Re: firmware backup
April 22, 2016 07:59AM
Okay this next bit is important. Put springs between the heated bed and the y carriage under it. Set the level of the bed physically by adjusting the screws at each of the four corners. Auto levelling is useful but just for fine tuning. I spent a lot of time trying to get auto levelling to work before deciding to do it properly. It's not that hard and it works.


Simon Khoury

Co-founder of [www.precisionpiezo.co.uk] Accurate, repeatable, versatile Z-Probes
Published:Inventions
Re: firmware backup
April 22, 2016 08:20AM
the springs were already on my checklist :-) like also a new extruder (E3Dv6)
for the auto leveling I found this YouTube video, it's very well explained.
Re: firmware backup
April 22, 2016 08:22AM
Yeah that's good also try Tom's guide to auto bed levelling on YouTube.


Simon Khoury

Co-founder of [www.precisionpiezo.co.uk] Accurate, repeatable, versatile Z-Probes
Published:Inventions
Re: firmware backup
April 22, 2016 08:31AM
first things first, need to replace the arduino and install the latest marlin firmware
configure the configuration.h file with your config will be a big challenge
but yeah, this noob need to learn also ;-)
Re: firmware backup
April 22, 2016 03:34PM
Okay my version of Marlin configured for the i3 rework, [onedrive.live.com]

Let me know when you've downloaded it I'll delete it.

Sections you are going to definitely want to check/edit.

-Thermistors
-Endstop logic (true/false - depends on whether endstops are normally open or normally closed) Use m119 from within a host such as pronterface to get a reading on the endstops and if they're wrong change the settings here.
-Stepper direction should be okay but if an axis moves the wrong way change these settings.
-Homing direction depends on which end of your axes the endstops are, generally z homes -1, but x and y might be the opposite setting. My x endstop is to the right i.e. max, my y endstop is at the back i.e. min.
-Travel limits (also called software endstops) ought to be set to allow your nozzle the widest travel around the bed, without running the risk of hitting anything. after homing move the nozzle around using the host and work out the coordinates you can move around safely. The coordinates are on your lcd display.
-Bed levelling grid points are a bit of a pain but try some different values by doing g28 home all, then g29 autolevel. You have to keep your probe over the print bed, it is offset from the nozzle.
-Probe offset - set the values in mm for the relative position of the nozzle relative to the probe trigger point. X and Y are easy just measure it. Z is a bit trickier. You can physically move your probe up and down using the large nuts that hold it to its bracket, so that when you do g28 (or do home z once x and y are homed) the nozzle stops between 1-3mm above the bed. If its a lot outside this move the probe up and down and try again. Keep one hand on the power switch you might crash the nozzle into the bed, kill the power quickly if you do. Once you've got a decent position, home all. Then send g92 z10, this tells the firmware you are 10mm higher than you really are. Now put a piece of paper under the clean nozzle and lower in 0.1mm increments until you grip the paper. Count how many mm you went down. This is your z_offset_from_probe and is a negative number - so maybe -1.5mm or something like that.
-default axis steps per unit. x and y will almost certainly be 80 as this relates to having 20 tooth sprockets and using a gt2 belt. But use triffid hunters guide [www.google.co.uk] to get these values. Z depends on your m8 threaded rod/leadscrew.

The rest should be okay.
Don't worry if it all seems like a lot to do once youve done this a few times youll know what all of it means.


Simon Khoury

Co-founder of [www.precisionpiezo.co.uk] Accurate, repeatable, versatile Z-Probes
Published:Inventions
Re: firmware backup
April 23, 2016 02:10AM
OK, I have downloaded the file, thx
It's indeed a lot to change but I was expecting it ;-)
now I am waiting for my order with the adruino and the springs. I also ordered a thermistor, it was only 3€ and then I am sure what model I have.
in the mean time I can work on the file thumbs up
Sorry, only registered users may post in this forum.

Click here to login