Skip to content

Instantly share code, notes, and snippets.

@bprobbins
bprobbins / particle-cli-setup.sh
Last active November 27, 2021 15:25
sudo bash script for quickly installing the particle-cli onto Raspberry Pi
######################################################################
# Particle-cli setup script for Raspberry Pi
# by bprobbins
# Code leans heavily on audstanley's excellent nodejs installer:
# https://github.com/audstanley/NodeJs-Raspberry-Pi
#
# Run this installer in your home (usually pi) directory.
# In your home directory, enter the following in your terminal:
# sudo bash particle-cli-setup.sh
# Once running, please don't interrupt the script. It can take awhile
@bprobbins
bprobbins / purpleairSPI-V5.ino
Created September 28, 2020 03:08
Particle Photon code to display PurpleAir sensor data on Digole SPI OLED
//Spurpleair.ino - code to display pm2_5 air concentration
//as reported by one selected purpleair community sensor
//Would be nice if possible to average over several sensors and also
//if use of Strings could be eliminated in HttpClient library
#include <Particle.h>
#include <clickButton.h>
#include <HttpClient.h>
#include <sampledata.h>
#include <math.h>
#include <Particle.h>
#include <LoRa.h> //https://github.com/sandeepmistry/arduino-LoRa
/*
#define RFM95_CS A2
#define RFM95_RST D4
#define RFM95_INT D2
*/
#define RF95_FREQ 915.0
//Employs Particle Xenon, Adafruit Ultimate GPS Feather,
//and Adafruit RF95 Feather Radio
#include <Adafruit_GPS.h>
#include <Particle.h>
#include <SPI.h>
#include <LoRa.h> //https://github.com/sandeepmistry/arduino-LoRa
SYSTEM_MODE(MANUAL);
SYSTEM_THREAD(ENABLED);
@bprobbins
bprobbins / featherM0-lora-client-reliable-datagram.ino
Last active May 4, 2020 16:58
Arduino code for Adafruit M0 radio
/*
Basic client for Adafruit Feather LoRa radios.
This is based on the RadioHead library for RF95, but has all
the required pins and setup for Feather LoRa's.
NOTE: You need to select a unique radio address for this to work
*/
#include <Adafruit_GPS.h>
#include <RHReliableDatagram.h>
#include <RH_RF95.h>
@bprobbins
bprobbins / argon-lora-gps-client.ino
Last active May 4, 2020 16:55
Particle argon lora gps client
#include <Adafruit_GPS.h>
#include <RF9X-RK.h> //https://github.com/rickkas7/RF9X-RK
#include <RHReliableDatagram.h>
#include <RH_RF95.h>
#include <SPI.h>
#define CLIENT_ADDRESS 1
#define SERVER_ADDRESS 2
#define RFM95_CS D6
@bprobbins
bprobbins / photon-gps-reliable-datagram-server.ino
Last active May 4, 2020 16:56
Particle photon reliable datagram server for gps client
#include <RF9X-RK.h> //https://github.com/rickkas7/RF9X-RK
#include <RHReliableDatagram.h>
#include <RH_RF95.h>
#include <SPI.h>
#define CLIENT_ADDRESS 1
#define SERVER_ADDRESS 2
@bprobbins
bprobbins / xenon-reliable-client.cpp
Last active May 4, 2020 16:56
Particle xenon rf9x reliable datagram client
#include <Particle.h>
#include <RF9X-RK.h> //https://github.com/rickkas7/RF9X-RK
#include <RHReliableDatagram.h>
#include <RH_RF95.h>
#include <SPI.h>
#define CLIENT_ADDRESS 1
#define SERVER_ADDRESS 2