• Tags
  • Documentation
  • Order
  • Register
  • Login
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
10.6k
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
    last edited by 25 Apr 2020, 08:44

    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
      last edited by 25 Apr 2020, 13:45

      @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
      • undefined
        fractalengineer
        last edited by 25 Apr 2020, 14:26

        @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

        ? 1 Reply Last reply 25 Apr 2020, 14:35 Reply Quote 0
        • ?
          A Former User @fractalengineer
          last edited by 25 Apr 2020, 14:35

          @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
          • undefined
            fractalengineer
            last edited by 25 Apr 2020, 14:48

            @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

            ? 1 Reply Last reply 25 Apr 2020, 14:50 Reply Quote 0
            • ?
              A Former User @fractalengineer
              last edited by 25 Apr 2020, 14:50

              @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.

              undefined 1 Reply Last reply 25 Apr 2020, 15:05 Reply Quote 0
              • undefined
                fractalengineer @A Former User
                last edited by 25 Apr 2020, 15:05

                @bearer ok here's the test again with the gpio util:

                pi@duet3:~ $ DY=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 ;}
                Usage: gpio mode pin mode
                Usage: gpio read pin
                (Pin RDY/) should equal 1 (Pin CS/24)
                Usage: gpio read pin
                (Pin RDY/) 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.

                ...And wow, here's with a jump on the ribbon...

                pi@duet3:~ $ 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 ;}
                (Pin RDY/22) 0 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 | 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.

                Guess we found the culprit

                So can we try wiring using the duponts? what are the minimum wires required?

                Railcore II ZL

                ? 2 Replies Last reply 25 Apr 2020, 15:12 Reply Quote 0
                • ?
                  A Former User @fractalengineer
                  last edited by A Former User 25 Apr 2020, 15:12

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

                  (Pin RDY/22) 0 should equal 1 (Pin CS/24)

                  Now thats interesting.

                  I wasn't able to test if that can only mean the RDY pin isn't reading correctly, or if it could be the CS pin not being asserted correctly. But it is in line with the error from DCS.

                  I'd be surprised if DCS was blocking the CS pin but not the MISO/MOSI pins, but for good measure making sure DCS isn't running might be worth while.

                  Then you could attempt to actually measure the voltage, but the fact that it isn't working is sufficient to move on to the next Pi imo. Given the RDY pin is defined as an input it should be safe to jumper it straight to 3.3v and see if the value stays at 1. That would confirm if the problem is RDY or CS.

                  As a last resort you can attempt to change the RDY pin. Its defined in /opt/dsf/conf/config.json. But you could change the definition (for the test), move the jumper and re-run the test before editing the file. Changing RDY from 22 to 26 will mean you have to use a custom cable, and connect 26 on the Pi to 22 on the Duet. And jumper 26 to 24 to test with (the only change is RDY=26)

                  RDY=26 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 ;}
                  

                  Edit: oh damn, pins in config.json are broadcom gpios, which means you need to enter 7 in config.json to use physical pin2 26. Just to rule out differences between versions of rPi run gpio readall | cut -b41-90 | grep "^| 26 " | cut -b35-38 to check that it outputs 7, or use whatever number it does output.

                  1 Reply Last reply Reply Quote 0
                  • undefined
                    fractalengineer
                    last edited by 25 Apr 2020, 15:12

                    damn I can't edit the previous post but I figured I messed up the mirroring of the pins on the ribbon; here's the actual result

                    pi@duet3:~ $ 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 ;}
                    (Pin RDY/22) 0 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.

                    Railcore II ZL

                    ? 1 Reply Last reply 25 Apr 2020, 15:13 Reply Quote 0
                    • ?
                      A Former User @fractalengineer
                      last edited by 25 Apr 2020, 15:13

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

                      here's the actual result

                      ah, i got hung on the "interesting" part, which stayed the same so no worries.

                      Its the RDY or CS pin that should get focus for now.

                      1 Reply Last reply Reply Quote 0
                      • ?
                        A Former User @fractalengineer
                        last edited by 25 Apr 2020, 15:21

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

                        So can we try wiring using the duponts? what are the minimum wires required?

                        you can, but if jumpering it directly on the pi doesn't work, new wires isn't going to help.

                        The pins are shown on the Duet3 wiring diagram, in the note. This does visualize it (I've only connected two of the 5 grounds, but it should suffice). Connect 1:1 from the Duet to the Pi taking care to correctly identifying pin 1.
                        ca311733-c5d1-400f-9bec-de11a27423fe-image.png

                        undefined 1 Reply Last reply 25 Apr 2020, 15:28 Reply Quote 0
                        • undefined
                          fractalengineer @A Former User
                          last edited by fractalengineer 25 Apr 2020, 15:28

                          @bearer Ok so the next steps would be:

                          1-Stopping DCS and rerunning the test
                          2-Jump RDY (22) to 3.3v
                          3-Change RDY pin
                          4-Swap to the other Rpi
                          5-Wire with all jumpers

                          Am I correct?

                          Those are pretty heavy operations I'll try to hang there but I hope I won't mess anything

                          Here's 1-Stopping DCS and rerunning the test

                          pi@duet3:~ $ sudo systemctl stop duetwebserver
                          pi@duet3:~ $ sudo systemctl stop duetcontrolserver
                          pi@duet3:~ $ RDY=22 CS=24 ; {
                          gpio -1 mode $RDY in
                          > 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 ;}
                          (Pin RDY/22) 0 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.

                          Railcore II ZL

                          ? 1 Reply Last reply 25 Apr 2020, 15:33 Reply Quote 0
                          • ?
                            A Former User @fractalengineer
                            last edited by A Former User 25 Apr 2020, 15:33

                            @fractalengineer

                            Tbh, I'd start by just having jumpers on the other pi.

                            Then I'd move the jumpers to jump RDY(26) to CS(24) and run the gpio test again, targeting the correct RDY pin. edit: actually run the gpio test before and after changing the jumper, ignoring the output the first time (to ensure the pin is in input mode before connecting it)

                            If still no dice, then I'd wire RDY to 3.3v and run the gpio test again, targeting the correct RDY pin be it 22 or 26. (again run gpio test before making changes to ensure pin is input)

                            If all of that fails then no point in the rest.

                            If something succeeds then try with the duet and whatever combination of Pi and RDY pin gave the desired test result.

                            Also note I edited the post about editing config.json to reflect which pin number to enter if you get to that point.

                            undefined 1 Reply Last reply 25 Apr 2020, 15:45 Reply Quote 0
                            • undefined
                              fractalengineer @A Former User
                              last edited by 25 Apr 2020, 15:45

                              @bearer thanks;

                              Ok so here's my wiring;

                              I wired both grounds and both +5v; is this about right?

                              94243092_2542474216069513_7843403288077664256_n.jpg

                              Railcore II ZL

                              ? 1 Reply Last reply 25 Apr 2020, 15:48 Reply Quote 0
                              • ?
                                A Former User @fractalengineer
                                last edited by A Former User 25 Apr 2020, 15:48

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

                                I wired both grounds and both +5v; is this about right?

                                Yes, they're just double up to reduce voltage drop.

                                It looks right as far as I can tell; but not easy to see if blue/purple was swapped on the way over. The rest I'm reasonable confident in.

                                Although I'd be very surprised to see it working if the gpio test didn't indicate RDY and CS had the same readings on each line.

                                undefined 1 Reply Last reply 25 Apr 2020, 15:57 Reply Quote 0
                                • undefined
                                  dc42 administrators
                                  last edited by 25 Apr 2020, 15:52

                                  Does the soldering of the 26-way connector look OK on the underside of the Duet?

                                  Duet WiFi hardware designer and firmware engineer
                                  Please do not ask me for Duet support via PM or email, use the forum
                                  http://www.escher3d.com, https://miscsolutions.wordpress.com

                                  1 Reply Last reply Reply Quote 0
                                  • undefined
                                    chrishamm administrators
                                    last edited by 25 Apr 2020, 15:53

                                    Side note: DCS uses the driver that provides /dev/gpiochip because it allows faster reactions to pin level transitions than the standard sysfs GPIO driver. So I recommend using the tools from the gpiod package for GPIO troubleshooting (install via apt-get install gpiod). So by running gpiodetect you can see all the available GPIO lines. Once you shut down DCS, you can check the pin state by running gpioget 0 25 and that should output 1. I'll install that package by default in the next DuetPi version.

                                    Duet software engineer

                                    ? 1 Reply Last reply 25 Apr 2020, 15:55 Reply Quote 0
                                    • ?
                                      A Former User @chrishamm
                                      last edited by A Former User 25 Apr 2020, 15:55

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

                                      So I recommend using the tools from the gpiod package for GPIO troubleshooting

                                      ah, thats why wiringpi wasn't a dependency any more. I'll work it into the instructions at a later time. thanks for the heads up.

                                      So by running gpiodetect you can see all the available GPIO lines.

                                      i think you meant gpioinfo but close enough.

                                      1 Reply Last reply Reply Quote 0
                                      • undefined
                                        fractalengineer @A Former User
                                        last edited by 25 Apr 2020, 15:57

                                        @bearer damn you caught it!

                                        Thanks; ok so the problem still exists with the jumpers; not sure if relevant wired to duet but here's the test:

                                        pi@duet3:~ $ 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 ;}
                                        (Pin RDY/22) 0 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 | 05 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.

                                        @dc42 solderings look perfect; both on the duet and the pi

                                        Railcore II ZL

                                        ? 1 Reply Last reply 25 Apr 2020, 15:59 Reply Quote 0
                                        • ?
                                          A Former User @fractalengineer
                                          last edited by 25 Apr 2020, 15:59

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

                                          not sure if relevant wired to duet but here's the test:

                                          no its not, it'll only give the same readings if the pins are shorted; which is why I would wait with connecting the duet until testing with just jumpers show its working properly.

                                          1 Reply Last reply Reply Quote 0
                                          144 out of 166
                                          • First post
                                            144/166
                                            Last post
                                          Unless otherwise noted, all forum content is licensed under CC-BY-SA