Lisp HUG Maillist Archive

Rovio http command

I'm trying to send a Rovio robot an http command.
 
This works from the Internet Explorer URL line:
 
http://192.168.0.194///rev.cgi?Cmd=nav&action=18&drive=1&speed=5
 
My attempt at writing this in Lisp:
 
(with-open-stream (http (comm:open-tcp-stream "192.168.0.194" 80))
  (format http "rev.cgi?Cmd=nav&action=18&drive=1&speed=5")
  (force-output http)
  (close http))
The (comm:open-tcp-stream "192.168.0.194" 80) part returns something that looks appropriate, but the command doesn't execute - the robot should move forward, but nothing happens.
 
I apologize for asking such a basic question - but this one has me puzzled....
 
Bruce.
 

Re: Rovio http command

You could try (format http "GET /rev.cgi?Cmd=nav&action=18&drive=1&speed=5 HTTP/1.1")

It's probably easier to use a web client library like http://www.weitz.de/drakma/.


-a



On May 17, 2010, at 12:25 AM, Bruce J Weimer MD wrote:

I'm trying to send a Rovio robot an http command.
 
This works from the Internet Explorer URL line:
 
http://192.168.0.194///rev.cgi?Cmd=nav&action=18&drive=1&speed=5
 
My attempt at writing this in Lisp:
 
(with-open-stream (http (comm:open-tcp-stream "192.168.0.194" 80))
  (format http "rev.cgi?Cmd=nav&action=18&drive=1&speed=5")
  (force-output http)
  (close http))
The (comm:open-tcp-stream "192.168.0.194" 80) part returns something that looks appropriate, but the command doesn't execute - the robot should move forward, but nothing happens.
 
I apologize for asking such a basic question - but this one has me puzzled....
 
Bruce.
 

Updated at: 2020-12-10 08:39 UTC