Lua Modul
Hallo, wir kann ich in einem Lua Modul den gesendeten Befehl M355 S1 oder M355 S0 auslesen. Das Beispiel mit der LED läuft unter Repetier Server im ordner Lua. Aber wie fange ich den String M355 S1 S0 ab um ihn in Lua auszuwerten, und einen GPIO des Raspberry Pi damit zu schalten.
Hello, we can read out the sent command M355 S1 or M355 S0 in a Lua module. The example with the LED runs under Repetier Server in the Lua folder. But how do I catch the string M355 S1 S0 to evaluate it in Lua and switch a GPIO with it. ( Raspberry Pi )
Hello, we can read out the sent command M355 S1 or M355 S0 in a Lua module. The example with the LED runs under Repetier Server in the Lua folder. But how do I catch the string M355 S1 S0 to evaluate it in Lua and switch a GPIO with it. ( Raspberry Pi )
Comments
server:registerResponseHandler(callback)
Registrers a callback that gets called for every line a printer returns. Use this if you need to analyse printer responses. The callback needs to accept the paramater (printer,response).
so only when firmware would return something in response you could track it with lua.Alternative solution:
You can modify the firmware description:
to contain a @execute lightOn or lightOff command and define them in extcommands.xml as described in advanced configuration in manual. In the scripts you would then change the gpio instead. Benefit is no slowdown for a watcher.
RepetierServer ---- Zwischenspeicherdatei -- Raspberry etc.