WICED WIFI UART - MQTT

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi All,

I am currently working on BCM9WCD1EVAL1 board which has BCM943362WCD4 chip

my task is to take data on BCM9WCD1EVAL1 from other MC board through UART and put it to MQTT i.e publish whatever packet i receive on uart

i used inbuilt MQTT code separately it is working fine and also used UART inbuilt code it working but i am Little confused in UART communication problems i am facing given below:-

PS: when i connect BCM9WCD1EVAL1 to my PC i get COM28

1.what is the purpose of this line in uart.mk file "GLOBAL_DEFINES := WICED_DISABLE_STDIO"

2.if i club two in built codes uart.c and mqtt.c i can not able to see debug messages of mqtt.c on COM28

   i have to remove/comment "GLOBAL_DEFINES := WICED_DISABLE_STDIO"

   once i remove/comment messages came but uart functionality not working

   mqtt.c uses "WPRINT_APP_INFO"

   what may be the issue ?

3.what API should be used to receive from UART and take into buffer and whole string send it to mqtt plublish mssg

4.can you explain the functionalities of below:-

"wiced_uart_receive_bytes( STDIO_UART, &c, &expected_data_size, WICED_NEVER_TIMEOUT )"

wiced_uart_transmit_bytes( STDIO_UART, TEST_STR, sizeof( TEST_STR ) - 1 )

5.which GPIO Header pins of  BCM9WCD1EVAL1 are for UART and which api we should use to print the debug messages?

6.how to use UART interrupts?

7.can in mqtt.c by just putting IP address of Ubuntu instance which running on amazon cloud will work? Ubuntu instance also running mqtt broker at aws

0 Likes
7 Replies
Anonymous
Not applicable

Hi All,

Why any of the above question not got answered?

did i am doing wrong way or what i mention is not that informative?

please let me know i will improve question

thanks,

0 Likes

what is the purpose of this line in uart.mk file "GLOBAL_DEFINES := WICED_DISABLE_STDIO"

By default all applications uses the uart signals for transmitting data, for the UART snip application you are using, we are routing the UART Tx and Rx pins as a loopback in order to echo whatever is typed on console to be echo'd back.

2.if i club two in built codes uart.c and mqtt.c i can not able to see debug messages of mqtt.c on COM28

   i have to remove/comment "GLOBAL_DEFINES := WICED_DISABLE_STDIO"

   once i remove/comment messages came but uart functionality not working

   mqtt.c uses "WPRINT_APP_INFO"

   what may be the issue ?

As I mentioned the UART pins get changed, instead of UART from ST host processor, the UART from input is echo'd back, so you are not seeing the logs, would not suggest you to club the two apps. If you need to send data over UART, refer to console application under test folder.

3.what API should be used to receive from UART and take into buffer and whole string send it to mqtt plublish mssg

Refer to console application for user input from the terminal in order to publish a topic .

4.can you explain the functionalities of below:-

"wiced_uart_receive_bytes( STDIO_UART, &c, &expected_data_size, WICED_NEVER_TIMEOUT )"

wiced_uart_transmit_bytes( STDIO_UART, TEST_STR, sizeof( TEST_STR ) - 1 )

The header file for each has description for the following functions, one is used for Rx and other for Tx of data.

5.which GPIO Header pins of  BCM9WCD1EVAL1 are for UART and which api we should use to print the debug messages?

As mentioned above, the UART snip applications routes the UART pins differently than other regular applications. Refer to schematics for your platform under the platforms folder.

6.how to use UART interrupts?

What details would you like to know here in particular here, standard UART interrupts has been implemented in the SDK.

7.can in mqtt.c by just putting IP address of Ubuntu instance which running on amazon cloud will work? Ubuntu instance also running mqtt broker at aws

Yes it will work, as long as you provide the hostname or IP address of the broker you can change them accordingly, preferable location is in your application than the library implementation of mqtt.c

MichaelF_56
Moderator
Moderator
Moderator
250 sign-ins 25 comments on blog 10 comments on blog

Note that June 10th was a Friday. So your series of questions were responded to 1 work day later.

0 Likes
Anonymous
Not applicable

!Hi vik86​,

thank you for your reply

on BCM9WCD1EVAL1 board which has BCM943362WCD4 chip i am able to setup successfully uart communication and aws_iot_publisher

i.e what ever data i am getting on BCM920737-TAG  through UART transferring to BCM9WCD1EVAL1 and publishing to topic on aws_iot.

and on receiver side BCM9WCD1EVAL1 i am using aws_iot_subscriber to receive JASON data.

but now i am facing some issues if i use only publisher it is working fine and also if i use only subscriber it also works fine but when i connect both boards one as subscriber and one as publisher.both boards loose connection and data cannot be publish or even subscribe.

any idea what will be the issue

i am suspecting some broker issue because if i am using MQTT client on aws_iot or MQTT fx it works fine.

i am using same network and router for both the boards.

thank you

0 Likes

make sure the client id of publisher and subscriber are different.

Anonymous
Not applicable

Thank you,

uart,aws_publisher and aws_subscriber working fine.

but one issue is there when i connect BCM9WCD1EVAL1 board to Linux PC am not seeing any /dev/tty newly connected device.

i want to use BCM9WCD1EVAL1 board as a subscriber which will print received data on serial port.

anyone worked on Linux PC with this boards please help.

is it a driver issue?

i installed FTDI drivers also but no success.

0 Likes

Did you install the driver from ftdichip.com ?

If you have would suggest you t to reboot your pc and try again for

sudo ls /dev/tty*

0 Likes