Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => iMX233 => Topic started by: cKon on September 15, 2013, 02:56:53 PM

Title: Set Static IP address,hardware /system clock
Post by: cKon on September 15, 2013, 02:56:53 PM
Hi,
   Is there a way to enable/disable DHCP and set static ip address through a program(ansi-c),also ways to set the hwclock and sysclock. Currently , i do it from command-line , but dont want to ssh everytime to change it ,would be convenient to include the code in the application.

Thanks in advance.

Regards,
cKon
Title: Re: Set Static IP address,hardware /system clock
Post by: Christian Jann on September 15, 2013, 05:09:47 PM
Yes there are configuration files to enable/disable DHCP and set static ip address  (https://wiki.archlinux.org/index.php/Network_Configuration) and also to to set the hardware clock (https://wiki.archlinux.org/index.php/Time, https://wiki.archlinux.org/index.php/Network_Time_Protocol_daemon).

If you're currently doing it from the command line then you can also put the commands into a startup script (https://wiki.archlinux.org/index.php/Initscripts).

If you want to do it through your ansi-c program then you can either look into the source code of the commands that that you are currently using to set the time etc. or simply call them from your program (https://www.linuxquestions.org/questions/programming-9/execute-shell-command-inside-of-c-code-188645/).
Title: Re: Set Static IP address,hardware /system clock
Post by: cKon on September 17, 2013, 06:46:03 AM
Hi Christian,
             Thank you , was wondering ,whether this sort of a question was to be posted here or in archlinuxarm forum.Thanks for your response,will check soon.

Regards,

cKon