Preamble
I've wanted to implement auto bed leveling for my Anet A8 (V1.5 board) because the manual bed leveling with a piece of paper every time is getting really monotonous and is the main reason I don't print much as I would otherwise. Despite what some people say, I need to level my bed every time or my first layer peels off and I get mad.
Another reason I would like to upgrade to Marlin is because my Octoprint says it lacks a thermal runway (no way to detect the hothead thermistor as fallen out and will keep raising temperature regardless until possible fire) So uploading to Marlin would allow me to enable thermal runway protection and utilize the induction sensor I have mounted to the lower x-axis bearing with a mounted I've modeled in Autodesk Fusion 360.
The Problem
I've done a fair amount of research into this. I purchased a USBasp back in 2014 for flashing firmware to drone, so I dug it out to use to flash the Anet A8. I looked at the schematic of the J3 header and modified to wiring of my USBasp so the inner 6 pins line up with VCC, MOSI, GND, MISO, SCK, and RESET and the outer 4 pins are not connected. I installed the USBasp driver from USBasp - USB programmer for Atmel AVR controllers - fischl.de and used Zadig to replace the driver with the WinUSB driver as instructed by some sources.
Next, I downloaded the latest version of Marlin (2.0.5.3 at the time of writing) and the Anet A8 board definitions from GitHub - SkyNet3D/anet-board: This is a board definition which works in Arduino IDE 1.8.x for Anet Board targets. and put them in the Documents/Arduino directory as required. Next I downloaded the Marlin configuration examples and copied the contents of the Anet A8 sub folder into the Marlin subfolder of the downloaded Marlin 2.0.5.3 firmware and overwrote the existing files.
As recommended by a YouTube video (Anet A8 Marlin Firmware 1.1.9 Upgrade. Comprehensive guide. - YouTube), I attempted to upload the the Marlin firmware straight away by uploading (failure would indicate no bootloader he suggests), and of course, it failed for a myriad of reasons that I cannot remember. One I can remember was "file path or extension to long" regarding the AVRdude executable. I looked around online for this but there was little information about it, some suggest moving the file to C:\TEMP to shorten the file path. I did not much success. For each error I solved, there was another to popup. Ultimately, I gave up on Marlin 2.x and downloaded Marlin 1.19 (Note I also tried Visual Studio Code with PlatformIO and Auto Build Marlin extensions that looked promised and then...as usual...failure. Note: I also used old versions of Arduino IDE (1.8.5) as recommended by the YouTube video said.
Marlin 1.19
With Marlin 1.19 I nearly had success. Obviously from the blank screen of my Anet A8, I had corrupted the bootloader, so I used my USBasp connected to J3 to burn the (optiboot) bootloader to the Anet A8 which appeared to work fine according to the AVRdude comments.
Then using a USB cable, I attempted to upload Marlin 1.19, but not surprisingly I got an error to do with Interrupts or something. I looked it up and saw some say to comment out this line from Configuration.h file and it will work fine. I did this and true, it solved it. Because of the failure, I had to keep re-burning the bootloader, every failure (I won't mention this every time). When uploading Marlin 1.19 after this I it look like it is working. I see Writing ####################### Reading ########################... then once again failure "Selected serial port does not exist or device not connected" (Sigh). Not sure what this means, it is connected. (Note the COM port selected is correct)
Note I have tried uploading the firmware through the USBasp with "Upload with Programmer" but I get the exact same results and will end up have to reburn the bootloader. I can't find anything useful online about "Selected serial port does not exist of device is not connect". My electronics lecturer which does similar things in his spare time suggested trying to try and upload a simple blink script to the Anet A8 AtMega AVR chip to see if it is possible to even upload and to tell whether it is a Marlin code issue or not. I managed to upload this simple script and using the LED_BUILT_IN constant, I could make the ANET A8 board blink its LED at different rates.
Going back to upload Marlin 1.19 I get the same Serial Port Error!
8th April 2020
I have attempted to used the 1.9.0 BETA version of the Arduino IDE and get the error "file path or extension too long". I found that to fix this you have to insert the line "build.path="C:\Temp" in the Arduino preferences .txt file while the IDE is closed. This fixed that problem but created yet another problem. Now I get the error:
avrdude: input file C:\Temp/Marlin.ino.hex contains 108612 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 56.28s
avrdude: verifying ...
An error occurred while uploading the sketch
avrdude: verification error, first mismatch at byte 0x0000
0x00 != 0x0c
avrdude: verification error; content mismatch
avrdude done. Thank you.
I looked this up but there is too many suggestions, such as uninstalling every other trace of any other version of Arduino IDE, etc. But no luck! I think it looks as if I'm going to have to buy a new Anet A8 board to at least have a working printer.
This is where I have reached the (I need help stage, to unbrick my Anet A8 v1.5 board)
Please watch this video: youtube.com/watchv=hqc60IdlsOU
Thanks for the help in advance.