Close

Going WIFI - Marlin V2 and first tests

A project log for BrailleRAP diy Braille embosser

An Open source Braille embosser in the spirit of RepRap

stephaneStephane 5 days ago0 Comments

In the path to enable WIFI connectivity with BrailleRAP, we need an upgrade of the BrailleRAP firmware to Marlin 2 as standard BrailleRAP firmware is still based on Marlin V1. 

We call the firmware we are using in BrailleRAP MarlinBraille. Basically it's a Marlin firmware with the good configuration for Homing, Step / mm and using the bed power connector to control the electromagnet. We modified the G28 command to set the 0 on Y axes at the top of the paper sheet, this is just a slightly logic modification of the homing function. 

- If the endstop Y is activated there is already a sheet of paper in the device so we are doing a standard Homing procedure

- If the endstop Y is not activated, we try to move the paper sheet forward until the endstop is activated. Then we are doing a standard homing procedure.

Porting the MarlinBrailleRAP features in Marlin V2 was not a great deal, just about reporting the  motor driver configuration and specialize the homing logic. Building Marlin 2 is another story if you want to build it for several MCU base board. And this is what we have in mind, building a firmware for MKS gen 1.4 and MKS Gen L V2.1 which are based on ATMEGA 2560 MCU, and build a firmware for MKS TinyBEE, an ESP32 base control board.

Marlin V2 build system is based on buildroot, a developpement tools, genuinely developed to compile linux kernel on different embedded hardware. You can still try Arduino ide or VS code, if you just need one configuration. But i you want to build for several MCU, you need an automated build tool, based on make or cmake, and the toolchain for every mcu you need. These kind of build environment can be easily done in docker. Docker is a software used to build virtual machine, you can use it to build software configuration like web or database server available on internet. You can also use docker to build temporary "machine" just to install complex software toolchain, compile what you need, and destroy the virtual machine. With this kind of procedure, you avoid "polluting" your own system with complex software installation.

For those who are interested you will find all source code on github:

Docker configuration for building marlin : https://github.com/crocsg/marlin-build

MarlinBraille2 source code : https://github.com/braillerap/MarlinBraille2

Marlin2 configurations : https://github.com/braillerap/MarlinBraille2Configuration

Now that we have a firmware based on Marlin V2, we can activate the 2nd UART in configuration.h

/**
 * Select a secondary serial port on the board to use for communication with the host.
 * Currently Ethernet (-2) is only supported on Teensy 4.1 boards.
 * :[-2, -1, 0, 1, 2, 3, 4, 5, 6, 7]
 */
#define SERIAL_PORT_2 2
#define BAUDRATE_2 250000   // :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] Enable to override BAUDRATE

According to the documentation, the UART RX and TX pin are D16 and D17 on EXP1 connector on the MKS Gen L V.1 board. GND pins are also available on J25.

So now we can test with a USB to serial converter. Wiring TX on D17, RX on D16 and GND on GND.

And it work perfectly !  we are now able to connect to the board with Pronterface with either the USB or USB to serial board

Discussions