Connection / cable testing

anyone have a good idea how to test quality of the connection between octoprint host and a printer.

yesterday we were debugging a new printer and spent hours assuming something else was wrong while the issue was a #^%^%#$_)* usb cable between pi and d9 .. so anyone have a good idea for a script that would send in a loop stuff to printer loading both printer cpu and connection and monitoring hw messages for usb issues and .. with some report afterwards.. maybe actually moving motors a bit and enabling / disabling drivers ... 'cause of EMI...

You'd think that we'd have a testing tool (like the rig we had back in the Teletype days).

Sounds like you'd want a pair of Raspberry Pi computers (host/client) and one serial USB cable and a second means of communicating out-of-band (wi-fi) to coordinate things.

  • Both sides set things up for a particular baudrate
  • A million characters are sent/checked
  • If there are errors, stop and display the baudrate
  • Increase the baudrate and repeat...

not sure how would one connect 2 pi's with AB cable or A - mini cable :smiley: .. A - micro might even work not sure :smiley: ..

but I think 2 rpi's is not a solution, I think it should be a test one can run on actual target system... I can test a cable locally, 40GHz spectrum analyzer, 5G pulse generator, 40GHz scope and I can look at the eye and see what's up there.. but not something I can do "on prem" at a "customer site" :slight_smile:

I was thinking more about

  • connect to printer
  • send ton of #^#@% to printer, long (in characters) commands (G91, G0 X000.0000 Y000.0000 Z000.0000 F000.00000 E000.00000 ...) and introduce some actual "dancing moves" (G0 X001.0000 Y001.0000 Z0001.0000, G0 X-001.0000 Y-001.0000 Z-0001.0000) and some disable/enable steppers (biggest EMI producer) .. all with checksum of course
  • send ton of "mini" gcodes (G0X0 for e.g.)
  • collect statistic about
    • requests for retry
    • disconnects
    • timing of each reply
  • monitor dmesg , /var/log/messages ... while doing it

so we get as result both test of a cable and some info about max troughput from octoprint to printer (and back)...

and all that as part of octoprint (plugin) :smiley:

I know how I'd do it in C outside of octoprint but the idea is to do the whole thing trough octoprint by octoprint's serial library to get the actual numbers octoprint related... a section of it might be external to octoprint (e.g. 30min run of "G0X0" at max system speed, to test cable) but most of it should go trough all octoprint layers.. and that's the part I have no clue how to do :frowning:

I'm afraid that if this is a plugin then OctoPrint will have tried to own that serial port. As the programmer, I'd want to fully own that connection myself. :man_shrugging:

yes, that's part that's problematic ... if you let use octoprint use the serial port you test communication trough octoprint which is useful but you don't have full control over serial port... if you connect yourself (possible even if plugin, you disconnect octoprint, select port in plugin) you have full control of the serial port but you are bypassing the octoprint

1 Like

I like this idea and I think it would be useful to have this as a plugin going thru the Octoprint comm layer. I haven't played with it but it looks like it would be possible to use the octoprint-comm-transport-serial-factory hook to both control the connection and send and read data. A plugin tab could provide both accumulated and detailed test results for each round.

1 Like

This is spot on, I was just going to recommend that route :smiley:

1 Like

cool so it is possible to do it trough octoprint :D... now just to learn python

I have to say that I love the documentation.

Btw. Here's an example of someone who probably could benefit from this type of plugin: Problems with serial communication with the board

1 Like