We have a touchscreen app (running on Chromium) on our RPi-based ROS robot where the user can change WiFi network or switch to access point mode. ROS_HOSTNAME is set to $(hostname).local, which is translated to the current IP address of the robot. The problem is that when the network is changed, the IP address of the robot changes. This causes the touchscreen node to lose connection with some other nodes. It seems like some nodes get the new IP address (from the new hotspot) and some retain the old IP address. The current solution is to restart the whole ROS software, but this is not ideal. Is there a way of telling all nodes to use the new IP address? Or is there some other way around this problem?
Related
I've an issue connecting with my raspberry from a specific computer on home network.
Raspberry is connected on WiFi and my computer is connected on LAN.
The issue occurs only on the actual raspberry IP that is a static IP (192.168.1.3. This is correctly reached from every other device in the home network.
If I change the IP assigned to raspi it becomes reachable from my computer but I don't know why.
I've tried deleting DNS cache from the computer and checking Firewall rules but nothing found. I've also checked raspi to see if there are rules blocking the connection but nothing found here too.
Could you please help me understanding why this is happening? I would like to keep the actual IP assigned to the raspi.
Thank you
I am working on an embedded software product that runs on an Ubuntu edge computer with multiple network ports.
The software allows the user to change the IP address of the ports via a locally hosted web interface.
In the scenario that a customer changed an IP on one of our devices, but then forgets their setting I am looking for an easy strategy to walk them through detecting the IP.
Ideally this tool would be usable by non-sophisticated customers (we don’t want to walk them through using Wireshark or command line tools).
Is there a service we can setup on our machine that will broadcast its identity across subnets using another protocol like UDP or EtherNet/IP? Then a simple tool the client could install on their computer to ‘scan’ for our devices?
The edge computers also have USB ports if it is easier to broadcast an identify there.
Changing a local IP address to something invalid (=not compatible with its local subnet) generally disables all L3 communication. Limited broadcasts (to 255.255.255.255) still work, but answering to them by unicast most likely won't. The same goes for multicasting - but you could use that for discovery both ways.
Also, the common link-level discovery protocols (like LLDP or CDP) still work since they don't rely on IP.
However, all that is limited to the connected L2 segment at most. Discovery across subnets isn't possible without some kind of infrastructure (discovery sensors, central server, multicast routing, ...). A reasonable way would be dynamic DNS but then again, that requires IP to work.
I think you'd need to take a step back and reevaluate your design. One way would be to verify a user's reconfiguration before it becomes permanent. For instance, you could have a user change the IP setup and then forward the session to the new IP address. If the session isn't continued within five minutes or so on the new address, it reverses to the previous config.
Additionally, some kind of out-of-band management could be useful.
I have Wireguard installed on a Raspberry Pi 4 via PiVPN. The pi is plugged directly into my network switch.
I went through the setup and assigned the pi a static IP (10.0.0.157), generated a config and tried to login from my laptop (laptop was on a personal hotspot for testing purposes).
Wireguard connected using the profile and said it was sending traffic, but I was not able to load anything or ping any of the devices on my internal network.
I also noticed that my laptop was being assigned an IP of 10.0.6.1, which doesn't make sense because my network is in the IP range of 10.0.0.0/24
Any idea why this is happening or how to fix it?
I was able to fix this by changing the AllowedIPs value in the config and ensuring that I was forwarding the proper port.
I have ros node which is continuously polling on some packets and it accepts them only from specific ip, now I want to send some packets so that node will receive it.
How do I create dummy h/w which will have that specific ip address and my ros node will capture data from that?
If you can set an IP in your node then you don't need DUMMY H/W.
You can use your own local IP (127.0.0.1 AKA localhost) and custom port (if your code accepts it).
I am not expert on this subject, need your suggestions. I have a few devices on ethernet/LAN. I wanted to have these devices communicate over LAN without going into their network configurations. Below is my plan, please let me know if this can be achievable:
1) I install TCP/IP stack on these devices
2) I give them their hostnames like device1, device 2 etc....
3) I configure these devices for local-link networking, so that they can configure themselves and get their IPs.
4) I use socket programming and access each device by using hostnames.
Please let me know if this can be done without much hassle, and let me know if I have missed out something in above mentioned points.
Thanks in advance.
This is basically a good approach.
If your embedded devices have a good IPv6 stack, I recommend using it instead of IPv4. link local addresses work better with IPv6. Most IPv4 stacks are configured to try to obtain an address from a DHCP server first, and only fall back to link local addresses if they can't get one. The link local address and DHCP address might be mutually exclusive, so the link local address doesn't become operational until after DHCP has been tried and timed out. The link local address might even be disrupted if DHCP periodically retries. Although the devices will normally be connected to each other and there won't be a DHCP server, you don't want to disable DHCP, because the devices probably should obtain a DHCP address if they are ever connected to a wider network. With IPv6 on the other hand, the link local addresses come up immediately when the interface comes up, and stay up continuously while other IP addresses (from autoconf or from DHCPv6) may come and go.
Link local addresses alone won't let the devices contact each other by hostname, but dns-sd (mDNS, zeroconf) will. If you are using Linux then you can use avahi as a dns-sd stack.
Better than using hostnames, consider having the devices probe for each other by dns-sd service type. If you are using a custom protocol between your devices, make up a unique service tpe name and have the devices advertise themselves it and probe for it with dns-sd.