Skip to content

Commit b444c76

Browse files
committed
Improve some of the logging
1 parent be89f02 commit b444c76

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

scripts/flash.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
44

5-
PORT=COM8
5+
PORT=COM7
66
BUILD_DIR=$SCRIPTPATH/../build
77

88
# Do path conversion for WSL

src/examples/sandbox/sandbox.ino

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,6 @@ void decodeMessage(const char *message) {
207207
return;
208208
}
209209

210-
Log.infof("Starting to stream for %d s\r\n", duration);
211-
212210
data_frequency = frequency;
213211
seconds_counted = 0;
214212
target_seconds = duration;
@@ -221,7 +219,6 @@ void decodeMessage(const char *message) {
221219

222220
void setup() {
223221
Log.begin(115200);
224-
Log.setLogLevel(LogLevel::DEBUG);
225222

226223
LedCtrl.begin();
227224
LedCtrl.startupCycle();
@@ -249,6 +246,8 @@ void setup() {
249246
return;
250247
}
251248

249+
Log.infof("Board name: %s\r\n", thing_name);
250+
252251
sprintf(mqtt_sub_topic, MQTT_SUB_TOPIC_FMT, thing_name);
253252
sprintf(mqtt_pub_topic, MQTT_PUB_TOPIC_FMT, thing_name);
254253

@@ -260,6 +259,7 @@ void loop() {
260259
switch (state) {
261260
case NOT_CONNECTED:
262261
state = CONNECTED_TO_NETWORK;
262+
Log.info("Connected to LTE network");
263263
connectMqtt();
264264
break;
265265
default:
@@ -291,7 +291,7 @@ void loop() {
291291
case CONNECTED_TO_NETWORK:
292292
state = CONNECTED_TO_BROKER;
293293

294-
Log.info("Connected to broker, subscribing to topic");
294+
Log.info("Connected to MQTT broker, subscribing to topics");
295295

296296
MqttClient.subscribe(mqtt_sub_topic, MqttQoS::AT_LEAST_ONCE);
297297

@@ -382,7 +382,9 @@ void loop() {
382382
case CONNECTED_TO_BROKER:
383383

384384
state = STREAMING_DATA;
385-
Log.info("Starting streaming data");
385+
386+
Log.infof("Starting to stream data for %d seoncds\r\n",
387+
target_seconds);
386388
startStreamTimer();
387389
break;
388390

0 commit comments

Comments
 (0)