No luck on firmware upgrade

394 views
Skip to first unread message

Fitch

unread,
May 27, 2016, 12:44:04 PM5/27/16
to CTC3Dprinters
I've been at this upgrade fiasco for days with no luck.

I have a CTC3D dual extruder (34mm apart)
My OS is Ubuntu 16.04
Using ReplicatorG-Sailfish-40r30

I could press the reset and update button for decades, and still never get it to upgrade

If I open RepG in a terminal: I get:

May 27, 2016 5:23:42 PM replicatorg.machine.MachineThread loadDriver
INFO
: Loading simulator.
May 27, 2016 5:23:42 PM replicatorg.drivers.DriverFactory loadClass
INFO
: Loading driver: replicatorg.drivers.gen3.MightySailfish
May 27, 2016 5:23:42 PM replicatorg.drivers.gen3.MightySailfish <init>
INFO
: Created a MightySailfish
test2
Experimental:  JNI_OnLoad called.
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version   = RXTX-2.1-7
test2
test2
May 27, 2016 5:23:42 PM replicatorg.app.Base loadFile
INFO
: Load file : /home/alistair/Desktop/plastic/dremel cyclone separator.gcode
Java 3D: implicit antialiasing enabled
May 27, 2016 5:23:44 PM replicatorg.app.ui.modeling.PreviewPanel setScene
INFO
: /home/alistair/Desktop/plastic/dremel cyclone separator.stl
test2
May 27, 2016 5:24:54 PM replicatorg.drivers.SerialDriver openSerial
INFO
: Connecting to machine using serial port: /dev/ttyACM0
May 27, 2016 5:24:54 PM replicatorg.drivers.gen3.Sanguino3GDriver getVersionInternal
WARNING
: Motherboard firmware v7.2 ()
RXTX fhs_lock
() Error: creating lock file: /var/lock/LCK..ttyACM0: File exists
RXTX fhs_lock
() Error: creating lock file: /var/lock/LCK..ttyACM0: File exists
/home/alistair/replicatorg-0040r30-Sailfish/tools/avrdude
 
-C/home/alistair/replicatorg-0040r30-Sailfish/tools/avrdude.conf
-cstk500v1 -P/dev/ttyACM0 -b57600 -D
-Uflash:w:/home/alistair/.replicatorg/firmware/ff_creator-Sailfish-v7.7.0-r1432.hex:i
 
-pm1280
/home/alistair/replicatorg-0040r30-Sailfish/tools/avrdude:
error
while loading shared libraries: libusb-0.1.so.4: cannot open
shared
object file: No such file or directory

I have libusb-1.0-0-dev installed.
What am I not doing right?

Gregory Sullivan

unread,
May 27, 2016, 5:32:25 PM5/27/16
to CTC3Dprinters
can you control the bot thru rep g?

also if the board has a c20 installed you should not need/want to press reset

adam paul

unread,
May 28, 2016, 12:08:31 AM5/28/16
to CTC3Dprinters
Ctc has never installed c20, to my knowledge, you will have to press reset. CTC did switch to the 2560 mega recently, I'm assuming that's how they made space for the USB+ debacle, do you should verify visually which chip you have 1280 or 2560.

I have recently flashed a flashforge board using r33 and 14.04lts, so I'm sure you can get this worked out. Can you connect to the bot using the control panel? Your user has permission rights to the dialout group?

adam paul

unread,
May 28, 2016, 12:09:33 AM5/28/16
to CTC3Dprinters
I think it was click ok on the desktop then half second later press button on bot.

Fitch

unread,
May 28, 2016, 9:42:50 AM5/28/16
to CTC3Dprinters
Thank you all for your patience .
Not quite sure what is wrong with my emails, as I don't see any of the replies that I sent back.
I apologise if they are in here somewhere, if not, I will copy them here:

Reply 1:

I have full control and build from the USB.
It still does not upload new firmware with me not pressing reset, although I haven't actually rifled through the innards to find this C20..

It must be the last few lines that are telling me something, but I don't know what to do about it:
 
Reply 2:

It's a 1280 chip.  I eventually found my magnifying glass.

Yes, I have control using the control panel: I can move the bed and steppers quite happily.
But then when I installed RepG, I did do the following:
sudo usermod -a -G tty $USER
sudo usermod -a -G dialout $USER
cd /dev/serial/by-id
sudo chown <me> usb*
sudo chgrp <me> usb*
sudo gpasswd -a <me> dialout
So I think I got that one covered.

Clicking on upload gives the error message immediately (less than half a second, no matter what time I press the reset).

Something must have changed in Ubuntu 16.04 that stops the firmware upload.

I can only add that the green "Machine The Replicator ready" status bar (if I can call it that) instantly goes to red "No connection" after selecting: Firmware upgrade > board select > Firmware version > select serial port.
And I have to close RepG, and then restart it to get connection again. 

adam paul

unread,
May 29, 2016, 12:19:37 AM5/29/16
to CTC3Dprinters
Another possibility is CTC not installing a bootloader, or it has become corrupted. This requires the use of an avr programmer.

Fitch

unread,
May 29, 2016, 5:03:57 AM5/29/16
to ctc3dp...@googlegroups.com
So nothing to do with the last couple of lines?
error while loading shared libraries: libusb-0.1.so.4: cannot open
shared
object file: No such file or directory

I have a Pickit 2.....

Gregory Sullivan

unread,
May 29, 2016, 9:41:23 AM5/29/16
to ctc3dp...@googlegroups.com
I have an mBot board that I could not update the firmware on and if you look over on the 'jetty-firmware' group there is a thread I started looking for help but it requires using and AVR ISP to flash a good bootloader and at the same time the firmware hex file. After putting the correct bootloader on the MCU chip I can now flash it thru repG. I was using windows but the commands themselves are there and should work for any OS once you have the concept clear in your mind. Feel free to post in the thread if you chose to go this way as it would be good to have windows and mac and or linux methods in one place.

I think when they load firmware on some of these boards they are somhow doing bootloader and firmware at the same time and this leaves the lock bit open on the bootloader making things difficult for upgading.... I think avrdude see's this (lock bit bs) and just is not capable of spitting out the correct error codes to the log file.

here is the 1280 bootloader, in the jetty tread I think just the 2560 bootloader is posted....


On Friday, May 27, 2016 at 12:44:04 PM UTC-4, Fitch wrote:

adam paul

unread,
May 29, 2016, 10:01:30 AM5/29/16
to CTC3Dprinters
Also, there is this.....

Optional: remove brltty

Some users have had issues with a Braille program that comes pre-installed in Ubuntu and may conflict with the serial driver. If you run into problems, you can remove the program with this command:
sudo apt-get remove brltty

I couldn't get a connection until I removed the brltty. Although personally at this point I feel it's either a timing issue or a bootloader issue. If you can connect and control the bot through repG control panel, I feel you should be able to flash the firmware.

You could boot from a 14.04 disk as a test?

Fitch

unread,
May 30, 2016, 7:27:38 AM5/30/16
to ctc3dp...@googlegroups.com
Thanks.
I don't have Britty installed, so I'll go straight for the programmer.
It'll probably take a week or two to arrive, but I'll keep you posted.

Although the attachment looks more like an xml page than a hex file...

Gregory Sullivan

unread,
May 30, 2016, 10:24:13 AM5/30/16
to ctc3dp...@googlegroups.com
yea, I bet it is, I'll find the correct one... 

correct one, sorry

old mbi site for more info, one of jetty's post has everything!
ATmegaBOOT_168_atmega1280.hex

Duplicat

unread,
Jun 2, 2016, 12:39:00 AM6/2/16
to CTC3Dprinters

If you still want to give a try,, I had a similar "timing" issue on a FFCX and WD4X with the 1280.  Trick was to wait a full 2 seconds before pressing the reset button.

Fitch

unread,
Jun 2, 2016, 11:10:11 AM6/2/16
to ctc3dp...@googlegroups.com
The problem is, as soon as I press the upgrade button, it immediately says:
-Uflash:w:/home/alistair/.replicatorg/firmware/ff_creator-Sailfish-v7.7.0-r1432.hex:-pm1280
/home/alistair/replicatorg-0040r30-Sailfish/tools/avrdude:
error
while loading shared libraries: libusb-0.1.so.4: cannot open
shared
object file: No such file or directory

I checked the directory and ff_creator-Sailfish-v7.7.0-r1432.hex does exist

I've downloaded the hex file, thanks.  Just have to wait for the programmer, and some instruction on how to do it without bricking my board.
 

Gregory Sullivan

unread,
Jun 2, 2016, 11:23:33 AM6/2/16
to ctc3dp...@googlegroups.com
if it's like windows you need to open the terminal from within the directory

Gregory Sullivan

unread,
Jun 2, 2016, 11:28:42 AM6/2/16
to CTC3Dprinters
look over in the jetty group, you flash the boot loader and make sure the lock bit is set to locked, then flash the firmware hex.  



On Thursday, June 2, 2016 at 11:10:11 AM UTC-4, Fitch wrote:

Fitch

unread,
Jun 2, 2016, 11:32:03 AM6/2/16
to ctc3dp...@googlegroups.com
Will do, as soon as the slow boat from China docks with my programmer onboard.

Daniel Newman

unread,
Jun 2, 2016, 5:46:24 PM6/2/16
to CTC3Dprinters
I can only add that the green "Machine The Replicator ready" status bar (if I can call it that) instantly goes to red "No connection" after selecting: Firmware upgrade > board select > Firmware version > select serial port.
And I have to close RepG, and then restart it to get connection again. 

Well, that's a problem in and of itself: you must not be connected to the printer over USB from RepG when you download firmware.  RepG will fork a process to run avrdude and avrdude needs to connect to the printer over USB.  Since Linux doesn't do device locking by default (and the locks are only advisory anyhow), you can end up with two programs talking at the same time to the printer: one doing temp queries every 5 seconds and the other trying to download firmware....  Not a good mix.

However, your other problem is that the avrdude packaged in RepG no longer runs on your Linux kernel.  I guess if I ever release a new RepG -- 40r34 -- then I'll have to update the avrdude binary.  However, you should be able to "sudo apt-get install avrdude" and thereby install a good, working copy of avrdude and its dependencies. (Indeed, doing that may make the avrdude bundled in your RepG work as well since it appears you are missing the libusb.so shared library.  Installing avrdude with apt-get should install that as well.)

Fitch

unread,
Jun 2, 2016, 8:30:32 PM6/2/16
to CTC3Dprinters
I did a sudo apt-get install avrdude and got:

avrdude is already the newest version (6.2-5).
avrdude set to manually installed.

I've done a:
sudo add-apt-repository ppa:pmjdebruijn/avrdude-release

and an update/upgrade, but no later version came up.

Daniel Newman

unread,
Jun 2, 2016, 9:17:29 PM6/2/16
to CTC3Dprinters
Now try running *that* version of avrdude and not the one which shipped with RepG.  In your posting above, you indicate that you ran the one supplied with RepG,

Fitch

unread,
Jun 3, 2016, 8:00:22 AM6/3/16
to ctc3dp...@googlegroups.com
The only way I could figure out how to do that is to copy the installed avrdude from /usr/bin to the sailfish /tools directory.

I don't get the problem of no libusb, but it now complains of a syntax error.

/home/alistair/replicatorg-0040r30-Sailfish/tools/avrdude -C/home/alistair/replicatorg-0040r30-Sailfish/tools/avrdude.conf -cstk500v1 -P/dev/ttyACM0 -b57600 -D -Uflash:w:/home/alistair/.replicatorg/firmware/mighty_twox-Sailfish-v7.7.0-r1432.hex:i -pm1280
avrdude
: error at /home/alistair/replicatorg-0040r30-Sailfish/tools/avrdude.conf:313: programmer type must be written as "id_type"
avrdude
: error reading system wide configuration file "/home/alistair/replicatorg-0040r30-Sailfish/tools/avrdude.conf"

Lines 310 to 314 in the config file:
programmer
  id    
= "avrisp";
  desc  
= "Atmel AVR ISP";
  type  
= stk500;
;

So I take it that I have to alter "id to "id_type" using a global search and replace as there are hundreds of the little buggers..

Maybe if someone could tell me how I really should be getting Replicator to use the correct avrdude...

Sorry for being thick.


Daniel Newman

unread,
Jun 3, 2016, 10:23:37 AM6/3/16
to CTC3Dprinters


On Friday, June 3, 2016 at 5:00:22 AM UTC-7, Fitch wrote:
The only way I could figure out how to do that is to copy the installed avrdude from /usr/bin to the sailfish /tools directory.

No, you would manually run the avrdude yourself from a term window rather than try to have RepG run avrdude.  If you want to have RepG run the new avrdude then you have to provide for avrdude all the pieces it needs (e.g., new avrdude binary, new avrdude.conf file, etc.).

adam paul

unread,
Jun 3, 2016, 5:38:33 PM6/3/16
to CTC3Dprinters
Im sorry that I cant just tell you what to type into the term window.  I have only recently switched to ubuntu and and still quite illiterate.  Microsoft pissed me off with the whole windows 10 debacle that I made the switch.  I had my win 7 backup on a separate disk partition get wiped during the 10 install.  Quite frustrating.  Win 10 didn't even absorb the now empty partition, just left 1/3 of my hard drive with a clean empty useless partition.  F U microsoft.

Gregory Sullivan

unread,
Jun 3, 2016, 10:24:03 PM6/3/16
to CTC3Dprinters
always always run an off-machine backup... I picked up a 2014 hp pavilion dv7 with native dual 250gb SSD, ATI GPU that solidworks and turbo cad and premiere like for 360 USD on eBay w7 64. do not blame ms, they have been this way since dos 6 /win 3.11. you could also take your DVD out and put a 2nd SSD there.I get 80gb sys clones @ 455mbs - or about 12 mins total

also get GParted live on a USB stick and aomei backup (stick also). plenty of free torrents out there!

Fitch

unread,
Jun 4, 2016, 8:27:22 AM6/4/16
to ctc3dp...@googlegroups.com
Windows v Linux aside,  I copied the avrdude command at the bottom of the code in post 1 and pasted it straight into a terminal.
I got the same problem with the syntax error in the config file, so I removed the -C part and tried again.
The result:
alistair@Main:~$ avrdude -c stk500v1 -P/dev/ttyACM0 -b57600 -D -Uflash:w:/home/alistair/.replicatorg/firmware/ff_creator-Sailfish-v7.7.0-r1432.hex:i  -pm1280
avrdude
: stk500_recv(): programmer is not responding
avrdude
: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude
: stk500_recv(): programmer is not responding
avrdude
: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude
: stk500_recv(): programmer is not responding
avrdude
: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude
: stk500_recv(): programmer is not responding
avrdude
: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude
: stk500_recv(): programmer is not responding
avrdude
: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude
: stk500_recv(): programmer is not responding
avrdude
: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude
: stk500_recv(): programmer is not responding
avrdude
: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude
: stk500_recv(): programmer is not responding
avrdude
: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude
: stk500_recv(): programmer is not responding
avrdude
: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude
: stk500_recv(): programmer is not responding
avrdude
: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00

avrdude
done.  Thank you.

So what is an stk500?  Do I actually have one?  I thought the idea was flashing through the USB..

However, I can't deny that it's a step forward...

My programmer arrived today.  It's still in its bubble wrap for the moment.



Fitch

unread,
Jun 4, 2016, 8:50:04 AM6/4/16
to ctc3dp...@googlegroups.com
AHA!!

O.K. a couple of things...

1.  I forgot to press the reset button, resulting in the previous output.
2.  When I did it again, (pressing the reset button) I kept pressing the button as it was going through it's 10 attempts.

This is very handy, allowing the poor punter several goes before it times out.
On it's 6th attempt it did it.
Motherboard firmware reports 7.7.
Happy bunny.
AVR Programmer for sale.
Thanks all.

And yes, I got fed up with Windoze and banished it in 2009.  Never looked back.

Now, does anyone know how I can tell Replicator to not to use it's own avrdude?
Could anyone who has a working config file paste it here so I can correct my own one?

Gregory Sullivan

unread,
Jun 4, 2016, 11:10:44 AM6/4/16
to CTC3Dprinters
:D 
Reply all
Reply to author
Forward
0 new messages