| Author |
Message |
|
matt (support)
Site Admin
Joined: Jan 27, 2003 Posts: 11698 Location: Texas
|
 Serial Bridge beta posted
I have had a few requests to publish this for download, so here is the first public beta of Serial Bridge (30 day free trial available):
http://www.perceptiveautomation.com/ser ... nload.html
Serial Bridge is a rapid development environment for using AppleScript to communicate with serial devices. Using Serial Bridge you can easily create AppleScript glue, called connection scripts, to communicate between serial-based hardware and scriptable applications (Indigo, iTunes, Weeder boards, serial Thermostats, etc.). Documentation on exactly what Serial Bridge is and how to use it are marginal at best, but I'll work on that.  Included in the download are a couple commented sample AppleScripts, including a sample connection script.
There are two ways to communicate with serial devices using Serial Bridge. You can use a stand-alone AppleScript (or for example an embedded Execute AppleScript action inside Indigo) to send commands to Serial Bridge, or you can use the Serial Bridge attachment AppleScript (connection script). Every open serial port connection can have a connection script, which automatically runs as its own process. Serial Bridge automatically launches the connection script when a serial connection is opened, which happens on application launch, and automatically terminates it when Serial Bridge closes the connection (or quits). You can also force the connection script to quit and reload with a single button press.
All serial port settings are specified in the connection window (GUI), and automatically saved. This is useful since serial port names can change if your USB to serial adapter drops its connection (as seen when a USB hub loses power or the computer crashes). You won't have to modify your AppleScript when this happens -- just select the correct port name in the GUI.
Additionally, a log window is provided to help debug connection scripts and track data received and sent to the serial devices.
Let me know how the beta works for you. If you come up with any good connection scripts and would like to share them, then drop me an email. Pricing on Serial Bridge has not been determined yet.
Regards,
Matt
Last edited by matt (support) on Fri Jan 18, 2008 10:46 am, edited 1 time in total.
|
| Wed Mar 30, 2005 2:04 pm |
|
 |
|
matt (support)
Site Admin
Joined: Jan 27, 2003 Posts: 11698 Location: Texas
|
 Re: Serial Bridge beta posted
New beta build posted that fixes some bugs (time stamps not correct, timeout errors in scripts, faster script termination, and more):
http://www.perceptiveautomation.com/ser ... nload.html
Regards,
Matt
|
| Fri Apr 01, 2005 3:13 pm |
|
 |
|
pgershon
Joined: Jul 10, 2004 Posts: 195
|
 GC-100 / Serial Bridge
Once again I think I have some time to work on this project. I am looking to communicate between serial devices and my Mac/Indigo system over my TCP/IP Cat 5 network (serial device is remote from the Mac). The GC-100 seems like a good option (although I am open to other suggestions). Can SerialBridge work with this device. It looks like the serial I/O is set to come in/out on Port 4999.
|
| Mon May 09, 2005 1:13 pm |
|
 |
|
matt (support)
Site Admin
Joined: Jan 27, 2003 Posts: 11698 Location: Texas
|
 Re: GC-100 / Serial Bridge
SerialBridge only works with serial devices directly connected to your Mac (Keyspan USB to serial adapter), unless you have a special driver that does the serial<->IP<->serial translations. I don't believe there is such a driver available for the GC-100 on OS X.
Regards,
Matt
|
| Tue May 10, 2005 10:21 am |
|
 |
|
pgershon
Joined: Jul 10, 2004 Posts: 195
|
Is there another way I can read data from Port 4999 into Indigo?
|
| Tue May 10, 2005 12:35 pm |
|
 |
|
matt (support)
Site Admin
Joined: Jan 27, 2003 Posts: 11698 Location: Texas
|
Hmmm, I'm not sure. Without a serial<->IP driver, you aren't really doing serial communication but are reading/writing to a TCP port. You can telnet into the device on port 4999 and should be able to control it and see the data, but I'm not sure the best way to then get that into Indigo. I suppose you could redirect it into a file or something and then read the file. Anyone have any ideas?
Regards,
Matt
|
| Tue May 10, 2005 9:29 pm |
|
 |
|
pgershon
Joined: Jul 10, 2004 Posts: 195
|
Can a single Applescript talk to Indigo and the Terminal (for Telnet)?
|
| Tue May 17, 2005 12:18 pm |
|
 |
|
matt (support)
Site Admin
Joined: Jan 27, 2003 Posts: 11698 Location: Texas
|
Yes, but I'm not sure the level of communication you need can be made to work with AppleScript alone. You might need to use Perl or Python to open up a socket with the GC-100 and then feed the incoming data to an AppleScript via osascript.
Matt
|
| Wed May 18, 2005 4:30 pm |
|
 |
|
pgershon
Joined: Jul 10, 2004 Posts: 195
|
How tricky is Perl or Python to use. Ceryainly out of my league on first blush, but I used to be able to program 25 years ago (APL, C, etc).
|
| Wed May 18, 2005 6:20 pm |
|
 |
|
matt (support)
Site Admin
Joined: Jan 27, 2003 Posts: 11698 Location: Texas
|
They aren't too bad. Perl is very popular so there are a bunch of tutorials online to get you started. Here is one Perl socket tutorial that shows how to connect to a device (GC-100 in your case), and here is a good reference on socket programming with Perl.
I'd also Google for "OS X" "Perl Tutorial" for some basics to get you going. Once you have a Perl script that can communicate with your GC-100 and you are ready to have Perl call into AppleScript, let me know and I can show you how that is done. I think (never done it from Perl, but have done it from PHP).
Matt
|
| Wed May 18, 2005 9:55 pm |
|
 |
|
matt (support)
Site Admin
Joined: Jan 27, 2003 Posts: 11698 Location: Texas
|
A new beta (beta 6) of Serial Bridge is now available. This one fixes a random communication failure that caused the AppleScript execution to halt.
Regards,
Matt
|
| Sat May 28, 2005 4:10 pm |
|
 |
|
DavidMLewis
Joined: May 30, 2005 Posts: 4
|
pgershon wrote:How tricky is Perl or Python to use?
I can't speak directly to Perl, but Python is, to me, a wonderful language. Every time I do a programming project in it, something about the language winds up delighting me. A good place to start is the tutorial posted at <http://www.python.org/>. Once you've worked through that, go to <http://www.pythonmac.org/> for Mac-specific stuff. In the case of Serial Bridge, I found the appscript suite, which you can get from <http://freespace.virgin.net/hamish.sanderson/appscript.html>, the easiest way to communicate with it. The AppleScript fragment
property theConnection : "Thermocouple Datalogger"
tell application "Serial Bridge"
send to source theConnection string "P"
end tell
translates to the Python fragment
import appscript
theConnection = "Thermocouple Datalogger"
serialBridge = appscript.app("Serial Bridge")
serialBridge.send_to_source(theConnection, string="P")
Enjoy,
David
|
| Wed Jun 01, 2005 1:14 pm |
|
 |
|
matt (support)
Site Admin
Joined: Jan 27, 2003 Posts: 11698 Location: Texas
|
Cool, thanks for the example. I didn't realize it was that straightforward to interface between Perl and AppleScript.
Matt
|
| Wed Jun 01, 2005 7:34 pm |
|
 |
|
DavidMLewis
Joined: May 30, 2005 Posts: 4
|
support wrote:Cool, thanks for the example. I didn't realize it was that straightforward to interface between Perl and AppleScript.
Matt
Whoops! That's Python and AppleScript (or rather scriptable applications like Serial Bridge).
Best,
David
|
| Wed Jun 01, 2005 9:23 pm |
|
 |
|
matt (support)
Site Admin
Joined: Jan 27, 2003 Posts: 11698 Location: Texas
|
I meant Python. A Perl example would have looked like a bird had danced all over the keyboard (no offense Perl folks!).
Matt
|
| Thu Jun 02, 2005 9:12 am |
|
|