EdgeX Community 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..

LEARN MORE

Hardware

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

Note: This DevKit requires Ubuntu Linux 18.10 (64 bit)

GET IT NOW

GrovePi+

The GrovePi+ 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.

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 THE RASPBERRY PI 3B+
GET THE GROVE PI KIT
GET THE BME680 SENSOR

Note: Temperature and Humidity Sensor available in the starter kit is not supported. Instead BME680 is used.

Hardware Connection

The GrovePI+ board is mounted on the Raspberry PI as shown below. 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-1

I2C

BME680 Sensor

I2C-2

I2C

RGB Backlit LCD

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 (BME680)

Y

Get Temperature, Pressure and Humidity
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

  1. Download Ubuntu 20.04 LTS – 64 bit available for Raspberry Pi 3 from the Ubuntu site.
  2. Extract the image ubuntu-20.04-preinstalled-server-arm64+raspi.img using the command
    - unxz ubuntu-20.04-preinstalled-server-arm64+raspi.img.xz
    Note: The image above was available at the time of testing. If a newer version is available, download it.
  3. Flash the image to a FAT32 formatted SD card
  4. After flashing SD card, mount locally and modify the following files in system-boot:
    config.txt – disable uart i.e. #enable_uart=1
    syscfg.txt – disable uart and spi i.e. #enable_uart=1 and #dtparam=spi=on
  5. Insert SD card in theRaspberry Pi and power on to boot.
  6. After bootup, upgrade the kernel, to get the latest update
    sudo apt update
    sudo apt dist-upgrade

Software Setup

Install docker-ce and set the sudo permission:

  1. Install docker-ce (run the following on the command line)sudo apt update
    sudo apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    sudo add-apt-repository "deb [arch=arm64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
    sudo apt update
    sudo apt install docker-ce
  2. Add user to the docker group
    sudo usermod -aG docker $USER
  3. Log out and log back in for the change to take effect.

Install docker-compose

sudo apt install docker-compose

Install Node-RED

sudo apt update
sudo apt install nodejs npm
sudo npm install -g --unsafe-perm node-red

Start Node-RED

node-red

On a web browser, type
http://localhost:1880
or if your browser is on a different machine:
http://your.ip.add.ress:1880

Note:  You must install Node-RED and the Node-RED dashboard as described below if the connected sensors use Node-RED. 

Install the Node-RED dashboard

Add the dashboard items to the palette as follows:

  1. Select the Palette tab of the User Settings dialog box in Node-RED
  2. Select the Install option from the Manage Palette menu
  3. Search for node-red-dashboard
  4. Install node-red-dashboard

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 the Node-RED Dashboard.
    open a web browser and enter http://localhost:1880/ui
  3. Pull the images from dockerhub to run the device grove service with the EdgeX core services on Raspberry Pi
    cd demo-grove-pi
    docker-compose -f docker-compose-demo-grove.yml up --detach

Note:

  1. The mqtt-broker needed to publish the data required by the Node-RED flow is configured in the docker-compose file.
  2. 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 commandsSet 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:49992/api/v1/device/all/Set_GreenLed
Turn Off curl -H “Content-Type: application/json” -d ‘{“Green-LED”:”false”}’ http://localhost:49992/api/v1/device/all/Set_GreenLed
Red LED Turn On curl -H “Content-Type: application/json” -d ‘{“Red-LED”:”true”}’ http://localhost:49992/api/v1/device/all/Set_RedLed
Turn Off curl -H “Content-Type: application/json” -d ‘{“Red-LED”:”false”}’ http://localhost:49992/api/v1/device/all/Set_RedLed
Blue LED Turn On curl -H “Content-Type: application/json” -d ‘{“Blue-LED”:”true”}’ http://localhost:49992/api/v1/device/all/Set_BlueLed
Turn Off curl -H “Content-Type: application/json” -d ‘{“Blue-LED”:”false”}’ http://localhost:49992/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:49992/api/v1/device/all/Write_String
Relay Set curl -H “Content-Type: application/json” -d ‘{“Grove-Relay”:”true”}’ http://localhost:49992/api/v1/device/all/Set_Relay
UnSet curl -H “Content-Type: application/json” -d ‘{“Grove-Relay”:”false”}’ http://localhost:49992/api/v1/device/all/Set_Relay
Buzzer Turn On curl -H “Content-Type: application/json” -d ‘{“Grove-Buzzer”:”true”}’ http://localhost:49992/api/v1/device/all/Set_Buzzer
Turn Off curl -H “Content-Type: application/json” -d ‘{“Grove-Buzzer”:”false”}’ http://localhost:49992/api/v1/device/all/Set_Buzzer
Get Button Get State curl -H “Content-Type: application/json” http://localhost:49992/api/v1/device/all/Get_ButtonState
Rotary Sensor Get Rotary Sensor Measurements curl -H “Content-Type: application/json” http://localhost:49992/api/v1/device/all/Get_RotarySensorMeasurements
Sound Sensor Get Sound Intensity curl -H “Content-Type: application/json” http://localhost:49992/api/v1/device/all/Get_SoundIntensity
Light Sensor Get Light Intensity curl -H “Content-Type: application/json” http://localhost:49992/api/v1/device/all/Get_LightIntensity
BME680 Sensor Get_TempPressHumidity curl -H “Content-Type: application/json” http://localhost:49992/api/v1/device/all/Get_TempPressHumidity

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 49992

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.