1 (edited by foofoodog 2013-11-10 19:04:39)

Topic: Repetier-Host source code hack

I just realized Repetier-Host was up on github.
I downloaded it and added a personal crazy and dangerous feature to monitor a folder for a gcode file and it if sees it, it loads it, connects to the printer, and runs it. So no more pasting gcode through remote desktop!

http://www.soliforum.com/misc.php?action=pun_attachment&item=3923&download=1

All I need now is my string translated into 14 languages, a test suite for all platforms, to update the documentation, and be willing to support it.

Post's attachments

hack.jpg
hack.jpg 80.94 kb, 540 downloads since 2013-11-10 

You don't have the permssions to download the attachments of this post.

2

Re: Repetier-Host source code hack

Kind of interesting how RH is really a pretty decent program and yet the source code smells to high heaven. 37 public fields no less in in the Main class which is a UI class, never mind properties and methods, and 363 references back to Main.main including 92 from classes that are ostensibly in the "model" namespace.

Winforms programmers keep all of their state in the UI I guess and share it like a biker chick. It is no wonder this thing has no automation interface.

Also, trust me, you do not want to run any static code analysis tools over this code base to check for quality issues.

3 (edited by foofoodog 2013-11-13 01:51:44)

Re: Repetier-Host source code hack

Wow, so not one reply from anyone else so far. I think I should just delete the topic. I suppose anyone who has any interest in botting the host device has probably already done it with Octoprint or some such. I was thinking of taking this farther but the sound of crickets dissuades me. It did look to me that once I had my hooks into it I could drop a remotely accessible interface on it to get it do pretty much wherever I wanted.

4

Re: Repetier-Host source code hack

For what its worth, you have like 100 thread views.

5 (edited by adrian 2013-11-13 08:02:20)

Re: Repetier-Host source code hack

Well, try writing firmware and sit back and enjoy the copious feedback lol smile

Nice work.

My only advice is, a: you've already summised correctly - RH isn't designed to be an automated interface, and there is existing solutions to achieve what you desire - from Repetier themselves.

The Repetier project consists of THREE projects:
Repetier-Host - Designed to do what its supplied for - a GUI Interface for 1:1 printing with the ability to connect to multiple printers (but not per instance).
Repetier-Firmware - Designed to run the "Machine Code", i.e, its an equivalent to Marlin.
Repetier-Server - Designed to do what you are trying to bludgeon RH into doing.

Basically - you are trying to beat the wrong tool into submission and make it achieve a purpose it was never set out to achieve. They built other tools to do that in a proper enterprise-esque 3-layer model.

My only other comment is, Repetier is a specifically guided project with clear goals and corporate sponsorship that dictates its development efforts. If you do want to be actively involved, you should do that upstream as part of the project and not in isolation of a private fork smile

Anyway - Great work and great to see more contributing code around the place - but if you plan to continue particularly in relation to making it 'bot like' - you're going about it using the wrong tool for the wrong task smile Repetier-Server is what you need to work with - that way you aren't trying 'upgrade' a butter knife to cut steak, you are using the steak knife in the first place wink

6

Re: Repetier-Host source code hack

If I was going to contribute it would probably be to OctoPrint as apposed to RS. If only, given the choice, I would rather write bad python than bad c. Bad c# I can do in my sleep;)

I think you may underestimate how many folks have a $100 eBay notebook hooked up to the printer to only serve gcode that was sliced on their main rig and how much use there might be for a seamless master/slave kind of setup.

With all of the fixiins a RasPi is gong to run you $100 anyway which is as much as a crappy yet serviceable XP or Linux laptop.

7 (edited by adrian 2013-11-14 04:49:39)

Re: Repetier-Host source code hack

I'm not understanding how reptier - server doesn't address the scenario you suggest?
'it runs on Rpi or Linux. And windows works, but they are still messing to make it run as a service not an app.
And it's design ed to serve gcode as you suggest?

Confused I am. Have you read what repetier- server does and how it works?

Still sounds like you are trying to make the wrong tool work right? I'm not seeing any need to reinvent wheels here... but that's just me.

8

Re: Repetier-Host source code hack

I don't think I could ever get my printer to where I could trust it to run unattended well enough to use a feature like this, but I like the idea.

See, I was thinking of digging into RH source code just so I could add a key binding for the Extrude and Retract buttons, because I usually have to have one hand and both eyes on the printer when I'm loading and unloading filament, and working the mouse to hit those tiny buttons on the Manual Control tab is a pain.  But I never even got around to something as simple (conceptually, at least, maybe not implementationally) as that.

9

Re: Repetier-Host source code hack

adrian wrote:

Have you read what repetier- server does and how it works?

I have and I do. I like the idea of a full featured GUI program that also has an automation interface is all.

10

Re: Repetier-Host source code hack

Hunter Green wrote:

I was thinking of digging into RH source code just so I could add a key binding for the Extrude and Retract buttons.


Override ProcessCmdKey in view\PrintPanel.cs looking for (Keys.Up | Keys.Control) or (Keys.Down | Keys.Control) and call buttonRetract_Click or buttonExtrude_Click seems to work. Patch attached.

Post's attachments

RetractExtrudeKeyboardControl.patch 808 b, 9 downloads since 2013-11-15 

You don't have the permssions to download the attachments of this post.

11

Re: Repetier-Host source code hack

Hunter Green wrote:

I don't think I could ever get my printer to where I could trust it to run unattended

The key word there being trust since firing off a well sliced print is an act of faith in and of itself every single time.
I wander by the printer and make sure the bed is clear then settle down in my comfy chair in another room. When something strikes my fancy I slice it and send it. Then I can watch it on the web cam or wander into the lab to see that the first layers are going OK since that is where the trouble starts. Call me lazy. Maybe I will add an @tweet host command next wink

12

Re: Repetier-Host source code hack

I have been using my printer for two months unattended. In excess of 40 prints without watching. Usually a >4hr print I'll end up checking on it.

Sometimes my prints do fail, but their failure is rarely if ever anything major. I just lose out on the plastic. It's certainly not outrageous.

I do lower my feedrate by 20% at least when i leave, just incase. Generally not pushing the speed is more reliable.

13 (edited by adrian 2013-11-19 05:12:09)

Re: Repetier-Host source code hack

Tomek wrote:

Sometimes my prints do fail, but their failure is rarely if ever anything major. I just lose out on the plastic. It's certainly not outrageous.

Are you crazy man?!?! Remember what happened when someone left a 3D printer unattended @ 1600 penn!!!!

http://i.onionstatic.com/avclub/4004/00/16x9/620.jpg

14

Re: Repetier-Host source code hack

lol

SD3 w/ mods:
Glass bed with QU-BD heat pad upgrade, threadless ballscrew w/ 8mm smooth rod, spectra line belt replacement, lawsy MK5 extruder, Lawsy replacement carriage, E3D hotend, Ramps 1.4 w/ reprap discount controller, DRV8825 drivers, 12v 30A PS, Acrylic case, Overkill Y-idlers, Filament alarm, Extruder fan + more.

15

Re: Repetier-Host source code hack

Replying to my own old dead topic. I might have to dive into this code again.
I want to turn off/collapse the object analysis pane since it is a pain. It makes the UI all jumpy depending on whether one item is selected or many. That makes the UI pretty crappy if the log window is open and one has to scroll to scale or rotate. Also, can no longer CTRL+A to select all in the object list. So no CTRL+A, DEL, just a lot of little trash can icons. Some might like the object analysis pane but I am not finding any use for it. It comes across as a slap on feature.

16

Re: Repetier-Host source code hack

i dont know anything about firmware patches... that patch mentioned above will let me use the keyboard to extrude and retract? how/where do i install it?

17

Re: Repetier-Host source code hack

Its closed source from >0.95 onwards.

18

Re: Repetier-Host source code hack

adrian wrote:

Its closed source from >0.95 onwards.

Is there any place to download an older version.  You know... For those of us that didn't save each version in a separate location?

Printit Industries Model 8.10 fully enclosed CoreXY, Chamber heat
3-SD3's & a Workbench all fully enclosed, RH-Slic3r Win7pro, E3D V6, Volcano & Cyclops Hot End
SSR/500W AC Heated Glass Bed, Linear bearings on SS rods. Direct Drive Y-axis, BulldogXL
Thanks to all for your contributions

19 (edited by adrian 2014-01-27 02:22:14)

Re: Repetier-Host source code hack

wardjr wrote:
adrian wrote:

Its closed source from >0.95 onwards.

Is there any place to download an older version.  You know... For those of us that didn't save each version in a separate location?

Most immediate answer would be check the repetier.com website under Downloads - there you'll find about the previous 5 versions ?... Source code is also all still up on 'Github and you can download and compile them - they are still there, just no longer updated in past 3 months and wont be from here on out based on 'repetiers' comments. You could go back to 0.85b/0.84 via the Solidoodle files but there has been literally dozens of bugfixes and enhancements between even 0.90D and 0.95F .. and none of those will be in the source code or older versions.

Incidentally - Directory Monitoring is supported natively in 0.95+.. so except the keyboard shortcuts (which you can do via a hotkey macro app as well without rewriting the program).. its all there in the untainted mainstream version *shrug*

20 (edited by MolecularConcept 2014-01-27 01:41:33)

Re: Repetier-Host source code hack

lol im still running .082b

21

Re: Repetier-Host source code hack

adrian wrote:

Its closed source from >0.95 onwards.

I can't say I have not enjoyed having my way with the source code and being able to taint it as I see fit but...
Given what a big ball of mud that thing is maybe it is better it is closed source now.

22

Re: Repetier-Host source code hack

MolecularConcept wrote:

i dont know anything about firmware patches... that patch mentioned above will let me use the keyboard to extrude and retract? how/where do i install it?

Yeah, that is a c# .net source code patch, for the windows host software. So unless you are willing and able to pull the source tree, get it to build and apply the patch it won't be much use to you. That being said, it was trivial to implement. The true burden comes from testing, documenting and supporting the feature.

I suspect it won't be long, since they figured out how to use a FileWatcher, that they will learn how accelerator keys work too and add that feature.

23

Re: Repetier-Host source code hack

i just upgraded from .82 to .95f.  it was a pretty drastic change! glad i did the new look is nicer and some other features i like too.

24

Re: Repetier-Host source code hack

Old thread but today I am thinking I need a feature that backs down the feed rate if the hot end temperature drops too much. Say a 10 degree drop goes to a safe as hell 50 feed rate to allow the thing to catch up, and perhaps recovers from there incrementally. I never thought about needing this before but I think my parts are getting old and tired and can't do balls to the wall field fills anymore without losing steam and it needs a little more TLC.

I do know there may be other underlying problems that might be corrected to solve this problem instead of adding a hack. PID is not tuned, poor insulation, shop is drafty or gets cold at night, heater core is shot or not bedded well, etc.
And that there are fixed settings that might be configured more modestly to avoid the situation to begin with. But still, a little bit of a dynamic feedback loop, an STFD (slow the f down) algorithm might be useful.