Skip to content

Instantly share code, notes, and snippets.

Avatar

Henri Pihkala hpihkala

View GitHub Profile
@hpihkala
hpihkala / lht65_decoder.js
Created Mar 25, 2021
Helium LHT65 decoder function
View lht65_decoder.js
// 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 Feb 26, 2018
Produce data to Streamr over HTTP (example)
View produce-example.js
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', {