androidthings / sensorhub-cloud-iot Goto Github PK
View Code? Open in Web Editor NEWSensor-based data collection device publishing to Cloud IoT Core
License: Apache License 2.0
Sensor-based data collection device publishing to Cloud IoT Core
License: Apache License 2.0
There is a huge choice of cheap BMP280 Barometric Pressure Sensor Breakout Boards on Amazon, eBay or AliExpress like these ones:
https://www.amazon.com/Wrisky-GY-BMP280-3-3-Pressure-Precision-Atmospheric/dp/B01KZ6S06O
https://www.aliexpress.com/item/I2C-SPI-BMP280-3-3-Digital-Barometric-Pressure-Altitude-Sensor-High-Precision-Atmospheric-Module-Replace-BMP180/32681667220.html
You can use it instead of original Adafruit BMP280, the only thing you need is using the following pinout:
VCC -> +3.3V (J8 pin 1)
GND -> Ground (J8 pin 9)
SCL -> I2C1 SCL (J8 pin 5)
SDA -> I2C1 SDA (J8 pin 3)
CSB -> to +3.3V through a pull-up resistor (I2C bus selection if HIGH)
SDO -> to +3.3V through a pull-up resistor (0x77 I2C bus addr selection if HIGH)
EC
in this command:adb shell am start -e project_id <PROJECT_ID> -e cloud_region <REGION> -e registry_id <REGISTRY_ID> -e device_id <DEVICE_ID> [-e key_algorithm <one of RSA,EC>] com.example.androidthings.sensorhub/.SensorHubActivity
the key point is -e key_algorithm
, which allows RSA
and EC
, and EC
is actually ES256
:
ES256 key pair using the Eliptic Curve algorithm
See Google Cloud Internet of Things Core - Creating Public/Private Key Pairs
ES256_X509
:This function in AuthKeyGenerator.class
is actually for _X509
public void initialize() throws GeneralSecurityException, IOException {
if (certificate instanceof X509Certificate) { // is true
private void writeCertificatePEM(OutputStream os) throws GeneralSecurityException, IOException {
os.write("-----BEGIN CERTIFICATE-----\n".getBytes());
os.write(Base64.encode(certificate.getEncoded(), Base64.DEFAULT));
os.write("-----END CERTIFICATE-----\n".getBytes());
}
I can't find the key pair (private and public) on the device
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.