druckabfragen für den flashforge adventurer 5m (pro) 3d drucker

Begonnen von the ratman, 13 April 2024, 17:33:20

Vorheriges Thema - Nächstes Thema

the ratman

hiho,
nachdem ich hier ja sehr kompetente hilfe bei den abfragen bekommen hab, will ich das gesamtkonstrukt aus httpmod, doif und (für win) rainmeter zur verfügung stellen.

was ist das ganze?
einfach ein paar daten des aktuellen drucks im 3d-drucker.

es gibt allerdings immer noch das ungelöste problem, dass der drucker abfragen scheinbar nur alle 35 sekunden zulässt. das ganze reicht also grade mal für eine übersicht, aber nicht für eine layer/%-genau info.

und ja, es ist mir klar, dass das sehr viel hier wesentlich besser hinbekommen würden. aber mir reichts mal. ausserdem freu' ich mich über jeden hier, der denselben drucker hat und mit mir infos austauschen will.

bitte nicht vergessen, die ip-adresse des druckers, den namen der steckdose im doif, usw. anzupassen.
wer mein doif nicht verwendet, muß auch mal die disable=1 in den httmods rauswerfen.

die 3 httpmod abfragen:
1) infos zu "% fertig" und die maximale anzahl der layer, sowie die aktuelle layerhöhe
defmod adv5mpro1 HTTPMOD http://192.168.178.9:8899/command 35
attr adv5mpro1 alias die fabrik - fortschritt
attr adv5mpro1 enableControlSet 1
attr adv5mpro1 group 3d druck
attr adv5mpro1 httpVersion 1.1
attr adv5mpro1 icon 3d_printer
attr adv5mpro1 reading01Name prozentIst
attr adv5mpro1 reading01Regex byte (\d+)
attr adv5mpro1 reading02Name layerIst
attr adv5mpro1 reading02Regex Layer: (\d+)
attr adv5mpro1 reading03Name layerSoll
attr adv5mpro1 reading03Regex Layer: \d+\/(\d+)
attr adv5mpro1 requestData ~M27
attr adv5mpro1 room computer
attr adv5mpro1 showBody 1
attr adv5mpro1 stateFormat <table>\
<tr>\
<td align="left">fertig: </td><td align="left">prozentIst&nbsp;;%</td><td></td><td></td>\
</tr><tr>\
<td align="left">layer: </td><td align="left">layerIst</td><td>&nbsp;;von&nbsp;;</td><td align="left">layerSoll</td>\
</tr>\
</table>
attr adv5mpro1 timeout 35

setstate adv5mpro1 <table>\
<tr>\
<td align="left">fertig: </td><td align="left">0&nbsp;;%</td><td></td><td></td>\
</tr><tr>\
<td align="left">layer: </td><td align="left">0</td><td>&nbsp;;von&nbsp;;</td><td align="left">0</td>\
</tr>\
</table>

2) model-namen (vollständig und auch nur der name) und der zustand und modus in dem sich der drucker gerade befindet
defmod adv5mpro2 HTTPMOD http://192.168.178.9:8899/command 35
attr adv5mpro2 alias die fabrik - infos
attr adv5mpro2 disable 1
attr adv5mpro2 enableControlSet 1
attr adv5mpro2 group 3d druck
attr adv5mpro2 httpVersion 1.1
attr adv5mpro2 icon 3d_printer
attr adv5mpro2 reading01Name modell
attr adv5mpro2 reading01Regex CurrentFile: (.*)
attr adv5mpro2 reading02Name mode
attr adv5mpro2 reading02Regex MoveMode: (.*)
attr adv5mpro2 reading04Name status
attr adv5mpro2 reading04Regex MachineStatus: (.*)
attr adv5mpro2 requestData ~M119
attr adv5mpro2 room computer
attr adv5mpro2 showBody 1
attr adv5mpro2 stateFormat <table>\
<tr>\
<td align="left">name: </td><td align="left">modell</td>\
</tr><tr>\
<td align="left">modus: </td><td align="left">mode</td></td>\
</tr><tr>\
<td align="left">zustand: </td><td align="left">status</td></td>\
</tr>\
</table>
attr adv5mpro2 timeout 35
attr adv5mpro2 userReadings modell_simpel { my $js = ReadingsVal($NAME,"modell",0);;if ($js =~/zGapTest/){return "teste düsen kalibrierung";;} $js=~s/.gcode//;; $js=~s/_/ /g;;$js;;}

setstate adv5mpro2 <table>\
<tr>\
<td align="left">name: </td><td align="left">auftragslos</td>\
</tr><tr>\
<td align="left">modus: </td><td align="left">aus</td></td>\
</tr><tr>\
<td align="left">zustand: </td><td align="left">aus</td></td>\
</tr>\
</table>

3) die aktuellen düsen- und bett-temperaturen, plus deren soll
defmod adv5mpro HTTPMOD http://192.168.178.9:8899/command 35
attr adv5mpro alias die fabrik - temperaturen
attr adv5mpro enableControlSet 1
attr adv5mpro group 3d druck
attr adv5mpro httpVersion 1.1
attr adv5mpro icon 3d_printer
attr adv5mpro reading01Name nozzleIst
attr adv5mpro reading01Regex T0:(\d+\.\d+)
attr adv5mpro reading02Name nozzleSoll
attr adv5mpro reading02Regex T0:\d+\.\d+/(\d+)
attr adv5mpro reading03Name bedIst
attr adv5mpro reading03Regex B:(\d+\.\d+)
attr adv5mpro reading04Name bedSoll
attr adv5mpro reading04Regex B:\d+\.\d+/(\d+)
attr adv5mpro requestData ~M105
attr adv5mpro room computer
attr adv5mpro showBody 1
attr adv5mpro stateFormat <table>\
<tr>\
<td align="left">düse: </td><td align="left">nozzleIst°C</td><td>&nbsp;;von&nbsp;;</td><td align="left">nozzleSoll°C</td>\
</tr><tr>\
<td align="left">bett: </td><td align="left">bedIst°C</td><td>&nbsp;;von&nbsp;;</td><td align="left">bedSoll°C</td>\
</tr>\
</table>
attr adv5mpro timeout 35

setstate adv5mpro <table>\
<tr>\
<td align="left">düse: </td><td align="left">X°C</td><td>&nbsp;;von&nbsp;;</td><td align="left">X°C</td>\
</tr><tr>\
<td align="left">bett: </td><td align="left">X°C</td><td>&nbsp;;von&nbsp;;</td><td align="left">X°C</td>\
</tr>\
</table>

da ich noch eine steuerbare steckdose hab, um den drucker abzustellen, verwend' ich auch gleich folgendes doif, um den readings passende namen zu verpassen, wenn der drucker aus ist. außerdem stell' ich die httpmods ab damit
defmod doif_adv5mpro_abfrageio DOIF ( [HUEDevice13:state] eq "off" )\
\
(set adv5mpro stop)\
(set adv5mpro1 stop)\
(set adv5mpro2 stop)\
(setreading adv5mpro bedIst X )\
(setreading adv5mpro bedSoll X )\
(setreading adv5mpro nozzleIst X )\
(setreading adv5mpro nozzleSoll X )\
(setreading adv5mpro1 layerIst 0 )\
(setreading adv5mpro1 layerSoll 0 )\
(setreading adv5mpro1 prozentIst 0 )\
(setreading adv5mpro2 mode aus )\
(setreading adv5mpro2 modell auftragslos )\
(setreading adv5mpro2 status aus )\
\
DOELSEIF\
\
( [HUEDevice13:state] eq "on" )\
\
(set adv5mpro start)\
(set adv5mpro1 start)\
(set adv5mpro2 start)
attr doif_adv5mpro_abfrageio alias die fabrik - abfragen start stop
attr doif_adv5mpro_abfrageio do always
attr doif_adv5mpro_abfrageio group 3d druck
attr doif_adv5mpro_abfrageio icon helper_doif
attr doif_adv5mpro_abfrageio room computer

das mach' ich vor allem, dass der rainmeter in meinem win ruhe gibt - wer den auch verwendet:
[Rainmeter]
Update=1000
BackgroundMode=0
DynamicWindowSize=1

################################################################################################################
#####   BEZEICHNUNG
################################################################################################################

[linie]
Meter=Image
X=0
Y=530
W=140
H=1
SolidColor=0,0,0,255
[kreis_aussen]
Meter=Roundline
x=140
y=500
W=60
H=60
StartAngle=(Rad(270))
RotationAngle=(Rad(360))
LineWidth=1
LineStart=28
LineLength=30
LineColor=0,0,0,255
Solid=1
AntiAlias=1
[kreis_füllung]
Meter=Roundline
x=141
y=501
W=58
H=58
LineWidth=1
LineStart=0
LineLength=29
LineColor=200,200,200,255
Solid=1
AntiAlias=1
[Text1]
Meter=String
X=5
Y=503
FontFace=Bahnschrift
FontColor=0,0,0,255
FontSize=10
AntiAlias=1
Text=in der fabrik


################################################################################################################
#####   INFO % fertig
################################################################################################################


[MeasureFertig]
Measure=WebParser
URL=http://192.168.178.8:8083/fhem?cmd={ReadingsVal(%22adv5mpro1%22,%22prozentIst%22,0)}&XHR=1
RegExp=(.*)
UpdateRate=10
StringIndex=1
[MeasureProzent]
Measure=Calc
Formula=(MeasureFertig % 100) + 1
MinValue=1
MaxValue=100
[MeterFertigRand]
Meter=Image
SolidColor=0,0,0,255
X=5
Y=520
W=107
H=20
[MeterFertigBar]
Meter=BAR
MeasureName=MeasureProzent
X=6
Y=521
W=105
H=18
BarColor=128,0,0,255
SolidColor=232,232,232,255
BarOrientation=Horizontal
[MeterFertigText]
Meter=String
MeasureName=MeasureFertig
X=7
Y=522
FontFace=Bahnschrift
FontColor=0,0,0,255
FontSize=11
AntiAlias=1
AutoScale=1
Text=%1%


################################################################################################################
#####   INFO ModellName
################################################################################################################


[MeasureModell]
Measure=WebParser
URL=http://192.168.178.8:8083/fhem?cmd={ReadingsVal(%22adv5mpro2%22,%22modell_simpel%22,0)}&XHR=1
RegExp=(.*)
UpdateRate=10
StringIndex=1
[textModell]
Meter=String
MeasureName=MeasureModell
X=5
Y=490
StringAlign=left
FontFace=Bahnschrift
FontColor=0,0,0,255
FontSize=10
AntiAlias=1
Text=%1


################################################################################################################
#####   INFO Layeranzahl
################################################################################################################


[MeasureLayerIst]
Measure=WebParser
URL=http://192.168.178.8:8083/fhem?cmd={ReadingsVal(%22adv5mpro1%22,%22layerIst%22,0)}&XHR=1
RegExp=(.*)
UpdateRate=10
StringIndex=1
[MeasurelayerSoll]
Measure=WebParser
URL=http://192.168.178.8:8083/fhem?cmd={ReadingsVal(%22adv5mpro1%22,%22layerSoll%22,0)}&XHR=1
RegExp=(.*)
UpdateRate=10
StringIndex=1
[LayerEineZeile]
Meter=String
FontFace=Bahnschrift
FontColor=100,100,100,255
FontSize=12
AntiAlias=1
X=5
Y=544
Text=layer [&MeasureLayerIst] von [&MeasurelayerSoll]
DynamicVariables=1

################################################################################################################
#####   INFO IO
################################################################################################################

[kreis3_aussen]
Meter=Roundline
X=110
Y=510
W=40
H=40
StartAngle=(45*(PI/180))
RotationAngle=(270*(PI/180))
LineWidth=1
LineStart=19
LineLength=20
LineColor=0,0,0,255
Solid=1
AntiAlias=1
[kreis3_füllung]
Meter=Roundline
x=111
y=511
W=38
H=38
LineWidth=1
LineStart=0
LineLength=19
LineColor=200,200,200,255
Solid=1
AntiAlias=1

[MeasureIO]
Measure=WebParser
URL=http://192.168.178.8:8083/fhem?cmd={ReadingsVal(%22HUEDevice13%22,%22onoff%22,0)}&XHR=1
RegExp=(.*)
UpdateRate=1
StringIndex=1

[schalterIO]
Meter=Image
MeasureName=MeasureIO
ImageName=%1.png
X=113
Y=513
W=32
H=32
LeftMouseUpAction=[!ToggleMeterGroup "IO"]|[!UpdateGroup "IO"]


################################################################################################################
#####   INFO KAMERA + POPUP BROWSER
################################################################################################################

[MeterCam]
Meter=Image
ImageName=cam.png
X=145
Y=505
W=50
H=50
LeftMouseUpAction=["C:\Program Files (x86)\Microsoft\Edge\Application\msedge_proxy.exe"  --profile-directory=Default --app-id=nibhlpbnnhfiklkjbbokjbjmdhingghe --app-url=http://192.168.178.9:8080/stream_simple.html --app-launch-source=4]

################################################################################################################
#####   POPUP IO-SCHALTER
################################################################################################################

[io_kreis_aussen]
Group=IO
Hidden=1
Meter=Roundline
X=170
Y=530
LineWidth=2
LineStart=0
LineLength=40
LineColor=20,20,20,150
Solid=1
AntiAlias=1
[io_kreis_füllung]
Group=IO
Hidden=1
Meter=Roundline
X=171
Y=531
LineWidth=1
LineStart=0
LineLength=40
LineColor=200,200,200,150
Solid=1
AntiAlias=1

[io_schalter]
Group=IO
Hidden=1
Meter=Image
MeasureName=MeasureIO
ImageName=%1.png
X=122
Y=483
W=90
H=90
LeftMouseUpAction=["#CURRENTPATH#WebPost.exe" "http://192.168.178.8:8083/fhem?cmd.HUEDevice13=set HUEDevice13 toggle"]|[!ToggleMeterGroup "IO"]
das sieht dann so aus Du darfst diesen Dateianhang nicht ansehen.
mittlerweile hat der auch einen schönen %-balken unter der %-zahl *g*
das videofenster kommt aus dem microsft-edge - mit dem ich den aufruf einfach als app gespeichert hab.

hier WebPost.exe noch die webPost.exe. die gehört zum script ins selbe verzeichnis und schaltet die steckdose.

des weiteren ein paar grafiken für den anfang. die gehören auch einfach ins verzeichnis des scripts
→do↑p!dnʇs↓shit←

the ratman

#1
und hier noch die readingsgroup mit allen daten + cam. angepasst für meinen handy-floorplan.
defmod rg_ffadv5mpro readingsGroup HUEDevice13:state,modell_simpel@adv5mpro2\
adv5mpro:<düse:&nbsp;;>,nozzleIst,<von>,nozzleSoll\
adv5mpro:<bett:&nbsp;;>,bedIst,<von>,bedSoll\
<hr>\
adv5mpro1:<fertig:&nbsp;;>,prozentIst\
adv5mpro1:<layer:&nbsp;;>,layerIst,<von>,layerSoll\
adv5mpro2:<zustand:&nbsp;;>,status\
adv5mpro2:<aktuell:&nbsp;;>,mode\
<hr>\
adv5mpro:?!cam
attr rg_ffadv5mpro cellStyle {\
'r:1,c:1' => 'style="text-align:center;;"',\
'r:1,c:2' => 'style="border:1px solid;; -moz-border-radius:4px;; border-radius:4px;; padding:5px;; margin:5px;; float:center;; color:333333;; width:100%;; height:20px;; vertical-align:middle;; text-align:center;; align:center;;"'\
}
attr rg_ffadv5mpro commands { \
'state.off' => 'set %DEVICE on',\
'state.on' => 'set %DEVICE off'\
}
attr rg_ffadv5mpro icon 00-03
attr rg_ffadv5mpro noheading 1
attr rg_ffadv5mpro nolinks 1
attr rg_ffadv5mpro nonames 1
attr rg_ffadv5mpro nostate 1
attr rg_ffadv5mpro notime 1
attr rg_ffadv5mpro room hidden
attr rg_ffadv5mpro valueColumns {\
'name' => 'colspan="3";;',\
'cam' => 'colspan="4";; rowspan="4";;',\
'mode' => 'colspan="3";;',\
'status' => 'colspan="3";;'\
}
attr rg_ffadv5mpro valueFormat {\
'cam' => '<img src=http://192.168.178.9:8080/?action=stream" width=100&#37;;>'\
}
attr rg_ffadv5mpro valueIcon {\
'state.on' => 'control_standby@green',\
'state.off' => 'control_standby@red'\
}
attr rg_ffadv5mpro valueSuffix {\
'nozzleIst' => '&nbsp;;°c',\
'nozzleSoll' => '&nbsp;;°c',\
'bedIst' => '&nbsp;;°c',\
'bedSoll' => '&nbsp;;°c',\
'prozentIst' => '&nbsp;;%'\
}
→do↑p!dnʇs↓shit←

the ratman

#2
neuigkeiten:
hab die disable 0/1 herausgenommen, braucht ja nicht wirklich wer. was mich da wieder geritten hat?

hinweis: seit dem letzten firmware-update kann man den stream unter http://192.168.178.9:8080/?action=stream nur noch einmal gleichzeitig sehen, wer den stream mehrmals gelichzeitig sehen möchte, hat pech. der stream unter 192.168.178.9:8080/stream_simple.html scheint ganz verstorben zu sein. ob das ein fehler ist oder so gewollt, weiß ich nicht.
es gibt auch wohl keine einstellungsseite mehr für den stream - zumindest ist die alte tod und eine eventuell neue kenne ich nicht.

außerdem gibts nun von ff selber für ios und android eigene apps, da kann ich ned mithalten: https://www.flashforge.com/product-detail/flash-maker

einzig ein tipp bleibt mir noch: wer orca zum slicen verwendet, sollte beim original 2.0 bleiben, und nicht beim orca von ff (1.7x). blieben nur leute, die unbedingt die 0.25 und 0.8 nozzle-deffinitionen braucht. die kommen beim orginal-orca wohl erst in der 2.1 version.
→do↑p!dnʇs↓shit←