I thought I’d try updating the firmware for my TinyG G2 using the Chilipeppr widget, and it’s failing with a “board not found” error. Screenshot attached. I’m on macOS Sierra 10.12.6 and Chrome version 62.0.3202.89. Any idea what’s causing his to fail?
BTW, isn’t version 087-edge a bit old? Is there a newer and better build that this widget should be pointing to? The Github edge is at 100.26.
John - what G2core Pinout configuration are you using? if GShield, you will have to build your own binary, see https://github.com/synthetos/g2/wiki/Getting-Started-with-g2core-Development#compiling-the-code
If you choose to do the build, read and make the correction first https://github.com/synthetos/g2/issues/272
Loading - what version of SPJS are you using?
You could always try Bossac from the CLI: https://github.com/synthetos/g2/wiki/Flashing-g2core-with-OSX
I’m flexible about this, but I’m replacing an Arduino Uno that has GRBL 1.1 flashed to it, so I’d like to keep to that pin layout. The 78.02 firmware on the Synthetos site does match that layout and works, but has other issues, namely that feed/hold isn’t immediate, and will hang randomly, requiring a power cycle to get it running again.
the TinyG G2 87.01 edge build that Chilipeppr points to sort of works. The pinout is correct and I can drive the motors and it doesn’t crash. Unfortunately it was apparently compiled with motor 3 mapped as inverted Y. The settings widget was written for the TinyG, so while it does allow me to fix that mapping, it doesn’t work for setting units, and those settings aren’t persistent. I haven’t been able to make Chilipeppr’s archive/restore settings thing work, perhaps because of the same issue of it not being compatible with g2core. Also this firmware doesn’t detect the hardware feed/hold button which is important to me and was working nicely with GRBL 1.1.
I cloned the 100.26 edge branch from Github and built it. When I flash the built gShield firmware to the Due, it’s no longer driving my motors. Chilipeppr can talk to it, but the movement commands don’t do anything. I’m a little confused by that since it’s meant to drive a gShield, and the gShield pinout is supposed to be comparable with GRBL 1.1.
I’ve started familiarizing myself with the source code to see if I can find where this is all controlled. Is it motatePins.h? is it gShield-pinout.h? is it motate_pin_assignments.h? It’s not immediately clear where to do this, and I’d appreciate any advice or help I can get.
Thanks!
I’m using SPJS 1.94. It seems to be working fine for actually talking with the board otherwise, it’s just that the programming widget in Chilipeppr fails. I’ve been doing the flashing from the command line with the newer http://DuefromOSX.sh shell script, and that’s working. I just wanted to try the programming widget since it seemed like a pretty convenient and slick way to go.
@John_Knoll 87.01 and earlier builds were available in 2 flavors, tinyGV9 and DUE+gShield. The latest EDGE, which is building 100.26 is available prebuilt for several different configurations but not gShield, probably due to the Issue discussed in Issue 272. You have to follow the suggestions there to revert the unintentional deletion of gshield.h from the build tree, then make sure you specify gshield.h for your build. Since you have already done some builds, be sure to make clean first, or who knows what you will get. I have done this build, it seems to properly work but have not connected motors to it. Others have, however, so I believe 100.26, properly built with gshield.h, will work.
I developed the Archive and Restore Widget and know it will not work with G2Core, because it uses the tinyG mm> prompt string in a character match. I have not had time to fix it.
Since the G2Core build system is rather easy to use once set up, I found that compiling in my specifc machine parameters in to a customized settings.h file was much quicker than Archive and Restore, at least for me.
@John_Knoll I am not familiar with DUEfromOSX or anything OSX, I do all my work in Linux. Did you follow the discussion at Issue #94?
The SPJS installer simply automates the bossac call process that is outlined in Flashing g2core with Linux · synthetos/g2 Wiki · GitHub. Give the Linux procedure a look, then translate to OSX. To be honest, this is the first I have looked at the OSX version of this procedure, seems way more complex than necessary. Likely done this way since the G2 devs work in OSX so by default have the IDE up and running.
Start your SPJS with the -v option in a command window. The processing log that results will display what is going on when you initiate the code download feature.
If you do it first from the CLI, using the Linux procedure as a guideline, and succeed of course, keep a copy of the CLI messages and flow of the process.
Then start up SPJS with -v and kick off the same update from there. Watch what is streaming on the window running the SPJS process and see if you can spot where it is failing.
Aha! Turning on the verbose mode revealed this:
2017/11/16 16:48:01 programmer.go:492: Tool:\Users\johnknoll\Documents\serial-port-json-server-1.94_macosx\arduino\tools\bossac\bin\bossac.exe, cmdline:[–port=cu.usbmodemFD131 -U false -e -w -v -b /var/folders/yt/2m60jbkc8xj56t0059bj827r0000gn/T/serial-port-json-server671299479/TinyG2-gShield-087edge.bin -R -v]
2017/11/16 16:48:01 programmer.go:72: Flashing with command:–port=cu.usbmodemFD131 -U false -e -w -v -b /var/folders/yt/2m60jbkc8xj56t0059bj827r0000gn/T/serial-port-json-server671299479/TinyG2-gShield-087edge.bin -R -v
2017/11/16 16:48:01 programmer.go:99: Command finished with error: exec: “\Users\johnknoll\Documents\serial-port-json-server-1.94_macosx\arduino\tools\bossac\bin\bossac.exe”: executable file not found in $PATH
Looks like the tool is looking for a Windows specific .exe as well as using Windows file paths.
I should also mention that I previously got this error:
2017/11/16 16:44:07 programmer.go:274: Error: open /Users/johnknoll/Documents/serial-port-json-server-1.94_macosx/arduino/hardware/sam/boards.txt: no such file or directory
That’s because the directory structure of the SPJS does not include the arduino directory. The actual path is this:
/Users/johnknoll/Documents/serial-port-json-server-1.94_macosx/hardware/sam/boards.txt
I corrected this on my side my making the arduino directory and moving the files into it. This should probably be corrected in either the widget, or in the directory structure of the SPJS tool.
Looking further into issue 272 mentioned above, it does appear to have been fixed. When I cloned the edge branch a few days ago, the gShield_pinout.h file was there, and as I said the build succeeds without error.
I’m specifically building the gShield target, but unfortunately when I flash that to the Due, it doesn’t work.
Chilipeppr sees that it’s attached, and can communicate enough that it reports “TinyG G2 100.26” in the tinygwidget, but the motors don’t move, and the Due doesn’t ever echo the status messages.
Any thoughts as to how to proceed with troubleshooting?
Do you have a terminal program equivalent to CoolTerm on MAC? I use putty on Linux.
Try that, see if you can get expected cli behavior.
Read the G2core Readme carefully. https://github.com/synthetos/g2
100.26 introduces Line Mode, and it starts up locked in JSON mode.
I had some flakiness off and on a couple months back connecting with CP, I am not sure how well SPJS and Line Mode get along.
Indeed, I have a couple of options for serial terminals. Connected to a terminal when the board powers up I get:
{“r”:{“fv”:0.99,“fb”:100.26,“fbs”:“100.26-4-g6519”,“fbc”:“settings_default.h”,“hp”:3,“hv”:0,“id”:“0084-9ce7-29c6-7bd”,“msg”:“SYSTEM READY”},“f”:[1,0,1]}
If I send it a ?, I get:
{“r”:{“sr”:{“line”:0,“posx”:0,“posy”:0,“posz”:0,“vel”:0,“unit”:1,“stat”:3,“feed”:0,“coor”:1,“momo”:0,“plan”:0,“path”:2,“dist”:0,“mpox”:0,“mpoy”:0,“mpoz”:0}},“f”:[1,0,2]}
Send $ej=2 (auto mode). Then ? should return the familiar text version of that response.
You are on your own from here, I am headed to vacation for a week.
here is a good read: https://github.com/synthetos/g2/wiki/Configuring-0.99-System-Groups#system-groups
Thanks Carl! Setting the Due to auto mode and sending a ? returns this:
Line number: 0
X position: 0.000 mm
Y position: 0.000 mm
Z position: 0.000 mm
A position: 0.000 deg
Feed rate: 0.000 mm/min
Velocity: 0.000 mm/min
Units: G21 - millimeter mode
Coordinate system: G54 - coordinate system 1
Distance mode: G90 - absolute distance mode
Arc Distance mode: G91.1 - incremental distance mode (default mode)
Feed rate mode: G94 - units-per-minute mode (i.e. feedrate mode)
Motion mode: G80 - cancel motion mode (none active)
Machine state: Ready
g2core[mm] ok>
Typing gcode at it (i.e. G0 x10 y10) results in:
g2core[mm] ok>
Machine state: Stop
But the motors don’t move, and a ? inquiry shows that the machine doesn’t think the motors moved either:
Line number: 0
X position: 0.000 mm
Y position: 0.000 mm
Z position: 0.000 mm
A position: 0.000 deg
Feed rate: 0.000 mm/min
Velocity: 0.000 mm/min
Units: G21 - millimeter mode
Coordinate system: G54 - coordinate system 1
Distance mode: G90 - absolute distance mode
Arc Distance mode: G91.1 - incremental distance mode (default mode)
Feed rate mode: G94 - units-per-minute mode (i.e. feedrate mode)
Motion mode: G0 - linear traverse
Machine state: Stop
g2core[mm] ok>
Perplexed. Is anyone successfully using a g2Core 100.26 build with a gShield and Chilipeppr? Anyone have thoughts about what might be going on or how to troubleshoot?
Hmm, that is odd - I think I ran the Chilipeppr Logo test Gcode one over the summer, did not have motors connected but the streaming trace in CP did render correctly.
Do your $$ parameters makes sense?
G2core servers a lot of new applications, I don’t have a copy of the default parameter set handy.
Motors are enabled by default, yes?
My sense is JohnL tweaked SPJS and CP to work correctly with tinyG 440.20 type messaging, where $ej set the start up mode but Auto switching between text an JSON was built in. Since SPJS was JSON format centric, SPJS goes to great lengths to keep tinyG in JSON mode. WIth G2core, setting $ej=2 might work, although I believe SPJS will be sending a lot of $ej=1 commands, it’s way of forcing tinyG to stay JSON.
I believe it is true that tinyG was always in auto mode, where as if $ej=1 in G2Core, responses to commands will always be JSON.
I’d stick to CLI until you can get motors moving, then maybe try CP. I am not sure the TinyG parameter configurator will work with G2core.
I do know that Archive and restore won’t work, because I did a character match on “tinyg mm>” to sense the end of $$ command when doing an Archive. So the collect info pahse of Archive will likely hang.
Have a look at https://github.com/synthetos/g2/issues to see what other developers are asking and doing.
With luck, JohnL will swing by and report what he has been successful with.
Thanks Carl, and have a nice vacation. I’ve been reading the GitHub g2 messages, but haven’t seen anyone encountering quite what I have.
It’s clear that for the g2core to be practical as my cnc controller I’ll have to build it myself to compile in the correct configuration for my machine, but before I even get to customizing the settings.h file, the build produces something that doesn’t work.
If you can figure out how to send a PM I’ll send you a link to my build, maybe a build issue? Doebtful, but …
Can you control Spinoff with gcode?
@John_Knoll Looking above I see you built your G2core with settings_default.h, those appear to be for a screw machine ($_tr=1.25) but should be able to move motors. I built my G2core for gshield using the shapeokodualY-gshield.h (check spelling). As I said, I never connected motors.
I have not used gshield either. Isn’t there some adjustment you need to make for DUE voltage vs UNO?
I assume you have a voltmenter?
Step pulses are rather narrow therefore hard to measure. With your voltmeter, see if the DUE pins for the enable leads are toggling properly.
On boot, the Enable leads should go low for 2 seconds (the $mt setting), then go high.
After that, you should be able to observe control using “$me 10” (enable motors for 10 seconds) and $md (turn off motors). Those should be observable with a plain Voltmeter.
@cmcgrath5035 to send a pm in g+ first “follow” each other then when you create a post select the persons name from the list that drops down in place of the community name.
I’m pretty sure it’s not the 5v vs 3.3v difference that’s the issue. Earlier firmware builds do work to drive motors (with other issues), so my stepper drivers definitely do work with 3.3v logic.
I’m not actually using a gShield. I’ve wired up my own header pins that fit into the headers of an UNO or a Due that expect GRBL pinout.
Specifically, I’m driving a medium sized bench top milling machine, a Rong Fu RF-30 which is all lead screws. I’m using external 4 amp stepper drivers so I can drive somewhat more powerful motors than you can with a tinyg or a gShield.
I got the whole thing working with an UNO flashed with GRBL 1.1, but it seemed like swapping to a Due with g2core had a number of advantages, specifically that the g2core software was more sophisticated and didn’t already fill the program memory of the Due (like GRBL on the UNO), that it could drive up to six axes (I have a rotary table I’d like to use sometimes without having to unplug another axis), and that the tinyg workspace is the one that is most actively maintained and contains the newest features.
I’ll see what I can learn from a voltmeter.
BTW, I did send you a pm using the method outlined here:
https://www.wikihow.com/Send-a-Private-Message-on-Google%2B
