This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://github.com/helium/console-decoders | |
function Decoder(bytes, port) { | |
//Payload Formats of LHT65 Deveice | |
return { | |
//Battery Level | |
battery_level: | |
{ | |
"0":"Ultra Low", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', { |