From owner-freebsd-questions@FreeBSD.ORG Tue Apr 7 09:42:13 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 39FF6106564A for ; Tue, 7 Apr 2009 09:42:13 +0000 (UTC) (envelope-from valentin.bud@gmail.com) Received: from mail-bw0-f164.google.com (mail-bw0-f164.google.com [209.85.218.164]) by mx1.freebsd.org (Postfix) with ESMTP id 859668FC17 for ; Tue, 7 Apr 2009 09:42:12 +0000 (UTC) (envelope-from valentin.bud@gmail.com) Received: by bwz8 with SMTP id 8so2177542bwz.43 for ; Tue, 07 Apr 2009 02:42:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=kjJg3YvjbIcGagEWOR1nQj6tBz3NY79NY1cqnfeAUTg=; b=izhU62TIkANcBenQ8vRCPvh1U2dyNwmnyNKxiHWdOXQITYsHVCFV+8UWzK+tTU/0Ux xZ9wCyQ0gmHG0wLOhv4gGj7XpbtF+1HfhIiPSaSSlNZ8JjJiIwx0WNjhlLvr5Yh5IuMq 4991FPfbk9JXDcOo0QpNL/MqDtaVvdrjDVO/8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=mnZjXtOtUKJajfjYNlV9/lWOHSx4cpKPbYa1kDvOANHxyYQxA3pWaxGDtweqWzPp8N AEx0TpMA2Xl4a2P4uUhjLISa3vmfTBQilic7K431LBHgZlY5S3H6Q1KzPjLxdv53s85i qQ/0WtO/p7FxZre4i6IrPTn9AkSH+x8er4+a8= MIME-Version: 1.0 Received: by 10.223.120.197 with SMTP id e5mr4165831far.25.1239097331317; Tue, 07 Apr 2009 02:42:11 -0700 (PDT) From: Valentin Bud Date: Tue, 7 Apr 2009 11:41:54 +0200 Message-ID: <139b44430904070241j5227d178jd75f6a93057a150a@mail.gmail.com> To: freebsd-questions Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: 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 09:42:13 -0000 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 -- network warrior since 2005