eclipse-threadx / samples

A collection of complete sample workspaces and projects for popular development boards from ST, NXP, Renesas, Microchip and Microsoft using popular IDEs and toolchains, including IAR, ARM, STM32CubeIDE, MCUXpresso, MPLAB, Visual Studio, and Visual Studio Code.
131 stars 51 forks source link

Azure-Iot-Sample serial port not showing #11

Closed solarflarefx closed 3 years ago

solarflarefx commented 3 years ago

I am trying to follow the doc "Azure RTOS IoT Quick Connect Sample STM32L4+-DISCO IoT Node using STM32CubeIDE User Guide". I was able to get up to the point of downloading the project to the board, but I am having trouble with the following part: image

I am using Ubuntu 18.04, so I chose to use Putty as the terminal instead. First I searched for the serial ports using: dmesg | grep tty

I got: image

So within Putty I set up the following: image

However, even after running the program I just get an empty terminal: image

I tried using Azure IoT Explorer's telemetry but it does not seem to communicate: image

I believe the program is running fine as the LED at the corner is blinking red and green

wangwen-4220 commented 3 years ago

@solarflarefx , can you re-plug the USB cable of the board to make sure the correct serial port is selected?

solarflarefx commented 3 years ago

@wangwen-4220 I have tested the same serial port on the same board, but using bare metal C code and that works fine.

wangwen-4220 commented 3 years ago

@solarflarefx , want to make sure with you which board you are using , b-l4s5 or b-l475?

solarflarefx commented 3 years ago

@wangwen-4220 I have the B-L475E-IOT01A1

wangwen-4220 commented 3 years ago

@solarflarefx , please change the linker file to "STM32L475VGTX_FLASH.ld" :

image

solarflarefx commented 3 years ago

Thanks for the suggestions. Seems to have made a difference, but I get this error now: image

bo-ms commented 3 years ago

@solarflarefx could you check if set the WIFI user name and password?

solarflarefx commented 3 years ago

@bo-ms You mean in board_setup.c?

ifndef WIFI_SSID

//#error "Symbol WIFI_SSID must be defined."

define WIFI_SSID "xxx"

endif / WIFI_SSID /

ifndef WIFI_PASSWORD

//#error "Symbol WIFI_PASSWORD must be defined."

define WIFI_PASSWORD "yyy"

endif / WIFI_PASSWORD /

I edited the lines above, replacing "xxx" and "yyy" with the SSID and password. Is there anything else I am supposed to edit?

I get a wifi not connected, dns create fail message

I double checked and made sure that I put in the SSID and password correctly. Could there be another source of error on my part?

bo-ms commented 3 years ago

@solarflarefx correct, set WIFI_SSID and WIFI_PASSWORD as yours, could you also check if the WIFI_SECURITY_TYPE is correct? If also failed, could you try to use phone hotspot first?

solarflarefx commented 3 years ago

@bo-ms I looked at the security settings for my wifi network: image

My settings were:

ifndef WIFI_SECURITY_TYPE

//#error "Symbol WIFI_SECURITY_TYPE must be defined."

define WIFI_SECURITY_TYPE WIFI_ECN_WPA2_PSK

endif / WIFI_SECURITY_TYPE /

bo-ms commented 3 years ago

@solarflarefx seems the settings are correct, one potential issue, the wifi signal on L4 board is weak, could you try to move the router close to board? or try to get the board connected to hotspot? thanks.

solarflarefx commented 3 years ago

I get this: STM32L4XX Lib:

CMSIS Device Version: 1.7.0.0. HAL Driver Version: 1.12.0.0. BSP Driver Version: 1.0.0.0. ES-WIFI Firmware: Product Name: Inventek eS-WiFi Product ID: ISM43362-M3G-L44-SPI Firmware Version: C3.5.2.5.STM API Version: v3.5.2 ES-WIFI MAC Address: xxx ES-WIFI Connected. ES-WIFI IP Address: x.x.x.x ES-WIFI Gateway Address: x.x.x.x ES-WIFI DNS1 Address: x.x.x.x ES-WIFI DNS2 Address: x.x.x.x Error in connecting to server: 0x10005

Does anything look off here?

bo-ms commented 3 years ago

@solarflarefx made some progress, once you get the IP address, it means the device already connected to router. did you set the symbols used to connect IoT Hub in sample_config.h? such as: DEVICE_ID, DEVICE_SYMMETRIC_KEY, HOST_NAME

solarflarefx commented 3 years ago

@bo-ms I followed the PDF instructions and set:

I did not set other parameters except for the WIFI information.

Is there a way to tell which of the above parameters is giving a problem? Though I believe I have set the above 3 parameters correctly.

wangwen-4220 commented 3 years ago

@solarflarefx , which sample are you running? please note that DEVICE_SAS is time-limited. what value did you set for "Expiration (minutes)" when creating SAS token connection string

solarflarefx commented 3 years ago

@wangwen-4220 I am trying to run sample_azure_iot project. I set the SAS to 120 minutes. This time did not expire from when I generated the token and then tried to run the sample.

wangwen-4220 commented 3 years ago

@solarflarefx ,HOST_NAME's format looks like "your-iothub-name.azure-devices.net". how is it going ? still Error in connecting to server: 0x10005?

solarflarefx commented 3 years ago

Yes still the same error. I believe I did put in the correct HOST_NAME

wangwen-4220 commented 3 years ago

can you try the latest release samples : https://github.com/azure-rtos/samples

bo-ms commented 3 years ago

closing this issue for now, let us know if you have further questions.