Hello droftarts,
I RTFM of both links and had a guess and used;
http://192.168.1.14/rr_gcode?gcode=M999
WOW! That worked.
Back to playing with the Duet.
Thanks again for your help.
Hello droftarts,
I RTFM of both links and had a guess and used;
http://192.168.1.14/rr_gcode?gcode=M999
WOW! That worked.
Back to playing with the Duet.
Thanks again for your help.
I tried the common keys (ENTER, ESC, DEL, SPACE, BACKSPACE etc ) to acknowledge the M291 message but no luck. I was hoping to hover the cursor over the ESTOP, use a shortcut to acknowledge the M291 message and then press the ESTOP before (very little time) the message comes up again. Regret not putting a pause in the macro.
Hello droftarts,
I cannot run anything from the console unless there is a way to append M999 in the browsers address bar. I am remotely logged in and the Duet has a static IP address 192.168.1.14 in the address bar. Is there some sort of HTML method to POST ??
There is no one to do a hard reset. Or is there a key board short cut to acknowledge the OK on the M291 message and or a keyboard short cut for ESTOP.? Maybe if I can quickly apply the two to get out of the loop.
Thanks again.
I am remotely logged into a laptop that has a Duet 6XD hanging off it.
I wrote a macro that is in a never ending loop that brings up a message using M291. I hit ok but then the message displays again and there is not enough time to hit the Estop between messages.
Is there a way to send a command to reboot the board from my browser in a remote location?
Thanks Mark
Hello zuoyan,
Thanks for message, you are spot about macro "blocking". There is a little more to the story. The input is fed from an output (I did this for testing as I am connected to the Duet remotely). So I would run the macro that runs the WHILE loop and as it is counting up I would run another macro to change the state of an output that is connected to the input (sensors.gpIn[2]) that we are testing. Once I got somebody to switch the input with a simple button, all worked as expected.
Thank you for all your help.
Hi mikeabuilder,
That's a top idea. Also modified the echo state during the WHILE loop;
var timeOut = 8 ; Set time out in seconds
var tooLong = 0 ; Reset
var count = 1 ; Counter reset to 1
var trippedInput = 0 ; Reset
echo "State of input before the WHILE loop is " , sensors.gpIn[2].value
G4 P2000 ; Pause for 2 seconds to see the input state
while sensors.gpIn[2].value == 0
echo var.count , "Seconds. Input state - " , sensors.gpIn[2].value
G4 P1000 ; Pause for 1 second
set var.count = var.count + 1
if var.count > var.timeOut
set var.tooLong = 1
break
echo "State of input after the WHILE loop is " , sensors.gpIn[2].value
if var.tooLong == 1
M291 P"Time Out" S2
else
M291 P"Input Tripped" S2
I notice that the input state only shows '1' if the input is high before starting the macro. If I switch the input high during the WHILE loop, the input state remains at '0' even after the while loop. Unexpected behavior. May need to restructure using IF statement but can not see a way to BRANCH to loop like using a GOTO statement.
Thanks again for the idea, showed something is not right.
Thanks dc42, I see you have been busy in the forums.
echo boards[0].firmwareVersion
Returns 3.5.1
As far as I know, the Duet is in Standalone mode ie we do NOT have an SBC like a RPI or other hanging off the Duet.
Thanks Mark
I have been trying to create a while loop that either breaks out after some time or when an input becomes high.
The following code sort of works,
If the input is high before running, the code goes through the while loop and displays the 'Input Tripped' message as expected.
If the input remains low the iterations/count are reached and breaks out of the while loop displaying the 'Time Out' message as expected.
However if the input goes from low to high during the WHILE loop it does not 'break' out and 'Times out'
It is almost as if the WHILE acts as an IF
I have tried several variations, like 'while true' , using the iterations variable etc but never had any luck achieving an expected result.
var timeOut = 8 ; Set time out in seconds
var tooLong = 0 ; Reset
var count = 1 ; Counter reset to 1
var trippedInput = 0 ; Reset
echo "State of input is " , sensors.gpIn[2].value
G4 P2000 ; Pause for 2 seconds to see the input state
while sensors.gpIn[2].value == 0
echo "Seconds " , var.count
G4 P1000 ; Pause for 1 second
set var.count = var.count + 1
if var.count > var.timeOut
set var.tooLong = 1
break
if var.tooLong == 1
M291 P"Time Out" S2
else
M291 P"Input Tripped" S2
I have had a look at other examples and spent several hours, on what I thought should be a simple execution of a WHILE loop but ............
My next idea is to try and structure the code not using any WHILE statement and using only IF statements. Getting clunkier as we go along.
Any ideas would be great.
Thanks Mark
Thanks for clarifying and providing the schematic showing the two inputs tied internally.
Thanks Mark
Sorry, I am not following, 'have set up GpIn port 2' ?
I kind of get the object model and have had success 'plucking' / reading / echoing elements / values from the arrays.
Are the physical/hardware tied together internally so you can only use one in software - Surely not.
And this is what adds to the confusion.
I am looking at the documentation that shows the pin naming and it seems logical (at least to me) that io8.in is an input and io8.in.iso is another input.
So
M950 J2 C"io8.in"
Maps io8.in to pin number J2
and
M950 J3 C"io8.in.iso"
would map the isolated input to J3
But obviously not??
How, if possible do we make use of both the GPIO input and the ISOLATED input as independent entities ????
Thanks Mark
Thanks for the clarification.
Here is screen shot. The temperatures all read!
Thanks again.
Other than bits of info scattered on the forums there seems to be no real 'How to' which has been my experience with the duet making more difficult than it needs to be to use.
My understanding is that the daemon.g file/macro/script runs about every 10 second if it exists in the sys directory (Same directory as the config.g file)
I have created a file named daemon.g in the sys directory.
The file has only one line of code
M117 "Hello"
This did not work but once I replaced the above line with
echo "Test"
it worked printing the word test in the console
Seemed like daemon.g was not starting but perhaps it's not a good idea to run macros from within it ?????
We have wired up three PT1000 into the three temperature sensor inputs (temp0, temp1, temp2). And tried variations of setting up the PT1000 sensors and heaters in config.g with the following;
; Sensors
M308 S0 P"temp0" Y"pt1000" A"E-Heat-0" ; configure sensor #0
M308 S1 P"temp1" Y"pt1000" A"E-Heat-1" ; configure sensor #1
M308 S2 P"temp2" Y"pt1000" A"E-Heat-2" ; configure sensor #2
; Heaters
M950 H0 C"out0" T0 ; create heater #0
M143 H0 P0 S200
M307 H0 B0 S1.00
M950 H1 C"out1" T1 ; create heater #1
M143 H1 S200
M307 H1 B0 S1.00
M950 H2 C"out2" T2 ; create heater #2
M143 H2 S200
M307 H2 B0 S1.00
; TOOLS
M563 P0 D0 H0 ; Create tool P-Tool_number D-Extruder_Drive H-Heaters F-Fans_to_use
M563 P1 D0 H1
M563 P2 D0 H2
Save the config.g and reset.
This has been the best outcome, 2 out of the three sensors are reading (confident that the hardware is working). But notice the naming is not correct (See attached image) The Heater names are Heater 0, Heater 1 and E-Heat-2. I expected to see E-Heat-0, E-Heat-1 and E-Heat-2.
I do not understand where the labels Heater 0 and Heater 1 are coming from ????
And not sure why the first PT1000 is not reading??
![alt text](image url)
Any ideas would be awesome
Thanks Mark
@droftarts Thank you for the replies, I now have my head around the object model's Arrays, Objects and Value. I installed the plug in, studied it and was able to 'pluck' values using the echo command for eg;
echo boards[0].mcuTemp.current
boards is an array, element 0 holds mcuTemp with the value current
I seem to have run into another problem on using the 6XD I/Os. There are opto isolated inputs and outputs as well as the GPIO inputs and outputs.
Maybe I am not understanding but if I try to configure number 8 opto as well as number 8 GPIO out like the following in config ;
M950 S9 C"io8.out" ; GPIO 8
M950 S8 C"!io8.out.iso" ; Isolated out 8
Then save, reset, and run
M98 P"config.g"
Returns
Error: Pin 'io8.out.iso' is not free
Another bruise on my head, This the only use of io8.out.iso
Not sure how io8.out.iso is the same as io8.out ???
The same happens with io8.in.iso and io8.in .
Is it a case of only being able to use one or the other??
On the positive,
I linked io8.out to io8.in with a jumper wire.
The following worked to setup a digital output and input.
M950 P9 C"io8.out"
M950 J2 C"io8.in"
In config.g, save and reset
M42 P9 S0 ;Turn off the output
echo sensors.gpIn[2].value ;Check the input
M42 P9 S1 ;Turn on the output
echo sensors.gpIn[2].value ;Check the input
Not sure where to check the output status in the object model ??
Hope this helps someone who comes across this who is trying to turn on off an output / check an input etc before they plant their fist into the screen.
Thanks Mark
Hi Tony,
Thanks for your reply. I was thinking on similar lines but incremental ie in the slicer set start g code to run M180
Then the Duet runs M180 which turns on the output, runs a while loop waiting for an input to change ie Heaters change voltage of an input on the duet board or powers one of the opto isolated inputs once they are up to temperature. Then the while loop is broken and can continue, Assume
T0 M568 S200
T1 M568 S220
T2 M568 S240
T3 M568 S250
This of coarse is simplified, there would be a few safety interlocks and checks.
In your example M1040, M568, M1060 run in parallel? The question would be bringing on outputs and checking inputs. I still having issues with both. I seem to have had success declaring outputs and inputs in the config.g file but only had success turning on the heater outputs from a macro. No luck turning on GPIO outputs or checking GPIO inputs. Any ideas or examples?
Thanks Mark
I have tried switching the input to GND, then checking for a change of input from the duet side, then tried switching the input to 3.3 volt looking for a change of state and then out desperation tried switching the input to 5 volt still with no changes. Perhaps my naming or syntax in the macro is incorrect. ie the hardware side is no issue but not sure about the naming. When running M950 in config we declare the pin as J1 ie
M950 J1 C"io6 . in" in the config.g file (The spaces between io6 and the . and in are intentional cause I cannot send this message for the system sees it as a link and blocks it)
But then when we try to check the inputs status in the macro we cannot use J1 - it gives an error.
So tried
if sensors.gpIn[6].value != 0
I have looked at the documentation and examples in the forums. I have tried variations but never see any sign of change on the software side. Also tried one of the opto isolated inputs;
M950 J1 C"!io5 . in . iso" -in config.g
But the same problems.
M950 J1 Gives the same message if the opto coupler is powered or not (24 volts at the input. The documentation states 10-50 volt so 24 volt should be safe and sufficient)
Also tried to see a change of state with the above lines in a macro adjusting the input number (or I think cause the naming is different)
Any help in using ie naming etc from a macro would be awesome because the frustration might cause me to see this control board as Frisbee that needs throwing!
Thanks Mark
I have been trying to create an input on io6 using
M950 J1 C"io6 . in" in the config.g file
Then tried to check the status from the console with;
M950 J1
But always get - Pin io6 . in, active, true
I tried changing the state of the input by tying the pin to GND and 3.3V but the message never changes. Also tried to check the status of the input using
M409 K"inputs" but the output is not clear which input I should be looking at on the list.
I also tried writing a simple macro
if sensors.gpIn[6].value != 0
M117 "Output should be on"
else
M117 "Output should be off"
Not sure is the pin naming in the macro is correct so cannot trust the output of this macro.
In any case there is no change in message from the macro even though there was a change of input.
Any help would be appreciated,
Thanks Mark