Cooee
Posts: 4
Joined: Sat Jun 15, 2019 1:13 pm

Wifi - Inbound connectivity issue

Sat Jun 15, 2019 1:41 pm

Hi. I'm trying to help my girlfriends dad set up a RPi3B running MotionEyeOS to watch his outdoor fish tanks. This will probably be more of a general networking question rather than something RPi or MotionEyeOS specific.

The wireless connected RPi stops responding to inbound connection attempts (ssh / http / ping) after a period of time. The strange part is that it starts working again if I open the shell on the RPi and ping the remote host first.

For example, if the remote host is "A" and the RPi is "B" then "ping B" from A will fail. If I "ping A" from "B" first it will work (although there will be a couple lost packets to begin with). Following that "ping B" from A will be successful for a while after. Pinging the router was not sufficient. It had to be the host that I was trying to communicate with (my phone / laptop / or both).

Strangely each host has this issue. If I introduce a "C" node, it won't work until I do the same thing as above, even if A<-->B are already working.

The modem / router is in another house, connected via a wired ethernet connection to this house into a wireless access point, and finally to the RPi. There is only one subnet that all the hosts are on.

I can't change the network setup too much because 1) the router admin pages are all in Japanese and I can't read them. 2) If things break, I won't be here to fix them.

I guess I'm hoping someone might have an idea about what might be going wrong since I'm pretty well stumped. It is like the wireless connection is going to sleep, but I don't think that is the case. My best bet is that it is something to do with the main router (arp cache or something)?

Cheers!

pcmanbob
Posts: 6209
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Wifi - Inbound connectivity issue

Sat Jun 15, 2019 3:25 pm

Hi.

Sounds like your wifi access point is dropping the connection to the pi , probably due to no traffic from the pi, many routers/access points do this if a device is not using the wifi connection then the device is is dropped or disconnected to reduce the devices on the wifi to improve speed for device that are using the wifi.

if you were just using normal raspbian I would suggest you set up a cron job to ping the router every few minutes to keep the connection active, but I don't know if you can do this with MotionEyeOS.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

Cooee
Posts: 4
Joined: Sat Jun 15, 2019 1:13 pm

Re: Wifi - Inbound connectivity issue

Sun Jun 16, 2019 12:49 am

pcmanbob wrote:
Sat Jun 15, 2019 3:25 pm
Sounds like your wifi access point is dropping the connection to the pi
Thanks for the reply. I'm not sure that can be the case though, as A<>B might be working while A<>C is failing at the same time. Also, pinging the router does not resolve the issue. I need the ping from the pi the host that I want accept incoming traffic from.

I'm starting to think that ARP requests might not be traversing the wifi access point, but when the pi initiates the connection the ARP data must be getting through. I don't really know enough about ARP to know if that is possible.

epoch1970
Posts: 3028
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Wifi - Inbound connectivity issue

Sun Jun 16, 2019 10:20 am

Cooee wrote:
Sun Jun 16, 2019 12:49 am
Also, pinging the router does not resolve the issue. I need the ping from the pi the host that I want accept incoming traffic from.
I do not know how "motioneyes OS" works.

It looks to me like client isolation in the AP. Or a misconfigured firewall on the Pi that would drop pings and "unsollicited trafic" in general.

If you add a permanent (=manual) ARP entry in the Pi pointing to the MAC and IP of the desktop machine, can you start pinging from the Desktop machine at any time?
If not can you in addition ping the router from the Pi every minute, and try again?

If neither peppering the host's ARP table nor forcibly keeping the wifi link active do work, then I would start looking for a firewall somewhere along the path.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

Cooee
Posts: 4
Joined: Sat Jun 15, 2019 1:13 pm

Re: Wifi - Inbound connectivity issue

Sun Jun 16, 2019 5:29 pm

It looks like this might be an issue with MotionEyeOs not playing well with unusual network configurations. I've installed Raspbian onto the SD card and so far it seems to be working well.

The issue MotionEyeOs seemed to be having, in case any one ends up here via Google or something in the future, was that it was selective around when it would reply to ARP requests. There were certain hosts that it just seemed to ignore and never send an ARP reply to. I'm not sure whether it was only replying to a certain category of hosts (ie. on the wired network, hosts on the same AP, etc.). If I get more time before I go home, I'll see if I can troubleshoot it further.

epoch1970
Posts: 3028
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Wifi - Inbound connectivity issue

Sun Jun 16, 2019 8:47 pm

I looked at the MotionEyesOS repo on github, but it is almost the whole buildroot tree with some additions here and there so it's not too easy to see what's going on just by navigating directories.
I have noticed the OS seems to enable bluetooth, not a positive for wifi reliability, but wifi+BT normally should work.
I failed to find the /etc/sysctl.conf or iptables rules files I expected to see, so I am not too sure MotionEyesOS is to blame.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

Cooee
Posts: 4
Joined: Sat Jun 15, 2019 1:13 pm

Re: Wifi - Inbound connectivity issue

Mon Jun 17, 2019 7:54 am

This is what I'm seeing in Wireshark, where the ARP requests are going unanswered. I should also have mentioned earlier that I had 2x Pi's, connected to different Wireless AP's, both running MotionEyeOS, and both have the same problem. The one that I have recently starting running Raspbian on seems to be running flawlessly so far.

I might create a post on the MotionEyeOS forum, because this issue looks like it might be related to that OS. Unfortunately I leave the country in 3 days, and I'm doing lots of tourist stuff so I don't have much time to really spend with it :(
Attachments
Wireshark.png
Wireshark.png (42.32 KiB) Viewed 229 times

Duke1990
Posts: 1
Joined: Tue Jun 18, 2019 7:36 pm

Re: Wifi - Inbound connectivity issue

Tue Jun 18, 2019 7:39 pm

Search for a problem in your network. This website shows a very good info about all the routers: internetwifi.online You should check it.

Return to “Troubleshooting”