all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Controlling an external device with elisp
@ 2003-05-04 17:16 upro
  2003-05-04 18:52 ` Jonas Steverud
  0 siblings, 1 reply; 7+ messages in thread
From: upro @ 2003-05-04 17:16 UTC (permalink / raw)


Hi!

Now this might be a strange question, but is it possible to control an
external device, through parallel or serial port, using elisp as
programming language?

Thank You In Advance!

-- 
Michael

r-znvy: zvpunry.wryqra  jro.qr (chg gur "@" jurer vg svgf...)
ab fcnz cyrnfr

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Controlling an external device with elisp
  2003-05-04 17:16 Controlling an external device with elisp upro
@ 2003-05-04 18:52 ` Jonas Steverud
  2003-05-04 19:50   ` upro
  0 siblings, 1 reply; 7+ messages in thread
From: Jonas Steverud @ 2003-05-04 18:52 UTC (permalink / raw)


upro <upro@gmx.net> writes:

> Now this might be a strange question, but is it possible to control an
> external device, through parallel or serial port, using elisp as
> programming language?

It should be possible if the device has a text-based protocol and
supports a tcp/ip connection. Gnus, which I use right now, does that
to my ISP's newsserver.

But if you mean on a lower level, if the device is stupid, like an
thermometer or simple motor; I do not know.

Depends on the device, a bit.

-- 
(         http://hem.bredband.net/steverud        !     Wei Wu Wei     )
(        Meaning of U2 Lyrics, Roleplaying        !  To Do Without Do  )

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Controlling an external device with elisp
  2003-05-04 18:52 ` Jonas Steverud
@ 2003-05-04 19:50   ` upro
  2003-05-05  0:48     ` Bijan Soleymani
  2003-05-05  2:45     ` Ed L Cashin
  0 siblings, 2 replies; 7+ messages in thread
From: upro @ 2003-05-04 19:50 UTC (permalink / raw)


Jonas Steverud <tvrud-usenet@spray.se> writes:

> upro <upro@gmx.net> writes:
>
>> Now this might be a strange question, but is it possible to control an
>> external device, through parallel or serial port, using elisp as
>> programming language?
>
> It should be possible if the device has a text-based protocol and
> supports a tcp/ip connection. Gnus, which I use right now, does that
> to my ISP's newsserver.
>
> But if you mean on a lower level, if the device is stupid, like an
> thermometer or simple motor; I do not know.
>
> Depends on the device, a bit.

Hi Jonas, what I meant was indeed a "stupid" device, like a selfmade
small circuit to switch on a light or somolar (as seen in the Coffee
mini-HOWTO).

Do you think this is impossible?

-- 
Michael

r-znvy: zvpunry.wryqra  jro.qr (chg gur "@" jurer vg svgf...)
ab fcnz cyrnfr

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Controlling an external device with elisp
  2003-05-04 19:50   ` upro
@ 2003-05-05  0:48     ` Bijan Soleymani
  2003-05-05  2:45     ` Ed L Cashin
  1 sibling, 0 replies; 7+ messages in thread
From: Bijan Soleymani @ 2003-05-05  0:48 UTC (permalink / raw)


upro <upro@gmx.net> writes:

> Do you think this is impossible?

It is impossible to do it entirely in elisp (unless you modify the C
part of emacs to support parallel port transfer directly).

All you need is a small program (in C or something) to send data to
the device. Then just pipe data to and from it, from within emacs.

Bijan

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Controlling an external device with elisp
  2003-05-04 19:50   ` upro
  2003-05-05  0:48     ` Bijan Soleymani
@ 2003-05-05  2:45     ` Ed L Cashin
  2003-05-05  8:13       ` upro
  1 sibling, 1 reply; 7+ messages in thread
From: Ed L Cashin @ 2003-05-05  2:45 UTC (permalink / raw)


upro <upro@gmx.net> writes:

> Jonas Steverud <tvrud-usenet@spray.se> writes:
>
>> upro <upro@gmx.net> writes:
>>
>>> Now this might be a strange question, but is it possible to control an
>>> external device, through parallel or serial port, using elisp as
>>> programming language?
>>
>> It should be possible if the device has a text-based protocol and
>> supports a tcp/ip connection. Gnus, which I use right now, does that
>> to my ISP's newsserver.
>>
>> But if you mean on a lower level, if the device is stupid, like an
>> thermometer or simple motor; I do not know.
>>
>> Depends on the device, a bit.
>
> Hi Jonas, what I meant was indeed a "stupid" device, like a selfmade
> small circuit to switch on a light or somolar (as seen in the Coffee
> mini-HOWTO).
>
> Do you think this is impossible?

No, it's perfectly possible.  The thing is that you can *use* the
device from emacs but ultimately talking to hardware is a kernel
thing.  Assuming Linux, as your reference to the Coffee mini-HOWTO
would suggest, your choices are to ...

  * build the circuit to recognize codes you can send using an
    existing driver

    e.g., you could put the device on your first serial port and
    control it from emacs by writing strings like "please turn on the
    light" or numbers like 101 to /dev/ttyS0.

or

  * use IO primitives or write your own driver as suggested in the
    Coffee mini-HOWTO

The former option is probably a lot easier in software; the latter is
probably easier for you in terms of circuit design.

-- 
--Ed L Cashin     PGP public key: http://noserose.net/e/pgp/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Controlling an external device with elisp
  2003-05-05  2:45     ` Ed L Cashin
@ 2003-05-05  8:13       ` upro
  2003-05-05 15:57         ` Ed L Cashin
  0 siblings, 1 reply; 7+ messages in thread
From: upro @ 2003-05-05  8:13 UTC (permalink / raw)


Ed L Cashin <cashin@cs.uga.edu> writes:

> upro <upro@gmx.net> writes:
>
>> Jonas Steverud <tvrud-usenet@spray.se> writes:
>>
>>> upro <upro@gmx.net> writes:
>>>
>>>> Now this might be a strange question, but is it possible to control an
>>>> external device, through parallel or serial port, using elisp as
>>>> programming language?
>>>
>>> It should be possible if the device has a text-based protocol and
>>> supports a tcp/ip connection. Gnus, which I use right now, does that
>>> to my ISP's newsserver.
>>>
>>> But if you mean on a lower level, if the device is stupid, like an
>>> thermometer or simple motor; I do not know.
>>>
>>> Depends on the device, a bit.
>>
>> Hi Jonas, what I meant was indeed a "stupid" device, like a selfmade
>> small circuit to switch on a light or somolar (as seen in the Coffee
>> mini-HOWTO).
>>
>> Do you think this is impossible?
>
> No, it's perfectly possible.  The thing is that you can *use* the
> device from emacs but ultimately talking to hardware is a kernel
> thing.  Assuming Linux, as your reference to the Coffee mini-HOWTO
> would suggest, your choices are to ...
>
>   * build the circuit to recognize codes you can send using an
>     existing driver
>
>     e.g., you could put the device on your first serial port and
>     control it from emacs by writing strings like "please turn on the
>     light" or numbers like 101 to /dev/ttyS0.
>
> or
>
>   * use IO primitives or write your own driver as suggested in the
>     Coffee mini-HOWTO

Are these IO primitives in C? I don't really understand this. 

I prefer the second suggestion, since I have very few knowledge of how
to build circtios (not to speak of how to recognize signals...)

Thank You In Advance!

>
> The former option is probably a lot easier in software; the latter is
> probably easier for you in terms of circuit design.

-- 
Michael

r-znvy: zvpunry.wryqra  jro.qr (chg gur "@" jurer vg svgf...)
ab fcnz cyrnfr

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Controlling an external device with elisp
  2003-05-05  8:13       ` upro
@ 2003-05-05 15:57         ` Ed L Cashin
  0 siblings, 0 replies; 7+ messages in thread
From: Ed L Cashin @ 2003-05-05 15:57 UTC (permalink / raw)


upro <upro@gmx.net> writes:

> Ed L Cashin <cashin@cs.uga.edu> writes:
...
>> No, it's perfectly possible.  The thing is that you can *use* the
>> device from emacs but ultimately talking to hardware is a kernel
>> thing.  Assuming Linux, as your reference to the Coffee mini-HOWTO
>> would suggest, your choices are to ...
>>
>>   * build the circuit to recognize codes you can send using an
>>     existing driver
>>
>>     e.g., you could put the device on your first serial port and
>>     control it from emacs by writing strings like "please turn on the
>>     light" or numbers like 101 to /dev/ttyS0.
>>
>> or
>>
>>   * use IO primitives or write your own driver as suggested in the
>>     Coffee mini-HOWTO
>
> Are these IO primitives in C? I don't really understand this. 

Yes, in fact, this is where our thread becomes off-topic in
gnu.emacs.help.  It's linux-specific.  Remember section 3 in the
Coffee mini-HOWTO how they mention ioperm and outb?  It's that kind of
thing.

> I prefer the second suggestion, since I have very few knowledge of how
> to build circtios (not to speak of how to recognize signals...)

In that case, your work is mostly in creating a simple driver.  Using
it from emacs will be easy once it's in place.  

Some leads: I hear the O'Reilley book, _Linux Device Drivers_, is good
for learning how to write drivers.  You can also search the kernel
sources for examples of simple device drivers and think about joining
the kernelnewbies mailing list.

-- 
--Ed L Cashin     PGP public key: http://noserose.net/e/pgp/

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-05-05 15:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-04 17:16 Controlling an external device with elisp upro
2003-05-04 18:52 ` Jonas Steverud
2003-05-04 19:50   ` upro
2003-05-05  0:48     ` Bijan Soleymani
2003-05-05  2:45     ` Ed L Cashin
2003-05-05  8:13       ` upro
2003-05-05 15:57         ` Ed L Cashin

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.