Communication with nrfCloud from external devices

HI all! 

I've been doing some research on working with nRF Cloud and I have a few questions/clarifications: 

1. In general are you able to drive/control a GPIO pin through a cloud service? I'm already assuming this is a no since these are mostly for collecting and transforming data but just to make sure. 

2. Generally to drive the GPIO NMOS for the nRF91 SiP on the Thingy 91 would be done through an LTE connection, is it possible to do this through creating an external application like an app or website? So you could press a button on this application and that would set the variable assigned to a pin to be set to HIGH and then it drives an LED or whatever would be connected to the GPIO pin?

3. Also if I have my Thingy plugged into the wall to power, I should still be able to use the Serial Monitor application on nRF Connect for Desktop to communicate via AT commands correct?  

I'm trying to gauge the full extent of the GPIO and cloud capabilities associated with the Thingy 91 so advice would be greatly appreciated for a beginner like me :)

Thanks!!

  • Hi,

    1. In general are you able to drive/control a GPIO pin through a cloud service? I'm already assuming this is a no since these are mostly for collecting and transforming data but just to make sure. 
    2. Generally to drive the GPIO NMOS for the nRF91 SiP on the Thingy 91 would be done through an LTE connection, is it possible to do this through creating an external application like an app or website? So you could press a button on this application and that would set the variable assigned to a pin to be set to HIGH and then it drives an LED or whatever would be connected to the GPIO pin?

    The answer is yes, the device can change GPIO state if you send a specific command through cloud. See the method mentioned in (+) Using nrf9160-DK and nrfCloud - Control GPIO from the nrfCloud - Nordic Q&A - Nordic DevZone - Nordic DevZone (nordicsemi.com).

    3. Also if I have my Thingy plugged into the wall to power, I should still be able to use the Serial Monitor application on nRF Connect for Desktop to communicate via AT commands correct?  

    Yes, as long as you connect the USB port with PC.

    Best regards,

    Charlie

  • Hi Charlie! 

    Thank you so much for your reply, this really helps me plan through this project! Just to clarify this: 

    Yes, as long as you connect the USB port with PC.

    So if my Thingy is connected to the wall via USB I wouldn't be able to use Connect for Desktop because it's not plugged into the computer. 

    Also, I went to the DevZone post you pointed me towards and found the documentation for that command. The sample on the SDK is only available for the 9160DK but I'm assuming the command and logic can be implemented with the Thingy 91?

    Thanks again for all the help!

  • witch_mountain said:
    So if my Thingy is connected to the wall via USB I wouldn't be able to use Connect for Desktop because it's not plugged into the computer. 

    Yes, because the nRF Connect for Desktop is running on PC with Mac/Win/Linux. 

    witch_mountain said:
    Also, I went to the DevZone post you pointed me towards and found the documentation for that command. The sample on the SDK is only available for the 9160DK but I'm assuming the command and logic can be implemented with the Thingy 91?

    Yes, the nRF Cloud can be used with all nRF91 devices.

  • Hi Charlie! 

    I got caught up with a few things but to follow up your answer with using the SendDeviceMessage Endpoint, is this available to be used if my device was using the MQTT API?

    If I am able to use this endpoint to I enter the curl command into the terminal on nRF Cloud or do I enter something similar to the sample found in the Cloud API into the cloud terminal? https://api.nrfcloud.com/v1/#tag/Messages/operation/SendDeviceMessage

    Also, regardless of the syntax, for the actual message/data I'm sending what would change to make it toggle the GPIO pins on the SiP? I know there are the AT Commands available for this but when I tried using 

    > AT#XGPIO=0,13,1
    ERROR
    > AT#XGPIO=2,13,1
    ERROR
    > AT#XGPIO=1,13
    ERROR

    I thought I might test them out and see how it works with an LED connected to NMOS 1 on the Thingy 91. However, the terminal kept giving me errors even when I tried to read the state of the GPIO. I'm wondering if I need to add like a GPIO library/package in main.c? At the moment my device is just running the asset tracker v2 application (LTE). 

    So I'm not sure how to go about actually using the SendDeviceMessage Endpoint for my purpose here. 

    Thanks!

  • witch_mountain said:
    I got caught up with a few things but to follow up your answer with using the SendDeviceMessage Endpoint, is this available to be used if my device was using the MQTT API?

    I do not quite understand your request. Following is the message path when you are using REST API SendDeviceMessage Endpoint. Is this want you want?

    Any REST client(e.g. nRF Cloud Device management terminal, your own cloud service, postman)--------SendDeviceMessage-----> nRF Cloud ---------MQTT API---------> nRF91 Device

    witch_mountain said:
    Also, regardless of the syntax, for the actual message/data I'm sending what would change to make it toggle the GPIO pins on the SiP? I know there are the AT Commands available for this but when I tried using 

    Serial LTE modem (nordicsemi.com) support following commands, AT#XGPIO is one of the proprietary AT commands only supported by SLM sample.

    When you run Assert Tracker v2 sample, the shell only support AT commands from modem. You need to add codes for GPIO operation when the device receives some specific message you defined for GPIO control.

    Best regards,

    Charlie

Related