Skip to content

Instantly share code, notes, and snippets.

@hpihkala
hpihkala / lht65_decoder.js
Created March 25, 2021 12:21
Helium LHT65 decoder function
// https://github.com/helium/console-decoders
function Decoder(bytes, port) {
//Payload Formats of LHT65 Deveice
return {
//Battery Level
battery_level:
{
"0":"Ultra Low",
@hpihkala
hpihkala / produce-example.js
Created February 26, 2018 14:09
Produce data to Streamr over HTTP (example)
const fetch = require('node-fetch');
// Stream ID
const TEST_STREAM = 'MY_STREAM_ID'
// User API key (OR anonymous Stream key with write permission to the stream)
const TEST_KEY = 'MY_KEY'
// Function to POST data points to the API
async function produceToStreamr(msg, streamId, apiKey) {
const res = await fetch('https://www.streamr.com/api/v1/streams/'+streamId+'/data', {