Got python on the Rpi talking to the TinyG.
I should add that I'm using the Adafruit version of Raspbian, Occidentalis which has enhanced low-level hardware support.
After freeing up the uart as in my above post, install the python-serial routines. (Same process to install minicom, you must have network connection to install either of these. Although there are ways of doing it with manually downloaded packages)
At a command prompt enter:
<code>sudo apt-get install python-serial</code>
Before I was able to get python-serial to work I had to reboot the Rpi. I suspect that the port was not free due to prior minicom use.
In IDLE I created a new file. Note, don't name it serial. It will try to import the current file if you do.
test code:
<code>
import serial
serialport = serial.Serial("/dev/ttyAMA0", 115200, timeout=0.5)
serialport.write("\r")
serialport.write("?\r")
response = serialport.readlines(None)
print str(response)
</code>
When the port is opened by python, it sends the TinyG an x character. I haven't figured out where this is coming from.
Next up is learning about JSON, how to use python's JSON interpreter, and learning enough python to do what I want.
I hope in the next few weeks to begin a blog with an overview of my garage/shop and journal the build process. Particularly relevant developments to the TinyG I will repost here if that is okay.
End goals:
I plan to build a CNC mill/printer. It will have removable heads such that either a milling spindle or 3d printer head may be used. When in milling configuration it will have available table mounted 4th axis for rotary milling capability. The bed will be mounted to the X axis, Y and Z axis on a bridge. Raspberry Pi based gui frontend for the TinyG incorporating the various features of CNC controls I like. I want to take from the feature sets of Fanuc, HAAS, Fadal, and even a couple of things from the Acramatic series. I want to build a pendant that in addition to a handwheel, controls most machine functions. Somewhat like the later Cincinnati or HAAS pendants. It will interface through spi to the Rpi.
To these ends I have a Atlas 6" lathe with milling attachment, and an asian floormount drill press, and various other power and hand tools. 4 3.4V 2.0A NEMA23 steppers in the 100 oz/in range.