MKS WIFI for Makerbase Robin: PCB and how to compile & upload firmware – 2

Spread the love

I bought a FlyingBear Ghost 5 with an integrated WiFi module, but I discovered no web interface. I don’t know why they can’t add a basic user interface. Then I went to see the web interface of the high-end Makerbase cards and realized that it was better they didn’t develop it.

My solution was to modify the firmware to support the Web Socket and develop the Web interface. This feature is compatible with all Makerbase cards with an MKS WiFi module.

Makerbase MKS wifi module upload flash compile pcb
Makerbase MKS WiFi module upload flash compile PCB

The result of the BeePrint Web interface is in this screenshot.

MKS WiFi BeePrint interface of my FlyingBear Ghost 5
MKS WiFi BeePrint interface of my FlyingBear Ghost 5

I also decided to explain all the development phases of the project. In this article, I would like to expose the hardware infrastructure of the MKS WiFi card that interfaces with the Makerbase Robin Nano.

Here I’d like to explain the MKS WiFi module, how to program and connect a device that can be used as a WiFi module alternative.

How to program It from scratch

You can find the source code on the Makerbase GitHub repository, but remember that they don’t update the esp8266 core, so you must use the 2.4.2 version, you can refer to my version for the same code ported to 2.7.4; on master, you can find the latest version with data folder and Web UI.

esp12

esp12 E pinout low resolution
esp12 E pinout low resolution

The connection schema is the same as the article “esp12 esp07 (esp8266): flash, pinout, specs, and Arduino IDE configuration”, I insert It here, but to understand better the wiring refers to the article.

esp12 flashing module connection breadboard
esp12 flashing module connection breadboard

I used the 3D printed adapter and the relative programming board posted in the previous article to do the first test.

Test env for MKS WiFi with esp12 E programming on Robin Nano disassembled
Test env for MKS WiFi with esp12 E programming on Robin Nano disassembled

But you can print the adapter and use a breadboard

Socket for esp12 and esp07 

Socket for esp12 and esp07 with V base 

Here is the adapter on a breadboard.

Programming circuit on breadboard with adapter for esp12
Programming circuit on a breadboard with adapter for esp12

The programming parameter on your Arduino IDE for esp12 are

  • BoardNodeMCU 1.0 (ESP-12E Module)
  • Builtin Led2
  • Upload Speed921600 (115200 is more secure)
  • CPU Frequency: “160MHz” (80MHZ is more secure)
  • Flash Size4MB
  • SPIFFS: 3Mb
esp12-E Arduino IDE configuration
esp12-E Arduino IDE configuration

But you can use a regular NodeMCU board as MKS WiFi.

Program MKS WiFi module without OTA

The MKS WiFi module is more simple to connect and program from scratch. To explain better, I reproduce the PCB.

MKS WiFi module PCB

The board is quite simple to create.

MKS WiFi original pcb
MKS WiFi original PCB

You can directly order 10 pcb for 5$ here on PCBWay
PCB from PCBWay

Here the esp12 and esp07 that you can use with Aliexpress esp-12 - Aliexpress esp-07

So the position of the pin is linear, and the connection schema becomes very simple.

MKS WiFi esp12 programming module connection on BreadBoard
MKS WiFi esp12 programming module connection on BreadBoard

This is the GPIO mode to manage the board status.

ModeGPIO15GPIO0GPIO2
UARTLowLowHigh
Flash BootLowHighHigh

And you must do this operation to enter in program mode:

  • Hold down the FLASH button;
  • Press and release the RST button;
  • Release FLASH button.

When I compile the project first time, my libraries version are

  • ArduinoJson@6.18.4
  • ESP8266WiFi@1.0
  • ESP8266mDNS@1.2
  • EEPROM@1.0
  • ESP8266HTTPClient@1.2

Upload Filesystem

If you select the latest version, you also need to upload the filesystem with the BeePrint interface.

You can upload filesystem data with the classic method via the plugin. Refer to the relative tutorial WeMos D1 mini (esp8266), integrated SPIFFS Filesystem.

Check if data the directory exists in the sketch folder (with some files), and the plugin is used to upload.

ESP8266 Sketch Data Upload Menu

NodeMCU

NodeMcu v2 pinout low resolution
NodeMcu v2 pinout low resolution

With NodeMCU, It’s all more simple. If the upload process does not start, disconnect the esp from the MKS Robin board temporarily.

You can find v2 and v3 version of NodeMCU here on WeMos D1 mini - NodeMCU V2 V2.1 V3 - esp01 - esp01 programmer

For the parameter check, the previous paragraph is the same as esp12.

Use OTA web page to upload the original firmware

An alternative method is to generate a bin file; first, open your source code on your Arduino IDE, compile It to check errors, and select. Sketch -> Export compiled Binary,

esp8266 esp32 Arduino Export compiled binary IDE menu
esp8266 esp32 Arduino Export compiled binary IDE menu

then by click on Sketch -> Show Sketch Folder you can find bin file. Here “esp8266: flash compiled and signed firmware (.bin)” you can get more information about compiled firmware.

Now we can use the web page that you can find to the root of the IP assigned to MKS WiFi.

MKS WiFi firmware update page
MKS WiFi firmware update page

Remember the files name must be:

  • MksWifi.bin: for firmware;
  • MksWifi_WebView.bin: for filesystem.

Thanks

  1. MKS WIFI for Makerbase Robin: boards and how to wiring esp12 & NodeMCU
  2. MKS WIFI for Makerbase Robin: PCB and how to compile & upload firmware
  3. MKS WIFI for Makerbase Robin: communication protocol and Cura plugin
  4. MKS WIFI for Makerbase Robin: firmware upgrade and new Web Socket features
  5. MKS WIFI for Makerbase Robin: BeePrint web interface with Camera on Flying Bear Ghost
All the code is released under Creative Commons License
Spread the love

14 Responses

  1. Andrey says:

    Hello!
    MksWifi compile with error:
    RepRapWebServer.h:140:30: error: no matching function for call to ‘WiFiClient::write(fs::File&, int)’
    140 | return _currentClient.write(file, HTTP_DOWNLOAD_UNIT_SIZE);
    You are not modify ESP8266WiFi/src/WiFiClient ?
    Thanks

    • Hi Andrey,
      no the libraries are standard.. can you attach a file with all the log of the compilation.

      What versions of libraries you had use?

      You can find also the compiled firmware on GitHub.

      Bye Renzo

      • Andrey says:

        I installed the latest version of esp8266 (3.0.2), and there the write(Stream&, size_t) prototype was removed as deprecated and instead it to use write (Stream&) in the commit from 04/27/2021, changed the code and this moment passed. I also have arduino-1.8.16 and it gave some errors in MKS_WIFI_source.ino: the “package_net_para” and “package_static_ip_info” functions did not return data, changed them prototypes to void return and everyhing was assembled.

  2. Andrey says:

    Also in the Upload Filesystem section link to SPIFFS plugin, but in the screenshot LittleFS is highlighted. I downloaded both, assembled the LittleFS image, and compating it with the release firmware. And undestand to assemble with ESP8266 Sketch Data Upload item (which is by the link)… I’m a beginner in all this. I wanted to add a few debug messages to firmware, because interface does not fully working with the Marlin firmware on the 3d-printer.

    • The plugin It’s the same of LittleFS, but the only filesystem supported (for backward compatibility) is SPIFFS, If I have some time I upgrade It.

      As already write you can use forum also so we can do a specified tread for Marilin.

      Refer to the article to add DEBUG message because the standard serial is used to communicate with SMT32 of the board.

      Bye Renzo

  3. Eugene says:

    Hello, Renzo! Thank you very much for your work! I am trying to install BeePrint on my MKS Robin Nano V3.1 with ESP-12S. But i see only ‘{“err”: “404: / NOT FOUND”}’ message before and after uploading the firmware file. It looks like the wifi firmware installation failed. Is it possible to flash it on the MKS board or i should make a stand described here?

    • Hi Eugene,
      you must retry to upload all via SD.
      The error say that the Web part is missing.
      Bye Renzo

      • Eugene says:

        Thank you for quick answer!
        /update_sketch says “MKS WIFI MISCHIANTIMISCHIANTI_v1.3. To upload Web part restore the original firmware, upload MksWifi_WebView than upload new firmware.” and asks for wifi firmware. There is no field to select the web part file. / (root) answers 404.

      • Happy Eugene says:

        I finally succeeded 🙂 Installed original firmware, then Web View, then modified firmware, now BeePrint works well Thank you very much!

  4. Victor Yinemag says:

    This guide is for MksWifi.bin. How the MksWifi_WebView.bin can be compiled? I need to change some gcode that doesn’t work as the one to delete file that should be ‘M30 ‘ + file + ‘\r\n’ rather than ‘M30 1:’ + file + ‘\r\n’ otherwise it doesn’t work with Marlin and nothing happens when I click on delete button.

Leave a Reply

Your email address will not be published. Required fields are marked *