Hi Dave,
Last night I left the RasPi running my Squeak code to change the channels. Most worked just fine. One of the calls to "OSProcess command:..." says it had a "... normal termination with status 1". It didn't change the channel. I will look through the code for what this and other status codes mean but can you tell me or point me to some docs.
I would like to test for errors and retry. For now I think I will just test for non zero.
Lou
On Tue, 5 Feb 2013 17:22:50 -0500, "David T. Lewis" lewis@mail.msen.com wrote:
On Tue, Feb 05, 2013 at 03:55:14PM -0500, Louis LaBrunda wrote:
On Mon, Feb 04, 2013 at 02:07:12PM -0500, Louis LaBrunda wrote:
Hi Guys,
I would like to call irsend (a program that is part of lirc package) from Squeak on the Raspberry Pi. Can anyone please post some sample code.
I'm not familiar with it myself, but if irsend is just a simple command line program then I should think that you could call it easily using OSProcess.
Thanks for the reply. OSProcess sounds like it is what I need but I can't find any install instructions, probably because I don't know much about Squeak and Linux and I'm not sure where to look.
Open a SqueakMap Package Loader:
world -> open... -> SqueakMap Catalog
In the SqueakMap Package Loader, select package OSProcess. Expand that category and you will find entries for version 4.4.11 and for "head". Either one is fine, but I usually recommend just using the latest version, so select "head" and install it.
Assuming that you want to run irsend with some command line parameters, try inspecting the following expression (but use some command parameters that actually do something):
OSProcess command: 'irsend foo bar baz'
The result will be an instance of ExternalUnixOSProcess that is a proxy for the actual irsend program that you just executed. You can send it #succeeded to see if the command was evaluated without error.
I think this is sufficient for what you are trying to do, but you can also do fancier things with external programs if you load CommandShell (also on SqueakMap).
For additional background see http://wiki.squeak.org/squeak/708 and http://wiki.squeak.org/squeak/1914.
Follow up questions welcome :)
Dave
----------------------------------------------------------- Louis LaBrunda Keystone Software Corp. SkypeMe callto://PhotonDemon mailto:Lou@Keystone-Software.com http://www.Keystone-Software.com