Hello,
I'm working on my own software to send GCode files to TinyG.
I have the serial In/Out running, but I have some weirds issues.
First of all :
TinyG Firmware version : 0.95
TinyG Firmware build : 380.02
Software developped in Java.
I made a test protocol.
I watch both what my application sends and what TinyG boards sends in 2 separates Arduino Serial monitor. (This helps making sure what's sent is what I'm expecting). I'm using Virtual Serial Port Emulator to split the COM ports, and send them on 2 separate devices.
When sending a file, here is what my application sends (copied from the outgoing Arduino monitor) :
{"gc":"n1g17"}
{"gc":"n2m3s1000"}
{"gc":"n3g0x-84.0y19.0"}
{"gc":"n4g1f300.0z-0.5"}
{"gc":"n5g1f800.0x-38.0"}
{"gc":"n6g1y53.0"}
{"gc":"n7g1x-84.0"}
{"gc":"n8g1y19.0"}
{"gc":"n9g0z3.0"}
{"gc":"n10g0y0.0"}
{"gc":"n11g1f300.0z-0.5"}
{"gc":"n12g1f800.0x0.0"}
{"gc":"n13g1y70.0"}
{"gc":"n14g1x-106.0"}
{"gc":"n15g1y0.0"}
{"gc":"n16g1x-84.0"}
{"gc":"n17g0z3.0"}
{"gc":"n18g0y19.0"}
... (And more, not displayed)
And below is what TinyG answers (also copied from the Arduino monitor plugged on the TinyG COM port):
{"r":{"fb":380.02,"fv":0.950,"hv":7,"id":"9H3583-PXN","msg":"SYSTEM READY","f":[1,0,2,3394]}}
{"r":{"gc":"N1G17","n":1,"f":[1,0,15,1162]}}
{"r":{"gc":"N2M3S1000","n":2,"f":[1,0,19,5972]}}
{"r":{"gc":"N3G0X-84.0Y19.0","n":3,"f":[1,0,25,3712]}}
{"sr":{"line":3,"posx":-0.000,"posy":101.470,"vel":0.31,"momo":0,"stat":5}}
{"sr":{"posx":-0.000,"posy":101.470,"vel":1.23}}
{"r":{"gc":"N4G1F300.0Z-0.5","n":4,"f":[1,0,25,7547]}}
{"sr":{"posx":-0.000,"posy":101.470,"vel":2.76}}
{"r":{"gc":"N5G1F800.0X-38.0","n":5,"f":[1,0,26,4801]}}
{"sr":{"posx":-0.001,"posy":101.470,"vel":4.91}}
{"r":{"gc":"N6G1Y53.0","n":6,"f":[1,0,19,7909]}}
{"sr":{"posx":-0.002,"posy":101.468,"vel":9.29}}
{"r":{"gc":"N7G1X-84.0","n":7,"f":[1,0,20,4319]}}
{"sr":{"posx":-0.004,"posy":101.467,"vel":12.97}}
{"r":{"gc":"N8G1Y19.0","n":8,"f":[1,0,19,7522]}}
{"sr":{"posx":-0.007,"posy":101.464,"vel":19.65}}
{"r":{"gc":"N9G0Z3.0","n":9,"f":[1,0,18,5076]}}
{"sr":{"posx":-0.011,"posy":101.460,"vel":27.72}}
{"r":{"gc":"N10G0Y0.0","n":10,"f":[1,0,19,8305]}}
{"sr":{"posx":-0.015,"posy":101.456,"vel":33.86}}
{"r":{"gc":"N11G1F300.0Z-0.5","n":11,"f":[1,0,26,2080]}}
{"sr":{"posx":-0.022,"posy":101.449,"vel":44.22}}
{"r":{"gc":"N12G1F800.0X0.0","n":12,"f":[1,0,25,6781]}}
{"sr":{"posx":-0.031,"posy":101.440,"vel":55.97}}
{"r":{"gc":"N13G1Y70.0","n":13,"f":[1,0,20,8967]}}
{"sr":{"posx":-0.039,"posy":101.433,"vel":64.57}}
{"r":{"gc":"N14G1X-106.0","n":14,"f":[1,0,22,8984]}}
{"sr":{"posx":-0.052,"posy":101.420,"vel":78.62}}
{"sr":{"posx":-0.056,"posy":101.415,"vel":83.61}}
{"r":{"gc":"N15G1Y0.0","n":15,"f":[1,0,19,410]}} // <--- error starts here
{"sr":{"posx":-0.073,"posy":101.399,"vel":99.50}}
{"r":{"gc":"N17G0Z3.0","n":17,"f":[1,0,19,2954]}}
{"sr":{"posx":-0.086,"posy":101.386,"vel":110.86}}
{"r":{"f":[1,48,19,3280]}}
{"sr":{"posx":-0.100,"posy":101.372,"vel":122.84}}
{"r":{"gc":"NF800.0X0.0","f":[1,42,21,8955]}}
{"sr":{"posx":-0.115,"posy":101.357,"vel":135.43}}
{"sr":{"posx":-0.124,"posy":101.349,"vel":141.96}}
{"r":{"gc":1,"f":[1,0,21,1154]}}
As you can see, the line N16 is not acknowledged, although it was sent.
Any idea why ?
After that we can see that TinyG completely lost the track of sent GCode. The response enveloppe shows incoherent GCode.
I can't understand what the error {"r":{"f":[1,48,19,3280]}} is for. I know 49 means "Bad json format", but I can't see any wrong command.
If it helps, my application is handling Xon/Xoff, but I'm pretty sure this is not the case, because until line N16, there is not much data.
Can you pelase help me see through this ?
Thanks