Hello Team,
I am going to use the MQTT Protocol, and i want to send data on JSON format is this possible. Because this i read your documents in that JSON formate AT command is only for HTTP and HTTPS protocol. if i want to use MQTT protocol then which language should we use to design the IOT page.
and another information required i am not using RTC then RTC sensor should give ground or VDD.
because my SDK is not load in module they stuck in middle i think this is because of RTC is goes in SLEEP mode so what should we do to WAKE UP this RTC.
Best Regard's
AK.
Hi AK,Thank you for posting your questions online.
ak said: I am going to use the MQTT Protocol, and i want to send data on JSON format is this possible. Because this i read your documents in that JSON formate AT command is only for HTTP and HTTPS protocol. if i want to use MQTT protocol then which language should we use to design the IOT page.
You can use the JSON format with MQTT protocol.The DA16200 SDK supports JSON and we provide a sample code.The JSON sample code is located in the below SDK directory:[SDK root]/0.DOC/Doxygen/html/json.html
ak said: and another information required i am not using RTC then RTC sensor should give ground or VDD. because my SDK is not load in module they stuck in middle i think this is because of RTC is goes in SLEEP mode so what should we do to WAKE UP this RTC.
Please refer on DA16200 Datasheet (renesas.com), on section 7.4 RTC, page:41The RTC GPIOs should be used to control the sleep modes.The API names to control the RTC_GPO are the following:
/** **************************************************************************************** * @brief This function initializes the RTC_GPO pin. * @param[in] mode 0: Auto mode (output high in power on state and output low in sleep state) * mode 1: Manual mode * **************************************************************************************** */ void RTC_GPO_OUT_INIT(UINT8 mode); /** **************************************************************************************** * @brief Set RTC_GPO output level. * @param[in] value of GPO 0: low, 1: high * **************************************************************************************** */ void RTC_GPO_OUT_CONTROL(UINT8 value);
Hello,
Yes, you can definitely send data in JSON format over MQTT. While you mentioned that the AT commands you read only reference JSON for HTTP and HTTPS, MQTT can also handle JSON payloads. You just need to format your data as a JSON string before publishing it to the MQTT broker. Here's a basic example in Python:
import paho.mqtt.client as mqttimport json
# Define the MQTT settingsbroker_address = "your_broker_address"client = mqtt.Client("ClientID")
# Connect to the brokerclient.connect(broker_address)
# Prepare your data in JSON formatdata = { "temperature": 22.5, "humidity": 60}json_data = json.dumps(data)
# Publish the JSON dataclient.publish("your/topic", json_data)
# Disconnectclient.disconnect()
You can use any programming language that supports MQTT libraries (like Python, Java, C/C++, JavaScript, etc.) to design your IoT application.
Regarding the RTC (Real-Time Clock) connection:
Feel free to ask if you have any more questions or need further assistance!
Best regards,
I successfully load the SDK and i get AT command OK.the problem which i face is in PDF of DA16200MOD has no mention RTC Sensor Pin function so i keep this pin open so that why the SDK is not loading at that time.so i read in one pdf and as you suggest that this PIN should be GND or VDD according sensor design. i make this PIN GND and SDK load.
Hello, i want make connection of two LED to this DA16200MOD for when transmission will happen that red will glow and receive time blue will glow so tell what to do in SDK file to this operation.thanks and regard's
Hi Ak,Thank you for the reply.
ak said: i want make connection of two LED to this DA16200MOD for when transmission will happen that red will glow and receive time blue will glow so tell what to do in SDK file to this operation.
Are you talking about Wi-Fi transmission or AT cmd transmissions?Generally for controlling LED, please refer on UM-WI-046 DA16200 DA16600 FreeRTOS SDK Programmer Guide (renesas.com) , on section 17.2 GPIO page:263Best Regards,OV_Renesas
hello,
Tell me for both wifi transmission and AT command transmission what to do in SDK.i read for GPIO just tell me for wifi transmission and AT command transmission.
i want to say when AT Command is send that time led glow same for receive side also. means we can get clarification of our data transmission not lost that the reason i am applying this. just like take example of HC05 Bluetooth LED function before connection state and after connection state and during transmission.
best regard's
kindly answer the question as soon as possible i am waiting your replay.
i read the GPIO API example but where to call in this function means in which file main.c,user.c or system start.c i am bit confuse.
thanks and regard's
AK
Hi AK,Thank you for the replies.It is not exactly clear what you are trying to achieve.However, for MQTT AT Commands you should use the following:When you send this AT command the following part will be executed in the atcmd.c file:
// AT+NWMQMSG else if (strcasecmp(argv[0] + 5, "MQMSG") == 0) { char *top; if (argc == 2 || argc == 3) { int rsp_val; /* AT+NWMQMSG=<msg>(,<topic>) (set only) */ if (strlen(argv[1]) > MQTT_MSG_MAX_LEN) { err_code = AT_CMD_ERR_NW_MQTT_PUB_MESSAGE_LEN; goto atcmd_network_end; } if (argc == 2) { top = NULL; } else if (argc == 3) { if (strlen(argv[2]) > MQTT_TOPIC_MAX_LEN) { err_code = AT_CMD_ERR_NW_MQTT_PUB_TOPIC_LEN; goto atcmd_network_end; } else { top = argv[2]; } } rsp_val = mqtt_client_send_message(top, argv[1]); if (rsp_val == -1) { err_code = AT_CMD_ERR_NW_MQTT_NOT_CONNECTED; } else if (rsp_val == -2) { // in-flight message is in progress err_code = AT_CMD_ERR_NW_MQTT_PUB_TX_IN_PROGRESS; } else if (rsp_val == -3) { // no topic in mqtt configuration err_code = AT_CMD_ERR_NW_MQTT_PUB_TOPIC_NOT_EXIST; } else if (rsp_val == 9 /* MOSQ_ERR_PAYLOAD_SIZE */) { // paylod too long err_code = AT_CMD_ERR_NW_MQTT_PUB_MESSAGE_LEN; } else { // pre-check passed ... if (dpm_mode_is_enabled() == pdTRUE) { if (mqtt_client_get_qos() > 0) { // qos 1 or 2 if (rsp_val != 0) { mqtt_client_convert_to_atcmd_err_code(&rsp_val, &err_code); } } else { // qos 0 if (rsp_val != 0) { mqtt_client_convert_to_atcmd_err_code(&rsp_val, &err_code); } else { // make async +NWMQMSGSND:1 to sync print atcmd_mqtt_qos0_msg_send_done_in_dpm = TRUE; atcmd_mqtt_qos0_msg_send_rc = 0; } } } } } else { err_code = AT_CMD_ERR_INSUFFICENT_ARGS; } }
void mqtt_client_convert_to_atcmd_err_code(int* err_code, int* atcmd_err_code) { int mosq_err_code = *err_code; if (mosq_err_code == MOSQ_ERR_INVAL || mosq_err_code == MOSQ_ERR_PAYLOAD_SIZE) { *atcmd_err_code = AT_CMD_ERR_WRONG_ARGUMENTS; } else if (mosq_err_code == MOSQ_ERR_NO_CONN || mosq_err_code == MOSQ_ERR_CONN_LOST) { *atcmd_err_code = AT_CMD_ERR_NOT_CONNECTED; } else { *atcmd_err_code = AT_CMD_ERR_UNKNOWN; } } void atcmd_asynchony_event_for_mqttmsgpub(int result, int err_code) { int atcmd_err; if (result == 1) { PRINTF_ATCMD("\r\n+NWMQMSGSND:1\r\n"); } else if (result == 0) { mqtt_client_convert_to_atcmd_err_code(&err_code, &atcmd_err); PRINTF_ATCMD("\r\n+NWMQMSGSND:0,%d\r\n", atcmd_err); } }
I understand.
now i am take one example of DA16200MOD for GPIO and i did build project it gives me error in wifi stack i am attaching the image just give me the solution.
Best Regards,
Hi AK,Thank you for the reply.Apologies for the delay but I was OOO.You are getting this kind of error on one of our default example projects?If yes, could you please shorten the path of your workspace? If you have modified the example, could you please share the modifications you have made?Best Regards,OV_Renesa