OctoPi not reading SD card or print progress from Ender 3 (SOLVED)

Unmark "Enable automatic firmware detection" and mark "Always assume SD card is present- Repetier" in Octroprint Settings / Firmware & Protocol.

3 Likes

Please re-read this entire thread and then let us know what part of "Solved by b-morgan in post #6" you don't understand.

1 Like

First of all, thanks for your effort and to be kind inenough to find a solution
I read the thread, and I'm confused
Do you have the plugin in the repositories or I have to write the file myself and put it in the plugin folder?
I have the same issue

Thanks

This is apparently an IQ test for Ender 3 owners and I don't know how the make it any easier for the owners without a large amount of work on my part and I don't own an Ender 3.

Reply #6 is marked as the solution to the problem. The first "grey" area is the code and this must be cut and pasted into a file created by the Ender 3 owner in the ~/.octoprint/plugins directory with the name Convert_TF_SD.py.

I don't know what else to do if these instructions are still too confusing for you.

2 Likes

Hello,
I am new to octoprint and i am having the same problem that other people are having, with my Ender 3, and i have a few questions. Firstly, where is the ~/.octoprint/plugins directory and how do i get to it. Second, do i use something like Notepad++ to create the .py file? Any help is welcome.
Thanks in advance!

The directory is on the RPi. Since you asked about Notepad++ I'm going to assume you have a Windows host. You will need Notepad++ (or Notepad on an up-to-date Windows 10), Putty, and (optionally) WinSCP. Different tools if you have a MacOS or a Linux host.

You can create the .py file with Notepad++ by cut and pasting the code I posted above or download this .zip file convert_TF_SD.zip (407 Bytes). If you create the file yourself, make sure to set the line endings to Unix (Edit, EOL Conversion). Use WinSCP to transfer the file to the listed directory on the RPi. Use the username "pi" and your password. The default for hidden files should be to show them but if not, https://winscp.net/eng/docs/ui_pref_panels to change it. Navigate to the local directory and the remote directory and upload.

You can also use Putty to make an SSH terminal connection to the RPi using the username "pi" and the password (which should have been changed from the default). You can now "cd .octoprint/plugins" and use "nano Convert_TF_SD.py" to create the file (nano is a very simple text editor with its commands listed at the bottom of the screen).

I guess a third method would be to shutdown the RPi, remove the SD card and insert it in your Windows system, and copy the file you created with Notepad++ to the card. Re-insert the card in the RPi and boot it, login with Putty, and "mv /boot/Convert_TF_SD.py ~/.octoprint/plugins".

Thank you @b-morgan ! I used the SSH method and it worked.

I tried the plugin and it successfully enabled Octoprint to see the files on the SD since the M20 command's result became "SD card ok". But when sending M27 in terminal it returns "TF printing byte/byte". What gives?

The plugin will not change what is received from the serial line (which is what the log shows) but how it is being read and thus interpreted by OctoPrint.

You will still see the broken responses but they should be understood correctly.

Oh, I see. So, this plugin cannot enable Octoprint to know which layer is being printed etc when printing manually from SD?

No. And that is also information that won't be pushed by firmware in general which is why there's always information missing with SD prints compared to streaming.

The plugin fixes the broken responses by the firmware, it doesn't add features, it makes existing features work after the printer vendor decided to break them.

I see.. Thanks again for the explanation. BTW, just wanted to let you know that I really enjoy Octoprint and I admire the work you've done! Again, Kudos!

1 Like

Hi All,

I can confirm that it works in an Ender 3 Pro purchased at the end of August.

Thanks for your contributions

I used Ender-3s printer, I cant get sd card file from octoprint. I just follwoed b-morgan steps , but I still cant get anything . So I Unmark "Enable automatic firmware detection" and mark "Always assume SD card is present- Repetier" in Octroprint Settings / Firmware & Protocol.It works well.

1 Like

plug-in works like a charm! thank you!

I guess what the plugin does is to intercept every line received by the printer. If it contains "SD" then it replaces "SD" with "TF". This approach has the drawback that a function is invoked (the callback itself) which itself does further more calls (basically find&replace).

Here I provide an alternate solution by directly patching the file that handles Octoprint's communication with the printer (comm.py) which from my point of view is more performant then to hook in a plugin. I have octoprint installed via pip in my home folder. Alternatively you can change COMM_FILE to whatever location fits for your installation.
MAKE A BACKUP OF comm.py FILE BEFORE YOU TRY THIS OR YOUT INSTALLATION MAYBE RUINED. DON'T DO THIS IF YOU HAVE NO CLUE WHAT ALL THIS MEANS

#/bin/bash
COMM_FILE="OctoPrint/venv/lib/python2.7/site-packages/octoprint/util/comm.py"
LINE_WITH_SD_IN_IT="elif 'SD card ok' in line and not self._sdAvailable"
SD_CONTAINING_STRING='SD card ok'
TF_CONTAINING_STRING='TF card ok'

LINE_IN_COMM_FILE=$(grep "$LINE_WITH_SD_IN_IT" "$COMM_FILE")
if [ "$LINE_IN_COMM_FILE" != "" ]
then
  echo "It seems the file $COMM_FILE requires patching. To continue hit enter"
  read
  sed -i "s/$SD_CONTAINING_STRING/$TF_CONTAINING_STRING/" $COMM_FILE
  echo "Please restart octoprint"
else
  echo "No need to patch $COMM_FILE"
fi

I placed this file in my home directory and made it executable (chmod +x). It has to be executed every time an update of octoprint overwrites the comm.py file.

I had the same issue and read the whole thread. It's disappointing that no one found the correct answer in this thread.

No plugin or changes to files are needed .. @NRom posted the correct solution twice:

1 Like

@Scott_Westberg b-morgan's #6 post may have been helpful previously but is no longer the best method, @NRom has posts below on how to fix this through the GUI, can you please change the solution to his post?

Why? If the solution he choosed works for him. The solution of NRom is another solution.

All I read here are workarounds, no solutions. I also tried the "Always assume SD card is present- Repetier" which resulted in other errors - I was no longer able to connect to my printer.

The problem is located in the Ender3's firmware. A solution would be to patch that - but that's out of scope. Another cleaner solution would be not to catch fixed strings in comm.py. Instead use translations and provide a translation file for each printer so that the whole parsing becomes independent of the strings themselves.