[BUG] Preprocessor sequence prevents plain text connections
Author: RichardBarryCreated Mar 27, 2023Updated Jul 4, 2026
Labelsbug
Describe the bug I can't connect to port 1883 of test.mosquitto.org with a username and password set, but this code sequence prevents me from omitting the username.
Using the demo documented on this page: https://freertos.org/mqtt-agent/mqtt-agent-demo.html#building
Target
- Development board: Windows simulator
- Instruction Set Architecture:
- IDE and version: Visual Studio
- Toolchain and version:
Host
- Host OS: Windows
- Version:
To Reproduce
- Configure the project to connect to port 1883 of test.mosquitto.org, then run the project. The connection is refused as "unauthorised".
Expected behavior The connection to be accepted as it is plain text and unauthenticated.
Screenshots If applicable, add screenshots to help explain your problem.
Additional context The workaround is to comment out democonfigUSE_AWS_IOT_CORE_BROKER in demo_config.h - so it isn't defined at all. Setting it to 0 is not good enough.
Source: FreeRTOS/FreeRTOS