Mega2560 RAMPS 1.6 Marlin 2 connection issues (partially solved)

Hardware and firmware are sucking the life out of me right now :slight_smile:

I have my Acro laser working perfectly with an arduino UNO and a CNC shield V3.0 and GRBL 1.1f

But I want to play around with another piece of hardware I just got… a RAMPS 1.6 board. This lives on a Mega2560 arduino board.

I have been trying all sorts of firmware on this combination and so far have had little success getting a connection that seems functional… tried both GRBL and Marlin and while LightBurn finds the board, and it it seems to connect to the board, but I cannot get any responses to typed commands in the console.

Normally all I see in the console window is “Waiting for connection”

I type $$ in the command field and I see $$ appear in the console output but no machine output.
If I tick the Show All switch I see a series of G0
Waiting for connection…
Waiting for connection…
Waiting for connection…
$$
G0
G0
G0
G0
G0
G0
G0
G0

Forever...

Right now I am using a Marlin version that is device specific for the MPCNC since I am building an MPCNC and hopefully it will replace my Acro Laser as both a Laser Engraver AND a CNC milling machine…

I should add that at this stage all I have is the Mega2560 and the RAMPS board on top, nothing at all hooked up. I have also tried with just the MEGA2560 without the RAMPS board. I should be able to talk to the Mega2560 either way and get responses…

If I use LightBurn “Find My Laser” it finds it as GRBL M3 (1.1e or earlier) (10mmx10mm) at COM7 115200 baud even though it is running Marlin. (I compiled Marlin in Arduino IDE and loaded it.

I have also tried manually creating the laser selecting Marlin and specifying a size etc… When I have that created, the very first time I launch LightBurn after flashing the board with Marlin I get the following in the console messages which tells me it really is talking to the board and seeing the version I flashed…

Waiting for connection…
Waiting for connection…
echo:start

Once I saw marlin build info… but have not been able to duplicate that scenario.

But after the first time I never see any messages when I connect with LightBurn all I see is Waiting for connection.

The LED on the RAMPS board does come on as soon as LightBurn connects.

It is like it see’s the board, sends something to the board that confuses it and can never talk to it again.

I realize I am way down there in the guts of things but from the discussion I have read on this forum, there is a lot of experience here… so after 3 days of fighting with this I figure I should ask for help.

Further update on this…
Rather than using LightBurn to connect to the board I used PuTTY terminal emulator, serial, COM7, 115200 baud.

I flashed the board fresh with Marlin.
Opened a terminal session then hit the reset button on the board.
Full response was encouraging.
echo:start
Marlin 509D 2.0.7.2

echo: Last Updated: 2020-10-15 | Author: (V1 Engineering, Ryan, 509D)
echo:Compiled: Feb 6 2021
echo: Free Memory: 3389 PlannerBufferBytes: 1456
DIGIPOTS Loading
DIGIPOTS Loaded
DIGIPOTS Loading
DIGIPOTS Loaded
echo:V82 stored settings retrieved (665 bytes; crc 51192)

Aha…its alive…

So I typed $$ to get a status…

THATS when I realized I was an idiot. Marlin isn’t GRBL… there may be many commands that look the same but Marlin isn’t GRBL. Doh…

You want to see settings, type M503 not $$ Want to save settings, M500

M503 reports
echo: G21 ; Units in mm (mm)
echo: M149 C ; Units in Celsius

echo:; Filament settings: Disabled
echo: M200 S0 D1.75
echo:; Steps per unit:
echo: M92 X200.00 Y200.00 Z800.00 E200.00
echo:; Maximum feedrates (units/s):
echo: M203 X50.00 Y50.00 Z15.00 E25.00
echo:; Maximum Acceleration (units/s2):
echo: M201 X180.00 Y180.00 Z80.00 E180.00
echo:; Acceleration (units/s2): P<print_accel> R<retract_accel> T<travel_accel>
echo: M204 P180.00 R3000.00 T180.00
echo:; Advanced: B<min_segment_time_us> S<min_feedrate> T<min_travel_feedrate> J<junc_dev>
echo: M205 B20000.00 S0.00 T0.00 J0.04
echo:; Home offset:
echo: M206 X0.00 Y0.00 Z0.00
echo:; Material heatup parameters:
echo: M145 S0 H180 F0
echo: M145 S1 H240 F0
echo:; PID settings:
echo: M301 P22.20 I1.08 D114.00
ok

So then I went back to LightBurn

Using the Marlin device I “Create Manually” I got nothing… then realized that by default it uses 250000 baud… (I hadn’t reset that last time I created it and I had defined my board to use 115200 so it appears 250000 baud is a defacto standard for Marlin, I will recompile mine for that)

I now see
Waiting for connection…
Waiting for connection…
echo:start
Marlin 509D 2.0.7.2
echo: Last Updated: 2020-10-15 | Author: (V1 Engineering, Ryan, 509D)
echo:Compiled: Feb 6 2021
echo: Free Memory: 3389 PlannerBufferBytes: 1456
DIGIPOTS Loading
DIGIPOTS Loaded
DIGIPOTS Loading
DIGIPOTS Loaded
echo:V82 stored settings retrieved (665 bytes; crc 51192)
echo:Unknown command: “����G0”
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok

And M503 in the console gets me an expected response.

So I think I have figured out what I was doing wrong… but still have a couple of questions.

Why didn’t LightBurn detect it as a Marlin device?
Why didn’t it work when I was loading GRBL.

I have some theories to try and will update once I have tried…

So my first theory was the baud rate. I reflashed the board to default to 250000 baud and tried the detect in Lightburn and it did not detect it as a Marlin board. It detected it as GRBL. Failed to connect or do anything.

Used “Create Manually” to create Marlin and that worked fine at 250000 baud.

When back and reflashed the board with GRBL
Connected with PuTTY again before connecting with LightBurn
On connection shows GRBL 1.1g version.
I went into LightBurn and had it search for it and it said it found it as GRBL on USB COM7 115200 (which is the correct baud rate for GRBL).

But back to the steady stream of G0 on console when Show All is toggled. $$ does not get a response.

Lightburn does not seem to properly negotiate with a MEGA2560 RAMPS combo. (RAMPS is really moot here, the MEGA2560 doesn’t even know the RAMPS shield is plugged in)

So I have figured out how to make Marlin work, Create Manually

Haven’t figured out how to mage GRBL work.

Any and all tips welcome… and if anyone at Lightburn has any tests they want me to perform I am open and willing to try whatever firmware or whatever versions of LightBurn they may want to suggest.

Well things are more interesting (read confusing) than I thought…
Today I got steppers for my new setup so I plugged one into the RAMPS board to just see LightBurn make it move.

Still have Marlin burned on Mega2560/RAMPS combo.

Launch LightBurn and… no connection to Marlin board. Huh? this WAS working yesterday, I swear.

Pull up PuTTY and connect, yup, Marlin talking. Launch LightBurn AND I AM CONNECTED!!!

Huh???

What seems to be happening is that if I open the COM7 port with PuTTY. close PuTTY to free up the port, then launch LightBurn I can connect. What this tells me is that LightBurn is not setting SOMETHING correctly on the port by itself.

As long as I open the port ONCE with PuTTY I can open and close LightBurn and reliably get a connection to the Mega2560/Ramps combo. If I unplug the Mega2560 and plug it back in, then LightBurn will no longer connect until I launch PuTTY and open the port.

I used the old school DOS MODE command to look at the COM7 port before and after PuTTY had touched it. (below) and noticed many changes. Short answer is if I issue a MODE COM7 DTR=on command before launching LightBurn then LightBurn will connect to the board.

Anyone from LightBurn have any ideas?

Oh I should add that I tried the Enable DTR setting in the LightBurn Device Settings and that did not have any effect… it is DTR on the Windows port that matters.

C:\Users\admin>mode com7

Status for device COM7:

Baud:            0
Parity:          None
Data Bits:       0
Stop Bits:       1
Timeout:         OFF
XON/XOFF:        OFF
CTS handshaking: OFF
DSR handshaking: OFF
DSR sensitivity: OFF
DTR circuit:     OFF

C:\Users\admin>mode com7

Status for device COM7:

Baud:            250000
Parity:          None
Data Bits:       8
Stop Bits:       1
Timeout:         OFF
XON/XOFF:        ON
CTS handshaking: OFF
DSR handshaking: OFF
DSR sensitivity: OFF
DTR circuit:     ON
RTS circuit:     ON

And last but not least… I reflashed my board with GRBL and did some testing.

Yup, you bet…

MODE COM7 DTR=on

Lightburn connects to the board running GRBL…

Why this behaves different than say an UNO or a NANO board connection I have no idea. But I bet this sheds some light on a number of others having connection issues with these and other types of boards…

And there’s three days of my life I will never get back…

Lucky you!!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.