stack-chan

環境構築

English

開発に必要なもの

スタックチャンリポジトリのクローン

--recursiveオプションをつけて本リポジトリをクローンします。

$ git clone --recursive https://github.com/meganetaaan/stack-chan.git
$ cd stack-chan/firmware
$ npm i

ModdableSDKのセットアップ

ホストPCでModdableSDKESP-IDFをインストールします。 次の3通りの方法があります。

xs-devを使う(推奨)

スタックチャンはセットアップ手順をnpmスクリプト化しています。 stack-chan/firmwareディレクトリで次のコマンドを実行します。

$ npm run setup
$ npm run setup -- --device=esp32

内部でxs-devを使ってModdableSDKやESP-IDFのセットアップを自動化しています。

Dockerイメージを使う(Linuxのみ)

このリポジトリはDockerfileによるビルド環境を提供しています。 Dockerコンテナの中でファームウェアのビルド、書き込みとデバッグが可能です。

注意:Linux(Ubuntu20.04)で動作確認しています。Windows(WSL)やMacOSでは、コンテナ側からのデバイスへの接続がうまくいかない問題が報告されているため、非推奨です。

ターミナルから

stack-chan/firmwareディレクトリで次のコマンドを実行します。

$ ./docker/build-container.sh
$ ./docker/launch-container.sh

# コンテナ内で以下を実行
$ npm install

VSCodeから

VSCodeのDevContainer用設定を同梱しています。 以下のコマンドでコンテナ内でプロジェクトを開けます。

手動で行う

公式サイトの手順(英語)に従ってModdableSDKとESP-IDFをインストールします。 CLIやDockerがうまくセットアップできない場合はこちらを行ってください。

環境のテスト

npm run doctorコマンドで環境のテストができます。 インストールに成功していれば次のようにModdable SDKのバージョンが表示され、Supported target devicesにesp32が表示されます。

$ npm run doctor

> stack-chan@0.2.1 doctor
> xs-dev doctor

xs-dev environment info:
  CLI Version                0.20.0                                                                
  OS                         Linux                                                                 
  Arch                       x64                                                                   
  NodeJS Version             v16.14.2 (/usr/local/bin/node)                                        
  Python Version             3.8.10 (/home/sskw/.espressif/python_env/idf4.4_py3.8_env/bin/python) 
  Moddable SDK Version       3.6.0 (/home/sskw/.local/share/moddable)                              
  Supported target devices   lin, esp32                                                            
  ESP32 IDF Directory        /home/sskw/.local/share/esp32/esp-idf                                 

If this is related to an error when using the CLI, please create an issue at "https://github.com/hipsterbrown/xs-dev/issues/new" with the above info.

次のステップ