Closed rapasal closed 6 years ago
@rapasal
You do not need to use writeMQTTString
function.
In ConnectEsp8266WiFiClient example you can find the connect paramaters structure: MQTTPacket_connectData options
.
It contains username
and password
fields:
MQTTString
usernameMQTTString
passwordThe MQTTString
type could be initialized just with symple c-string like I did for options.clientID
:
options.clientID.cstring = (char*)MQTT_ID;
so the following should work (please adjust to the types of user
and pass
):
options.username.cstring = (char*) user;
options.password.cstring = (char*) pass;
I thought there'd be a cleaner way of doing it. Working great now! Thanks.
I cannot for the life of me see where to enter a username and key for a broker. I've tried adding the following in amongst the other options that are set in the examples:
This compiles, but I still cannot get anything in or out of the broker. I am assuming this is to do with my credentials. Error output as below:
This is running on an ESP Huzzah with a WiFiClient. Can anyone point me in the right direction?