I am trying to make Marlin use the RX1 and TX1 pins that are in the EXP1 connection. I am connecting those pins to the TX, RX of an Arduino.

The Configuration.h file has a SERIAL_PORT define, normally configured to be 0, but supposedly changeable.

What should be changed in Marlin to make it used the Serial1 port (if possible at all)? I am using the latest code provided in Printrbot's Marlin repository

From the Configuration.h file:

// SERIAL_PORT selects which serial port should be used for communication with the host.
// This allows the connection of wireless adapters (for instance) to non-default port pins.
// Serial port 0 is still used by the Arduino bootloader regardless of this setting.
#define SERIAL_PORT 0
//#define SERIAL_PORT 1

// This determines the communication speed of the printer
// This determines the communication speed of the printer
#define BAUDRATE 250000
//#define BAUDRATE 9600



I was able to resolve this issue:

  1. I moved to Marlin 1.1.9 (the final release of the 1.1.x versions).
  2. I made a fork, for those who would like to see the changes. Also summarized below.
  3. The RX1 and TX1 pins are well identified in the question. I connected those directly to the HC-06 bluetooth module (using a voltage divider for the RX pin in the bluetooth, as it is a 3.3 V logic module).

Changes in code:

Marlin/Conditionals.LCD.h: commented out:

// this line conflicted with the bluetooth/serial1 options
// #define USE_MARLINSERIAL !(defined(__AVR__) && defined(USBCON))

The rest are the configuration options already provided by Marlin in Marlin.Configuration.h:

define SERIAL_PORT 1
define BAUDRATE 115200  // Note: this baudrate MUST match the one set in the bluetooth module. That's done using the AT commands. There is plenty of information on how to do that. 

As a result of these changes I am able to print with my PrintrBot Simple 2014 (Printrboard Rev. D) with Bluetooth over a distance of ~3.5mts, behind a wall. I haven't tested it exhaustely, but it does print.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.