Enabling any GPIO pin(LPC 54018) to high on recieving input from Alexa

cancel
Showing results for 
Search instead for 
Did you mean: 

Enabling any GPIO pin(LPC 54018) to high on recieving input from Alexa

637 Views
tanmayparashar9
Contributor I

Hello,

I am working with Alexa, AWS and the LPC 54018 module.

I am able to toggle the on board LED ON/OFF on passing a command from Alexa.

In this case when I say Alexa, ask my home to turn on/off the LED, the LED is turned on or off.

I wanted to know if on receiving the same input from Alexa can any of the other GPIO pins of the LPC 54018 module be toggled high or low? I wanted to pass information from that GPIO pin to an other board in my project.

 

~If I had to work on a particular application for example I say ( Alexa, ask my home to call the drone) and when I say this I wanted to enable one of the GPIO pins (Not the on board LED) of the LPC 54018 module to go high/1 on receiving this input from Alexa.

 

Where all do I need to make changes?

 

Is executing this particular application achievable and how do I do it?

Thank You

Regards,

Tanmay

Labels (1)
Tags (1)
0 Kudos
8 Replies

152 Views
tanmayparashar9
Contributor I

Hello,

Thank You for your help!

I had a question.

It is possible to test the LED's on the hardware using the alexa simulator on alexa developer console without using the alexa echo dot device right?

Regards,

Tanmay

pastedImage_2.png

0 Kudos

152 Views
Sabina_Bruce
NXP Employee
NXP Employee

Hi Tanmay,

That is correct, you can type in the command in the Alexa Simulator and you can test it without the echo dot.

Best Regards,

Sabina

0 Kudos

152 Views
tanmayparashar9
Contributor I

Hello,

I had an other question.

If I am trying to do run the "LPC54018iotmodule_aws_remote_control_wifi" example, How should I import the whole project folder into MCU Xpresso? 

 

I can find this particular application under AWS examples but not understanding how to pull the project folder into MCU Xpresso.

 

I would also need to update the endpoint API, Thing name, WIFI SSID and Password for that particular example. So where can I do that?

Could you please help me out.

pastedImage_1.png

pastedImage_2.png

Thank You

Regards,

Tanmay

0 Kudos

152 Views
Sabina_Bruce
NXP Employee
NXP Employee

Hello Tanmay, 

In order to import an SDK example, I recommend that you take a look at chapter 7 of the MCUXpresso IDE User Guide.

Once you have the project you can see that the project is essentially the same as the previous one, with added peripherals. To update the endpoint API, Thing name, WIFI SSID and Password you can find it in the same file as your other project "aws_clientcredential.h"

I recommend that you use the step by step instructions you used in the led control project as a reference. You will notice that everything else is the same, and the principal changes occur in the main.c and remote_control.c.

Best Regards,

Sabina

0 Kudos

152 Views
tanmayparashar9
Contributor I

Hello,

Thank you for your response.

I am using the on board LED ( LED3) in my code. Please can you help me out with which of the GPIO pins on the OM4006 baseboard is the the LPC 54018 module on board LED connected?

I wanted to use that GPIO to which the LED of the LPC 54018 module is connected to pass on the information to an other board.

I'm finding it difficult to trace the information from the schematic provided hence need your help.

Thank You!

Regards,

Tanmay

0 Kudos

152 Views
tanmayparashar9
Contributor I

Hello,

Thank you for your response.

I will look into the example you mentioned. Is it located in the SDK examples?

1)Toggling a GPIO pin will work very similar to the LEDs, you will need to intialize the correct pin you want to work with and include it in your  application

Where are the GPIO pins located? Should the GPIO pins on the OM 4006 baseboard be initialized? The LPC 54018 module does not have any GPIO pins. Should the pins on the baseboard be included and initialized in the code?

Also can the input from Alexa reach the on board LED and one of the GPIO pins at the same time? ( LED is turned ON and the GPIO pin goes high at the same time on receiving an input from Alexa)

Regards,

Tanmay

0 Kudos

152 Views
Sabina_Bruce
NXP Employee
NXP Employee

Hello,

It is located in th SDK examples for the LPC54018iotmodule and you will find it under the tab for AWS_examples.

Where are the GPIO pins located? Should the GPIO pins on the OM 4006 baseboard be initialized? The LPC 54018 module does not have any GPIO pins. Should the pins on the baseboard be included and initialized in the code?

The specific pins you need can be found in the baseboard schematic and you can match up the correct pin on the IoT module. In the example I mentioned you will see that in the code it initialized P3_3 and P3_14 which are the corresponding user leds on the base board. You can see the same information on the schematic. 

For example if you would like to test the pin digital pin D7 on your base board you can find it in the schematic under "Arduino Shield receptacles " and see that it is P2_2. So in your code you need to initialize that pin in the same manner that the above leds are initialized.

Also can the input from Alexa reach the on board LED and one of the GPIO pins at the same time? ( LED is turned ON and the GPIO pin goes high at the same time on receiving an input from Alexa)

This depends on how you modify the code, it is possible to have them turn on at the same time if you create a message that allows for it, but it is more complex. If not you would need to first turn on the led "Alexa, ask my home to turn on the led" and then "Alexa, ask my home to call the drone".  With the example that I am mentioning you will see that you can turn on the leds and update the accelerometer and the leds will stay on until you say otherwise, but you cannot turn on the led and update the accelerometer at the same time. 

Best Regards,

Sabina

0 Kudos

152 Views
Sabina_Bruce
NXP Employee
NXP Employee

Hello Tanmay,

Now that you are more familiarized with the process of communicating your development board with amazon's services. You can now begin to modify the code itself to add the peripherals you are looking for. To answer your question this is possible and is not limited to just GPIO, but  you can enable many other pins and functions to include sensors and actors.

As a general overview the changes will be made mainly in your led_control.c, reading and writing to your thing's shadow, the lambda function will also have to include the new peripherals and the alexa skill. To get you started I recommend taking a look at the example "LPC54018iotmodule_aws_remote_control_wifi", this example is the same as what you have been working with except that it has extra peripherals added. In this case you will be able to control the IoT Module baseboard's LEDs and update the accelerometer.

Toggling a GPIO pin will work very similar to the LEDs, you will need to intialize the correct pin you want to work with and include it in your  application. Before making any changes I recommend that you make a copy of your project, your lambda and your skill.


I sent you the JSON Alexa skill and the lambda function that you need to run this example via email.Please take in mind that these two files are from the Amazon side of the application not NXP. Due to this it is out of our scope to support the Amazon side of the applications that come with the SDK.

We don't have a detailed guide that shows how to achieve what you are looking for, sorry for the inconvinience that this may cause.You can begin to work on your application using as a reference the SDK example that I mentioned before.

Unfortunately, we cannot provide support for the modifications in the lambda function or the skill. The purpose of the SDK examples that we provide is to show you how to start working with Amazon Web Services. The modifications made to the project to fit your needs will depend on you, and we can only help you with the NXP side.If you have specific questions regarding the SDK examples, please let me know so I can assist you.


For further communication please reply directly in this post.

Thank you,
Sabina

0 Kudos