You are not logged in.
I added a button on nextion to send the Gcode "M806" to the RAMPS,How can I implement this?
Offline
You need to post gcode with key called gcode to /gcode path.
Offline
Where is the /gcode path? Can you teach me a little more detail?
Offline
How can I send the Gcode from nextion to RPI?
Offline
I'm looking at the source available at https://github.com/Tibus/TouchScreen-For-NanoDLP
I do not see a /gcode directory. I, too, would like to add a custom button or two to the Nextion touchscreen.
Offline
You need to send post request from nextion side to nanodlp /gcode path.
Offline
It is very easy to do but it depends on your programming language.
If you want it to send through Linux terminal.
wget --post-data "gcode=M806" http://rpi_ip/gcode
Or with jquery
$.post("http://rpi_ip/gcode", {gcode: "M806"})
OR with nodejs
var request = require('request');
request.post('http://rpi_ip/gcode').form({gcode:'M806'})
Offline
Is this code written to Nextion's button event?
Offline
Hi MaxJewels,Thank you very much for your reply.Where can I find Julien Delnatte's z-axis page, or where can I download it?
Offline
I believe this is what he's referring to: https://github.com/Tibus/TouchScreen-Fo … s/zAxis.js
Offline
Ok, I've used the Nextion Editor to add buttons to the home screen (id's are b0 and b2) and I've adjusted the home.js file to include the following:
this.addListener("click_b0", function (e) {
_this2.changePage("/button/press/0");
});
this.addListener("click_b2", function (e) {
_this2.changePage("/button/press/1");
});
From what I see, this should allow me to press on these two buttons and get a changePage call to my buttons I made in NanoDLP.
I assume I hit compile and compiling adds all of the .js files from the repository into the .tft?
Offline
qingquan wrote:How can I send the Gcode from nextion to RPI?
Do you know a minimum of js programming? If you know it then just insert a custom button on nanoDLP and then retrieve it from the .js file on the page where you're hugging the button indicating the id from the nanoDLP .json file
Hi
I want to add code to this file"/home/pi/nextion/bin/plugins/nextion/pages/projector.js" to send "M806" code to ramps, can you tell me the specific code?
Replace the original instruction in this sentence:
this.addListener("click_b4", function () {
return _this2.nanoDLP.command("/shutter/open");
});
Offline