From 65976a2b232a55647ce57e3c84c2ff28554a1b5b Mon Sep 17 00:00:00 2001 From: josh Date: Wed, 27 Sep 2023 22:29:08 -0400 Subject: [PATCH 1/3] Added enviroment_setup.md --- enviroment_setup.md | 94 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100755 enviroment_setup.md diff --git a/enviroment_setup.md b/enviroment_setup.md new file mode 100755 index 00000000..3566c56d --- /dev/null +++ b/enviroment_setup.md @@ -0,0 +1,94 @@ +## Clone repositories +1. Clone InfiniTime: +```bash +git clone https://github.com/InfiniTimeOrg/InfiniTime.git +cd InfiniTime +git submodule update --init +``` + +2. Clone InfiniSim: +```bash +cd .. #Ignore this line if you already cd'd into the diretory you want it cloned into +git clone --recursive https://github.com/InfiniTimeOrg/InfiniSim.git +``` + +## Install dependencies +### For building InfiniTime +1. Install Docker +2. Pull docker container (optional, container will be pulled when running the docker container if not pulled now). +```bash +sudo docker pull infinitime/infinitime-build +``` + +### For building InfiniSim +This was the most difficult part for me to get right since the steps on the github page are not entirely complete for my setup. If you encounter errors while building, it's probably because one of the dependencies are missing or have the wrong version installed. If you do have an error while building, check out the issues on github and see if you can find some help there: https://github.com/InfiniTimeOrg/InfiniSim/issues +1. The apt install part. This is almost exactly the same as what is on the github page except for npm. When I added npm in to here, I got an older version that didn't work. We'll install the correct version in step 2. +```bash +sudo apt install -y cmake libsdl2-dev g++ libpng-dev +``` + +2. Install the correct node version. (At least v14.0.0 is required). Commands from https://github.com/nodesource/distributions First, choose the node version by running one of these lines: +```bash +NODE_MAJOR=16 +NODE_MAJOR=18 +NODE_MAJOR=20 +``` +I'm not sure which is the best to use, I went with 16 since that is the closest to the version required by InfiniSim, but I doubt it makes much of a difference. Once you've done that, then install it with these commands: +```bash +sudo apt-get update +sudo apt-get install -y ca-certificates curl gnupg +sudo mkdir -p /etc/apt/keyrings +curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg + +NODE_MAJOR=20 +echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list + +sudo apt-get update +sudo apt-get install nodejs -y +``` + +3. Install npm packages +```bash +npm install lv_font_conv@1.5.2 -g +npm install ts-node@10.9.1 @swc/core@1.3.82 lv_img_conv@0.3.0 -g +``` + + +## Build InfiniSim +### Building with stock InfiniTime +Now to see if we did everything the way our computer wants it. First cd into the directory where InfinSim was cloned (`cd InfiniSim` if you are still in the directory you started in). Now you should be able to build InfiniSim with the InfiniTime version that was included with InfiniSim: +```bash +cmake -S . -B build +cmake --build build -j4 +``` + +If that didn't produce any error, now run it! +```bash +./build/infinisim +``` + +### Building with your own version of InfiniTime +To test your own modifications of InfiniTime: +```bash +cmake -S . -B build -DInfiniTime_DIR=../InfiniTime +cmake --build build -j4 +``` +Assuming that the git clone command was run in the same directory for both InfiniSim and InfiniTime. If not, replace `../InfiniTime` with the path to the directory where InfiniTime was cloned to. +And now run it if there were no errors! +```bash +./build/infinisim +``` + +## Build InfiniTime +Now is the fun part, building your own version of InfiniTime and flashing it to your watch! +First, cd into the directory into which InfiniTime cloned (`cd ~/InfiniTime` if you cloned from your home directory). Now run the docker container (for more info on this command, see https://github.com/InfiniTimeOrg/InfiniTime/blob/main/doc/buildWithDocker.md): +```bash +docker run --rm -it -v ${PWD}:/sources --user $(id -u):$(id -g) infinitime/infinitime-build +``` + +If that doesn't have any errors, it will save the files to build/output/. The file you will want to flash to your watch is `pinetime-mcuboot-app-dfu-x.x.x.zip`. I found a pretty nice program called WatchMate that you can use to flash it from linux, but I think you can also use Gadgetbridge to flash the file. In WatchMate, just scroll down to the "Firmware Version" dropdown and click on "Upload from file" > +"Firmware" and select the zip file mentioned above. Once that's done, you may also want to send it the `infinitime-resources-x.x.x.zip` if some features are greyed out on the watch (for me it was a couple watch faces and the navigation app that were greyed out). In WatchMate, you'll want to use the "Resources" option instead of the "Firmware" option to upload this file. + +## Celebrate +There you go, you've just flashed your own custom os to your watch! If you got all this far without running into any error, you have something to celebrate about as it took me a couple of days to get to this point. If you did have some errors and figured them out, then great, you've got it all figured out now! +One final thing, I would recommend making use of git commits and branches so that you can revert if you totally mess something up and don't have to clone the entire repository and dependencies again like I had to do several times before I decided to start doing that. \ No newline at end of file From 15e525a5bafad548aed2db6f680405e1131b9dfd Mon Sep 17 00:00:00 2001 From: josh Date: Wed, 27 Sep 2023 22:49:58 -0400 Subject: [PATCH 2/3] Update todo and fix docker command in enviroment_setup.md --- README.md | 2 ++ enviroment_setup.md | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 099479a4..b1170874 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,8 @@ ### Josh - [ ] Seconds on digital watchface +- [ ] Battery on digital watchface +- [ ] Remap button double click (to music app) ### Moses - [ ] Redo music control gestures diff --git a/enviroment_setup.md b/enviroment_setup.md index 3566c56d..1c06b908 100755 --- a/enviroment_setup.md +++ b/enviroment_setup.md @@ -83,7 +83,7 @@ And now run it if there were no errors! Now is the fun part, building your own version of InfiniTime and flashing it to your watch! First, cd into the directory into which InfiniTime cloned (`cd ~/InfiniTime` if you cloned from your home directory). Now run the docker container (for more info on this command, see https://github.com/InfiniTimeOrg/InfiniTime/blob/main/doc/buildWithDocker.md): ```bash -docker run --rm -it -v ${PWD}:/sources --user $(id -u):$(id -g) infinitime/infinitime-build +sudo docker run --rm -it -v ${PWD}:/sources --user $(id -u):$(id -g) infinitime/infinitime-build ``` If that doesn't have any errors, it will save the files to build/output/. The file you will want to flash to your watch is `pinetime-mcuboot-app-dfu-x.x.x.zip`. I found a pretty nice program called WatchMate that you can use to flash it from linux, but I think you can also use Gadgetbridge to flash the file. In WatchMate, just scroll down to the "Firmware Version" dropdown and click on "Upload from file" > @@ -91,4 +91,4 @@ If that doesn't have any errors, it will save the files to build/output/. The fi ## Celebrate There you go, you've just flashed your own custom os to your watch! If you got all this far without running into any error, you have something to celebrate about as it took me a couple of days to get to this point. If you did have some errors and figured them out, then great, you've got it all figured out now! -One final thing, I would recommend making use of git commits and branches so that you can revert if you totally mess something up and don't have to clone the entire repository and dependencies again like I had to do several times before I decided to start doing that. \ No newline at end of file +One final thing, I would recommend making use of git commits and branches so that you can revert if you totally mess something up and don't have to clone the entire repository and dependencies again like I had to do several times before I decided to start doing that. From 1fd2496ee224a48cd2aa12bf40b588053b966192 Mon Sep 17 00:00:00 2001 From: tofasthacker Date: Fri, 29 Sep 2023 01:46:02 +0000 Subject: [PATCH 3/3] Update README.md --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b1170874..5ed317db 100644 --- a/README.md +++ b/README.md @@ -17,16 +17,17 @@ - [ ] Remap button double click (to music app) ### Moses -- [ ] Redo music control gestures - - [ ] Swipe up toggles control mode and swipe down exits - - [ ] Swipe left/right goes to watchface/another app - +- [x] Redo music control gestures + - [x] Swipe up toggles control mode and swipe down exits + - [x] Swipe left/right goes to watchface/another app +- [x] Exponent button on calculator +- [x] Rearrange quick acces and apps +- [ ] Add quick ring settings + ## Medium priority - [ ] Temp sensor w/ arduino - [ ] Homeassistant control - [ ] Periodic heart rate measurement -- [ ] Exponent button on calculator ## Lower priority -- [ ] Rearrange quick acces and apps - [ ] Maybe some prank watchfaces