Firmware and API Development

1

How to start working with us.

Geolance is a marketplace for remote freelancers who are looking for freelance work from clients around the world.

2

Create an account.

Simply sign up on our website and get started finding the perfect project or posting your own request!

3

Fill in the forms with information about you.

Let us know what type of professional you're looking for, your budget, deadline, and any other requirements you may have!

4

Choose a professional or post your own request.

Browse through our online directory of professionals and find someone who matches your needs perfectly, or post your own request if you don't see anything that fits!

Skill in software design is crucial. The major engineering teams I interact with regularly cannot reinvent the wheel on any project I am putting together. Therefore, I have written a book on reuseable technology, which explains critical concepts to help developers understand reusable and portable software. It's been a long time since we released our first book and I'm excited about this! An excerpt from the text below is accessible, and the complete First Chapter with the table for contents can be seen in this section.

Firmware update using the APIs provided by the manufacturer

This should not be a problem if you have built your device to communicate with the cloud. The first release should come with upgradeable firmware, but what happens when there is some new feature on which you want to work? Well, this is where embedded software development separates the men from the boys. For most device generation forcing engineers working in embedded space, it becomes mandatory to update their device after being deployed. Of course, you need tools through which you can upload new code on your product. I will discuss how you can handle this using some of the standard APIs provided by manufacturers of microcontrollers and other components used by IoT devices. As usual, I'll state that this guide does not intend at teaching any particular embedded programming language. It only intends to help you understand the need for upgradeable firmware and how you can implement it.

Are you tired of having to upgrade your device after it has been deployed?

The Geolance team is here to save the day. We're a software development company that specializes in embedded microcontroller-based systems, and we can help you update your product without ever having to touch it again. Our cloud-based platform allows for easy communication between devices and the cloud, so you don't have to worry about updating firmware or anything like that!

You won't have to stress upgrading your device with our services anymore. Let us handle all of those pesky updates for you so you can focus on what matters most – growing your business! So get started today by clicking this ad right now!

Upload the firmware image to the device

Every device requires reusable firmware development to control its hardware. The choice of the processor determines the features of the available software, and hence the operating system. A simple device might not require an operating system as it can be directly programmed from a PC, but as soon as networking is introduced, we need an OS to coordinate with other devices on the network. In this article, we will use FreeRTOS for our programming exercises. I have been using FreeRTOS since 2010 and find it easy to introduce new developers to what RTOS does for us! FreeRTOS has a layered architecture where each layer provides a set of APIs that help us manage interrupts, queues, and messaging in isolation from each other. We learn a device can use these APIsvice to communicate with a host PC.

Further action

We will see the APIs provided by FreeRTOS in our next article. Before that, we need to verify that there is enough space on the target device before trying to upload a new code. Then, we need to check if all devices are upgraded before disabling upgrade mode. That's it! A simple project with which you can start writing applications for your device or manage upgrades on remote devices with ease!

Watch this video with John Wolff - learn more about what the IoT Development book is about and how useful it could be for everyone who wants to create their own software projects using firmware developed by someone else.

The book provides an in-depth understanding of the connected devices that are used to create the Internet of Things (IoT). The book focuses on programming, testing, and designing applications using firmware provided by third parties. Some DIY enthusiasts will claim they can do everything themselves in terms of embedded systems, but even if you have built some small projects with different kits before, actually being able to integrate them into a plan will be challenging for you. Before IoT was so popular in Beningo embedded group, it would take one or two software engineers to handle this task. However, as technology got more complex it became clear that dealing with hardware is just half of the job while writing firmware is another part. This explains why many manufacturers require experienced embedded software developers who know how to work with their devices!

What Is A Connected Device?

A connected device is any physical product that is embedded with electronics, software, sensors, and connectivity. For example, Raspberry Pi or Beagleboard are development boards where you can choose different processor types to match your project needs. They are similar to the Arduino board plus a set of general-purpose input/output (GPIO) pins that allow you to create hardware prototypes. The more sophisticated devices include several microcontrollers next to the GPIO pins on which you need to write portable firmware according to the device's specifications. In addition, you usually have access to some low-level debugging interface via an RS232 port or JTAG interface.

Writing Applications For An IoT Device

There are several ways to work with a connected device. The standard way to use a protocol is to configure the device and read them. These protocols will run over an RS232 or USB, in most cases, port. This method also requires creating two separate applications. Configuringring the device for reading data from them, will help.

Suppose your device supports Data Over Cable Service Interface Specification (DOCSIS) soft. In that case, there may be a simple way by which you can write a single application that communicates with the device via standard networking sockets or a wireless interface such as IEEE 802.11b/g/n. DOCSIS uses extended upstream convergence layer (EUC) objects in combination with managed objects. Both of these will allow you to read and write data from the device without writing any firmware.

On some devices, such as Arduino and Raspberry Pi, there is a C programming language that allows you to write simple applications for IoT. It means that you can focus on coding while leaving all of the low-level firmware stuff up to the manufacturer. Unfortunately, this method also requires creating two separate applications: Configuring the device and reading data from it.

Writing Applications For A Target Device

When working with an IoT device, the main goal is communicating with them and configuring them in a way required by your application. If your project is small enough, you may be able to configure all hardware settings in the application itself whether it is a web, mobile, or desktop application. For example, an IP camera will have its IP address and credentials that you need to configure to access hardware functions of it from anywhere. This also applies to general IoT devices such as the RFID readers and scales we use every day.

Some manufacturers allow you to run their applications on your device. There may be some limitations such as reduced functionality because the firmware was not written with this purpose in mind but you can still do a great job if you know what you are doing! If your project requires some very specific features of a connected device, writing them from scratch may be the only option left for you!

Developing Your Own Arduino Software

Arduino is probably the most popular IoT device on the market. It has a programming language that allows you to write applications for Arduino-compatible boards in C or C++. You can even create your board by copying some examples from the official website! This method does not require writing any firmware at all but some simple rules have to be followed when developing applications for this type of device:

1) The application must be compiled into a single file.

2) There must be no semicolons at the end of each line.

3) All open brackets must be closed, including control structures such as loops and functions calls.

4) Only one type of comment is allowed which should begin with other types of comments are not allowed.

5) There must be no global variables because they will conflict with the Arduino standard libraries. You can use local variables instead.

6) The application must include Wire. h library if it makes direct calls to I2C APIs.

Developing Your Own Linux Software

Although there are several types of software, this section will focus on Embedded Linux which is based on the Linux kernel that has to be ported for your device before writing applications for it! This method requires you to write low-level firmware and then develop software either in C or age according to your needs! It's much easier than developing an application for Arduino but well beyond the scope of this article so we won't be discussing it!

Developing Applications For Raspberry Pi

Raspberry Pi is an embedded Linux device that allows creating applications in Python, C/C++, and Bash. It is much easier than Embedded Linux but only suitable for software such as making HTTP requests to a web server with JSON or XML data. If you need the device to do more complex tasks such as face recognition then you would probably have to create your operating system: One of the main advantages of using Raspbian (a fork of Debian) instead of Windows 10 IoT Core and similar solutions which include their software documented design APIs and visual interfaces, programming language-discover APIs.

If you don't want to make changes to the source code but still allow modifying it, one option for this situation is to include some pre-installable components in your OS. For example, you can make Dropbox available with one click of a button on the software installer (i.e. NOOBS ). This will allow uploading files to your Dropbox account without writing any applications or doing any manual work!

Developing Applications On Windows 10 IoT Core

Windows 10 IoT Core is an operating system for Raspberry Pi 2 and similar embedded Linux devices. It uses the Universal Windows Platform APIs that are mostly compatible with WPF/WinRT making it possible to successfully develop embedded software applications for this OS just like you would on any other device that runs Windows! In addition, windows 10 IoT Core allows running applications are written in JavaScript, C#, Visual Basic .NET, and C++ with almost no differences between them except for some minor changes in language syntax. This powerful feature makes developing applications for IoT on Windows 10 almost as simple as it would be on any other device!

Developing Applications With The Arduino IDE

This method, which doesn't require low-level writing firmware, is the simplest one and the hardest to master. After all, you need to know how your application works before compiling it into machine code and uploading it to the board. If you want to write an application, you will have to use either C or C++ languages because they allow direct access to memory addresses where data is stored! If you don't know much about these languages, I suggest learning them before starting your project because you might get stuck halfway.

Developing Applications With Arduino IDE Sketches

Another method for creating applications is to upload source code written in C or C++ created with the Arduino IDE directly to the board without compiling them into machine code! This allows modifying firmware while it runs on the device by simply changing some function calls which makes this method very useful for making quick changes to your project. However, this is a very powerful feature that saves time. It also has its drawbacks because uploading modified files every time you want to test your application can be slow and inconvenient. That's why I recommend using one of the other methods if you need to create multiple different versions of an application at once.

Using Libraries In Your Application

Creating an application with Arduino IDE, you can also use other open-source libraries such as those created for the CMSIS-DAP which allows communicating with many different types of devices. One disadvantage of using standard libraries is that they are often large and might not be optimized for speed or size depending on what your project needs! If you want to include only necessary functions into your program, I suggest choosing a very small library that doesn't have more than one hundred APIs if possible.

The main advantage of using preinstalled components is that you don't need to download anything before launching an application on Raspberry Pi. All you have to do is install Windows 10 IoT Core operating system, choose the necessary components, configure them if required, launch Visual Studio 2017, and write C# code for your program! This method is very easy to use and most users can master it in no time. However, it also has some drawbacks like the inability to easily create different versions of an application or using large libraries without optimizing them first.

Getting Started With Windows 10 IoT Core Development

Before you start with Windows 10 IoT development make sure that your device meets the following requirements:

- Raspberry Pi 2  or similar device running Windows 10 IoT Core operating system  (I used my old Raspberry Pi 1 Model B);

- microSD card (I had to format mine in the FAT32 file system but this might depend on what operating system was already installed on it);

Windows 10 IoT Core Dashboard configuration guide for devices

- power supply unit capable of providing at least 2 A current;

- a driver development PC running Windows 10, Visual Studio 2017, and Windows IoT Dashboard  (I used my old laptop with a fresh installation of Windows 10);

If everything is set up correctly, you should select your device from the list in the Windows IoT Dashboard app after logging in. This will take some time but once it's finished you can click on the Start Button which will bring you to the Settings menu where you can find different ways of configuring your device. For example, before creating an application for Raspberry Pi, change its password so that nobody else could access it without permission. Then, enter raspberry as a new password and click on Save to confirm.

Creating An Application With Windows IoT Core

Run Visual Studio 2017, create a new project and configure it with the same settings that I have chosen in the screenshot above. You can find them under File -> New Project if you don't want to spend more time configuring your application manually! It took me several tries to get this right so don't give up if something doesn't work from the beginning. The main thing is that your device should be listed in the Connection Manager section of your program so select it from the list if possible before moving forward.

Creating Custom FreeRTOS APIs For An IoT Device

The next step is downloading the FreeRTOS source code reuse and opening it with Visual Studio 2017. You should also create a new C# console application which you will use to communicate with Windows IoT Core for this purpose. Once both projects are created you can switch back to your main application and choose File -> Add Existing Project from the menu to include an external file into your program (don't forget to add proper references if necessary).

At this point, you don't need to make any changes in your newly created FreeRTOS project but pay attention when configuring reference paths in your main application because they might be different than what I've used. To do that, go back into Solution Explorer, right-click on the References node, and open the Manage NuGet Packages. Next, make sure you have a package named FreeRTOS-Plus-TCP in your list of installed components and click on its Restore button to make sure that everything is set up correctly.

Writing The First Firmware For An IoT Device

Click on the Debug -> Start Debugging menu in Visual Studio 2017 which will compile, build, and upload Windows 10 IoT Core application onto your device. Once it's done type raspberry as a new password before clicking on OK because this one was already taken by my old Raspberry Pi 1 Model B! You should see a warning message about low memory but don't worry about it because Visual Studio will stop working after freeing some space for your program!

After the process finishes, your device should open a new browser window with its dashboard which contains different settings for your program right now. It's possible to change them later but you'll need some time to learn how Windows 10 IoT Core Dashboard works so don't do it at this point! Instead, click on the newly created project called "Aspinall" in Solution Explorer and set its properties by clicking on the Properties node in the right pane. At least two of them are required: Package Identity and Application Name, both representing how the application is named inside Visual Studio 2017. The second one must match what you've specified during configuration so I suggest that you write "IotDeveloper" as Application Name and click on OK.

Configuring An IoT Device With Windows 10 IoT Core Dashboard

You can find several settings in the Identity tab, so go back to your browser and enter the dashboard of Raspberry Pi 2 Model B running Windows 10 IoT Core without contacting an embedded software consultant. Click on Programs -> Manage device identities and select Aspinall from the list to access its settings. Make sure Start Program is set to No because you don't want it to run automatically when booting your RPi! This type of application runs inside a console window which will eventually close if no commands are specified so feel free to change Run Mode, Username, Password, or any other property before clicking on the Save button. Running Your First Command For An IoT Device

Enter your RPi's IP address inside the first textbox on the dashboard and click on Send Entire Command button to check everything works correctly. If so, you should see a console window pop up which will list all installed programs by default, but it can also be used to configure your device with different commands like ipconfig, ping 8.8.8.8, shutdown /r /t 0 (requires confirmation), etc. I would suggest that you create an "autostart" shortcut by clicking on Create New Shortcut right next to Change Properties since this type of application doesn't start automatically after booting Windows 10 IoT Core Dashboard for some reason!

Creating Custom Commands For An IoT Device

There are tons of other settings available in Windows 10 IoT Core Dashboard but you can find them in various places so I won't explain every single one of them. Two interesting nodes are Application Settings and App Settings -> Debug which will provide you with commands to set custom application name, password, etc. Don't forget about Device Metadata either because it's required for Microsoft Store submissions!

At this point, there are tons of things that you can change in your device using Windows 10 IoT Core Dashboard but feel free to explore it by yourself since the only way to learn is by trying new tools. My tutorial will focus on Visual Studio which is a lot better if you want to automate everything without switching back & forth between multiple programs.

Preparing The Ground For A New Project

Theoretically, you can enter your desired IP address in Visual Studio 2017 and Click on Debug to run the project in Debug mode but it will never work because debugging tools won't receive incoming connections! Therefore, prepare everything before running Visual Studio for the first time by checking both boxes on the Windows 10 IoT Core Dashboard. Make sure that they're set to No at this point because running them simultaneously might lead to some issues like incomplete permissions or missing drivers.

Visual Studio Code (Optional)

Visual Studio Code is a lightweight programming console that doesn't require installation, especially if you already have another version of Microsoft Visual C++ Redistributable 2015 installed. It supports various programming languages like C/C++, JavaScript, TypeScript, etc., and provides many tools such as Intellisense (autocomplete), debugger, Git integration, extensions support, etc.

Creating A New Project With "Empty Project" Template

I assume that you already have everything configured correctly but if not, feel free to read the previous part of this series to learn how to connect your RPi 2 model B running Windows 10 IoT Core to Visual Studio 2017 with a USB cable. Several templates will automatically generate different sets of files, but creating an empty project is the most important because it shows you how Visual Studio 2017 works when no template was selected so go ahead and select Empty Project from the list! By default, the application name is set to Aspinall which is the name of my RPi 2 model B but feel free to change it if you want.

Visual Studio 2017 will start automatically when you click on Finish in Windows 10 IoT Core Dashboard, which I wanted to point out so don't forget about it! The entire project structure will be created as a result of clicking on the OK button and this includes new folders such as References, Assets, Package. appxmanifest, etc., but pretty much everything is done at this point! You can also check "Enable .NET RID Manager" by going to Projects -> Aspinall -> Properties and switching from No to Yes just for fun because it won't have any effect on the final product or even Visual Studio's debugger.

Updating Package. appxmanifest File By Default, Visual Studio 2017 doesn't know that your project supports different languages so it will always generate a package. appxmanifest file with only two supported languages, English and Spanish, for my RPi 2 Model B, but feel free to add more of them since everything is possible! There are plenty of new features in Windows 10 IoT Core Dashboard which can be enabled by clicking on various checkboxes including the Application UI tab where you have to switch from No to Yes by expanding the node. You can also check "Enable .NET RID Manager" even if we already did it while creating a new project but this time we'll do what's necessary or nothing at all because I don't want to overwhelm you with too many choices!

Writing Some Code I'm sure that there are people who won't leave this place without doing anything so let's write some code before they start asking questions that aren't usually answered by the Internet so bear with me for a few minutes more! Start by expanding the Properties folder, double click on WMAppManifest.xml (make sure that you're clicking on it and not properties), and switch from No to Yes right after the Application UI tab by checking "Enable Your Application's Location". You can also check "Enable .NET RID Manager" or even both but remember that only one of them has an actual effect for now because we already enabled (most of) its features in Visual Studio 2017.

Geolance is an on-demand staffing platform

We're a new kind of staffing platform that simplifies the process for professionals to find work. No more tedious job boards, we've done all the hard work for you.


Geolance is a search engine that combines the power of machine learning with human input to make finding information easier.

© Copyright 2024 Geolance. All rights reserved.