Hardware : bcm9wcd5eval1_3
SDK : started with 3.3.1 and then aded 3.4.0-aws
Followed AWS_IOT getting started guide to create a sample thing and test topic.
Using the command line on my Mac, I am able to subscribe to and publish messages.
On the bcm9wcd5eval1_3 board I am able to connect to my mqtt broker, but I am unable to send messages.
I don't get any obvious errors, but I don't see anything either on my AWSIOTLogs in CloudWatch, or in the subscriber terminal
I am using the demo.aws_iot.pub_sub.publisher as my code base.
I have copied rootCa.pem, cert.perm and private_key.pm to resources/app/secure_mqtt
and made the following changes described in the publisher.c file :
#define MQTT_BROKER_ADDRESS "A23UXEXXOFKGVR.iot.us-east-1.amazonaws.com"
#define WICED_TOPIC "topic/test"
#define CLIENT_ID "clientid1"
conninfo.port_number = 8883; <-- I tried with default value of 0 as always, but got the same behavior
Using aws cli on Mac:
terminal 1 : subscriber
$ mosquitto_sub --cafile ./rootCA.pem --cert ./cert.pem --key privateKey.pem -h A23UXEXXOFKGVR.iot.us-east-1.amazonaws.com -p 8883 -q 1 -d -t "topic/test" -i "clientid1"
Client clientid1 sending CONNECT
Client clientid1 received CONNACK
Client clientid1 sending SUBSCRIBE (Mid: 1, Topic: topic/test, QoS: 1)
Client clientid1 received SUBACK
Subscribed (mid: 1): 1
terminal 2 : publisher
$ mosquitto_pub --cafile rootCA.pem --cert cert.pem --key privateKey.pem -h A23UXEXXOFKGVR.iot.us-east-1.amazonaws.com -p 8883 -t topic/test -i clientid1 -m "Hello, Dalvi"
terminal 1 : subscriber sees published message
Client clientid1 received PUBLISH (d0, q0, r0, m0, 'topic/test', ... (12 bytes))
Logs from CoolTerm
Starting WICED v3.4.0-AWS
Platform BCM943341WCD1 initialised
Started ThreadX v5.6
Initialising NetX_Duo v5.7_sp2
Creating Packet pools
WWD SDIO interface initialised
WLAN MAC Address : 6C:AD:F8:F0:EC:43
WLAN Firmware : wl0: Oct 13 2014 15:25:13 version 220.127.116.11 (r507746) FWID 01-60cadeb3
Joining : mySSID
Successfully joined : mySSID
Obtaining IPv4 address via DHCP
DHCP CLIENT hostname WICED IP
IPv4 network ready IP: 10.xx.xx.xx
Setting IPv6 link-local address
IPv6 network ready IP: FE80:0000:0000:0000:6EAD:F8FF:FEF0:EC43
Resolving IP address of MQTT broker
[MQTT] Connecting to broker 18.104.22.168 ...
[MQTT] Opening connection...Success
No errors while publishing the message, but on terminal 1 I don't see the message being received.
Also I don't see any logs should up on AWS CloudWatch Logs