Page 1 of 1

Developing GRBL for Chilipeppr.com

Posted: Wed Jul 16, 2014 5:57 pm
by jarretl
Shifting discussion from PCB thread http://www.shapeoko.com/forum/viewtopic.php?f=28&t=3797

Xaracen:
Per your last post in the linked thread above, I have also been reviewing the code for the tinyg planner and agree with you that mainly a simple check of the ok status is needed. Most of the visual elements could be removed, or replaced with an output of the main stored values on the users gshield (run a $$ command and display some of the key values in the widget, possibly even let a user update settings via input boxes).
One other thing I noticed in the UGS code was some hardcoded values for returning to home or zeroing location depending on which version of GRLB was connected (v8, v8c, v9) so this may need to be considered if different gcode instructions are needed depending on the version of grbl, to accomplish the same tasks from the xyz widget. hardcoded values here.

jlauer:
i'm still trying to get the serial json server running on mac, your github description is a bit limited and my knowledge of the 'GO' language is non-existant.
I've installed google's GO tools, and am able to run GO scripts, but what's the next step in compiling this? It seems to be looking for other dependencies from github in a very random /usr/local... path.
Any advice or additional build instructions for OSX you could throw my way? If i can get it working, maybe I will push an update to your github readme with steps for building on osx.

Additionally, I am unfamiliar with how JSFiddle works, I opened your code for the XYZ widget and made some changes (without forking it to my own account). I hit update, but have no idea if it sends those changes to you for review or if they are just lost? I was attempting to fix an issue where navigating with the arrow keys & pgup/pgdwn would cause the browser to scroll in the respective direction at the same time as jogging the machine. :)

Cheers,
-J.

Re: Developing GRBL for Chilipeppr.com

Posted: Wed Jul 16, 2014 6:07 pm
by jlauer
Wow. Awesome feedback. I agree with everything you were thinking. Would love to jump on a google hangout with you on all these but am traveling right now. I will try to respond later today.

Re: Developing GRBL for Chilipeppr.com

Posted: Wed Jul 16, 2014 6:13 pm
by jlauer
Watch the video on the hello world in this wiki for help on forking.https://github.com/synthetos/TinyG/wiki/Chilipeppr

Re: Developing GRBL for Chilipeppr.com

Posted: Wed Jul 16, 2014 7:06 pm
by Xaracen
jarretl, yes, I saw that in UGS, too, so I went looking to see why. That was last week, and I'd been wandering around Github at various grbl versions, UGS, TinyG yesterday, and also in various wikis, just gathering information and understanding. There's a lot to take in and digest, then you go and look for more. As I said it'll be a while before I start tinkering in earnest, but it is beginning to come together. I've always needed a real project to focus on before I am able take on any new skills and understanding. I need to have a solid practical context to hang ideas, concepts, problems and solutions on, or it just doesn't make real sense to me.

It has been a long time since I did any coding and things have moved on enormously, but I do want to get back into it now that I have retired and have some time to fill.

John, yes, it looks like that script will be the key one. I'll have some questions no doubt but that can wait till I've done some serious digesting! :D

Re: Developing GRBL for Chilipeppr.com

Posted: Thu Jul 17, 2014 1:58 am
by jlauer
jarretl wrote: i'm still trying to get the serial json server running on mac, your github description is a bit limited and my knowledge of the 'GO' language is non-existant.
I've installed google's GO tools, and am able to run GO scripts, but what's the next step in compiling this? It seems to be looking for other dependencies from github in a very random /usr/local... path.
Any advice or additional build instructions for OSX you could throw my way? If i can get it working, maybe I will push an update to your github readme with steps for building on osx.
There is a tutorial at http://www.cyberciti.biz/faq/installing ... -mac-os-x/
1. You will need to install Xcode from the Apple store first as it has the gcc compiler in it that Go will require to compile the serial port code.
2. Then install Go on the mac. It will put it in something like /usr/local/go. Make sure to open a new terminal after install and type "go" to see if it's in your path. It should execute go and show you a response. If it doesn't, add go to your path.
3. Then make a directory in your home folder called something like "gocode". You need to create an environment variable called GOPATH that points to this folder. You could just type "export GOPATH=$HOME/gocode" to have it point to the "gocode" directory you made.
4. Then cd into your gocode directory.
5. Type "go get github.com/johnlauer/serial-port-json-server". This will get my project from github and download all the dependent projects. You can then cd into src/github.com/ to see all the directories that were created.
6. Change directory into the serial-port-json-server directory at "gocode/src/github.com/johnlauer/serial-port-json-server" and type "go build"
7. It will build the binary and you should then just be able to type "./serial-port-json-server" to execute it and it should run fine. It will bind to port 8989 on your local machine. You can now load ChiliPeppr and connect to your IP address of your machine running the server and be all set.
jarretl wrote: Additionally, I am unfamiliar with how JSFiddle works, I opened your code for the XYZ widget and made some changes (without forking it to my own account). I hit update, but have no idea if it sends those changes to you for review or if they are just lost? I was attempting to fix an issue where navigating with the arrow keys & pgup/pgdwn would cause the browser to scroll in the respective direction at the same time as jogging the machine. :)
Hit "Fork" to create a forked version of ChiliPeppr's version. You must be logged in to JSFiddle for it to save the fork under your own ID. Then modify your code and hit "update". Notice it adds a new number to the URL to show you which version it created. You can go back to any previous version of your code just by changing that number to an earlier number. When you are happy and want to make your code be your main code, hit "Set as Base" and it makes that version of your code be your main code for that JSFiddle. Every time you hit "update" it will create a new version. Just say "set as base" to keep making it be your master version.

You do have to fork a workspace on ChiliPeppr and make it point to your new widget instead of the old widget. You also have to "Fork Bootscript" in the upper right corner menu to create a new top-level directory on ChiliPeppr.com that you own. You make that "Boot script" point to your forked workspace that loads your forked widget. So forking is really 3 steps (1. Fork widget. 2. Fork workspace. 3. Fork boot script)

Re: Developing GRBL for Chilipeppr.com

Posted: Thu Jul 17, 2014 5:02 am
by jarretl
Awesome; thanks for all the info.
The GOPATH was the problem, once I got that set and did a 'go get ...' to pull down a couple github dependencies, the build worked perfectly. I am able to run the server now, and connect via chilipeppr.

I will start playing with altering the tinyg widget for use with grbl over the next few days and will report back on my progress.

Also thanks for clarifying the forking process for workspaces/widgets, I am now set up at http://chilipeppr.com/jarret and http://jsfiddle.net/user/jarret/

Cheers,
-J.

Re: Developing GRBL for Chilipeppr.com

Posted: Thu Jul 17, 2014 5:08 am
by jlauer
Can you email me the binaries for Mac so I can post them so others don't have to compile? Jlauer12@Gmail.com

Re: Developing GRBL for Chilipeppr.com

Posted: Mon Dec 01, 2014 6:05 pm
by thiagokunz
Hello guys.

It the process above was not working. I think we need an update to the step #5 above:

Code: Select all

sudo -E go get github.com/johnlauer/serial-port-json-server
Than, enter your user password. This will solve the problem of being unable to download from github.

Thanks for your work John.

Re: Developing GRBL for Chilipeppr.com

Posted: Mon Dec 01, 2014 6:17 pm
by jlauer
The latest mac binary is now published inside ChiliPeppr so you don't have to build anymore.

Also, a new tutorial video was posted on the Github readme just in case. The readme has the latest steps as well.