Find the gateway
Gateways in the local network can be discovered in various ways. Where the quickest way is discovery via Internet. Other methods like UPnP and Nmap are more advanced and might be used when Internet discovery isn’t available or fails.
Discovery via Internet
This returns a JSON list of all known gateways in the local network.
If both the gateway and the application have Internet access, this method is the easiest way to find the gateway.
Response
[{
"id": "E0:69:78:58:22:A4:32:CE",
"internalipaddress": "192.168.192.34",
"internalport": "8080",
"macaddress": "E0:69:78:58:22:A4:32:CE",
"name": "RaspBee GW"
}]Note: For webapps this is the only way to automatically find the gateway.
By visiting https://phoscon.de/discover a list of all gateways in the local network will be displayed. This is done by only using jQuery, Ajax and internet discovery.
Discovery via UPnP
Another method to find the gateway is UPnP discovery via UDP sockets.
The main advantage compared to the internet discovery is that no internet is needed at all.
Note: This method does not work across multiple sub-networks, since UDP broadcasts are not forwarded between these.Discovery via Nmap
Nmap is an open source command-line network scanner which is available for all major platforms. Since the gateway runs a SSH deamon at port 22 it is easy to find it in the local network.
$ nmap -p 22 -T5 -n -min-parallelism 100 --open 192.168.192.0/24
Note: Replace the 192.168.192.0/24 with
your subnetwork for example 192.168.0.0/24.
Result
Starting Nmap 6.25 ( http://nmap.org ) at 2013-07-01 13:04 CEST
Nmap scan report for 192.168.192.34
Host is up (0.00081s latency).
PORT STATE SERVICE
22/tcp open ssh
Discovery via Phoscon App
By visiting http://dresden-elektronik.de/pwa the official Phoscon App will be loaded in the browser.
When you click the Phoscon logo the search for gateways in the local network starts. This does not require internet connection!
When gateways are found they will be listed at the page. You can connect to a gateway by selecting it.