Initial commit of Arduino libraries
This commit is contained in:
49
AsyncMQTT_ESP32/scripts/CI/build_examples_pio.sh
Normal file
49
AsyncMQTT_ESP32/scripts/CI/build_examples_pio.sh
Normal file
@@ -0,0 +1,49 @@
|
||||
#!/bin/bash
|
||||
|
||||
#pip install -U platformio
|
||||
#platformio update
|
||||
platformio lib -g install AsyncTCP
|
||||
platformio lib -g install ESPAsyncTCP
|
||||
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[0;33m'
|
||||
NC='\033[0m'
|
||||
|
||||
lines=$(find ./examples/ -maxdepth 1 -mindepth 1 -type d)
|
||||
retval=0
|
||||
while read line; do
|
||||
if [[ "$line" != *ESP8266 && "$line" != *ESP32 ]]
|
||||
then
|
||||
echo -e "========================== BUILDING $line =========================="
|
||||
echo -e "${YELLOW}SKIPPING${NC}"
|
||||
continue
|
||||
fi
|
||||
echo -e "========================== BUILDING $line =========================="
|
||||
if [[ -e "$line/platformio.ini" ]]
|
||||
then
|
||||
# skipping
|
||||
#output=$(platformio ci --lib="." --project-conf="$line/platformio.ini" $line 2>&1)
|
||||
:
|
||||
else
|
||||
if [[ "$line" == *ESP8266 ]]
|
||||
then
|
||||
output=$(platformio ci --lib="." --project-conf="scripts/CI/platformio_esp8266.ini" $line 2>&1)
|
||||
else
|
||||
output=$(platformio ci --lib="." --project-conf="scripts/CI/platformio_esp32.ini" $line 2>&1)
|
||||
fi
|
||||
fi
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "$output"
|
||||
echo -e "Building $line ${RED}FAILED${NC}"
|
||||
retval=1
|
||||
else
|
||||
echo -e "${GREEN}SUCCESS${NC}"
|
||||
fi
|
||||
done <<< "$lines"
|
||||
|
||||
# cleanup
|
||||
platformio lib -g uninstall AsyncTCP
|
||||
platformio lib -g uninstall ESPAsyncTCP
|
||||
|
||||
exit "$retval"
|
||||
16
AsyncMQTT_ESP32/scripts/CI/platformio_esp32.ini
Normal file
16
AsyncMQTT_ESP32/scripts/CI/platformio_esp32.ini
Normal file
@@ -0,0 +1,16 @@
|
||||
; PlatformIO Project Configuration File
|
||||
;
|
||||
; Build options: build flags, source filter
|
||||
; Upload options: custom upload port, speed and extra flags
|
||||
; Library options: dependencies, extra library storages
|
||||
; Advanced options: extra scripting
|
||||
;
|
||||
; Please visit documentation for the other options and examples
|
||||
; https://docs.platformio.org/page/projectconf.html
|
||||
|
||||
[env:esp32]
|
||||
platform = espressif32
|
||||
board = esp32dev
|
||||
framework = arduino
|
||||
build_flags =
|
||||
-Wall
|
||||
16
AsyncMQTT_ESP32/scripts/CI/platformio_esp8266.ini
Normal file
16
AsyncMQTT_ESP32/scripts/CI/platformio_esp8266.ini
Normal file
@@ -0,0 +1,16 @@
|
||||
; PlatformIO Project Configuration File
|
||||
;
|
||||
; Build options: build flags, source filter
|
||||
; Upload options: custom upload port, speed and extra flags
|
||||
; Library options: dependencies, extra library storages
|
||||
; Advanced options: extra scripting
|
||||
;
|
||||
; Please visit documentation for the other options and examples
|
||||
; https://docs.platformio.org/page/projectconf.html
|
||||
|
||||
[env:esp8266]
|
||||
platform = espressif8266
|
||||
board = esp01_1m
|
||||
framework = arduino
|
||||
build_flags =
|
||||
-Wall
|
||||
28
AsyncMQTT_ESP32/scripts/get-fingerprint/get-fingerprint.py
Normal file
28
AsyncMQTT_ESP32/scripts/get-fingerprint/get-fingerprint.py
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import argparse
|
||||
import ssl
|
||||
import hashlib
|
||||
|
||||
parser = argparse.ArgumentParser(description='Compute SSL/TLS fingerprints.')
|
||||
parser.add_argument('--host', required=True)
|
||||
parser.add_argument('--port', default=8883)
|
||||
|
||||
args = parser.parse_args()
|
||||
print(args.host)
|
||||
|
||||
cert_pem = ssl.get_server_certificate((args.host, args.port))
|
||||
cert_der = ssl.PEM_cert_to_DER_cert(cert_pem)
|
||||
|
||||
md5 = hashlib.md5(cert_der).hexdigest()
|
||||
sha1 = hashlib.sha1(cert_der).hexdigest()
|
||||
sha256 = hashlib.sha256(cert_der).hexdigest()
|
||||
print("MD5: " + md5)
|
||||
print("SHA1: " + sha1)
|
||||
print("SHA256: " + sha256)
|
||||
|
||||
print("\nSHA1 as array initializer:")
|
||||
print("const uint8_t fingerprint[] = {0x" + ", 0x".join([sha1[i:i+2] for i in range(0, len(sha1), 2)]) + "};")
|
||||
|
||||
print("\nSHA1 as function call:")
|
||||
print("mqttClient.addServerFingerprint((const uint8_t[]){0x" + ", 0x".join([sha1[i:i+2] for i in range(0, len(sha1), 2)]) + "});")
|
||||
Reference in New Issue
Block a user