Skip to main content

DIY or Plug and Play EdgeX DevKits

EdgeX Community DevKits provide options for developers who want to get started quickly using pre-tested, cost-effective and production-ready development kits. These Community DevKits refer to configurations of the EdgeX software, built for use with particular combinations of third-party hardware devices..

EdgeX Community DevKit configurations currently include a combination of RaspberryPi 3B+ and GrovePI sensor kit; other configurations will be added in the future.

Hardware

Raspberry PI 3 Model B+

The Raspberry PI 3 Model B+ is a 1.4GHz, 64-bit quad-core processor with 1GB SDRAM.

Key Features include:

  • 2.4GHz and 5GHz IEEE 802.11.b/g/n/ac wireless LAN, Bluetooth 4.2, BLE
  • Gigabit Ethernet over USB 2.0 (maximum throughput 300 Mbps)
  • Extended 40-pin GPIO header
GET IT NOW

GrovePi+

The GrovePi+ (view board) is an add-on board with 15 Grove 4-pin interfaces that brings Grove sensors to the Raspberry Pi. It is the newest version compatible with Raspberry Pi model B/B+/A+/2/3 perfectly.

The GrovePi+ starter kit integrates easily with Raspberry PI and includes a GrovePi+ board and the following 12 sensors/accessories:

  • Temperature & Humidity Sensor
  • Rotary Angle Sensor
  • Light Sensor
  • Sound Sensor
  • LCD RGB Backlight
  • Blue LED
  • Red LED
  • Green LED
  • Buzzer
  • Relay
  • Button
  • Ultrasonic Ranger
GET IT NOW

Hardware Connection

The GrovePI+ board is mounted on the Raspberry PI as shown in this image. This allows you to connect Grove Sensors directly to the board. Make sure the pins are properly aligned.

Connect the Grove Sensors to the ports on Grove Pi board as shown in the table below.

Port

Interface Grove Sensor

D2

GPIO

Blue LED

D3

GPIO

Green LED

D4

GPIO

Button

D6

GPIO

Red LED

D7

GPIO

Relay

D8

GPIO

Buzzer

A0

AIO

Light Sensor

A1

AIO

Sound Sensor

A2

AIO

Rotary Angle Sensor

I2C-2

I2C

RGB Backlit LCD
GET IT NOW

Software

The EdgeX Device Grove Service was developed to control/communicate with Grove sensors connected on Grove Pi in an EdgeX deployment. The current version of the service supports the following sensors/functionality:

Sensor Supported Available Functionality
Temperature & Humidity Sensor

N

– N/A –

Rotary Angle Sensor

Y

Get RotaryAngle & Rotary Voltage
Light Sensor

Y

Get Light Luminosity
Sound Sensor

Y

Get Sound Intensity in Vbiased
LCD RGB Backlight

Y

Write Text, starting at a particular row, column
Blue LED

Y

Turn On/Off Blue LED
Red LED

Y

Turn On/Off Red LED
Green LED

Y

Turn On/Off Green LED
Buzzer

Y

Turn On/Off Buzzer
Relay

Y

Turn On/Off Relay
Button

Y

Get Button State (Press/Release)
Ultrasonic Ranger

N

– N/A –

Setup Instructions

Prerequisite

To install Ubuntu Linux 18.10 (64 bit) on Raspberry Pi 3B+, download an installer from here:

usb_installer.zip.

This installer includes Node-RED, mosquitto service, docker-compose and boot configuration changes required to run the device grove service on Raspberry Pi.

To install, follow the steps as described below:

  • Unzip the contents of the installer on to a new USB stick.
  • Insert a blank SD card into the Pi, and the USB install stick into a USB port, then power on the Pi.

After a short delay the Ubuntu installer boots from the USB. Follow the installer instructions to install on the SD card and create a user account. After completing the install process, the Pi can be rebooted from the SD card into Xubuntu 18.10 64 bit arm version.

Note: When the Pi boots with the new image, there are some warnings & an error from kernel , which should be ignored.

Software Setup

  1. Install docker-ce and set the sudo permission:
    1. Install docker-ce:
      sudo apt install docker-ce
    2. Add user to the docker group
      sudo usermod -aG docker $USER
      Log out and log back in for the change to take effect.
  2. Clone the demo-grove-pi repository from EdgeXFoundry to start the services
    1. Clone the repo
      git clone https://github.com/edgexfoundry-holding/demo-grove-pi
    2. Start Node-Red by typing
      node-red
      Wait for the Node-Red to start.
      To get Node-Red on the web browser, type http://localhost:1880. On another tab, type http://localhost:1880/ui to start the Node-RED Dashboard.
    3. Pull the images from dockerhub to run the device grove service along with the EdgeX core services on Raspberry Pi
      cd demo-grove-pi
      docker-compose -f docker-compose-demo-grove.yml up --detach

    Note: edgex-device-grove image is built with the configuration described in the profile Grove_Device.yml. This file can be found at /device-grove/res/Grove_Device.yml within the edgex-device-grove container.

Running Device Grove Service

There are two ways to test the connected sensors on Grove Pi:

1. Using the curl commands

Set of the curl commands used to test the sensors – “device-grove curl commands” are as follows:

Set/Get Grove Sensor Functionality Curl Command
Set Green LED Turn On curl -H “Content-Type: application/json” -d ‘{“Green-LED”:”true”}’ http://localhost:49991/api/v1/device/all/Set_GreenLed
Turn Off curl -H “Content-Type: application/json” -d ‘{“Green-LED”:”false”}’ http://localhost:49991/api/v1/device/all/Set_GreenLed
Red LED Turn On curl -H “Content-Type: application/json” -d ‘{“Red-LED”:”true”}’ http://localhost:49991/api/v1/device/all/Set_RedLed
Turn Off curl -H “Content-Type: application/json” -d ‘{“Red-LED”:”false”}’ http://localhost:49991/api/v1/device/all/Set_RedLed
Blue LED Turn On curl -H “Content-Type: application/json” -d ‘{“Blue-LED”:”true”}’ http://localhost:49991/api/v1/device/all/Set_BlueLed
Turn Off curl -H “Content-Type: application/json” -d ‘{“Blue-LED”:”false”}’ http://localhost:49991/api/v1/device/all/Set_BlueLed
LCD Write_String curl -H “Content-Type: application/json” -d ‘{“Display-String”:”Edgex Demo”, “Row”: “0”, “Column”: “0”}’ http://localhost:49991/api/v1/device/all/Write_String
Relay Set curl -H “Content-Type: application/json” -d ‘{“Grove-Relay”:”true”}’ http://localhost:49991/api/v1/device/all/Set_Relay
UnSet curl -H “Content-Type: application/json” -d ‘{“Grove-Relay”:”false”}’ http://localhost:49991/api/v1/device/all/Set_Relay
Buzzer Turn On curl -H “Content-Type: application/json” -d ‘{“Grove-Buzzer”:”true”}’ http://localhost:49991/api/v1/device/all/Set_Buzzer
Turn Off curl -H “Content-Type: application/json” -d ‘{“Grove-Buzzer”:”false”}’ http://localhost:49991/api/v1/device/all/Set_Buzzer
Get Button Get State curl -H “Content-Type: application/json” http://localhost:49991/api/v1/device/all/Get_ButtonState
Rotary Sensor Get Rotary Sensor Measurements curl -H “Content-Type: application/json” http://localhost:49991/api/v1/device/all/Get_RotarySensorMeasurements
Sound Sensor Get Sound Intensity curl -H “Content-Type: application/json” http://localhost:49991/api/v1/device/all/Get_SoundIntensity
Light Sensor Get Light Intensity curl -H “Content-Type: application/json” http://localhost:49991/api/v1/device/all/Get_LightIntensity

Note: Above commands are based on the following:

  1. Curl commands are issued on the system where the device-grove service is running
  2. device-grove service configuration is set to use port 49991

2. Using Node-RED

Current version of the flow – nodered_flow.json available in ‘demo-grove-pi’ repo reads the value from the sensors. The updates are displayed on the Node-RED dashboard as Line Charts & Gauge.

  1. In the browser, go to the Node-RED tab, from the menu select ‘Import – Clipboard’ and copy the contents from nodered_flow.json and click on ‘Import’. This creates a tab ‘Grove_Device’ on Node-RED. The screen will look like:

  1. Update the mqtt-server configuration on the ‘MQTT_DeviceGrove’ node as follows:
    • Double-click ‘MQTT_DeviceGrove’, to open mqtt node. Click edit to update mqtt-broker node. In the ‘Server’ tab, replace ‘mqtt-broker’ with the ip of the system on which the edgex-device-grove service is running. Click ‘Update’ and ‘Done’.
    • Run the executable [available at demo-grove-pi repo]

    ./register_mqtt <ip_addr>

    ip_addr of the machine where the device-grove service is running

  2. Test SoundSensor, Light Sensor and Rotary Sensor and monitor the output on the Node-RED dashboard. The following picture captures the variation of Light and Sound intensity captured over a period of one hour.To test Grove Rotary Sensor, rotate the knob on the Rotary Sensor to observe the change on the gauge that displays ‘Rotary Angle’ and ‘Rotary Voltage’

Support

The EdgeX Community DevKit is offered as a resource to help developers get hands on with EdgeX. The project makes no warranties around the hardware you are purchasing from third-parties, nor guarantees on service level. That being said – we are here to help!

If you have any questions or need help with your kit, join our community Mailing List or Slack.