Coder Social home page Coder Social logo

flower-power-history's Introduction

flower-power-history

node.js lib for decoding Parrot Flower Power history file.

Install

$ npm install flower-power-history

Usage

const FlowerPowerHistory = require('flower-power-history')
const fs = require('fs')

const history = FlowerPowerHistory(b64History, startupTime)
const stream = fs.createWriteStream('history.csv')
stream.once('open', (fd) => {
  history.writeCSV(stream)
  stream.end()
})

File structure

  • Header

Size: 0X10

Index Type Value
0x0 unsigned int16 Unknown
0x2 unsigned int16 Nb entries
0x4 unsigned int32 Last entry time
0x8 unsigned int16 First entry index
0xA unsigned int16 Last entry index
0xC unsigned int16 Session ID
0xE unsigned int16 Period
  • Entry

Size: 0xC

Index Type Value
0x0 unsigned int16 Air temperature
0x2 unsigned int16 Light
0x4 unsigned int16 Soil EC
0x6 unsigned int16 Soil temperature
0x8 unsigned int16 Soil VWC
0xA unsigned int16 Battery level

Conversions

  • Temperature:

0.0473711045 * value + -11.19891627 => °C

  • Light:

10981.31391 * exp ( 1 / value) + -10981.3812 => mol / m² / d

  • Soil VWC:

0.179814297 * value + -40.76741498 => %

  • Battery level:

0.2865304553 * value + -177.3583506 => %

  • Soil EC:

TODO

TODO

  • convert soil EC raw value to dS/m

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.