colinrgodsey / step-daemon

stepd - External planner and stepper for 3d printing
GNU General Public License v3.0
98 stars 8 forks source link

Connection Error #10

Closed rafaelbiasi closed 3 years ago

rafaelbiasi commented 3 years ago

When I try to connect to the printer the error happens:

Offline (Error: TypeError: 'write() argument must be str, not bytes' @ comm.py:_do_send_without_checksum:3593) 2020-10-08_15-45

octoprint.log

rafaelbiasi commented 3 years ago

I have almost no Python skills, I don't know if it's the right way.

I replaced the 'subprocess' with 'pexpect' and managed to make it work. I also comment StepdServiceLogger. Then, I increase 'devStettingsTimeout' in 'pipeline/config_handler.go', because my printer have a slow initialization.

So, now, I got the following error in terminal tab:

Send: M420V1
Recv: Cap:VOLUMETRIC:1
Recv: Cap:AUTOREPORT_TEMP:1
Recv: Cap:PROGRESS:0
Recv: Cap:PRINT_JOB:1
Recv: Cap:AUTOLEVEL:1
Recv: Cap:RUNOUT:0
Recv: Cap:Z_PROBE:1
Recv: Cap:LEVELING_DATA:1
Recv: Cap:BUILD_PERCENT:0
Recv: Cap:SOFTWARE_POWER:0
Recv: Cap:TOGGLE_LIGHTS:0
Recv: Cap:CASE_LIGHT_BRIGHTNESS:0
Recv: Cap:EMERGENCY_PARSER:0
Recv: Cap:PROMPT_SUPPORT:0
Recv: Cap:SDCARD:1
Recv: Cap:AUTOREPORT_SD_STATUS:0
Recv: Cap:LONG_FILENAME:0
Recv: Cap:THERMAL_PROTECTION:1
Recv: Cap:MOTION_MODES:0
Recv: Cap:ARCS:0
Recv: Cap:BABYSTEPPING:0
Recv: Cap:CHAMBER_TEMPERATURE:0
Recv: M420V1
Recv: error: failed parsing gcode (strconv.Atoi: parsing "420V1": invalid syntax)
Changing monitoring state from "Operational" to "Error: failed parsing gcode (strconv.Atoi: parsing "420V1": invalid syntax)"
Send: M112
Send: N6 M112*39
Send: N7 M104 T0 S0*38
Send: N8 M140 S0*109
Changing monitoring state from "Error: failed parsing gcode (strconv.Atoi: parsing "420V1": invalid syntax)" to "Offline (Error: failed parsing gcode (strconv.Atoi: parsing "420V1": invalid syntax))"
Connection closed, closing down monitor

Then loss of connection to printer.

rafaelbiasi commented 3 years ago

I got work. This 'M420V1' gcode is sent by ABL Expert Plugin. I edited to send with space: 'M420 V1'

colinrgodsey commented 3 years ago

good catch! there should definitely be more graceful handling for general parsing errors like that

Kannix2005 commented 3 years ago

Hey, i got the same problem, can you describe the steps you´ve done to fix this? I honestly got no idea.

Best

colinrgodsey commented 3 years ago

@Kannix2005 what g-code is it failing on? you should be able to find that g-code (or the source of it) and modify it to correct the gcode.

colinrgodsey commented 3 years ago

This should be fixed in the latest commit. If you're using OctoPrint, you'll need to grab the new plugin (URL listed on the README) as the new version requires the newer plugin. Let me know if its still causing issues!