Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
nexboot
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
nexboot
Commits
888aa7f4
Commit
888aa7f4
authored
May 25, 2018
by
Franco (nextime) Lanza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added /reboot URI
parent
388ad1ac
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
75 additions
and
4 deletions
+75
-4
bootloader_start.c
components/bootloader/subproject/main/bootloader_start.c
+1
-1
html.h
main/html.h
+50
-3
nexboot.c
main/nexboot.c
+6
-0
index.html
web/index.html
+2
-0
reboot.html
web/reboot.html
+16
-0
No files found.
components/bootloader/subproject/main/bootloader_start.c
View file @
888aa7f4
...
@@ -112,7 +112,7 @@ static int selected_boot_partition(const bootloader_state_t *bs)
...
@@ -112,7 +112,7 @@ static int selected_boot_partition(const bootloader_state_t *bs)
// Check for reset to the factory firmware or for launch OTA[x] firmware.
// Check for reset to the factory firmware or for launch OTA[x] firmware.
// Customer implementation.
// Customer implementation.
if
(
REG_GET_BIT
(
GPIO_IN_REG
,
BIT26
)
==
BIT26
)
{
if
(
REG_GET_BIT
(
GPIO_IN_REG
,
BIT26
)
==
BIT26
)
{
ESP_LOG
E
(
TAG
,
"GPIO 26 PRESSED: Booting on FACTORY_INDEX
\n
"
);
ESP_LOG
W
(
TAG
,
"GPIO 26 PRESSED: Booting on FACTORY_INDEX
\n
"
);
boot_index
=
FACTORY_INDEX
;
boot_index
=
FACTORY_INDEX
;
}
}
#endif
#endif
...
...
main/html.h
View file @
888aa7f4
...
@@ -52,7 +52,54 @@ unsigned char index_html[] = {
...
@@ -52,7 +52,54 @@ unsigned char index_html[] = {
0x74
,
0x79
,
0x70
,
0x65
,
0x3d
,
0x22
,
0x73
,
0x75
,
0x62
,
0x6d
,
0x69
,
0x74
,
0x74
,
0x79
,
0x70
,
0x65
,
0x3d
,
0x22
,
0x73
,
0x75
,
0x62
,
0x6d
,
0x69
,
0x74
,
0x22
,
0x20
,
0x76
,
0x61
,
0x6c
,
0x75
,
0x65
,
0x3d
,
0x22
,
0x75
,
0x70
,
0x6c
,
0x22
,
0x20
,
0x76
,
0x61
,
0x6c
,
0x75
,
0x65
,
0x3d
,
0x22
,
0x75
,
0x70
,
0x6c
,
0x6f
,
0x61
,
0x64
,
0x22
,
0x3e
,
0x0a
,
0x09
,
0x09
,
0x3c
,
0x2f
,
0x66
,
0x6f
,
0x6f
,
0x61
,
0x64
,
0x22
,
0x3e
,
0x0a
,
0x09
,
0x09
,
0x3c
,
0x2f
,
0x66
,
0x6f
,
0x72
,
0x6d
,
0x3e
,
0x0a
,
0x20
,
0x20
,
0x20
,
0x3c
,
0x2f
,
0x62
,
0x6f
,
0x64
,
0x72
,
0x6d
,
0x3e
,
0x0a
,
0x20
,
0x20
,
0x20
,
0x20
,
0x20
,
0x20
,
0x3c
,
0x62
,
0x79
,
0x3e
,
0x0a
,
0x3c
,
0x2f
,
0x68
,
0x74
,
0x6d
,
0x6c
,
0x3e
,
0x0a
,
0x0a
0x72
,
0x3e
,
0x0a
,
0x20
,
0x20
,
0x20
,
0x20
,
0x20
,
0x20
,
0x3c
,
0x64
,
0x69
,
0x76
,
0x3e
,
0x3c
,
0x61
,
0x20
,
0x68
,
0x72
,
0x65
,
0x66
,
0x3d
,
0x2f
,
0x72
,
0x65
,
0x62
,
0x6f
,
0x6f
,
0x74
,
0x3e
,
0x52
,
0x45
,
0x42
,
0x4f
,
0x4f
,
0x54
,
0x3c
,
0x2f
,
0x61
,
0x3e
,
0x3c
,
0x2f
,
0x64
,
0x69
,
0x76
,
0x3e
,
0x0a
,
0x20
,
0x20
,
0x20
,
0x3c
,
0x2f
,
0x62
,
0x6f
,
0x64
,
0x79
,
0x3e
,
0x0a
,
0x3c
,
0x2f
,
0x68
,
0x74
,
0x6d
,
0x6c
,
0x3e
,
0x0a
,
0x0a
};
};
unsigned
int
index_html_len
=
660
;
unsigned
int
index_html_len
=
715
;
unsigned
char
reboot_html
[]
=
{
0x3c
,
0x21
,
0x44
,
0x4f
,
0x43
,
0x54
,
0x59
,
0x50
,
0x45
,
0x20
,
0x68
,
0x74
,
0x6d
,
0x6c
,
0x3e
,
0x0a
,
0x3c
,
0x68
,
0x74
,
0x6d
,
0x6c
,
0x3e
,
0x0a
,
0x20
,
0x20
,
0x20
,
0x3c
,
0x68
,
0x65
,
0x61
,
0x64
,
0x3e
,
0x0a
,
0x20
,
0x20
,
0x20
,
0x20
,
0x20
,
0x20
,
0x3c
,
0x6d
,
0x65
,
0x74
,
0x61
,
0x20
,
0x6e
,
0x61
,
0x6d
,
0x65
,
0x3d
,
0x22
,
0x76
,
0x69
,
0x65
,
0x77
,
0x70
,
0x6f
,
0x72
,
0x74
,
0x22
,
0x20
,
0x63
,
0x6f
,
0x6e
,
0x74
,
0x65
,
0x6e
,
0x74
,
0x3d
,
0x22
,
0x77
,
0x69
,
0x64
,
0x74
,
0x68
,
0x3d
,
0x64
,
0x65
,
0x76
,
0x69
,
0x63
,
0x65
,
0x2d
,
0x77
,
0x69
,
0x64
,
0x74
,
0x68
,
0x2c
,
0x20
,
0x69
,
0x6e
,
0x69
,
0x74
,
0x69
,
0x61
,
0x6c
,
0x2d
,
0x73
,
0x63
,
0x61
,
0x6c
,
0x65
,
0x3d
,
0x31
,
0x22
,
0x3e
,
0x0a
,
0x20
,
0x20
,
0x20
,
0x20
,
0x20
,
0x20
,
0x3c
,
0x6d
,
0x65
,
0x74
,
0x61
,
0x20
,
0x68
,
0x74
,
0x74
,
0x70
,
0x2d
,
0x65
,
0x71
,
0x75
,
0x69
,
0x76
,
0x3d
,
0x22
,
0x72
,
0x65
,
0x66
,
0x72
,
0x65
,
0x73
,
0x68
,
0x22
,
0x20
,
0x63
,
0x6f
,
0x6e
,
0x74
,
0x65
,
0x6e
,
0x74
,
0x3d
,
0x22
,
0x31
,
0x30
,
0x3b
,
0x75
,
0x72
,
0x6c
,
0x3d
,
0x2f
,
0x22
,
0x3e
,
0x0a
,
0x20
,
0x20
,
0x20
,
0x20
,
0x20
,
0x20
,
0x3c
,
0x73
,
0x74
,
0x79
,
0x6c
,
0x65
,
0x20
,
0x74
,
0x79
,
0x70
,
0x65
,
0x3d
,
0x22
,
0x74
,
0x65
,
0x78
,
0x74
,
0x2f
,
0x63
,
0x73
,
0x73
,
0x22
,
0x3e
,
0x0a
,
0x20
,
0x20
,
0x20
,
0x20
,
0x20
,
0x20
,
0x20
,
0x20
,
0x20
,
0x68
,
0x74
,
0x6d
,
0x6c
,
0x2c
,
0x20
,
0x62
,
0x6f
,
0x64
,
0x79
,
0x2c
,
0x20
,
0x69
,
0x66
,
0x72
,
0x61
,
0x6d
,
0x65
,
0x20
,
0x7b
,
0x20
,
0x6d
,
0x61
,
0x72
,
0x67
,
0x69
,
0x6e
,
0x3a
,
0x20
,
0x30
,
0x3b
,
0x20
,
0x70
,
0x61
,
0x64
,
0x64
,
0x69
,
0x6e
,
0x67
,
0x3a
,
0x20
,
0x30
,
0x3b
,
0x20
,
0x68
,
0x65
,
0x69
,
0x67
,
0x68
,
0x74
,
0x3a
,
0x20
,
0x31
,
0x30
,
0x30
,
0x25
,
0x3b
,
0x20
,
0x7d
,
0x0a
,
0x20
,
0x20
,
0x20
,
0x20
,
0x20
,
0x20
,
0x20
,
0x20
,
0x20
,
0x69
,
0x66
,
0x72
,
0x61
,
0x6d
,
0x65
,
0x20
,
0x7b
,
0x20
,
0x64
,
0x69
,
0x73
,
0x70
,
0x6c
,
0x61
,
0x79
,
0x3a
,
0x20
,
0x62
,
0x6c
,
0x6f
,
0x63
,
0x6b
,
0x3b
,
0x20
,
0x77
,
0x69
,
0x64
,
0x74
,
0x68
,
0x3a
,
0x20
,
0x31
,
0x30
,
0x30
,
0x25
,
0x3b
,
0x20
,
0x62
,
0x6f
,
0x72
,
0x64
,
0x65
,
0x72
,
0x3a
,
0x20
,
0x6e
,
0x6f
,
0x6e
,
0x65
,
0x3b
,
0x20
,
0x7d
,
0x0a
,
0x20
,
0x20
,
0x20
,
0x20
,
0x20
,
0x20
,
0x3c
,
0x2f
,
0x73
,
0x74
,
0x79
,
0x6c
,
0x65
,
0x3e
,
0x0a
,
0x20
,
0x20
,
0x20
,
0x20
,
0x20
,
0x20
,
0x3c
,
0x74
,
0x69
,
0x74
,
0x6c
,
0x65
,
0x3e
,
0x4e
,
0x65
,
0x78
,
0x62
,
0x6f
,
0x6f
,
0x74
,
0x20
,
0x4e
,
0x65
,
0x74
,
0x77
,
0x6f
,
0x72
,
0x6b
,
0x20
,
0x42
,
0x6f
,
0x6f
,
0x74
,
0x6c
,
0x6f
,
0x61
,
0x64
,
0x65
,
0x72
,
0x20
,
0x66
,
0x6f
,
0x72
,
0x20
,
0x45
,
0x53
,
0x50
,
0x33
,
0x32
,
0x3c
,
0x2f
,
0x74
,
0x69
,
0x74
,
0x6c
,
0x65
,
0x3e
,
0x0a
,
0x20
,
0x20
,
0x20
,
0x3c
,
0x2f
,
0x68
,
0x65
,
0x61
,
0x64
,
0x3e
,
0x0a
,
0x20
,
0x20
,
0x20
,
0x3c
,
0x62
,
0x6f
,
0x64
,
0x79
,
0x3e
,
0x0a
,
0x20
,
0x20
,
0x20
,
0x20
,
0x20
,
0x20
,
0x3c
,
0x68
,
0x31
,
0x3e
,
0x52
,
0x65
,
0x62
,
0x6f
,
0x6f
,
0x74
,
0x69
,
0x6e
,
0x67
,
0x2e
,
0x2e
,
0x2e
,
0x3c
,
0x2f
,
0x68
,
0x31
,
0x3e
,
0x0a
,
0x20
,
0x20
,
0x20
,
0x3c
,
0x2f
,
0x62
,
0x6f
,
0x64
,
0x79
,
0x3e
,
0x0a
,
0x3c
,
0x2f
,
0x68
,
0x74
,
0x6d
,
0x6c
,
0x3e
,
0x0a
,
0x0a
};
unsigned
int
reboot_html_len
=
465
;
main/nexboot.c
View file @
888aa7f4
...
@@ -175,6 +175,12 @@ static void mg_ev_handler(struct mg_connection *nc, int ev, void *p) {
...
@@ -175,6 +175,12 @@ static void mg_ev_handler(struct mg_connection *nc, int ev, void *p) {
mg_send_head
(
nc
,
200
,
index_html_len
,
"Content-Type: text/html"
);
mg_send_head
(
nc
,
200
,
index_html_len
,
"Content-Type: text/html"
);
mg_send
(
nc
,
index_html
,
index_html_len
);
mg_send
(
nc
,
index_html
,
index_html_len
);
}
}
}
else
if
(
strcmp
(
uri
,
"/reboot"
)
==
0
)
{
mg_send_head
(
nc
,
200
,
reboot_html_len
,
"Content-Type: text/html"
);
mg_send
(
nc
,
reboot_html
,
reboot_html_len
);
ESP_LOGI
(
TAG
,
"Rebooting... "
);
esp_restart
();
}
else
{
}
else
{
mg_send_head
(
nc
,
404
,
0
,
"Content-Type: text/plain"
);
mg_send_head
(
nc
,
404
,
0
,
"Content-Type: text/plain"
);
}
}
...
...
web/index.html
View file @
888aa7f4
...
@@ -15,6 +15,8 @@
...
@@ -15,6 +15,8 @@
<input
type=
"file"
name=
"fw"
>
<input
type=
"file"
name=
"fw"
>
<input
type=
"submit"
value=
"upload"
>
<input
type=
"submit"
value=
"upload"
>
</form>
</form>
<br>
<div><a
href=
/reboot
>
REBOOT
</a></div>
</body>
</body>
</html>
</html>
web/reboot.html
0 → 100644
View file @
888aa7f4
<!DOCTYPE html>
<html>
<head>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<meta
http-equiv=
"refresh"
content=
"10;url=/"
>
<style
type=
"text/css"
>
html
,
body
,
iframe
{
margin
:
0
;
padding
:
0
;
height
:
100%
;
}
iframe
{
display
:
block
;
width
:
100%
;
border
:
none
;
}
</style>
<title>
Nexboot Network Bootloader for ESP32
</title>
</head>
<body>
<h1>
Rebooting...
</h1>
</body>
</html>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment