PanelDue Sd-card

Hallo,
i sucessfull conected PanekDue to my Controller Board with Repetier 1.0.3dev.
Every thing works fine exept the listing of my SD-card.
After some problem tracking i found out the Command send from PanelDue is at a different format then Repetier expect.
Repetier expect "M20S2 P/" and PanelDue send "M20 S2 P0:/"
After i modified the Firmware of PanelDue the SD-Card was working flawless. But this makes PanelDue incompatible with all other Firmware(Marlin, RepRap, Smooth)
Without modification the Filelist is presented in a normal way and not in the Format of JSON.

Comments

  • In the past that was correct
            if (com->hasString() && com->text[1] == '2') { // " S2 P/folder"
                if (com->text[3] == 'P') {
                    sd.lsJSON(com->text + 4);
                }

    is what is happening. I guess we should not use com->text+4 but search for the / char as start to folder. Then old and new format will work.
  • Thank you for the fast response.

    I was using your recommendation and changed the last Line to:

    sd.lsJSON(com->text+(strchr(com->text,'/') - com->text));

    maybe not very effective or elegant, but this is working now with the default PanelDue commands.


  • Well adding and subtracting same value is in deed not effective:-)

    Here my version for next update of dev:

      case 20: // M20 - list SD card
    #if JSON_OUTPUT
        if (com->hasString() &&
            com->text[1] == '2') { // M20 S2 P/folder or M20 S2 P0:/folder
          if (com->text[3] == 'P') {
            char *slashPos = strchr(com->text, '/');
            if (*slashPos) {
              sd.lsJSON(slashPos);
            }
          }
        } else
          sd.ls();
        sd.ls();

    Hope it works as I have no paneldue for testing at the moment. But is is based on your solution, so it should work as well.
  • Your change is working well.
    I was sure my modification is not very effective, but i not so familiar with C++.

    Will this change be integratet into the next Repetier Update ? So i must not take care on updates.
  • Yes, next dev update will contain it. I think soon I will also publish dev as 1.0.4 stable.
Sign In or Register to comment.