-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7e45d4c
commit cb3b198
Showing
6 changed files
with
160 additions
and
102 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
5fb888ed4e3a0b47a34e71a0c3c7c7e7e6f039eb | ||
caab2b1da07a0c19ba585975a8d3d99815c2c54e |
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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,101 @@ | ||
|
||
@echo off | ||
|
||
:: Check if PlatformIO is installed | ||
pip show platformio > nul 2>&1 | ||
if %errorlevel% neq 0 ( | ||
echo PlatformIO is not installed. Proceeding with installation... | ||
pip install platformio | ||
if %errorlevel% neq 0 ( | ||
echo Error during PlatformIO installation. | ||
exit /b %errorlevel% | ||
) else ( | ||
echo PlatformIO has been successfully installed. | ||
) | ||
) else ( | ||
echo PlatformIO is already installed. | ||
) | ||
|
||
:: Create a temporary file with the result of the pip show platformio command | ||
pip show platformio > pip_show_platformio_info.txt | ||
|
||
:: Set the default location of the text file | ||
set file_path="pip_show_platformio_info.txt" | ||
|
||
:: Search the text file for the line containing "Location:" | ||
for /f "delims=: tokens=1,*" %%A in ('findstr /n "Location:" "%file_path%"') do ( | ||
set "line_number=%%A" | ||
set "location=%%B" | ||
) | ||
|
||
:: Remove leading and trailing spaces from the location | ||
set "location=%location:~10%" | ||
|
||
:: Output everything after "Location:" | ||
echo Everything after "Location:" in line %line_number%: %location% | ||
|
||
:: Remove "lib\site-packages" from the location and add "Scripts\platformio.exe" | ||
set "platformio_exe_path=%location:lib\site-packages=Scripts\platformio.exe%" | ||
echo %platformio_exe_path% | ||
|
||
:: Check if the platformio.exe file exists | ||
if exist "%platformio_exe_path%" ( | ||
echo Path to platformio.exe: %platformio_exe_path% | ||
) else ( | ||
echo Unable to find platformio.exe file. Check the installation path. | ||
) | ||
|
||
:: Path to the Arduino project | ||
set project_path=.\ | ||
|
||
:: Arduino board type (e.g., uno, nano, etc.) | ||
set board_type=nanoatmega328_oled | ||
|
||
:: Port to which Arduino is connected | ||
set port=arduino_port | ||
|
||
:: Calling PlatformIO CLI to upload the project | ||
%platformio_exe_path% run --target upload -d %project_path% -e %board_type% | ||
|
||
:: Check if the operation was successful | ||
if %errorlevel% neq 0 ( | ||
echo Error uploading the project. | ||
exit /b %errorlevel% | ||
) else ( | ||
echo The project has been successfully uploaded to Arduino. | ||
) | ||
set log_file=deploy.log | ||
( | ||
set current_datetime=%date% %time% | ||
echo Log started at: %current_datetime% | ||
) > "%log_file%" 2>&1 | ||
|
||
echo check Python | ||
( | ||
echo Checking if Python is installed... | ||
python --version | ||
if %errorlevel% neq 0 ( | ||
echo Python is not installed. Please install Python and try again. | ||
echo Press Enter to exit. | ||
pause >nul | ||
exit /b %errorlevel% | ||
) else ( | ||
echo Python is already installed. | ||
) | ||
) >> "%log_file%" 2>&1 | ||
|
||
echo check Platform IO | ||
( | ||
|
||
:: Check if PlatformIO is installed | ||
echo Checking if PlatformIO is installed... | ||
pip show platformio > pip_check.txt | ||
findstr /C:"WARNING: Package(s) not found" pip_check.txt | ||
if %errorlevel% equ 0 ( | ||
echo PlatformIO is not installed. Proceeding with installation... | ||
pip install platformio | ||
if %errorlevel% neq 0 ( | ||
echo Error during PlatformIO installation. | ||
echo Press Enter to exit. | ||
pause >nul | ||
exit /b %errorlevel% | ||
) else ( | ||
echo PlatformIO has been successfully installed. | ||
) | ||
) else ( | ||
echo PlatformIO is already installed. | ||
) | ||
)>> "%log_file%" 2>&1 | ||
|
||
echo locate Platform IO | ||
( | ||
:: Create a temporary file with the result of the pip show platformio command | ||
pip show platformio > pip_show_platformio_info.txt | ||
|
||
:: Set the default location of the text file | ||
set file_path="pip_show_platformio_info.txt" | ||
|
||
:: Search the text file for the line containing "Location:" | ||
for /f "delims=: tokens=1,*" %%A in ('findstr /n "Location:" "%file_path%"') do ( | ||
set "line_number=%%A" | ||
set "location=%%B" | ||
) | ||
|
||
:: Remove leading and trailing spaces from the location | ||
set "location=%location:~10%" | ||
|
||
:: Output everything after "Location:" | ||
echo Everything after "Location:" in line %line_number%: %location% | ||
|
||
:: Remove "lib\site-packages" from the location and add "Scripts\platformio.exe" | ||
set "platformio_exe_path=%location:lib\site-packages=Scripts\platformio.exe%" | ||
echo %platformio_exe_path% | ||
|
||
:: Check if the platformio.exe file exists | ||
if exist "%platformio_exe_path%" ( | ||
echo Path to platformio.exe: %platformio_exe_path% | ||
) else ( | ||
echo Unable to find platformio.exe file. Check the installation path. | ||
) | ||
|
||
echo Setting the path to the Arduino project... | ||
set project_path=.\ | ||
|
||
echo Setting the Arduino board type... | ||
set board_type=nanoatmega328_oled | ||
|
||
echo Setting the port to which Arduino is connected... | ||
set port=arduino_port | ||
|
||
echo Calling PlatformIO CLI to upload the project... | ||
%platformio_exe_path% run --target upload -d %project_path% -e %board_type% | ||
|
||
echo Checking if the operation was successful... | ||
if %errorlevel% neq 0 ( | ||
echo Error uploading the project. | ||
) else ( | ||
echo The project has been successfully uploaded to Arduino. | ||
) | ||
|
||
echo Log saved to %log_file%. | ||
) >> "%log_file%" 2>&1 | ||
|
||
echo Press Enter to exit. | ||
:: Wait for user to press Enter before exiting | ||
pause >nul |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Name: platformio | ||
Version: 6.1.15 | ||
Summary: Your Gateway to Embedded Software Development Excellence. Unlock the true potential of embedded software development with PlatformIO's collaborative ecosystem, embracing declarative principles, test-driven methodologies, and modern toolchains for unrivaled success. | ||
Home-page: https://platformio.org | ||
Author: PlatformIO Labs | ||
Author-email: contact@piolabs.com | ||
License: Apache Software License | ||
Location: f:\msys64\mingw64\lib\python3.9\site-packages | ||
Requires: ajsonrpc, bottle, click, colorama, marshmallow, pyelftools, pyserial, requests, semantic-version, starlette, tabulate, uvicorn, wsproto | ||
Required-by: |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Name: platformio | ||
Version: 6.1.15 | ||
Summary: Your Gateway to Embedded Software Development Excellence. Unlock the true potential of embedded software development with PlatformIO's collaborative ecosystem, embracing declarative principles, test-driven methodologies, and modern toolchains for unrivaled success. | ||
Home-page: https://platformio.org | ||
Author: PlatformIO Labs | ||
Author-email: contact@piolabs.com | ||
License: Apache Software License | ||
Location: f:\msys64\mingw64\lib\python3.9\site-packages | ||
Requires: ajsonrpc, bottle, click, colorama, marshmallow, pyelftools, pyserial, requests, semantic-version, starlette, tabulate, uvicorn, wsproto | ||
Required-by: |