DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Integrating PostgreSQL Databases with ANF: Join this workshop to learn how to create a PostgreSQL server using Instaclustr’s managed service

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • Revolutionizing IoT With Digital Temperature Sensors
  • Information Security: AI Security Within the IoT Industry
  • Application Integration for IoT Devices: A Detailed Guide To Unifying Your Ecosystem
  • Is Your Internet of Things Fully Online?

Trending

  • AI for Web Devs: Project Introduction and Setup
  • Chronicle Services: Low Latency Java Microservices Without Pain
  • Understanding Europe's Cyber Resilience Act and What It Means for You
  • Distributed Tracing Best Practices
  1. DZone
  2. Data Engineering
  3. Big Data
  4. Rocking the IoT world with Bulldog Library

Rocking the IoT world with Bulldog Library

An introduction to Bulldog: a Java library for single board computer platforms like Raspberry Pi.

Stefan Bunciak user avatar by
Stefan Bunciak
·
Nov. 03, 15 · Tutorial
Like (4)
Save
Tweet
Share
3.52K Views

Join the DZone community and get the full member experience.

Join For Free

Bulldog Library

It is a Java library providing developers with GPIO and other low-level IO interfaces like I2C, SPI, or PWM. Currently supports various Single Board Computer (SBC) platforms, including Raspberry Pi, BeagleBoneBlack, and CubieBoard.

Bulldog aims to be platform agnostic - to write a single piece of code that can be run on multiple platforms. The only thing that needs to be changed in the following snippet is the string identifier of GPIO pin to work on different SBCs.

public class BulldogLED {

  public static void main(String[] args) {
    //Detect the board we are running on
    Board board = Platform.createBoard();

    //Set up a digital output
    DigitalOutput output = board.getPin("P1_11").as(DigitalOutput.class);

    // Blink the LED
    output.high();
    BulldogUtil.sleepMs(1000);
    output.low();
    }
}


The latest 0.2.0 release was mainly about stabilizing and finishing platform detection capabilities, however we are already looking into our ultimate goal, that is to get rid of all filesystem interaction and omiting all the kernel modules, and interact directly with memory of the controlled SBC. This will boost the performance to the sky, so stay tuned!

Integration

There is also a component for Apache Camel that wraps Bulldog Library features. At the moment it supports only GPIO, however support for the rest of Bulldog features is already knocking on the door. 

An example is worth a thousand words. The following snippet is all you need to build a REST endpoint which controls a GPIO pin on your SBC. It will work on all platforms supported by Bulldog Library. 

<camelContext trace="false" xmlns="http://camel.apache.org/schema/spring">
    <restConfiguration bindingMode="auto" component="jetty" port="8080" />
    <rest path="/rest">
      <post uri="/led">
        <to uri="bulldog://gpio?pin=P1_11" />
      </post>
    </rest>
</camelContext>


So don't hesitate, grab the library and rock the IoT world!

References

  • http://silverspoon.io

  • https://github.com/px3/bulldog

Library IoT

Opinions expressed by DZone contributors are their own.

Related

  • Revolutionizing IoT With Digital Temperature Sensors
  • Information Security: AI Security Within the IoT Industry
  • Application Integration for IoT Devices: A Detailed Guide To Unifying Your Ecosystem
  • Is Your Internet of Things Fully Online?

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: