Clarifications PIC32MZ EF

AleG wrote on June 13, 2018:

Hi,

I am working on pic32mz curiosity dev board demo.
I’ll go straight to the point:
initially the board didn’t connect to the broker until I changed gateway and dns addresses in the project. Now when I try to change them, they remain set as the current ones.
Furthermore the IP address that shows me in the terminal is different from what is set by default in the project.
Why i can’t reset the addresses?

And another question, how can i switch from wifi to ethernet?

Thanks

Gaurav-Aggarwal-AWS wrote on June 14, 2018:

Hello,

Please follow the following Getting Started Guide to set up the Microchip board: https://docs.aws.amazon.com/freertos/latest/userguide/getting_started_mch.html

Specifically, the section +“Configure Your Project”+ walks you through to set up your endpoint and other credentials.

When you connect to a WiFi Access Point, IP address is not set by the project but the Access Point assigns it. That’s the reason you see a different IP address.

You need to define the following project level macro to use ethernet:

PIC32_USE_ETHERNET

In order to define a project level macro:

  • Right-click on your project and click properties.
  • Select Conf:[pic32mz_ef_curiosity]–>XC32(Global Options)–>cc32-gcc.
  • From the +Option Categories+ drop down, select +Preprocessing and messages+.
  • Click on +Preprocessor macros+ and add +PIC32_USE_ETHERNET+ in the dialog box that pops up.
    Hope that helps.

Thanks.

AleG wrote on June 15, 2018:

Hello,

I followed the instruction in that page, but the board sometimes did not connect.
Now that I switched to ethernet it always works, so thank you!

Another two question:
-IP address is setted by access point also in Ethernet, right?
-What is the use of this piece of code if the addresses are set differently?
in the file “system_config.h”:


#define TCPIP_NETWORK_DEFAULT_IP_ADDRESS			"192.168.100.115"
#define TCPIP_NETWORK_DEFAULT_IP_MASK				"255.255.255.0"
#define TCPIP_NETWORK_DEFAULT_GATEWAY			"192.168.100.1"
#define TCPIP_NETWORK_DEFAULT_DNS				"192.168.100.1"
#define TCPIP_NETWORK_DEFAULT_SECOND_DNS			"0.0.0.0"

Thank you for the help!

Gaurav-Aggarwal-AWS wrote on June 18, 2018:

I am glad that it worked.

The IP address is assigned dynamically by the Access Point if you are using DHCP. Otherwise, you can configure it statically.

Thanks.

BillP wrote on July 09, 2018:

I recently bought the PIC32MZ EF “bundle” and followed the getting started page from AWS. Everything worked until I got to the “Rebuild your project”. The build contained errors. What version of MPLAB X, XC32, and Harmony did you use to make it work?

Gaurav-Aggarwal-AWS wrote on July 16, 2018:

As mentioned in the getting started guide, Amazon FreeRTOS should work with the latest version of tools: https://docs.aws.amazon.com/freertos/latest/userguide/getting_started_mch.html

Would you please share what errors are you getting?

Thanks.