Burn Bootloader or Upload Marlin for Anet

Anet A6 with Marlin 2.0

I've recently purchased Anet A6 - a very cheap 3D printer which I paid for with my time.

Some months ago when I ordered an Anet A6 from Aliexpress. There were some issues, but finally the seller managed to send me exactly this model - Anet A6L as it's stated.

There are some differences from the regular Anet A6 which I did non realized at commencement sight.

Mainly this exact printer is equipped with a Star 5-button LCD (constitute in Anet A8) instead of the fancy rotating button with larger screen. I think this particular printer is kind of hybrid of Anet A6 and Anet A8. But I'yard fine with that as long as it works.

5-button star LCD display

I have no previous experience with 3D printers and a very very footling feel with microchips (like Arduino). All the same, I'm quite experienced with college level programming and a like these kinds of challenges.

Car leveling

The L in Anet A6L stands for leveling. A ROKO SN04-N sensor was included, which is an induction sensor. Consecration sensors detect metallic, therefore information technology is not possible to print e.k. on a glass sheet.

ROKO SN04-N induction probe

The sensor is fastened to the main board instead of the Z-stop. Fix it just in the lowest position possible. Later on you can determine the NOZZLE_TO_PROBE_OFFSET post-obit this procedure:

  1. Set up NOZZLE_TO_PROBE_OFFSET to 0 (the Z axis).
  2. Domicile Z axis. Printer volition say Z=0.
  3. Move manually the Z axis as low to the bed as possible until a sheet of paper will be "pinned" with the nozzle. You may demand to disable Soft stops (to make the nozzle movement beneath 0).
  4. Take electric current Z value a get in negative - that is you Z NOZZLE_TO_PROBE_OFFSET (for example mine is -0.25)

Mount the sensor as low as possible

Original firmware

The first printed boxes were fine and I was quite happy. Merely I noticed The original firmware was insufficient at all. Due to the presence of a fan on the left side of extruder the printer could't domicile Ten axis correctly. As a issue centering the nozzle did not actually motion the nozzle to the middle of heat bed but near 4 cm to right. This ways information technology was not possible to print full-sized (22x22 cm) objects.

Furthermore the original firmware does not back up auto-leveling and is quite basic after all.

I have back the original firmware up when burning new bootloader, information technology is available here.

Marlin firmware

I decided to flash better firmware. I've found printing community somewhat recommends Marlin customs.

The procedure seemed to be easy - download Marlin sources, include Anet A6 related config, compile in Arduino IDE, flash and you're ready.

Well... it was not.

Bootloader

Subsequently some hours of trial and error when I was unable to flash the firmware via Arduino IDE (avrdude sync mistake 0x00) I've learned in that location should exist a tiny piece of that program chosen bootloader, which purpose is to permit flashing firmware via USB (from eastward.g. Arduino IDE). And information technology is very likely that since Anet v1.5 chief lath this bootloader is missing (to save some retention). Since my main board says Anet v1.7 I was convinced my board is missing bootloader and needs to be burned first.

Anet v1.7 mainboard

There are plenty of guides how to burn bootloader using Arduino. Unfortunately I don't ain Arduino. However, I have an ESP32 and a Raspberry.

Long story short, the key words to google are raspberry as avr isp (in-arrangement programmer). Although I've plant a guide how to plow my ESP32 into an AVR ISP, I did not succeed connecting ESP32 to the printer. I suppose it is possible, but I was missing experiences. If you wanted to give your ESP32 a try, go along in heed that you lot don't want to connect ability wires (ESP uses 3.5 V while Anet is on five V), but yous want to connect the basis.

My idea was to utilize Raspberry as AVR programmer, connect to it via SSH and perform all operations via CLI tools. I did it this manner:

Connecting wires

Connect Raspberry pins with Anet J3 pins as follows:

Anet J3 pivot Raspberry GPIO pin
MISO GPIO xvi
SCK GPIO 21
RESET GPIO 12
MOSI GPIO xx
GND Footing

All the Raspberry pins are the lesser right pins. You don't have to connect ability (VCC <-> 5V power), it'south enough just to power on the printer.

Anet J3 pinout Raspberry Pi pinout

Installing Avrdude

This office is done on Raspberry. I was using SSH connection. Following this guide you will build and install avrdude with linuxgpio support:

sudo apt-get install bison flex libusb-dev              cd              /tmp wget http://download.savannah.gnu.org/releases/avrdude/avrdude-6.iii.tar.gz tar xf avrdude-6.1.tar.gz              cd              avrdude-vi.1 ./configure --prefix=/opt/avrdude --enable-linuxgpio make sudo make install

Information technology is possible that the latest Raspbian avrdude already supports linuxgpio, you can requite it a try.

Specify the linuxgpio developer for avrdude somewhere at the end of /opt/avrdude/etc/avrdude.conf:

              programmer   id    = "linuxgpio";   desc  = "Use the Linux sysfs interface to bitbang GPIO lines";   blazon  = "linuxgpio";   reset = 12;   sck   = 21;   mosi  = xx;   miso  = 16; ;                          

Backing current firmware upwards

Make sure the processor on your Anet board says it's ATMEGA 1284P. If not, you have to adapt all time to come commands.

Salvage your current firmware into anet-a6-original.hex:

              sudo /opt/avrdude/bin/avrdude -p atmega1284p -c linuxgpio -v -U flash:r:anet-a6-original.hex:i                          

Burning bootloader

Following the guide of Marlin firmware competitor Klipper we first download Optiboot, which is retentivity-optimised bootloader allowing more program infinite (thus more Marlin features to be enabled).

Then we will lock some parts of retentiveness. This pace is crucial since after on Ardiuno IDE was overwriting bootloader with firmware. Symptoms of overridden bootloader were printer unable to first when powering on (I had to press the hardware reset button multiple times, then it started) and mainly impossibility of flashing new firmware through Arduino IDE multiple times. I had to re-burn bootloader every time through Raspberry before flashing firmware which was very annoying.

Finally nosotros'll burn down the bootloader and over again.. lock something. I don't really know what, but it just works.

              cd /opt/avrdude/bin/  wget 'https://raw.githubusercontent.com/Lauszus/Sanguino/master/bootloaders/optiboot/optiboot_atmega1284p.hex'  sudo ./avrdude -p atmega1284p -c linuxgpio -five -due east -u -U lock:due west:0x3F:chiliad -U efuse:w:0xFD:thou -U hfuse:w:0xDE:yard -U lfuse:westward:0xFF:m sudo ./avrdude -p atmega1284p -c linuxgpio -v -U flash:westward:optiboot_atmega1284p.hex:i sudo ./avrdude -p atmega1284p -c linuxgpio -v -U lock:due west:0x0F:m                          

At this point Anet display is probably freezed and unresponsive. When you unplug and plug power in once again, you'll probably run across empty display. So far so proficient.

Flashing Marlin 2.0

It looks similar the aren't many people who successfully flashed Marlin 2.0 to Anet A6. I don't actually know why. Once you have the bootloader, flashing Marlin is easy.

First you lot will demand to download Arduino IDE.

Then you lot must import Anet A6 board definition. Merely follow instructions from SkyNet3D. SkyNet3D is an quondam fork of Marlin ane from ages when Marlin did non support Anet A6 and A8 printers. Currently Marlin (both one.ten and 2.0) supports Anet out of the box. Even so, the board definitions must exist downloaded from SkyNet3D.

Install U8glib library into Arduino IDE via Sketch -> Include library -> Manage libraries.

Download Marlin ii.0 firmware from official website and follow installation guide.

Use my fastened configuration for my specific Anet A6 or go with the recommended configuration for Anet A6. Every bit mentioned in the introduction, my Anet A6 has older display which must be enabled in the config file. I have also enabled motorcar bed leveling and set up offsets of the probe (induction sensor).

In Arduino IDE select Anet V1.0 (Optiboot) nether Tools -> Board and AVRISP mkII equally Programmer. Hit the Verify button. If everything is right, you can connect Anet to your computer via USB and striking Upload.

You lot may get a text overflow error during verification. This means you lot've enabled to many features which can't fit into the memory. Yous must comment some features.

After uploading the firmware printer should boot automatically.

Final steps

You may run into EEPROM init error. This can be solved either right in the printer's menu (Configuration -> Initialize EEPROM) or by sending commands M502 M500 M501 using e.g. Printrun and restarting the printer in both cases.

Actually, sending the 3 commands M502 M500 M501 is recommended after each firmware flashing to correctly load changes in compiled firmware.

dorseyvatread.blogspot.com

Source: https://github.com/harakiwi1/Anet-A6L-with-Marlin-2.0

0 Response to "Burn Bootloader or Upload Marlin for Anet"

Enregistrer un commentaire

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel