Home › Forums › TinyG › TinyG Projects › TinyG for Android
Tagged: android, android accessory, Arduino, TinyG
- This topic has 54 replies, 5 voices, and was last updated 8 years, 2 months ago by mcgyvr.
-
AuthorPosts
-
August 26, 2012 at 10:19 pm #3437greyhound716Member
I had a thread in the feature requests section, but I think this section makes more sense.
I’m working on a project that should yield some big enhancements to the TinyG for Android app. In particular, I’m likely going to add support for the TinyG to be connected to an Android Accessory. This means that connectivity to the app will be able to work using more widely available hardware. The downside (and the reason the original didn’t go down this road) is that it requires additional hardware. For many that won’t be a big hurdle (an Arduino with a USB shield or the Arduino ADK board), but it is one more hurdle.
I’m also planning some UI cleanups to make the app a little more useful, including the addition of a “teaching” mode. The idea is to enhance the existing manual jog system to support a few different options, and have a button to store the pairs of old X/Y/Z and new X/Y/Z for line or arc gcode instructions. Persistent parameters (like the last download filename) and an integrated file navigation system are also planned.
-MattSeptember 5, 2012 at 8:46 am #3460greyhound716MemberI posted a short video to show the progress thus far: TinyG Arduino. Right now, I have a simple Arduino sketch that handles TinyG initialization and downloads a gcode file on demand from a MicroSD card. Not shown in the video, but I also have the Arduino Mega ADK sketch able to process connect/disconnect events from an Android tablet in Accessory mode, and being able to send messages between all three components. I should have the full Android Arduino TinyG chain working for commands and display in the next few days.
-MattSeptember 5, 2012 at 12:19 pm #3461aldenMemberThanks for the update. This is looking really cool. You may be interested in the JSON work I’m doing. I am making another pass at the JSON libs to regularize the output. This should make machine parsing much simpler and more managable. All responses will come back in the same form, including parameter set and query, gcode lines, status reports, and system startup messages and warnings. It’s still in the github dev branch under active development right now. I’ve started documenting on the wiki:
– Alden
- This reply was modified 12 years, 3 months ago by alden.
September 5, 2012 at 9:17 pm #3464greyhound716MemberI haven’t had many problems parsing the current JSON, but it seems like this new framework will give some additional flexibility, so I’m all for it. I have had great success using XON/XOFF for throttling, and it’s even easier when it’s a TTL level serial link, and so I mostly need to pick out the status lines for informational purposes – just to update the LCD to the current coordinates, etc.
I’m hoping to avoid most of the parsing on the Arduino, and just keep it to the small stuff. Any heavy lifting will definitely be on the Android end.
More when I have it.
-MattSeptember 25, 2012 at 7:06 am #3522greyhound716MemberI posted a new video showing my progress so far. I’ve got the Android talking using accessory mode and am able to create programs and manipulate the jog interface. Not shown on the video yet is that I also got the gcode formation and command storage done last night. So now I need to make the link between the Arduino and Android smarter – it needs a file transfer mode, etc.
Inline video doesn’t seem to work on this site… Anyone know the trick, or is it disabled?
-MattOctober 17, 2012 at 2:54 pm #3563greyhound716MemberFYI, I pushed a new version of the Android app (called TinyG Console now). No big feature changes, but some small bug fixes and a lot of UI improvements to better look like a modern Android app (actionbar, better tabbing, etc). I’m incorporating additional features now, so feedback is appreciated.
-MattOctober 18, 2012 at 8:45 am #3564aldenMemberMatt, Cool. Let us know if you are making another video.
Also, I know you are aware of the JSON changes we are making in the dev branch, but I bring it up here in case any of our millions of readers are not already aware of this.
–Alden
October 19, 2012 at 8:40 pm #3568greyhound716MemberRandom bit of feedback on the JSON changes… I’m having a fun time writing a parser that supports both flavors. The “r” wrapper isn’t a big deal, since that object type won’t be visible when talking to old firmware. The contents of the body object is at the top level, and so at first I intended to essentially use a common parser block – look for those objects (“sys”, “1”, etc) at both the top level and within a “bd”. The problem is that some of the leaf objects appear to have been renamed (“posx” to “xpos”, etc), and so it looks like I’m going to need to add conditional tests for both elements or split the parser.
Not fatal, but something to be aware of as you start to harden the spec and more things get built on top of the underlying structure. 🙂 BTW, overall I like the new JSON.
-MattOctober 19, 2012 at 9:01 pm #3569greyhound716MemberI need to correct myself – the posx/xpos thing isn’t a change in the code, it’s an error in the JSON doc examples! 🙂
Also, “stat” of 1 in a “sys” block means “no movement since hardware reset” or is there a more precise defn? I was looking for it in the mailing list threads and didn’t find the info.
Thanks,
-MattOctober 19, 2012 at 9:18 pm #3570greyhound716MemberOh, it looks like all the codes for “stat” changed (“cycle” was added, incrementing all of the codes > 1). I was testing the numbers to enable/disable various controls, and so it got confused.
BTW, I will make another video when I get this code working!
-MattFebruary 26, 2013 at 10:11 pm #3818greyhound716MemberI’m most of the way done updating the app for the new flow control and related protocols. So far, everything looks really good – I’m not getting ANY checksum errors, and I’m able to run through the download of 300mm braid without (apparent) issues in a dry run. I’m going to wire things up to my JGRO-based CNC to test it for real, and see if I can get a new video up if all continues to work well. 🙂
The UI itself needs work – right now it’s just a simple download and jogging interface, but if we’ve licked the IO problems it should be an easy thing to add other things.
-MattFebruary 27, 2013 at 6:22 am #3820aldenMemberMatt,
Good news. I’ve been running braid at 1800mm/min and even slightly higher. Let us know how things go.
Alden
February 28, 2013 at 11:12 pm #3828greyhound716MemberMy current CNC hardware won’t support something that fast, but it looks like in a dry run test tonight it behaved itself. I’m going to give it a shot with real material tomorrow. Added some basic config editing support via the app, so it means that I can do some of the iterative adjustments based on the CNC without a PC in my workshop.
I want to put a couple of small features into the app, but I think I’ll have something tested and ready for a new release in about a week.
-MattMarch 1, 2013 at 6:22 am #3829aldenMemberMatt,
Here are some things you might want to look at before you do a lot of coding. Please see the github wiki (not the old Mediawiki, which we are going to retire) – which should be pretty up-to-date.
– JSON Operations. Much more powerful
– Status reports – particularly (1) filtered mode, (2) setting them, and (3) using mpo and ofs as a stable model representation for drawing
– {“qf”:1} command can be used for flushing the planner queue. In combination with ! feedhold you have the tools for some pretty sophisticated jogging
– qv, qvl, qvh as a way to synchronize your gcode sending directly with the planner queue instead of with the serial queue. This wil become much more important later as feed overrides and other “multi-character-in-cycle” commands are implemented
Alden
March 4, 2013 at 9:09 pm #3863greyhound716MemberEveryone,
I’ve got a new version of the app out that works with the current firmware releases. It should work very well for downloads, and I’ve added some support for making configuration updates. More work is needed, but given my problems with reflashing my board, I wanted to get something out in a reasonable time. Let me know what you think.
Alden, I’ve been using JSON for a while now, and I really like the filtered status reports. I’ll probably start to look at the various coordinate offsets when I add more visualization support. I’ve got some base code for a continuous jog function, but I’ve disabled it until the $qf issue is debugged. In the meantime, I’ve got a step jog which works ok.
-Matt -
AuthorPosts
- You must be logged in to reply to this topic.