diff --git a/platformio.custom.ini b/platformio.custom.ini index 5a28053..a6d0ba1 100644 --- a/platformio.custom.ini +++ b/platformio.custom.ini @@ -238,3 +238,18 @@ build_flags = ${RP2040_custom_releases_TP.build_flags} -D OKNXHW_REG1_BASE_V1 +; Release REG2_PiPico +[env:release_OKNXHW_REG2_PiPico] +extends = RP2040_custom_releases_TP, RP2040_2MB +build_flags = + ${RP2040_custom_releases_TP.build_flags} + -D OKNXHW_REG2_PIPICO_V1 +board = rpipico + +; Release REG2_PiPico_W +[env:release_OKNXHW_REG2_PiPico_W] +extends = RP2040_custom_releases_TP, RP2040_2MB +build_flags = + ${RP2040_custom_releases_TP.build_flags} + -D OKNXHW_REG2_PIPICO_W_V1 +board = rpipicow diff --git a/restore/Restore-Dependencies.ps1 b/restore/Restore-Dependencies.ps1 index 7dc240d..80df47d 100644 --- a/restore/Restore-Dependencies.ps1 +++ b/restore/Restore-Dependencies.ps1 @@ -1,4 +1,8 @@ <# +Open ■ +┬────┴ Restore-Dependencies +■ KNX 2024 OpenKNX - Erkan Çolak + FILEPATH: restore/Restore-Dependencies.ps1 This script is designed to automate the process of managing dependencies in a software project, making it easier to @@ -31,33 +35,37 @@ Here's a high-level description of what it does: 8. Many core functions of the script are modularized and can be used outside of this script, providing flexibility and reusability. #> + # Optional Input Parameters param( # Set the Git checkout mode [ValidateSet("Branch", "Hash")] - [string]$GitCheckoutMode = "Branch", # Branch or Hash. Default is Branch + [string]$GitCheckoutMode= "Branch", # Branch or Hash. Default is Branch # Force the script to recreate symbolic links - [switch]$ForceRecreateSymLinks = $true, # Default is $true + [switch]$ForceRecreateSymLinks= $true, # Default is $true # "dependencies.txt" file - [string]$DependenciesFile = "dependencies.txt", # Default is "dependencies.txt" + [string]$DependenciesFile= "dependencies.txt", # Default is "dependencies.txt" # Check for privileges (Windows only) - [switch]$CheckForDeveloperMode = $true, # Default is $true - [switch]$CHeckForSymbolicLinkPermissions = $true, # Default is $true - [switch]$CheckForAdminOnly = $false # Default is $false + [switch]$CheckForDeveloperMode= $true, # Default is $true + [switch]$CheckForSymbolicLinkPermissions= $true, # Default is $true + [switch]$CheckForAdminOnly= $false # Default is $false ) # Global Variables -# If the user has no permissions to create symbolic links with 'New-Item', the script will try to use mklink to create symbolic links. -$Auto_Use_mklink_To_Create_SymLinks = $true # Default is $true +# If the user has no permissions to create symbolic links with 'New-Item', the script will try to use mklink to create symbolic links. + +#Those variables are used to check if the script is running on Windows. Only on Windows we can use mklink to create symbolic links. +# If $Auto_Use_mklink_To_Create_SymLinks is $true, the script will automatically use mklink to create symbolic links. +$Auto_Use_mklink_To_Create_SymLinks = $false # Default is $false # Ignore the permissions to create symbolic links with 'New-Item' and use mklink to create symbolic links. -$Foce_Use_mklink_To_Create_SymLinks = $false # Default is $false +$Force_Use_mklink_To_Create_SymLinks = $true # Default is $true. If $Auto_Use_mklink_To_Create_SymLinks is $true, this variable is ignored. # Set the Write-Host message behavior -[switch]$Verbose = $false # Default is $false -[switch]$DebugMsg = $false # Default is $false +[switch]$Verbose= $false # Default is $false +[switch]$DebugMsg= $false # Default is $false function Test-Administrator { return (([Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole('Administrators')).If($true, $false) @@ -68,8 +76,7 @@ function Test-DeveloperMode { # Check if the registry key exists $isDeveloperMode = (Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" -Name "AllowDevelopmentWithoutDevLicense" -ErrorAction Stop) -eq 1 return $isDeveloperMode - } - catch { + } catch { Write-Host -ForegroundColor Red "Error: $_" return $false } @@ -99,8 +106,7 @@ function Test-SymbolicLinkPermission { Write-Host -ForegroundColor DarkRed "- TargetName: $($err.CategoryInfo.TargetName)" Write-Host -ForegroundColor DarkRed "- ScriptName: $($err.InvocationInfo.ScriptName)" Write-Host -ForegroundColor DarkRed "- ErrorId: $($err.FullyQualifiedErrorId)" - } - else { + } else { if ($Verbose) { Write-Host -ForegroundColor DarkRed "- Error Message: $($err.Exception.Message)" Write-Host -ForegroundColor DarkRed "- ErrorId: $($err.FullyQualifiedErrorId)" @@ -108,13 +114,12 @@ function Test-SymbolicLinkPermission { } if ($err.FullyQualifiedErrorId -eq "UnauthorizedAccess" -or $err.FullyQualifiedErrorId -eq "NewItemSymbolicLinkElevationRequired,Microsoft.PowerShell.Commands.NewItemCommand") { - if ($Verbose) { Write-Host -ForegroundColor Red "- Symbolic link creation requires elevated privileges." ([Char]0x2717) } - Write-Host -ForegroundColor Red "- User $($env:USERNAME) has not permissions to create symbolic links with 'New-Item'." ([Char]0x2717) + if ($Verbose) { Write-Host -ForegroundColor Red "- Symbolic link creation requires elevated privileges." ([Char]0x2717) } + Write-Host -ForegroundColor Red "- User $($env:USERNAME) has not permissions to create symbolic links with 'New-Item'." ([Char]0x2717) break } } - } - else { + } else { # There was no error, so the symbolic link was created successfully if ($Verbose) { Write-Host -ForegroundColor Green "- TestSymbolic link created successfully." } Write-Host -ForegroundColor Green "- User $($env:USERNAME) has permissions to create symbolic links with New-Item." ([Char]0x221A) @@ -131,13 +136,13 @@ function OpenKNX_ShowLogo($AddCustomText = $null) { #Write-Host "■" -ForegroundColor Green Write-Host "$( [char]::ConvertFromUtf32(0x25A0) )" -ForegroundColor Green $unicodeString = "$( [char]::ConvertFromUtf32(0x252C) )$( [char]::ConvertFromUtf32(0x2500) )$( [char]::ConvertFromUtf32(0x2500) )$( [char]::ConvertFromUtf32(0x2500) )$( [char]::ConvertFromUtf32(0x2500) )$( [char]::ConvertFromUtf32(0x2534) ) " - + if ($AddCustomText) { - #Write-Host "┳━━━━┻ $AddCustomText" -ForegroundColor Green + #Write-Host "┬────┴ $AddCustomText" -ForegroundColor Green Write-Host "$($unicodeString) $($AddCustomText)" -ForegroundColor Green } else { - #Write-Host "┳━━━━┻" -ForegroundColor Green + #Write-Host "┬────┴" -ForegroundColor Green Write-Host "$($unicodeString)" -ForegroundColor Green } @@ -149,41 +154,36 @@ function OpenKNX_ShowLogo($AddCustomText = $null) { function CheckForPrivileges { if ($IsWinEnv ) { - if ($CheckForAdminOnly) { - if ($Verbose) { Write-Host -ForegroundColor Yellow "- Checking if we are in Administrator privileges" } - if ( -not (Test-Administrator) ) { + if($CheckForAdminOnly) { + if($Verbose) { Write-Host -ForegroundColor Yellow "- Checking if we are in Administrator privileges" } + if( -not (Test-Administrator) ) { Write-Host -ForegroundColor Red "ERROR: Restore-Dependencies requires Administrator privileges to run!" Write-Host -ForegroundColor Red "- Please run the script again with Administrator privileges." exit 1 - } - else { Write-Host -ForegroundColor Green "- The script is running with Administrator privileges." ([Char]0x221A) } + } else { Write-Host -ForegroundColor Green "- The script is running with Administrator privileges." ([Char]0x221A) } } - if ($CheckForDeveloperMode) { - if ($Verbose) { Write-Host -ForegroundColor Yellow "- Checking if we are in Developer Mode" } - if ( -not (Test-DeveloperMode) ) { + if($CheckForDeveloperMode) { + if($Verbose) { Write-Host -ForegroundColor Yellow "- Checking if we are in Developer Mode" } + if( -not (Test-DeveloperMode) ) { Write-Host -ForegroundColor Red "ERROR: Restore-Dependencies requires Developer Mode to run!" Write-Host -ForegroundColor Red "- Please run the script again with Developer Mode." Write-Host -ForegroundColor Red "- If you are using Windows `>10, you can enable Developer Mode by going to Settings `> Update `& Security `> For developers and selecting Developer mode." exit 1 - } - else { Write-Host -ForegroundColor Green "- The script is running with Developer Mode." ([Char]0x221A) } + } else { Write-Host -ForegroundColor Green "- The script is running with Developer Mode." ([Char]0x221A) } } - if (-not $Foce_Use_mklink_To_Create_SymLinks -and $CHeckForSymbolicLinkPermissions) { - if ($Verbose) { Write-Host -ForegroundColor Yellow "- Checking if we have permissions to create symbolic links" } - if ( -not (Test-SymbolicLinkPermission) ) { - if ($Auto_Use_mklink_To_Create_SymLinks) { - $Script:Foce_Use_mklink_To_Create_SymLinks = $true + if(-not $Force_Use_mklink_To_Create_SymLinks -and $CheckForSymbolicLinkPermissions) { + if($Verbose) { Write-Host -ForegroundColor Yellow "- Checking if we have permissions to create symbolic links" } + if( -not (Test-SymbolicLinkPermission) ) { + if($Auto_Use_mklink_To_Create_SymLinks) { + $script:Force_Use_mklink_To_Create_SymLinks = $true Write-Host -ForegroundColor Yellow "- We have no permissions to create symbolic links with 'New-Item'. We will try to use mklink to create symbolic links." - } - else { + } else { Write-Host -ForegroundColor Red "ERROR: Restore-Dependencies requires permissions to create symbolic links to run!" Write-Host -ForegroundColor Red "- Please run the script again with Administrator privileges." exit 1 } - } - else { Write-Host -ForegroundColor Green "- The script has permissions to create symbolic links." ([Char]0x221A) } - } - else { Write-Host -ForegroundColor Green "- We will use mklink to create symbolic links." ([Char]0x221A) } + } else { Write-Host -ForegroundColor Green "- The script has permissions to create symbolic links." ([Char]0x221A) } + } else { Write-Host -ForegroundColor Green "- We will use mklink to create symbolic links." ([Char]0x221A) } } } @@ -203,14 +203,14 @@ function CheckOS { $script:IsMacOSEnv = (Get-Variable -Name "IsMacOS" -ErrorAction Ignore) -and $IsMacOS $script:IsWinEnv = !$IsLinuxEnv -and !$IsMacOSEnv - $CurrentOS = switch ($true) { + $CurrentOS = switch($true) { $IsLinuxEnv { "Linux" } $IsMacOSEnv { "MacOS" } $IsWinEnv { "Windows" } default { "Unknown" } } $PSVersion = "$($PSVersionTable.PSVersion.Major).$($PSVersionTable.PSVersion.Minor).$($PSVersionTable.PSVersion.Patch)" - if ($true) { Write-Host -ForegroundColor Green "- We are on $CurrentOS Build Environment with PowerShell $PSVersion" ([Char]0x221A) } + if($true) { Write-Host -ForegroundColor Green "- We are on $CurrentOS Build Environment with PowerShell $PSVersion" ([Char]0x221A) } } function ProcessDependencies($DependenciesFile) { # Check if the file exists @@ -229,25 +229,24 @@ function ProcessDependencies($DependenciesFile) { if ($line -notmatch '^-------' -and -not $line.StartsWith('#')) { $parts = $line -split ' ', 4 if ($parts.Count -lt 4) { - if ($Verbose) { Write-Host -ForegroundColor DarkYellow "Dependencies: Error on line ${lineNumber}: Line does not have the expected format and will be skipped: $line" } - } - else { + if($Verbose) { Write-Host -ForegroundColor DarkYellow "Dependencies: Error on line ${lineNumber}: Line does not have the expected format and will be skipped: $line" } + } else { $hash, $branch, $folders, $urlParts = $parts $folders = $folders -split '/' $urlParts = $urlParts -split '#' $url = $urlParts[0] - $branch = if ($urlParts.Count -gt 1) { $urlParts[1] } else { $branch } + $branch = if($urlParts.Count -gt 1) { $urlParts[1] } else { $branch } # Extract the project name from the URL $urlParts = $url -split '/' $projectNameWithExtension = $urlParts[-1] $projectName = $projectNameWithExtension -split '\.' | Select-Object -First 1 # Create a custom object for the project [PSCustomObject]@{ - "Hash" = $hash - "Branch" = $branch - "Folder" = $folders + "Hash" = $hash + "Branch" = $branch + "Folder" = $folders "FolderCount" = $folders.Count - "URL" = $url + "URL" = $url "ProjectName" = $projectName } } @@ -262,8 +261,8 @@ function Get-ProjectFiles($subprojects) { # Loop through each subproject foreach ($subproject in $subprojects) { # Find and Get the project file - $projectFile = $subproject | Select-Object BaseName - if ($Verbose) { Write-Host "- Get-ProjectFiles - Found existing project file: $($projectFile.BaseName)" -ForegroundColor Yellow } + $projectFile = $subproject | Select-Object BaseName + if($Verbose) { Write-Host "- Get-ProjectFiles - Found existing project file: $($projectFile.BaseName)" -ForegroundColor Yellow } # Check if the file name is not "README" and is not empty if ($projectFile.BaseName -ne "README" -and ![string]::IsNullOrWhiteSpace($projectFile.BaseName)) { @@ -275,40 +274,43 @@ function Get-ProjectFiles($subprojects) { # Return the list of project files return $projectFiles } -function CloneRepository($projectFilesGitInfo, $dependedProjects, $CloneDir, $CloneModeHash = $false) { +function CloneRepository($projectFilesGitInfo, $dependedProjects, $CloneDir, $CloneModeHash= $false) { # Loop through each depended project - if ($CloneModeHash -and $Verbose) { Write-Host "- CloneRepository - Using hash" -ForegroundColor Green } + if($CloneModeHash -and $Verbose) { Write-Host "- CloneRepository - Using hash" -ForegroundColor Green } foreach ($dependedProject in $dependedProjects) { # Initialize a flag to track if the project is found $hashMatch = $false $branchMatch = $false - if ($Verbose) { Write-Host "- CloneRepository - Check: '$($dependedProject.ProjectName)'" -ForegroundColor Green } + if($Verbose) { Write-Host "- CloneRepository - Check: '$($dependedProject.ProjectName)'" -ForegroundColor Green } # Loop through each project file's git information foreach ($projectFile in $projectFilesGitInfo) { # Check if projectFile contains valid data - if (($null -ne $projectFile.BaseName -and $projectFile.BaseName -ne "") -and + if (($null -ne $projectFile.BaseName -and $projectFile.BaseName -ne "") -and ($null -ne $dependedProject.ProjectName -and $dependedProject.ProjectName -ne "") -and - ( $projectFile.BaseName -match $dependedProject.ProjectName) ) { - if ($Verbose) { Write-Host "- CloneRepository - Found: '$($dependedProject.ProjectName)' - '$($projectFile.Path)'" -ForegroundColor Green } + ( $projectFile.BaseName -match $dependedProject.ProjectName) ) + { + if($Verbose) { Write-Host "- CloneRepository - Found: '$($dependedProject.ProjectName)' - '$($projectFile.Path)'" -ForegroundColor Green } #Compare the branches and hashes # Check if the branches match if (($null -ne $projectFile.TargetBranch -and $projectFile.TargetBranch -ne "") -and - $projectFile.TargetBranch -eq $dependedProject.Branch) { + $projectFile.TargetBranch -eq $dependedProject.Branch) + { # If the branches match, set the flag to true $branchMatch = $true - if ($Verbose) { Write-Host "- CloneRepository - Branch: '$($dependedProject.ProjectName)' - Both matches to ($($projectFile.TargetBranch))" -ForegroundColor Green } + if($Verbose) { Write-Host "- CloneRepository - Branch: '$($dependedProject.ProjectName)' - Both matches to ($($projectFile.TargetBranch))" -ForegroundColor Green } } # Check if the hashes match if (($null -ne $projectFile.TargetShortHash -and $null -ne $dependedProject.Hash) -and - $projectFile.TargetShortHash -match $dependedProject.Hash) { + $projectFile.TargetShortHash -match $dependedProject.Hash) + { # If the project is found, set the flag to true and break the loop $hashMatch = $true - if ($Verbose) { Write-Host "- CloneRepository - Hash: '$($dependedProject.ProjectName)' - Both matches to ($($projectFile.TargetShortHash))" -ForegroundColor Green } + if($Verbose) { Write-Host "- CloneRepository - Hash: '$($dependedProject.ProjectName)' - Both matches to ($($projectFile.TargetShortHash))" -ForegroundColor Green } } - if ($branchMatch -and $hashMatch) { - if ($Verbose) { Write-Host "- CloneRepository - Found: "$dependedProject.ProjectName" - "$projectFile.Path -ForegroundColor Green } - if ($Verbose) { Write-Host "- CloneRepository - Branches and Hashes matching: '$($dependedProject.ProjectName)'" -ForegroundColor Green } + if($branchMatch -and $hashMatch) { + if($Verbose) { Write-Host "- CloneRepository - Found: "$dependedProject.ProjectName" - "$projectFile.Path -ForegroundColor Green } + if($Verbose) { Write-Host "- CloneRepository - Branches and Hashes matching: '$($dependedProject.ProjectName)'" -ForegroundColor Green } break } break @@ -319,127 +321,118 @@ function CloneRepository($projectFilesGitInfo, $dependedProjects, $CloneDir, $Cl if (-not $branchMatch -and -not $hashMatch) { # Create the Git clone URL with the URL and the Hash from the dependency $GitClone = ($dependedProject.URL).ToString() - if ($Verbose) { Write-Host "- CloneRepository - '$($dependedProject.ProjectName)' not Found. Target does not exist." -ForegroundColor DarkYellow } + if($Verbose) { Write-Host "- CloneRepository - '$($dependedProject.ProjectName)' not Found. Target does not exist." -ForegroundColor DarkYellow } # Try to clone the repository try { - if ($IsWinEnv) { + if($IsWinEnv){ $CloneTarget = Join-Path $CloneDir $dependedProject.ProjectName - } - else { + } else { $CloneTarget = Join-Path -Path $CloneDir -ChildPath $dependedProject.ProjectName } - if ($Verbose) { Write-Host "- CloneRepository - CloneTarget: " $CloneTarget -ForegroundColor Green } - if ($Verbose) { Write-Host "- CloneRepository - Cloning '$($dependedProject.ProjectName)': '$GitClone' to '$CloneTarget'" -ForegroundColor Yellow } + if($Verbose) { Write-Host "- CloneRepository - CloneTarget: " $CloneTarget -ForegroundColor Green } + if($Verbose) { Write-Host "- CloneRepository - Cloning '$($dependedProject.ProjectName)': '$GitClone' to '$CloneTarget'" -ForegroundColor Yellow } - $DoClone = $true + $DoClone= $true # Check if the folder already exists if (Test-Path $CloneTarget -PathType Container) { # Check if it's a Git repository (contains .git directory) if (Test-Path (Join-Path $CloneTarget ".git") -PathType Container) { - if ($Verbose) { Write-Host "- CloneRepository - Cloning: The target directory is already a Git repository." -ForegroundColor Yellow } - $DoClone = $false - } - else { + if($Verbose) { Write-Host "- CloneRepository - Cloning: The target directory is already a Git repository." -ForegroundColor Yellow } + $DoClone= $false + } else { # The folder exists, but it's not a Git repository, so rename it - if ($true) { Write-Host "- CloneRepository - The directory already exists, but it's not a Git repository. Renaming..." -ForegroundColor Yellow } + if($true) { Write-Host "- CloneRepository - The directory already exists, but it's not a Git repository. Renaming..." -ForegroundColor Yellow } Rename-Item -Path $CloneTarget -NewName "${CloneTarget}_backup" -Force } } - if ($DoClone) { + if($DoClone) { Invoke-RestMethod -Uri $GitClone -Method Head -ErrorAction Stop; - if ($Verbose) { - $GitCmd = "git clone '$($GitClone)' '$($CloneTarget.ToString())'" - } - else { $GitCmd = "git clone -q '$($GitClone)' '$($CloneTarget.ToString())'" } + if($Verbose) { $GitCmd= "git clone '$($GitClone)' '$($CloneTarget.ToString())'" + } else { $GitCmd= "git clone -q '$($GitClone)' '$($CloneTarget.ToString())'" } Invoke-Expression $($GitCmd) #git clone -q '$GitClone' '$CloneTarget.ToString()' } - if ($true) { Write-Host "- CloneRepository - Cloning "$dependedProject.ProjectName": '$GitClone' to '$CloneTarget' Done"([Char]0x221A) -ForegroundColor Green } + if($true) { Write-Host "- CloneRepository - Cloning "$dependedProject.ProjectName": '$GitClone' to '$CloneTarget' Done"([Char]0x221A) -ForegroundColor Green } } # If the repository does not exist, catch the error catch { - if ($Verbose) { Write-Host "CloneRepository - Cloning Error: "$dependedProject.ProjectName"- Repository does not exist: "$GitClone -ForegroundColor DarkYellow } + if($Verbose) { Write-Host "CloneRepository - Cloning Error: "$dependedProject.ProjectName"- Repository does not exist: "$GitClone -ForegroundColor DarkYellow } } } # If the project is found, check out to the specific branch - if (-not $hashMatch -or -not $branchMatch) { - if ($Verbose) { Write-Host "- CloneRepository - Found: "$dependedProject.ProjectName" - "$dependedProject.URL -ForegroundColor Green } + if(-not $hashMatch -or -not $branchMatch) + { + if($Verbose) { Write-Host "- CloneRepository - Found: "$dependedProject.ProjectName" - "$dependedProject.URL -ForegroundColor Green } # If the repository already exists, switch to the corresponding branch $checkoutTarget = if ($CloneModeHash) { "Hash" } else { "Branch" } - if ($Verbose) { Write-Host "- CloneRepository -"$dependedProject.ProjectName"- Repository already exists. Checking out to the $($checkoutTarget)." -ForegroundColor Yellow } + if($Verbose) { Write-Host "- CloneRepository -"$dependedProject.ProjectName"- Repository already exists. Checking out to the $($checkoutTarget)." -ForegroundColor Yellow } try { # Check the installed Git version - if ($IsWinEnv) { + if($IsWinEnv){ $CloneTarget = Join-Path $CloneDir $dependedProject.ProjectName $GitDir = Join-Path $CloneTarget ".git" - } - else { + } else { $CloneTarget = Join-Path -Path $CloneDir -ChildPath $dependedProject.ProjectName $GitDir = Join-Path -Path $CloneTarget.TargetPath -ChildPath ".git" } - if ($Verbose) { Write-Host "- CloneRepository - $($checkoutTarget) - GitDir: "$GitDir -ForegroundColor Yellow } + if($Verbose) { Write-Host "- CloneRepository - $($checkoutTarget) - GitDir: "$GitDir -ForegroundColor Yellow } $GitCmd = "git --git-dir=""$($GitDir)"" --work-tree=""$($CloneTarget.ToString())""" - if ($Verbose) { Write-Host "- CloneRepository - $($checkoutTarget) - GitCmd: "$GitCmd -ForegroundColor Yellow } + if($Verbose) { Write-Host "- CloneRepository - $($checkoutTarget) - GitCmd: "$GitCmd -ForegroundColor Yellow } - if ($CloneModeHash) { + if($CloneModeHash) { $CheckOutTarget = $($dependedProject.Hash) # Optional: If the CloneModeHash is true, use the Hash - } - else { + } else { $CheckOutTarget = $($dependedProject.Branch) # If the CloneModeHash is false (default), use the Branch } if ((& git --version) -ge 'git version 2.23' -and $CloneModeHash -eq $false ) { $CheckOutMethod = "switch" # If the Git version is 2.23 or higher, use the 'switch' command - } - else { + } else { $CheckOutMethod = "checkout" # If the Git version is 2.23 or higher, use the 'switch' command } # Let's do the git checkout - if ($Verbose) { + if($Verbose) { Invoke-Expression "$GitCmd $CheckOutMethod $($CheckOutTarget)" - } - else { + } else { Invoke-Expression "$GitCmd $CheckOutMethod $($CheckOutTarget) -q" | Out-Null } - if ($true) { - $checkoutTarget = if ($CloneModeHash) { "Hash '$($dependedProject.Hash)'" } else { "Branch '$($dependedProject.Branch)'" } + if($true) { + $checkoutTarget = if ($CloneModeHash) { "Hash '$($dependedProject.Hash)'" } else { "Branch '$($dependedProject.Branch)'" } Write-Host "- CloneRepository - '$($dependedProject.ProjectName)' $($checkoutTarget) Checked out."([Char]0x221A) -ForegroundColor Green } } # If cannot check out to the branch, catch the error catch { - if ($Verbose) { - $checkoutTarget = if ($CloneModeHash) { "Hash '$($dependedProject.Hash)'" } else { "Branch '$($dependedProject.Branch)'" } - Write-Host "- CloneRepository - $($dependedProject.ProjectName) - Checkout Error! Cannot checkout $($checkoutTarget) Checked out."([Char]0x2717) -ForegroundColor DarkYellow - } + if($Verbose) { + $checkoutTarget = if ($CloneModeHash) { "Hash '$($dependedProject.Hash)'" } else { "Branch '$($dependedProject.Branch)'" } + Write-Host "- CloneRepository - $($dependedProject.ProjectName) - Checkout Error! Cannot checkout $($checkoutTarget) Checked out."([Char]0x2717) -ForegroundColor DarkYellow } } } } } function Get-GitInfo($path) { if ($IsWinEnv) { - $TargetDir = (Join-Path $path ".git").ToString() + $TargetDir= (Join-Path $path ".git").ToString() + } else { + $TargetDir= (Join-Path -Path $path -ChildPath ".git").ToString() } - else { - $TargetDir = (Join-Path -Path $path -ChildPath ".git").ToString() - } - if ($Verbose) { Write-Host "GitInfo - TargetDir: "$TargetDir -ForegroundColor Yellow } + if($Verbose) { Write-Host "GitInfo - TargetDir: "$TargetDir -ForegroundColor Yellow } if (Test-Path $TargetDir) { $ShortCommitHash = "git --git-dir ""$($TargetDir)"" log -1 --pretty=format:'%h'" $LongCommitHash = "git --git-dir ""$($TargetDir)"" log -1 --pretty=format:'%H'" $RemoteOriginURL = "git --git-dir ""$($TargetDir)"" config --get remote.origin.url" - if ($Verbose) { $ShortCommitHash = Invoke-Expression $ShortCommitHash } else { $ShortCommitHash = Invoke-Expression $ShortCommitHash | Out-Null } - if ($Verbose) { $LongCommitHash = Invoke-Expression $LongCommitHash } else { $LongCommitHash = Invoke-Expression $LongCommitHash | Out-Null } - if ($Verbose) { $RemoteOriginURL = Invoke-Expression $RemoteOriginURL } else { $RemoteOriginURL = Invoke-Expression $RemoteOriginURL | Out-Null } + if($Verbose) { $ShortCommitHash= Invoke-Expression $ShortCommitHash } else { $ShortCommitHash= Invoke-Expression $ShortCommitHash | Out-Null } + if($Verbose) { $LongCommitHash= Invoke-Expression $LongCommitHash } else { $LongCommitHash= Invoke-Expression $LongCommitHash | Out-Null } + if($Verbose) { $RemoteOriginURL = Invoke-Expression $RemoteOriginURL } else { $RemoteOriginURL = Invoke-Expression $RemoteOriginURL | Out-Null } - if ($Verbose) { Write-Host "GitInfo - Found git repo in directory: $path" -ForegroundColor Green } + if($Verbose) { Write-Host "GitInfo - Found git repo in directory: $path" -ForegroundColor Green } return @{ ShortHash = $ShortCommitHash @@ -448,19 +441,19 @@ function Get-GitInfo($path) { } } else { - if ($Verbose) { Write-Host "GitInfo - Not a git repo. Ignoring directory: $path" -ForegroundColor DarkYellow } + if($Verbose) { Write-Host "GitInfo - Not a git repo. Ignoring directory: $path" -ForegroundColor DarkYellow } return $null } } function CreateGitDependencyInfo($projectDir, $dependedProjects) { # Check if project files or project directory is null or empty if ( -not $projectDir -or -not $dependedProjects) { - if ($Verbose) { Write-Host "CreateGitDependencyInfo - Project files or project directory is null or empty." -ForegroundColor DarkYellow } - return @() + if($Verbose) { Write-Host "CreateGitDependencyInfo - Project files or project directory is null or empty." -ForegroundColor DarkYellow } + return @() } - # Iterate over each project file - $projectDependedList = $dependedProjects | ForEach-Object { - if ( $IsWinEnv ) { + # Iterate over each project file + $projectDependedList = $dependedProjects | ForEach-Object { + if( $IsWinEnv ){ $fullPath = Join-Path $projectDir $_.Folder[0] $fullPath = Join-Path $fullPath $_.Folder[1] $TargetPath = (Resolve-Path (Join-Path $projectDir '..') ).Path @@ -481,28 +474,26 @@ function CreateGitDependencyInfo($projectDir, $dependedProjects) { try { $gitDir = Join-Path -Path $TargetPath -ChildPath ".git" $TargetBranch = & git --git-dir $gitDir branch --show-current - } - catch { + } catch { Write-Host "Failed to get the current branch of project: $($_.ProjectName)" -ForegroundColor Red } - } - else { + } else { if ($Verbose) { Write-Host "CreateGitDependencyInfo - Target project: $($_.ProjectName) is not a git repo." -ForegroundColor DarkYellow } } # Create a new PSObject with the git information and return it New-Object PSObject -Property @{ - BaseName = $_.ProjectName - Path = $fullPath - Branch = $_.Branch - ShortHash = $_.Hash - LongHash = $gitInfo.LongHash - RemoteURL = $_.URL - TargetPath = $TargetPath - TargetBranch = $TargetBranch - TargetShortHash = $targetGitInfo.ShortHash - TargetLongHash = $targetGitInfo.LongHash - TargetRemoteURL = $targetGitInfo.RemoteURL + BaseName = $_.ProjectName + Path = $fullPath + Branch = $_.Branch + ShortHash = $_.Hash + LongHash = $gitInfo.LongHash + RemoteURL = $_.URL + TargetPath = $TargetPath + TargetBranch = $TargetBranch + TargetShortHash = $targetGitInfo.ShortHash + TargetLongHash = $targetGitInfo.LongHash + TargetRemoteURL = $targetGitInfo.RemoteURL } } return $projectDependedList @@ -511,68 +502,65 @@ function CreateSymbolicLink ($projectDir, $projectFiles) { # Check if projectDir and projectFiles are not empty if (-not $projectDir -or -not $projectFiles) { - if ($Verbose) { Write-Host "- CreateSymbolicLink - Project directory or project files are empty." -ForegroundColor DarkYellow } + if($Verbose) { Write-Host "- CreateSymbolicLink - Project directory or project files are empty." -ForegroundColor DarkYellow } return } foreach ($projectFile in $projectFiles) { $CreateSymLink = $true # Test if if a symbolic link exists - if ($Verbose) { Write-Host "- CreateSymbolicLink - Symbolic link test: $($projectFile.Path)" -ForegroundColor Yellow } + if($Verbose) { Write-Host "- CreateSymbolicLink - Symbolic link test: $($projectFile.Path)" -ForegroundColor Yellow } if ($null -ne $projectFile.Path -and $projectFile.Path -ne '' -and (Test-Path $projectFile.Path)) { - if ((Get-Item $projectFile.Path).Attributes.ToString().Contains("ReparsePoint")) { + if ((Get-Item $projectFile.Path).Attributes.ToString().Contains("ReparsePoint")) { # Seems that there is a valid link. Now lets get the linked Target of it $targetPath = (Get-Item $projectFile.Path) - if ($DebugMsg) { write-output $targetPath } + if($DebugMsg) { write-output $targetPath } # Get the target of the symbolic link - if ($IsMacOS -or $IsLinux) { - $symlink = $targetPath.target - } - else { $symlink = $targetPath.target[0] } + if($IsMacOS -or $IsLinux) { $symlink = $targetPath.target + } else { $symlink = $targetPath.target[0] } - if ($Verbose) { Write-Host "- CreateSymbolicLink - Found Symbolic Link: $($symlink)"-ForegroundColor DarkYellow } + if($Verbose) { Write-Host "- CreateSymbolicLink - Found Symbolic Link: $($symlink)"-ForegroundColor DarkYellow } # Now, lets create target link path $linkTarget = Join-Path $(Join-Path ".." "..") $projectFile.BaseName.ToString() # Check if we are on Windows and if we should use mklink to create the symbolic link - if ($IsWinEnv -and -not $Foce_Use_mklink_To_Create_SymLinks) { + if($IsWinEnv -and -not $Force_Use_mklink_To_Create_SymLinks) { $LinkTarget = Join-Path $(Split-Path -Path $projectDir -Parent) $ProjectFile.BaseName } # If the link target is the same as the project file name, set the CreateSymLink flag to false if ($symlink.ToString() -eq $linkTarget.ToString()) { - if (!$ForceRecreateSymLinks) { Write-Host "- CreateSymbolicLink - '$($ProjectFile.BaseName)'- A existing and valid symbolic link detected. Skip linking."([Char]0x221A) -ForegroundColor Green } - $CreateSymLink = $false + if(!$ForceRecreateSymLinks) { Write-Host "- CreateSymbolicLink - '$($ProjectFile.BaseName)'- A existing and valid symbolic link detected. Skip linking."([Char]0x221A) -ForegroundColor Green } + $CreateSymLink = $false } } - } - else { if (-not ($null -ne $projectFile.Path -and $projectFile.Path -ne '')) { $CreateSymLink = $false } } + } else { if (-not ($null -ne $projectFile.Path -and $projectFile.Path -ne '')) { $CreateSymLink = $false } } - if ($CreateSymLink -or $ForceRecreateSymLinks ) { + if($CreateSymLink -or $ForceRecreateSymLinks ) { # Create a symlink - if ($Verbose) { - $Message = "- CreateSymbolicLink - '$($ProjectFile.BaseName)' - No valid symbolic link detected. Creating new symbolic link." - if ( $ForceRecreateSymLinks ) { - $Message = "- CreateSymbolicLink - '$($ProjectFile.BaseName)' - Forcing to create new symbolic links." + if($Verbose) { + $Message= "- CreateSymbolicLink - '$($ProjectFile.BaseName)' - No valid symbolic link detected. Creating new symbolic link." + if( $ForceRecreateSymLinks ) { + $Message= "- CreateSymbolicLink - '$($ProjectFile.BaseName)' - Forcing to create new symbolic links." } Write-Host $Message -ForegroundColor Yellow } # Remove a existing symbolic link first - if ( ($ForceRecreateSymLinks -or ($null -ne $projectFile.Path -and $projectFile.Path -ne '')) -and - (Test-Path $projectFile.Path) ) { + if( ($ForceRecreateSymLinks -or ($null -ne $projectFile.Path -and $projectFile.Path -ne '')) -and + (Test-Path $projectFile.Path) ) { - if ($Verbose -and $ForceRecreateSymLinks ) { - $Message = "- CreateSymbolicLink - '$($ProjectFile.BaseName)' - Forcing to remove existing symbolic link: '$($projectFile.Path)'" + if($Verbose -and $ForceRecreateSymLinks ) { + $Message= "- CreateSymbolicLink - '$($ProjectFile.BaseName)' - Forcing to remove existing symbolic link: '$($projectFile.Path)'" Write-Host $Message -ForegroundColor Yellow } Remove-Item -Path $projectFile.Path -Force -Recurse if (!$?) { exit 1 } } - if ($DebugMsg) { write-output $ProjectFile } + if($DebugMsg) { write-output $ProjectFile } # Create the symbolic link to link the project file to the target $linkTarget = $ProjectFile.BaseName @@ -582,29 +570,26 @@ function CreateSymbolicLink ($projectDir, $projectFiles) { $CreateSymLinkCommand = "New-Item -ItemType SymbolicLink -Path '$($projectFile.Path)' -Target '$($linkValue)'" # Check if we are on Windows and if we should use mklink command to create the symbolic link - if ($IsWinEnv) { - if ( $Foce_Use_mklink_To_Create_SymLinks) { - $CreateSymLinkCommand = "cmd /C mklink /D ""$($projectFile.Path)"" ""$($linkValue)""" - } - else { + if($IsWinEnv) { + if ( $Force_Use_mklink_To_Create_SymLinks) { + $CreateSymLinkCommand = "cmd /C mklink /D ""$($projectFile.Path)"" ""$($linkValue)""" + } else { $TargetLinkDir = Split-Path -Path $projectDir -Parent $linkValue = Join-Path $TargetLinkDir $ProjectFile.BaseName $CreateSymLinkCommand = "New-Item -ItemType SymbolicLink -Path '$($projectFile.Path)' -Target '$($linkValue)'" } } - if ($Verbose) { Write-Host "- CreateSymbolicLink - '$($ProjectFile.BaseName)' - CreateSymLinkCommand: $($CreateSymLinkCommand)" -ForegroundColor Yellow } + if($Verbose) { Write-Host "- CreateSymbolicLink - '$($ProjectFile.BaseName)' - CreateSymLinkCommand: $($CreateSymLinkCommand)" -ForegroundColor Yellow } # Try to create the symbolic link try { - if ($Verbose) { - Invoke-Expression $CreateSymLinkCommand - } - else { - Invoke-Expression $CreateSymLinkCommand | Out-Null + if($Verbose) { + Invoke-Expression $CreateSymLinkCommand + } else { + Invoke-Expression $CreateSymLinkCommand | Out-Null } Write-Host "- CreateSymbolicLink - Symbolic link created at $($projectFile.Path) with target $linkValue"([Char]0x221A) -ForegroundColor Green - } - catch { + } catch { Write-Host "Error creating symbolic link: $_" -ForegroundColor Red exit 1 } @@ -619,7 +604,7 @@ Write-Host "Starting to Restore depended projects..." -ForegroundColor Green CheckOS # check on which os we are running CheckForPrivileges # check for privileges, which are needed to run the script -if ($Verbose) { Write-Host -ForegroundColor Yellow "- We assume, we start this script in the project's 'restore' directory." } +if($Verbose) { Write-Host -ForegroundColor Yellow "- We assume, we start this script in the project's 'restore' directory." } #Start-Sleep 30 Set-Location .. # Go one directory back, to get the project dir. # Now we are in the project directory @@ -627,11 +612,11 @@ Set-Location .. # Go one directory back, to get the project dir. # Call the ProcessDependencies function and store the result in the $dependedProjects variable Write-Host -ForegroundColor Yellow "- Reading the dependencies.txt file and processing each line." $dependedProjects = ProcessDependencies $DependenciesFile -if ( $dependedProjects.Count -eq 0) { +if( $dependedProjects.Count -eq 0) { Write-Host -ForegroundColor Red "- No dependencies found in dependencies.txt file. Please check the file." exit 1 # exit with error } -if ($DebugMsg) { $dependedProjects | ForEach-Object { Write-Output $_ } } # Output each depended project +if($DebugMsg) { $dependedProjects | ForEach-Object { Write-Output $_ } } # Output each depended project # Call the Get-ProjectFiles function with the content of the 'lib' directory and store the result in the $projectFiles variable # Check if the 'lib' directory exists @@ -639,8 +624,7 @@ Write-Host -ForegroundColor Yellow "- Checking if the 'lib' directory exists." if (Test-Path 'lib') { # Call the Get-ProjectFiles function with the content of the 'lib' directory and store the result in the $projectFiles variable $projectFiles = Get-ProjectFiles (Get-ChildItem 'lib') -} -else { +} else { Write-Host -ForegroundColor DarkYellow "- The 'lib' directory was not found and will be created in 3 seconds..." Start-Sleep -Seconds 3 New-Item -ItemType Directory -Path 'lib' | Out-Null @@ -648,23 +632,23 @@ else { } #Write-Host "Project files:" -if ($DebugMsg) { $projectFiles | ForEach-Object { Write-Output $_ } } # Output each project file +if($DebugMsg) { $projectFiles | ForEach-Object { Write-Output $_ } } # Output each project file # Get the current location and store it in the $projectDir variable $projectDir = Get-Location # Call the CreateGitDependencyInfo function with the current location and the project files and store the result in the $projectFilesGitInfo variable Write-Host -ForegroundColor Yellow "- Creating git dependency information for each project file." $projectFilesGitInfo = CreateGitDependencyInfo $projectDir $dependedProjects -if ($DebugMsg) { $projectFilesGitInfo | ForEach-Object { Write-Output $_ } } -# Output each project file's git information +if($DebugMsg) { $projectFilesGitInfo | ForEach-Object { Write-Output $_ } } + # Output each project file's git information # Call the CloneRepository function with the project files' git information and the depended projects Write-Host -ForegroundColor Yellow "- Checking, cloning and rebranching the git repositories for each dependency." $CloneDir = (Resolve-Path (Join-Path $projectDir '..')).Path -if ($Verbose) { Write-Host $CloneDir } +if($Verbose) { Write-Host $CloneDir } CloneRepository $projectFilesGitInfo $dependedProjects $CloneDir ($GitCheckoutMode -eq "Hash") -if ($Verbose) { Write-Host -ForegroundColor Yellow "- Checking and creating symbolic links for each project file." } +if($Verbose) { Write-Host -ForegroundColor Yellow "- Checking and creating symbolic links for each project file." } CreateSymbolicLink $projectDir $projectFilesGitInfo OpenKNX_ShowLogo -AddCustomText "Restore Dependencies: Done $([Char]0x221A)" \ No newline at end of file diff --git a/scripts/Build-Release.ps1 b/scripts/Build-Release.ps1 index 1171a07..092984f 100644 --- a/scripts/Build-Release.ps1 +++ b/scripts/Build-Release.ps1 @@ -32,36 +32,61 @@ if (!$?) { exit 1 } # build firmware based on generated headerfile +# Build firmware for each defined build +$parentDir = Split-Path -Path $PSScriptRoot -Parent +Write-Host "ScriptPath: $parentDir" + # build firmware for PiPico-BCU-Connector lib/OGM-Common/scripts/setup/reusable/Build-Step.ps1 release_PiPico_BCU_Connector firmware-PiPico-BCU-Connector uf2 +#lib/OGM-Common/scripts/setup/reusable/Build-Step.ps1 -pioEnv release_PiPico_BCU_Connector -firmwareName firmware-PiPico-BCU-Connector -binaryFormat uf2 -ProjectDir $parentDir if (!$?) { exit 1 } # build firmware for 1TE-RP2040-SmartMF lib/OGM-Common/scripts/setup/reusable/Build-Step.ps1 release_1TE_RP2040_SmartMF firmware-1TE-RP2040-SmartMF uf2 +#lib/OGM-Common/scripts/setup/reusable/Build-Step.ps1 -pioEnv release_1TE_RP2040_SmartMF -firmwareName firmware-1TE-RP2040-SmartMF -binaryFormat uf2 -ProjectDir $parentDir if (!$?) { exit 1 } # build firmware for OpenKNX-REG1-Base lib/OGM-Common/scripts/setup/reusable/Build-Step.ps1 release_OpenKNX_REG1_Controller2040 firmware-OpenKNX-REG1-BASE-V0 uf2 +#lib/OGM-Common/scripts/setup/reusable/Build-Step.ps1 -pioEnv release_OpenKNX_REG1_Controller2040 -firmwareName firmware-OpenKNX-REG1-BASE-V0 -binaryFormat uf2 -ProjectDir $parentDir if (!$?) { exit 1 } # build firmware for OpenKNX-REG1-Base lib/OGM-Common/scripts/setup/reusable/Build-Step.ps1 release_OpenKNX_REG1_BASE_V1 firmware-OpenKNX-REG1-BASE-V1 uf2 +#lib/OGM-Common/scripts/setup/reusable/Build-Step.ps1 -pioEnv release_OpenKNX_REG1_BASE_V1 -firmwareName firmware-OpenKNX-REG1-BASE-V1 -binaryFormat uf2 -ProjectDir $parentDir if (!$?) { exit 1 } # build firmware for RP2040 sensormodule breakout board lib/OGM-Common/scripts/setup/reusable/Build-Step.ps1 release_Sensormodul_Breakout_RP2040 firmware-Sensormodul-Breakout-RP2040 uf2 Sensormodul-Breakout-Board-Just-for-testers +#lib/OGM-Common/scripts/setup/reusable/Build-Step.ps1 -pioEnv release_Sensormodul_Breakout_RP2040 -firmwareName firmware-Sensormodul-Breakout-RP2040 -binaryFormat uf2 -productName Sensormodul-Breakout-Board-Just-for-testers -ProjectDir $parentDir if (!$?) { exit 1 } # build firmware for RP2040 sensormodule lib/OGM-Common/scripts/setup/reusable/Build-Step.ps1 release_Sensormodul_v40_RP2040 firmware-Sensormodul-v40-RP2040 uf2 Sensormodul-v4.x-RP2040 +#lib/OGM-Common/scripts/setup/reusable/Build-Step.ps1 -pioEnv release_Sensormodul_v40_RP2040 -firmwareName firmware-Sensormodul-v40-RP2040 -binaryFormat uf2 -productName Sensormodul-v4.x-RP2040 -ProjectDir $parentDir if (!$?) { exit 1 } -# build firmware based on generated headerfile for SAMD +# build firmware based on generated headerfile for SAMD Sensormodule v3.1 lib/OGM-Common/scripts/setup/reusable/Build-Step.ps1 release_Sensormodul_v31_SAMD firmware-Sensormodul-v31-SAMD bin Sensormodul-v3.1-SAMD +#lib/OGM-Common/scripts/setup/reusable/Build-Step.ps1 -pioEnv release_Sensormodul_v31_SAMD -firmwareName firmware-Sensormodul-v31-SAMD -binaryFormat bin -productName Sensormodul-v3.1-SAMD -ProjectDir $parentDir if (!$?) { exit 1 } +# build firmware based on generated headerfile for SAMD Sensormodule v3.0 lib/OGM-Common/scripts/setup/reusable/Build-Step.ps1 release_Sensormodul_v30_SAMD firmware-Sensormodul-v30-SAMD bin Sensormodul-v3.0-SAMD +#lib/OGM-Common/scripts/setup/reusable/Build-Step.ps1 -pioEnv release_Sensormodul_v30_SAMD -firmwareName firmware-Sensormodul-v30-SAMD -binaryFormat bin -productName Sensormodul-v3.0-SAMD -ProjectDir $parentDir +if (!$?) { exit 1 } + +# build firmware based on generated headerfile for REG2-PiPico +#lib/OGM-Common/scripts/setup/reusable/Build-Step.ps1 -productName OpenKNX-REG2-PiPico -pioEnv release_OKNXHW_REG2_PiPico -firmwareName firmware-OKNXHW-REG2-PiPico -binaryFormat uf2 +lib/OGM-Common/scripts/setup/reusable/Build-Step.ps1 release_OKNXHW_REG2_PiPico firmware-OKNXHW-REG2-PiPico uf2 + if (!$?) { exit 1 } +#build firmware based on generated headerfile for REG2-PiPico_W +#lib/OGM-Common/scripts/setup/reusable/Build-Step.ps1 -productName OpenKNX-REG2-PiPicoW -pioEnv release_OKNXHW_REG2_PiPico_W -firmwareName firmware-OpenKNX-REG2-PiPico_W -binaryFormat uf2 +lib/OGM-Common/scripts/setup/reusable/Build-Step.ps1 release_OKNXHW_REG2_PiPico_W firmware-OpenKNX-REG2-PiPico_W uf2 + +if (!$?) { exit 1 } + # TEMPORARY: We use our own generic updload files for this version Copy-Item scripts/data/* release/data -Force @@ -71,5 +96,5 @@ lib/OGM-Common/scripts/setup/reusable/Build-Release-Postprocess.ps1 $args[0] if (!$?) { exit 1 } if (Test-Path -Path release-collection -PathType Container) { - Copy-Item release/* release-collection/ -} + Copy-Item release/* release-collection/ +} \ No newline at end of file diff --git a/scripts/Readme-Hardware.md b/scripts/Readme-Hardware.md index b768de0..828103b 100644 --- a/scripts/Readme-Hardware.md +++ b/scripts/Readme-Hardware.md @@ -9,6 +9,8 @@ Die Software für dieses Release wurde auf folgender Hardware getestet und läuf * **OpenKNX-UP1-System** [OpenKNX-Wiki](https://github.com/OpenKNX/OpenKNX/wiki/OpenKNX-UP1), auf allen Varianten als Logikmodul lauffähig * **OpenKNX-REG1-Base** [OpenKNX-Wiki](https://github.com/OpenKNX/OpenKNX/wiki/REG1-Base), Logikmodul lauffähig * **OpenKNX-REG1-Base-IP** [OpenKNX-Wiki](https://github.com/OpenKNX/OpenKNX/wiki/REG1-Base-IP), Logikmodul (reines KNX-IP-Gerät) lauffähig +* **OpenKNX-REG2-PiPico** [OpenKNX-Wiki](https://github.com/OpenKNX/OpenKNX-Pi-Pico-REG2), Logikmodul lauffähig +* **OpenKNX-REG2-PiPicoW** [OpenKNX-Wiki](https://github.com/OpenKNX/OpenKNX-Pi-Pico-REG2), Logikmodul lauffähig Andere Hardware kann genutzt werden, jedoch muss das Projekt dann neu compiliert werden. Alle notwendigen Teile für ein Aufsetzen der Build-Umgebung inclusive aller notwendigen Projekte finden sich im [OpenKNX-Projekt](https://github.com/OpenKNX)