@chrishamm I have tried to run the command gpioget gpiochip4 28 and tried also with gpiochip0
and it gave me this error: gpioget: error reading GPIO values: No such file or directory
any suggestion?
@chrishamm I have tried to run the command gpioget gpiochip4 28 and tried also with gpiochip0
and it gave me this error: gpioget: error reading GPIO values: No such file or directory
any suggestion?
@chrishamm thank you for your reply. Yes I realized installing DSF is the easiest way.
However I have few questions regarding the connection between the SBC and duet:
are they 5 wire connection in total? is the connection below right?
Also how to identify the GpioChipDevice and TransferReadyPin? I couldn't get any info from gpioinfo and gpioget
Is It possible to send gcode command from a tinker board to a Duet board via SPI without installing the DSF on the Debian OS?
this is the code I am using with Python-periphery library but nothing is happening.
from periphery import SPI
spi = SPI("/dev/spidev1.0", 0, 1000000)
data_out = b'G1 Y180 F5000\n'
data_in = spi.transfer(data_out)
spi.close()
@Falcounet I am calling macros to rotate motors and control sensors.
the code is something like this:
def send_command_duet(command):
with serial.Serial('/dev/ttyACM0') as ser:
ser.setRTS(True)
ser.write(b'\n')
ser.write(command)
eof = False
while not eof:
line = ser.readline()
if line == b'ok\n':
eof = True
print(line)
while True:
Capture image
classify image
send_command_duet(command) #perform action
receive signal from duet to go to next iteration
@Falcounet I am performing some image classification in a loop on the RPi and based on that the duet will perform some actions. But sometimes the mechanism controlled by the duet gets jammed and the python code keeps running. So for each time the Rpi sends a command I would like the duet to be able to send back a signal/command in order for RPi to perform the next image classification.
@Falcounet Is it possible to communicate back from the Duet to the Raspberry Pi such as if a condition is met stop the python code?
I would really appreciate your help again
@jay_s_uk I believe this is a different question
Hi guys,
I am new to the duet, I have connected a duet3D Mini 5+ to a raspberry pi 4 through usb cable. I am trying to send a command to the duet in python to run a gcode file (macro) on duet3d 5mini+. Any suggestion on how to do that? thanks
@Falcounet I was able to get the motor to rotate with your code:
import serial
with serial.Serial('/dev/ttyACM0') as ser:
ser.setRTS(True)
ser.write(b'\n')
ser.write(bG0 Y30 F50000\n')
eof = False
while not eof:
line = ser.readline()
if line == b'ok\n':
eof = True
print(line)
thank you very much!!!!!!!!
@Falcounet it gives me a wrong wi fi address ----> b'WiFi IP address 255.255.255.255\n' thou..
Also, right now if I run :
import serial
ser = serial.Serial("/dev/ttyACM0", 115200)
time.sleep(1)
print('read')
ser.write(b"G0 Y30 F50000\n")
print('write')
time.sleep(2)
ser.close()
the code it doesn't get stuck anymore but still cannot get the motor to rotate
also what does this line mean?
b'Messages queued 244, send timeouts 242, received 0, lost 0, longest wait 0ms for reply type 0, free buffers 15\n'
@Falcounet in my case I have got this output:
b'=== Diagnostics ===\n'
b'RepRapFirmware for Duet 3 Mini 5+ version 3.2.2 running on Duet 3 Mini5plus WiFi (standalone mode)\n'
b'Board ID: QMD5L-P296U-D65J0-40KMY-2203Z-HKNTX\n'
b'Used output buffers: 1 of 40 (4 max)\n'
b'=== RTOS ===\n'
b'Static ram: 98732\n'
b'Dynamic ram: 106852 of which 68 recycled\n'
b'Never used RAM 39564, free system stack 152 words\n'
b'Tasks: NETWORK(ready,358) HEAT(blocked,315) CanReceiv(blocked,947) CanSender(blocked,372) CanClock(blocked,363) TMC(blocked,106) MAIN(running,517) IDLE(ready,20) AIN(blocked,269)\n'
b'Owned mutexes: WiFi(NETWORK) USB(MAIN)\n'
b'=== Platform ===\n'
b'Last reset 00:00:27 ago, cause: power up\n'
b'Last software reset at 2022-11-29 10:16, reason: User, GCodes spinning, available RAM 39564, slot 0\n'
b'Software reset code 0x0003 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x00000000 BFAR 0xe000ed38 SP 0x00000000 Task MAIN Freestk 0 n/a\n'
b'Error status: 0x00\n'
b'Aux0 errors 0,0,0\n'
b'Aux1 errors 0,0,0\n'
b'Supply voltage: min 0.0, current 24.2, max 24.3, under voltage events: 0, over voltage events: 0, power good: yes\n'
b'Driver 0: position 0, standstill, SG min/max 0/0, read errors 0, write errors 0, ifcnt 9, reads 3849, writes 9, timeouts 0, DMA errors 0\n'
b'Driver 1: position 0, standstill, SG min/max 0/0, read errors 0, write errors 0, ifcnt 9, reads 3849, writes 9, timeouts 0, DMA errors 0\n'
b'Driver 2: position 0, standstill, SG min/max 0/0, read errors 0, write errors 0, ifcnt 9, reads 3849, writes 9, timeouts 0, DMA errors 0\n'
b'Driver 3: position 0, standstill, SG min/max 0/0, read errors 0, write errors 0, ifcnt 9, reads 3848, writes 9, timeouts 0, DMA errors 0\n'
b'Driver 4: position 0, standstill, SG min/max 0/0, read errors 0, write errors 0, ifcnt 9, reads 3849, writes 9, timeouts 0, DMA errors 0\n'
b'Driver 5: position 0, assumed not present\n'
b'Driver 6: position 0, assumed not present\n'
b'Date/time: 1970-01-01 00:00:00\n'
b'Cache data hit count 59010343\n'
b'Slowest loop: 4.53ms; fastest: 0.13ms\n'
b'=== Storage ===\n'
b'Free file entries: 10\n'
b'SD card 0 detected, interface speed: 22.5MBytes/sec\n'
b'SD card longest read time 3.2ms, write time 0.0ms, max retries 0\n'
b'=== Move ===\n'
b'DMs created 83, maxWait 0ms, bed compensation in use: none, comp offset 0.000\n'
b'=== MainDDARing ===\n'
b'Scheduled moves 0, completed moves 0, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 0], CDDA state -1\n'
b'=== AuxDDARing ===\n'
b'Scheduled moves 0, completed moves 0, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 0], CDDA state -1\n'
b'=== Heat ===\n'
b'Bed heaters = 0 -1, chamberHeaters = -1 -1\n'
b'=== GCodes ===\n'
b'Segments left: 0\n'
b'Movement lock held by null\n'
b'HTTP is idle in state(s) 0\n'
b'Telnet is idle in state(s) 0\n'
b'File is idle in state(s) 0\n'
b'USB is ready with "M122" in state(s) 0\n'
b'Aux is idle in state(s) 0\n'
b'Trigger is idle in state(s) 0\n'
b'Queue is idle in state(s) 0\n'
b'LCD is idle in state(s) 0\n'
b'SBC is idle in state(s) 0\n'
b'Daemon is idle in state(s) 0\n'
b'Aux2 is idle in state(s) 0\n'
b'Autopause is idle in state(s) 0\n'
b'Code queue is empty.\n'
b'=== Network ===\n'
b'Slowest loop: 9.56ms; fastest: 0.00ms\n'
b'Responder states: HTTP(0) HTTP(0) HTTP(0) HTTP(0) FTP(0) Telnet(0), 0 sessions\n'
b'HTTP sessions: 0 of 8\n'
b'- WiFi -\n'
b'Network state is active\n'
b'WiFi module is connected to access point \n'
b'Failed messages: pending 0, notready 0, noresp 0\n'
b'WiFi firmware version 1.25\n'
b'WiFi MAC address f0:08:d1:02:e9:d4\n'
b'WiFi Vcc 3.35, reset reason Power up\n'
b'WiFi flash size 2097152, free heap 27528\n'
b'WiFi IP address 255.255.255.255\n'
b'WiFi signal strength 31dBm, mode 802.11n, reconnections 0, sleep mode modem\n'
b'Clock register 00002002\n'
b'Socket states: 0 0 0 0 0 0 0 0\n'
b'=== CAN ===\n'
b'Messages queued 244, send timeouts 242, received 0, lost 0, longest wait 0ms for reply type 0, free buffers 15\n'
b'ok\n'
@alankilian thank you for your reply. I have tried that but still didn't work
I have connected a duet3D Mini 5+ to a raspberry pi 4 with a usb cable. I am trying to send gcode commands to the duet through the serial package in python. I have a stepper motor connected to the duet. So i am trying to send a command to rotate it. when i run the python script it just stops at line (ser.write) and it doesn't execute the subsequent lines.
here is the code:
import serial
ser = serial.Serial("/dev/ttyACM0", 115200)
time.sleep(2)
print('read')
ser.write(b"G1 Y10 F5000\n")
print('write')
time.sleep(1)
ser.close()
if I connect the duet to the laptop and execute the gcode line in the YAT terminal it works fine.
Am I missing something?
@Falcounet yes. if I set a value for write_timeout in serial.Serial() then it exits the code with an error after the amount of time that I set, but still cannot tell the duet to rotate the motor
@Falcounet I have tried that and still no luck..
@Sindarius thank you for your reply. I have tried that and no luck..
if I connect the duet to the laptop and execute the gcode line in the YAT terminal it works fine.
I don't really know what I am missing
@jay_s_uk thank you for the response, I would prefer use only the usb port for communication
Hi all,
I am new to the duet. I have connected a duet3D Mini 5+ to a raspberry pi 4 with a usb cable. I am trying to send gcode commands to the duet through the serial package in python. I have a stepper motor connected to the duet. So i am trying to send a command to rotate it. when i run the python script in the image below it just stops at line 6 (ser.write) and it doesn't execute the subsequent lines.
Am I missing something?
I would really appreciate your help on how to do it.
thanks
Hi all,
I am new to the duet. I have connected a duet3D Mini 5+ to a raspberry pi 4 with a usb cable. I am trying to send gcode commands to the duet through the serial package in python. I have a stepper motor connected to the duet. So i am trying to send a command to rotate it. when i run the python script in the image below it just stops at line 6 (ser.write) and it doesn't execute the subsequent lines.
Am I missing something?
I would really appreciate your help on how to do it.
thanks