I have a network made of Rpi, ubiquities, and esp8266. Raspberry pi is configured as the eth0 to eth1 router. Eth1 is made using a USB to ethernet converter. The Main ubiquiti is connected to the eth1 using the ethernet cable and the same generate a hotspot "RpiAP". All the esp8266 is connected to the Hotspot RpiAP. We have one main ubiquity ac pro which is connected directly to the Raspberry Pi eth1 and the second ubiquity AC lite which is connected to the main ubiquity wirelessly.

The raspberry pi runs a DHCP server using dnsmasq software and it is configured as follows.



# Bind to the interface to make sure we aren't sending things

# elsewhere


server= # Forward DNS requests to Google DNS

domain-needed # Don't forward short names

# Never forward addresses in the non-routed address spaces.


# Assign IP addresses between and with a

# 12 hours lease time


The esp8266 will send some sensor data to the RPI and will sleep for 12 hours. But the 12 hours were implemented using 24 loops of 30 minutes of sleep. After every 30minute sleep, there will be 4 esp restart with 6sec gap and it will connect to the RpiAP automatically and then again go to 30minute sleep. The sleep is given by the atmega328p using AT+GSLP=1800000 and the atmega will sleep after the command, the esp will wake up the atmega when he wakes after 30minute. So we can see all DHCP messages on the Raspberry Pi's Syslog for each esp restart. The 4 dhcp messages will be DHCPDISCOVER, DHCPOFFER,DHCPREQUEST,DHCPACK for a single restart.

After a long run of 6 months, some ESPs show some problems.

  1. Esp restart logs(DHCP logs) were missing. example: Instead of 4 restarts, only 1 restart is logged
  3. In some cases, the esp is get connected to RpiAP and it is not sleeping. We verified this by the DHCP logs. The DHCP logs were showing only DHCPREQUEST,DHCPACK with 6 hr gap.

What factors can be related to this problem. After some debugging, I found the following factors

  1. Wifi Interference
  2. Issue in the atmega code.
  3. Bad configuration in Rpi and ubiquity.
  4. Battery power(230mA, 3.7v, Xeno XL-205F)

Is there any one has such issues? Can you share any information that can help me to solve the issue.


1 Answer 1


Interesting problem. I have the same setup as you: RPi-4 4 gig, dongle Ethernet, dnsmasq serving up IPv4 (and IPv6) addresses from comcast.com ISP. I don't have a esp8266 on my network. My OS is Raspian-buster.

My biggest difference is that I jam a MTU of 1412 on my local network hosts. See man pppoe [enter link description here][1]

[1]: https://linux.die.net/man/8/pppoe . Search for 1412 in the man page for problems with MTU's larger than 1412. My current provider doesn't use pppoe but I don't have network stalls because of packet resend when a connection is established.

I have noticed that a RPi-4 (2 Gig) has a problem setting the MTU to 1412 because the MTU is left at the default of 1500. This is a bug as the IP number apparatus is not re-assigning the MTU (to 1412) even for IPv6. This bug sounds to me like a lazy ARM re-code of the DHCP implementation.

I'm running 2 Ubiquiti access points. All wifi connections use the dnsmasq as DHCP to assign IP number and maximum time to live of 150 seconds which is set by writing into the dnsmasq.d directory and which are re-read during dnsmasq restart.

I use '/sbin/dhcpcd -6 -U eth0' to get the IPv6 (and IPv4) values for my ISP connection and parse the output stream to get dns and the IPv6 /64 base address. The secret is the -U which took me 4 months to find!!

I don't put any devices to sleep and renew IP addresses after 150 seconds. This is different than your setup. I'm using ra-name (router advertisement), and my variable IP assign range is 50-250 with a 12h life. I set 5 machines with a permanent IPv4 address.

My current RPi-4 router has an uptime of 84 days.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.