Problems with DHCP from Mikrotik Device with WiFi WheatherStation

Hi there, I am searching for days now how to solve my Problem. Without success, Maybe someone has an idea :slight_smile:

Central Router is a CRS125 with RouterOS 6.49.6 and there are several cAPs connected with CapsMan (all v 6.49.6).
I used to have a Windows Server 2016 in the last years as Domain Controller, fileserver and DHCP/DNS-Server.
For some reasons I decided to shutdown permanently the Windows Server.
DNS and DHCP moved to the MikroTik Router. All configured, all working well.

But since I shut down the Windows Server, my WiFi Weather Station reports WiFi problems. There are massive packet losses in the connection.
I’ve checked it by pinging the weatherstation from PC and from the Winbox. In this state, the Weatherstation cannot submit its data to a local WeeWX instance because of the bad connection
I thought it is maybe a WiFi Problem with my Cap Configuration or so, but it isn’t.
When I stop the DHCP Server on the MikroTik device reactivate my Windows Server, the WiFi Weatherstation works 100 well all the time.
No packet losses, no WiFi Problems, nothing. All ok.
I turn off again Windows Server and activate DHCP on the MikroTik device, the problem comes back again.

When the WeatherStation boots, it connects to the cAP and all is working OK for some minutes. After about 4-5 minutes, the Problem begins again. Packet losses over and over.
Sometimes, without doing anything, it works again for 1-2 minutes, before breaking again.

This is very awful. I’ve checked with “DHCP Explorer” what Informations are sent through Windows Server DHCP and MikroTik DHCP:

DHCP Windows Server:
DHCP-Server-WinServer2016.PNG
DHCP MikroTik DHCP Server
DHCP-Server-MikroTik.PNG
I only see differences for DHCP renewal time and rebind time. It isn’t mentioned with MikroTik DHCP. Could this be a Problem?
What is the difference of MikroTik an Windows DHCP that can cause sucha Problem.

By the way, the weatherstation cannot work with manual IP configuration. It only uses DHCP.
And this is the WeatherStation: DNT WeatherScreen Pro

Anyone has any ideas? Thanks in advance.

Are you sure this is the problem?

After a full backup, paste this on terminal:

/ip dhcp-server
set [find] lease-time=1d
/ip dhcp-server option
add code=58 name=Renewal-Time value=0x0000A8C0
add code=59 name=Rebinding-Time value=0x00012750
/ip dhcp-server network
set [find] dhcp-option=Renewal-Time,Rebinding-Time

Another issue I have encountered with multiple home automation products was their sensitivity to DNS response contents. Mikrotik filters out some unsolicited items from the responses, and converts fqdns into lowercase. So try to exclude Mikrotik itself from the list of DNS servers sent to the client via DHCP.

I do realize the weatherstation doesn’t respond to ping which should be unrelated to DNS stuff, however on those power consumption optimized devices the network stacks may behave unusually.

Uhhhhhhhhhhhhhhhhhh… :open_mouth:

For the record, case conversion in DNS responses was fixed in v7 (I’m not saying you should rush to upgrade, as it’s probably not it anyway).

Hi and thanks, i guess you’re a MikroTik god :slight_smile:
I’ve added the DHCP Options as you told me to, rebootet the weatherstation and since then it runs perfectly. Now 1/2 hour without any problems.
I will watch again after 1 day (new lease time) and see whats happen. I hope it keeps stable.

I don’t know why this weather station has this issue, all other clients are working fine with the standard DHCP Server on MikroTik.
But when I saw that it always happens after some minutes after it connects, I had the suspicion it had something to do with the missing DHCP options (rebind, renewal).
DHCP was the only change in the network in this time.

So thanks again. I will post again after 1 or 2 days about the status.

Is the same fix I haved used on the past for fix playstation network problems for some users…
And now is a default config for all my CPEs…

Hi, I have bad news. The problem occured again after 12 hours and 5 minutes after I set the Options.
Thats when the “renewal time” is reached. DHCP Renewal time is set to 12 Hours. I think it has something to do with that.

Any more Ideas?

Yes, assign a static lease (convert dynamic by simply clicking on the button) and set the lease time to 100 years.
I don’t think you will come back to this forum in 100 years to complain, I bet on this …

and set the lease time to 100 years.

:laughing:
Really ?

To me, if it was a lease renewal problem it would occur in exactly 12 hours and not in 12 hours and 5 minutes…
But yes, assigning a static lease might be a solution …

Hi again,

static IP is not enough. I already worked with static IP via MikroTik (weather device doesn’t support native static IP). Then I switched to dynamic IP and it happened also.
OK, then I will have to increase the renewal period. That’s not perfect but will work I think.

Thanks again for all hints.

I say “assign a static lease (convert dynamic by simply clicking on the button)” etc.
not increase dhcp lease time on dhcp-server settings… :wink:

Static IP (as in “manually configured”) is not the same as static lease (a reservation of IP address to be assigned via DHCP to a given client-id). What @rextended suggests is the latter - for a static lease, you can specify also other parameters, like the lease time, individually, differently from the common defaults. In fact you can even specify the address as a pool, so the address itself will remain dynamic, but the lease time of 100 years will only be used for lease to the weatherstation.

I remember reading that tidbit but thought it was for some isolated functionality, is this the case for all DNS now…

@anav: It’s OT here, I only added extra info because it was mentioned, in case someone finds it later. The problem was that ROSv6 ignored case used by client in query and returned lowercase hostname in response, while most or all other DNS servers kept the case. And some clients started to rely on what other servers did. So ROSv7 now does the same as others. In short, don’t worry about it, everything is fine.

Thanks, I misunderstood. I never tried static lease times. I now have set in the configuration for this device a fixes lease time of 365 days, this should ne enough.
Only by rising the renewal time didn’t work. The lease time doesn’t went up, it was still by 12 hours.
But the 365 days now work. Hope it stays ok :slight_smile: