Skip to content

Instantly share code, notes, and snippets.

@salfare
salfare / meshcore_var.txt
Last active February 22, 2026 10:32
meshcore var
# get bootloader available from DEV as of 21.2.26
#https://github.com/meshcore-dev/MeshCore/commit/c2abe894c9d3095b013087c5ad1695e887b7f7ca
#also in https://github.com/mattzzw/MeshCore/releases/tag/v1.13.0-evo_0.1.9
get bootloader.ver #command for NRF52
Board with:
RFM95(W) Semtech 1276 LORAWAN http://www.hoperf.com/upload/rf/RFM95_96_97_98W.pdf
Arduino Pro Mini Atmega328P 3.3V 8Mhz
----------------
In Arduino IDE
Set Board to ARDUINO Pro or Pro Mini
Atmega328P 3.3V 8Mhz
function Decoder(bytes) {
// Decode an uplink message from a buffer
// (array) of bytes to an object of fields.
// var Lat = ((bytes[2] <<8) | bytes[3] <<16 | bytes[4] <<24 | bytes[5]) /100000;
// var Lon = ((bytes[6] <<8) | bytes[7] <<16 | bytes[8] <<24 | bytes[9]) /100000;
var temp = ((((bytes[0] << 8) | bytes[1])/100 ) -40).toFixed(1);
var batt = (((bytes[2] << 8) | bytes[3])/100).toFixed(2);
var humd = (((bytes[4] << 8) | bytes[5])/100).toFixed(1);
var ldr = (bytes[6]) *4;
/*******************************************************************************
* Copyright (c) 2015 Thomas Telkamp and Matthijs Kooijman
*
* Permission is hereby granted, free of charge, to anyone
* obtaining a copy of this document and accompanying files,
* to do whatever they want with them without any restriction,
* including, but not limited to, copying, modification and redistribution.
* NO WARRANTY OF ANY KIND IS PROVIDED.
*
* This example sends a valid LoRaWAN packet with static payload,
@salfare
salfare / local_conf.json
Created April 27, 2017 13:21
local_conf.json
{
"gateway_conf": {
"gateway_ID": "BEEEEF0000000001",
// "gateway_ID": "B827EBFFFEA05465",
"servers": [ { "server_address": "router.eu.thethings.network", "serv_port_up": 1700, "serv_port_down": 1700, "serv_enabled": true } ],
"ref_latitude": 47.367,
"ref_longitude": 8.3782,
"ref_altitude": 490,
"contact_email": "stefan@alfare.net",
"description": "ttn-ic880a"
@salfare
salfare / global_conf.json
Last active April 27, 2017 13:19
/opt/ttn-gateway/bin/global_conf.json
{
"SX1301_conf": {
"lorawan_public": true,
"clksrc": 1, /* radio_1 provides clock to concentrator */
"radio_0": {
"enable": true,
"type": "SX1257",
"freq": 867500000,
"rssi_offset": -166.0,
"tx_enable": true
@salfare
salfare / syslog ttn.gw start
Last active April 27, 2017 13:42
TTN syslog during gw start
sudo systemctl stop ttn-gateway
# wait a few seconds
# start tail
sudo tail -f /var/log/syslog
# start sttn-gatway again
sudo systemctl start ttn-gateway