macsat.com OpenWrt and ASUS WL Forum

ASUS WL 500-g WL-500gx WL-300g and WL-HDD help => Misc. Talk => Topic started by: yeager on August 21, 2007, 12:20:19 PM



Title: compiling help
Post by: yeager on August 21, 2007, 12:20:19 PM
hi
is here anybody wher can make executable this script on asus wl500
http://www.wardriving.pl/new.php?nr=84

restart.c
Code:
00  /* RESETER.c (c) 2004 Marcin Lukasik  */
01 
02  #include <sys/io.h>
03  #include <unistd.h>
04  #include <stdio.h>
05  #include <stdlib.h>
06 
07  #include "port.h"
08 
09  #define ERR " \033[0;22m\033[31m-\033[31;1m>\033[31;22m-\033[0m "
10 
11  int main(int argc, char **argv) {
12 
13       unsigned int t = 0;
14 
15       if(getuid() != 0) {
16        printf("ERROR: To access LPT from Linux you must run this program as root.");
17        exit(-1);
18       }
19 
20      if(argc != 2) {
21  printf("%sUsage: %s reset_time_in_sec\n", ERR, argv[0]);
22  exit(-1);
23      }
24 
25 
26      t = atoi(argv[1]) * 1000000;   
27 
28 
29      ioperm(0x378, 3, 1);  // open port
30      port_out(0x378, 255); // HI on b2-b9 (relay open - RESET)
31      usleep(t);            // sleep for t seconds
32      port_out(0x378, 0);   // LOW on (relay closed - NORMAL OPERATION)
33 
34      return 0;
35  }
36 


Title: Re: compiling help
Post by: yeager on August 22, 2007, 14:58:47 PM
is this so big problem? please i need it urgentli.


Title: Re: compiling help
Post by: nsn on August 24, 2007, 19:37:03 PM
I can compile it if you have the port.h for me or know the values of: port_out


Title: Re: compiling help
Post by: yeager on August 24, 2007, 20:09:18 PM
here is the link, and thx
http://milea.pl/pl/wlan-faq/howto/reseter/port.h
order here you can find all
http://milea.pl/download/reseter.tar.gz


Title: Re: compiling help
Post by: nsn on August 24, 2007, 20:54:49 PM
I'm getting an error in line 15.. of port.h
Please have a seach on lpif
This is a utility i use for setting bits on a parallel port.
You can use that in combination with a script file !!

see: http://www.sephail.net/projects/openwrt/



Title: Re: compiling help
Post by: yeager on August 24, 2007, 20:59:57 PM
it is possible that is not work on asus :(
i have nothing else, only this what is on this site


Title: Re: compiling help
Post by: nsn on August 25, 2007, 00:10:50 AM
It works on a asus wl500g. Let me know what exactly you like to do. I 'll have a look how to combine things for you.

regards, NSN


Title: Re: compiling help
Post by: yeager on August 25, 2007, 08:17:54 AM
i will only restart one machine using this tool. nothing else. sending a ping packets every 2 minits to ip, and when not responding then switch the relay to 30s.


Title: Re: compiling help
Post by: nsn on August 26, 2007, 19:52:48 PM
Ok then i suggest to use the lpif utility. You can use it from like "lpif -s 1" to set bit 1 of the par port wait a few seconds and do a "lpif -s 0". See http://www.sephail.net/projects/openwrt/

You can download the executable there.


Title: Re: compiling help
Post by: yeager on August 26, 2007, 20:32:56 PM
ok i wait, but this is for OpenWRT and i use olegs firmware. will this work with olegs too? or i must change a firmware?


Title: Re: compiling help
Post by: nsn on August 26, 2007, 21:36:42 PM
It surtenly works on openwrt. I've it working on openwrt.
I would suggest to change firmware to openwrt.


Title: Re: compiling help
Post by: yeager on August 27, 2007, 19:29:49 PM
ok, it no problem switch to OpenWRT. please tell me if you finished. thx.


Title: Re: compiling help
Post by: yeager on September 06, 2007, 08:26:54 AM
Ok then i suggest to use the lpif utility. You can use it from like "lpif -s 1" to set bit 1 of the par port wait a few seconds and do a "lpif -s 0". See http://www.sephail.net/projects/openwrt/

You can download the executable there.


this is not god for me. when i scitch the relay, then i dont have acces to asus :(

asus/AC power --> PoE Switche --> PoE Switche --> my PC