Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send commands from RPI #51

Open
ameennihad opened this issue May 21, 2018 · 13 comments
Open

Send commands from RPI #51

ameennihad opened this issue May 21, 2018 · 13 comments

Comments

@ameennihad
Copy link

I have a typical setup of tinyg and Rasberry PI running SPJS, my computer is few meters away from my CNC machine, sometimes I need to adjust XTZ and zero the machine when I'm near it without going beck and forth to the computer, what is the possibility of doing that from keyboard or game controller connected to RPI? Or possibly few buttons connected to GPIO pins?

I'm thinking of writing Python script to send command to SPJS.

Any better ideas?

@chilipeppr
Copy link
Owner

chilipeppr commented May 21, 2018 via email

@ameennihad
Copy link
Author

A side from analog input of the joystick, is it possible to run the same code on ESP8266?

@chilipeppr
Copy link
Owner

chilipeppr commented May 23, 2018 via email

@ameennihad
Copy link
Author

I'm considering ESP8266 because I have number of unused boards, but no ESP32.

@chilipeppr
Copy link
Owner

chilipeppr commented May 23, 2018 via email

@ameennihad
Copy link
Author

I know, but shipping to Iraq takes 60 day.

@ameennihad
Copy link
Author

ESP8266 is running out of memory, code might work with some optimization but I don't think it worth trying, I'll order ESP32, in the meantime I try to port your code using Python and use a usb game controller connected to RPI.

@ameennihad
Copy link
Author

I ended up writing the code in c++, I have a functional code now, I can control the machine with a gamepad connected to Raspberry PI and do other stuff like zero-out the machine. I'm considering the following features:

  • Memic the function of touch plate.
  • Connect E-Stop to RPi GPIO and send feedhold when the switch is pressed, I had issues connecting the switch directly to tinyg.

I have a questions:

  • Is it possible to tell SPJS to run the loaded gcode in CP? I guess no!

@chilipeppr
Copy link
Owner

chilipeppr commented Jun 4, 2018 via email

@chilipeppr
Copy link
Owner

chilipeppr commented Jun 4, 2018 via email

@ameennihad
Copy link
Author

The "data" object passed to onChiliPepprBroadcast function is the message "start-job", there is no data.Cmd or data.Msg both are undefined! I just changed the if statement to following to make it work:
if (data == "start-job")
I'm sending the command this way: ws->send("broadcast start-job");
Am I missing something or this is a bug in your macro?

@chilipeppr
Copy link
Owner

chilipeppr commented Jun 5, 2018 via email

@chilipeppr
Copy link
Owner

chilipeppr commented Jun 5, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants