talk to duet from a 2nd micro-controller? August 12, 2018 05:02AM |
Registered: 9 years ago Posts: 280 |
Re: talk to duet from a 2nd micro-controller? August 12, 2018 07:35AM |
Registered: 10 years ago Posts: 14,672 |
Quote
shadowphile
Hi. I am using Arduino board in my delta for miscellaneous functions like indicators, panic buttons, or jog controls, maybe a Home button..
These will be tied to the hardware buttons on a panel I printed out. I want to use those buttons to send Gcode from the Arduino to the Duet.
I can't tell from the schematics if there is even a port other than the USB. Is it possible to (easily) send commands through that port?
(I have the Duet Ethernet BTW)
Quote
shadowphile
On a similar subject, is it possible to set up the Duet to execute a Gcode whenever one of it's digital IO pins is toggled?
Re: talk to duet from a 2nd micro-controller? August 16, 2018 03:12PM |
Registered: 9 years ago Posts: 465 |
Re: talk to duet from a 2nd micro-controller? August 17, 2018 07:47AM |
Registered: 10 years ago Posts: 14,672 |
Quote
SupraGuy
So if I am reading this correctly...
The PanelDue connector could be connected to a Raspberry Pi GPIO UART for serial communication, and using this, I could (at least in theory) use the Pi's HDMI/USB to replicate/enhance the PanelDue's functionality?
Quote
SupraGuy
I see that the power pin on the Duet is labelled as 5V, I presume that's an output to power the PanelDue. What kind of current can it supply? (Enough to power up the Pi?)
Quote
SupraGuy
Does the Duet just update the PanelDue, or does the panel have to poll the board for information? Where do i find computational information to provide line checksums? (I'm actually kind of excited about this as a possibility.)
Re: talk to duet from a 2nd micro-controller? August 18, 2018 02:09AM |
Registered: 8 years ago Posts: 5,232 |
Re: talk to duet from a 2nd micro-controller? August 25, 2018 06:54PM |
Registered: 9 years ago Posts: 280 |
Re: talk to duet from a 2nd micro-controller? August 26, 2018 01:37AM |
Registered: 10 years ago Posts: 14,672 |
Re: talk to duet from a 2nd micro-controller? September 02, 2018 06:12PM |
Registered: 9 years ago Posts: 280 |
Re: talk to duet from a 2nd micro-controller? September 03, 2018 01:54AM |
Registered: 10 years ago Posts: 14,672 |
Re: talk to duet from a 2nd micro-controller? September 03, 2018 07:00PM |
Registered: 9 years ago Posts: 280 |
Re: talk to duet from a 2nd micro-controller? September 04, 2018 02:44AM |
Registered: 10 years ago Posts: 14,672 |
Re: talk to duet from a 2nd micro-controller? September 04, 2018 04:09PM |
Registered: 9 years ago Posts: 280 |
Re: talk to duet from a 2nd micro-controller? September 04, 2018 05:28PM |
Registered: 9 years ago Posts: 465 |
Quote
dc42
If you don't have a PanelDue connected to your Duet, then the simplest option is to use the PanelDue port. This is a standard async serial port using 3.3V signals levels (so you will need to level shift them if you want to connect it to an Arduino with 5V signal levels). You can send GCodes to this port. By default, the baud rate is 57600 and the commands must include line numbers and checksums for integrity checking; but you can use M575 in config.g to change these.
Re: talk to duet from a 2nd micro-controller? September 04, 2018 06:08PM |
Registered: 9 years ago Posts: 280 |
Re: talk to duet from a 2nd micro-controller? September 20, 2018 01:16PM |
Registered: 9 years ago Posts: 465 |
#!/usr/bin/python # Test to interface to a Duet Wifi over the serial port, hopefully able to read # some keyboard information, (Later have mouse clicks and other inputs) and send # simple gcode to the Duet serial port and read back responses import serial import time portDuet = serial.Serial("/dev/serial0", baudrate=57600, timeout=1.0) iLineNumber=1 # Calculate line checksums def fnCheckSum(strString): iCS = 0; for chrChar in strString: iCS = iCS ^ ord(chrChar); return(iCS); # Add Line numbers and checksums to strings def fnVetLine(strString): if len(strString) == 0: return(strString); strString = "N" + str(iLineNumber) + " " + strString; iCheckSum = fnCheckSum(strString); strString += "*" + str(iCheckSum); return(strString); # Read a NL terminated line from the serial port def fnReadLine(portPort): strRV = ""; while True: chrChar = portPort.read(); strRV += chrChar; if chrChar != "": if ord(chrChar) == 10 or ord(charChar) == 13: return(strRV); else: return(strRV); strGCode = "M552"; strSendCode = fnVetLine(strGCode); print strSendCode; portDuet.write(strSendCode); strResponse=fnReadLine(portDuet); print strResponse;
Re: talk to duet from a 2nd micro-controller? September 21, 2018 12:23PM |
Registered: 9 years ago Posts: 465 |
Re: talk to duet from a 2nd micro-controller? September 21, 2018 12:27PM |
Registered: 10 years ago Posts: 14,672 |
Re: talk to duet from a 2nd micro-controller? September 24, 2018 11:52AM |
Registered: 9 years ago Posts: 465 |
{"status":"I","heaters":[2000.0,2000.0],"active":[0.0,0.0],"standby":[0.0,0.0],"hstat":[0,0],"pos":[0.000,0.000,0.000],"machine":[0.000,0.000,0.000],"sfactor":100.00,"efactor":[100.00],"babystep":0.000,"tool":-1,"probe":"0","fanPercent":[30.00,100.00,100.00,0.00,0.00,0.00,0.00,0.00,0.00],"fanRPM":0,"homed":[0,0,0],"msgBox.mode":-1}
Re: talk to duet from a 2nd micro-controller? September 25, 2018 03:07PM |
Registered: 10 years ago Posts: 14,672 |
Quote
SupraGuy
I also have a question about the position response. There seems to be 2 sets "pos" and "machine" I've been working under the assumption that "pos" is the position that the software has been told to go to, and "machine" is the actual position which may be en route during a move. probably for my purposes the difference isn't too important, but it would be good to know.
Re: talk to duet from a 2nd micro-controller? September 26, 2018 06:21PM |
Registered: 9 years ago Posts: 465 |
Quote
RepRap Wiki
I=idle, P=printing from SD card, S=stopped (i.e. needs a reset), C=running config file (i.e starting up), A=paused, D=pausing, R=resuming from a pause, B=busy (e.g. running a macro), F=performing firmware update
Re: talk to duet from a 2nd micro-controller? September 27, 2018 02:33AM |
Registered: 10 years ago Posts: 14,672 |