Hi,
I am using an Arduino Mega2560, and WiFi shield as an MQTT client, communicating with Mosquitto on a Linux box. I can send large amounts of data from Mosquitto to the Arduino, and all is OK.
Like many people, when I try to send more than 90 bytes from the Arduino, it fails.
I've installed Atmel studio, and downloaded the WiFi firmware (The 32U4 portion) from GitHub, and I can see the SPI polling code, which indeed uses a 100 byte receive buffer. The code is very close to the wire in terms of space on the 32U4, which is why, I would say, the developer(s) limited the buffer to 100 bytes.
I re-compiled the firmware under Atmel Studio 6, and produced a new .elf file, but when I flashed this to the WiFi shield, it wouldn't connect to the Mosquitto broker, (WiFi connection was OK), so I'm guessing that the source code on GitHub is out of sync with the latest firmware being shipped with Arduino 1.5.5.
So, I decided to alter the WiFiClient code to impose a 50 byte MTU limit for the SPI transmission from my Arduino Mega to the Shield. This works, up to a point. I successfully transmittefd 200 bytes just fine.
However, last thing last night I tried to send a 500 byte message from a file, and crashed the shield. I'm guessing another buffer over-run. More tonight.
Some questions, for anyone who is working in this area;
- Has anyone else overcome this issue?
- Does anyone know where I can get the latest source code for the 32U4 firmware?
My next step is to try the CC3000 shield. Unfortunately, a quick look seems to indicate that the software library for this shield does not inherit from Client, so I will have to write a wrapper class for it in order to use it with the Arduino MQTT Client, which expects a Client.
Is anyone else still working on this?
Cheers,
Con