Community discussions

MikroTik App
 
User avatar
ahmedramze
Member Candidate
Member Candidate
Topic Author
Posts: 111
Joined: Mon Feb 21, 2005 9:29 am
Location: IRAQ
Contact:

WiFi Signal for Hotspot in Login Page

Wed Oct 18, 2006 8:31 pm

Hi all

I need help in Hotspot Script , How can I add the status of wirelss client , I want to Get the SNMP or /interface wireless regsitartion-table , and get the signal of user accourding his MAC-Address and put it in the hotspot status page . also the Tx/Rx of user .

Thanx for help
 
Hellbound
Long time Member
Long time Member
Posts: 508
Joined: Tue Oct 26, 2004 11:21 am

Thu Oct 19, 2006 9:43 am

I need it as well... anyone with any idea?
 
User avatar
savagedavid
Trainer
Trainer
Posts: 320
Joined: Thu Aug 25, 2005 12:58 pm
Location: Cape Town, South Africa
Contact:

Thu Oct 19, 2006 7:44 pm

It's an interesting idea - I'll attempt to get it working and post result if I do
 
User avatar
savagedavid
Trainer
Trainer
Posts: 320
Joined: Thu Aug 25, 2005 12:58 pm
Location: Cape Town, South Africa
Contact:

Thu Oct 19, 2006 7:50 pm

From command line this will return the signal for a given MAC:

:put [/interface wireless registration-table get [find mac-address=00:85:49:8E:27:C7] signal-strength]

MAC can be entered without the colons too

Now to populate the hotspot status page with the data...
 
Hellbound
Long time Member
Long time Member
Posts: 508
Joined: Tue Oct 26, 2004 11:21 am

Thu Oct 19, 2006 7:52 pm

It's an interesting idea - I'll attempt to get it working and post result if I do
I have an idea... use SSH via PHP to retrieve it then
put one iframe inside hotspot page linked to that php code.

how's that? anyone that can do this?
 
User avatar
savagedavid
Trainer
Trainer
Posts: 320
Joined: Thu Aug 25, 2005 12:58 pm
Location: Cape Town, South Africa
Contact:

Fri Oct 20, 2006 10:59 am

I am sure there must be an easier way, as most hotspot data is returned by direct function calls to the router (it would seem).

Any ideas on this Eugene?
 
User avatar
Eugene
Forum Veteran
Forum Veteran
Posts: 986
Joined: Mon May 31, 2004 5:06 pm
Location: Cranfield, UK

Fri Oct 20, 2006 2:00 pm

I am not aware of a way that would be easier then one described by Hellbound.

Eugene
 
User avatar
ahmedramze
Member Candidate
Member Candidate
Topic Author
Posts: 111
Joined: Mon Feb 21, 2005 9:29 am
Location: IRAQ
Contact:

Fri Oct 20, 2006 5:33 pm

We are talk about HOTSPOT user not Mikrotik (( admin or )) any user , I didn't want to great a script that may be some hackers use it to login inside Mikrotik Box ?

any Idea ,

and some users use (( Wireless Client Routers )) like D-Link or UsRobotik and the Hotspot see the LAN MAC-Address of them PCs not the MAC-Address of wireless LAN of the Router .

Need Help , and I think we need help from mikrotik and it must added to mikrotik hotspot to be more compatable .


Regard
 
Hellbound
Long time Member
Long time Member
Posts: 508
Joined: Tue Oct 26, 2004 11:21 am

Fri Oct 20, 2006 5:39 pm

We are talk about HOTSPOT user not Mikrotik (( admin or )) any user , I didn't want to great a script that may be some hackers use it to login inside Mikrotik Box ?

any Idea ,

and some users use (( Wireless Client Routers )) like D-Link or UsRobotik and the Hotspot see the LAN MAC-Address of them PCs not the MAC-Address of wireless LAN of the Router .

Need Help , and I think we need help from mikrotik and it must added to mikrotik hotspot to be more compatable .


Regard
initially that was what I though you meant... people won't have a backdoor to enter your router or server...

php code will render and only text will be sent to users (or images)
 
User avatar
ahmedramze
Member Candidate
Member Candidate
Topic Author
Posts: 111
Joined: Mon Feb 21, 2005 9:29 am
Location: IRAQ
Contact:

Fri Oct 20, 2006 6:21 pm

Yes the PHP and HTML can not be hacked , and I think if we use the SNMP oid , to get the signal strengh but i have problem how can I know the MAC-addrees or the Number for assined Item with Print oid command




[admin@MikroTik] interface wireless registration-table> print oid

0 strength=.1.3.6.1.4.1.14988.1.1.1.2.1.3.0.1.36.112.75.166.3
tx-bytes=.1.3.6.1.4.1.14988.1.1.1.2.1.4.0.1.36.112.75.166.3
rx-bytes=.1.3.6.1.4.1.14988.1.1.1.2.1.5.0.1.36.112.75.166.3
tx-packets=.1.3.6.1.4.1.14988.1.1.1.2.1.6.0.1.36.112.75.166.3
rx-packets=.1.3.6.1.4.1.14988.1.1.1.2.1.7.0.1.36.112.75.166.3
tx-rate=.1.3.6.1.4.1.14988.1.1.1.2.1.8.0.1.36.112.75.166.3
rx-rate=.1.3.6.1.4.1.14988.1.1.1.2.1.9.0.1.36.112.75.166.3
 
Hellbound
Long time Member
Long time Member
Posts: 508
Joined: Tue Oct 26, 2004 11:21 am

Fri Oct 20, 2006 6:23 pm

Yes the PHP and HTML can not be hacked ,
can you explain how?
 
User avatar
ahmedramze
Member Candidate
Member Candidate
Topic Author
Posts: 111
Joined: Mon Feb 21, 2005 9:29 am
Location: IRAQ
Contact:

Fri Oct 20, 2006 9:42 pm

I'm not want to learn in this how to hack the PHP and SQL and CGI script , there is many Seecurity Holes,

for fun like phpBB forum , ........!!!!!



regard
 
Hellbound
Long time Member
Long time Member
Posts: 508
Joined: Tue Oct 26, 2004 11:21 am

Fri Oct 20, 2006 9:46 pm

I'm not want to learn in this how to hack the PHP and SQL and CGI script , there is many Seecurity Holes,
for fun like phpBB forum , ........!!!!!
regard
dude,
IMHO you basically didn't get the idea correctly. the logic is to only send user a text value for his signal...

if you do think PHP is not a secure platform then you should close your browser right now!! or even for your information the Mikrotik Hotspot is using cgi-like input... you must not USE it!!!

but it is also proven that no security system made by human is garanteed to be secured from another human.

leave or like it there is no solution from Mikrotik except what I told you...
 
User avatar
ahmedramze
Member Candidate
Member Candidate
Topic Author
Posts: 111
Joined: Mon Feb 21, 2005 9:29 am
Location: IRAQ
Contact:

Fri Oct 20, 2006 10:09 pm

No I'm not want to Disscuse the Security options for the Languages , I wana to told you we cant get admin option to user to get the value of his signal ,

all user (( hackers )) or not , have spectrum program that can get the value of admin level , every week I'm close may ports in my network .

Finaly , I love Mikrotik OS and I'm use it for 2 year , forget what I'm talk about security and let us get some think for people in hotspot.
 
Hellbound
Long time Member
Long time Member
Posts: 508
Joined: Tue Oct 26, 2004 11:21 am

Fri Oct 20, 2006 10:15 pm

we cant get admin option to user to get the value of his signal
Please believe me when I say you didn't not fully understand what I said.
Your box's password is not reveal to anyone at all. it is part of your code that is runned in a WebServer separately... the webserver log into your box , read the value and send the value to your user.

it is not JAVAScript that is runned at client. it is a server code that is runned at Server

However I would be still interested no matter if you think it is not secured if anyone can do this for us?

thanks
 
User avatar
ahmedramze
Member Candidate
Member Candidate
Topic Author
Posts: 111
Joined: Mon Feb 21, 2005 9:29 am
Location: IRAQ
Contact:

Fri Oct 20, 2006 10:19 pm

I'm understand you we can do it like MRTG software and generate PNG images , Right ?
 
Hellbound
Long time Member
Long time Member
Posts: 508
Joined: Tue Oct 26, 2004 11:21 am

Fri Oct 20, 2006 10:21 pm

I'm understand you we can do it like MRTG software and generate PNG images , Right ?
exactly...
 
User avatar
ahmedramze
Member Candidate
Member Candidate
Topic Author
Posts: 111
Joined: Mon Feb 21, 2005 9:29 am
Location: IRAQ
Contact:

Fri Oct 20, 2006 10:24 pm

any new Idea ? to start work .
 
User avatar
tneumann
Member
Member
Posts: 394
Joined: Sat Apr 16, 2005 6:38 pm
Location: Germany

Sat Oct 21, 2006 2:59 pm

how can I know the MAC-addrees or the Number for assined Item with Print oid command
The MAC address of the associated client is part of its corresponding registration-table OID. Let's look at an actual example:

[admin@AP] interface wireless registration-table> print
# INT... RADIO-NAME MAC-ADDRESS AP SIGNAL... TX-RATE UPTIME
0 wlan1 000C420C12B0 00:0C:42:0C:12:B0 no -52dBm... 6Mbps 1d21h14m2s
1 wlan2 000C420C12A8 00:0C:42:0C:12:A8 no -54dBm... 6Mbps 1d21h13m58s

[admin@AP] interface wireless registration-table> print oid
0 strength=.1.3.6.1.4.1.14988.1.1.1.2.1.3.0.12.66.12.18.176.4
[...]
1 strength=.1.3.6.1.4.1.14988.1.1.1.2.1.3.0.12.66.12.18.168.5

The orange parts go together, just translate the hexadecimal bytes from the MAC address into decimal, so for the above example 0x00=0, 0x0C=12, 0x42=66, 0x0C=12, 0x12=18, 0xB0=176.

The final value, following the six bytes from the MAC address in the OID (marked green above) is the SNMP interface index of the interface that the client is associated to (so walk the ifTable to find the index if you only know the interface name).

So if you know the clients MAC address and the SNMP index of the AP interface where the client is supposed to be connected to then it is very easy to calculate the OID for the SNMP GET. The cyan part is static anyway.


--Tom
 
User avatar
ahmedramze
Member Candidate
Member Candidate
Topic Author
Posts: 111
Joined: Mon Feb 21, 2005 9:29 am
Location: IRAQ
Contact:

Wed Oct 25, 2006 8:53 am

Just I know how get the MAC for user

in HTML variable name is $mac and it was string need to convert .

and more idea

if any one has OCX file on SNMP , I'm try to search VB and Java script but all them not free.

Regard and Still work
 
User avatar
chimaster
Member Candidate
Member Candidate
Posts: 133
Joined: Tue Feb 07, 2006 8:54 am
Location: Queenstown
Contact:

Re: WiFi Signal for Hotspot in Login Page

Thu Feb 12, 2009 3:14 am

Did anyone get further on this?

I realise it's an old post, but it would be great to be able to show signal strength on login page. That way when users call up and say I have 3 Bars, we can ask, "what is the signal on the login page", answer "-81db" "well, that's not enough, please try moving to the window or whatever....


Surely this is something that someone has nailed?
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: WiFi Signal for Hotspot in Login Page

Sun Feb 15, 2009 12:42 pm

Hi chimaster,
I took a shot at this, but there are a couple big challenges:
1) The hotspot interface is not always a radio. Could be ether2 or bridge1.
2) If the radio is in a remote AP, retrieving the signal value from there could be a problem.
ADD: 3) No scripts run in the html docs like php does. (maybe someone could ask MT for that?)

I have not given up. Hopefully there are others trying this as well. It is a good idea.
 
User avatar
chimaster
Member Candidate
Member Candidate
Posts: 133
Joined: Tue Feb 07, 2006 8:54 am
Location: Queenstown
Contact:

Re: WiFi Signal for Hotspot in Login Page

Wed Feb 18, 2009 12:56 pm

I'm definitely not a coder so it won't be me I'm afraid. Would love to. Might get my php guy to give it a crack once we've upgraded our billing system and remote login pages.

In Answer.

1. We use Ethernet Hotspot too, I guess we'd just have to deal with it and have it not display if no Signal available. 60% of cases would be better than 0%.

2. Only to get signal from clients connect to master WLAN interfaces, not worried about CPE's just laptops and USB devices.

3. Scripting from server side calling Mikrotik Variables? Again, this is my coders strong point not mine, I'm trawling through his smarty code with takes the variables from a Mikrotik Login page redirect to be displayed on the remote server login page (MAC ADD, IP etc..) If we can get something turned into a variable for display on remote......

*sigh* Again, not a coder. Really should give up reading Sci-fi and start reading PHP and Ruby.

I'm keen on this one, so I'll post back here if we get a result!

Cheers
 
User avatar
ahmedramze
Member Candidate
Member Candidate
Topic Author
Posts: 111
Joined: Mon Feb 21, 2005 9:29 am
Location: IRAQ
Contact:

Re: WiFi Signal for Hotspot in Login Page

Mon May 30, 2011 4:26 am

its done
test.gif
and code for PHP also need attached class.
<?php

require('routeros_api.class.php');

$API = new routeros_api();

$API->debug = false;

if ($API->connect('10.10.10.253', 'admin', '')) {      // Change this as necessery
$ARRAY = $API->comm("/system/resource/print");


$first = $ARRAY['0'];
$memperc = ($first['free-memory']/$first['total-memory']);
$hddperc = ($first['free-hdd-space']/$first['total-hdd-space']);
$mem = ($memperc*100);
$hdd = ($hddperc*100);

echo "<br />";
echo "<p align=center>Mikrotik Resources";

echo "<table width=550 border=1 align=center>";

echo "<tr><td>Platform, board name and Ros version is: </td><td>" . $first['platform'] . " - " . $first['board-name'] . " - "  . $first['version'] . " - " . $first['architecture-name'] . "</td></tr><br />";

echo "<tr><td>Cpu and available cores:</td><td>" . $first['cpu'] . " at " . $first['cpu-frequency'] . " Mhz with " . $first['cpu-count'] . " core(s) "  . "</td></tr><br />";

echo "<tr><td>Uptime is:</td><td>" . $first['uptime'] . " (hh/mm/ss)" . "</td></tr><br />";

echo "<tr><td>Cpu Load is:</td><td>" . $first['cpu-load'] . " %" . "</td></tr><br />";

echo "<tr><td>Total,free memory and memory % is:</td><td>" . $first['total-memory'] . "Kb - " . $first['free-memory'] . "Kb - " . number_format($mem,3) . "% </td></tr><br />";

echo "<tr><td>Total,free disk and disk % is:</td><td>" . $first['total-hdd-space'] . "Kb - " . $first['free-hdd-space'] . "Kb - " . number_format($hdd,3) . "% </td></tr><br />";

echo "<tr><td>Sectors (write,since reboot,bad blocks):</td><td>" . $first['write-sect-total'] . " - " . $first['write-sect-since-reboot'] . " - " . $first['bad-blocks'] . "% </td></tr><br />";

echo "</table>";



$ARRAY = $API->comm("/interface/wireless/registration-table/print");
$first = $ARRAY['0'];
echo "<p align=center>RX Signal=".$first['signal-strength-ch0'] . "    and TX Signal=" . $first['tx-signal-strength'] ;

$API->disconnect();

require('./class.progressbar.php');   // include class file 

$prb = new ProgressBar(300, 50);   // create new ProgressBar (width:300px,height:50px)
$prb->max = 100;   // max step 
$prb->left = 330;   // distance from left in px 
$prb->top = 550;   // distance from top in px 
$prb->color = '#ffcc00';   // Bar Color 
$prb->bgr_color = 'blue';   // Background Color 
$prb->txt_color = '#000000';   // Text Color 
$prb->brd_color = '#000000';   // Border Color 
$prb->brd_width = 1 ;   // Border Width 
$prb->showBar();   // display the ProgressBar 
$prb->moveBar(-1 * $first['tx-signal-strength']); 

$prb = new ProgressBar(300, 50);   // create new ProgressBar (width:300px,height:50px)
$prb->max = 100;   // max step 
$prb->left = 330;   // distance from left in px 
$prb->top = 605;   // distance from top in px 
$prb->color = '#ffcc00';   // Bar Color 
$prb->bgr_color = 'blue';   // Background Color 
$prb->txt_color = '#000000';   // Text Color 
$prb->brd_color = '#000000';   // Border Color 
$prb->brd_width = 1 ;   // Border Width 
$prb->showBar();   // display the ProgressBar 
$prb->moveBar(-1 * $first['signal-strength-ch0']); 



}

?>
You do not have the required permissions to view the files attached to this post.
 
User avatar
JP_Wireless
Member Candidate
Member Candidate
Posts: 276
Joined: Thu Dec 13, 2007 4:31 pm
Location: Lagos Nigeria
Contact:

Re: WiFi Signal for Hotspot in Login Page

Thu Jun 16, 2011 11:17 pm

well done! i will try it out. more kudos!!
 
WICaRD
just joined
Posts: 5
Joined: Fri Sep 06, 2013 2:42 am

Re: WiFi Signal for Hotspot in Login Page

Fri Apr 10, 2015 10:13 pm

Hi All, I know this post is very old, but my php and html skills are little to none just enough to help myself in some cases, I found this nice code for signal checks but I don't know how to get it up and running. can someone please help me to know where I should copy, move or incorporate this nice signal test php page. thanks in advance.

Edit : OK I used this on my freePBX pc also setup as a web server, I have concluded that this nice php script does work well but it only check the first wireless device set as 0, how can we set this to be used with the MAC-ADdRESS I know there is something like this "$(mac)" that one can use to find the pc mac but how do I make it search for the signal on that mac-address.

something to wakeup the brain..
 
troffasky
Member
Member
Posts: 431
Joined: Wed Mar 26, 2014 4:37 pm

Re: WiFi Signal for Hotspot in Login Page

Mon Apr 13, 2015 12:08 am

/interface wireless registration-table print where mac-address eq $(mac)
Where is $(mac) coming from, though? Is $(mac) even a valid way of representing a PHP variable?
 
WICaRD
just joined
Posts: 5
Joined: Fri Sep 06, 2013 2:42 am

Re: WiFi Signal for Hotspot in Login Page

Mon Apr 13, 2015 7:31 pm

For what I know regarding php is dangerous, I don't know what variables are available for php and $mac I know $mac does work in html. and I have searched the internet for a possible why to do the same in php, but some people say that it's not possible and that one should use jave to do this. I have tested most of the current php code that other wrote but none of them gives me the mac of the client connected.

This would be nice to be able to see ones signal strength on the login page but I'm starting to feel skeptic. I will keep on searching.
 
User avatar
ahmedramze
Member Candidate
Member Candidate
Topic Author
Posts: 111
Joined: Mon Feb 21, 2005 9:29 am
Location: IRAQ
Contact:

Re: WiFi Signal for Hotspot in Login Page

Thu Apr 16, 2015 4:30 am

Php its different from HTML.

the code in PHP are execute on server then send the result as HTML to your web browser.

HTML are execute in your Browser.

so The PHP its server side ,PHP is a programming language, it usually handles business logic with conditionals, loops, arrays and objects.

the HTML its client side , HTML is a markup language that displays the text, image and anything else you want to the browser.

Who is online

Users browsing this forum: diamuxin, G00dm4n and 15 guests