MediaTek-Labs / aws_mbedtls_mqtt

The source code to use mbedTLS library to connect to AWS mqtt IOT server.
62 stars 34 forks source link

No Serial output when this function bearer_callback #1

Closed syediddi closed 8 years ago

syediddi commented 8 years ago

This seems to be weird.

If the function bearer_callback is present in the code, the serial simply doesn't output anything.

I tried nodejs sdk from amazon and the mqtt sample works perfect.

However even before trying the mqtt the function bearer_callback prevents anything to print on Serial monitory. If I remove the function and print on Serial Monitor it a at least prints.

Any idea whats going on?

Arduino 1.6.5-r5 Windows 10 MediaTek

JasonMTK commented 8 years ago

Hi,

Did you replace the platform.txt file in your Arduino?

It seems like not only Mac need to replace the platform.txt. For windows 10, you may also need to do this step:

Noticed: please replace platform.txt to the following place:

Arduino 1.5.7: /Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/mtk/platform.txt

Arduino 1.6.5: /Users/{YOUR_USERNAME}/Library/Arduino15/packages/LinkIt/hardware/arm/1.1.17/platform.txt

You could download the platform.txt from this github.

Thanks,

syediddi commented 8 years ago

I see the platform.txt in this path.

C:\Users\AppData\Roaming\Arduino15\packages\LinkIt\hardware\arm\1.1.17

Also, I was able to successfully execute the blink and wifi sample..The issue was with the mqtt sample and that particular function.

JasonMTK commented 8 years ago

Yes, you are correct. I upload a version for Windows platform.txt. Could you try to download it and replace it for the path C:\Users\AppData\Roaming\Arduino15\packages\LinkIt\hardware\arm\1.1.17?

Let me know the issue would be fixed or not.

The reason for this problem is about compile options and may only happened to win10. We need to add "-ffunction-sections -fdata-sections" those two options in compiler.c.flags=-c and compiler.cpp.flags=-c in platform.txt.

syediddi commented 8 years ago

Man it worked. Thanks.