Report comment

Hi, thank you providing detail explanation. I am facing an issue where ip address assigned to wlan0 gets auto removed after about 2 hours. I'm using commands mentioned in createAdHocNetwork function to assign ip address to wlan0 interface. For about 2 hours it seems to be working fine and then suddenly wlan0 looses ip address.

Log shown below shows that it looses ip, but it does not mention why it looses it.

Feb 16 14:29:59 raspberrypi dnsmasq-dhcp[18852]: DHCP packet received on wlan0 which has no address
Feb 16 14:30:05 raspberrypi dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 19
Feb 16 14:30:07 raspberrypi dnsmasq-dhcp[18852]: DHCP packet received on wlan0 which has no address
Feb 16 14:30:08 raspberrypi hostapd: wlan0: STA d1:11:f2:2c:77:a3 IEEE 802.11: disassociated
Feb 16 14:30:08 raspberrypi kernel: [94722.027977] brcmfmac: brcmf_cfg80211_stop_ap: setting INFRA mode failed -52
Feb 16 14:30:08 raspberrypi kernel: [94722.062038] brcmfmac: brcmf_add_if: ERROR: netdev:wlan0 already exists
Feb 16 14:30:08 raspberrypi kernel: [94722.062055] brcmfmac: brcmf_add_if: ignore IF event
Feb 16 14:30:08 raspberrypi avahi-daemon[468]: Interface wlan0.IPv6 no longer relevant for mDNS.
Feb 16 14:30:08 raspberrypi avahi-daemon[468]: Leaving mDNS multicast group on interface wlan0.IPv6 with address ff40::aa16:cdee:fccc:fe5d.
Feb 16 14:30:08 raspberrypi avahi-daemon[468]: Withdrawing address record for ff40::aa16:cdee:fccc:fe5d on wlan0.
Feb 16 14:30:08 raspberrypi dhclient: receive_packet failed on wlan0: Network is down
Feb 16 14:30:08 raspberrypi dhclient: receive_packet failed on wlan0: Network is down
Feb 16 14:30:08 raspberrypi dhclient: receive_packet failed on wlan0: Network is down
Feb 16 14:30:08 raspberrypi hostapd: wlan0: STA 00:00:00:00:00:00 IEEE 802.11: disassociated
Feb 16 14:30:08 raspberrypi systemd[1]: Stopping LSB: Advanced IEEE 802.11 management daemon...
Feb 16 14:30:08 raspberrypi hostapd[24204]: Stopping advanced IEEE 802.11 management: hostapd.
Feb 16 14:30:08 raspberrypi systemd[1]: Stopped LSB: Advanced IEEE 802.11 management daemon.
Feb 16 14:30:08 raspberrypi systemd[1]: Stopping Host and Network Name Lookups.
Feb 16 14:30:08 raspberrypi systemd[1]: Stopped target Host and Network Name Lookups.
Feb 16 14:30:08 raspberrypi systemd[1]: Stopping dnsmasq - A lightweight DHCP and caching DNS server...
Feb 16 14:30:08 raspberrypi dnsmasq[18852]: exiting on receipt of SIGTERM
Feb 16 14:30:08 raspberrypi systemd[1]: Stopped dnsmasq - A lightweight DHCP and caching DNS server.
Feb 16 14:30:09 raspberrypi kernel: [94722.959023] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready

I was wondering if you have faced similar issue or would know how to go about debugging this issue.

Thanks