Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Duet3/pi DCS is unavailable after wiring 24V

    Scheduled Pinned Locked Moved
    Duet Hardware and wiring
    duet 3 rasberry pi
    8
    166
    11.3k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A Former User?
      A Former User @chrishamm
      last edited by

      @chrishamm said in Duet3/pi flashing Diag LED after wiring 24V DCS is unavailable:

      It must be the connection from the Pi to the Duet 3

      of curiosity what does DCS say if it gets a response, but the wrong due to say wrong firmware or spi clock?

      1 Reply Last reply Reply Quote 0
      • chrishammundefined
        chrishamm administrators
        last edited by chrishamm

        It's also worth starting DCS with -l debug to see a few more details. If the SPI clock is too high, you usually see warnings about failed transfers and/or checksum errors.

        Duet software engineer

        A Former User? 1 Reply Last reply Reply Quote 1
        • A Former User?
          A Former User @chrishamm
          last edited by A Former User

          @chrishamm said in Duet3/pi flashing Diag LED after wiring 24V DCS is unavailable:

          It's also worth starting DCS with -l debug to see a few more details. If the SPI clock is too high, you usually see warnings about failed transfers and/or checksum errors.

          -l debug shows the difference, no difference without it.

          #with 22 low
          pi@raspberrypi:~ $ /opt/dsf/bin/DuetControlServer -l debug
          [debug] Lost connection to Duet
             System.OperationCanceledException: Timeout while waiting for transfer ready pin ...
          [error] Duet is not available
          
          #with 22 high
          pi@raspberrypi:~ $ /opt/dsf/bin/DuetControlServer -l debug
          [debug] Lost connection to Duet
             System.OperationCanceledException: Board is not available (no header) ...
          [error] Duet is not available
          

          Maybe change the first to Duet is not ready?

          edit: sudo wasn't needed (at that point in starting up at least)
          edit2: whops, wasn't testing the latest version, error changed to fatal, but same string.

          1 Reply Last reply Reply Quote 0
          • chrishammundefined
            chrishamm administrators
            last edited by

            Yes I thought it already showed more details so I'm going to improve that in v2.1.1.

            Duet software engineer

            1 Reply Last reply Reply Quote 0
            • fractalengineerundefined
              fractalengineer @chrishamm
              last edited by

              @chrishamm I just checked continuity once more; ever pin beeps from one board to the other.

              Also checked for any short to ground; it’s all clear with the multimeter.

              I’ll try wiring pin by pin using bridges; really can’t figure out what else to do

              Unless the previous duet fried the pi4 too...

              Railcore II ZL

              A Former User? 1 Reply Last reply Reply Quote 0
              • A Former User?
                A Former User @fractalengineer
                last edited by A Former User

                @fractalengineer said in Duet3/pi flashing Diag LED after wiring 24V DCS is unavailable:

                really can’t figure out what else to do

                if you've got a steady hand you could measure the voltage on pin 22 with the Duet running (before and after starting DCS) and then cross refrene with the output of running DSC with -l debug to at least verify if the Pi is reading pin 22 correctly.

                see next post instead:

                1 Reply Last reply Reply Quote 1
                • A Former User?
                  A Former User
                  last edited by A Former User

                  Hold off on that; not sure why loopback testing didn't occur to me a week ago ... but:

                  https://github.com/rm-hull/spidev-test

                  combine with wiringpi's gpiocommand and two jumpers to do full (or 80%? as SCK isn't tested) diagnostic on the rPi.

                  place jumper over 22-24 and 19-21, then run commands as shown, compare to output below.
                  9ff41e90-9272-4588-bceb-75e5acf19c86-image.png
                  (Quick copy/paste to get the spidev-test tool and wiringpi):

                  sudo apt install -y git wiringpi
                  git clone https://github.com/rm-hull/spidev-test ~/spidev-test
                  cd ~/spidev-test
                  gcc spidev_test.c -o spidev_test
                  

                  Commands to run:

                  RDY=22 CS=24 ; { 
                  gpio -1 mode $CS out
                  gpio -1 mode $RDY in
                  gpio -1 write $CS 1 && echo "(Pin RDY/$RDY) `gpio -1 read $RDY` should equal `gpio -1 read $CS` (Pin CS/$CS)"
                  gpio -1 write $CS 0 && echo "(Pin RDY/$RDY) `gpio -1 read $RDY` should equal `gpio -1 read $CS` (Pin CS/$CS)"
                  { ~/spidev-test/spidev_test -v -s 8000000 -D /dev/spidev0.0 && echo RX should equal TX. ;} | tail -n3 | cut -b-100 ;}
                  

                  What output should look like:

                  (Pin RDY/22) 1 should equal 1 (Pin CS/24)
                  (Pin RDY/22) 0 should equal 0 (Pin CS/24)
                  TX | FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D
                  RX | FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D
                  RX should equal TX.
                  

                  Repeat with wires jumpering the far side of the ribbon cable if test with jumpers on the rPi is passed.
                  (Print quality comments can be addressed to Tiertime pending full Duet conversion of the Up Mini 2)

                  1 Reply Last reply Reply Quote 1
                  • Danalundefined
                    Danal
                    last edited by

                    I don't know about the "W" part... but I'll take a look.

                    I can also spiff it up so that its output is very clear for an "end user", in the Duet environment.

                    Delta / Kossel printer fanatic

                    A Former User? 1 Reply Last reply Reply Quote 0
                    • A Former User?
                      A Former User @Danal
                      last edited by

                      @Danal wrong topic?

                      1 Reply Last reply Reply Quote 0
                      • Danalundefined
                        Danal
                        last edited by Danal

                        I thought a post said: "If a C Wizard happens along"... and then got edited... the request being to make spidev_test more duet specific, easier to interpret. ?

                        Hopefully, because I did take a look.

                        I am not a Wizard, but:

                        ./DuetTestSPI
                        spi mode: 0x0
                        bits per word: 8
                        max speed: 8000000 Hz (8000 KHz)
                        TX | FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D  | ......@....�..................�.
                        RX | FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D  | ......@....�..................�.
                        Loopback on pins 19-21, SPI MOSI MISO tested successfully.
                        All tests passed, SPI should work for Duet 3 <> Raspberry Pi.
                        

                        (removed jumper)

                        ./DuetTestSPI
                        spi mode: 0x0
                        bits per word: 8
                        max speed: 8000000 Hz (8000 KHz)
                        TX | FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D  | ......@....�..................�.
                        RX | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  | ................................
                        Send and receive buffers do not match! 
                        Check jumpers on pins 19-21; if they are correct this machine has an SPI problem. 
                        Aborted
                        

                        Much clearer messages, etc. This is 1/2 of your suggestion above, I'll do the 22-24 part in a few min, and then post a link.

                        Delta / Kossel printer fanatic

                        A Former User? 1 Reply Last reply Reply Quote 0
                        • A Former User?
                          A Former User @Danal
                          last edited by A Former User

                          @Danal said in Duet3/pi flashing Diag LED after wiring 24V DCS is unavailable:

                          I thought a post said: "If a C Wizard happens along"... and then got edited...

                          it did, but "W" didn't make much sense; anyways, as DSF depends on wiringpi anyways figured less effort than forking the spi tools. (and easier to change if other boards have different gpio mapping)

                          1 Reply Last reply Reply Quote 0
                          • Danalundefined
                            Danal
                            last edited by

                            Understood... it was obscure. Perhaps should have said "not a Wiz, but"

                            Delta / Kossel printer fanatic

                            1 Reply Last reply Reply Quote 0
                            • Danalundefined
                              Danal
                              last edited by Danal

                              OK, here you go, a 'tester' for SPI on a Pi, to see if it is hardware OK to run with a Duet.

                              Installation:  Either:
                                git clone https://github.com/DanalEstes/DuetTestSPI
                              or, if you want just the binary:
                                wget https://github.com/DanalEstes/DuetTestSPI/raw/master/DuetTestSPI
                                chmod 744 DuetTestSPI
                              
                              Run
                              Place a jumper on Pi GPIO pins 22-24 and 19-2, then:
                              
                              ./DuetTestSPI
                              
                              All messages should be self explanatory.
                              

                              Delta / Kossel printer fanatic

                              1 Reply Last reply Reply Quote 0
                              • Danalundefined
                                Danal
                                last edited by

                                @bearer

                                I invoked the great architectural pattern of "reuse" and put your jumper pic on the github for this. I will pull it if you'd rather I not use it.

                                Delta / Kossel printer fanatic

                                1 Reply Last reply Reply Quote 0
                                • A Former User?
                                  A Former User
                                  last edited by

                                  Everything on the forum is CC-BY-SA AFAIK.

                                  I think I'll more or less just add some curly bracets to clean up the output and stick with it as is; simple to understand, simple to change if someone uses a different user configurable ready pin or spi device, stays up to date with past, present and future (physical) pin mappings. It also provides the techies with all the jucy details without dumming it down.

                                  If the gloas was to make it shorter, it'll all fit on one line, but defeats the simple to undertand and simple to change part. Could even tee and grep it for humanreadable output, but as the SCK signal isn't covered saying "all good" feels wrong, miss matched data will suffice as a failed test.

                                  pi@raspberrypi:~ $ RDY=22 CS=24 ; { gpio -1 mode $CS out ; gpio -1 mode $RDY in ; echo "Pin RDY/$RDY Pin CS/$CS" ; gpio -1 write $CS 1 && echo "         `gpio -1 read $RDY`         `gpio -1 read $CS` <-should be equal" ; gpio -1 write $CS 0 && echo "         `gpio -1 read $RDY`         `gpio -1 read $CS` <-should be equal" ; echo TX should equal RX: ; ~/spidev-test/spidev_test -v -s 8000000 -D /dev/spidev0.0 | tail -n2 | cut -b-100;}
                                  Pin RDY/22 Pin CS/24
                                           1         1 <-should be equal
                                           0         0 <-should be equal
                                  TX should equal RX:
                                  TX | FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D
                                  RX | FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D
                                  
                                  1 Reply Last reply Reply Quote 0
                                  • A Former User?
                                    A Former User
                                    last edited by

                                    @fractalengineer the lovely Duet people released new updates RFF3.01-RC10 and DSF2.1.1.

                                    While neither will solve your problem, it'll help diagnose the SPI issues with clearer error messages printed without needing the -l debug parameter.

                                    Between that and the loopback test we should have done ages ago I think we should pinpoint the problem at last.

                                    Fingers crossed!

                                    1 Reply Last reply Reply Quote 1
                                    • fractalengineerundefined
                                      fractalengineer
                                      last edited by

                                      @bearer @Danal wow thanks for the overwhelming help guys; really grateful for the support 🙂

                                      Even though most of it goes above my head as I'm not a codehead at all, I managed to install and run the SPI test on my own pi3

                                      @bearer I bought the dupont cables and bridged the pin as per your picture; here's the results of the SPI test:

                                      pi@duet3:~/spidev-test $ RDY=22 CS=24 ; {
                                      > gpio -1 mode $CS out
                                      > gpio -1 mode $RDY in
                                      > gpio -1 write $CS 1 && echo "(Pin RDY/$RDY) `gpio -1 read $RDY` should equal `gpio -1 read $CS` (Pin CS/$CS)"
                                      > gpio -1 write $CS 0 && echo "(Pin RDY/$RDY) `gpio -1 read $RDY` should equal `gpio -1 read $CS` (Pin CS/$CS)"
                                      > { ~/spidev-test/spidev_test -v -s 8000000 -D /dev/spidev0.0 && echo RX should equal TX. ;} | tail -n3 | cut -b-100 ;}
                                      -bash: gpio: command not found
                                      -bash: gpio: command not found
                                      -bash: gpio: command not found
                                      -bash: gpio: command not found
                                      TX | FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D
                                      RX | FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D
                                      RX should equal TX.
                                      

                                      IF I REMOVE THE JUMPERS:

                                      pi@duet3:~/spidev-test $ RDY=22 CS=24 ; {
                                      > gpio -1 mode $CS out
                                      > gpio -1 mode $RDY in
                                      > gpio -1 write $CS 1 && echo "(Pin RDY/$RDY) `gpio -1 read $RDY` should equal `gpio -1 read $CS` (Pin CS/$CS)"
                                      > gpio -1 write $CS 0 && echo "(Pin RDY/$RDY) `gpio -1 read $RDY` should equal `gpio -1 read $CS` (Pin CS/$CS)"
                                      > { ~/spidev-test/spidev_test -v -s 8000000 -D /dev/spidev0.0 && echo RX should equal TX. ;} | tail -n3 | cut -b-100 ;}
                                      -bash: gpio: command not found
                                      -bash: gpio: command not found
                                      -bash: gpio: command not found
                                      -bash: gpio: command not found
                                      TX | FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D
                                      RX | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                                      RX should equal TX.
                                      

                                      Looks like the Pi is fine?

                                      Onto updating everything then.

                                      If the ribbon still gives us trouble I'll be able to wire using the duponts

                                      Railcore II ZL

                                      A Former User? 1 Reply Last reply Reply Quote 0
                                      • A Former User?
                                        A Former User @fractalengineer
                                        last edited by

                                        @fractalengineer said in Duet3/pi flashing Diag LED after wiring 24V DCS is unavailable:

                                        Looks like the Pi is fine?

                                        40% fine, seems duet have changed a dependency so you're missing the GPIO utility. but the data part of the SPI bus is fine.

                                        run sudo apt install -y wiringpi and do it again.

                                        and you can also test the ribbon by making some male jumpers (or use male to male duponts for that matter).
                                        5d54dd44-2ed7-4582-b35d-a8184f1b6784-image.png

                                        It'd be interesting to see what DuetControlServer says after the update, because its looking less likely to be a rPi fault.

                                        1 Reply Last reply Reply Quote 0
                                        • fractalengineerundefined
                                          fractalengineer
                                          last edited by

                                          @bearer nice; I'm getting a new error message indeed;

                                          pi@duet3:~ $ apt list 2>/dev/null | grep duet
                                          duetcontrolserver/unstable,now 2.1.1 armhf [installed,automatic]
                                          duetruntime/unstable,now 2.1.1 armhf [installed,automatic]
                                          duetsd/unstable,now 1.0.6 all [installed,automatic]
                                          duetsoftwareframework/unstable,now 2.1.1 armhf [installed]
                                          duettools/unstable,now 2.1.1 armhf [installed,automatic]
                                          duetwebcontrol/unstable,now 2.1.5 all [installed,automatic]
                                          duetwebserver/unstable,now 2.1.0 armhf [installed,automatic]
                                          pi@duet3:~ $ sudo journalctl -u duetcontrolserver -e
                                          Apr 25 15:46:18 duet3 systemd[1]: duetcontrolserver.service: Succeeded.
                                          Apr 25 15:46:23 duet3 systemd[1]: duetcontrolserver.service: Service RestartSec=5s expired, scheduling restart.
                                          Apr 25 15:46:23 duet3 systemd[1]: duetcontrolserver.service: Scheduled restart job, restart counter is at 61.
                                          Apr 25 15:46:23 duet3 systemd[1]: Stopped Duet Control Server.
                                          Apr 25 15:46:23 duet3 systemd[1]: Started Duet Control Server.
                                          Apr 25 15:46:24 duet3 DuetControlServer[3286]: Duet Control Server v2.1.1
                                          Apr 25 15:46:24 duet3 DuetControlServer[3286]: Written by Christian Hammacher for Duet3D
                                          Apr 25 15:46:24 duet3 DuetControlServer[3286]: Licensed under the terms of the GNU Public License Version 3
                                          Apr 25 15:46:26 duet3 DuetControlServer[3286]: [info] Settings loaded
                                          Apr 25 15:46:26 duet3 DuetControlServer[3286]: [info] Environment initialized
                                          Apr 25 15:46:27 duet3 DuetControlServer[3286]: [fatal] Could not connect to Duet (Timeout while waiting for transfer ready pin)
                                          

                                          I'll try the gpio test

                                          Railcore II ZL

                                          A Former User? 1 Reply Last reply Reply Quote 0
                                          • A Former User?
                                            A Former User @fractalengineer
                                            last edited by

                                            @fractalengineer said in Duet3/pi flashing Diag LED after wiring 24V DCS is unavailable:

                                            Apr 25 15:46:27 duet3 DuetControlServer[3286]: [fatal] Could not connect to Duet (Timeout while waiting for transfer ready pin)

                                            That is suggesting no connection to the Duet, the gpio test could rule out the Pi, new cable could rule out the ribbon.

                                            fractalengineerundefined 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Unless otherwise noted, all forum content is licensed under CC-BY-SA