Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
a2352b9
Add devcontainer
SergioGasquez Mar 28, 2022
9de0317
Update readme: devcontainer
SergioGasquez Mar 28, 2022
898f77b
Update from dockerfile to image
SergioGasquez Mar 28, 2022
640f20c
Remove rust-toolchain file
SergioGasquez Mar 30, 2022
0ec1bab
Remove rust-toolchain files
SergioGasquez Mar 30, 2022
b7341e5
Update the container image
SergioGasquez Mar 30, 2022
b5e2264
Merge pull request #1 from SergioGasquez/feature/fetch-dependencies
SergioGasquez Mar 30, 2022
3d1cc45
Add more information on podman
SergioGasquez Mar 31, 2022
7d7448f
Format indentation
SergioGasquez Apr 1, 2022
25a1d98
Add gitpod file
SergioGasquez Apr 1, 2022
fca1d4b
Test before task
SergioGasquez Apr 1, 2022
3f632a3
Add vscode extensions
SergioGasquez Apr 1, 2022
611deeb
Update commands
SergioGasquez Apr 1, 2022
36b030d
Update extensions
SergioGasquez Apr 1, 2022
eb43c38
Update extensions
SergioGasquez Apr 1, 2022
523e1f4
Fix typo
SergioGasquez Apr 1, 2022
362885e
Fix typo
SergioGasquez Apr 1, 2022
50c3d1f
Remove export
SergioGasquez Apr 1, 2022
c79461e
Add gitpod button
SergioGasquez Apr 2, 2022
3ba1ec4
Update readme
SergioGasquez Apr 4, 2022
4a5b1fa
Update commands
SergioGasquez Apr 4, 2022
e01345a
Merge pull request #2 from SergioGasquez/feature/gitpod
SergioGasquez Apr 4, 2022
d883f49
Add gitpod flashing and monitoring information
SergioGasquez Apr 4, 2022
a2e8c24
Merge pull request #3 from SergioGasquez/feature/gitpod
SergioGasquez Apr 4, 2022
837be4e
Integration with wokwi
SergioGasquez Apr 6, 2022
f71c657
Test gitpod integration with wokwi
SergioGasquez Apr 6, 2022
5589a89
Modify gitignore to include tasks
SergioGasquez Apr 7, 2022
625b103
Add task.json
SergioGasquez Apr 7, 2022
8a95f6a
Add documentation for Wokwi simulation
SergioGasquez Apr 7, 2022
d99f6fe
Rename task
SergioGasquez Apr 7, 2022
54e6b3a
Update path
SergioGasquez Apr 7, 2022
4ab3ae9
Update message
SergioGasquez Apr 7, 2022
901a316
Merge pull request #4 from SergioGasquez/feature/wokwi
SergioGasquez Apr 7, 2022
83b269f
Update board
SergioGasquez Apr 8, 2022
70d0ce0
Add run script
SergioGasquez Apr 8, 2022
d168e83
Add one task for every project
SergioGasquez Apr 8, 2022
2075121
Update README.md
SergioGasquez Apr 8, 2022
ac4ca5a
Update Wokwi Simulator documentation
SergioGasquez Apr 8, 2022
1eaccb3
Add Dockerfile
SergioGasquez Apr 8, 2022
423a89b
Open Wokwi port
SergioGasquez Apr 8, 2022
50f5beb
Avoid runing simulator if build fails
SergioGasquez Apr 8, 2022
a23f0b5
Update auth_method to allow open access points
SergioGasquez Apr 8, 2022
9bfbb01
Include both "image" and "build" properties
SergioGasquez Apr 11, 2022
53c1e84
Update wokwi server script
SergioGasquez Apr 11, 2022
a819852
Add dockerfile to gitpod
SergioGasquez Apr 11, 2022
f892170
Fix cargo-espflash version
SergioGasquez Apr 11, 2022
82f71a9
Use FS repo to fetch dependencies
SergioGasquez Apr 11, 2022
8d0408a
Add default user
SergioGasquez Apr 11, 2022
584b410
Add the option to build from Dockerfile
SergioGasquez Apr 11, 2022
df5ede8
Add documentation about Dockerfile
SergioGasquez Apr 11, 2022
27ba47b
Merge branch 'main' into feature/dockerfile
SergioGasquez Apr 11, 2022
5979916
Merge pull request #5 from SergioGasquez/feature/dockerfile
SergioGasquez Apr 11, 2022
fac56f7
Update container user, tasks and documentation
SergioGasquez Apr 14, 2022
75de511
Update user in gitpod
SergioGasquez Apr 14, 2022
661eb2c
Add rust-toolchain
SergioGasquez Apr 14, 2022
84277a3
Update rust version
SergioGasquez Apr 14, 2022
19c2041
Add rust-toolchain
SergioGasquez Apr 14, 2022
3d70ede
Use rust board with neopixel for some projects
SergioGasquez Apr 14, 2022
ef86ac2
Use neopixel in advanced/button-interrupt examples
SergioGasquez Apr 19, 2022
ad2f3f8
Edit script url to allow simulation in gitpod
SergioGasquez Apr 20, 2022
e7a21c1
Edit script url to allow simulation in gitpod
SergioGasquez Apr 20, 2022
d6e161e
Edit script url to allow simulation in gitpod
SergioGasquez Apr 20, 2022
7c3ee80
Add port 9012
SergioGasquez Apr 20, 2022
d9c24e1
Update port visibility
SergioGasquez Apr 20, 2022
8b45d2e
Update wokwi server script for gitpod
SergioGasquez Apr 20, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
FROM debian:bullseye
ENV DEBIAN_FRONTEND=noninteractive
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
RUN apt-get update \
&& apt-get install -y vim nano git curl gcc ninja-build cmake libudev-dev \
python3 python3-pip libusb-1.0-0 libssl-dev pkg-config libtinfo5 clang \
&& apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts
RUN pip3 install websockets==10.2
ARG CONTAINER_USER=esp
ENV USER=${CONTAINER_USER}
RUN adduser --disabled-password --gecos "" ${CONTAINER_USER}
USER ${CONTAINER_USER}
WORKDIR /home/${CONTAINER_USER}
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \
--default-toolchain nightly-2022-03-30 -y
ENV PATH=${PATH}:$HOME/.cargo/bin:$HOME/.cargo/bin
RUN $HOME/.cargo/bin/rustup component add rust-src --toolchain nightly-2022-03-30
RUN $HOME/.cargo/bin/rustup target add riscv32i-unknown-none-elf
RUN $HOME/.cargo/bin/cargo install cargo-generate espmonitor bindgen ldproxy
RUN $HOME/.cargo/bin/cargo install cargo-espflash --version 1.4.0
ENV ESP_IDF_TOOLS_INSTALL_DIR=global
ENV ESP_BOARD=esp32c3
ENV ESP_IDF_VER=v4.4
ENV ESP_IDF_VERSION=release/v4.4
ENV ESP_IDF_BRANCH=release/v4.4
RUN git clone --recursive --depth 1 --shallow-submodules -b ${ESP_IDF_BRANCH} \
https://github.com/espressif/esp-idf.git $HOME/esp-idf
RUN $HOME/esp-idf/install.sh ${ESP_BOARD}
ENV IDF_PATH=$HOME/esp-idf
# In order to have dependencies pre-fecthed please, uncoment this section:
# RUN git clone https://github.com/ferrous-systems/espressif-trainings.git && \
# # Hardware Check
# cd $HOME/espressif-trainings/intro/hardware-check && \
# $HOME/.cargo/bin/cargo fetch && \
# $HOME/.cargo/bin/cargo build && \
# $HOME/.cargo/bin/cargo clean && \
# # Http Client
# cd $HOME/espressif-trainings/intro/http-client/exercise && \
# $HOME/.cargo/bin/cargo fetch && \
# cd $HOME/espressif-trainings/intro/http-client/solution && \
# $HOME/.cargo/bin/cargo fetch && \
# # Http Server
# cd $HOME/espressif-trainings/intro/http-server/exercise && \
# $HOME/.cargo/bin/cargo fetch && \
# cd $HOME/espressif-trainings/intro/http-server/solution && \
# $HOME/.cargo/bin/cargo fetch && \
# # MQTT
# cd $HOME/espressif-trainings/intro/mqtt/exercise && \
# $HOME/.cargo/bin/cargo fetch && \
# cd $HOME/espressif-trainings/intro/mqtt/solution && \
# $HOME/.cargo/bin/cargo fetch && \
# cd $HOME/espressif-trainings/intro/mqtt/host-client && \
# $HOME/.cargo/bin/cargo fetch && \
# # Button Interrupt
# cd $HOME/espressif-trainings/advanced/button-interrupt/exercise && \
# $HOME/.cargo/bin/cargo fetch && \
# cd $HOME/espressif-trainings/advanced/button-interrupt/solution && \
# $HOME/.cargo/bin/cargo fetch && \
# # I2C Driver
# cd $HOME/espressif-trainings/advanced/i2c-driver/solution && \
# $HOME/.cargo/bin/cargo fetch && \
# # I2C Sensor Reading
# cd $HOME/espressif-trainings/advanced/i2c-sensor-reading/solution && \
# $HOME/.cargo/bin/cargo fetch && \
# # Delete the repository
# rm -rf $HOME/espressif-trainings
37 changes: 37 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "espressif-training",
// Choose between "image" and "build" properties to pull built image or build from Dockerfile
"image": "docker.io/sergiogasquez/esp-rs-env:esp32c3-training",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to use the build property with the local Dockerfile as the default, otherwise the dev environment relies on this particular image to be available.

// "build": {
// "dockerfile": "Dockerfile",
// },
"settings": {
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "modifications",
"editor.formatOnType": true,
"lldb.executable": "/usr/bin/lldb",
"files.watcherExclude": {
"**/target/**": true
},
"rust-analyzer.checkOnSave.command": "clippy",
"[rust]": {
"editor.defaultFormatter": "matklad.rust-analyzer"
},
},
"extensions": [
"matklad.rust-analyzer",
"tamasfe.even-better-toml",
"vadimcn.vscode-lldb",
"serayuzgur.crates",
"mutantdino.resourcemonitor",
"yzhang.markdown-all-in-one",
],
// Uncomment if using Podman and choose the proper device
// "runArgs": ["--userns=keep-id", "--device", "/dev/ttyUSB0", "--security-opt", "label=disable", "--annotation", "run.oci.keep_original_groups=1"],
"forwardPorts": [
9012
],
"workspaceMount": "source=${localWorkspaceFolder},target=/home/esp/workspace,type=bind,consistency=cached",
"workspaceFolder": "/home/esp/workspace/"
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.vscode
!.vscode/tasks.json
target
Cargo.lock
cfg.toml
Expand Down
23 changes: 23 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Choose between building from Dockerfile or pulling the built image.
image: sergiogasquez/esp-rs-env:esp32c3-training
# image:
# Due to https://github.com/gitpod-io/gitpod/issues/7754 building from Dockerfile is not working
# file: .devcontainer/Dockerfile
tasks:
- name: Adopt environment in the container image to gitpod user
command: |
ln -s /home/esp/.rustup /home/gitpod/.rustup
mkdir /home/gitpod/.cargo
ln -s /home/esp/.cargo/bin /home/gitpod/.cargo/bin
ln -s /home/esp/.cargo/env /home/gitpod/.cargo/env
source /home/gitpod/.cargo/env
vscode:
extensions:
- matklad.rust-analyzer
- tamasfe.even-better-toml
- vadimcn.vscode-lldb
- anwar.resourcemonitor
- yzhang.markdown-all-in-one
ports:
- port: 9012
visibility: public
201 changes: 201 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"command": [
"cd ${relativeFileDirname}/.. &&",
"cargo espflash --release save-image app.bin &&",
"python3 $HOME/workspace/wokwi/wokwi-server.py"
],
"problemMatcher": [
"$rustc"
],
"label": "Build and run Wokwi simulation: Focused project",
"group": {
"kind": "build",
"isDefault": true
}
},
{
"type": "shell",
"command": [
"export CURRENT_PROJECT=intro/hardware-check &&",
"bash wokwi/run.sh"
],
"problemMatcher": [
"$rustc"
],
"label": "Build and run Wokwi simulation: intro/hardware-check",
"group": {
"kind": "build",
"isDefault": false
}
},
{
"type": "shell",
"command": [
"export CURRENT_PROJECT=intro/http-client/exercise &&",
"bash wokwi/run.sh"
],
"problemMatcher": [
"$rustc"
],
"label": "Build and run Wokwi simulation: intro/http-client/exercise",
"group": {
"kind": "build",
"isDefault": false
}
},
{
"type": "shell",
"command": [
"export CURRENT_PROJECT=intro/http-client/solution &&",
"bash wokwi/run.sh"
],
"problemMatcher": [
"$rustc"
],
"label": "Build and run Wokwi simulation: intro/http-client/solution",
"group": {
"kind": "build",
"isDefault": false
}
},
{
"type": "shell",
"command": [
"export CURRENT_PROJECT=intro/http-server/exercise &&",
"bash wokwi/run.sh"
],
"problemMatcher": [
"$rustc"
],
"label": "Build and run Wokwi simulation: intro/http-server/exercise",
"group": {
"kind": "build",
"isDefault": false
}
},
{
"type": "shell",
"command": [
"export CURRENT_PROJECT=intro/http-server/solution &&",
"bash wokwi/run.sh"
],
"problemMatcher": [
"$rustc"
],
"label": "Build and run Wokwi simulation: intro/http-server/solution",
"group": {
"kind": "build",
"isDefault": false
}
},
{
"type": "shell",
"command": [
"export CURRENT_PROJECT=intro/mqtt/exercise &&",
"bash wokwi/run.sh"
],
"problemMatcher": [
"$rustc"
],
"label": "Build and run Wokwi simulation: intro/mqtt/exercise",
"group": {
"kind": "build",
"isDefault": false
}
},
{
"type": "shell",
"command": [
"export CURRENT_PROJECT=intro/mqtt/host-client &&",
"bash wokwi/run.sh"
],
"problemMatcher": [
"$rustc"
],
"label": "Build and run Wokwi simulation: intro/mqtt/host-client",
"group": {
"kind": "build",
"isDefault": false
}
},
{
"type": "shell",
"command": [
"export CURRENT_PROJECT=intro/mqtt/solution &&",
"bash wokwi/run.sh"
],
"problemMatcher": [
"$rustc"
],
"label": "Build and run Wokwi simulation: intro/mqtt/solution",
"group": {
"kind": "build",
"isDefault": false
}
},
{
"type": "shell",
"command": [
"export CURRENT_PROJECT=advanced/button-interrupt/exercise &&",
"bash wokwi/run.sh"
],
"problemMatcher": [
"$rustc"
],
"label": "Build and run Wokwi simulation: advanced/button-interrupt/exercise",
"group": {
"kind": "build",
"isDefault": false
}
},
{
"type": "shell",
"command": [
"export CURRENT_PROJECT=advanced/button-interrupt/solution &&",
"bash wokwi/run.sh"
],
"problemMatcher": [
"$rustc"
],
"label": "Build and run Wokwi simulation: advanced/button-interrupt/solution",
"group": {
"kind": "build",
"isDefault": false
}
},
{
"type": "shell",
"command": [
"export CURRENT_PROJECT=advanced/i2c-driver/solution &&",
"bash wokwi/run.sh"
],
"problemMatcher": [
"$rustc"
],
"label": "Build and run Wokwi simulation: advanced/i2c-driver/solution",
"group": {
"kind": "build",
"isDefault": false
}
},
{
"type": "shell",
"command": [
"export CURRENT_PROJECT=advanced/i2c-sensor-reading/solution &&",
"bash wokwi/run.sh"
],
"problemMatcher": [
"$rustc"
],
"label": "Build and run Wokwi simulation: advanced/i2c-sensor-reading/solution",
"group": {
"kind": "build",
"isDefault": false
}
},
]
}
Loading