cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Setup a Raspberry Pi as an IoT Device Part 1

100% helpful (1/1)

 

Connect a Raspberry Pi to ThingWorx using the Edge MicroServer (EMS).

 

GUIDE CONCEPT

 

This project will utilize the Edge MicroServer (EMS) to connect ThingWorx Foundation to a Raspberry Pi.

 

YOU'LL LEARN HOW TO

 

  • Set up Raspberry Pi
  • Install, configure, and launch the Edge MicroServer (EMS)
  • Connect a remote device to ThingWorx Foundation

 

NOTE:  The estimated time to complete all parts of this guide is 60 minutes.

 

 

Step 1: Introduction

 

A Raspberry Pi is a small, single-board computer that utilizes an ARM processor and typically runs a variant of Linux.

 

Due to its small size, relatively affordable cost, and ability to run a full operating system, the Pi is a near-ideal device to utilize as a Proof-of-Concept (PoC) IoT Edge device.

 

In addition, there is a version of the ThingWorx Edge MicroServer (EMS) built to work on ARM processors. Therefore, this guide will explore getting the EMS running on a Raspberry Pi to connect to ThingWorx Foundation.

 

00-mlp-pi.jpg

 

 

As stated in the Overview, you may purchase a Pi directly from the Raspberry Pi web site or from a distribution partner such as Digi-Key or RS.

 

You will also need an SD card (8+GB... 16+GB recommended) with the Raspbian operating system installed... though this guide will instruct you on installing the Raspbian OS on a microsdhc flash card if you prefer to purchase an SD card separately.

 

You may alternately wish to purchase a "Pi Canakit". Canakits, depending on the version, typically include a Pi, SD card with a version of Raspbian pre-installed, and various other items like sensors, a case, an HDMI cable, and other accessories.

 

To make this guide as straight-forward as possible, we'll assume a monitor, USB keyboard, USB mouse, and WiFi connectivity to interact with the Pi.

 

Note that the Pi has an HDMI port, so you may also need an HDMI-to-DVI convertor or similar if your monitor doesn't natively support HDMI.

 

 

Step 2: Format MicroSDHC Card

 

The microSDHC flash card which the Pi accepts may (or may not) come pre-installed with the Raspbian OS. If Raspbian is pre-installed and working, you may skip this step.

 

However, these flash cards are susceptible to corruption, especially if proper static-control guards are not followed or if the Pi is powered-down without going through a proper shutdown procedure.

 

As such, the steps immediately below will assume that you are installing (or re-installing) Raspbian on your microSDHC card.

 

Depending on your PC's ports, you may also require a microSDHC adapter to insert the flash card into your computer.

 

  1. Locate your microSDHC card.

    • Remember that 8+GB is mandatory, but 16+GB is recommended to ensure that the Pi has enough swap-space.
     

    01-mlp-microsdhc.jpg

  2. Locate your flash card adapter.

    • Note that you may have a different type of adapter. Simply ensure that your PC can recognize the microSDHC card.

    02-mlp-adapter.jpg

     

  3. Insert the microSDHC card into the adapter.


    03-mlp-card-plus-adapter.jpg

     

     
  4. Insert the adapter-plus-microsdhc card into your PC.

    04-mlp-insert-pc.jpg

     

     
  5. Assuming a Windows PC and either a pre-installed or corrupted flash card, you will receive a pop-up stating that it needs to be formatted prior to use; click Format disk.


    05-mlp-format-disk.png

     

  6. On the following Format SDHC Card pop-up, click Start.

    06-mlp-format-start.png

     

  7. On the following Format Confirmation pop-up, click OK.
     

    07-mlp-format-confirm.png

     

  8. On the following Format Complete pop-up, click OK.

    08-mlp-format-complete.png

     

  9. On the previous Format pop-up which is still open, click Close.

    09-mlp-format-close.png
     
  10. You now have a formatted microSDHC card which Windows can recognize.
     

    10-mlp-formatted-microsdhc.png

     

 

Step 3: Flash MicroSDHC Card

 

Now that the flash card is accessible to Windows, you want to install the Raspbian OS on it.

 

Once again, this step assumes that you are installing (or re-installing) the Raspbian OS.

 

If your microSDHC card came pre-installed with Raspbian, then you may skip this step.

 

  1. Download the Raspbian OS .zip file.

  2. Navigate to the download location and locate the Raspbian .zip file.


    11-mlp-downloads.png

 

3. Right-click on the file and select Extract All....

12-mlp-extract-all.png

 

4. On the Extract Pop-up, click Extract.

13-mlp-extract-pop-up.png

 

5. Download the balenaEtcher "flasher" software.

6. Navigate to the download location and locate the balenaEtcher .exe file.


14-mlp-balena-etcher.png 

7. Double-click on the balenaEtcher .exe to begin the installation process.


15-mlp-etcher-install.png

 

8. On the balenaEtcher installer pop-up, click I Agree.

  • After the installation completes, balenaEtcher will automatically open.

     

    16-mlp-etcher-running.png

9. Click Select image and navigate to the previously-extracted Raspbian OS .img file.


17-mlp-etcher-nagigate-image.png

 

10. Select the .img file and click Open.

  • Assuming the only microSDHC card currently inserted into your PC is the one for the Pi, then the SD SCSI Disk Device will be pre-selected; otherwise, choose the correct flash disk.

    18-mlp-etcher-disk.png
 

11. Click Flash!.

  • Accept allowing the etcher to make changes to your computer.

    19-mlp-etcher-flashing.png

 

12. Wait for balenaEtcher to complete the flashing process; this may take ~5-10 minutes.

20-mlp-etcher-finished.png

 

13. Remove the microSDHC card and adapter from your PC.

 

 

Click here to view Part 2 of this guide.

Version history
Last update:
‎Mar 07, 2023 02:50 PM
Updated by:
Labels (1)
Contributors