Why volumio.local was able to access the raspberry since it connected to local network - linux

After setting up volumio on raspberry, an interest feature was that you can use 'volumio.local' as the address to access the webpage hosted by raspberry, and there was not much to worry whether the ip address changed every time the raspberry connected to the local network. I was wondering how did volumio do that and how to setup an custom address for an raspberry to do the same.

It uses a system called Bonjour, which can locate devices and services on a local network using multicast Domain Name System (mDNS). See this Wikipedia article.

Related

Find IP address of local DHCP device other than through Powershell

I'm developing an application for my own use which, though I'm developing it on Windows is destined for a Raspberry PI, if it works. This needs to make a TCP connection to another device on my local network (a solar inverter) to collect data.
I hoped that the box would respond to the PnP multicast, but tests suggest it does not. I have a TalkTalk router at the moment but would prefer a solution that would survive a change of broadband provider.
Google searches seem to come up only with PowerShell solutions, but if PowerShell can do it then that suggests there's an underlying DHCP protocol (unless PowerShell is accessing PnP data).
Oops! Turns out that (at least with this hub) there's a trivial answer. The hub populates its own DNS, so all I needed to do was use the address "LuxController.lan:8000".
That's the device name I set in the hub web interface.

How to p2p_connect to device with WiFi Direct without MAC Address? (Raspberry Pi and Android)

I have an Android tablet and A Raspberry Pi and I want to established a connection between them automatically when the tablet sends a request to the Pi.
I followed an Android application example here and start discovering any nearby devices. (https://www.youtube.com/watch?v=qnY97iBxp30)
At the same time i run sudo wpa_cli and p2p_find 20. The Android application detects the Pi, and I try to establish connection with the Pi which will display
<3>P2P-GO-NEG-REQUEST TABLET_MAC_ADDRESS dev_passwd_id=4
Normally I would just p2p_connect TABLET_MAC_ADDRESS pbc to successfully connect them together but I find it inefficient if I were to swap to another mobile device.
Are there any other ways to connect the tablet without writing the tablet mac address? For example connecting to that specific device ssid when they send a P2P-GO-NEG-REQUEST to the pi?
TL;DR Nope.
If we look at the OSI ISO 7 layer model for network communication we can see that the Media Access Control (MAC) address is vital for identifying which device is which within a wifi network.
You could try setting up a bluetooth connection or a token-ring, but I suspect that would be more effort than you are looking for.
With IPv6 your devices could use neighbour discovery to automate past the MAC entry to the Internet Protocol, and its possible to connect between devices using their link-local address (fe80::some:thing)
Wifi carries packets of data, that have addresses. By analogy, if I tell you which town I live in, but don't write my building address on the packet, you are going to have a hard time delivering it.

Dynamically hosting website from behind router

I built a small app on a raspberry pi, which, among other things, hosts a simple website to allow a user to control it from a mobile device. Currently, the website is available through the pi's ip address, which is only visible on the LAN. I'd like to make this visible from the WAN.
Now, to complicate matters, it looks like I'm going to be building a couple dozen of these devices, and they will not all be on the same LAN. What I was thinking, is to have the device register itself with a program running on an external server with a common domain name (which I currently have access to). Once registered, a user could access an individual pi via a domain-name with a device key (the program on the server would map the device key to the particular device's ip)
There seems to be a lot of web-sites describing using a domain mapped directly to a particular device, but that would require a lot of domain names, and I'd rather have things more dynamic. I'm wondering if this is the right approach, and if it is, how would I go about redirecting a web page to something behind a LAN?

Finding device on network without its ip

We have developed a device that is connected to our clients network and we would like to be able to get its ip or set the ip without knowing its ip.
The device has a Linux OS.
We can save the device MAC Address before giving it to customers. We can program a service to broadcast the device IP and MAC Address to a certain IP or port/socket. We can listen to a certain port/socket for commands. Is this the right direction? Should we investigate in other network protocols other than TCP/IP?
We have seen this feature in hardware/device manufacturers provide a CD with a software that can locate their devices on a network even if they have been newly added to the network without network or ip configuration.
Best regards,
Hussam Kazah
Using propriety broadcasting protocol is a very common technique for detecting devices on network without knowing it's name.
However there's a better option:
UPNP, is an excellent protocol for achieving your goals.
libupnp can get you started in no time.
There's a standard protocol called DHCP which allows a network device to make a broadcast request for its IP address. This protocol is widely used by network appliances. On the other hand you may scan your local network for all connected devices using ARP (address resolution protocol) using for example arp-scan utility.

Connecting internet to Raspbery Pi board

I have successfully ported Linux kernel to Raspberry Pi board.
But now i need to have Internet connection into it.
And my internet connection is like, it needs a user name and password to login then only we can access Internet(wired internet through LAN or RJ 45 connector). And this interface for entering username and password comes in a browser.
But now in case of Raspberry pi , its just a kernel so , i do not have a browser in it.
So how to connect this internet connection in Board.
Thanks
The hardware solution is to use a home router that does the logging-in for you, and then acts as a gateway between your local LAN and the Internet. You would connect the Raspberry Pi to one of the router's LAN ports, and use either DHCP or static IPs on that local net.
A software solution might be using e.g. curl to implement some kind of login-script that fakes the accesses to the web page.
If you could connect it (temporarily) to an Internet connection that doesn't require a login/password, you could install a command line based browser. I would suggest looking into Lynx, if you choose to do it this way. http://en.wikipedia.org/wiki/Lynx_%28web_browser%29

Resources