I’ve been using Chilipeppr for several months now to wirelessly connect with my TinyG through a Rpi2 running the JSON server and absolutely loving it! I have implemented the touch probe feature and GPIO server which allow me to control my mill from across the room!
Ever since I got the GPIO JSON server set up, I have been hoping to add physical ‘feed hold’, ‘pause’ and ‘resume’ buttons right next to my machine so I don’t have to run across the room to my computer to stop it.
Has anyone installed physical buttons to interface (through the RPi) with Chilipeppr and the TinyG? If not, does anyone have advice on the best way to accomplish this?
Might be as simple as adding a key binding script to rpi and have it monitor gpio pins for response then execute the keyboard shortcuts chilipeppr recognizes
I would have the buttons have a script that injects the command into SPJS via websocket. I wouldn’t have it be done via the GPIO server, back to browser, back to SPJS.
As I am not a master of coding John’s solution is probibly the best one please heed his advice over mine @Zachary_Milroy my analisys of the problem comes from basic problem solving of industrial electrical issues where I hand off my problem analysis to an engineer that fixes the problem. In this case John is the engineer
Injecting straight to SPJS is one way. I’m doing that in my shuttleCP stuff on the raspberry pi. Another thing to consider is how absolute you want that feed hold button to be. If you want to make sure there is no chance of some software not being connected or a funny somewhere, you could skip all the software and use the pins directly on the tinyg itself to command feed hold. I built something like this using a wireless remote control thing from adafruit. It let me set a pin high or low using buttons on a remote. Pretty easy.
Thank you for the feedback everyone! I will take a stab at creating a GPIO script on the Raspi to inject SPJS commands this weekend and see what I can hack up. Note, I am a novice to this wonderful world of the Raspi and coding, so I will probably have additional questions.
@Frank_Graffagnino could you kindly provide some more information on how you connected buttons directly to the TingG to send commands directly? Did you re-define the Amax/Amin pins?
I was assuming the same pins were available on the tinyG. If they aren’t, that’s a bummer. Seems like a hardware way to issue a feed hold would be something you would want. Also a reset/abort button. Sorry, I’m not familiar with how to do that on TinyG. My apologies.
Pins that cause a feed hold are currently running in the g2 code base, which is operating at firmware version 0.98. they are flexible and assignable. (“Pause” is essentially a feed hold). But to resume from a pin is potentially dangerous and should be done through the UI. There is an interlock function in 0.98 that can be used to do this, but we think it’s better to resume motion with an explicit user command.
These features will be migrated the the v8 code base as part of firmware version 0.98. We are currently working to close out version 0.97, then we will be bringing in 0.98