Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web書き込み機能の不具合修正 #23

Merged
merged 8 commits into from
Jan 16, 2025
2 changes: 1 addition & 1 deletion .github/workflows/bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
uses: ./.github/actions/setup
- name: Bundle
if: steps.diff_check.outputs.diff_detected || steps.cache.outputs.cache-hit != 'true'
run: source $HOME/.local/share/xs-dev-export.sh && npm run bundle
run: source $HOME/.local/share/xs-dev-export.sh && sh ./setting_scripts/unset_psram.sh && npm run bundle
working-directory: ./firmware
- name: Upload Firmware Bundle
if: steps.diff_check.outputs.diff_detected || steps.cache.outputs.cache-hit != 'true'
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,11 @@ This repository includes the following contents.
* For Windows: [(WSL2) Windows 11 Stack-chan Environment Setup Manual (Japanese)](firmware/docs/getting-started-wsl2_ja.md)
* For MacOS/Linux: [Getting Started (MacOS/Linux)](./firmware/docs/getting-started.md)
* For Web: Follow the steps below (Reference: [Tried Flashing a Program to Stack-chan via Web Browser (Japanese)](https://rt-net.jp/humanoid/archives/5907)):
1. Access the web-flash page from your PC.
1. Access the [web-flah page](https://rt-net.github.io/stack-chan/web/flash/) from your PC.
2. Connect Stack-chan to the PC using a cable.
3. Select `M5Stack CoreS3`.
4. Press the `Flash Stack-chan firmware [・_・]` button.
3. Hold the reset button on the bottom of the M5Stack for 3 seconds to switch to BOOT mode (a green light will appear near the reset button).
4. Select `M5Stack CoreS3`.
5. Press the `Flash Stack-chan firmware [・_・]` button.

## Contribution

Expand Down
5 changes: 3 additions & 2 deletions README_ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@
* Webの場合:以下の手順を実行(参考:[Webブラウザからスタックチャンにプログラムを書き込んでみた](https://rt-net.jp/humanoid/archives/5907))
1. PCから[web-flahページ](https://rt-net.github.io/stack-chan/web/flash/)にアクセス
2. スタックチャンとPCをケーブルで接続
3. `M5Stack CoreS3`を選択
4. `Flash Stack-chan firmware [・_・]`ボタンを押下
3. M5Stackの下部にあるリセットボタンを3秒以上押し続けてBOOTモードに切替(切り替わるとリセットボタン付近が緑色に光ります)
4. `M5Stack CoreS3`を選択
5. `Flash Stack-chan firmware [・_・]`ボタンを押下

## コントリビューション

Expand Down
10 changes: 7 additions & 3 deletions firmware/docs/getting-started-wsl2_ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,7 @@ $ curl https://get.volta.sh | bash

<img src="images/getting-started-wsl2_ja/volta_reboot.jpg" width="100%">

インストールに成功すると`success: Setup complete. Open a new terminal to start using Volta!`と表示され、新しいターミナルを開始するように促されます。

Ubuntuのウインドウを閉じ、Windows11のスタートメニューからUbuntuを再起動してください。
インストールに成功すると`success: Setup complete. Open a new terminal to start using Volta!`と表示され、新しいターミナルを開くように指示されますが、環境を反映するには、Ubuntuのウインドウを閉じ、Windows11のスタートメニューからUbuntuを再起動してください。

### `Volta`から`Node.js`と`npm`をインストール

Expand Down Expand Up @@ -249,6 +247,12 @@ $ ./setting_scripts/set_xs-dev_env.sh

### 構築した環境の確認

Ubuntuを度再起動(Ubuntuのウインドウを閉じてから再度開く)し、以下の`cd`コマンドで作業フォルダを移動してください。

```bash
$ cd stack-chan/firmware`
```

#### Moddableの環境確認

以下のコマンドでModdableの環境のテストをします。
Expand Down
4 changes: 3 additions & 1 deletion firmware/docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ By completing these steps, your shell environment will be configured correctly f

## Test the environment

You can test your environment with the `npm run doctor` command.
You can test your environment with the `npm run doctor` command.
This command needs to be executed from the `stack-chan/firmware` directory.

If the installation is successful, 4.9.5 will be displayed as the version of Moddable SDK as shown below, and esp32 will be displayed in Supported target devices.

```console
Expand Down
7 changes: 6 additions & 1 deletion firmware/docs/getting-started_ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,22 @@ xs-dev(CLI)でうまくセットアップできない場合はこちらを
$ ./setting_scripts/unset_psram.sh
```

次のコマンドを実行し、Shellの設定ファイルに`source ~/.local/share/xs-dev-export.sh`を追加します。これにより、Shellの起動時に環境変数を設定されます
次のコマンドを実行し、Shellの設定ファイルに`source ~/.local/share/xs-dev-export.sh`を追加します。これにより、Shellの起動時に環境変数が設定されます

```console
$ ./setting_scripts/set_xs-dev_env.sh
```

ここまで完了したら、ターミナルを再起動してください。

## 環境のテスト

`npm run doctor`コマンドで環境のテストができます。
コマンドは、`stack-chan/firmware`配下で実行する必要があります。

インストールに成功していれば次のようにModdable SDKのバージョンとして4.9.5が表示され、Supported target devicesにesp32が表示されます。


```console
$ npm run doctor

Expand Down
4 changes: 2 additions & 2 deletions firmware/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion firmware/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stack-chan",
"version": "0.2.1",
"version": "2.1.1",
"description": "A firmware of M5Stack Stack-chan module",
"main": "stackchan/main.ts",
"scripts": {
Expand Down
12 changes: 6 additions & 6 deletions firmware/setting_scripts/set_xs-dev_env.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/sh

# 追記するコマンドを設定
# Define the command to append
XS_DEV_SH="source ~/.local/share/xs-dev-export.sh"

# 現在のシェルを取得
# Get the current shell
CURRENT_SHELL=$(basename "$SHELL")

# 設定ファイルを決定
# Determine the configuration file
if [ "$CURRENT_SHELL" = "bash" ]; then
CONFIG_FILE="$HOME/.bashrc"
elif [ "$CURRENT_SHELL" = "zsh" ]; then
Expand All @@ -16,17 +16,17 @@ else
exit 1
fi

# 設定ファイルが存在しない場合は作成
# Create the configuration file if it doesn't exist
if [ ! -f "$CONFIG_FILE" ]; then
touch "$CONFIG_FILE"
echo "# Created $CONFIG_FILE for $CURRENT_SHELL settings" >> "$CONFIG_FILE"
echo "$CONFIG_FILE was created."
fi

# ファイルに追記
# Append the command to the file
if grep -Fxq "$XS_DEV_SH" "$CONFIG_FILE"; then
echo "The string '$XS_DEV_SH' already exists in $CONFIG_FILE. No changes made."
else
echo "$XS_DEV_SH" >> "$CONFIG_FILE"
echo "The string '$XS_DEV_SH' has been added to $CONFIG_FILE."
fi
fi
10 changes: 5 additions & 5 deletions firmware/setting_scripts/unset_psram.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/bin/sh

# 設定ファイルパスを取得
# Get the path to the configuration file
SDKCONFIG="$HOME/.local/share/moddable/build/devices/esp32/targets/m5stack_cores3/sdkconfig/sdkconfig.defaults"

# macOS Linux sed コマンドの互換性を考慮
# Ensure compatibility between macOS and Linux sed command
if [ "$(uname)" = "Darwin" ]; then
# macOS
# macOS
sed -i '' 's/CONFIG_SPIRAM=y/CONFIG_SPIRAM=n/' "$SDKCONFIG"
else
# Linux
# Linux
sed -i 's/CONFIG_SPIRAM=y/CONFIG_SPIRAM=n/' "$SDKCONFIG"
fi

# 結果を表示
# Display the result
cat "$SDKCONFIG"
2 changes: 1 addition & 1 deletion web/flash/manifest_esp32_m5stack_cores3.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Stack-chan",
"version": "1.0.0",
"version": "2.1.1",
"builds": [
{
"chipFamily": "ESP32-S3",
Expand Down
Loading