Jump to content
Ultimaker Community of 3D Printing Experts
scottd

Control Ultimaker 2 LEDs Via GCode?

Recommended Posts

Hi Everyone,

Long time lurker here. I am just curious if anyone knows how to control the LED lights on the Ultimaker 2 using GCode. I currently have my UM2 machines controlled with Octoprint and I would like to be able to send GCode commands to control the PWM of the LEDs during a USB print.

Thank you very much.

Scott

Share this post


Link to post
Share on other sites

Using LED J15: Control it in G Code with M42 P13 SXXX where XXX is a value between 0 and 255.  Use M42 P13 S0 to turn the leds off.

But I may be wrong.

 

Actually LED_PIN is 13 on the UMO board and pin 8 (PH5) for the UM2...

...but never mind - the LED_PIN is the default for the M42 command.

You can omit the pin number and everything between

"M42 S0" and "M42 S255"

should work with every Marlin version out there...

Share this post


Link to post
Share on other sites

Hey Labern,

Thanks for the info.  I am using Octoprint to send G Code commands to my printer and unfortunately, the M42 command on Pin 13 seems to be killing the connection to the printer.

I sent M42 P13 S0 to the printer and the LED turned off, so I thought I was good, but I just realized the connection has been killed and would need to be reconnected.  Any other commands I sent to the printer (i.e. M105), would get no response after that.

Is there a way to confirm that the LEDs are using Aux Pin 13?

Thanks again!

--Scott

Edited by Guest
Spelling

Share this post


Link to post
Share on other sites

Actually LED_PIN is 13 on the UMO board and pin 8 (PH5) for the UM2...

...but never mind - the LED_PIN is the default for the M42 command.

You can omit the pin number and everything between

"M42 S0" and "M42 S255"

should work with every Marlin version out there...

 

Excellent.  I think my issue may be with Octoprint sending the commands.  If I send M42 S0 it will lock up the connection.  The LEDs do turn go off every time the connection breaks though.  

Very strange behavior.

Thank you,

--Scott

Edited by Guest

Share this post


Link to post
Share on other sites

It works. I use it on my umo+ (same board)

 

Which application are you using to send the G Code to your machine?

I just tried using Printrun to send the M42 S0 command and it failed and locked up the connection the same as it did with OctoPrint.

Any thoughts on what could be going on here? Maybe there is a difference between the UMO+ board and the UM2 board?

Can anyone test on an UM2?

Thank you,

--Scott

Share this post


Link to post
Share on other sites

Which application are you using to send the G Code to your machine?

 

I use it on my auto0.g file on my umo+ it makes the lights to go on when the printer it's power on.

The M42 it's described on the Marlin for Ultimaker 2

https://github.com/Ultimaker/Ultimaker2Marlin/blob/master/README.md

Edited by Guest

Share this post


Link to post
Share on other sites

 

Using LED J15: Control it in G Code with M42 P13 SXXX where XXX is a value between 0 and 255.  Use M42 P13 S0 to turn the leds off.

But I may be wrong.

 

Actually LED_PIN is 13 on the UMO board and pin 8 (PH5) for the UM2...

...but never mind - the LED_PIN is the default for the M42 command.

You can omit the pin number and everything between

"M42 S0" and "M42 S255"

should work with every Marlin version out there...

 

I just happened to be reading a post on using and UM2 for laser engraving so was a cut n paste from that article. But glad you corrected the mistake.

Share this post


Link to post
Share on other sites

A little additional info about the SD card testing... I put the M42 S0 command at the beginning of one of my prints and when I ran it from the SD card it crashed the printers. This is happening on all 3 UM2s that I tested it on.

Any help would be appreciated!

Thank you,

--Scott

Share this post


Link to post
Share on other sites

Has anyone been able to confirm that this M42 command works on the UM2?

 

I found some time today and made a short test.

I can confirm that this command does not work properly. Your printers hardware is ok and Octoprint too, i'm pretty sure that you found a bug in the Marlin firmware. Honour to whom honour is due. :)

I will take a closer look at it in the next days and fix it for the tinker firmware. Which firmware version are you using?

  • Like 1

Share this post


Link to post
Share on other sites

Ok, it was i simple fix. The M42 command works like intended now.

Here is the updated release of the tinker firmware. You can install it with Cura 15.04 (Machine -> Install custom firmware...)

I also made a pull request for the standard firmware, but there was no activity for months -

so this may take some more time...

Edited by Guest
  • Like 2

Share this post


Link to post
Share on other sites

Oh no!  I installed the Tinker Firmware and when I use OctoPrint, my nozzle will shut off as soon as it gets to temperature on every print.  Is there a place where I can log this issue for this Firmware?

 

Assuming that everything else is the same as before (esp. the gcode file), this indeed should not happen.

Best would be to report a new issue on the GitHub page. You can attach additional files there. Though you would need to create an account first (it's free).

Share this post


Link to post
Share on other sites

Oh no!  I installed the Tinker Firmware and when I use OctoPrint, my nozzle will shut off as soon as it gets to temperature on every print.

 

Hi Scott,

I don't use OctoPrint (... I still believe that USB printing is NOT reliable, but it is just my personal opinion), but, as also tinkergnome said, this should not happen so ... please follow thinkergnome instructions and open ad issue on GitHub ...

... and you help all the community to have a better firmware :)

Guglielmo

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Our picks

    • Taking Advantage of DfAM
      This is a statement that’s often made about AM/3DP. I'll focus on the way DfAM can take advantage of some of the unique capabilities that AM and 3DP have to offer. I personally think that the use of AM/3DP for light-weighting is one of it’s most exciting possibilities and one that could play a key part in the sustainability of design and manufacturing in the future.
        • Like
      • 3 replies
×

Important Information

Welcome to the Ultimaker Community of 3D printing experts. Visit the following links to read more about our Terms of Use or our Privacy Policy. Thank you!