From 3caec296f462ef5a7225be335606a60d0c5578f2 Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Thu, 6 May 2021 15:20:05 +0500 Subject: [PATCH 01/44] add Arduino Nano 33 ioT example code --- .../iothub_ll_telemetry_sample/iot_configs.h | 26 ++ .../iothub_ll_telemetry_sample.ino | 313 ++++++++++++++++++ .../platform.local.txt | 103 ++++++ .../iothub_ll_telemetry_sample/sample_init.h | 21 ++ 4 files changed, 463 insertions(+) create mode 100644 examples/ArduinoNano33iot/iothub_ll_telemetry_sample/iot_configs.h create mode 100644 examples/ArduinoNano33iot/iothub_ll_telemetry_sample/iothub_ll_telemetry_sample.ino create mode 100644 examples/ArduinoNano33iot/iothub_ll_telemetry_sample/platform.local.txt create mode 100644 examples/ArduinoNano33iot/iothub_ll_telemetry_sample/sample_init.h diff --git a/examples/ArduinoNano33iot/iothub_ll_telemetry_sample/iot_configs.h b/examples/ArduinoNano33iot/iothub_ll_telemetry_sample/iot_configs.h new file mode 100644 index 0000000..36c6496 --- /dev/null +++ b/examples/ArduinoNano33iot/iothub_ll_telemetry_sample/iot_configs.h @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +#ifndef IOT_CONFIGS_H +#define IOT_CONFIGS_H + +/** + * WiFi setup + */ +#define IOT_CONFIG_WIFI_SSID "" +#define IOT_CONFIG_WIFI_PASSWORD "" + +/** + * IoT Hub Device Connection String setup + * Find your Device Connection String by going to your Azure portal, creating (or navigating to) an IoT Hub, + * navigating to IoT Devices tab on the left, and creating (or selecting an existing) IoT Device. + * Then click on the named Device ID, and you will have able to copy the Primary or Secondary Device Connection String to this sample. + */ +#define DEVICE_CONNECTION_STRING "" + +// The protocol you wish to use should be uncommented +// +#define SAMPLE_MQTT +//#define SAMPLE_HTTP + +#endif /* IOT_CONFIGS_H */ diff --git a/examples/ArduinoNano33iot/iothub_ll_telemetry_sample/iothub_ll_telemetry_sample.ino b/examples/ArduinoNano33iot/iothub_ll_telemetry_sample/iothub_ll_telemetry_sample.ino new file mode 100644 index 0000000..949cc69 --- /dev/null +++ b/examples/ArduinoNano33iot/iothub_ll_telemetry_sample/iothub_ll_telemetry_sample.ino @@ -0,0 +1,313 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// CAVEAT: This sample is to demonstrate azure IoT client concepts only and is not a guide design principles or style +// Checking of return codes and error values shall be omitted for brevity. Please practice sound engineering practices +// when writing production code. + +// Note: PLEASE see https://github.com/Azure/azure-iot-arduino#simple-sample-instructions for detailed sample setup instructions. +// Note2: To use this sample with the esp32, you MUST build the AzureIoTSocket_WiFi library by using the make_sdk.py, +// found in https://github.com/Azure/azure-iot-pal-arduino/tree/master/build_all. +// Command line example: python3 make_sdk.py -o +#include +#include +#include +#include + +#include "iot_configs.h" // You must set your wifi SSID, wifi PWD, and your IoTHub Device Connection String in iot_configs.h +#include "sample_init.h" + +#ifdef is_esp_board + #include "Esp.h" +#endif + +#ifdef is_arduino_board + #include "Arduino.h" +#endif + +#ifdef SAMPLE_MQTT + #include "AzureIoTProtocol_MQTT.h" + #include "iothubtransportmqtt.h" +#endif // SAMPLE_MQTT +#ifdef SAMPLE_HTTP + #include "AzureIoTProtocol_HTTP.h" + #include "iothubtransporthttp.h" +#endif // SAMPLE_HTTP + +static const char ssid[] = IOT_CONFIG_WIFI_SSID; +static const char pass[] = IOT_CONFIG_WIFI_PASSWORD; + +/* Define several constants/global variables */ +const int RESET_PIN = 40; +static const char* connectionString = DEVICE_CONNECTION_STRING; +static bool g_continueRunning = true; // defines whether or not the device maintains its IoT Hub connection after sending (think receiving messages from the cloud) +static size_t g_message_count_send_confirmations = 0; +static bool g_run_demo = true; + +IOTHUB_MESSAGE_HANDLE message_handle; +size_t messages_sent = 0; +#define MESSAGE_COUNT 5 // determines the number of times the device tries to send a message to the IoT Hub in the cloud. +const char* telemetry_msg = "test_message"; +const char* quit_msg = "quit"; +const char* exit_msg = "exit"; + +IOTHUB_DEVICE_CLIENT_LL_HANDLE device_ll_handle; + +static int callbackCounter; +int receiveContext = 0; + +/* -- receive_message_callback -- + * Callback method which executes upon receipt of a message originating from the IoT Hub in the cloud. + * Note: Modifying the contents of this method allows one to command the device from the cloud. + */ +static IOTHUBMESSAGE_DISPOSITION_RESULT receive_message_callback(IOTHUB_MESSAGE_HANDLE message, void* userContextCallback) +{ + int* counter = (int*)userContextCallback; + const unsigned char* buffer; + size_t size; + const char* messageId; + + // Message properties + if ((messageId = IoTHubMessage_GetMessageId(message)) == NULL) + { + messageId = ""; + } + + // Message content + if (IoTHubMessage_GetByteArray(message, (const unsigned char**)&buffer, &size) != IOTHUB_MESSAGE_OK) + { + LogInfo("unable to retrieve the message data\r\n"); + } + else + { + LogInfo("Received Message [%d]\r\n Message ID: %s\r\n Data: <<<%.*s>>> & Size=%d\r\n", *counter, messageId, (int)size, buffer, (int)size); + // If we receive the word 'quit' then we stop running + if (size == (strlen(quit_msg) * sizeof(char)) && memcmp(buffer, quit_msg, size) == 0) + { + g_continueRunning = false; + } + } + + /* Some device specific action code goes here... */ + (*counter)++; + return IOTHUBMESSAGE_ACCEPTED; +} + + +/* -- send_confirm_callback -- + * Callback method which executes upon confirmation that a message originating from this device has been received by the IoT Hub in the cloud. + */ +static void send_confirm_callback(IOTHUB_CLIENT_CONFIRMATION_RESULT result, void* userContextCallback) +{ + (void)userContextCallback; + // When a message is sent this callback will get envoked + g_message_count_send_confirmations++; + Serial.println("confirmation callback recieved"); + LogInfo("Confirmation callback received for message %lu with result %s\r\n", (unsigned long)g_message_count_send_confirmations, MU_ENUM_TO_STRING(IOTHUB_CLIENT_CONFIRMATION_RESULT, result)); + Serial.println((unsigned long)g_message_count_send_confirmations); + Serial.println(MU_ENUM_TO_STRING(IOTHUB_CLIENT_CONFIRMATION_RESULT, result)); +} + +/* -- connection_status_callback -- + * Callback method which executes on receipt of a connection status message from the IoT Hub in the cloud. + */ +static void connection_status_callback(IOTHUB_CLIENT_CONNECTION_STATUS result, IOTHUB_CLIENT_CONNECTION_STATUS_REASON reason, void* user_context) +{ + (void)reason; + (void)user_context; + // This sample DOES NOT take into consideration network outages. + if (result == IOTHUB_CLIENT_CONNECTION_AUTHENTICATED) + { + Serial.println("Device is connected to iothub"); + LogInfo("The device client is connected to iothub\r\n"); + } + else + { + Serial.println("Device is unable to connected to iothub"); + LogInfo("The device client has been disconnected\r\n"); + } +} + +/* -- reset_esp_helper -- + * waits for call of exit_msg over Serial line to reset device + */ +static void reset_esp_helper() +{ +#ifdef is_esp_board + // Read from local serial + if (Serial.available()){ + String s1 = Serial.readStringUntil('\n');// s1 is String type variable. + Serial.print("Received Data: "); + Serial.println(s1);//display same received Data back in serial monitor. + + // Restart device upon receipt of 'exit' call. + int e_start = s1.indexOf('e'); + String ebit = (String) s1.substring(e_start, e_start+4); + if(ebit == exit_msg) + { + ESP.restart(); + } + } +#endif // is_esp_board +} +// void(* resetFunc) (void) = 0; +// static void reset_arduino_helper() +// { +// #ifdef is_arduino_board +// delay(5000); +// digitalWrite(RESET_PIN, LOW); +// // Read from local serial +// if (Serial.available()){ +// String s1 = Serial.readStringUntil('\n');// s1 is String type variable. +// Serial.print("Received Data: "); +// Serial.println(s1);//display same received Data back in serial monitor. + +// // Restart device upon receipt of 'exit' call. +// int e_start = s1.indexOf('e'); +// String ebit = (String) s1.substring(e_start, e_start+4); +// if(ebit == exit_msg) +// { +// resetFunc(); +// } +// } +// #endif // is_arduino_board +// } +/* -- run_demo -- + * Runs active task of sending telemetry to IoTHub + * WARNING: only call this function once, as it includes steps to destroy handles and clean up at the end. + */ +static void run_demo() +{ + int result = 0; + + // action phase of the program, sending messages to the IoT Hub in the cloud. + do + { + if (messages_sent < MESSAGE_COUNT) + { + // Construct the iothub message from a string or a byte array + message_handle = IoTHubMessage_CreateFromString(telemetry_msg); + //message_handle = IoTHubMessage_CreateFromByteArray((const unsigned char*)msgText, strlen(msgText))); + + // Set Message property + /*(void)IoTHubMessage_SetMessageId(message_handle, "MSG_ID"); + (void)IoTHubMessage_SetCorrelationId(message_handle, "CORE_ID"); + (void)IoTHubMessage_SetContentTypeSystemProperty(message_handle, "application%2fjson"); + (void)IoTHubMessage_SetContentEncodingSystemProperty(message_handle, "utf-8");*/ + + // Add custom properties to message + // (void)IoTHubMessage_SetProperty(message_handle, "property_key", "property_value"); + + LogInfo("Sending message %d to IoTHub\r\n", (int)(messages_sent + 1)); + Serial.println("Sending message to iothub"); + result = IoTHubDeviceClient_LL_SendEventAsync(device_ll_handle, message_handle, send_confirm_callback, NULL); + // The message is copied to the sdk so the we can destroy it + IoTHubMessage_Destroy(message_handle); + + messages_sent++; + } + else if (g_message_count_send_confirmations >= MESSAGE_COUNT) + { + // After all messages are all received stop running + Serial.println("else called in do"); + g_continueRunning = false; + } + + IoTHubDeviceClient_LL_DoWork(device_ll_handle); + ThreadAPI_Sleep(3); + // reset_esp_helper(); + // reset_arduino_helper(); + + } while (g_continueRunning); + + // Clean up the iothub sdk handle + IoTHubDeviceClient_LL_Destroy(device_ll_handle); + // Free all the sdk subsystem + IoTHub_Deinit(); + + LogInfo("done with sending"); + return; +} +void setup() { + + + // digitalWrite(RESET_PIN, HIGH); + // pinMode(RESET_PIN, OUTPUT); + + // Select the Protocol to use with the connection +#ifdef SAMPLE_MQTT + IOTHUB_CLIENT_TRANSPORT_PROVIDER protocol = MQTT_Protocol; +#endif // SAMPLE_MQTT +#ifdef SAMPLE_HTTP + IOTHUB_CLIENT_TRANSPORT_PROVIDER protocol = HTTP_Protocol; +#endif // SAMPLE_HTTP + Serial.println("before sample innit"); + + sample_init(ssid, pass); + Serial.println("after sample inti"); + + // Used to initialize IoTHub SDK subsystem + (void)IoTHub_Init(); + // Create the iothub handle here + device_ll_handle = IoTHubDeviceClient_LL_CreateFromConnectionString(connectionString, protocol); + LogInfo("Creating IoTHub Device handle\r\n"); + + if (device_ll_handle == NULL) + { + LogInfo("Error AZ002: Failure creating Iothub device. Hint: Check you connection string.\r\n"); + Serial.println("error creating device handle"); + } + else + { + // Set any option that are neccessary. + // For available options please see the iothub_sdk_options.md documentation in the main C SDK + // turn off diagnostic sampling + int diag_off = 0; + Serial.println("device handle created sucessfully"); + IoTHubDeviceClient_LL_SetOption(device_ll_handle, OPTION_DIAGNOSTIC_SAMPLING_PERCENTAGE, &diag_off); + +#ifndef SAMPLE_HTTP + // Example sdk status tracing for troubleshooting + bool traceOn = true; + IoTHubDeviceClient_LL_SetOption(device_ll_handle, OPTION_LOG_TRACE, &traceOn); +#endif // SAMPLE_HTTP + + // Setting the Trusted Certificate. + IoTHubDeviceClient_LL_SetOption(device_ll_handle, OPTION_TRUSTED_CERT, certificates); + +#if defined SAMPLE_MQTT + //Setting the auto URL Encoder (recommended for MQTT). Please use this option unless + //you are URL Encoding inputs yourself. + //ONLY valid for use with MQTT + bool urlEncodeOn = true; + IoTHubDeviceClient_LL_SetOption(device_ll_handle, OPTION_AUTO_URL_ENCODE_DECODE, &urlEncodeOn); + /* Setting Message call back, so we can receive Commands. */ + if (IoTHubClient_LL_SetMessageCallback(device_ll_handle, receive_message_callback, &receiveContext) != IOTHUB_CLIENT_OK) + { + LogInfo("ERROR: IoTHubClient_LL_SetMessageCallback..........FAILED!\r\n"); + Serial.println("Error IoTHubClient_LL_SetMessageCallback "); + } + else + { + Serial.println("PASS IoTHubClient_LL_SetMessageCallback "); + } +#endif // SAMPLE_MQTT + + // Setting connection status callback to get indication of connection to iothub + (void)IoTHubDeviceClient_LL_SetConnectionStatusCallback(device_ll_handle, connection_status_callback, NULL); + + } +} + +void loop(void) +{ + + if (g_run_demo) + { + Serial.println("running demo"); + run_demo(); + g_run_demo = false; + } +// reset_esp_helper(); +// reset_arduino_helper(); +} diff --git a/examples/ArduinoNano33iot/iothub_ll_telemetry_sample/platform.local.txt b/examples/ArduinoNano33iot/iothub_ll_telemetry_sample/platform.local.txt new file mode 100644 index 0000000..87bccfa --- /dev/null +++ b/examples/ArduinoNano33iot/iothub_ll_telemetry_sample/platform.local.txt @@ -0,0 +1,103 @@ +name=Nano33IoT Arduino +version=1.0.0 + + + +tools.esptool_py.path={runtime.tools.esptool_py.path} +tools.esptool_py.cmd=esptool +tools.esptool_py.cmd.linux=esptool.py +tools.esptool_py.cmd.windows=esptool.exe + +tools.esptool_py.network_cmd=python "{runtime.platform.path}/tools/espota.py" +tools.esptool_py.network_cmd.windows="{runtime.platform.path}/tools/espota.exe" + +tools.gen_esp32part.cmd=python "{runtime.platform.path}/tools/gen_esp32part.py" +tools.gen_esp32part.cmd.windows="{runtime.platform.path}/tools/gen_esp32part.exe" + +compiler.warning_flags=-w +compiler.warning_flags.none=-w +compiler.warning_flags.default= +compiler.warning_flags.more=-Wall -Werror=all +compiler.warning_flags.all=-Wall -Werror=all -Wextra + +compiler.path={runtime.tools.xtensa-esp32-elf-gcc.path}/bin/ +compiler.sdk.path={runtime.platform.path}/tools/sdk +compiler.cpreprocessor.flags=-DESP_PLATFORM -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DHAVE_CONFIG_H "-I{compiler.sdk.path}/include/config" "-I{compiler.sdk.path}/include/app_trace" "-I{compiler.sdk.path}/include/app_update" "-I{compiler.sdk.path}/include/asio" "-I{compiler.sdk.path}/include/bootloader_support" "-I{compiler.sdk.path}/include/bt" "-I{compiler.sdk.path}/include/coap" "-I{compiler.sdk.path}/include/console" "-I{compiler.sdk.path}/include/driver" "-I{compiler.sdk.path}/include/esp-tls" "-I{compiler.sdk.path}/include/esp32" "-I{compiler.sdk.path}/include/esp_adc_cal" "-I{compiler.sdk.path}/include/esp_event" "-I{compiler.sdk.path}/include/esp_http_client" "-I{compiler.sdk.path}/include/esp_http_server" "-I{compiler.sdk.path}/include/esp_https_ota" "-I{compiler.sdk.path}/include/esp_ringbuf" "-I{compiler.sdk.path}/include/ethernet" "-I{compiler.sdk.path}/include/expat" "-I{compiler.sdk.path}/include/fatfs" "-I{compiler.sdk.path}/include/freemodbus" "-I{compiler.sdk.path}/include/freertos" "-I{compiler.sdk.path}/include/heap" "-I{compiler.sdk.path}/include/idf_test" "-I{compiler.sdk.path}/include/jsmn" "-I{compiler.sdk.path}/include/json" "-I{compiler.sdk.path}/include/libsodium" "-I{compiler.sdk.path}/include/log" "-I{compiler.sdk.path}/include/lwip" "-I{compiler.sdk.path}/include/mbedtls" "-I{compiler.sdk.path}/include/mdns" "-I{compiler.sdk.path}/include/micro-ecc" "-I{compiler.sdk.path}/include/mqtt" "-I{compiler.sdk.path}/include/newlib" "-I{compiler.sdk.path}/include/nghttp" "-I{compiler.sdk.path}/include/nvs_flash" "-I{compiler.sdk.path}/include/openssl" "-I{compiler.sdk.path}/include/protobuf-c" "-I{compiler.sdk.path}/include/protocomm" "-I{compiler.sdk.path}/include/pthread" "-I{compiler.sdk.path}/include/sdmmc" "-I{compiler.sdk.path}/include/smartconfig_ack" "-I{compiler.sdk.path}/include/soc" "-I{compiler.sdk.path}/include/spi_flash" "-I{compiler.sdk.path}/include/spiffs" "-I{compiler.sdk.path}/include/tcp_transport" "-I{compiler.sdk.path}/include/tcpip_adapter" "-I{compiler.sdk.path}/include/ulp" "-I{compiler.sdk.path}/include/vfs" "-I{compiler.sdk.path}/include/wear_levelling" "-I{compiler.sdk.path}/include/wifi_provisioning" "-I{compiler.sdk.path}/include/wpa_supplicant" "-I{compiler.sdk.path}/include/xtensa-debug-module" "-I{compiler.sdk.path}/include/esp32-camera" "-I{compiler.sdk.path}/include/esp-face" "-I{compiler.sdk.path}/include/fb_gfx" + +compiler.c.cmd=xtensa-esp32-elf-gcc +compiler.c.flags=-std=gnu99 -Os -g3 -fstack-protector -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wpointer-arith {compiler.warning_flags} -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -Wno-old-style-declaration -MMD -c + +compiler.cpp.cmd=xtensa-esp32-elf-g++ +compiler.cpp.flags=-std=gnu++11 -fno-exceptions -Os -g3 -Wpointer-arith -fexceptions -fstack-protector -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib {compiler.warning_flags} -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -fno-rtti -MMD -c + +compiler.S.cmd=xtensa-esp32-elf-gcc +compiler.S.flags=-c -g3 -x assembler-with-cpp -MMD -mlongcalls + +compiler.c.elf.cmd=xtensa-esp32-elf-gcc +compiler.c.elf.flags=-nostdlib "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" -T esp32_out.ld -T esp32.common.ld -T esp32.rom.ld -T esp32.peripherals.ld -T esp32.rom.spiram_incompatible_fns.ld -u ld_include_panic_highint_hdl -u call_user_start_cpu0 -Wl,--gc-sections -Wl,-static -Wl,--undefined=uxTopUsedPriority -u __cxa_guard_dummy -u __cxx_fatal_exception +compiler.c.elf.libs=-lgcc -lopenssl -lbtdm_app -lfatfs -lwps -lcoexist -lwear_levelling -lesp_http_client -lprotobuf-c -lhal -lnewlib -ldriver -lbootloader_support -lpp -lfreemodbus -lmesh -lsmartconfig -ljsmn -lwpa -lethernet -lphy -lfrmn -lapp_trace -lfr_coefficients -lconsole -lulp -lwpa_supplicant -lfreertos -lbt -lmicro-ecc -lesp32-camera -lcxx -lxtensa-debug-module -ltcp_transport -lmdns -lvfs -lmtmn -lesp_ringbuf -lsoc -lcore -lfb_gfx -lsdmmc -llibsodium -lcoap -ltcpip_adapter -lprotocomm -lesp_event -limage_util -lc_nano -lesp-tls -lasio -lrtc -lspi_flash -lwpa2 -lwifi_provisioning -lesp32 -lface_recognition -lapp_update -lnghttp -lspiffs -lface_detection -lespnow -lnvs_flash -lesp_adc_cal -llog -ldl_lib -lsmartconfig_ack -lexpat -lfd_coefficients -lm -lmqtt -lc -lheap -lmbedtls -llwip -lnet80211 -lesp_http_server -lpthread -ljson -lesp_https_ota -lstdc++ + +compiler.as.cmd=xtensa-esp32-elf-as + +compiler.ar.cmd=xtensa-esp32-elf-ar +compiler.ar.flags=cru + +compiler.size.cmd=xtensa-esp32-elf-size + +# This can be overriden in boards.txt +build.flash_size=4MB +build.flash_mode=dio +build.boot=bootloader +build.code_debug=0 +build.defines= +build.extra_flags=-DESP32 -DDONT_USE_UPLOADTOBLOB -DUSE_BALTIMORE_CERT -DUSE_MBEDTLS +#-DCORE_DEBUG_LEVEL={build.code_debug} {build.defines} + +# These can be overridden in platform.local.txt +compiler.c.extra_flags= +compiler.c.elf.extra_flags= +compiler.S.extra_flags= +compiler.cpp.extra_flags= +compiler.ar.extra_flags= +compiler.objcopy.eep.extra_flags= +compiler.elf2hex.extra_flags= + +## Compile c files +recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.flags} {compiler.c.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" -DARDUINO_VARIANT="{build.variant}" {compiler.c.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" + +## Compile c++ files +recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpreprocessor.flags} {compiler.cpp.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" -DARDUINO_VARIANT="{build.variant}" {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" + +## Compile S files +recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.flags} {compiler.S.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" -DARDUINO_VARIANT="{build.variant}" {compiler.S.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" + +## Create archives +recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}" + +## Combine gc-sections, archives, and objects +recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} -Wl,--start-group {object_files} "{archive_file_path}" {compiler.c.elf.libs} -Wl,--end-group -Wl,-EL -o "{build.path}/{build.project_name}.elf" + +## Create eeprom +recipe.objcopy.eep.pattern={tools.gen_esp32part.cmd} -q "{runtime.platform.path}/tools/partitions/{build.partitions}.csv" "{build.path}/{build.project_name}.partitions.bin" + +## Create hex +recipe.objcopy.hex.pattern="{tools.esptool_py.path}/{tools.esptool_py.cmd}" --chip esp32 elf2image --flash_mode "{build.flash_mode}" --flash_freq "{build.flash_freq}" --flash_size "{build.flash_size}" -o "{build.path}/{build.project_name}.bin" "{build.path}/{build.project_name}.elf" +recipe.objcopy.hex.pattern.linux=python "{tools.esptool_py.path}/{tools.esptool_py.cmd}" --chip esp32 elf2image --flash_mode "{build.flash_mode}" --flash_freq "{build.flash_freq}" --flash_size "{build.flash_size}" -o "{build.path}/{build.project_name}.bin" "{build.path}/{build.project_name}.elf" + +## Save hex +recipe.output.tmp_file={build.project_name}.bin +recipe.output.save_file={build.project_name}.{build.variant}.bin + +## Compute size +recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf" +recipe.size.regex=^(?:\.iram0\.text|\.iram0\.vectors|\.dram0\.data|\.flash\.text|\.flash\.rodata|)\s+([0-9]+).* +recipe.size.regex.data=^(?:\.dram0\.data|\.dram0\.bss|\.noinit)\s+([0-9]+).* + +# ------------------------------ + +tools.esptool_py.upload.protocol=esp32 +tools.esptool_py.upload.params.verbose= +tools.esptool_py.upload.params.quiet= +tools.esptool_py.upload.pattern="{path}/{cmd}" --chip esp32 --port "{serial.port}" --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode {build.flash_mode} --flash_freq {build.flash_freq} --flash_size detect 0xe000 "{runtime.platform.path}/tools/partitions/boot_app0.bin" 0x1000 "{runtime.platform.path}/tools/sdk/bin/bootloader_{build.boot}_{build.flash_freq}.bin" 0x10000 "{build.path}/{build.project_name}.bin" 0x8000 "{build.path}/{build.project_name}.partitions.bin" +tools.esptool_py.upload.pattern.linux=python "{path}/{cmd}" --chip esp32 --port "{serial.port}" --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode {build.flash_mode} --flash_freq {build.flash_freq} --flash_size detect 0xe000 "{runtime.platform.path}/tools/partitions/boot_app0.bin" 0x1000 "{runtime.platform.path}/tools/sdk/bin/bootloader_{build.boot}_{build.flash_freq}.bin" 0x10000 "{build.path}/{build.project_name}.bin" 0x8000 "{build.path}/{build.project_name}.partitions.bin" +tools.esptool_py.upload.network_pattern={network_cmd} -i "{serial.port}" -p "{network.port}" "--auth={network.password}" -f "{build.path}/{build.project_name}.bin" diff --git a/examples/ArduinoNano33iot/iothub_ll_telemetry_sample/sample_init.h b/examples/ArduinoNano33iot/iothub_ll_telemetry_sample/sample_init.h new file mode 100644 index 0000000..5400379 --- /dev/null +++ b/examples/ArduinoNano33iot/iothub_ll_telemetry_sample/sample_init.h @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +#ifndef SAMPLE_INIT_H +#define SAMPLE_INIT_H +#if defined(ARDUINO_ARCH_ESP8266) + #define sample_init esp8266_sample_init + #define is_esp_board + void esp8266_sample_init(const char* ssid, const char* password); +#endif // ARDUINO_ARCH_ESP8266 +#if defined(ARDUINO_ARCH_ESP32) + #define sample_init esp32_sample_init + #define is_esp_board + void esp32_sample_init(const char* ssid, const char* password); +#endif // ARDUINO_ARCH_ESP32 +#if defined(ARDUINO_ARCH_SAMD) + #define sample_init m0_sample_init + #define is_arduino_board + void m0_sample_init(const char* ssid, const char* password); +#endif +#endif // SAMPLE_INIT_H From 47371d82626d43b39bd9e72240af7413158cc2db Mon Sep 17 00:00:00 2001 From: Khawaja-Usman-Riaz-Sehgal <70154356+Khawaja-Usman-Riaz-Sehgal@users.noreply.github.com> Date: Thu, 6 May 2021 15:28:02 +0500 Subject: [PATCH 02/44] Added support for Arduino Nano 33 Iot --- README.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/README.md b/README.md index 1db40ac..9b19be5 100644 --- a/README.md +++ b/README.md @@ -128,6 +128,40 @@ You should have the following ready before beginning with any board: 9. Access the [Huzzah Get Started](https://azure.microsoft.com/en-us/documentation/samples/iot-hub-c-huzzah-getstartedkit/) tutorial to learn more about Microsoft Huzzah Dev Kit. + +## ARDUINO NANO 33 IOT + +##### ARDUINO NANO 33 IOT board + +1. Install Arduino Nano33 IoT board support into your Arduino IDE. + + - Open Boards Manager from Tools > Board menu and install arduino nano 33 iot platform 1.8.11 or later + + - Select your Arduino Nano 33 IoT board from Tools > Board menu after installation + +2. Open the `iothub_ll_telemetry_sample` example from the Arduino IDE File->Examples->AzureIoTHub menu. + +3. Update Wifi SSID/Password in `iot_configs.h` + +- Ensure you are using a wifi network that does not require additional manual steps after connection, such as opening a web browser. + +4. Update IoT Hub Connection string in `iot_configs.h` + +5. Configure board library using the automation script and `python3`. If you choose this method you can skip step 6. + - Clone or download this repo: `git clone https://github.com/Azure/azure-iot-pal-arduino.git` , navigate to the downloaded sub-folder: `cd azure-iot-pal-arduino/build_all/base-libraries/AzureIoTHub/src/scripts` , and check that the script `automate_board_config.py` exists in this location. If this folder or script cannot be located, download the script [directly](https://raw.githubusercontent.com/Azure/azure-iot-pal-arduino/master/build_all/base-libraries/AzureIoTHub/src/scripts/automate_board_config.py). + - Run the script E.x.: `python3 automate_board_config.py` and select appropriate options. + - Note: if you update or reinstall your board library in Arduino you will need to run this script again. + +6. Navigate to where your arduino nano 33 iot board package is located, typically in `C:\Users\\AppData\Local\Arduino15\packages` on Windows and `~/.arduino15/packages/` on Linux + + - Navigate deeper in to `hardware/samd//` where the `platform.txt` file lives. + + - Copy the [`platform.local.txt`](https://github.com/Azure/azure-iot-arduino/blob/master/examples/iothub_ll_telemetry_sample/ArduinoNano33iot/platform.local.txt) file from the `ArduinoNano33iot` folder in the sample into the same folder as the `platform.txt`. + + - Alternatively, or for later versions of the Board Package, add the define `-DDONT_USE_UPLOADTOBLOB` to `build.extra_flags=` in `platform.txt` or a `platform.local.txt` that you create. + +7. Run the sample. + ## License See [LICENSE](LICENSE) file. From eac403d4004e0bb553d1080bf0fd80988c37c8a7 Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Tue, 18 May 2021 11:35:56 +0500 Subject: [PATCH 03/44] modified .travis.yml file for nano33iot board --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index a43f083..f019dc5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,7 @@ env: - BOARD="esp8266:esp8266:huzzah:FlashSize=4M3M,CpuFrequency=80" - BOARD="esp8266:esp8266:thing" - BOARD="esp32:esp32:huzzah" + - BOARD="nano33iot:nano33iot" before_install: - /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16 - sleep 3 From e45fb593b6705d40dc9b6823c4041b6c20a3f162 Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Tue, 18 May 2021 11:45:00 +0500 Subject: [PATCH 04/44] modified .travis.yml file for nano33iot board --- .travis.yml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index f019dc5..4c0e930 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,9 +6,6 @@ env: global: - IDE_VERSION=1.8.10 matrix: - - BOARD="esp8266:esp8266:huzzah:FlashSize=4M3M,CpuFrequency=80" - - BOARD="esp8266:esp8266:thing" - - BOARD="esp32:esp32:huzzah" - BOARD="nano33iot:nano33iot" before_install: - /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16 @@ -18,16 +15,6 @@ before_install: - tar xf arduino-$IDE_VERSION-linux64.tar.xz - mv arduino-$IDE_VERSION $HOME/arduino-ide - export PATH=$PATH:$HOME/arduino-ide - - if [[ "$BOARD" =~ "esp8266:esp8266:" ]]; then - arduino --pref "boardsmanager.additional.urls=http://arduino.esp8266.com/stable/package_esp8266com_index.json" --install-boards esp8266:esp8266; - arduino --pref "boardsmanager.additional.urls=" --save-prefs; - arduino --install-library NTPClient; - fi - - if [[ "$BOARD" =~ "esp32:esp32:" ]]; then - arduino --pref "boardsmanager.additional.urls=https://dl.espressif.com/dl/package_esp32_index.json" --install-boards esp32:esp32; - arduino --pref "boardsmanager.additional.urls=" --save-prefs; - arduino --install-library NTPClient; - fi - findAndReplace() { sed -i'' -e"s|$1|$2|g" "$3"; } - buildExampleSketch() { From 17d170d1cb15f2f9b50153f3c1c5a184b6611eae Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Tue, 18 May 2021 11:52:12 +0500 Subject: [PATCH 05/44] modified .travis.yml file for nano33iot board --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4c0e930..14ac577 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ env: global: - IDE_VERSION=1.8.10 matrix: - - BOARD="nano33iot:nano33iot" + - BOARD="arduino:samd:nano33iot" before_install: - /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16 - sleep 3 From 883a153160d4438e3c1c53b5f77aacacd614210e Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Tue, 18 May 2021 11:57:43 +0500 Subject: [PATCH 06/44] modified .travis.yml file for nano33iot board --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 14ac577..896b665 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ env: global: - IDE_VERSION=1.8.10 matrix: - - BOARD="arduino:samd:nano33iot" + - BOARD="arduino:arch:nano33iot" before_install: - /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16 - sleep 3 From bcc91233bd532c23cd0856510f8f2d58feaf163c Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Tue, 18 May 2021 12:00:22 +0500 Subject: [PATCH 07/44] modified .travis.yml file for nano33iot board --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 896b665..4aa9f8d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ env: global: - IDE_VERSION=1.8.10 matrix: - - BOARD="arduino:arch:nano33iot" + - BOARD="arduino:samd:arduino_nano_33_iot" before_install: - /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16 - sleep 3 From d0ee6379a0f56f8406db08f2ac82f518d2aa04d5 Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Wed, 19 May 2021 11:14:57 +0500 Subject: [PATCH 08/44] modified .travis.yml file for nano33iot board --- .travis.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4aa9f8d..deb583f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,9 @@ env: global: - IDE_VERSION=1.8.10 matrix: + - BOARD="esp8266:esp8266:huzzah:FlashSize=4M3M,CpuFrequency=80" + - BOARD="esp8266:esp8266:thing" + - BOARD="esp32:esp32:huzzah" - BOARD="arduino:samd:arduino_nano_33_iot" before_install: - /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16 @@ -15,7 +18,20 @@ before_install: - tar xf arduino-$IDE_VERSION-linux64.tar.xz - mv arduino-$IDE_VERSION $HOME/arduino-ide - export PATH=$PATH:$HOME/arduino-ide - + - if [[ "$BOARD" =~ "esp8266:esp8266:" ]]; then + arduino --pref "boardsmanager.additional.urls=http://arduino.esp8266.com/stable/package_esp8266com_index.json" --install-boards esp8266:esp8266; + arduino --pref "boardsmanager.additional.urls=" --save-prefs; + arduino --install-library NTPClient; + fi + - if [[ "$BOARD" =~ "esp32:esp32:" ]]; then + arduino --pref "boardsmanager.additional.urls=https://dl.espressif.com/dl/package_esp32_index.json" --install-boards esp32:esp32; + arduino --pref "boardsmanager.additional.urls=" --save-prefs; + arduino --install-library NTPClient; + fi + - if [[ "$BOARD" =~ "arduino:samd:" ]]; then + arduino --install-boards arduino:samd; + arduino --install-library WiFiNINA; + fi - findAndReplace() { sed -i'' -e"s|$1|$2|g" "$3"; } - buildExampleSketch() { EXAMPLE_SKETCH=$PWD/examples/iothub_ll_telemetry_sample/iothub_ll_telemetry_sample.ino; From 2e799ddcbf04de7a0b5f93ab5a895c7769356e6e Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Wed, 19 May 2021 11:42:54 +0500 Subject: [PATCH 09/44] modified .travis.yml file for nano33iot board --- .travis.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index deb583f..43d971b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,10 +6,7 @@ env: global: - IDE_VERSION=1.8.10 matrix: - - BOARD="esp8266:esp8266:huzzah:FlashSize=4M3M,CpuFrequency=80" - - BOARD="esp8266:esp8266:thing" - - BOARD="esp32:esp32:huzzah" - - BOARD="arduino:samd:arduino_nano_33_iot" + - BOARD="arduino:samd:nano_33_iot" before_install: - /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16 - sleep 3 From ce5f2f4c2aac731ec834be384b76e56ed03be0cf Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Wed, 19 May 2021 12:33:51 +0500 Subject: [PATCH 10/44] modified .travis.yml file for nano33iot board --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 43d971b..55e75d7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,4 +42,4 @@ install: - arduino --install-library "AzureIoTProtocol_HTTP" - ln -s $PWD $HOME/Arduino/libraries/. script: - - buildExampleSketch telemetry_sample.c + - buildExampleSketch iothub_ll_telemetry_sample.ino From 2538ca1ccdb661593e7476821f76253dfed6d7fd Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Wed, 19 May 2021 12:55:59 +0500 Subject: [PATCH 11/44] modified .travis.yml file for nano33iot board --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 55e75d7..e1229af 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,7 +31,7 @@ before_install: fi - findAndReplace() { sed -i'' -e"s|$1|$2|g" "$3"; } - buildExampleSketch() { - EXAMPLE_SKETCH=$PWD/examples/iothub_ll_telemetry_sample/iothub_ll_telemetry_sample.ino; + EXAMPLE_SKETCH=$PWD/examples/ArduinoNano33iot/iothub_ll_telemetry_sample/iothub_ll_telemetry_sample.ino; arduino --verbose-build --verify --board $BOARD $EXAMPLE_SKETCH; } From 6483a382acdeaeb9077fa3f867325ea2e83e2ad7 Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Thu, 20 May 2021 14:33:53 +0500 Subject: [PATCH 12/44] modified platform.local.txt file for nano33iot board --- .../platform.local.txt | 284 +++++++++++++----- 1 file changed, 212 insertions(+), 72 deletions(-) diff --git a/examples/ArduinoNano33iot/iothub_ll_telemetry_sample/platform.local.txt b/examples/ArduinoNano33iot/iothub_ll_telemetry_sample/platform.local.txt index 87bccfa..a0c81aa 100644 --- a/examples/ArduinoNano33iot/iothub_ll_telemetry_sample/platform.local.txt +++ b/examples/ArduinoNano33iot/iothub_ll_telemetry_sample/platform.local.txt @@ -1,103 +1,243 @@ -name=Nano33IoT Arduino -version=1.0.0 - - - -tools.esptool_py.path={runtime.tools.esptool_py.path} -tools.esptool_py.cmd=esptool -tools.esptool_py.cmd.linux=esptool.py -tools.esptool_py.cmd.windows=esptool.exe - -tools.esptool_py.network_cmd=python "{runtime.platform.path}/tools/espota.py" -tools.esptool_py.network_cmd.windows="{runtime.platform.path}/tools/espota.exe" - -tools.gen_esp32part.cmd=python "{runtime.platform.path}/tools/gen_esp32part.py" -tools.gen_esp32part.cmd.windows="{runtime.platform.path}/tools/gen_esp32part.exe" +# Copyright (c) 2014-2015 Arduino LLC. All right reserved. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# Arduino SAMD Core and platform. +# +# For more info: +# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification + +name=Arduino SAMD (32-bits ARM Cortex-M0+) Boards +version=1.8.11 + +# Compile variables +# ----------------- compiler.warning_flags=-w compiler.warning_flags.none=-w compiler.warning_flags.default= -compiler.warning_flags.more=-Wall -Werror=all -compiler.warning_flags.all=-Wall -Werror=all -Wextra - -compiler.path={runtime.tools.xtensa-esp32-elf-gcc.path}/bin/ -compiler.sdk.path={runtime.platform.path}/tools/sdk -compiler.cpreprocessor.flags=-DESP_PLATFORM -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DHAVE_CONFIG_H "-I{compiler.sdk.path}/include/config" "-I{compiler.sdk.path}/include/app_trace" "-I{compiler.sdk.path}/include/app_update" "-I{compiler.sdk.path}/include/asio" "-I{compiler.sdk.path}/include/bootloader_support" "-I{compiler.sdk.path}/include/bt" "-I{compiler.sdk.path}/include/coap" "-I{compiler.sdk.path}/include/console" "-I{compiler.sdk.path}/include/driver" "-I{compiler.sdk.path}/include/esp-tls" "-I{compiler.sdk.path}/include/esp32" "-I{compiler.sdk.path}/include/esp_adc_cal" "-I{compiler.sdk.path}/include/esp_event" "-I{compiler.sdk.path}/include/esp_http_client" "-I{compiler.sdk.path}/include/esp_http_server" "-I{compiler.sdk.path}/include/esp_https_ota" "-I{compiler.sdk.path}/include/esp_ringbuf" "-I{compiler.sdk.path}/include/ethernet" "-I{compiler.sdk.path}/include/expat" "-I{compiler.sdk.path}/include/fatfs" "-I{compiler.sdk.path}/include/freemodbus" "-I{compiler.sdk.path}/include/freertos" "-I{compiler.sdk.path}/include/heap" "-I{compiler.sdk.path}/include/idf_test" "-I{compiler.sdk.path}/include/jsmn" "-I{compiler.sdk.path}/include/json" "-I{compiler.sdk.path}/include/libsodium" "-I{compiler.sdk.path}/include/log" "-I{compiler.sdk.path}/include/lwip" "-I{compiler.sdk.path}/include/mbedtls" "-I{compiler.sdk.path}/include/mdns" "-I{compiler.sdk.path}/include/micro-ecc" "-I{compiler.sdk.path}/include/mqtt" "-I{compiler.sdk.path}/include/newlib" "-I{compiler.sdk.path}/include/nghttp" "-I{compiler.sdk.path}/include/nvs_flash" "-I{compiler.sdk.path}/include/openssl" "-I{compiler.sdk.path}/include/protobuf-c" "-I{compiler.sdk.path}/include/protocomm" "-I{compiler.sdk.path}/include/pthread" "-I{compiler.sdk.path}/include/sdmmc" "-I{compiler.sdk.path}/include/smartconfig_ack" "-I{compiler.sdk.path}/include/soc" "-I{compiler.sdk.path}/include/spi_flash" "-I{compiler.sdk.path}/include/spiffs" "-I{compiler.sdk.path}/include/tcp_transport" "-I{compiler.sdk.path}/include/tcpip_adapter" "-I{compiler.sdk.path}/include/ulp" "-I{compiler.sdk.path}/include/vfs" "-I{compiler.sdk.path}/include/wear_levelling" "-I{compiler.sdk.path}/include/wifi_provisioning" "-I{compiler.sdk.path}/include/wpa_supplicant" "-I{compiler.sdk.path}/include/xtensa-debug-module" "-I{compiler.sdk.path}/include/esp32-camera" "-I{compiler.sdk.path}/include/esp-face" "-I{compiler.sdk.path}/include/fb_gfx" - -compiler.c.cmd=xtensa-esp32-elf-gcc -compiler.c.flags=-std=gnu99 -Os -g3 -fstack-protector -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wpointer-arith {compiler.warning_flags} -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -Wno-old-style-declaration -MMD -c - -compiler.cpp.cmd=xtensa-esp32-elf-g++ -compiler.cpp.flags=-std=gnu++11 -fno-exceptions -Os -g3 -Wpointer-arith -fexceptions -fstack-protector -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib {compiler.warning_flags} -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -fno-rtti -MMD -c - -compiler.S.cmd=xtensa-esp32-elf-gcc -compiler.S.flags=-c -g3 -x assembler-with-cpp -MMD -mlongcalls - -compiler.c.elf.cmd=xtensa-esp32-elf-gcc -compiler.c.elf.flags=-nostdlib "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" -T esp32_out.ld -T esp32.common.ld -T esp32.rom.ld -T esp32.peripherals.ld -T esp32.rom.spiram_incompatible_fns.ld -u ld_include_panic_highint_hdl -u call_user_start_cpu0 -Wl,--gc-sections -Wl,-static -Wl,--undefined=uxTopUsedPriority -u __cxa_guard_dummy -u __cxx_fatal_exception -compiler.c.elf.libs=-lgcc -lopenssl -lbtdm_app -lfatfs -lwps -lcoexist -lwear_levelling -lesp_http_client -lprotobuf-c -lhal -lnewlib -ldriver -lbootloader_support -lpp -lfreemodbus -lmesh -lsmartconfig -ljsmn -lwpa -lethernet -lphy -lfrmn -lapp_trace -lfr_coefficients -lconsole -lulp -lwpa_supplicant -lfreertos -lbt -lmicro-ecc -lesp32-camera -lcxx -lxtensa-debug-module -ltcp_transport -lmdns -lvfs -lmtmn -lesp_ringbuf -lsoc -lcore -lfb_gfx -lsdmmc -llibsodium -lcoap -ltcpip_adapter -lprotocomm -lesp_event -limage_util -lc_nano -lesp-tls -lasio -lrtc -lspi_flash -lwpa2 -lwifi_provisioning -lesp32 -lface_recognition -lapp_update -lnghttp -lspiffs -lface_detection -lespnow -lnvs_flash -lesp_adc_cal -llog -ldl_lib -lsmartconfig_ack -lexpat -lfd_coefficients -lm -lmqtt -lc -lheap -lmbedtls -llwip -lnet80211 -lesp_http_server -lpthread -ljson -lesp_https_ota -lstdc++ - -compiler.as.cmd=xtensa-esp32-elf-as - -compiler.ar.cmd=xtensa-esp32-elf-ar -compiler.ar.flags=cru - -compiler.size.cmd=xtensa-esp32-elf-size - -# This can be overriden in boards.txt -build.flash_size=4MB -build.flash_mode=dio -build.boot=bootloader -build.code_debug=0 -build.defines= -build.extra_flags=-DESP32 -DDONT_USE_UPLOADTOBLOB -DUSE_BALTIMORE_CERT -DUSE_MBEDTLS -#-DCORE_DEBUG_LEVEL={build.code_debug} {build.defines} +compiler.warning_flags.more=-Wall +compiler.warning_flags.all=-Wall -Wextra + +# EXPERIMENTAL feature: optimization flags +# - this is alpha and may be subject to change without notice +compiler.optimization_flags=-Os +compiler.optimization_flags.release=-Os +compiler.optimization_flags.debug=-Og -g3 + +compiler.path={runtime.tools.arm-none-eabi-gcc-7-2017q4.path}/bin/ +compiler.c.cmd=arm-none-eabi-gcc +compiler.c.flags=-mcpu={build.mcu} -mthumb -c -g {compiler.optimization_flags} {compiler.warning_flags} -std=gnu11 -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -MMD +compiler.c.elf.cmd=arm-none-eabi-g++ +compiler.c.elf.flags={compiler.optimization_flags} -Wl,--gc-sections -save-temps +compiler.S.cmd=arm-none-eabi-gcc +compiler.S.flags=-c -g -x assembler-with-cpp -MMD +compiler.cpp.cmd=arm-none-eabi-g++ +compiler.cpp.flags=-mcpu={build.mcu} -mthumb -c -g {compiler.optimization_flags} {compiler.warning_flags} -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD +compiler.ar.cmd=arm-none-eabi-ar +compiler.ar.flags=rcs +compiler.objcopy.cmd=arm-none-eabi-objcopy +compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 +compiler.elf2hex.bin.flags=-O binary +compiler.elf2hex.hex.flags=-O ihex -R .eeprom +compiler.elf2hex.cmd=arm-none-eabi-objcopy +compiler.ldflags=-mcpu={build.mcu} -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align +compiler.size.cmd=arm-none-eabi-size +compiler.define=-DARDUINO= +compiler.readelf.cmd=arm-none-eabi-readelf + +# this can be overriden in boards.txt +build.extra_flags= "-DDONT_USE_UPLOADTOBLOB" # These can be overridden in platform.local.txt compiler.c.extra_flags= compiler.c.elf.extra_flags= -compiler.S.extra_flags= +#compiler.c.elf.extra_flags=-v compiler.cpp.extra_flags= +compiler.S.extra_flags= compiler.ar.extra_flags= -compiler.objcopy.eep.extra_flags= compiler.elf2hex.extra_flags= +compiler.arm.cmsis.c.flags="-I{runtime.tools.CMSIS-4.5.0.path}/CMSIS/Include/" "-I{runtime.tools.CMSIS-Atmel-1.2.0.path}/CMSIS/Device/ATMEL/" +compiler.arm.cmsis.ldflags="-L{runtime.tools.CMSIS-4.5.0.path}/CMSIS/Lib/GCC/" -larm_cortexM0l_math + +compiler.libraries.ldflags= + +# USB Flags +# --------- +build.usb_flags=-DUSB_VID={build.vid} -DUSB_PID={build.pid} -DUSBCON '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}' + +# Default usb manufacturer will be replaced at compile time using +# numeric vendor ID if available or by board's specific value. +build.usb_manufacturer="Unknown" + +# Compile patterns +# ---------------- + ## Compile c files -recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.flags} {compiler.c.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" -DARDUINO_VARIANT="{build.variant}" {compiler.c.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" +recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {compiler.arm.cmsis.c.flags} "-I{build.core.path}/api/deprecated" "-I{build.core.path}/api/deprecated-avr-comp" {includes} "{source_file}" -o "{object_file}" ## Compile c++ files -recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpreprocessor.flags} {compiler.cpp.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" -DARDUINO_VARIANT="{build.variant}" {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" +recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {compiler.arm.cmsis.c.flags} "-I{build.core.path}/api/deprecated" "-I{build.core.path}/api/deprecated-avr-comp" {includes} "{source_file}" -o "{object_file}" ## Compile S files -recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.flags} {compiler.S.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" -DARDUINO_VARIANT="{build.variant}" {compiler.S.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" +recipe.S.o.pattern="{compiler.path}{compiler.S.cmd}" {compiler.S.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.S.extra_flags} {build.extra_flags} {compiler.arm.cmsis.c.flags} "-I{build.core.path}/api/deprecated" "-I{build.core.path}/api/deprecated-avr-comp" {includes} "{source_file}" -o "{object_file}" ## Create archives +# archive_file_path is needed for backwards compatibility with IDE 1.6.5 or older, IDE 1.6.6 or newer overrides this value +archive_file_path={build.path}/{archive_file} recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}" ## Combine gc-sections, archives, and objects -recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} -Wl,--start-group {object_files} "{archive_file_path}" {compiler.c.elf.libs} -Wl,--end-group -Wl,-EL -o "{build.path}/{build.project_name}.elf" +recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" "-L{build.path}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" --specs=nano.specs --specs=nosys.specs {compiler.ldflags} -o "{build.path}/{build.project_name}.elf" {object_files} {compiler.libraries.ldflags} -Wl,--start-group {compiler.arm.cmsis.ldflags} -lm "{build.path}/{archive_file}" -Wl,--end-group + +## Create output (bin file) +recipe.objcopy.bin.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.bin.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.bin" -## Create eeprom -recipe.objcopy.eep.pattern={tools.gen_esp32part.cmd} -q "{runtime.platform.path}/tools/partitions/{build.partitions}.csv" "{build.path}/{build.project_name}.partitions.bin" +## Create output (hex file) +recipe.objcopy.hex.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.hex" -## Create hex -recipe.objcopy.hex.pattern="{tools.esptool_py.path}/{tools.esptool_py.cmd}" --chip esp32 elf2image --flash_mode "{build.flash_mode}" --flash_freq "{build.flash_freq}" --flash_size "{build.flash_size}" -o "{build.path}/{build.project_name}.bin" "{build.path}/{build.project_name}.elf" -recipe.objcopy.hex.pattern.linux=python "{tools.esptool_py.path}/{tools.esptool_py.cmd}" --chip esp32 elf2image --flash_mode "{build.flash_mode}" --flash_freq "{build.flash_freq}" --flash_size "{build.flash_size}" -o "{build.path}/{build.project_name}.bin" "{build.path}/{build.project_name}.elf" +build.preferred_out_format=bin ## Save hex -recipe.output.tmp_file={build.project_name}.bin -recipe.output.save_file={build.project_name}.{build.variant}.bin +recipe.output.tmp_file={build.project_name}.{build.preferred_out_format} +recipe.output.save_file={build.project_name}.{build.variant}.{build.preferred_out_format} ## Compute size recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf" -recipe.size.regex=^(?:\.iram0\.text|\.iram0\.vectors|\.dram0\.data|\.flash\.text|\.flash\.rodata|)\s+([0-9]+).* -recipe.size.regex.data=^(?:\.dram0\.data|\.dram0\.bss|\.noinit)\s+([0-9]+).* +recipe.size.regex=^(?:\.text|\.data|)\s+([0-9]+).* +recipe.size.regex.data=^(?:\.data|\.bss)\s+([0-9]+).* + + +# Debugger configuration (general options) +# ---------------------------------------- +# EXPERIMENTAL feature: +# - this is alpha and may be subject to change without notice +debug.executable={build.path}/{build.project_name}.elf +debug.toolchain=gcc +debug.toolchain.path={runtime.tools.arm-none-eabi-gcc-7-2017q4.path}/bin/ +debug.toolchain.prefix=arm-none-eabi- +debug.server=openocd +debug.server.openocd.path={runtime.tools.openocd-0.10.0-arduino7.path}/bin/openocd +debug.server.openocd.scripts_dir={runtime.tools.openocd-0.10.0-arduino7.path}/share/openocd/scripts/ +debug.server.openocd.script={runtime.platform.path}/variants/{build.variant}/{build.openocdscript} + +# Upload/Debug tools +# ------------------ + +# +# AVRDUDE +# +tools.avrdude.path={runtime.tools.avrdude.path} +tools.avrdude.cmd={path}/bin/avrdude +tools.avrdude.config.path={path}/etc/avrdude.conf + +tools.avrdude.upload.params.verbose=-v -v +tools.avrdude.upload.params.quiet=-q -q +tools.avrdude.upload.params.noverify=-V +tools.avrdude.upload.pattern="{cmd}" "-C{config.path}" {upload.verbose} -p{build.emu.mcu} -c{upload.protocol} -P{serial.port} -b{upload.speed} "-Uflash:w:{build.path}/{build.project_name}.hex:i" + +tools.avrdude_remote.upload.pattern="openocd --version 2>&1 | grep 2016 && if opkg update; then opkg upgrade openocd; exit 1; else echo 'Please connect your board to the Internet in order to upgrade tools' >&2; exit 1; fi || /usr/bin/run-avrdude /tmp/sketch.hex" + +tools.avrdude.network_cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA +tools.avrdude.upload.network_pattern="{network_cmd}" -address {serial.port} -port 65280 -username arduino -password "{network.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b + +# +# BOSSA +# +tools.bossac.path={runtime.tools.bossac-1.7.0-arduino3.path} +tools.bossac.cmd=bossac +tools.bossac.cmd.windows=bossac.exe + +tools.bossac.upload.params.verbose=-i -d +tools.bossac.upload.params.quiet= +tools.bossac.upload.pattern="{path}/{cmd}" {upload.verbose} --port={serial.port.file} -U {upload.native_usb} -i -e -w -v "{build.path}/{build.project_name}.bin" -R + +tools.bossac_remote.upload.pattern=/usr/bin/run-bossac {upload.verbose} --port=ttyATH0 -U {upload.native_usb} -e -w -v /tmp/sketch.bin -R + +arduinoota.extraflags= +tools.bossac.network_cmd={runtime.tools.arduinoOTA-1.3.0.path}/bin/arduinoOTA +tools.bossac.upload.network_pattern="{network_cmd}" -address {serial.port} -port 65280 -username arduino -password "{network.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b {arduinoota.extraflags} + +# +# BOSSA (ignore binary size) +# +tools.bossacI.path={runtime.tools.bossac-1.7.0-arduino3.path} +tools.bossacI.cmd=bossac +tools.bossacI.cmd.windows=bossac.exe + +tools.bossacI.upload.params.verbose=-i -d +tools.bossacI.upload.params.quiet= +tools.bossacI.upload.pattern="{path}/{cmd}" {upload.verbose} --port={serial.port.file} -I -U {upload.native_usb} -i -e -w "{build.path}/{build.project_name}.bin" -R + +tools.bossacI_remote.upload.pattern=/usr/bin/run-bossac {upload.verbose} --port=ttyATH0 -U {upload.native_usb} -e -w -v /tmp/sketch.bin -R + +tools.bossacI.network_cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA +tools.bossacI.upload.network_pattern="{network_cmd}" -address {serial.port} -port 65280 -username arduino -password "{network.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b + + +# +# OpenOCD sketch upload +# + +tools.openocd.path={runtime.tools.openocd-0.10.0-arduino7.path} +tools.openocd.cmd=bin/openocd +tools.openocd.cmd.windows=bin/openocd.exe + +tools.openocd.upload.params.verbose=-d2 +tools.openocd.upload.params.quiet=-d0 +tools.openocd.upload.pattern="{path}/{cmd}" {upload.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "telnet_port disabled; program {{build.path}/{build.project_name}.bin} verify reset 0x2000; shutdown" + +tools.openocd.network_cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA +tools.openocd.upload.network_pattern={network_cmd} -address {serial.port} -port 65280 -username arduino -password "{network.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b + +tools.openocd.program.params.verbose=-d2 +tools.openocd.program.params.quiet=-d0 +tools.openocd.program.pattern="{path}/{cmd}" {program.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "telnet_port disabled; program {{build.path}/{build.project_name}.hex} verify reset; shutdown" + +tools.openocd.erase.params.verbose=-d3 +tools.openocd.erase.params.quiet=-d0 +tools.openocd.erase.pattern= + +tools.openocd.bootloader.params.verbose=-d2 +tools.openocd.bootloader.params.quiet=-d0 +tools.openocd.bootloader.pattern="{path}/{cmd}" {bootloader.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "telnet_port disabled; init; halt; at91samd bootloader 0; program {{runtime.platform.path}/bootloaders/{bootloader.file}} verify reset; shutdown" + +# +# OpenOCD sketch upload - version with configurable bootloader size +# FIXME: this programmer is a workaround for default options being overwritten by uploadUsingPreferences +# + +tools.openocd-withbootsize.path={runtime.tools.openocd-0.10.0-arduino7.path} +tools.openocd-withbootsize.cmd=bin/openocd +tools.openocd-withbootsize.cmd.windows=bin/openocd.exe + +tools.openocd-withbootsize.upload.params.verbose=-d2 +tools.openocd-withbootsize.upload.params.quiet=-d0 +tools.openocd-withbootsize.upload.pattern="{path}/{cmd}" {upload.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "telnet_port disabled; program {{build.path}/{build.project_name}.bin} verify reset {bootloader.size}; shutdown" + +# Program flashes the binary at 0x0000, so use the linker script without_bootloader +tools.openocd-withbootsize.program.params.verbose=-d2 +tools.openocd-withbootsize.program.params.quiet=-d0 +tools.openocd-withbootsize.program.pattern="{path}/{cmd}" {program.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "telnet_port disabled; program {{build.path}/{build.project_name}.elf} verify reset; shutdown" + +tools.openocd-withbootsize.erase.params.verbose=-d3 +tools.openocd-withbootsize.erase.params.quiet=-d0 +tools.openocd-withbootsize.erase.pattern= -# ------------------------------ +tools.openocd-withbootsize.bootloader.params.verbose=-d2 +tools.openocd-withbootsize.bootloader.params.quiet=-d0 +tools.openocd-withbootsize.bootloader.pattern="{path}/{cmd}" {bootloader.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "telnet_port disabled; init; halt; at91samd bootloader 0; program {{runtime.platform.path}/bootloaders/{bootloader.file}} verify reset; shutdown" -tools.esptool_py.upload.protocol=esp32 -tools.esptool_py.upload.params.verbose= -tools.esptool_py.upload.params.quiet= -tools.esptool_py.upload.pattern="{path}/{cmd}" --chip esp32 --port "{serial.port}" --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode {build.flash_mode} --flash_freq {build.flash_freq} --flash_size detect 0xe000 "{runtime.platform.path}/tools/partitions/boot_app0.bin" 0x1000 "{runtime.platform.path}/tools/sdk/bin/bootloader_{build.boot}_{build.flash_freq}.bin" 0x10000 "{build.path}/{build.project_name}.bin" 0x8000 "{build.path}/{build.project_name}.partitions.bin" -tools.esptool_py.upload.pattern.linux=python "{path}/{cmd}" --chip esp32 --port "{serial.port}" --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode {build.flash_mode} --flash_freq {build.flash_freq} --flash_size detect 0xe000 "{runtime.platform.path}/tools/partitions/boot_app0.bin" 0x1000 "{runtime.platform.path}/tools/sdk/bin/bootloader_{build.boot}_{build.flash_freq}.bin" 0x10000 "{build.path}/{build.project_name}.bin" 0x8000 "{build.path}/{build.project_name}.partitions.bin" -tools.esptool_py.upload.network_pattern={network_cmd} -i "{serial.port}" -p "{network.port}" "--auth={network.password}" -f "{build.path}/{build.project_name}.bin" From 6e27d3115ab26602f30f0fb377fafe611e8260bc Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Fri, 21 May 2021 12:20:12 +0500 Subject: [PATCH 13/44] modified .travis.yml file for nano33iot board --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index e1229af..56ad886 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ language: generic env: global: - IDE_VERSION=1.8.10 + - build.extra_flags= "-DDONT_USE_UPLOADTOBLOB" matrix: - BOARD="arduino:samd:nano_33_iot" before_install: From d57a0e5a89e2225b0be70cd71d1a04100e6ca5fa Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Fri, 21 May 2021 12:25:10 +0500 Subject: [PATCH 14/44] modified .travis.yml file for nano33iot board --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 56ad886..1049bc7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,8 @@ language: generic env: global: - IDE_VERSION=1.8.10 - - build.extra_flags= "-DDONT_USE_UPLOADTOBLOB" + flags: + - DDONT_USE_UPLOADTOBLOB matrix: - BOARD="arduino:samd:nano_33_iot" before_install: From b365b6e30fefb883633861578f45059edc31bcd9 Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Mon, 24 May 2021 11:58:12 +0500 Subject: [PATCH 15/44] modified .travis.yml file for nano33iot board --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1049bc7..9fb844f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,4 +44,4 @@ install: - arduino --install-library "AzureIoTProtocol_HTTP" - ln -s $PWD $HOME/Arduino/libraries/. script: - - buildExampleSketch iothub_ll_telemetry_sample.ino + - buildExampleSketch ArduinoNano33iot/iothub_ll_telemetry_sample From 8464d0e1f7af804a3047c959db6119092230ff2a Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Mon, 24 May 2021 12:10:03 +0500 Subject: [PATCH 16/44] modified .travis.yml file for nano33iot board --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9fb844f..1a69160 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,4 +44,4 @@ install: - arduino --install-library "AzureIoTProtocol_HTTP" - ln -s $PWD $HOME/Arduino/libraries/. script: - - buildExampleSketch ArduinoNano33iot/iothub_ll_telemetry_sample + - buildExampleSketch iothub_ll_telemetry_sample From 4c25c3b5e313f8d8fb561e7799f72c90d6891c43 Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Mon, 24 May 2021 12:42:26 +0500 Subject: [PATCH 17/44] modified .travis.yml file for nano33iot board --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1a69160..7d407da 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,8 +5,9 @@ language: generic env: global: - IDE_VERSION=1.8.10 - flags: - - DDONT_USE_UPLOADTOBLOB + branches: + only: + - ArduinoNano33IoT_example_support matrix: - BOARD="arduino:samd:nano_33_iot" before_install: From 7d91c01b7548cca38abe85d01d306fed69b8cf0a Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Tue, 25 May 2021 12:36:25 +0500 Subject: [PATCH 18/44] add platformio.ini --- .pio/build/nano_33_iot/.sconsign38.dblite | Bin 0 -> 4534 bytes .pio/build/nano_33_iot/src/certs/certs.c.o | Bin 0 -> 5072 bytes .pio/build/project.checksum | 1 + .vscode/settings.json | 12 ++++++++++ .vscode/tasks.json | 26 +++++++++++++++++++++ platformio.ini | 5 ++++ 6 files changed, 44 insertions(+) create mode 100644 .pio/build/nano_33_iot/.sconsign38.dblite create mode 100644 .pio/build/nano_33_iot/src/certs/certs.c.o create mode 100644 .pio/build/project.checksum create mode 100644 .vscode/settings.json create mode 100644 .vscode/tasks.json create mode 100644 platformio.ini diff --git a/.pio/build/nano_33_iot/.sconsign38.dblite b/.pio/build/nano_33_iot/.sconsign38.dblite new file mode 100644 index 0000000000000000000000000000000000000000..424b10fabcc17d4ec04d5128f39658bde3299ee6 GIT binary patch literal 4534 zcmd^D&u`pB6i(Z;Nt&i@RG`qR(n516hwRRHJf4{%kebj`1kzSb`5~Ze=Vxr#wO6*c zQY#?}XLG8{KfnbEZu||L;fRFz1A5@zBhQ;`Vi$!Ty0`4EJ)ZT9=i4{m``&x|aQgAj zi&LZ5*X5<+Tze2D9W{)4rW4CJ=@Qb7lDw0px?K6@@YK}9>Bl)V)vFr6D7S2!=l2IT zyPxH@-_~Vua&t9_v-ap5ZN+7=FuuGR=jr|OQTgV#Wi|Pziei_H@3*ff#`H~ds%9`$XO%l@ETS0DX&x0ueN2ew>)^4;O7@LaXp_PLnXu!@V)EC-8* z)7u6MXTsw|6(Vp_V2?_o zk?&mKtSG}bMsUK5>*p^VY9cwUlYU>u#@Gr{Ite($*nnv!oRrM^++&Uh6a@lt;d4!E za5mokt!|cKyDW~3sQA{g5fu?M`%*DH$W+A0XA)70G?9VT9&w%y5L1c^i#)t96*p$0 zy2XoyFS8`J@%G+_FHS`wjPH4b2b%Z_DaSp}6Vh`Mn}9H1?NM>#@UaGx`Tnq%M|o;( zdjdFo6JRD}fT)vNbAvcS%7eGG1|#g(aIoV|9DA-g0US~&LJYS?fkx9DW8fNI}&6qCRS z?W`um3al|fb&WdhH9$Nom=hq0RTQ|Ojpqdlc*3>DLK@CFqkvFAgc$4h#_w|tFsF>n zDwAtHpf;L`??x(k2Y;7JumUWPEzkq?Hc?e?WklkPB&dRe*h^w21<`~%H6uq@OD zfC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d00001 diff --git a/.pio/build/project.checksum b/.pio/build/project.checksum new file mode 100644 index 0000000..4b4c6b8 --- /dev/null +++ b/.pio/build/project.checksum @@ -0,0 +1 @@ +7730d7177f85c99afaf4bec37fc866b3c035c276 \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..6c3cbaa --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,12 @@ +{ + "cSpell.words": [ + "ddont", + "iothub", + "ll", + "samd", + "sample", + "telemetry", + "uploadtoblob", + "use" + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..f97e9e6 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,26 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "type": "shell", + "command": "msbuild", + "args": [ + // Ask msbuild to generate full paths for file names. + "/property:GenerateFullPaths=true", + "/t:build", + // Do not generate summary otherwise it leads to duplicate errors in Problems panel + "/consoleloggerparameters:NoSummary" + ], + "group": "build", + "presentation": { + // Reveal the output only if unrecognized errors occur. + "reveal": "silent" + }, + // Use the standard MS compiler pattern to detect errors, warnings and infos + "problemMatcher": "$msCompile" + } + ] +} \ No newline at end of file diff --git a/platformio.ini b/platformio.ini new file mode 100644 index 0000000..8736860 --- /dev/null +++ b/platformio.ini @@ -0,0 +1,5 @@ +[env:nano_33_iot] +platform = atmelsam +board = nano_33_iot +framework = arduino +build_flags = -DDONT_USE_UPLOADTOBLOB \ No newline at end of file From e8cda102c243ad401e52278bf94578714c44ed99 Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Tue, 25 May 2021 12:43:11 +0500 Subject: [PATCH 19/44] modified .travis.yml file for nano33iot board --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7d407da..4ac053a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,5 +44,5 @@ install: - arduino --install-library "AzureIoTProtocol_MQTT" - arduino --install-library "AzureIoTProtocol_HTTP" - ln -s $PWD $HOME/Arduino/libraries/. -script: - - buildExampleSketch iothub_ll_telemetry_sample +# script: +# - buildExampleSketch iothub_ll_telemetry_sample From d1432e452cc32ecee16ac378f8df344dd2b15473 Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Tue, 25 May 2021 12:50:27 +0500 Subject: [PATCH 20/44] modified .travis.yml file for nano33iot board --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4ac053a..3a5a9ea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,5 +44,5 @@ install: - arduino --install-library "AzureIoTProtocol_MQTT" - arduino --install-library "AzureIoTProtocol_HTTP" - ln -s $PWD $HOME/Arduino/libraries/. -# script: -# - buildExampleSketch iothub_ll_telemetry_sample + script: + - buildExampleSketch() From 0a266aaf128ca2329710dd73f043c95dcae26c43 Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Tue, 25 May 2021 12:51:03 +0500 Subject: [PATCH 21/44] modified .travis.yml file for nano33iot board --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3a5a9ea..6c323cb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -45,4 +45,4 @@ install: - arduino --install-library "AzureIoTProtocol_HTTP" - ln -s $PWD $HOME/Arduino/libraries/. script: - - buildExampleSketch() + - buildExampleSketch() From a8d2ac9557f66fe0e2928391b4e17033c35b04da Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Tue, 25 May 2021 12:54:01 +0500 Subject: [PATCH 22/44] modified .travis.yml file for nano33iot board --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6c323cb..5fffaee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,5 +44,3 @@ install: - arduino --install-library "AzureIoTProtocol_MQTT" - arduino --install-library "AzureIoTProtocol_HTTP" - ln -s $PWD $HOME/Arduino/libraries/. - script: - - buildExampleSketch() From bfc85c03974c90e7a45cb707e4bab0d1517942db Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Tue, 25 May 2021 12:55:14 +0500 Subject: [PATCH 23/44] modified .travis.yml file for nano33iot board --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 5fffaee..4c174a1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,3 +44,5 @@ install: - arduino --install-library "AzureIoTProtocol_MQTT" - arduino --install-library "AzureIoTProtocol_HTTP" - ln -s $PWD $HOME/Arduino/libraries/. +script: + - buildExampleSketch() \ No newline at end of file From eb91d63569e967cddb1c98d914307b95edc7a349 Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Tue, 25 May 2021 13:00:16 +0500 Subject: [PATCH 24/44] modified .travis.yml file for nano33iot board --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4c174a1..1972f31 100644 --- a/.travis.yml +++ b/.travis.yml @@ -45,4 +45,4 @@ install: - arduino --install-library "AzureIoTProtocol_HTTP" - ln -s $PWD $HOME/Arduino/libraries/. script: - - buildExampleSketch() \ No newline at end of file + - buildExampleSketch $EXAMPLE_SKETCH \ No newline at end of file From b66c6379bc79fbc4fd1ecd20d212d9998d55d38c Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Tue, 25 May 2021 13:11:26 +0500 Subject: [PATCH 25/44] modified .travis.yml file for nano33iot board --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1972f31..36db5c1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -45,4 +45,4 @@ install: - arduino --install-library "AzureIoTProtocol_HTTP" - ln -s $PWD $HOME/Arduino/libraries/. script: - - buildExampleSketch $EXAMPLE_SKETCH \ No newline at end of file + - buildExampleSketch \ No newline at end of file From 869e6b49346fd6989b5e7390fa391429804d0091 Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Tue, 25 May 2021 13:38:17 +0500 Subject: [PATCH 26/44] modified .travis.yml file for nano33iot board --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 36db5c1..67c78a8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,9 +40,8 @@ before_install: } install: - arduino --install-library "AzureIoTUtility" - - arduino --install-library "AzureIoTSocket_WiFi" - arduino --install-library "AzureIoTProtocol_MQTT" - arduino --install-library "AzureIoTProtocol_HTTP" - ln -s $PWD $HOME/Arduino/libraries/. script: - - buildExampleSketch \ No newline at end of file + - buildExampleSketch iothub_ll_telemetry_sample From 4f7f4bc3b6522a66d2df0f09763de28c988af3a3 Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Tue, 25 May 2021 14:30:55 +0500 Subject: [PATCH 27/44] modified .travis.yml file for nano33iot board --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 67c78a8..3d72fea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,4 +44,4 @@ install: - arduino --install-library "AzureIoTProtocol_HTTP" - ln -s $PWD $HOME/Arduino/libraries/. script: - - buildExampleSketch iothub_ll_telemetry_sample + - buildExampleSketch $PWD/examples/ArduinoNano33iot/iothub_ll_telemetry_sample From ba34ff6b1895588bf1116da35e45194e6ac0a77c Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Tue, 25 May 2021 14:43:58 +0500 Subject: [PATCH 28/44] modified .travis.yml file for nano33iot board --- .../iothub_ll_telemetry_sample/platform.local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/ArduinoNano33iot/iothub_ll_telemetry_sample/platform.local.txt b/examples/ArduinoNano33iot/iothub_ll_telemetry_sample/platform.local.txt index a0c81aa..ab5bf54 100644 --- a/examples/ArduinoNano33iot/iothub_ll_telemetry_sample/platform.local.txt +++ b/examples/ArduinoNano33iot/iothub_ll_telemetry_sample/platform.local.txt @@ -59,7 +59,7 @@ compiler.define=-DARDUINO= compiler.readelf.cmd=arm-none-eabi-readelf # this can be overriden in boards.txt -build.extra_flags= "-DDONT_USE_UPLOADTOBLOB" +build.extra_flags= -DDONT_USE_UPLOADTOBLOB # These can be overridden in platform.local.txt compiler.c.extra_flags= From 2e7fa22583671f693f533ab7eb9df615a7acc7be Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Tue, 25 May 2021 17:17:41 +0500 Subject: [PATCH 29/44] modified .travis.yml file for nano33iot board --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3d72fea..36f8627 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,6 +42,7 @@ install: - arduino --install-library "AzureIoTUtility" - arduino --install-library "AzureIoTProtocol_MQTT" - arduino --install-library "AzureIoTProtocol_HTTP" + - arduino --install-library "AzureIoTHub" - ln -s $PWD $HOME/Arduino/libraries/. script: - - buildExampleSketch $PWD/examples/ArduinoNano33iot/iothub_ll_telemetry_sample + - buildExampleSketch $PWD/examples/ArduinoNano33iot/iothub_ll_telemetry_sample; From 9c2f06902413031fdcfccd3b2dc6c0317d0743b3 Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Wed, 26 May 2021 12:42:40 +0500 Subject: [PATCH 30/44] modified .travis.yml file for nano33iot board --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 36f8627..35aded4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ language: generic env: global: - - IDE_VERSION=1.8.10 + - IDE_VERSION=1.6.11 branches: only: - ArduinoNano33IoT_example_support From 3a47aaad52a2eee5dcf115d61befd3e7b391c234 Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Wed, 26 May 2021 13:02:34 +0500 Subject: [PATCH 31/44] add flags in platformio.ini file --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 8736860..2758a17 100644 --- a/platformio.ini +++ b/platformio.ini @@ -2,4 +2,4 @@ platform = atmelsam board = nano_33_iot framework = arduino -build_flags = -DDONT_USE_UPLOADTOBLOB \ No newline at end of file +build_flags = -DDONT_USE_UPLOADTOBLOB -DUSE_BALTIMORE_CERT -DUSE_MBEDTLS \ No newline at end of file From 952bfcb6646d948e40dd6d9fdceee72f4b073082 Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Wed, 26 May 2021 13:03:04 +0500 Subject: [PATCH 32/44] modified .travis.yml file for nano33iot board --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 35aded4..c2004c6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ language: generic env: global: - - IDE_VERSION=1.6.11 + - IDE_VERSION=1.8.11 branches: only: - ArduinoNano33IoT_example_support From 35105ff9952c90aa1a97f17a508b43549dff07a6 Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Wed, 26 May 2021 13:08:27 +0500 Subject: [PATCH 33/44] modified .travis.yml file for nano33iot board --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c2004c6..35aded4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ language: generic env: global: - - IDE_VERSION=1.8.11 + - IDE_VERSION=1.6.11 branches: only: - ArduinoNano33IoT_example_support From d9d8f92b2699499292a830739a33e0f10a8055c5 Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Wed, 26 May 2021 13:13:38 +0500 Subject: [PATCH 34/44] modified .travis.yml file for nano33iot board --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 35aded4..36f8627 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ language: generic env: global: - - IDE_VERSION=1.6.11 + - IDE_VERSION=1.8.10 branches: only: - ArduinoNano33IoT_example_support From 4673429381e1cb577b942257396de7ae9586eca2 Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Thu, 27 May 2021 10:53:03 +0500 Subject: [PATCH 35/44] modified .travis.yml file for nano33iot board --- .gitignore | 5 +++ .pio/build/nano_33_iot/.sconsign38.dblite | Bin 4534 -> 0 bytes .pio/build/nano_33_iot/src/certs/certs.c.o | Bin 5072 -> 0 bytes .pio/build/project.checksum | 2 +- .travis.yml | 36 ++++++++++++--------- .vscode/extensions.json | 7 ++++ platformio.ini | 2 +- 7 files changed, 34 insertions(+), 18 deletions(-) create mode 100644 .gitignore delete mode 100644 .pio/build/nano_33_iot/.sconsign38.dblite delete mode 100644 .pio/build/nano_33_iot/src/certs/certs.c.o create mode 100644 .vscode/extensions.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..89cc49c --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.pio +.vscode/.browse.c_cpp.db* +.vscode/c_cpp_properties.json +.vscode/launch.json +.vscode/ipch diff --git a/.pio/build/nano_33_iot/.sconsign38.dblite b/.pio/build/nano_33_iot/.sconsign38.dblite deleted file mode 100644 index 424b10fabcc17d4ec04d5128f39658bde3299ee6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4534 zcmd^D&u`pB6i(Z;Nt&i@RG`qR(n516hwRRHJf4{%kebj`1kzSb`5~Ze=Vxr#wO6*c zQY#?}XLG8{KfnbEZu||L;fRFz1A5@zBhQ;`Vi$!Ty0`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&#OS8rjhMa<{+8cAd{N<@C}{Ya^qDZW`WF;e zq+Q{5Wx<84S%~Z~Sz*3L-jc&5Phsx^~>bS7iD zOgeme)(3Mj?;BS0@><-V^c=^BX*retcoZ0oM3()h=O0DYdN#{4Z=R#Feg<{%%oko5 z1Yz*JtxG>_nzC-5mmdiXUw%AO9}71t>t8=FKM|ks=Q|OjG3xopI?O}234i_kJD|f^ z_@?6H@}pO~CqH?v!)w~4<>{H2&k2nBml43xC5IcjUOIaEN7VhEE$cSCeT3L_^uy2p z6#ne#m*4%x)32WX>cd|@{ms+gKK=c7k4up+em=iD`EK-||MfZZ!xuLzqtS=apM1_n z;}2hrzx=?5(f42Re?Ye}uaEQRqtP!$NZt?Yw)x~g+B8aiw+)-o=u^`ds31mdTfer+ zdk@X99eoPi)*XHFnr8H=F7Ja+cSS!b_~e&G5uT7B^5rMDZR^y#JT!k{(f>U7JH)#C z=7%?t*ZZVD$iI8yAKv8NJ@K{NyMOQN^JnP&-{gMtrte+E zB=h@sp*P;0FQXTIvwCO!{1>AU@jgK9yS{t-{>?l4w@B{aPed4ix?{h%I f(Z3_Pzr1(eo_BqS{L@_Ttp7lS!<)>#d6)ZdwXBO< diff --git a/.pio/build/project.checksum b/.pio/build/project.checksum index 4b4c6b8..fa7d2a1 100644 --- a/.pio/build/project.checksum +++ b/.pio/build/project.checksum @@ -1 +1 @@ -7730d7177f85c99afaf4bec37fc866b3c035c276 \ No newline at end of file +c6791a4fbf98852daca2023ec98649d785fdba3c \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 36f8627..10de61c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,12 +4,11 @@ language: generic env: global: - - IDE_VERSION=1.8.10 - branches: - only: - - ArduinoNano33IoT_example_support + - IDE_VERSION=1.6.11 matrix: - BOARD="arduino:samd:nano_33_iot" + - BOARD="esp8266:esp8266:huzzah:FlashSize=4M3M,CpuFrequency=80" + - BOARD="esp8266:esp8266:thing" before_install: - /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16 - sleep 3 @@ -18,31 +17,36 @@ before_install: - tar xf arduino-$IDE_VERSION-linux64.tar.xz - mv arduino-$IDE_VERSION $HOME/arduino-ide - export PATH=$PATH:$HOME/arduino-ide + - if [[ "$BOARD" =~ "arduino:samd:" ]]; then + arduino --install-boards arduino:samd; + arduino --install-library WiFi101; + arduino --install-library WiFi101; + arduino --install-library RTCZero; + arduino --install-library NTPClient; + fi - if [[ "$BOARD" =~ "esp8266:esp8266:" ]]; then arduino --pref "boardsmanager.additional.urls=http://arduino.esp8266.com/stable/package_esp8266com_index.json" --install-boards esp8266:esp8266; arduino --pref "boardsmanager.additional.urls=" --save-prefs; arduino --install-library NTPClient; - fi - - if [[ "$BOARD" =~ "esp32:esp32:" ]]; then - arduino --pref "boardsmanager.additional.urls=https://dl.espressif.com/dl/package_esp32_index.json" --install-boards esp32:esp32; - arduino --pref "boardsmanager.additional.urls=" --save-prefs; arduino --install-library NTPClient; fi - - if [[ "$BOARD" =~ "arduino:samd:" ]]; then - arduino --install-boards arduino:samd; - arduino --install-library WiFiNINA; - fi - findAndReplace() { sed -i'' -e"s|$1|$2|g" "$3"; } - buildExampleSketch() { - EXAMPLE_SKETCH=$PWD/examples/ArduinoNano33iot/iothub_ll_telemetry_sample/iothub_ll_telemetry_sample.ino; + EXAMPLE_SKETCH=$PWD/examples/$1/$1.ino; + + if [[ "$BOARD" =~ "esp8266:esp8266:" ]]; then + findAndReplace WiFi101 ESP8266WiFi $EXAMPLE_SKETCH; + findAndReplace WiFiSSLClient WiFiClientSecure $EXAMPLE_SKETCH; + findAndReplace WiFiUdp WiFiUdp $EXAMPLE_SKETCH; + fi + + cat $EXAMPLE_SKETCH; arduino --verbose-build --verify --board $BOARD $EXAMPLE_SKETCH; } install: - arduino --install-library "AzureIoTUtility" - - arduino --install-library "AzureIoTProtocol_MQTT" - arduino --install-library "AzureIoTProtocol_HTTP" - - arduino --install-library "AzureIoTHub" - ln -s $PWD $HOME/Arduino/libraries/. script: - - buildExampleSketch $PWD/examples/ArduinoNano33iot/iothub_ll_telemetry_sample; + - buildExampleSketch simplesample_http \ No newline at end of file diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..e80666b --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,7 @@ +{ + // See http://go.microsoft.com/fwlink/?LinkId=827846 + // for the documentation about the extensions.json format + "recommendations": [ + "platformio.platformio-ide" + ] +} diff --git a/platformio.ini b/platformio.ini index 2758a17..1160f87 100644 --- a/platformio.ini +++ b/platformio.ini @@ -2,4 +2,4 @@ platform = atmelsam board = nano_33_iot framework = arduino -build_flags = -DDONT_USE_UPLOADTOBLOB -DUSE_BALTIMORE_CERT -DUSE_MBEDTLS \ No newline at end of file +build_flags = -DDONT_USE_UPLOADTOBLOB -DUSE_BALTIMORE_CERT -DUSE_MBEDTLS From 11c4b39a4ba2a7f56db93eb14817c903d74645fb Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Thu, 27 May 2021 10:59:36 +0500 Subject: [PATCH 36/44] modified .travis.yml file for nano33iot board --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 10de61c..10add6a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,7 +32,7 @@ before_install: fi - findAndReplace() { sed -i'' -e"s|$1|$2|g" "$3"; } - buildExampleSketch() { - EXAMPLE_SKETCH=$PWD/examples/$1/$1.ino; + EXAMPLE_SKETCH=$PWD/examples/ArduinoNano33iot/$1.ino; if [[ "$BOARD" =~ "esp8266:esp8266:" ]]; then findAndReplace WiFi101 ESP8266WiFi $EXAMPLE_SKETCH; From 52f050764a272fca7b47912318cbb1197e756fef Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Thu, 27 May 2021 11:10:26 +0500 Subject: [PATCH 37/44] modified .travis.yml file for nano33iot board --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 10add6a..1ee073f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,7 +32,7 @@ before_install: fi - findAndReplace() { sed -i'' -e"s|$1|$2|g" "$3"; } - buildExampleSketch() { - EXAMPLE_SKETCH=$PWD/examples/ArduinoNano33iot/$1.ino; + EXAMPLE_SKETCH=$PWD/examples/ArduinoNano33iot/iothub_ll_telemetry_sample.ino; if [[ "$BOARD" =~ "esp8266:esp8266:" ]]; then findAndReplace WiFi101 ESP8266WiFi $EXAMPLE_SKETCH; From 742d4318dc67f19003a9b50e10337369ed38ba89 Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Thu, 27 May 2021 11:30:39 +0500 Subject: [PATCH 38/44] modified .travis.yml file for nano33iot board --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1ee073f..a713adb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -49,4 +49,4 @@ install: - arduino --install-library "AzureIoTProtocol_HTTP" - ln -s $PWD $HOME/Arduino/libraries/. script: - - buildExampleSketch simplesample_http \ No newline at end of file + - buildExampleSketch iothub_ll_telemetry_sample \ No newline at end of file From 63e92273f392c3e75c2f329e26b94b73beaa3d86 Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Thu, 27 May 2021 11:35:00 +0500 Subject: [PATCH 39/44] modified .travis.yml file for nano33iot board --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a713adb..6367713 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,7 +32,7 @@ before_install: fi - findAndReplace() { sed -i'' -e"s|$1|$2|g" "$3"; } - buildExampleSketch() { - EXAMPLE_SKETCH=$PWD/examples/ArduinoNano33iot/iothub_ll_telemetry_sample.ino; + EXAMPLE_SKETCH=$PWD/examples/ArduinoNano33iot/iothub_ll_telemetry_sample/iothub_ll_telemetry_sample.ino; if [[ "$BOARD" =~ "esp8266:esp8266:" ]]; then findAndReplace WiFi101 ESP8266WiFi $EXAMPLE_SKETCH; From 2a9613bc6d1b1e793fea920be049b9dce3c050d5 Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Thu, 27 May 2021 11:40:55 +0500 Subject: [PATCH 40/44] modified .travis.yml file for nano33iot board --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 6367713..21eccec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,6 +47,7 @@ before_install: install: - arduino --install-library "AzureIoTUtility" - arduino --install-library "AzureIoTProtocol_HTTP" + - arduino --install-library "AzureIoTProtocol_MQTT" - ln -s $PWD $HOME/Arduino/libraries/. script: - buildExampleSketch iothub_ll_telemetry_sample \ No newline at end of file From e7f0a263cd983d5ffe0054e85c18f923b2f215b9 Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Thu, 27 May 2021 11:48:58 +0500 Subject: [PATCH 41/44] modified iot_config file for nano33iot board --- .../iothub_ll_telemetry_sample/iot_configs.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/ArduinoNano33iot/iothub_ll_telemetry_sample/iot_configs.h b/examples/ArduinoNano33iot/iothub_ll_telemetry_sample/iot_configs.h index 36c6496..cea4b62 100644 --- a/examples/ArduinoNano33iot/iothub_ll_telemetry_sample/iot_configs.h +++ b/examples/ArduinoNano33iot/iothub_ll_telemetry_sample/iot_configs.h @@ -7,8 +7,8 @@ /** * WiFi setup */ -#define IOT_CONFIG_WIFI_SSID "" -#define IOT_CONFIG_WIFI_PASSWORD "" +#define IOT_CONFIG_WIFI_SSID "InfoNet-BB" +#define IOT_CONFIG_WIFI_PASSWORD "pakistan313" /** * IoT Hub Device Connection String setup @@ -16,7 +16,7 @@ * navigating to IoT Devices tab on the left, and creating (or selecting an existing) IoT Device. * Then click on the named Device ID, and you will have able to copy the Primary or Secondary Device Connection String to this sample. */ -#define DEVICE_CONNECTION_STRING "" +#define DEVICE_CONNECTION_STRING "HostName=ArduinoNano33IoT.azure-devices.net;DeviceId=ArduinoNano33IoTDevice;SharedAccessKey=0XrwEGjbnYkbIglMadXZ/+SOIXHrn5eVxn7EoCIBqPM=" // The protocol you wish to use should be uncommented // From 50fba2ce6947222e47a2bf164453e09f1afbca4a Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Thu, 27 May 2021 11:58:52 +0500 Subject: [PATCH 42/44] modified .travis.yml file for nano33iot board --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 21eccec..dab134e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,8 +7,6 @@ env: - IDE_VERSION=1.6.11 matrix: - BOARD="arduino:samd:nano_33_iot" - - BOARD="esp8266:esp8266:huzzah:FlashSize=4M3M,CpuFrequency=80" - - BOARD="esp8266:esp8266:thing" before_install: - /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16 - sleep 3 @@ -48,6 +46,7 @@ install: - arduino --install-library "AzureIoTUtility" - arduino --install-library "AzureIoTProtocol_HTTP" - arduino --install-library "AzureIoTProtocol_MQTT" + - arduino --install-library "AzureIoTHub" - ln -s $PWD $HOME/Arduino/libraries/. script: - buildExampleSketch iothub_ll_telemetry_sample \ No newline at end of file From dc78b575e3390506bb942eaaac67b8f2f046bc59 Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Thu, 27 May 2021 13:09:45 +0500 Subject: [PATCH 43/44] modified .travis.yml file for nano33iot board --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index dab134e..374dc45 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,10 +43,10 @@ before_install: arduino --verbose-build --verify --board $BOARD $EXAMPLE_SKETCH; } install: + - arduino --install-library "AzureIoTHub" - arduino --install-library "AzureIoTUtility" - arduino --install-library "AzureIoTProtocol_HTTP" - arduino --install-library "AzureIoTProtocol_MQTT" - - arduino --install-library "AzureIoTHub" - ln -s $PWD $HOME/Arduino/libraries/. script: - buildExampleSketch iothub_ll_telemetry_sample \ No newline at end of file From 6affc5ff3a5cbec778b830b2d6ba87ed0b0bf83f Mon Sep 17 00:00:00 2001 From: Khawaja Usman Riaz Sehgal Date: Thu, 27 May 2021 14:53:47 +0500 Subject: [PATCH 44/44] modified .travis.yml file for nano33iot board --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 374dc45..61966d4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,7 @@ before_install: - export PATH=$PATH:$HOME/arduino-ide - if [[ "$BOARD" =~ "arduino:samd:" ]]; then arduino --install-boards arduino:samd; - arduino --install-library WiFi101; + arduino --install-library WiFiNINA; arduino --install-library WiFi101; arduino --install-library RTCZero; arduino --install-library NTPClient;