ambrop72 / aprinter

3D printer firmware written in C++
Other
143 stars 42 forks source link

can't connect with repsnapper due to line number mismatch #1

Closed wrtlprnft closed 10 years ago

wrtlprnft commented 10 years ago

When trying to use repsnapper to print using this firmware, I get the following error:

Error:Line Number is not Last Line Number+1, Last Line: 4294967295

I was able to fix this using the following patch:

diff --git a/aprinter/printer/PrinterMain.h b/aprinter/printer/PrinterMain.h
index 451fd34..fea87f0 100644
--- a/aprinter/printer/PrinterMain.h
+++ b/aprinter/printer/PrinterMain.h
@@ -1081,7 +1081,7 @@ public:
         TupleForEachForward(&o->m_fans, Foreach_init(), c);
         o->m_inactive_time = Params::DefaultInactiveTime::value() * Clock::time_freq;
         o->m_recv_next_error = 0;
-        o->m_line_number = 0;
+        o->m_line_number = 1;
         o->m_cmd = NULL;
         o->m_max_cart_speed = INFINITY;
         o->m_state = STATE_IDLE;

I don't know if this has any other consequences, but it works for me ;-)

ambrop72 commented 10 years ago

Thanks for the report. I'll try out RepSnapper to see more clearly what's happening, and I don't want to break anything that already works. Problem is there isn't really a spec on the protocol so a bit of experimentation is needed to get it right.

wrtlprnft commented 10 years ago

Thanks for the quick fix (and this firmware in general)!