ROBIN -  Open Source Mesh Network Forum Index ROBIN - Open Source Mesh Network
users community forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Open-Mesh to Orange-Mesh

 
Post new topic   Reply to topic    ROBIN - Open Source Mesh Network Forum Index -> OrangeMesh Dashboard
View previous topic :: View next topic  
Author Message
Ads






Posted: Mon Dec 11, 2017 8:51 pm    Post subject: Ads

Back to top
jack
User
User


Joined: 08 Oct 2008
Posts: 6

PostPosted: Wed Oct 08, 2008 2:05 pm    Post subject: Open-Mesh to Orange-Mesh Reply with quote

Our mesh is up on open-mesh and I have set up orange mesh which is working fine but no chckins. I have a few questions.

1. Does the network and nodes on Open-Mesh have to be created the same on my Orange_mesh server?(They are)

2. How do I get the nodes to checkin on Orange-Mesh? I have put in the ip address of my Orange-Mesh server in the alternate control server spot on Open-Mesh but still no luck.

3. How to be self contained using Orange-Mesh without the hassel of using Open-Mesh also? I am using the mini Routers from Open-Mesh.

Thanks

Jack
Back to top
View user's profile Send private message
shasan
Moderator
Moderator


Joined: 16 Feb 2008
Posts: 178
Location: Chapel Hill, NC

PostPosted: Thu Oct 09, 2008 12:46 am    Post subject: Reply with quote

Assuming you've added your nodes to your dashboard and properly configured your alternate control server, it should work properly. Right now there is no easy way to set your nodes to send checkins to an Orangemesh server without adding them first to Open-Mesh and setting the alternate control server value. The alternative would be to SSH in to each node and change its update server to point to your server. But, once you add the nodes to an Orangemesh server you should be able to completely control them from there without needing to go to Open-Mesh.

As for why your nodes are not checking in, I would verify that your Orangemesh server is reachable from other devices. Does it respond to ping from outside your network? Is it behind a firewall? Did you put the right IP address into the Alternate Control Server field? Make sure that if you have orangemesh running in a directory other than your webroot you put the path to the Orangemesh folder in that field. i.e.,
Only registered users can see links on this forum!
Register or Login on forum!

Please check/try these things and post back with your results.

_________________

Only registered users can see links on this forum!
Register or Login on forum!


unc-chapel hill, class of 2010
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jack
User
User


Joined: 08 Oct 2008
Posts: 6

PostPosted: Thu Oct 09, 2008 1:48 pm    Post subject: Open-mesh to Orange Mesh Reply with quote

Yes I have set the Alternate control server. I installed Orange mesh in the webroot of my Linux box and is pingable from the outside and resolves properly. I noticed that when you put an address into the Alternate control server on Open-mesh it adds the entry to /etc/config/general file on the nodesI checked this file to make sure the ipaddress was there and it is. Still no checkin. I will keep playing with it. Is there any other scripts or files on the node I can change to bypass the open-mesh besides the /etc/general/config file?

Thanks
Back to top
View user's profile Send private message
jack
User
User


Joined: 08 Oct 2008
Posts: 6

PostPosted: Thu Oct 09, 2008 4:00 pm    Post subject: Orange-Mesh errors Reply with quote

Looking on my linux box which is hosting the Orange-mesh I see the error message below in my httpd logs. Any Ideas

PHP Fatal error: Call to undefined function array_fill_keys() in /var/www/html/checkin-batman.php on line 33
Back to top
View user's profile Send private message
shasan
Moderator
Moderator


Joined: 16 Feb 2008
Posts: 178
Location: Chapel Hill, NC

PostPosted: Thu Oct 09, 2008 4:07 pm    Post subject: Reply with quote

Aha, that would be the problem. What version of PHP are you using? array_fill_keys is only available on PHP 5.2.0 or greater...

_________________

Only registered users can see links on this forum!
Register or Login on forum!


unc-chapel hill, class of 2010
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jack
User
User


Joined: 08 Oct 2008
Posts: 6

PostPosted: Thu Oct 09, 2008 4:19 pm    Post subject: PHP Version Reply with quote

Thanks I have PHP Ver 5.16 I will upgrade and let you know thanks.

Jack
Back to top
View user's profile Send private message
woodside
User
User


Joined: 09 Sep 2008
Posts: 8

PostPosted: Thu Oct 09, 2008 4:35 pm    Post subject: Reply with quote

This is good info! I setup orangemesh as a test and could never get my nodes to check in, ran out of time and hadn't gotten back to it. My php version is 5.1.6 so I guess that is my problem as well.
Back to top
View user's profile Send private message
jack
User
User


Joined: 08 Oct 2008
Posts: 6

PostPosted: Thu Oct 09, 2008 4:51 pm    Post subject: Success Reply with quote

Hey Shasan


Thanks You rock. I upgraded my centos php to ver 5.26 restarted httpd and bingo checkin was successful. Hope this helps out woodside also. Thanks again.
Back to top
View user's profile Send private message
wifitenne
User
User


Joined: 28 Mar 2008
Posts: 42
Location: Nederland

PostPosted: Thu Feb 26, 2009 1:46 pm    Post subject: Reply with quote

This works with 5.0 >

checkin-batman.php
Code:
<?php
//Establish database connection
require 'lib/connectDB.php';

if (! function_exists("array_combine")) {
    function array_combine($a1,$a2)
    {
        for($i=0;$i<count($a1);$i++)
            $ra[$a1[$i]] = $a2[$i];
        if(isset($ra)) return $ra; else return false;
    }

//Create an array to fill with the values from ROBIN
$keys = array('ip','mac','uptime','robin','batman','memfree','nbs','gateway','gw-qual',
'routes','users','kbdown','kbup','rank','hops','ssid','pssid');

$robin_vars = array_combine($keys, '');

//Move the ROBIN variables from $_GET to variables of the same names
//foreach($robin_vars as $key => $value) { $robin_vars[$key] = $_REQUEST[$key]; }

$robin_vars['ip'] = $_REQUEST['ip'];
$robin_vars['mac'] = $_REQUEST['mac'];
$robin_vars['uptime'] = $_REQUEST['uptime'];
$robin_vars['robin'] = $_REQUEST['robin'];
$robin_vars['batman'] = $_REQUEST['batman'];
$robin_vars['memfree'] = $_REQUEST['memfree'];
$robin_vars['nbs'] = $_REQUEST['nbs'];
$robin_vars['gateway'] = $_REQUEST['gateway'];
$robin_vars['gw-qual'] = $_REQUEST['gw-qual'];
$robin_vars['routes'] = $_REQUEST['routes'];
$robin_vars['users'] = $_REQUEST['users'];
$robin_vars['kbdown'] = $_REQUEST['kbdown'];
$robin_vars['kbup'] = $_REQUEST['kbup'];
$robin_vars['rank'] = $_REQUEST['rank'];
$robin_vars['hops'] = $_REQUEST['hops'];
$robin_vars['ssid'] = $_REQUEST['ssid'];
$robin_vars['pssid'] = $_REQUEST['pssid'];

//We must at least have a MAC address; fail if we don't.
if ($robin_vars["mac"] == '') die("No MAC address.");


//If we don't have a DB row for this MAC address, create one.
//While we're at it, get the memlow, usershi, and netid variables to use later.
$query = sprintf("SELECT memlow, usershi, netid FROM node WHERE mac='%s'",$robin_vars["mac"]);
$result = mysql_query($query, $conn);
if (mysql_num_rows($result) == 0) {
    $query = sprintf("INSERT INTO node (mac) VALUES ('%s')",$robin_vars["mac"]);
    mysql_query($query, $conn);
}
$row = mysql_fetch_array($result);
$memlow = $row['memlow'];
$usershi = $row['usershi'];
$netid = $row['netid'];

//Prepare the update string with the ROBIN vars
$update = "UPDATE node SET ";
foreach($robin_vars as $key => $value) $update .= "`" . $key . "`='" . $value . "', ";

//Add the time and derivative ROBIN vars to the update string
$update .= "`time`=CURRENT_TIMESTAMP, ";
if ($memlow == '' || $memlow > $robin_vars["memfree"]) $update .= "`memlow`='" . $robin_vars['memfree'] . "', ";
if ($usershi < $robin_vars["users"]) $update .= "`usershi`='" . $robin_vars['users'] . "', ";
if (in_array($robin_vars["gateway"],split(";",$robin_vars["nbs"]))) $update .= "`gateway_bit`=0, ";
else $update .= "`gateway_bit`=1, ";    //If $gateway is in $nbs array, the gateway is a neighbor (i.e. another node), which means this node itself is not a gateway. (For actual gateway nodes, the 'gateway' is the router.)

//Cap off the update string and make the update
$update = rtrim($update, ", ");
$update .= sprintf(" WHERE mac='%s'",$robin_vars["mac"]);
mysql_query($update, $conn);

//Get the network settings variables
$query = sprintf("SELECT * FROM network WHERE id='%s'",$netid);
$result = mysql_query($query, $conn);
if (mysql_num_rows($result) == 0) die("No such network");
$row = mysql_fetch_array($result);
$fields = array("ap1_essid","ap1_key","ap2_essid","ap2_key","ap1_isolate","ap2_isolate","ap2_enable",
  "node_pwd","download_limit","upload_limit","throttling_enable","lan_block","splash_redirect_url",
  "splash_idle_timeout","splash_force_timeout","test_firmware_enable","splash_enable");
foreach ($fields as $field) $$field = $row[$field];

//Create any other special strings needed for the response
if (strlen($splash_redirect_url) > 0) $splash_redirect_url_string = "RedirectURL " . $splash_redirect_url;
else $splash_redirect_url_string = "";
if ($test_firmware_enable == 1) $base = "trunk";
else $base = "beta";
if ($splash_enable == 1) $authenticate_immediately = 0;
else $authenticate_immediately = 1;
if ( strlen($ap1_key) >= 8) $ap_psk = 1;
else $ap_psk = 0;

//Output response to node. This comes from Antonio's sample, with some bug fixes.
 
echo <<< RESPONSE
#@#config node
general.net orange
#@#config management
enable.base $base
enable.rootpwd $node_pwd
enable.defessid 0
#@#config mesh
ap.up 1
Myap.up $ap2_enable
ap.psk $ap_psk
#@#config wireless
private.ssid $ap2_essid
public.ssid $ap1_essid
private.key $ap2_key

RESPONSE;
if ($ap_psk) echo "public.key $ap1_key\n";
echo <<< RESPONSE
#@#config iprules
LAN_BLOCK $lan_block
AP1_bridge $ap1_isolate
AP2_bridge $ap2_isolate
#@#config secondary
backend.update 0
backend.server
backend.ssl 0
#@#config acl
mac.mode_ap1 0
#@#config nodog
FirewallRuleSet preauthenticated-users {
FirewallRule allow
}
FirewallRuleSet authenticated-users {
FirewallRule allow
}
FirewallRuleSet users-to-router {
FirewallRule allow udp port 53
FirewallRule allow tcp port 53
FirewallRule allow udp port 67
FirewallRule allow tcp port 20
FirewallRule allow tcp port 21
FirewallRule allow tcp port 22
FirewallRule allow tcp port 23
FirewallRule allow tcp port 80
FirewallRule allow tcp port 443
}
GatewayName orange test
RedirectURL http://$splash_redirect_url
ClientIdleTimeout $splash_idle_timeout
ClientForceTimeout $splash_force_timeout
AuthenticateImmediately $authenticate_immediately
TrafficControl $throttling_enable
DownloadLimit $download_limit
UploadLimit $upload_limit
#bogus2 772827811
#@#config splash-HTML
page http://www.open-mesh.com/users/anselmi/splash.txt
file http://www.open-mesh.com/pages/gateway.css
image http://www.open-mesh.com/users/anselmi/images/antonio.GIF
image http://www.open-mesh.com/users/anselmi/images/open-mesh-small.png

RESPONSE;

?>
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    ROBIN - Open Source Mesh Network Forum Index -> OrangeMesh Dashboard All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
c d
e



Powered by phpBB © 2001, 2005 phpBB Group

Abuse - Report Abuse - TOS & Privacy.
Powered by forumup.it free forum, create your free forum! Created by Hyarbor & Qooqoa
Confirmed

Page generation time: 3.494