You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Open the Makefile and change settings in the configuration section.
31
+
Maybe you want to change the BOARD_VARIANT in the ./CMakeLists.txt file.
30
32
31
-
Connect your ESP32 Dev Board via USB and run
33
+
First build the project with
34
+
```shell
35
+
idf.py build
36
+
```
32
37
33
-
make flash monitor
38
+
Connect your ESP32 Dev Board via USB and run
39
+
```shell
40
+
idf.py flash monitor
41
+
```
34
42
35
43
Use the keyboard shortcut `AltGr + ]` to leave serial monitor.
36
44
37
45
Now you have installed the pre-configured boot script.
38
46
39
-
If this is your first install, your onboard LED should blink now. Blinking signals that
40
-
your board has started a soft ap with the ssid "esp32". With your mobile or desktop connect
41
-
to the WLAN SSID "esp32" and open http://192.168.4.1/setup (if you have not changed the default
42
-
credentials your username / password is esp32 / esp32 ).
47
+
If this is your first install, your onboard LED should blink now. Blinking signals that your board has started a soft ap with the ssid "esp32". With your mobile or desktop connect to the WLAN SSID "esp32" and open http://192.168.4.1/setup (if you have not changed the default credentials your username / password is esp32 / esp32 ).
43
48
44
49
On the Setup page you can configure your WLAN settings and an URL to download your JS main script from.
45
50
46
51
Please note that the script, does not need to have a main function, because its evaluated entirely.
47
52
That means, to print out "Hello World", you only have to include one line in your script on the webserver:
48
53
49
-
console.log('Hello world!');
54
+
```js
55
+
console.log('Hello world!');
56
+
```
57
+
58
+
### C/C++bindings
59
+
60
+
If you need to create your own C/C++ bindings for your JS code, this are the steps to perform:
61
+
62
+
1. Create a file named `project.cpp` in the `./main` directory
63
+
2. Implement the esp32_javascript_main callback function inside this `project.ccp`:
64
+
```c
65
+
externvoidesp32_javascript_main(duk_context *ctx)
66
+
{
67
+
// do your own duktape bindings here
68
+
}
69
+
```
70
+
71
+
See [Duktape Programmer's Guide](https://duktape.org/guide.html) for more information regarding Duktape bindings.
72
+
73
+
If you need more than this, you can create your own esp-idf component below `./components`. Then delegate the `esp32_javascript_main` function to this component.
74
+
Additionally you have to set your component name in the top level `./CMakeLists.txt`. Refer to the documentation next to the setting `ESP32_JS_PROJECT_NAME`.
75
+
See [ESP Build System](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/build-system.html) for information on how to create a component with the esp-idf build system.
76
+
77
+
### Clean
78
+
79
+
You can clean the project with
80
+
81
+
```shell
82
+
idf.py fullclean
83
+
```
50
84
51
85
## Compatibility
52
86
53
-
Tested with release/v4.0 (ba0f4f17ed91c3372149beacdfbee6af58e4f634) of esp-idf.
87
+
Tested with esp-idf (master branch commit hash 2e14149b).
0 commit comments