3 years ago.

How to implement MQTT with Nucleo F401RE and Sim900?


I'm trying to implement MQTT on Nucleo F401RE with Sim900, I've tried the following example:


But I get the following error:

Error: Name followed by "::" must be a class or namespace name in "GPRSInterface/GPRS/modem/modem.cpp", Line: 79, Col: 10

Can someone please assist me to resolve this issue? Or provide some advice for the implementation of MQTT with GPRS?

Thank you very much.

1 Answer

3 years ago.

Hello there,

The error you are getting is because the compiler is unable to locate the declaration of “BufferedSerial” when referencing the following line:

r = BufferedSerial::write(buffer, r);

If you take a look at the header file “modem.h”, the directives located at the top of the file:

#if defined(TARGET_LPC11UXX) || defined (TARGET_LPC176X)
#include "BufferedSerial.h"

They include a conditional on whether to include the BufferedSerial.h header file if you are either using LPC11UXX or LPC176X as your target board. It seems that since you are using Nucleo F401RE, the conditional is not including the necessary BufferedSerial.h file.

I was able to successfully compile the code when using LPC1768 and LPC11U24 as targets. I hope this answers your question!

-Karen, team Mbed

Accepted Answer

Thank you very much for this answer.

posted by Koos van der Wat 19 Jun 2018