1NCE Arduino Blueprint: Building Open-source IoT Projects


Code Less, Launch More  

The 1NCE Arduino Blueprint integrates our SDK for cellular connectivity. Building upon previous experiences with FreeRTOS and Zephyr, this blueprint simplifies the development process, allowing Arduino users to focus on their project's core functionalities.

Integrating Arduino with 1NCE offers several technical advantages for IoT projects. The first thing is reducing development costs by minimizing the time and resources required for software and configuration. The Arduino Blueprint provides pre-configured modules and libraries that seamlessly interface with Arduino boards, eliminating the need for complex custom coding and integration efforts. Secondly, the simplified authentication mechanisms and energy-efficient communication protocols contribute to faster time-to-market for IoT solutions. Arduino developers can quickly establish secure connections and transmit data efficiently over cellular networks. 

Arduino and 1NCE help developers adapt their IoT projects to evolving requirements and environments. Arduino's modular architecture allows for easy expansion and customization, while our support for industry-standard protocols like CoAP ensures interoperability with a wide range of IoT devices and platforms. Lastly, the vibrant developer communities surrounding both Arduino and 1NCE provide valuable resources, expertise, and support for IoT projects. Developers can use online forums, tutorials, and code repositories to collaborate with peers, troubleshoot issues, and share best practices. 


The Future is Open with Seamless Arduino Authentication 

Arduino's open-source nature allows developers to prototype and customize IoT projects with ease. However, traditional IoT device authentication can be a cumbersome process, involving multiple steps from registration to certificate generation and attachment. With 1NCE OS Device Authenticator, instead of navigating through up to 8 steps, developers can connect their devices securely in just two simple ones. Gone are the days of manually generating and attaching certificates. By automatically receiving the pre-shared key and establishing a secure DTLS connection, developers can focus on what matters most: their IoT application's functionality.


How Device Authenticator Works


Energy-Hungry Projects and Arduino Power Saving  

Device authentication is not the only tool in stock. Based on our customers’ feedback, we realize and addresses the pressing need for energy-efficient communication protocols. Traditional methods often overlook this aspect, leading to unnecessary energy consumption and reduced device lifespan. However, with Energy Saver, powered by CoAP/UDP, developers can optimize energy usage without compromising on connectivity or security. 

CoAP offers more efficient resource handling compared to MQTT by utilizing the User Datagram Protocol (UDP) instead of TCP. UDP, being connectionless and packet-oriented, sends data packets consecutively without the need for confirmation, unlike TCP which requires numbered packets and confirmation before sending the next packet. This approach conserves effort, time, and energy.  

Therefore, CoAP is particularly advantageous in scenarios where devices prioritize resource conservation. Battery-powered devices, typically equipped with basic hardware and limited computing capabilities, aim to transmit data swiftly and efficiently while minimizing energy consumption, making CoAP a preferred choice in such cases.


Energy Saver in the IoT Ecosystem


Work in Practice: Data-driven Harvest 

Let’s quickly show you how the 1NCE Arduino Blueprint works in practice within the Smart Agriculture Monitoring System:  

Easy Setup. Instead of dealing with complicated certificate generation, developers can connect their Arduino devices, like soil moisture or water sensors, to the cloud in just two easy steps. This means less time spent on setup and more focus on making the system work efficiently for monitoring crops and livestock.  

Energy Efficiency. By using Energy Saver, the system optimizes battery usage. This means devices can operate for longer periods without needing frequent battery replacements. It forms a low-power mode for your devices, ensuring they stay connected to the cloud while conserving energy. This is particularly useful in remote agricultural areas where power sources may be limited.   


Compatibility and Guidelines  

Today, the blueprint is compatible with Arduino Portenta H7 and Arduino Portenta H7 lite, both running on Mbed OS, and when connected to the Portenta Cat. M1/NB IoT GNSS Shield. For those looking to dive into IoT development with Arduino, there are abundant resources available, including tutorials, documentation, and community forums. The Arduino IDE (Integrated Development Environment) provides a user-friendly platform for writing, compiling, and uploading code to Arduino boards. Additionally, the Arduino IoT Cloud offers a seamless way to connect Arduino devices to the cloud and build IoT applications sources. Below, you can also find a step-by-step guideline on setting some of Arduino devices with the Arduino Blueprint. 


Getting Started with Arduino Protenta H7 

Step 1: Configuring the Development Environment: In this section, we will guide you through a step-by-step process of setting up your Portenta board for running the Arduino Blueprint. 

Start with Basic Setup 

  1. Connect Portenta: Plug your Portenta (USB-C®) to your computer. 

  2. Open IDE: Launch your Arduino IDE (ensure the latest version). 

Include the Portenta board in the list of available options 

To access the Portenta board in your Arduino IDE, navigate to the board manager and search for "portenta". Locate the Arduino mbed-enabled Boards library and select "Install" to download and install the latest version of the Mbed OS core. 

Include the Portenta board in the list of available options 

To include the 1NCE Arduino Blueprint in the available libraries, open your Arduino IDE and access the library manager. Search for “1NCE Arduino Blueprint” and locate the library by 1NCE GmbH. Click on “Install” to add the latest version, which is version 1.0.0 as of the time this tutorial was written. 


Step 2: Uploading the 1NCE Arduino Blueprint  

UDP Demo   

Let's program the Portenta with UDP Demo Example: in the Arduino IDE open the example by clicking the menu entry File> Examples> 1NCE Arduino Blueprint> nce_udp_demo  

Then you need to customize the following parameters: 


The configuration options for this example are:  

NCE_UDP_ENDPOINT is set to 1NCE endpoint. 

NCE_UDP_PORT is set by default to the 1NCE UDP endpoint port 4445. NCE_UDP_DATA_UPLOAD_FREQUENCY_SECONDS the interval between UDP packets. 

NCE_PAYLOAD Message to send to 1NCE IoT Integrator. 

NCE_PAYLOAD_DATA_SIZE Used when 1NCE Energy Saver is enabled to define the payload data size of the translation template. 

 

CoAP Demo 

Let's program the Portenta with UDP Demo Example: in the Arduino IDE open the example bu clicking the menu entry File> Examples> 1NCE Arduino Blueprint> nce_coap_demo 

 


The configuration options for CoAP sample are as follows: 

NCE_COAP_ENDPOINT is set to 1NCE endpoint. NCE_COAP_PORT is set automatically based on security options (with/without DTLS). 

NCE_COAP_URI_QUERY is the URI Query option used to set the MQTT topic for 1NCE IoT integrator. 

NCE_COAP_DATA_UPLOAD_FREQUENCY_SECONDS the interval between CoAP packets. 

NCE_PAYLOAD Message to send to 1NCE IoT Integrator. 

NCE_PAYLOAD_DATA_SIZE Used when 1NCE Energy Saver is enabled to define the payload data size of the translation template. 

LwM2M Demo  

Let's program the Portenta with UDP Demo Example: in the Arduino IDE open the example b clicking the menu entry File> Examples> 1NCE Arduino Blueprint> nce_LwM2M_demo


The configuration options for LwM2M sample are: 

NCE_ICCID the ICCID of 1NCE SIM Card. 

LWM2M_ENDPOINT is set to 1NCE endpoint. DTLS is enabled by default.

To use DTLS, bootstrapping PSK should be defined in LWM2M_BOOTSTRAP_PSK. It can be configured while testing the LwM2M integration (From the Device integrator), or from the API Create Pre-Shared Device Key

To test unsecured communication, disable the device authenticator by removing the following definition from nce_demo_config.h 

#define LwM2M_ENABLE_DTLS 

Arduino’s open-source philosophy, coupled with a vibrant developer community, has democratized IoT development and empowered individuals and organizations to create impactful projects. At the same time, 1NCE creates additional ways to use the full power of the platform and connect the devices seamlessly within just a few clicks.