mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-13 10:15:00 +00:00
Merge pull request #3725 from cesanta/protoclean
move embedded tutorials out of protocol tree
This commit is contained in:
@@ -633,8 +633,8 @@ jobs:
|
||||
matrix:
|
||||
example:
|
||||
- path: micropython/esp32
|
||||
- path: http/uart-bridge/esp32
|
||||
- path: http/http-client/esp8266/http-client-server
|
||||
- path: esp32/uart-bridge
|
||||
- path: esp8266/http-client-server
|
||||
name: ${{ matrix.example.path }}
|
||||
env:
|
||||
GO: 0
|
||||
@@ -652,7 +652,7 @@ jobs:
|
||||
include:
|
||||
- group: other
|
||||
examples: |
|
||||
mqtt/mqtt-client/microchip/same54-xpro
|
||||
microchip/same54-xpro/mqtt-client
|
||||
rp/pico-rmii
|
||||
stm32/nucleo-f746zg/minimal-rm2
|
||||
stm32/nucleo-f746zg/minimal-rndis
|
||||
@@ -691,13 +691,13 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
example:
|
||||
- path: esp32
|
||||
- path: esp32/device-dashboard
|
||||
name: ${{ matrix.example.path }}
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
with: { fetch-depth: 2 }
|
||||
- run: echo # nothing specific to install or do
|
||||
- run: make -C tutorials/http/device-dashboard/${{ matrix.example.path }} build
|
||||
- run: make -C tutorials/${{ matrix.example.path }} build
|
||||
|
||||
|
||||
device_dashboard_examples_arm:
|
||||
@@ -709,12 +709,12 @@ jobs:
|
||||
- group: none
|
||||
cflags: ""
|
||||
examples: |
|
||||
http/device-dashboard/microchip/same54-xpro
|
||||
microchip/same54-xpro/device-dashboard
|
||||
renesas/ek-ra6m4-make-baremetal-builtin
|
||||
- group: builtin
|
||||
cflags: -DMG_TLS=MG_TLS_BUILTIN
|
||||
examples: |
|
||||
http/device-dashboard/microchip/same54-xpro
|
||||
microchip/same54-xpro/device-dashboard
|
||||
renesas/ek-ra6m4-make-baremetal-builtin
|
||||
name: device dashboard ARM ${{ matrix.group }}
|
||||
steps:
|
||||
@@ -740,19 +740,19 @@ jobs:
|
||||
done
|
||||
exit $failed
|
||||
|
||||
# mqtt_dashboard_examples:
|
||||
# runs-on: ubuntu-latest
|
||||
# strategy:
|
||||
# fail-fast: false
|
||||
# matrix:
|
||||
# example:
|
||||
# - path:
|
||||
# name: ${{ matrix.example.path }}
|
||||
# steps:
|
||||
# - uses: actions/checkout@v5
|
||||
# with: { fetch-depth: 2 }
|
||||
# - run: echo # nothing specific to install or do
|
||||
# - run: make -C tutorials/${{ matrix.example.path }} build
|
||||
mqtt_dashboard_examples_arm:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
example:
|
||||
- path: rp/pico-rndis-device
|
||||
name: ${{ matrix.example.path }}
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
with: { fetch-depth: 2 }
|
||||
- run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
|
||||
- run: make -C tutorials/${{ matrix.example.path }} build
|
||||
|
||||
|
||||
# dual_examples:
|
||||
|
||||
@@ -98,8 +98,8 @@ jobs:
|
||||
with: { fetch-depth: 2 }
|
||||
- name: baremetal
|
||||
run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
|
||||
- run: make -C tutorials/http/device-dashboard/microchip/same54-xpro test VCON_API_KEY=${{secrets.VCON_API_KEY}}
|
||||
- run: make -C tutorials/mqtt/mqtt-client/microchip/same54-xpro test VCON_API_KEY=${{secrets.VCON_API_KEY}}
|
||||
- run: make -C tutorials/microchip/same54-xpro/device-dashboard test VCON_API_KEY=${{secrets.VCON_API_KEY}}
|
||||
- run: make -C tutorials/microchip/same54-xpro/mqtt-client test VCON_API_KEY=${{secrets.VCON_API_KEY}}
|
||||
|
||||
test_pico_w5500:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@@ -184,8 +184,8 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
example:
|
||||
- path: http/uart-bridge/esp32
|
||||
- path: http/http-client/esp8266/http-client-server
|
||||
- path: esp32/uart-bridge
|
||||
- path: esp8266/http-client-server
|
||||
name: ${{ matrix.example.path }}
|
||||
env:
|
||||
GO: 0
|
||||
@@ -227,7 +227,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
example:
|
||||
- path: esp32
|
||||
- path: esp32/device-dashboard
|
||||
name: ${{ matrix.example.path }}
|
||||
env:
|
||||
GO: 0
|
||||
@@ -235,12 +235,12 @@ jobs:
|
||||
- uses: actions/checkout@v5
|
||||
with: { fetch-depth: 2 }
|
||||
- run: |
|
||||
if ./test/match_changed_files.sh '^src|tutorials/http/device-dashboard'; then
|
||||
if ./test/match_changed_files.sh '^src|^tutorials/http/device-dashboard|^tutorials/${{ matrix.example.path }}'; then
|
||||
echo GO=1 >> $GITHUB_ENV
|
||||
# nothing specific to install or do
|
||||
fi
|
||||
- if: ${{ env.GO == 1 }}
|
||||
run: make -C tutorials/http/device-dashboard/${{ matrix.example.path }} build
|
||||
run: make -C tutorials/${{ matrix.example.path }} build
|
||||
|
||||
device_dashboard_examples_arm:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -248,7 +248,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
example:
|
||||
- path: http/device-dashboard/microchip/same54-xpro
|
||||
- path: microchip/same54-xpro/device-dashboard
|
||||
- path: renesas/ek-ra6m4-make-baremetal-builtin
|
||||
- path: rp/pico-rndis
|
||||
- path: rp/pico-w
|
||||
@@ -267,3 +267,24 @@ jobs:
|
||||
fi
|
||||
- if: ${{ env.GO == 1 }}
|
||||
run: make -C tutorials/${{ matrix.example.path }} build
|
||||
|
||||
mqtt_dashboard_examples_arm:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
example:
|
||||
- path: rp/pico-rndis-device
|
||||
name: ${{ matrix.example.path }}
|
||||
env:
|
||||
GO: 0
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
with: { fetch-depth: 2 }
|
||||
- run: |
|
||||
if ./test/match_changed_files.sh '^src|^tutorials/mqtt/mqtt-dashboard/device|^tutorials/${{ matrix.example.path }}'; then
|
||||
echo GO=1 >> $GITHUB_ENV
|
||||
sudo apt -y update && sudo apt -y install gcc-arm-none-eabi
|
||||
fi
|
||||
- if: ${{ env.GO == 1 }}
|
||||
run: make -C tutorials/${{ matrix.example.path }} build
|
||||
|
||||
@@ -4013,7 +4013,6 @@ uint64_t mg_now(void);
|
||||
// MG_INFO(("every second"));
|
||||
// }
|
||||
// Full examples:
|
||||
// tutorials/http/http-server/arduino/teensy41-http,
|
||||
// tutorials/mqtt/mqtt-client
|
||||
// Related APIs:
|
||||
// mg_millis(), mg_now()
|
||||
|
||||
@@ -29,7 +29,6 @@ uint64_t mg_now(void);
|
||||
// MG_INFO(("every second"));
|
||||
// }
|
||||
// Full examples:
|
||||
// tutorials/http/http-server/arduino/teensy41-http,
|
||||
// tutorials/mqtt/mqtt-client
|
||||
// Related APIs:
|
||||
// mg_millis(), mg_now()
|
||||
|
||||
+5
-3
@@ -16,9 +16,11 @@ IPV6 ?= 1
|
||||
MDASH ?= 1
|
||||
ASAN ?= -fsanitize=address,undefined,alignment -fno-sanitize-recover=all -fno-omit-frame-pointer -fno-common
|
||||
ASAN_OPTIONS ?= detect_leaks=1
|
||||
# This does not include ESP32, ESP8266, Microchip; all examples that are directly placed under an OS tutorial. Also, it is needed that way...
|
||||
TUTORIALS_EMBEDDED := $(dir $(wildcard ../tutorials/infineon/*/Makefile)) $(dir $(wildcard ../tutorials/nxp/*/Makefile)) $(dir $(wildcard ../tutorials/rp/*/Makefile)) $(dir $(wildcard ../tutorials/renesas/*/Makefile)) $(dir $(wildcard ../tutorials/stm32/*/*/Makefile)) $(dir $(wildcard ../tutorials/ti/*/Makefile)) $(dir $(wildcard ../tutorials/wch/*/Makefile))
|
||||
TUTORIALS := ../tutorials/micropython/ $(filter-out $(TUTORIALS_EMBEDDED), $(dir $(wildcard ../tutorials/*/*/Makefile)))
|
||||
# ESP8266 tutorials are not run here.
|
||||
TUTORIALS_EMBEDDED := $(dir $(wildcard ../tutorials/esp32/*/Makefile)) $(dir $(wildcard ../tutorials/infineon/*/Makefile)) $(dir $(wildcard ../tutorials/microchip/*/*/Makefile)) $(dir $(wildcard ../tutorials/nordic/*/Makefile)) $(dir $(wildcard ../tutorials/nxp/*/Makefile)) $(dir $(wildcard ../tutorials/pico-sdk/*/Makefile)) $(dir $(wildcard ../tutorials/rp/*/Makefile)) $(dir $(wildcard ../tutorials/renesas/*/Makefile)) $(dir $(wildcard ../tutorials/stm32/*/Makefile)) $(dir $(wildcard ../tutorials/stm32/*/*/Makefile)) $(dir $(wildcard ../tutorials/ti/*/Makefile)) $(dir $(wildcard ../tutorials/wch/*/Makefile))
|
||||
TUTORIALS_ESP8266 := $(dir $(wildcard ../tutorials/esp8266/*/Makefile))
|
||||
TUTORIALS_ZEPHYR := $(dir $(wildcard ../tutorials/zephyr/*/Makefile))
|
||||
TUTORIALS := ../tutorials/micropython/ $(filter-out $(TUTORIALS_EMBEDDED) $(TUTORIALS_ESP8266) $(TUTORIALS_ZEPHYR), $(dir $(wildcard ../tutorials/*/*/Makefile)))
|
||||
TUTORIALS_QUICK := $(filter-out ../tutorials/micropython/ ../tutorials/tcpip/pcap-driver/, $(TUTORIALS))
|
||||
TUTORIALS_MAC := $(filter-out ../tutorials/micropython/ ../tutorials/tcpip/pcap-driver/ ../tutorials/tcpip/tap-driver/, $(TUTORIALS))
|
||||
TUTORIALS_WIN := $(dir $(wildcard ../tutorials/http/file-*/Makefile) $(wildcard ../tutorials/http/http-*/Makefile) $(wildcard ../tutorials/mqtt/*/Makefile) $(wildcard ../tutorials/websocket/*/Makefile) $(wildcard ../tutorials/webui/*/Makefile))
|
||||
|
||||
@@ -29,20 +29,20 @@ teensy-board:
|
||||
touch teensy-board
|
||||
|
||||
seeeduino-xiao: arduino seeeduino-xiao-board
|
||||
cd $(ROOT)/tutorials/mqtt/mqtt-client/arduino/sim800-mqtt && $(ARD)/arduino/arduino --verbose --verify --board Seeeduino:samd:seeed_XIAO_m0 sim800-mqtt.ino
|
||||
cd $(ROOT)/tutorials/http/http-server/arduino/w5500-http && $(ARD)/arduino/arduino --verbose --verify --board Seeeduino:samd:seeed_XIAO_m0 w5500-http.ino
|
||||
cd $(ROOT)/tutorials/mqtt/mqtt-client/arduino/w5500-mqtt && $(ARD)/arduino/arduino --verbose --verify --board Seeeduino:samd:seeed_XIAO_m0 w5500-mqtt.ino
|
||||
cd $(ROOT)/tutorials/arduino/sim800-mqtt && $(ARD)/arduino/arduino --verbose --verify --board Seeeduino:samd:seeed_XIAO_m0 sim800-mqtt.ino
|
||||
cd $(ROOT)/tutorials/arduino/w5500-http && $(ARD)/arduino/arduino --verbose --verify --board Seeeduino:samd:seeed_XIAO_m0 w5500-http.ino
|
||||
cd $(ROOT)/tutorials/arduino/w5500-mqtt && $(ARD)/arduino/arduino --verbose --verify --board Seeeduino:samd:seeed_XIAO_m0 w5500-mqtt.ino
|
||||
|
||||
arduino-nano: arduino
|
||||
cd $(ROOT)/tutorials/mqtt/mqtt-client/arduino/nano-w5500-mqtt && $(ARD)/arduino/arduino --pref compiler.cpp.extra_flags=-DMG_ENABLE_LOG=0 --verbose --verify --board arduino:avr:nano nano-w5500-mqtt.ino
|
||||
cd $(ROOT)/tutorials/arduino/nano-w5500-mqtt && $(ARD)/arduino/arduino --pref compiler.cpp.extra_flags=-DMG_ENABLE_LOG=0 --verbose --verify --board arduino:avr:nano nano-w5500-mqtt.ino
|
||||
|
||||
esp32: arduino esp32-board
|
||||
cd $(ROOT)/tutorials/mqtt/mqtt-client/arduino/esp32-mqtt && $(ARD)/arduino/arduino --verbose --verify --board esp32:esp32:node32s esp32-mqtt.ino
|
||||
cd $(ROOT)/tutorials/arduino/esp32-mqtt && $(ARD)/arduino/arduino --verbose --verify --board esp32:esp32:node32s esp32-mqtt.ino
|
||||
# Needs a board with 'LED_BUILTIN', yet somehow invocation is missing that definition (lack of include somehow amended by the IDE)
|
||||
#cd $(ROOT)/tutorials/http/http-server/arduino/esp32-http && $(ARD)/arduino/arduino --verbose --verify --board esp32:esp32:esp32 esp32-http.ino
|
||||
#cd $(ROOT)/tutorials/arduino/esp32-http && $(ARD)/arduino/arduino --verbose --verify --board esp32:esp32:esp32 esp32-http.ino
|
||||
|
||||
teensy41: arduino teensy-board
|
||||
cd $(ROOT)/tutorials/http/http-server/arduino/teensy41-http && $(ARD)/arduino/arduino --verbose --verify --board teensy41-http.ino
|
||||
cd $(ROOT)/tutorials/arduino/teensy41-http && $(ARD)/arduino/arduino --verbose --verify --board teensy41-http.ino
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
ROOT ?= $(realpath $(CURDIR)/../..)
|
||||
PROJECTS ?= ../../tutorials/http/device-dashboard/esp32/ ../../tutorials/micropython/esp32/ ../../tutorials/http/uart-bridge/esp32/
|
||||
PROJECTS ?= ../../tutorials/esp32/device-dashboard/ ../../tutorials/micropython/esp32/ ../../tutorials/esp32/uart-bridge/
|
||||
TARGET ?= Debug
|
||||
DOCKER = docker run --rm -v $(ROOT):$(ROOT) -v $(CURDIR):/root -w $(CURDIR)
|
||||
IMAGE ?= espressif/idf
|
||||
|
||||
+5
-4
@@ -9,13 +9,13 @@ The fastest way to quickly get Mongoose running on your hardware is to follow ou
|
||||
|
||||
Steps to get the most out of this code base:
|
||||
|
||||
- Most code here has a README.md file that points to a verbose tutorial describing how to get the intended functionality out of Mongoose Network Library. Code there runs as is in Windows, Ubuntu Linux, and Mac (very few cases don't run in Windows).
|
||||
- Most workstation code here has a README.md file that points to a verbose tutorial describing how to get the intended functionality out of Mongoose Network Library. Code there runs as is in Windows, Ubuntu Linux, and Mac (very few cases don't run in Windows).
|
||||
- Navigate your way to the desired protocol or function, read the README.md file
|
||||
- Follow the linked tutorial
|
||||
- In cases were there is no tutorial:
|
||||
- Follow the [Build Tools](https://mongoose.ws/documentation/tutorials/tools/) tutorial to setup your development environment.
|
||||
- run `make all`
|
||||
- Embedded hardware tutorials are conveniently linked from OS tutorials, or grouped by vendor and board.
|
||||
- Embedded hardware tutorials are grouped by vendor and board.
|
||||
- Navigate your way to the desired board or the closest one, read the README.md file. In most cases you'll find a link to our [Wizard](https://mongoose.ws/wizard/); for others, there is a link to a [Tutorial](https://mongoose.ws/documentation/#tutorials), as described at the top of this text. The Wizard will also link you to the tutorials you'll need.
|
||||
- In cases were there you don't find a link to a tutorial:
|
||||
- Follow the [Build Tools](https://mongoose.ws/documentation/tutorials/tools/) tutorial to setup your development environment.
|
||||
@@ -28,7 +28,8 @@ Steps to get the most out of this code base:
|
||||
Rules for creating a new example:
|
||||
|
||||
- Makefile golden reference for desktop/server examples: [http-server](http/http-server/)
|
||||
- Makefile golden reference for embedded examples: [stm32/nucleo-f746zg-baremetal-builtin-rndis](stm32/nucleo-f746zg-baremetal-builtin-rndis/)
|
||||
- Makefile golden reference for embedded examples: [stm32/nucleo-f746zg/minimal](stm32/nucleo-f746zg/minimal/)
|
||||
- Desktop/server examples compile `$(REPO_ROOT)/mongoose.c` and add `$(REPO_ROOT)` to their include path
|
||||
- Examples must build on Windows, Mac and Ubuntu Linux systems
|
||||
- Assume that users installed their tools according to the [Build Tools](https://mongoose.ws/documentation/tutorials/tools/) tutorial
|
||||
- Makefiles must not include other Makefiles
|
||||
@@ -37,5 +38,5 @@ Rules for creating a new example:
|
||||
- Use `$(CFLAGS) $(CFLAGS_MONGOOSE) $(CFLAGS_EXTRA)` to compile
|
||||
- If an external repository is required, download it on demand using git shallow clone. See the embedded examples golden reference
|
||||
- Keep Makefiles as short as possible, but verbose to understand them easily
|
||||
- Symlink files when required, like `mongoose.c`, `ca.pem`, etc. Make no copies
|
||||
- Symlink files when required, like `ca.pem`, etc. Make no copies
|
||||
- Examples README.md files should contain only the title and the link to the corresponding mongoose.ws tutorial page
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../http/http-server/arduino/esp32-http
|
||||
@@ -1 +0,0 @@
|
||||
../mqtt/mqtt-client/arduino/esp32-mqtt
|
||||
@@ -1 +0,0 @@
|
||||
../mqtt/mqtt-client/arduino/sim800-mqtt/
|
||||
@@ -1 +0,0 @@
|
||||
../http/http-server/arduino/teensy41-http/
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../http/device-dashboard/net.c
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../http/device-dashboard/net.h
|
||||
@@ -0,0 +1 @@
|
||||
../../http/device-dashboard/packed_fs.c
|
||||
@@ -1 +0,0 @@
|
||||
../http/http-server/arduino/w5500-http
|
||||
@@ -1 +0,0 @@
|
||||
../mqtt/mqtt-client/arduino/w5500-mqtt
|
||||
@@ -0,0 +1 @@
|
||||
../../../http/device-dashboard/net.c
|
||||
@@ -0,0 +1 @@
|
||||
../../../http/device-dashboard/net.h
|
||||
@@ -0,0 +1 @@
|
||||
../../../http/device-dashboard/packed_fs.c
|
||||
@@ -0,0 +1 @@
|
||||
../../../../mongoose.c
|
||||
@@ -0,0 +1 @@
|
||||
../../../../mongoose.h
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../../http/uart-bridge/net.c
|
||||
@@ -0,0 +1 @@
|
||||
../../../http/uart-bridge/packed_fs.c
|
||||
@@ -1,8 +1,10 @@
|
||||
REPO_ROOT ?= ../../..
|
||||
|
||||
PROG ?= ./example # Program we are building
|
||||
DELETE = rm -rf # Command to remove files
|
||||
OUT ?= -o $(PROG) # Compiler argument for output file
|
||||
SOURCES = main.c mongoose.c net.c packed_fs.c # Source code files
|
||||
CFLAGS = -W -Wall -Wextra -g -I. # Build options
|
||||
SOURCES = main.c $(REPO_ROOT)/mongoose.c net.c packed_fs.c # Source code files
|
||||
CFLAGS = -I$(REPO_ROOT) -W -Wall -Wextra -g -I. # Build options
|
||||
|
||||
# Mongoose build options. See https://mongoose.ws/documentation/#build-options
|
||||
# CFLAGS_MONGOOSE +=
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../net.c
|
||||
@@ -1 +0,0 @@
|
||||
../../net.h
|
||||
@@ -1 +0,0 @@
|
||||
../../packed_fs.c
|
||||
@@ -1 +0,0 @@
|
||||
../../infineon/
|
||||
@@ -1 +0,0 @@
|
||||
../../../../../mongoose.c
|
||||
@@ -1 +0,0 @@
|
||||
../../../../../mongoose.h
|
||||
@@ -1 +0,0 @@
|
||||
../../net.c
|
||||
@@ -1 +0,0 @@
|
||||
../../net.h
|
||||
@@ -1 +0,0 @@
|
||||
../../packed_fs.c
|
||||
@@ -1 +0,0 @@
|
||||
../../nxp
|
||||
@@ -1 +0,0 @@
|
||||
../../pico-sdk/
|
||||
@@ -1 +0,0 @@
|
||||
../../renesas
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user