WirelessPrinting icon indicating copy to clipboard operation
WirelessPrinting copied to clipboard

Wifi flashing marlin with this method

Open forum999 opened this issue 6 years ago • 23 comments

sorry not really an issue just a big hope!

Would it be possible to update or reflash my printer with marlin using this method? this would make things so much easier if i didnt have to keep my old laptop near the printer to make changes and updates to marlin on the 3d printer....

forum999 avatar Feb 17 '19 17:02 forum999

You can reflash with an ESP (see esp-link), but not with this repo

chepo92 avatar Feb 19 '19 01:02 chepo92

Thanks can you post the link?

forum999 avatar Feb 19 '19 07:02 forum999

don't have the link, sending zelda, please follow http://lmgtfy.com/?q=esp-link

chepo92 avatar Feb 19 '19 19:02 chepo92

sorry not really an issue just a big hope! Would it be possible to update or reflash my printer with marlin using this method? this would make things so much easier if i didnt have to keep my old laptop near the printer to make changes and updates to marlin on the 3d printer....

Marlin have implemented the function for updating the firmware automatically from the SD card. This is a great looking feature that would open the way to achieve exactly what you are looking for. https://github.com/MarlinFirmware/Marlin/pull/12043 There is however an issue that makes things a bit more complicated. The new firmware needs to be on the PRINTER SD CARD, and not on the ESP SD CARD. This repository from probonopd has a big advantage in the upload speeds of files to the ESP, but does not save the files to the PRINTER SD CARD. There are a few alternatives out there that are able to save files to the PRINTER SD CARD , but I will warn you, the upload speed is VERY SLOW !!!!, and I am not talking slow like I can wait, I am talking slow like banging your head on the wall slow. This is because of a whole bunch of reasons that many people are trying to find a solution for, but at the moment you have the two options - reasonable upload to ESP SD CARD ( no marlin firmware update possible ) or EXTRA SLOW upload to PRINTER SD CARD ( allows the idea of marlin firmware update ) Give this one a look if you would like to try option two https://github.com/luc-github/ESP3D

just-jason avatar Feb 20 '19 09:02 just-jason

This looks like something i could work with? Do you have instructionns how to set it up as i cant find anthing in config.h or adv.h reference this in 2.0 bugfix

forum999 avatar Feb 20 '19 11:02 forum999

There are some things to set up first https://github.com/MarlinFirmware/Marlin/blob/a43e892fb5f180e9ff99815b679b58ff9422deb6/Marlin/Configuration_adv.h#L830 After that you just compile the firmware, save as .bin and transfer to SD card. By the next new start the printer will automatically read and update to the new firmware.

just-jason avatar Feb 20 '19 13:02 just-jason

With the esp-link bridge you can update directly with no special fw or config, ESP3D has a bridge implemented https://github.com/luc-github/ESP3D , if you can work on it to be implemented here would be appreciated

chepo92 avatar Feb 20 '19 13:02 chepo92

With the esp-link bridge you can update directly with no special fw or config,

OK, I will take your word for it, I thought that the bootloader needed a few mods, but I am glad to hear that it works without.

ESP3D has a bridge implemented https://github.com/luc-github/ESP3D , if you can work on it to be implemented here would be appreciated

I think implemeting a bridge is not the solution that you are looking for with the current state of development. There is an fundamental problem when using the serial bridge to upload files to the printer SD card in a Marlin based printer It is SLOOOOOOOWWWWWW , really slow !!!. Luc has had many people ask about this issue, and wrote a very good explanation where the problem lies. https://github.com/luc-github/ESP3D/issues/292 There is a work around to this, using a WiFi SD card, and can offer a great solution, so the choice is yours I think for the moment the solution that Probonopd has here is the most useable with just the ESP and a normal SD card, you will just have to get over the fact that the files are going to end up on the ESP SD card and NOT on the printer SD card. For some cases this is a deal breaker( firmware update - power loss recovery) , I can live with that 8/10.

just-jason avatar Feb 20 '19 15:02 just-jason

I think implemeting a bridge is not the solution that you are looking for with the current state of development. There is an fundamental problem when using the serial bridge to upload files to the printer SD card in a Marlin based printer It is SLOOOOOOOWWWWWW , really slow !!!. Luc has had many people ask about this issue, and wrote a very good explanation where the problem lies. luc-github/ESP3D#292

Yes, but th original question is if it is possible to flash firmware, it is possible with the link, but not implemented, the firm is as much as 256kB so the speed isnt't that terrible, even octoprint does it (and this is kind of a basic port of octoprint for esp). But of course if you want to send a complete gcode file to print you'd better use this repo and write to esp SD, that cost nothing compared to Wifi SD cards, also with wifi sd card you can't command the printer to print the file.

chepo92 avatar Feb 22 '19 20:02 chepo92

Yes, but th original question is if it is possible to flash firmware, it is possible with the link, but not implemented

Ok, I will take your word for it, I thought you needed to modify the bootloader, but I am glad to hear that it works without

also with wifi sd card you can't command the printer to print the file.

This method is being used in other repositories, works great.

just-jason avatar Feb 22 '19 21:02 just-jason

Are there any instructions anywhere for flashing with these methods?

forum999 avatar Feb 23 '19 00:02 forum999

This method is being used in other repositories, works great.

I would like to know those!

Are there any instructions anywhere for flashing with these methods?

https://github.com/jeelabs/esp-link

chepo92 avatar Feb 23 '19 06:02 chepo92

@justjason

I cant see how to save the marlin build as a bin file? When i goto export binary it saves as .hex files?

forum999 avatar Feb 23 '19 20:02 forum999

try this bin It should save a .bin in the Marlin folder. Save that to your SD card with what ever method you choose, and restart.

just-jason avatar Feb 23 '19 22:02 just-jason

Thanks Jason but it saves as .hex files and not .bin with that method?

forum999 avatar Feb 24 '19 00:02 forum999

I think hex is fine too?

probonopd avatar Feb 24 '19 08:02 probonopd

I think hex is fine too? Sorry, I can not tell you much about that. I kind of expect that a Marlin controller can be flashed with the hex, what I am not sure about is weather the process of auto-updating Marlin over SD card is checking for a .bin file to use or not. @forum999 give it a try and let us know how it goes.

just-jason avatar Feb 24 '19 09:02 just-jason

Hex doesnt work? Ive flashed the marlin changes required to config.h

Copied the 2 generated hex “export compiled binary” files to an sd card root

Put sd into printer

Turned on printer

Nothing happens

forum999 avatar Feb 24 '19 09:02 forum999

You are talking about http://domoticx.com/esp8266-wifi-esp-link-firmware/, right? (It is somewhat off-topic here). This might work:

  • Use avrdude and point it at port 23 of esp-link. Esp-link automatically detects the programming sequence and issues a reset to the AVR.
  • Use avrdude and point it at port 2323 of esp-link. This is the same as port 23 except that the autodectection is not used and the reset happens because port 2323 is used

So, not using the SD card at all.

probonopd avatar Feb 24 '19 09:02 probonopd

Do i need to install a specific boot loader for this?

As requested the changes i made were:

//#define SD_FIRMWARE_UPDATE #if ENABLED(SD_FIRMWARE_UPDATE) #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF #endif

Into configuration.h

Compiled and flashed to printer

forum999 avatar Feb 24 '19 09:02 forum999

Do i need to install a specific boot loader for this? As requested the changes i made were: //#define SD_FIRMWARE_UPDATE #if ENABLED(SD_FIRMWARE_UPDATE) #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF #endif Into configuration.h Compiled and flashed to printer

I did need to on mine, for SD update. I also have only tried to use it with .bin

and delete the "//" here //#define SD_FIRMWARE_UPDATE

just-jason avatar Feb 24 '19 09:02 just-jason

Something like this might work if we add a transparent serial bridge on port 2323:

avrdude -DV -p atmega1284p -c arduino -P net:192.168.0.22:2323 -b115200 -U flash:r:factory.hex:i

But we also need to silence all other communication with the printer if a client connects to that port. And it will only work if the hardware is connected to the same serial port that is used for flashing the firmware.

probonopd avatar Jul 09 '19 16:07 probonopd

Updating via the transparent serial bridge did not work for me, and we should probably implement it in a way that is compatible to Octoprint, so that e.g., Cura can be used for updating the firmware...

probonopd avatar Jul 31 '19 13:07 probonopd