wPi | Name | Mode | L | R | Mode | Name | wPi |
---|---|---|---|---|---|---|---|
3.3v | 01 | 02 | 5v | ||||
8 | SDA.1 | ALT0 | 03 | 04 | 5V | ||
9 | SCL.1 | ALT0 | 05 | 06 | GND | ||
7 | GPIO. 7 | IN | 07 | 08 | ALT0 | TxD | 15 |
GND | 09 | 10 | ALT0 | RxD | 16 | ||
0 | GPIO. 0 | IN | 11 | 12 | IN | GPIO. 1 | 1 |
2 | GPIO. 2 | IN | 13 | 14 | GND | ||
3 | GPIO. 3 | IN | 15 | 16 | IN | GPIO. 4 | 4 |
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
using System; | |
namespace functest | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.WriteLine("Hello World!"); |
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
# This will use the apt-get package manager to install three prerequiste packages. | |
sudo apt-get install curl libunwind8 gettext | |
# Download the latest .NET Core Runtime for ARM32. This is refereed to as armhf on the Daily Builds page https://github.com/dotnet/core-setup | |
wget -O dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-linux-arm.tar.gz | |
# Create a destination folder and extract the downloaded package into it. | |
sudo mkdir -p /opt/dotnet && sudo tar zxf dotnet.tar.gz -C /opt/dotnet | |
# Set up a symbolic link to a directory on the path so we can call dotnet |
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
[Unit] | |
Description=Appliance | |
Requires=network-online.target | |
After=network-online.target | |
[Service] | |
Type=simple | |
ExecStart=/home/pi/apps/Appliance/Appliance | |
Restart=always | |
StartLimitInterval=5min |
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
public async Task Initialize() | |
{ | |
while (true) | |
{ | |
try | |
{ | |
Log.Information("Azure IoT Hub trying to initialize"); | |
_deviceClient = null; | |
_deviceClient = DeviceClient.CreateFromConnectionString(Config.DeviceConnectionString, TransportType.Mqtt); | |
_deviceClient.SetConnectionStatusChangesHandler(async (s, r) => await ConnectionStatusChanged(s, r)); |
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
private async Task ConnectionStatusChanged(ConnectionStatus status, ConnectionStatusChangeReason reason) | |
{ | |
// https://github.com/Azure/azure-iot-sdk-csharp/pull/741 | |
//Log.Information("Azure IoT Hub connection status Changed Status: {status} Reason: {reason}", status, reason); | |
//if (status == ConnectionStatus.Connected && reason == ConnectionStatusChangeReason.Connection_Ok) | |
//{ | |
// Log.Information("Client connected (initially and after a successful retry)."); | |
//} |
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
namespace AWSServerless1 | |
{ | |
/// <summary> | |
/// The Main function can be used to run the ASP.NET Core application locally using the Kestrel webserver. | |
/// It is now also the main entry point for the custom runtime. | |
/// </summary> | |
public class LocalEntryPoint | |
{ | |
private static readonly LambdaEntryPoint LambdaEntryPoint = new LambdaEntryPoint(); | |
private static readonly Func<APIGatewayProxyRequest, ILambdaContext, Task<APIGatewayProxyResponse>> Func = LambdaEntryPoint.FunctionHandlerAsync; |
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
ARG VERSION=3.1-alpine | |
# Acknowledgements: | |
# This file was dervied with the help of a combination of https://github.com/ironPeakServices/iron-alpine/blob/master/Dockerfile | |
# and these 2 blog posts https://medium.com/01001101/containerize-your-net-core-app-the-right-way-35c267224a8d and https://medium.com/asos-techblog/minimising-your-attack-surface-by-building-highly-specialised-docker-images-example-for-net-b7bb177ab647 | |
# Stage 1: Build application | |
FROM mcr.microsoft.com/dotnet/core/sdk:$VERSION AS build-env | |
WORKDIR /build |
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
#!/usr/bin/env sh | |
# Acknowledgements: | |
# Most of this file was derived from https://github.com/ironPeakServices/iron-alpine/blob/master/Dockerfile | |
# with some additions from https://medium.com/asos-techblog/minimising-your-attack-surface-by-building-highly-specialised-docker-images-example-for-net-b7bb177ab647 | |
# fail if a command fails | |
set -e | |
set -o pipefail |
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
#!/usr/bin/env sh | |
# Acknowledgement: | |
# Most of this file was derived from https://github.com/ironPeakServices/iron-alpine/blob/master/post-install.sh | |
# fail if a command fails | |
set -e | |
set -o pipefail | |
# remove apk package manager |
OlderNewer