From owner-freebsd-questions@FreeBSD.ORG Tue Apr 7 12:38:58 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8E021065686 for ; Tue, 7 Apr 2009 12:38:58 +0000 (UTC) (envelope-from cwhiteh@onetel.com) Received: from april.london.02.net (april.london.02.net [87.194.255.143]) by mx1.freebsd.org (Postfix) with ESMTP id 87C348FC16 for ; Tue, 7 Apr 2009 12:38:58 +0000 (UTC) (envelope-from cwhiteh@onetel.com) Received: from [192.168.1.75] (93.97.24.219) by april.london.02.net (8.5.016.1) id 49D3A090004CB7A5; Tue, 7 Apr 2009 13:38:57 +0100 Message-ID: <49DB4960.8070109@onetel.com> Date: Tue, 07 Apr 2009 13:38:56 +0100 From: Chris Whitehouse User-Agent: Thunderbird 2.0.0.19 (X11/20090113) MIME-Version: 1.0 To: Valentin Bud References: <139b44430904070241j5227d178jd75f6a93057a150a@mail.gmail.com> In-Reply-To: <139b44430904070241j5227d178jd75f6a93057a150a@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions Subject: Re: C programming question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 12:38:59 -0000 Valentin Bud wrote: > Hello community, > > I have built with a micro controller a system of power plugs that can be > controlled through the serial port. > I have 2 plugs that i can start/stop and check the status of them. This is > accomplished by sending different > letters (eg. A/W) to start/stop one of the plugs and another set of letter > for the other plug and one letter > to check the status. > > Taking into account the fact that my C skills are almost 0 how complicated > would be to write a program > so I can control that micro controller through the serial port. Or is there > some kind of program that can > read/write from/to the serial port from the command line. I don't want an > interactive program like minicom, > just a program that connects and send a command (a letter in my case) to the > serial port. > > Why not minicom (or any other program like it)? My goal is to be able to > start/stop the plugs using a web interface. > I have tried using minicom and background it but when i log out minicom > closes. If minicom is started i can > send commands to ttyd0 with echo, but i can't read anything from serial. > > Now back to my original question, how hard/complicated will it be to write > a C program to control the micro controller > through the serial port. > > Of course on FreeBSD :). > > thanks, > v > There are some things here http://www.vitsch.net/ which might be useful see lampd, lampgui and An 8-output solid state mains-switch. It's all pretty old but then so are serial ports :) Chris