macsat.com OpenWrt and ASUS WL Forum
January 08, 2009, 10:15:33 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?
Login with username, password and session length
News: Back to macsat.com
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: compiling help  (Read 2920 times)
0 Members and 1 Guest are viewing this topic.
yeager
Jr. Member
**
Offline Offline

Posts: 89


View Profile
« 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 
Logged
yeager
Jr. Member
**
Offline Offline

Posts: 89


View Profile
« Reply #1 on: August 22, 2007, 14:58:47 PM »

is this so big problem? please i need it urgentli.
Logged
nsn
Newbie
*
Offline Offline

Posts: 46


View Profile
« Reply #2 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
Logged
yeager
Jr. Member
**
Offline Offline

Posts: 89


View Profile
« Reply #3 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
« Last Edit: August 24, 2007, 20:11:18 PM by yeager » Logged
nsn
Newbie
*
Offline Offline

Posts: 46


View Profile
« Reply #4 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/

Logged
yeager
Jr. Member
**
Offline Offline

Posts: 89


View Profile
« Reply #5 on: August 24, 2007, 20:59:57 PM »

it is possible that is not work on asus Sad
i have nothing else, only this what is on this site
Logged
nsn
Newbie
*
Offline Offline

Posts: 46


View Profile
« Reply #6 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
Logged
yeager
Jr. Member
**
Offline Offline

Posts: 89


View Profile
« Reply #7 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.
Logged
nsn
Newbie
*
Offline Offline

Posts: 46


View Profile
« Reply #8 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.
Logged
yeager
Jr. Member
**
Offline Offline

Posts: 89


View Profile
« Reply #9 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?
« Last Edit: August 26, 2007, 20:35:04 PM by yeager » Logged
nsn
Newbie
*
Offline Offline

Posts: 46


View Profile
« Reply #10 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.
Logged
yeager
Jr. Member
**
Offline Offline

Posts: 89


View Profile
« Reply #11 on: August 27, 2007, 19:29:49 PM »

ok, it no problem switch to OpenWRT. please tell me if you finished. thx.
Logged
yeager
Jr. Member
**
Offline Offline

Posts: 89


View Profile
« Reply #12 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 Sad

asus/AC power --> PoE Switche --> PoE Switche --> my PC
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

English Steel 1.6 © Saxon North Technologies
Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!
Page created in 0.124 seconds with 25 queries.