Giter Club home page Giter Club logo

lightningdevicesdk's Introduction

LightningDeviceSDK

The LightningDeviceSDK allows hardware manufacturers and researchers to connect their data aquisition devices to LabChart Lightning. This is accomplished by writing plugin software using Typescript.

This repository does not provide any functionality, only example files and typed interfaces. You will need LabChart Lightning with a valid license in order to run your device plugin and connect your device.

Get LabChart Lightning. Take advantage of our free 30 day trial while you are in the setup phase of your plugin.

Find out more. Benefits of integrating with LabChart Lightning and options for enhanced promotion and sales growth opportunities.

Tell us about yourself. If you would like notifications regarding new resources and opportunities, such as promoting your device to researchers, then please fill out our contact form.

**The LightningDeviceSDK is currently under development and is subject to change.**

Supported Device Classes

  • Serial
  • Bluetooth over Serial (Serial Port Profile)
  • More to come...

Change Log

See Changelog.

Upcoming Features

  • Base classes to help with getting started
  • Plugins work for non-admin users
  • Better error messaging

Getting Started

Minimum Requirements

  • LabChart Lightning
  • A text editor

Recommended Device Development Workflow and Initial Setup

When starting out, it is useful to be able to detect possible device implementation errors early, plus make and test improvements rapidly. Therefore, it is strongly recommended to do the following.

Install the needed dependencies:

If you're developing Arduino firmware:

  • Arduino IDE - https://www.arduino.cc/en/Main/Software
    • Arduino core(s) for the intended board(s)
    • For best possible time synchronization between devices over USB, we recommend SAM51 based boards, e.g. (e.g. Adafruit Feather M4 etc. and Sparkfun Thing+ SAMD51)
    • Optionally, the Arduino extension for Visual Studio Code
    • firmware examples for several boards exist in examples\firmware.

Clone this repo to your working environment

At the command line, install packages that will assist with development:

$ npm install

Note: npm is the Node Package Manager which comes with Node.js and should already be installed with the steps above.

If you are using Visual Studio Code you can open a terminal from the Terminal menu:

open terminal

And then run npm install:

npm install

In order for your plugin file to be loaded by Lightning it must be placed into the following location:

(Windows)
C:\Users\[USERNAME]\Documents\LabChart Lightning\Plugins\Devices

(MacOS)
~/Documents/LabChart Lightning/Plugins/devices

However, to speed up development you can instead work within your current location. Focusing in on the top left of VS Code you also can see an explorer button. Clicking on that button will allow you to see the structure of the project, and in particular, the ./development/ directory.


development-folder

The above image shows the path to an example device plugin file:

./development/devices/Device/Device.ts

Then run npm run watch in your terminal.

npm run watch

This watches for any changes to .js or .ts files located under ./development/, automatically copying the updated file(s) to the above mentioned Documents/LabChart Lightning/Plugins/ directory. In this way you an see the resulting changes as early as possible, and therefore speed up development.

Note: LabChart Lightning must be relaunched to re-compile device plugin files.

More Setup Steps

Here, you can go a little deeper and make sure that your plug-in file is being detected, and that you can find compilation errors.

Overview

Once your environment is set, you'll need an overview of the requirements for a device plug-in file.

Advanced Topics

Runtime debugging your device script.

Customizing Lightning's user interface for your device.

Inter-device time synchronization time synch.

License

BSD 3-Clause Clear

lightningdevicesdk's People

Contributors

ch-adi avatar kitadamsadi avatar ajackson-adi avatar petersuggate avatar tbennett-adi avatar rgroenendal avatar dependabot[bot] avatar m-lieshout-adi avatar

Stargazers

Deng Shanliang avatar MediCollector avatar Ji Yang avatar Jan Lebert avatar Mohamad Atayi avatar Kit Adams avatar  avatar  avatar

Watchers

James Cloos avatar  avatar  avatar Allan Ramsay avatar  avatar  avatar

lightningdevicesdk's Issues

DeviceConnectionInfo has incorrect parameter names

When using a DeviceConnectionInfo(usually in the scope of checkDeviceIsPresent), the deviceConnection has the incorrect parameter names for things like pnpId and friendlyName. Debugging reveals that what is actually given is deviceConnection.pnpid and deviceConnection.friendlyname(i.e. not camel case).

This need to be fixed in Lightning or our typing needs to be fixed.

A workaround is to cast deviceConnection as any.

Example device code broken by upgrade in TypeScript version

When Lightning was upgraded to 1.4 the version of TypeScript it was compiled against was upgraded. All plugins are compiled against this version, and the version bump for TypeScript created a breaking change - try catch clauses now implicitly have their error object type as unknown instead of any.

The example plugins need to be updated to compile against this newer version of TypeScript to stay compatible with the latest versions of Lightning. This is as simple as adding explicit any types to the catch clauses.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.