2020-08-25 01:23 AM
Hi together,
I'm using the NUCLEO-F401RE and NUCLEO-IDW04A1 trying to connect and publish to a MQTT Broker. Therefore i've edited the example HTTP_Request. Connecting to my WiFi-AP is working fine, but connecting to the Broker does not work. This is what my console output looks like after connecting to the WiFi-AP:
wifi connected...
>>connected...
AT+S.STS=ip_ipaddr
AT-S.Var:ip_ipaddr=192.168.178.122
AT-S.OK
>>IP address is 192.168.178.122
AT+S.GCFG=nv_model
AT-S.Var:nv_model=SPWF04SA
AT-S.OK
>>model no is SPWF04SA
AT+S.MQTTCONN=mqtt.eclipse.org,1883,,,,,,,,,,
AT-S.ERROR:111:Request failed
+WIND:87:MQTT Closed:0:0
This is how I'm trying to connect the Broker:
char console_host[20];
char * hostname = "mqtt.eclipse.org";
uint32_t port_num = 1883;
memcpy(console_host, (const char*)hostname, strlen((char*)hostname));
wifi_mqtt_connect((uint8_t *)console_host, port_num);
Does anyone of you have an idea what I'm doing wrong?
Thanks for your help!
Fabian