MKS WIFI for Makerbase Robin: PCB and how to compile & upload firmware – 2
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.
The result of the BeePrint Web interface is in this screenshot.
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
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.
I used the 3D printed adapter and the relative programming board posted in the previous article to do the first test.
But you can print the adapter and use a breadboard
Socket for esp12 and esp07 with V base
Here is the adapter on a breadboard.
The programming parameter on your Arduino IDE for esp12 are
- Board: NodeMCU 1.0 (ESP-12E Module)
- Builtin Led: 2
- Upload Speed: 921600 (115200 is more secure)
- CPU Frequency: “160MHz” (80MHZ is more secure)
- Flash Size: 4MB
- SPIFFS: 3Mb
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.
You can directly order 10 pcb for 5$ here on 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.
This is the GPIO mode to manage the board status.
Mode | GPIO15 | GPIO0 | GPIO2 |
---|---|---|---|
UART | Low | Low | High |
Flash Boot | Low | High | High |
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.
NodeMCU
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
,
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.
Remember the files name must be:
- MksWifi.bin: for firmware;
- MksWifi_WebView.bin: for filesystem.
Thanks
- MKS WIFI for Makerbase Robin: boards and how to wiring esp12 & NodeMCU
- MKS WIFI for Makerbase Robin: PCB and how to compile & upload firmware
- MKS WIFI for Makerbase Robin: communication protocol and Cura plugin
- MKS WIFI for Makerbase Robin: firmware upgrade and new Web Socket features
- MKS WIFI for Makerbase Robin: BeePrint web interface with Camera on Flying Bear Ghost
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
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.
Hi Andrey,
the versione of core must be 2.7.4 or lower, because v3 have a breaking change and not support SPIFFS.
It’s better if we open a topic on dedicated forum, so I can help you better with the fix also.
Bye Renzo
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
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
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.
I finally succeeded 🙂 Installed original firmware, then Web View, then modified firmware, now BeePrint works well Thank you very much!
Hi,
perfect, thanks for your feedback.
Bye Renzo