Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
co2ampel
ampel-firmware
Commits
675736a4
Commit
675736a4
authored
May 01, 2021
by
Eric Duminil
Browse files
Commands: local ip via serial or mqtt
parent
28687be6
Changes
2
Hide whitespace changes
Inline
Side-by-side
ampel-firmware/mqtt.cpp
View file @
675736a4
...
...
@@ -37,7 +37,7 @@ namespace mqtt {
mqttClient
.
setServer
(
config
::
mqtt_server
,
config
::
mqtt_port
);
sensor_console
::
defineIntCommand
(
"mqtt"
,
setMQTTinterval
,
F
(
" 60 (Sets MQTT sending interval, in s)"
));
sensor_console
::
defineCommand
(
"local_ip"
,
sendInfoAboutLocalNetwork
,
sensor_console
::
defineCommand
(
"
send_
local_ip"
,
sendInfoAboutLocalNetwork
,
F
(
" (Sends local IP and SSID via MQTT. Can be useful to find sensor)"
));
}
...
...
ampel-firmware/wifi_util.cpp
View file @
675736a4
...
...
@@ -33,10 +33,19 @@ namespace wifi {
Serial
.
println
();
}
// Initialize Wi-Fi
void
showLocalIp
()
{
Serial
.
print
(
F
(
"WiFi - Local IP : "
));
Serial
.
println
(
wifi
::
local_ip
);
Serial
.
print
(
F
(
"WiFi - SSID : "
));
Serial
.
println
(
WIFI_SSID
);
}
// Initialize Wi-Fi
void
connect
(
const
char
*
hostname
)
{
sensor_console
::
defineCommand
(
"wifi_scan"
,
scanNetworks
,
F
(
" (Scans available WiFi networks)"
));
sensor_console
::
defineCommand
(
"local_ip"
,
showLocalIp
,
F
(
" (Displays local IP and current SSID)"
));
//NOTE: WiFi Multi could allow multiple SSID and passwords.
WiFi
.
persistent
(
false
);
// Don't write user & password to Flash.
WiFi
.
mode
(
WIFI_STA
);
// Set ESP to be a WiFi-client only
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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