urlgrey / hsmm-pi

A set of tools to easily configure the Raspberry Pi to function as a High-Speed Multimedia (HSMM) wireless node.
MIT License
369 stars 92 forks source link

[Help] When rebooting. #47

Closed deavmi closed 8 years ago

deavmi commented 9 years ago

After installing HSMM-Pi on Raspbian on my RapsberryPi's, I then reboot, I loose all connectivity to my Pi. No web interface, or SSH. Not even ping.

argilo commented 9 years ago

Try connecting to 172.27.2.1, which will be the Pi's IP address after it reboots. Remember that the Pi will be acting as a DHCP server, so you should connect your computer straight to it and get an IP address from it. You should also be able to connect to it by name: localnode.

deavmi commented 9 years ago

It was on my LAN before the reboot, so should I now connect to it via direct ethernet (from my laptop plugged into Pi via ethernet)? :smile:

argilo commented 9 years ago

Yes, you'll have to take it off your LAN and connect directly.

deavmi commented 9 years ago

@argilo Okay, thanks :smile:

deavmi commented 9 years ago

@argilo Still no success... :cry:

argilo commented 9 years ago

Do you have all other network interfaces on your laptop (e.g. WiFi) turned off? What IP address does your connection to the Raspberry Pi have?

deavmi commented 9 years ago

I turned off my WiFi on my laptop and connected directly from y laptop's ethernet port to my RaspberryPi's thernet port. Still no success, I tried visiting the page you specefied.

argilo commented 9 years ago

Check whether your laptop was assigned an IP address by the Raspberry Pi. It should begin with 172.27.2. If that looks OK, make sure you're using port 8080 in the URL when you try to access hsmm-pi.

deavmi commented 9 years ago

@argilo Oh, I think it was my old ethernet settings that were messing things up! :small:

deavmi commented 9 years ago

@argilo I have re-initialised them and the Default Route label now shows 172.27.2.1 . Now to test the web-interface. UPDATE: Everything is working. Thanks :smile:

argilo commented 9 years ago

Excellent. See if you can access http://localnode:8080/ or http://172.27.2.1:8080/. You should also be able to log in through SSH if needed.

argilo commented 9 years ago

Glad to hear it's all working now. If there are things that need to be clarified in the README, let me know.

deavmi commented 9 years ago

@argilo Going to test the mesh now, set the WiFi Broadcast Channel to 9, got the same BSSID, so I think things shall be going well after this reboot. Thanks! :smile:

deavmi commented 9 years ago

@argilo Maybe an FAQ section could be good, on the repo's wiki. :smile:

deavmi commented 9 years ago

@argilo They do not seem to be picking each other up for some reason though. There is an ad-hoc BSSID being braodcast, which I set to (on both the nodes) "WMeshNet", but no links are shown on the status page.

argilo commented 9 years ago

Are you using hsmm-pi on both ends?

deavmi commented 9 years ago

@argilo Yep :smile:

deavmi commented 9 years ago

@argilo Something like this would be a good FAQ, https://github.com/urlgrey/hsmm-pi/wiki/FAQ

argilo commented 9 years ago

Double check that your settings are identical on both sides, apart from the node name which should be different. Also you can check the olsrd status at http://local node:1978/all for signs of trouble.

deavmi commented 9 years ago

@argilo There seems to be nothing under the "neighbours" section.

argilo commented 9 years ago

Does the "Interfaces" section look okay on both ends?

deavmi commented 9 years ago

I just generated a config file of Olsrd's current config, and everything seems to be marked out a.k.a #, surely this must be the problemo:

#
# Configuration file for olsr.org - pre-0.6.8.1-git_9891303-hash_7da0af84d0db0f920462d6ccb4f41102
# automatically generated by olsrd-cnf parser v. 0.1.2
#

# OLSR.org routing daemon config file
# This file contains ALL available options and explanations about them
#
# Lines starting with a # are discarded
#

#### ATTENTION for IPv6 users ####
# Because of limitations in the parser IPv6 addresses must NOT
# begin with a ":", so please add a "0" as a prefix.

###########################
### Basic configuration ###
###########################
# keep this settings at the beginning of your first configuration file

# Debug level (0-9)
# If set to 0 the daemon runs in the background, unless "NoFork" is set to true
# (default is 1)

DebugLevel  0

# IP version to use (4 or 6)
# (default is 4)

# IpVersion 4

#################################
### OLSRd agent configuration ###
#################################
# this parameters control the settings of the routing agent which are not
# related to the OLSR protocol and it's extensions

# Clear the screen each time the internal state changes
# (default is yes)

# ClearScreen     yes

# Should olsrd keep on running even if there are
# no interfaces available? This is a good idea
# for a PCMCIA/USB hotswap environment.
# (default is yes)

# AllowNoInt  yes

# LockFile
# The lockfile is used to prevent multiple OLSR instances running at the same
# time.
# (Linux/BSD default is "/var/run/olsrd-ipv(4/6).lock")
# (Win32     default is "configfile-ipv(4/6).lock")

# LockFile "lockfile"

# Polling rate for OLSR sockets in seconds (float). 
# (default is 0.05)

# Pollrate  0.05

# Interval to poll network interfaces for configuration changes (in seconds).
# Linux systems can detect interface statechange via netlink sockets.
# (default is 2.5)

# NicChgsPollInt  2.5

# TOS(type of service) value for the IP header of control traffic.
# (default is 192)

TosValue 16

# FIBMetric controls the metric value of the host-routes OLSRd sets.
# - "flat" means that the metric value is always 2(or as configured 
#   with FIBMetricDefault). This is the preferred value because it 
#   helps the linux kernel routing to clean up older routes
# - "correct" use the hopcount as the metric value.
# - "approx" use the hopcount as the metric value too, but does only update the
#   hopcount if the nexthop changes too
# (default is "flat")

# FIBMetric "flat"

# Default FIB metric.
# The kernel FIB does not need to know the metric of a route.
# This saves us from enqueuing/dequeueing hopcount only changes.
# (default is 2)

# FIBMetricDefault 2

#######################################
### Linux specific OLSRd extensions ###
#######################################
# these parameters are only working on linux at the moment, but might become
# useful on BSD in the future

# SrcIpRoutes tells OLSRd to set the Src flag of host routes to the originator-ip
# of the node. In addition to this an additional localhost device is created
# to make sure the returning traffic can be received.
# (default is "no")

# SrcIpRoutes no

# Specify the proto tag to be used for routes olsr inserts into kernel
# currently only implemented for linux
# valid values under linux are 1 .. 254
# 1 gets remapped by olsrd to 0 UNSPECIFIED (1 is reserved for ICMP redirects)
# 2 KERNEL routes (not very wise to use)
# 3 BOOT (should in fact not be used by routing daemons)
# 4 STATIC 
# 8 .. 15 various routing daemons (gated, zebra, bird, & co)
# (default is 0 which gets replaced by an OS-specific default value
# under linux 3 (BOOT) (for backward compatibility)

RtProto 3

# Specifies the routing Table olsr uses
# RtTable is for host routes, RtTableDefault for the route to the default
# internet gateway (2 in case of IPv6+NIIT) and RtTableTunnel is for
# routes to the ipip tunnels, valid values are 1 to 254
# There is a special parameter "auto" (choose default below)
# (with    smartgw: default is 254/223/224)
# (without smartgw: default is 254/254/254, linux main table)

# RtTable        254
# RtTableDefault 254
# RtTableTunnel  254

# Specifies the policy rule priorities for the three routing tables and
# a special rule for smartgateway routing (see README-Olsr-Extensions)
# Priorities can only be set if three different routing tables are set.
# if set the values must obey to condition
# RtTablePriority less than RtTableDefaultOlsrPriority
# less than RtTableTunnelPriority less than RtTableDefaultPriority
# There are two special parameters, "auto" (choose fitting to SmartGW
# mode) and "none" (do not set policy rule)
# (with    smartgw: default is -1/32776/32786/32796)
# (without smartgw: default is -1/-1   /-1   /-1   )

# RtTablePriority            -1
# RtTableDefaultOlsrPriority -1
# RtTableTunnelPriority      -1
# RtTableDefaultPriority     -1

# Activates (in IPv6 mode) the automatic use of NIIT
# (see README-Olsr-Extensions)
# (default is "yes")

UseNiit no

# Activates the smartgateway ipip tunnel feature.
# See README-Olsr-Extensions for a description of smartgateways.
# (default is "no")

# SmartGateway no

# Signals that the server tunnel must always be removed on shutdown,
# irrespective of the interface up/down state during startup.
# (default is "no")

# SmartGatewayAlwaysRemoveServerTunnel no

# Determines the maximum number of gateways that can be in use at any given
# time. This setting is used to mitigate the effects of breaking connections
# (due to the selection of a new gateway) on a dynamic network.
# (default is 1)

# SmartGatewayUseCount 1

# Determines the take-down percentage for a non-current smart gateway tunnel.
# If the cost of the current smart gateway tunnel is less than this percentage
# of the cost of the non-current smart gateway tunnel, then the non-current smart
# gateway tunnel is taken down because it is then presumed to be 'too expensive'.
# This setting is only relevant when SmartGatewayUseCount is larger than 1;
# a value of 0 will result in the tunnels not being taken down proactively.
# (default is 25)

# SmartGatewayTakeDownPercentage 25

# Determines the policy routing script that is executed during startup and
# shutdown of olsrd. The script is only executed when SmartGatewayUseCount
# is set to a value larger than 1. The script must setup policy routing
# rules such that multi-gateway mode works. A sample script is included.
# (default is not set)

# SmartGatewayPolicyRoutingScript 

# Determines the egress interfaces that are part of the multi-gateway setup and
# therefore only relevant when SmartGatewayUseCount is larger than 1 (in which
# case it must be explicitly set).
# (default is not set)

# SmartGatewayEgressInterfaces

# SmartGatewayEgressFile declares the file that contains the bandwidth
# parameters of the egress interfaces declared by SmartGatewayEgressInterfaces.
# Every line in the file declares bandwidth parameters of an egress interface,
# with the format:
#   # this is a comment
#   interface=upstream,downstream,pathcost,network/prefix,gateway
# Only the upstream and downstream fields are mandatory, the other fields are
# optional. An empty field signifies that its default should be used.
# The field defaults are:
#   upstream           = 0 (Kbps)
#   downstream         = 0 (Kbps)
#   pathcost           = 0 (dimensionless, 1024 is equivalent to 1 hop)
#   network/prefix     = no default / not set
#                        - network is an IP address
#                        - prefix is a number in the range [0, 24] for IPv4
#                          and in the range [0, 128] for IPv6
#   gateway            = no default / not set (IP address)
# (default is /var/run/olsrd-sgw-egress.conf)

# SmartGatewayEgressFile /var/run/olsrd-sgw-egress.conf

# SmartGatewayEgressFilePeriod determines the period (in milliseconds) on which
# the SmartGatewayEgressFile is checked for changes and processed if changed.
# (default is 5000)

# SmartGatewayEgressFilePeriod 5000

# Declares the file that is written by olsrd to contain the status of the smart
# gateways and is only relevant when SmartGatewayUseCount is larger than 1.
# (default is )

# SmartGatewayStatusFile 

# Determines the routing tables offset for multi-gateway policy routing tables
# See the policy routing script for an explanation.
# (default is 90)

# SmartGatewayTablesOffset 90

# Determines the policy routing rules offset for multi-gateway policy routing
# rules. See the policy routing script for an explanation.
# (default is 0, which indicates that the rules and tables should be aligned and
# puts this value at SmartGatewayTablesOffset - # egress interfaces -
# # olsr interfaces)

# SmartGatewayRulesOffset 0

# Allows the selection of a smartgateway with NAT (only for IPv4)
# (default is "yes")

# SmartGatewayAllowNAT yes

# Determines the period (in milliseconds) on which a new smart gateway
# selection is performed.
# (default is 10000 milliseconds)

# SmartGatewayPeriod 10000

# Determines the number of times the link state database must be stable
# before a new smart gateway is selected.
# (default is 6)

# SmartGatewayStableCount 6

# When another gateway than the current one has a cost of less than the cost
# of the current gateway multiplied by SmartGatewayThreshold then the smart
# gateway is switched to the other gateway. The unit is percentage.
# (default is 0)

# SmartGatewayThreshold  0

# The weighing factor for the gateway uplink bandwidth (exit link, uplink).
# See README-Olsr-Extensions for a description of smart gateways.
# (default is 1)

# SmartGatewayWeightExitLinkUp  1

# The weighing factor for the gateway downlink bandwidth (exit link, downlink).
# See README-Olsr-Extensions for a description of smart gateways.
# (default is 1)

# SmartGatewayWeightExitLinkDown  1

# The weighing factor for the ETX costs.
# See README-Olsr-Extensions for a description of smart gateways.
# (default is 1)

# SmartGatewayWeightEtx  1

# The divider for the ETX costs.
# See README-Olsr-Extensions for a description of smart gateways.
# (default is 0)

# SmartGatewayDividerEtx  0

# Defines what kind of Uplink this node will publish as a
# smartgateway. The existence of the uplink is detected by
# a route to 0.0.0.0/0, ::ffff:0:0/96 and/or 2000::/3.
# possible values are "none", "ipv4", "ipv6", "both"
# (default is "both")

# SmartGatewayUplink "both"

# Specifies if the local ipv4 uplink use NAT
# (default is "yes")

# SmartGatewayUplinkNAT yes

# Specifies the speed of the uplink in kilobit/s.
# First parameter is upstream, second parameter is downstream
# (default is 128/1024)

# SmartGatewaySpeed 128 1024

# Specifies the EXTERNAL ipv6 prefix of the uplink. A prefix
# length of more than 64 is not allowed.
# (default is 0::/0

# SmartGatewayPrefix 0.0.0.0/0.0.0.0

##############################
### OLSR protocol settings ###
##############################

# For testing purposes it may be nice to use another port for olsrd
# for using another port than the IANA assigned one 
# for a production network, there should be a good reason!!
# valid values are integers greater than 1, please be careful with
# using reserved port numbers
# (default is 698, the IANA assigned olsr-port)

# OlsrPort 698

# Sets the main IP (originator ip) of the router. This IP will NEVER
# change during the uptime of olsrd.
# (default is 0.0.0.0, which triggers usage of the IP of the first interface)

MainIp 10.26.157.93

# The fixed willingness to use (0-7)
# If not set willingness will be calculated
# dynamically based on battery/power status
# (default is 3)

# Willingness     3

# HNA (Host network association) allows the OLSR to announce
# additional IPs or IP subnets to the net that are reachable
# through this node.
# Syntax for HNA4 is "network-address    network-mask"
# Syntax for HNA6 is "network-address    prefix-length"
# (default is no HNA)
Hna4
{
}

# Hysteresis for link sensing (only for hopcount metric)
# Hysteresis adds more robustness to the link sensing
# but delays neighbor registration.
# (default is no)

# UseHysteresis no

# Hysteresis parameters (only for hopcount metric)
# Do not alter these unless you know what you are doing!
# Set to auto by default. Allowed values are floating point
# values in the interval 0,1
# THR_LOW must always be lower than THR_HIGH!!
# (default is 0.50/0.80/0.30)

# HystScaling  0.50
# HystThrHigh  0.80
# HystThrLow  0.30

# TC redundancy
# Specifies how much neighbor info should be sent in
# TC messages. Because of a design problem in the 0.5.x
# dijkstra implementation this value must be set to 2.
# 2 - send all neighbors
# (default is 2)

# TcRedundancy  2

# MPR coverage specifies how many MPRs a node should
# try select to reach every 2 hop neighbor. Because of
# a design problem in the 0.5.x dijkstra algorithm this
# value should be set to 7.
# (default is 7)

MprCoverage 5

################################
### OLSR protocol extensions ###
################################

# Link quality level switch between hopcount and 
# cost-based (mostly ETX) routing. Because of
# a design problem in the 0.5.x dijkstra algorithm this
# value should not be set to 1.
# 0 = do not use link quality
# 2 = use link quality for MPR selection and routing
# (default is 2)

# LinkQualityLevel 2

# Link quality algorithm (only for lq level 2)
# (see README-Olsr-Extensions)
# - "etx_float", a floating point  ETX with exponential aging
# - "etx_fpm", same as ext_float, but with integer arithmetic
# - "etx_ff" (ETX freifunk), an etx variant which use all OLSR
#   traffic (instead of only hellos) for ETX calculation
# - "etx_ffeth", an incompatible variant of etx_ff that allows
#   ethernet links with ETX 0.1.
# (default is "etx_ff")

LinkQualityAlgorithm    "etx_ffeth"

# Link quality aging factor (only for lq level 2)
# Tuning parameter for etx_float and etx_fpm, smaller values
# mean slower changes of ETX value. (allowed values are
# between 0.01 and 1.0)
# (default is 0.05)

# LinkQualityAging 0.05

# Fisheye mechanism for TCs (0 meansoff, 1 means on)
# (default is 1)

# LinkQualityFishEye  1

#
# NatThreshold 
#
# (currently this is only in the freifunk firmware)
# If the NAT-Endpoint (the preferred 0/0 HNA emitting node)
# is to be changed, the ETX value of the current 0/0 is 
# multiplied with the NatThreshold value before being
# compared to the new one.
# The parameter can be a value between 0.1 and 1.0, but
# should be close to 1.0 if changed.
# WARNING: This parameter should not be used together with
# the etx_ffeth metric !!
# (default is 1.0)

# NatThreshold  1.0

#############################################################
### Configuration of the IPC to the windows GUI interface ###
#############################################################

IpcConnect
{
    # Determines how many simultaneously
    # IPC connections that will be allowed
    # Setting this to 0 disables IPC

  # MaxConnections  0

    # By default only 127.0.0.1 is allowed
    # to connect. Here allowed hosts and networks can
    # be added

    Host 127.0.0.1
}

#####################################
### Example plugin configurations ###
#####################################
# Olsrd plugins to load
# This must be the absolute path to the file
# or the loader will use the following scheme:
# - Try the paths in the LD_LIBRARY_PATH 
#   environment variable.
# - The list of libraries cached in /etc/ld.so.cache
# - /lib, followed by /usr/lib

LoadPlugin "olsrd_nameservice.so.0.3" {
    PlParam "latlon-file"   "/var/run/latlon.js"
    PlParam "name"  "DD759C-2"
    PlParam "resolv-file"   "/etc/resolv.conf"
    PlParam "timeout"   "300"
    PlParam "interval"  "30"
    PlParam "sighup-pid-file"   "/var/run/dnsmasq/dnsmasq.pid"
}

LoadPlugin "olsrd_httpinfo.so.0.1" {
    PlParam "Resolve"   "true"
    PlParam "Net"   "0.0.0.0 0.0.0.0"
}

LoadPlugin "olsrd_arprefresh.so.0.1" {
}

LoadPlugin "olsrd_jsoninfo.so.0.0" {
    PlParam "accept"    "127.0.0.1"
}

#############################################
### OLSRD default interface configuration ###
#############################################
# the default interface section can have the same values as the following
# interface configuration. It will allow you so set common options for all
# interfaces.

InterfaceDefaults
{
}

######################################
### OLSRd Interfaces configuration ###
######################################
# multiple interfaces can be specified for a single configuration block
# multiple configuration blocks can be specified

Interface "wlan0"
{
    # Interface Mode is used to prevent unnecessary
    # packet forwarding on switched ethernet interfaces
    # valid Modes are "mesh" and "ether"
    # (default is "mesh")

    # Mode "mesh"

    # IPv4 broadcast address for outgoing OLSR packets.
    # One useful example would be 255.255.255.255
    # The second useful value would be to
    # specify the peer address of an ptp-tunnel.
    # another name of this parameter is "IPv4Multicast"
    # (default is 0.0.0.0, which triggers the usage of the
    # interface broadcast IP)

    # Ip4Broadcast      0.0.0.0

    # IPv6 multicast address
    # (default is ff02::6d, the manet-router linklocal multicast)

    # IPv6Multicast ff02::6d

    # IPv4 src address for outgoing OLSR packages
    # (default is 0.0.0.0, which triggers usage of the interface IP)

    # IPv4Src 0.0.0.0

    # IPv6 src prefix. OLSRd will choose one of the interface IPs
    # which matches the prefix of this parameter.
    # (default is 0::/0, which triggers the usage
    # of a not-linklocal interface IP)

    # IPv6Src ::

    # Emission intervals in seconds.
    # If not defined, Freifunk network defaults are used.
    # (defaults: Hello = 2.0/20.0,  TC  = 5.0/300.0,
    #            MID   = 5.0/300.0, HNA = 5.0/300.0)

    HelloInterval       6.0
    HelloValidityTime   600.0
    TcInterval          0.5
    # TcValidityTime      300.0
    MidInterval         10.0
    # MidValidityTime     300.0
    HnaInterval         10.0
    # HnaValidityTime     300.0

    # When multiple links exist between hosts
    # the weight of interface is used to determine
    # the link to use. Normally the weight is
    # automatically calculated by olsrd based
    # on the characteristics of the interface,
    # but here you can specify a fixed value.
    # Olsrd will choose links with the lowest value.
    # Note:
    # Interface weight is used only when LinkQualityLevel is set to 0.
    # For any other value of LinkQualityLevel, the interface ETX
    # value is used instead.
    # Weight 0

    # If a certain route should be preferred
    # or ignored by the mesh, the Link Quality
    # value of a node can be multiplied with a factor
    # entered here. In the example the route
    # using 192.168.0.1 would rather be ignored.
    # A multiplier of 0.5 will result in a small
    # (bad) LinkQuality value and a high (bad)
    # ETX value.
    # Note:
    # Link quality multiplier is used only when
    # LinkQualityLevel is greater than 0.

    # LinkQualityMult 192.168.0.1 0.5
}

# END AUTOGENERATED CONFIG
argilo commented 9 years ago

Not everything is commented out there. It looks normal to me.

deavmi commented 9 years ago

@argilo Everything looks correct, on the configuration side, I am doing a manual reboot now.

deavmi commented 9 years ago

@argilo Okay, that's good to know :smiley: Thanks

deavmi commented 9 years ago

The USB Wifi adpater sems to be off on the one Pi. Let me check this quickly. Oh, its off let me reboot.

deavmi commented 9 years ago

Okay, both dongles are powered on, but still, there seems to be a problem. They just do not mesh toghther.

argilo commented 9 years ago

I've had problems with certain WiFi adapters not working so well. Maybe a power supply that's not supplying enough current?

argilo commented 9 years ago

If you can't get it going, I'd suggest swapping in a different model of WiFi adapter to see if it works any better.

deavmi commented 9 years ago

@argilo Might want to check this out too https://github.com/urlgrey/hsmm-pi/issues/50

deavmi commented 9 years ago

@argilo This is what I get on the Status page. Warning!. There are no mesh links in range. It's a bit quiet around here..

deavmi commented 9 years ago

@argilo Was watching this, and @urlgrey says that nodes annouce their prescenece every 10 minutes, so maybe I ought to be patient.

deavmi commented 9 years ago

@argilo How many wifi adapters/antennas does pone node require?

deavmi commented 9 years ago

@argilo

I've had problems with certain WiFi adapters not working so well.

Did they atleast mesh though?

argilo commented 9 years ago

Nodes should mesh within a minute or two if things are working properly. Only one adapter/antenna per node is required. The problematic adapters I've seen work for a little while, then stop.

arnoldsmyth commented 9 years ago

Did anyone ever come to a resolution on this? I have this exact same problem. The nodes can see the Mesh when I run "iwlist wlan0 scan".

I can connect to the internal Mesh node with the Ethernet cable and the 172.27.2.1 IP address but while it see's the Mesh with a "Wifi Scan" the Status page still has the "It's a bit quiet" message. I can also connect to the gateway node with the IP address but it has the same issue.

The internal node does not have any access to the internet to run updates etc.

deavmi commented 9 years ago

@arnoldsmyth I feel ya bro. Lol :smile:

mathisono commented 9 years ago

Do a cold reboot remove the power. Ive had this problem a few times, sitting at my desk stumped my self, pull the power plug wait 30sec and reapply.

73 mathison On May 20, 2015 8:15 AM, "Tristan B. Kildaire" notifications@github.com wrote:

@arnoldsmyth https://github.com/arnoldsmyth I feel ya bro. Lol [image: :smile:]

— Reply to this email directly or view it on GitHub https://github.com/urlgrey/hsmm-pi/issues/47#issuecomment-103922528.

arnoldsmyth commented 9 years ago

@mathisono can you expand on what you mean by "reapply"?

mathisono commented 9 years ago

plug it back in

On Wed, May 20, 2015 at 9:48 AM, arnoldsmyth notifications@github.com wrote:

@mathisono https://github.com/mathisono can you expand on what you mean by "reapply"?

— Reply to this email directly or view it on GitHub https://github.com/urlgrey/hsmm-pi/issues/47#issuecomment-103956063.

argilo commented 8 years ago

I'm closing this, as it appears the original issue was resolved.