Monday, 31 December 2018

Speaking GCode directly to your 3D printer in Linux when it requires a custom baud rate

I recently impulse bought a 3D printer from Aldi. The Cocoon Create Model Maker HE170707. It's a rebrand of the Wanhao Duplicator i3 Mini. I'm slowly learning how to use it, and how to interact with it.

To date, I've been slicing in Cura and then exporting to SD card, then loading that into the printer, but today I started playing around with sending GCode directly to the printer. Eventually I want to update the version of Marlin it's running, but before I do that, I want to see what settings/version etc. the printer is running.

Cura can see the printer, and can send it basic requests - but it won't show me the printer's responses to particular GCodes, which I want to see. The inbuilt USB to serial adapter the printer uses is locked at 250,000 baud and this isn't supported by minicom.

I did some Googling, and in the end, I found out that I could instead use picocom. It's a very simple, cut down serial terminal package.

WARNING: Don't send commands to your printer if you don't know what they do. Read the instructions first. You change things at your own risk!


I found the command line:

$ picocom -b 250000 /dev/ttyUSB0 --echo --imap lfcrlf

... works well.

  • -b 250000
    Set the baudrate to required 250000
  • /dev/ttyUSB0
    The port which my printer appeared on when connected
  • --echo
    Turn on local echo so you can see what you're typing
  • --imap lfcrlf
    Convert the linefeeds sent by the printer in its responses into crlf sequences so it reads right on screen
I can then interrogate my printer:

$ picocom -b 250000 /dev/ttyUSB0 --echo --imap lfcrlf
picocom v3.1

port is        : /dev/ttyUSB0
flowcontrol    : none
baudrate is    : 250000
parity is      : none
databits are   : 8
stopbits are   : 1
escape is      : C-a
local echo is  : yes
noinit is      : no
noreset is     : no
hangup is      : no
nolock is      : no
send_cmd is    : sz -vv
receive_cmd is : rz -vv -E
imap is        : lfcrlf,
omap is        : 
emap is        : crcrlf,delbs,
logfile is     : none
initstring     : none
exit_after is  : not set
exit is        : no

Type [C-a] [C-h] to see available commands
Terminal ready
echo:SD card ok
start
echo:Marlin 1.1.4

echo: Last Updated: 2017-07-04 12:00 | Author: (none, default config)
Compiled: Aug 25 2018
echo: Free Memory: 3263  PlannerBufferBytes: 1232
echo:V12 stored settings retrieved (445 bytes; crc -30710)
echo:  G21    ; Units in mm
echo:  M149 C ; Units in Celsius

echo:Filament settings: Disabled
echo:  M200 D1.75
echo:  M200 D0
echo:Steps per unit:
echo:  M92 X80.00 Y80.00 Z400.00 E94.00
echo:Maximum feedrates (units/s):
echo:  M203 X300.00 Y300.00 Z5.00 E25.00
echo:Maximum Acceleration (units/s2):
echo:  M201 X3000 Y3000 Z100 E3000
echo:Acceleration (units/s2): P<print_accel> R<retract_accel> T<travel_accel>
echo:  M204 P800.00 R800.00 T1000.00
echo:Advanced: S<min_feedrate> T<min_travel_feedrate> B<min_segment_time_ms> X<max_xy_jerk> Z<max_z_jerk> E<max_e_jerk>
echo:  M205 S0.00 T0.00 B20000 X10.00 Y10.00 Z0.40 E1.00
echo:Home offset:
echo:  M206 X0.00 Y0.00 Z0.00
echo:Mesh Bed Leveling:
echo:  M420 S0 Z0.00
echo:  G29 S3 X1 Y1 Z0.00000
echo:  G29 S3 X2 Y1 Z0.00000
echo:  G29 S3 X1 Y2 Z0.00000
echo:  G29 S3 X2 Y2 Z0.00000
echo:Material heatup parameters:
echo:  M145 S0 H210 B70 F0
  M145 S1 H240 B110 F0
echo:PID settings:
echo:  M301 P22.20 I1.08 D114.00
echo:LCD Contrast:
echo:  M250 C200
echo:Z-Probe Offset (mm):
echo:  M851 Z0.00
echo:SD card ok
M115
FIRMWARE_NAME:Marlin 1.1.4 (Github) SOURCE_CODE_URL:https://github.com/MarlinFirmware/Marlin PROTOCOL_VERSION:1.0 MACHINE_TYPE:3D Printer EXTRUDER_COUNT:1 UUID:cede2a2f-41a2-4748-9b12-c55c62f367ff
Cap:EEPROM:1
Cap:AUTOREPORT_TEMP:1
Cap:PROGRESS:0
Cap:PRINT_JOB:1
Cap:AUTOLEVEL:0
Cap:Z_PROBE:1
Cap:LEVELING_DATA:1
Cap:SOFTWARE_POWER:0
Cap:TOGGLE_LIGHTS:0
Cap:CASE_LIGHT_BRIGHTNESS:0
Cap:EMERGENCY_PARSER:0
ok
M501
echo:V12 stored settings retrieved (445 bytes; crc -30710)
echo:  G21    ; Units in mm
echo:  M149 C ; Units in Celsius

echo:Filament settings: Disabled
echo:  M200 D1.75
echo:  M200 D0
echo:Steps per unit:
echo:  M92 X80.00 Y80.00 Z400.00 E94.00
echo:Maximum feedrates (units/s):
echo:  M203 X300.00 Y300.00 Z5.00 E25.00
echo:Maximum Acceleration (units/s2):
echo:  M201 X3000 Y3000 Z100 E3000
echo:Acceleration (units/s2): P<print_accel> R<retract_accel> T<travel_accel>
echo:  M204 P800.00 R800.00 T1000.00
echo:Advanced: S<min_feedrate> T<min_travel_feedrate> B<min_segment_time_ms> X<max_xy_jerk> Z<max_z_jerk> E<max_e_jerk>
echo:  M205 S0.00 T0.00 B20000 X10.00 Y10.00 Z0.40 E1.00
echo:Home offset:
echo:  M206 X0.00 Y0.00 Z0.00
echo:Mesh Bed Leveling:
echo:  M420 S0 Z0.00
echo:  G29 S3 X1 Y1 Z0.00000
echo:  G29 S3 X2 Y1 Z0.00000
echo:  G29 S3 X1 Y2 Z0.00000
echo:  G29 S3 X2 Y2 Z0.00000
echo:Material heatup parameters:
echo:  M145 S0 H210 B70 F0
  M145 S1 H240 B110 F0
echo:PID settings:
echo:  M301 P22.20 I1.08 D114.00
echo:LCD Contrast:
echo:  M250 C200
echo:Z-Probe Offset (mm):
echo:  M851 Z0.00
ok
M503
echo:  G21    ; Units in mm
echo:  M149 C ; Units in Celsius

echo:Filament settings: Disabled
echo:  M200 D1.75
echo:  M200 D0
echo:Steps per unit:
echo:  M92 X80.00 Y80.00 Z400.00 E94.00
echo:Maximum feedrates (units/s):
echo:  M203 X300.00 Y300.00 Z5.00 E25.00
echo:Maximum Acceleration (units/s2):
echo:  M201 X3000 Y3000 Z100 E3000
echo:Acceleration (units/s2): P<print_accel> R<retract_accel> T<travel_accel>
echo:  M204 P800.00 R800.00 T1000.00
echo:Advanced: S<min_feedrate> T<min_travel_feedrate> B<min_segment_time_ms> X<max_xy_jerk> Z<max_z_jerk> E<max_e_jerk>
echo:  M205 S0.00 T0.00 B20000 X10.00 Y10.00 Z0.40 E1.00
echo:Home offset:
echo:  M206 X0.00 Y0.00 Z0.00
echo:Mesh Bed Leveling:
echo:  M420 S0 Z0.00
echo:  G29 S3 X1 Y1 Z0.00000
echo:  G29 S3 X2 Y1 Z0.00000
echo:  G29 S3 X1 Y2 Z0.00000
echo:  G29 S3 X2 Y2 Z0.00000
echo:Material heatup parameters:
echo:  M145 S0 H210 B70 F0
  M145 S1 H240 B110 F0
echo:PID settings:
echo:  M301 P22.20 I1.08 D114.00
echo:LCD Contrast:
echo:  M250 C200
echo:Z-Probe Offset (mm):
echo:  M851 Z0.00
ok

Terminating...
Thanks for using picocom

Use Ctrl+a Ctrl+x to quit picocom (cue vim jokes here).
References:

No comments:

Post a Comment

Hey... thanks for leaving a comment! Due to Casino spam, I've had to turn on moderation for some of the posts. Apologies - I do read every comment left!