This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to send data to own AWS server using Cloud Client sample ?

HI All

Actually I need to send GPS data to own AWS server so from here I setup AWS server and use cloud client sample and follow the step 

like 

1) change the cloud backend to the AWS_IOT

2) Enable AWS IOT setting and added ID, HOSTNAME and SEC TAG.

3) Updated the modem certificates.

but get an error.

this my Kconfig 

#
# Copyright (c) 2020 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic
#

menu "Cloud Client Sample Settings"

config CLOUD_BACKEND
	string "Selects the cloud backend to be used"
	default "AWS_IOT"
	help
	  Possible values are "NRF_CLOUD", "AWS_IOT", "AZURE_IOT_HUB".

config AWS_IOT_BROKER_HOST_NAME
	string "AWS IoT MQTT broker hostname"
	default "a6i4ulevbqzm-ats.iot.us-east-2.amazonaws.com"
	help
	  Default is set to be the nRF Cloud MQTT broker.	  

config AWS_IOT_CLIENT_ID_STATIC
	string "Client ID"
	default "nrf-352656101080789"
	
config AWS_IOT_SEC_TAG
	int "Security tag for TLS credentials"
	default 111
	
config MQTT_BROKER_PORT
	int "AWS IoT MQTT broker port"
	default 8883
	  
config CLOUD_MESSAGE
	string "Sets the custom message published periodically to cloud"
	default "{\"state\":{\"reported\":{\"message\":\"Hello Internet of Things!\"}}}"

config CLOUD_MESSAGE_PUBLICATION_INTERVAL
	int "Sets how often the custom message should be published to cloud, in seconds"
	default 10

config CLOUD_CONNECTION_RETRY_TIMEOUT_SECONDS
	int "Sets the number of seconds between each cloud connection retry"
	default 30

choice
	prompt "Cloud Publication Trigger"
	default CLOUD_PUBLICATION_BUTTON_PRESS

config CLOUD_PUBLICATION_BUTTON_PRESS
	bool "Triggers publication to cloud upon a button press"

config CLOUD_PUBLICATION_SEQUENTIAL
	bool "Sets sequential publication to cloud set by the CONFIG_MESSAGE_PUBLICATION_INTERVAL option"

endchoice

config POWER_SAVING_MODE_ENABLE
	bool "Requests PSM from cellular network"

endmenu

module = CLOUD_CLIENT
module-str = Cloud client
source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config"

menu "Zephyr Kernel"
source "Kconfig.zephyr"
endmenu

this my prj.config

#
# Copyright (c) 2020 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic
#

# General config
CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
CONFIG_RESET_ON_FATAL_ERROR=n
CONFIG_NCS_SAMPLES_DEFAULTS=y

# Log level
# For more verbose and detailed log output, set the log level to
# CONFIG_CLOUD_CLIENT_LOG_LEVEL_DBG=y instead.
CONFIG_CLOUD_CLIENT_LOG_LEVEL_INF=y

# Network
CONFIG_NETWORKING=y
CONFIG_NET_NATIVE=n
CONFIG_NET_SOCKETS=y
CONFIG_NET_SOCKETS_OFFLOAD=y

# LTE link control
CONFIG_LTE_LINK_CONTROL=y
CONFIG_LTE_NETWORK_MODE_LTE_M=y
CONFIG_LTE_AUTO_INIT_AND_CONNECT=n

# BSD library
CONFIG_BSD_LIBRARY=y

# DK
CONFIG_DK_LIBRARY=y

# AT commands interface
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_AT_HOST_LIBRARY=y

# Generic cloud API
CONFIG_CLOUD_API=y

# Selected cloud backend
CONFIG_CLOUD_BACKEND="AWS_IOT"

# nRF Cloud
CONFIG_NRF_CLOUD=n
# CONFIG_NRF_CLOUD_CONNECTION_POLL_THREAD=y

# AWS IoT
CONFIG_AWS_IOT=y
CONFIG_AWS_IOT_CLIENT_ID_STATIC="nrf-352656101080789"
CONFIG_AWS_IOT_BROKER_HOST_NAME="a6i4ulevbqzm-ats.iot.us-east-2.amazonaws.com"
CONFIG_AWS_IOT_SEC_TAG=111
CONFIG_AWS_IOT_TOPIC_UPDATE_DELTA_SUBSCRIBE=y
CONFIG_AWS_IOT_CONNECTION_POLL_THREAD=y

# Azure IoT Hub
# CONFIG_AZURE_IOT_HUB=y
# CONFIG_AZURE_IOT_HUB_DEVICE_ID="my-device"
# CONFIG_AZURE_IOT_HUB_HOSTNAME="example.endpoint.com"
# CONFIG_AZURE_IOT_HUB_SEC_TAG=10

# Heap and stacks
# Extended memory heap size needed for encoding nRF Cloud messages to JSON
CONFIG_HEAP_MEM_POOL_SIZE=8192
CONFIG_MAIN_STACK_SIZE=4096
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

is there any i need to change?

Thanks & Regards

Iand Prj.config file

  • Hello, 


    jaydip kavaiya said:
    The only problem with modem LTE configuration.

    What is the issue with the modem configuration?

    jaydip kavaiya said:

    As per your suggestion I use PSM mode so get GPS data and after send data to AWS 

    in Modem_configuration getting error.

    Can you please provide the error code you get?

    Kind regards,
    Øyvind

      

  • HI Oyvind

    Thanks you for your Support and all valuable answer

    problem is solved, Now I get the GPS data and also send to my AWS server

    for just now I am only doing basic not use PSM mode(for PSM mode definitely need your help),

    but from use of below step I did it successfully.

    Step 1: Init_app as it is use in GPS sample code

    Step 2: Get GPS data after some time (3 min)

    Step 3: Close the GPS socket

    Step 4:  send this command

                 (i) AT+CFUN=4

                 (ii) AT%XSYSTEMMODE=1,0,0,0 

                 (iii) AT+CFUN=1"

    Step 5: Modem confgi as it is in AWS sample code

    Thanks & Regards

    Jaydip Kavaiya

Related