TinyG JSON Help

Started by mvberg on in TinyG Projects. 16 replies, last activity Apr 27, 2012.

#1918

Hi Guys,

First, thanks for all the hard work on this project!

I am trying to send some JSON command to my TinyG, and I am getting error {15}

tinyg[mm] ok> {"sr":""}

{15} Expected command letter: {SR}

tinyg[mm] ok> {"si":110}

{15} Expected command letter: {SI110}

tinyg[mm] ok> {"gc":"?"}

{15} Expected command letter: {GC}

tinyg[mm] ok>

When TinyG boots up it reports that it's running version 0.92 "Crocs"

#### TinyG 0.92 (build 326.06 - "Crocs") ####

Type h for help

tinyg[mm] ok>

Although when I send a "$" the version is reported as 0.90 (not sure if this matters)

Profile 1.00 [P_1.00]

Version 0.90 [V_0.90]

I am using CoolTerm on Windows:

Speed : 115200

Bits : 8

Parity : None

Stop Bits : 1

XON : True

Terminal : Line Mode

Enter Key: CR

Full settings from TinyG: http://dl.dropbox.com/u/9541708/tiny_g_settings.txt

I also tried sending the commands that tgFx sends on connect, but same results.

Please let me know if I am doing something wrong, or if you need more info.

Thank you!

Mike

Synthetos #1919

Actually, JSON was added in 0.93 ,Fanny Pack (release names are from bad fashion trends). You will need to upgrade. There's info on the wiki about how to do this, but basically it involves an Atmel ISP MKII programmer and AVRstudio. Sorry if this was not clear.

Alden

#1920

Good deal, thanks for the info.

On another note, when sending a file via coolterm, my shapeoko seems to be stopping at the same point every time. Line #27 in gcode file below.

One thing I can think of is that the file transfer is ignoring the XONXOFF flow control setting..

I also ran the file using ril3y's Swing app and actually got one line further, but it looks like there *could* be a serial communication issue looking at the console messages (http://dl.dropbox.com/u/9541708/tg_swing.jpg)

I tried different USB ports, I'm running it from a AAO netbook, not sure if that could be a problem?

Also, I'm supplying the 5+ from an Arduino, should that be sufficient?

Using a 24v supply, I have no heat sinks but I have a 12v fan directly over the board.

Sorry for all the newb questions but any ideas would be great!

Gcode: http://dl.dropbox.com/u/9541708/boxes_gcode_circle.txt

Console from Coolterm: http://dl.dropbox.com/u/9541708/cool_term_output.txt

Result: http://dl.dropbox.com/u/9541708/tiny_g_shape.jpg

Result w/ TG Swing: http://dl.dropbox.com/u/9541708/tiny_g_shape_2.jpg

Thanks in advance

Mike

#1921

Hey guys,

I tried running the python app mentioned here: http://www.synthetos.com/forums/topic.php?id=232#post-448

Got to the end of sending the same file as above - but seems like TG was ignoring a few commands in between.

It looks like it skipped the line in question from the previous post but actually made it to the end.

The TI chips are cool to the touch during the process (no where near the scald of the A4988)

Render: http://dl.dropbox.com/u/9541708/nc_plot_gcode.jpg

Console: http://dl.dropbox.com/u/9541708/tg_console.txt

Result: http://dl.dropbox.com/u/9541708/tiny_g_shape_3.jpg

Synthetos #1922

Your issue is noted. Let me get to a spot where I can test all your files and see if I can reproduce the problem. This may take me a few days, unfortunately. Looks like you are running 0.92 - Crocs. Can you please post all the gcode files you ran?

Thanks

Alden

Synthetos #1923

I just ran the boxes_gcode_circle file and it completed fine. I was running Coolterm on Mac, with Xon/Xoff enabled. I got the entire box, circle and 114 degree. Just for yuks, can you try inserting a brief delay between lines in Coolterm? Say about 1 ms?

Alden

Synthetos #1924

The old swing app is very badly outdated. This was a first attempt. In fact I killed all of the old "legacy" stuff when tinyG consisted of 2 followers (Alden and I!) today.

tgFX is what I want you guys to start using more and more. Its VERY MUCH still in heavy development. But this is what we are going with for use with TinyG. Currently we are testing and developing on Windows. However it WILL work eventually on LIN,WIN,OSX.

The instructions here are a very very quickly cobbled together work in progress:

http://www.synthetos.com/wiki/index.php?title=Projects:tgFX

I AM SURE there will be issues with the install instructions but I am hoping you guys update the wiki or msg me and I will add to them.

Again, this is coded for "Fanny Pack" anything else will not really be troubleshot. Not because I am a jerk :) Just because TinyG's JSON / Command interface has been in very much a HIGH state of flux.

Let me know if I can help guys.

Riley

#1925

Alden,

When using a 1ms line delay, I get strange results, normally where the file would quit before, the z axis now moves super slowmo for about 2 seconds (when we should be drawing the last 4) and then jerks over and draws the degree.

Image : http://dl.dropbox.com/u/9541708/ts_line_delay.jpg

I attached a serial monitor to the port (http://www.serial-port-monitor.com/index.html), it looks like the all of the gcode is sent to the board right off the bat, not sure if this is normal?

Here is what the app logs under 'Write Request' as soon as the file is sent (ran twice): http://dl.dropbox.com/u/9541708/serial_output.txt

Is there anyway I can verify that the XON/XOFF is actually working or is it even necessary for a file this small?

I am running the FTDI driver version 2.8.14.0 - tried it on multiple machines as well, both XP x32.

Thanks for all the time!

#1926

Riley,

I started out pulling the tgFx from GitHub, that's what prompted my first post :) Great work so far!

I look forward to helping the development process along - just grabbed the AVRISP to upgrade to Fanny Pack.

Mike

#1927

No idea if I am on the right track but this guys issue sounds very similar

http://bbs.homeshopmachinist.net/archive/index.php/t-44851.html

still reading through the thread but thought it may shed some light..

When sending the file via CoolTerm (using 1ms line delay), the progress jumps to 67% off the bat, then to 100% when the shapeoko has just finished drawing the circle.

Synthetos #1928

Do I take it that you are running Coolterm on Windows XP? The details of your configuration might be enlightening. Are you native, in a VM? What version CoolTerm? Let's check to make sure you have XON enabled in the firmware - can you send your $$ config?

You can verify XON/XOFF operation by looking at the XON/XOFF LED to see what's happening. You can tell when XON/XOFF is working by looking at the GPIO port LED that is closest to the USB port. Note: this is not the RX/TX LEDS that are right next to the USB connector itself. It turns on when XOFF is issued (communications halted) and off again when communication resumes.

We have found that the XON/XOFF implementation within TinyG works reliably - at least it's entirely consistent and predictable at the board level. How well it works as an end-to-end system - however - depends on how the host terminal program handles it, which is usually by passing the control down to the drivers on the host. We believe that the FTDI drivers work well, but we haven't tested every single combination! How the host program handles XON/XOFF can also vary. I have no problems running Coolterm from Mac OSX, and Riley runs it from his Windows machine. But beyond that we don't have a good handle on how other host/driver combinations work.

Given this variability, tgFX synchronizes on the responses. It uses the JSON interface, so you will need to complete your upgrade to 0.93. The current release candidate for 0.93 is build 338.05 which can be found in the edge branch.

So the XON/XOFF issues should be a stopgap - once we get tgFX out and running we will be past the machine variability in XON/XOFF.

Synthetos #1929

mvberg:

"I started out pulling the tgFx from GitHub, that's what prompted my first post :) Great work so far! I look forward to helping the development process along - just grabbed the AVRISP to upgrade to Fanny Pack."

Very cool! So you said that the WHOLE gcode file is being sent at the start. This is 100% not correct (unless its a very very small file sub 256 chars). I think that XON is not turned on in TinyG / Coolterm. Make sure you have the latest version of coolterm also.

I think from here. You need to get up to date on firmware 338.05. Once we are on the same build we can go forward and see what we can do to troubleshoot this.

Riley

#1930

"Do I take it that you are running Coolterm on Windows XP? The details of your configuration might be enlightening. Are you native, in a VM? What version CoolTerm? Let's check to make sure you have XON enabled in the firmware - can you send your $$ config?"

Yes, as noted above, I have tried two PC's both running Windows XP x32. Also, from my first post: Full settings from TinyG: http://dl.dropbox.com/u/9541708/tiny_g_settings.txt

Running CoolTerm version 1.4.1 (build 162)

Everything looks to be clearly enabled (XON wise) on both firmware and software. At this point, I will resort to upgrading the firmware and see if that will help at all.

Mike

Synthetos #1931

Another question I have is. Does this do this on ALL gcode files? Meaning stop at the same point in all of them? Or just this one file?

Riley

#1932

Hey Riley,

Thanks for the response - I ran this gcode using CoolTerm on XP

http://dl.dropbox.com/u/9541708/hello_world_shape.txt

http://dl.dropbox.com/u/9541708/shape_line_80.jpg

..it stops at line number 80, every time then jerks over and the machine goes OC (wanting to travel x & y way more than it should)

It's right before the arc in the h, TG actually prints this line.

Reported Line: {24} Arc specification error: G3X-1.

Full gcode line from file: G3 X-1.6859 Y0.1476 I-0.2729 J0.0036

Latest settings: http://dl.dropbox.com/u/9541708/tinyg_latest_settings.txt

It seems like XONXOFF is working ok here is the serial log

http://dl.dropbox.com/u/9541708/request_view_shape.htm

Note: I had to press reset on the TG to stop the ShapeOko from killing itself :)

Anyway, got the AVRISP - hopefully I can find some time to upgrade this weekend! Just thought I would provide some more info in the mean time.

Cheers

Mike

Synthetos #1933

Mike,

Thanks for the detailed report. What your symptoms suggest is that it's most likely the serial stream is getting corrupted, and this is most likely a problem in the end-to-end operation of XON/XOFF. What the machine does after the serial stream becomes corrupted is quite random and unpredictable, so not much information there.

I (re)confirmed that I am able to run the shapeoko hello world file you provided on my setup. It runs successfully. I also confirmed that you have XON/XOFF enabled from your settings. You do. So what this tells me is that it's probably not a problem in the TinyG code, but in the upstream serial interface and/or driver.

There are some significant differences between our host environments:

- I'm running MacOSX Lion, you are on XP.

- I'm therefore running a completely different set of FTDI drivers than you are - you are running FTDI driver version 2.8.14.0

- I'm therefore running the Mac version of Coolterm not the Windows version

So over the weekend I'll try to replicate your setup as closely as possible on a Windows box I have lying around. Some questions:

- What kind of machine are you running?

- Do you have any information on the serial port and the serial drivers. See

My Computer/Control Panel/System/Device Manager/ Ports for info.

- What service pack are you up to on XP and what type of XP are you running - home? pro?

- What version of Coolterm are your running?

- Just for yuks, what COM port does your USB driver map to (although this is usually quite random)?

- Lastly, what is the behavior of the XON/XOFF LED? It's the OUT3 LED located right next to the resistor labeled R22 in the picture here:

http://www.synthetos.com/wiki/index.php?title=Projects:TinyG-Hardware-Info:#Interface_Pinouts

-- Does it flash on and off during operation?

-- When the machine goes OC is it on or off?

-- Does it not turn on at all?

The LED turns ON when XOFF is issued by the board (because the serial receive buffer hit it's hi threshold -about 200 out of 256 characters), then turns OFF when XON is received from the host. Being stuck in the ON state can indicate that the board received characters, hit the hi limit of the buffer, issued the XOFF, then never received an XON. What THAT usually means is that the host never acted on the XOFF and just continued to jam characters down the wire.

I'll reserve judgement until we confirm or eliminate XON/XOFF as the culprit, but we are finding that even though our setups work fine with XON/XOFF, some others don't. Rather than diagnose each XON/XOFF problem independently the tgFX code synchronizes on the command responses rather than relying on XON/XOFF. So bear with us a bit longer until we get that out. In the mean time, let's try to get to the bottom of your issue.

- Alden

UPDATE: Can you please confirm the release of the FTDI Drivers you are running? in the VCP driver section I only see version 2.08.24 for for the Windows x86 - 32 bit. I do not see any drivers labeled 2.8.14.0 - perhaps you are running an earlier version.

Also, please also confirm that you are using the VCP drivers and not the D2XX drivers - I have to assume that you are because otherwise you don't get a COM port, but let's just be sure.

Thanks

Back to TinyG Projects or the forum archive.