Skip to content

Commit acb7daa

Browse files
fix(firstMile): pre-launch validation fixes (#5682)
1 parent bce23eb commit acb7daa

File tree

5 files changed

+40
-24
lines changed

5 files changed

+40
-24
lines changed

src/homepageExperience/components/steps/arduino/ExecuteAggregateQuery.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,33 +35,33 @@ export const ExecuteAggregateQuery = (props: OwnProps) => {
3535
// ... code from Write Data step
3636
3737
// Query will find the min RSSI value for last minute for each connected WiFi network with this device
38-
String query = "from(bucket: \"${bucketName}\")\n\
39-
|> range(start: -1m)\n\
40-
|> filter(fn: (r) => r._measurement == \"wifi_status\")\n\
38+
String aggregate_query = "from(bucket: \\"${bucketName}\\")\\n\\
39+
|> range(start: -1m)\\n\\
40+
|> filter(fn: (r) => r._measurement == \\"wifi_status\\")\\n\\
4141
|> min()";
4242
4343
// Print composed query
44-
Serial.println("Querying for the mean RSSI value written to the \"${bucketName}\" bucket in the last 1 min... ");
45-
Serial.println(query);
44+
Serial.println("Querying for the mean RSSI value written to the \\"${bucketName}\\" bucket in the last 1 min... ");
45+
Serial.println(aggregate_query);
4646
4747
// Send query to the server and get result
48-
FluxQueryResult result = client.query(query);
48+
FluxQueryResult aggregate_result = client.query(aggregate_query);
4949
5050
Serial.println("Result : ");
5151
// Iterate over rows.
52-
while (result.next()) {
52+
while (aggregate_result.next()) {
5353
// Get converted value for flux result column 'SSID'
54-
String ssid = result.getValueByName("SSID").getString();
54+
String ssid = aggregate_result.getValueByName("SSID").getString();
5555
Serial.print("SSID '");
5656
Serial.print(ssid);
5757
5858
Serial.print("' with RSSI ");
5959
// Get value of column named '_value'
60-
long value = result.getValueByName("_value").getLong();
60+
long value = aggregate_result.getValueByName("_value").getLong();
6161
Serial.print(value);
6262
6363
// Get value for the _time column
64-
FluxDateTime time = result.getValueByName("_time").getDateTime();
64+
FluxDateTime time = aggregate_result.getValueByName("_time").getDateTime();
6565
6666
String timeStr = time.format("%F %T");
6767
@@ -72,13 +72,13 @@ export const ExecuteAggregateQuery = (props: OwnProps) => {
7272
}
7373
7474
// Report any error
75-
if (result.getError() != "") {
75+
if (aggregate_result.getError() != "") {
7676
Serial.print("Query result error: ");
77-
Serial.println(result.getError());
77+
Serial.println(aggregate_result.getError());
7878
}
7979
8080
// Close the result
81-
result.close();
81+
aggregate_result.close();
8282
8383
Serial.println("==========");
8484

src/homepageExperience/components/steps/arduino/ExecuteQuery.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ export const ExecuteQuery = (props: OwnProps) => {
2626
// ... code from Write Data step
2727
2828
// Query will find the RSSI values for last minute for each connected WiFi network with this device
29-
String query = "from(bucket: \"${bucketName}\")\n\
30-
|> range(start: -1m)\n\
31-
|> filter(fn: (r) => r._measurement == \"wifi_status\" and r._field == \"rssi\")";
29+
String query = "from(bucket: \\"${bucketName}\\")\\n\\
30+
|> range(start: -1m)\\n\\
31+
|> filter(fn: (r) => r._measurement == \\"wifi_status\\" and r._field == \\"rssi\\")";
3232
3333
// Print composed query
34-
Serial.println("Querying for RSSI values written to the \"${bucketName}\" bucket in the last 1 min... ");
34+
Serial.println("Querying for RSSI values written to the \\"${bucketName}\\" bucket in the last 1 min... ");
3535
Serial.println(query);
3636
3737
// Send query to the server and get result

src/homepageExperience/components/steps/arduino/InitializeClient.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,9 @@ export const InitializeClient: FC<OwnProps> = ({
176176
Serial.print("InfluxDB connection failed: ");
177177
Serial.println(client.getLastErrorMessage());
178178
}
179-
}`
179+
}
180+
void loop() {}
181+
`
180182

181183
// Events log handling
182184
const logCopyCodeSnippet = () => {

src/homepageExperience/components/steps/arduino/InstallDependencies.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,18 @@ export const InstallDependencies: FC = () => {
1313
<li>
1414
Under Sketch &rarr; Include Libraries, click on Manage Libraries.
1515
</li>
16-
<li>Search for 'influxdb' in the search box.</li>
17-
<li>Install 'InfluxDB Client for Arduino' library.</li>
16+
<li>
17+
Search for{' '}
18+
<code className="homepage-wizard--code-highlight">'influxdb'</code> in
19+
the search box.
20+
</li>
21+
<li>
22+
Install{' '}
23+
<code className="homepage-wizard--code-highlight">
24+
'InfluxDB Client for Arduino'
25+
</code>{' '}
26+
library.
27+
</li>
1828
</ol>
1929
<p>
2030
You'll need to have{' '}

src/homepageExperience/components/steps/arduino/PrepareIde.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,10 @@ export const PrepareIde = () => {
6363
<ol style={listStyle}>
6464
<li>Open the Arduino Preferences (Arduino &rarr; Preferences) </li>
6565
<li>
66-
Look for "Additional Boards Manager URLs" input box and paste
67-
"http://arduino.esp8266.com/stable/package_esp8266com_index.json"
66+
Look for "Additional Boards Manager URLs" input box and paste{' '}
67+
<code className="homepage-wizard--code-highlight">
68+
http://arduino.esp8266.com/stable/package_esp8266com_index.json
69+
</code>{' '}
6870
in it.
6971
</li>
7072
<li>Click OK.</li>
@@ -82,8 +84,10 @@ export const PrepareIde = () => {
8284
<ol style={listStyle}>
8385
<li>Open the Arduino Preferences (Arduino &rarr; Preferences) </li>
8486
<li>
85-
Look for "Additional Boards Manager URLs" input box and paste
86-
"https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json"
87+
Look for "Additional Boards Manager URLs" input box and paste{' '}
88+
<code className="homepage-wizard--code-highlight">
89+
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
90+
</code>{' '}
8791
in it.
8892
</li>
8993
<li>Click OK.</li>

0 commit comments

Comments
 (0)