0

Problems with MDNSResponder in WiFi101
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Problems with MDNSResponder in WiFi101

by gberman on Thu Feb 13, 2020 12:26 am

I just purchased the WiFi 101 shield for use with an Arduino Mega. I can successfully connect to my network and use the Arduino as simple web server. However, the WiFiMDNSResponder does not seem to operate. If I load the MDNS_WiFiWebServer example included with the latest WiFi 101 Library it successfully connects to my network and responds to HTTP calls if I enter the IP address into my Safari browser, but it does not respond if I try to access by entering wifi101.local into the browser (which is the MDNS name specified in the example program). I have another Arduino Mega running a different web server program using an Ethernet Shield and the standard Arduino_MDNS library. This works fine (has worked for many months without a problem), which implies that Bonjour is properly working on my Mac, my router is not somehow blocking MDNS/UDP requests, etc. I am using the latest 1.8.11 Arduino IDE and the latest WiFi 101 library. My goal is to be able to replace my current hardwired web server (using an Ethernet Shield) with a wifi-enabled server - the MDNS functionality is not an absolute requirement but it is really convenient for the upstream applications that currently call my web server.

I did check the firmware using the example code and I appear to be running version 19.5.2. According the Adafruit web site for this shield I do not need to bother updating to 19.5.4. However, there appears to be an even newer version now available: 19.6.1. Just in case the problem with the MDNSResponder was related to the firmware version I thought I'd try to update to 19.6.1. However, this does not appear to be possible - if I select any of the Model B firmware updates, and hit "Test Connection" in the Firmware Updater I receive a "Programmer not responding" error. Same if I select firmware versions 19.5.4 or 19.5.2, which is ironic since the shield does appear to have 19.5.2 already loaded. The only time I receive a "Programmer Working" message is if I select the latest Model A firmware, which is 19.4.4. The WiFi chip on the shield is an ATWINC1500-MR210PB, which should be a Model B.

The problem I am having with the firmware update likely has nothing to do with MDNSResponder problem, but I wanted to mention just for completeness. Any advice would be greatly appreciated.

gberman
 
Posts: 2
Joined: Tue Feb 11, 2020 8:23 am

Re: Problems with MDNSResponder in WiFi101

by gberman on Thu Feb 13, 2020 9:25 pm

UPDATE: though I was not able to solve my MDNS issue, I was able to debug the problem preventing me from updating the firmware. First, I verified that the latest firmware from Atmel for this chip is indeed 19.6.1. A review of the java source code on GitHub for the WiFiUpdaterPlugIn revealed that the list of allowable firmware binaries is embedded in the java code as part of the same code that also sets the baud rate for the serial port. The WiFiUpdaterPlugin uses a baud rate of 1000000 for the MKR1000 boards and a baud rate of 115200 for the Mega. The firmware updater sketch also uses a baud of 115200. If you select firmware version 19.4.4 the Updater matches its baud rate to 115200, so the update works. If you select version 19.5.2, 19.5.4, or 19.6.1, the updater assumes (requires) you are using a MKR1000 and therefore sets the baud rate it will use to connect to the sketch to 1000000, which does not match the updater sketch - hence the updater can't connect to the board.

My first attempt to fix was simply to change the updater sketch to use a baud rate of 1000000. This almost worked - the updater plug-in was now able to communicate with the Mega, and it started to upload the new firmware. But it repeatedly failed on verification when reading back the firmware it tried to load. I guess this might be do the fact that the Mega can't reliably output that much data at such a high baud rate, and the read-back was failing. But who knows.

I changed the baud rate back to 115200 in the updater sketch and re-uploaded the 19.4.4 firmware, which worked fine, so I did not brick my board. But then realized that the updater itself does not actually no anything about the firmware files - they are just binary files the updater uploads and copies into the flash memory of the wifi chip via the Mega serial port. Solution: Copy the firmware binary stored under the 19.6.1 folder into the 19.4.4 folder and rename to match the 19.4.4 binary. Then use the updater to reload the "19.4.4" binary, which really is the 19.6.1 binary. Worked the first time. If I run the firmware-version-checking sketch it verifies that the firmware is indeed 19.6.1.

My web server program still works, which means the new firmware didn't break anything. But....this did not solve my MDNS problem, which made this this an interesting, but ultimately futile exercise.

gberman
 
Posts: 2
Joined: Tue Feb 11, 2020 8:23 am

Please be positive and constructive with your questions and comments.