13
ISOBlue An Open Source Project to Bring Agricultural Machinery Data to the Cloud 11/21/2014 Alex Layton, Purdue University

ISOBlue An Open Source Project to Bring Agricultural Machinery Data to the Cloud 11/21/2014Alex Layton, Purdue University

Embed Size (px)

Citation preview

Page 1: ISOBlue An Open Source Project to Bring Agricultural Machinery Data to the Cloud 11/21/2014Alex Layton, Purdue University

Alex Layton, Purdue University

ISOBlue

An Open Source Project to Bring Agricultural Machinery Data to the Cloud

11/21/2014

Page 2: ISOBlue An Open Source Project to Bring Agricultural Machinery Data to the Cloud 11/21/2014Alex Layton, Purdue University

Alex Layton, Purdue University 2

ISOBUS Overview

• Communication protocol (ISO 11783) used in agricultural industry• The ISOBUS network is composed of two separate CAN busses

– Tractor (Engine) Bus– Implement Bus

• The ISOBUS bitrate is 250 kbps (per bus)• ISOBUS data is sent using messages with the above format• The data of a message is identified by its PGN (Parameter Group

Number)– To interpret a message’s data, one must have access to the specification of its

corresponding Parameter Group11/21/2014

Page 3: ISOBlue An Open Source Project to Bring Agricultural Machinery Data to the Cloud 11/21/2014Alex Layton, Purdue University

Alex Layton, Purdue University 3

ISOBUS DataA variety of useful data are present on the ISOBUS network of agricultural machinery, e.g.• “As applied” data

– Location– Speed– Target application rate– Actual application rate

• Yield data– Mass flow rate– Moisture– Location– Speed

11/21/2014

Page 4: ISOBlue An Open Source Project to Bring Agricultural Machinery Data to the Cloud 11/21/2014Alex Layton, Purdue University

Alex Layton, Purdue University 4

ISOBlue Device• Platform is a BeagleBone Black

– Runs Angstrom, a kind of Linux

• Connects to the ISOBUS network with a CAN cape which has multiple CAN interfaces– Cape is compatible with SocketCAN

• Talks to Android over Bluetooth to forward ISOBUS messages– Uses USB Bluetooth Dongle

CAN Cape

BeagleBone Black

Bluetooth

USB

SPI

11/21/2014

Page 5: ISOBlue An Open Source Project to Bring Agricultural Machinery Data to the Cloud 11/21/2014Alex Layton, Purdue University

Alex Layton, Purdue University 5

System Overview

Main Components• ISOBlue Daemon software• libISOBlue Android library

Cloud

Implement Bus• GPS

Tractor Bus• Engine• Flow

sensor

Cell / WiFi

ISOBlue Data FlowCombine

ISOBUS

ISOBlue Daemon

SocketCANISOBUS ModuleISOBlue

Device

AndroidDevice

libISOBlue

3rd Party App

Bluetooth

11/21/2014

Page 6: ISOBlue An Open Source Project to Bring Agricultural Machinery Data to the Cloud 11/21/2014Alex Layton, Purdue University

Alex Layton, Purdue University 6

ISOBlue Daemon SoftwareSoftware written to work as a “server” for the Android library• Runs on ISOBlue, waiting for an Android device

to connect using libISOBlue• Monitors ISOBUS network with SocketCAN and

ISOBUS kernel module– SocketCAN is the de facto standard CAN driver for

Linux– The ISOBUS kernel module is an addition to this driver,

which runs as part of Linux rather than as an application

• Stores received messages in a database– Database used is LevelDB from Google– Its purpose it to efficiently store and retrieve messages

on the SD card

• Forwards ISOBUS messages from SocketCAN and/or the database to libISOBlue

ISOBUS from combine

ISOBlue Daemon

SocketCANISOBUS Module

Bluetooth to libISOBlue

Data Flow

11/21/2014

ISOBlue Device

Page 7: ISOBlue An Open Source Project to Bring Agricultural Machinery Data to the Cloud 11/21/2014Alex Layton, Purdue University

Alex Layton, Purdue University 7

libISOBlue Android Library

Custom written in Java, runs on the Android device• Receives ISOBUS messages forwarded by ISOBlue

– Talks to ISOBlue over Bluetooth– Tries to automatically reconnect when connection is lost

• Presents a simple socket like interface to the app using it– At a basic level a socket is an object which when you read it you

are returned a piece of data someone else sent to you since the last time you read the socket

– Sockets can be used to read data off either bus of the ISOBUS network

– Buffered sockets can be used to read data from before the Android device connected to ISOBlue

– Sockets give PGN, SA, DA, data bytes, and timestamp for each message

• The library can be used to set filters on which ISOBUS messages ISOBlue receives– Allows choosing which PGNs to receive and on which bus

Cell/WiFi to Cloud

libISOBlue

3rd Party App

Bluetooth fromISOBlue Device

Data Flow

11/21/2014

Page 8: ISOBlue An Open Source Project to Bring Agricultural Machinery Data to the Cloud 11/21/2014Alex Layton, Purdue University

Alex Layton, Purdue University 8

Yield Monitor App

• Written by Pat Sabpisal• Receives GNSS and Grain Flow ISOBUS

messages using libISOBlue Android library• Uses the received ISOBUS data to generate

a yield map and shows it on a Google Map• Updates the yield map in real-time as

ISOBUS data is received

11/21/2014

Page 9: ISOBlue An Open Source Project to Bring Agricultural Machinery Data to the Cloud 11/21/2014Alex Layton, Purdue University

Alex Layton, Purdue University 9

Logging/Cloud App• Written by myself• Receives all ISOBUS messages using

libISOBlue Android library– Displays messages on screen– Logs messages to SQLite database on

Android device’s SD card– Uploads messages to cloud (Google Drive)

11/21/2014

Image taken from thewildblogger.com

Page 10: ISOBlue An Open Source Project to Bring Agricultural Machinery Data to the Cloud 11/21/2014Alex Layton, Purdue University

Alex Layton, Purdue University 10

OADA Compliant ISOBlue• No Android device needed• Uses REST API to upload ISOBUS messages as JSON

– Supports SSL and OAUTH 2.0 Tokens– Supports compression to reduce data usage

• Works over Wi-Fi– Could work over cell if ISOBlue had it

11/21/2014

http://openag.io

Page 11: ISOBlue An Open Source Project to Bring Agricultural Machinery Data to the Cloud 11/21/2014Alex Layton, Purdue University

Alex Layton, Purdue University 11

Current ISOBlue/OADA Setup• ISOBlue is in Aaron’s combine logging data• Uses a Wi-Fi bridge to connect to Aaron’s iPad (for Internet only)• Data is uploaded to an AWS server• JSON Data is formatted like so (before compression)

{"bus":"0","pgn":"0f004","dst":"04","data":"f17d884c2cc0ffff","timestamp":946684951.807465,"src":"00“

}

11/21/2014

Page 12: ISOBlue An Open Source Project to Bring Agricultural Machinery Data to the Cloud 11/21/2014Alex Layton, Purdue University

Alex Layton, Purdue University 12

Changes to ISOBlue• Software running on ISOBlue modified

– Use HTTP rather than Bluetooth– Format data as JSON rather than something I made up– Add data compression– My Android library replaced with OADA

• Much of the code on ISOBlue from before was reused• Wi-Fi bridge connected to Ethernet port for Internet connection

– Makes no difference to code as long as Linux is connected to Internet

11/21/2014

Page 13: ISOBlue An Open Source Project to Bring Agricultural Machinery Data to the Cloud 11/21/2014Alex Layton, Purdue University

Alex Layton, Purdue University 13

AcknowledgementsThis work has been sponsored by:USDA/NIFA Project title: IMPROVING AGRICULTURAL MANAGEMENT WITH AUTOGENIC MOBILE TECHNOLOGY

and by the these companies:• Oxbow Agriculture, LLC• Enterprise Group, Ltd.• CrescoAg• FarmLogs

11/21/2014