10 |
11 | !!! note
12 | Google and Google Sheets are trademarks of Google LLC. This tutorial is not endorsed by or affiliated with Google in any way. We just thought it was a sweet tool to visualize all the data that was collected by your snazzy DataLogger IoT. 😉
13 |
14 |
15 |
16 | ### Log Some Data!
17 |
18 | At this point, we will assume that you have configured connected your devices to the DataLogger IoT and configured its settings. Insert the microSD card into it's socket. Power the DataLogger IoT up and start logging some data! In this case, we were using the DataLogger IoT using the Qwiic Environmental Combo Breakout - ENS160/BME280. of course, you could have other compatible Qwiic-enabled devices connected depending on your setup. For simplicity, a WiFi connection was used to synchronize the clock to the NTP server and a computer's USB port was used to power everything.
19 |
20 | !!! tip
21 | For users without an Internet connection to sync the clock to the NTP server, you may want to consider using a compatible Qwiic-enabled device like the Qwiic Real Time Clock (RTC) Module - RV-8803 or a Qwiic-enabled u-blox GNSS module. Note that you will need to configure the time to your area before logging any data. U-blox GNSS modules would also need to be able to view a few satellites before being able to synchronize to the UTC.
22 |
23 | !!! note
24 | For users that require a timestamp with their datasets, make sure to [enable timestamp](https://docs.sparkfun.com/SparkFun_DataLogger/example_timestamp/).
25 |
26 | ### Download the Log Files
27 |
28 | Users can download the log files to your computer with the IoT Web Server. You will need to update firmware to v01.02.00 and enable this feature. For more information, check out the [previous example to view and download log files using the IoT web server](../example_iot_web_server/).
29 |
30 |
31 |
32 |
33 | Of course, users can follow the old school method and manually grab the files using a microSD card reader. When ready, remove power from the DataLogger IoT and eject the microSD card from the socket. Insert the microSD card into an adapter and connect to your computer.
34 |
35 |
39 |
40 |
41 |
42 | ### Importing CSV to a Spreadsheet
43 |
44 | Log into your Google account and [open Google Sheets to create a new spreadsheet](https://www.google.com/sheets/about/).
45 |
46 |
47 |
48 | Head to the menu and select: **File** > **Import**.
49 |
50 |
51 |
52 |
53 |
54 | A window will pop up with some options to import a file. Click the **Upload** tab. Click on the **Browse** button to choose the file. Or drag and drop the file into the upload area. In this case, the DataLogger IoT saved the comma separated values to a text file called **sfe0003.txt**.
55 |
56 |
57 |
58 |
59 |
60 | !!! note
61 | Not seeing any data in the file or even a text file saved in the root directory? Make sure that the microSD card is formatted correctly and the DataLogger is configured properly. In the menu, make sure to have the [**SD Card Format** enabled and set to the correct format](../configuration/#logging-logger). In this case, we are using the default CSV format.
62 |
63 | Another window will pop up asking how to import the file. From the drop down menu, select: **Import location** > **Create new spreadsheet** and **Separator Type** > **Detect automatically**. Since the file will include commas to separate each reading, Google Sheets should automatically separate text and values into each cell. Otherwise, you can select **comma** as the separator type.
64 |
65 |
66 |
67 |
68 |
69 | !!! note
70 | If you have the file open, you can also manually paste the CSV data into the spreadsheet. Select all the contents of the text file and copy the contents onto your clipboard. Right click the cell closest to the top and farthest to the left of the spreadsheet (i.e. A1). Then paste the data. One caveat is that Google Sheets may have problems where it only pastes the title of each column.
71 |
72 |
73 |
74 |
75 |
76 | If you see this happen, you will need to select all but the header row from the text file. Then copy the contents onto your clipboard again. Right click on the next row the titles (i.e. A2) and paste the data.
77 |
78 |
79 |
80 |
81 |
82 | !!! tip
83 | To separate the values to each column, highlight everything in the column. Then head to the menu and select: **Data** > **Split text into columns**
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 | ### Graphing Your Datasets
92 |
93 | Hold down the Shift button on your keyboard and select the columns that you would like to graph using your mouse. Once the data is highlighted, head to the menu and select: **Insert** > **Chart**.
94 |
95 |
96 |
97 |
98 |
99 | The values that were selected will be graphed. You will want to be careful about including too many datasets on the graph as it can be hard to read when they are not in the same range.
100 |
101 |
102 |
103 |
104 |
105 | At this point, try formatting the data based on your preferences and export the graph. The graph below was formatted and exported to a PNG. Note that the values for the AQI were moved to the right of the graph for a better viewing since they were smaller than the datasets for TVOC and eCO2.
106 |
107 |
108 |
109 |
110 |
111 | !!! note
112 | There are additional features to help format your data based on your personal preferences! Select the column that you would like to format. Then head to the menu: **Format** > **Number**. Select the format that you would like to apply to the dataset. In this case, we adjusted the General Time with **Custom Date and Time** to show a 12-hour format before creating a new graph.
113 |
114 |
115 |
116 |
117 |
--------------------------------------------------------------------------------
/docs/example_aws.md:
--------------------------------------------------------------------------------
1 | # Creating and Connecting to an AWS IoT Device (Thing)
2 |
3 | One of the key features of the DataLogger IoT is it's simplified access to IoT service providers. This document outlines how an AWS IoT device is used by the DataLogger IoT.
4 |
5 |
10 |
11 | The following is covered by this document:
12 |
13 | * Device (Thing) creation in AWS
14 | * Securely connecting the device
15 | * How data is posted from the DataLogger IoT to the AWS Device via it's Shadow
16 |
17 | Currently, the AWS IoT device connection is a single direction - used to post data from the hardware to the IoT AWS Device via the AWS IoT devices **shadow**. Configuration information from AWS IoT to the DataLogger IoT is currently not implemented.
18 |
19 |
20 |
21 | ## General Operation
22 |
23 | AWS IoT enables connectivity between an IoT / Edge device and the AWS Cloud Platform, implementing secure endpoints and device models within the AWs infrastructure. This infrastructure allows edge devices to post updates, status and state to the AWS infrastructure for analytics, monitoring and reporting.
24 |
25 | In AWS IoT, an virtual representation of an actual device is created and referred to as a *Thing*. The virtual device/Thing is allocated a connection endpoint, security certificates and a device **shadow** - a JSON document used to persist, communicate and manage device state within AWS.
26 |
27 | The actual IoT device communicates with it's AWS representation via a secure MQTT connection, posting JSON document payloads to a set of pre-defined topics. Updates are posted to the AWS IoT device **shadow**, which is then accessed within AWS for further process as defined by the users particular cloud implementation.
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | ## Creating a Device in AWS IoT
37 |
38 | The following discussion outlines the basic steps taken to create a Thing in AWS IoT that the DataLogger IoT can connect to. First step is to log into your AWS account and create a thing.
39 |
40 |
41 |
42 | Once logged into your AWS account, select **IoT Core** from the menu of services.
43 |
44 |
45 |
46 |
47 |
48 | From the IoT Core console page, under the **Manage** section, select **All Devices > Things**
49 |
50 | On the resultant Things Page, select the **Create Things** button.
51 |
52 |
53 |
54 |
55 |
56 | AWS IoT will then take you through the steps to create a device. Selections made for a demo Thing are:
57 |
58 | * Create single thing
59 | * Thing Properties
60 | * Enter a name for your thing - for this example ***TestThing23***
61 | * Device Shadow - select ***Unnamed shadow (classic)***
62 | * Auto-generate a new certificate
63 | * Attach policies to certificate - This is discussed later in this document
64 | * Select **Create thing**
65 |
66 | Upon creation, AWS IoT presents you with a list of downloadable certificates and keys. Some of these are only available at this step. The best option is to download everything presented - three of these are used by the DataLogger IoT. The following should be downloaded:
67 |
68 | * Device Certificate
69 | * Public Key File
70 | * Private Key File
71 | * Root CA certificates - (for example: Amazon Root CA 1 )
72 |
73 | At this point, the new AWS IoT thing is created and listed on the AWS IoT Things Console
74 |
75 |
76 |
77 |
78 |
79 | ### Security Policy
80 |
81 | To write to the IoT device, a security policy that enables this is needed, and the policy needs to be assigned to the devices certificate.
82 |
83 | To create a Policy, select the ***Manage > Security > Policies*** menu item from the left side menu of the AWS IoT panel. Once on this page, select the **Create policy** button to create a new policy.
84 |
85 |
86 |
87 |
88 |
89 | When entering the policy, provide a name that fits your need. For this example, the name **NewThing23Policy** is used. For the Policy document, you can manually enter the security entires, or enter them as a JSON document. The JSON document used for this example is:
90 |
91 | ```json
92 | {
93 | "Version": "2012-10-17",
94 | "Statement": [
95 | {
96 | "Effect": "Allow",
97 | "Action": "iot:Connect",
98 | "Resource": "*"
99 | },
100 | {
101 | "Effect": "Allow",
102 | "Action": "iot:Subscribe",
103 | "Resource": "*"
104 | },
105 | {
106 | "Effect": "Allow",
107 | "Action": "iot:Receive",
108 | "Resource": "*"
109 | },
110 | {
111 | "Effect": "Allow",
112 | "Action": "iot:Publish",
113 | "Resource": "*"
114 | },
115 | {
116 | "Effect": "Allow",
117 | "Action": "iot:GetThingShadow",
118 | "Resource": "*"
119 | },
120 | {
121 | "Effect": "Allow",
122 | "Action": "iot:UpdateThingShadow",
123 | "Resource": "*"
124 | }
125 | ]
126 | }
127 | ```
128 |
129 |
130 |
131 |
132 |
133 | Once the policy is created, go back to the IoT Device/Thing created above and associate this policy to the device Certificate.
134 |
135 | * Go to your device ***Manage > All devices > Things***
136 | * Select the device - ***TestThing23*** for this example
137 | * Select the ***Certificates*** tab
138 | * Select the listed Certificate (it's a very long hex number)
139 | * At the bottom right of the page, select the ***Attach policies*** button and select the Policy created above.
140 |
141 |
142 |
143 |
144 |
145 | At this point, AWS IoT is ready for a device to connect and receive data.
146 |
147 |
148 |
149 | ## AWS Configuration
150 |
151 | The specifics for the AWS IoT Thing must be configured. This includes the following:
152 |
153 | * Server name/host
154 | * MQTT topic to update
155 | * Client Name - The AWS IoT Thing Name
156 | * CA Certificate Chain
157 | * Client Certificate
158 | * Client Key
159 |
160 |
161 |
162 | ### Server Name/Hostname
163 |
164 | This value is obtained from the AWS IoT Device page for the created device. When on this page, select the ***Device Shadows*** tab, and then select the ***Classic Shadow*** shadow, which is listed. Note a secure connection is used, so the port for the connection is `8883`.
165 |
166 |
167 |
168 |
169 |
170 |
171 | Selecting the ***Classic Shadow*** entry provides the Server Name/Hostname for the device, as well as the MQTT topic for this device.
172 |
173 |
174 |
175 |
176 |
177 | !!! note
178 | The server name is obtained from the Device Shadow URL entry
179 |
180 |
181 |
182 | ### MQTT Topic
183 |
184 | The MQTT topic value is based uses the ***MQTT topic prefix*** from above, and has the value ***update*** added to it. So for this example, the MQTT topic is:
185 |
186 | $aws/things/TestThing23/shadow/update
187 |
188 |
189 |
190 | ### Client Name
191 |
192 | This is the AWS IoT name of the thing. For the provided example, the value is ***TestThing23***
193 |
194 |
195 |
196 | ### CA Certificate Chain
197 |
198 | This value was downloaded as a file during the creation process. The contents of this file can be passed on to the DataLogger IoT by copying the file containing the data onto a devices SD Card and setting the filename property for the DataLogger IoT.
199 |
200 |
201 |
202 | ### Client Certificate
203 |
204 | This value was downloaded as a file during the creation process. The contents of this file can be passed on to the DataLogger IoT by copying the file containing the data onto a devices SD Card and setting the filename property for the DataLogger IoT.
205 |
206 |
207 |
208 | ### Client Key
209 |
210 | This value was downloaded as a file during the creation process. The contents of this file can be passed on to the DataLogger IoT by copying the file containing the data onto a devices SD Card and setting the filename property for the DataLogger IoT.
211 |
212 |
213 |
214 | ## Setting Properties
215 |
216 | The above property values must be set on the DataLogger before use. They can be set manually by using the menu system like the previous MQTT example.
217 |
218 | For users that are interested in using the menu system, you will need to open a Serial Terminal, connect to the COM port that your DataLogger enumerated to, and set it to **115200** baud. In this case, we connected to **COM13**. Press any key to enter the Main Menu. Type 1 to enter the Settings menu. Then type 11 to enter the AWS IoT Menu. When the menu system for the AWS IoT connection is presented, you will need to configure the property values as listed in the JSON file. Saving the values through the menu system will save the credentials to the ESP32's persistent memory. The following options are displayed:
219 |
220 |
221 |
222 |
223 |
224 | The alternative to using the menu system is a JSON file. These values can be set using a JSON file that is loaded by the system at startup. For the DataLogger IoT example outlined in this document, the entries in the settings JSON file are as follows:
225 |
226 | ```json
227 | "AWS IoT": {
228 | "Enabled": true,
229 | "Port": 8883,
230 | "Server": "avgpd2wdr5s6u-ats.iot.us-east-1.amazonaws.com",
231 | "MQTT Topic": "$aws/things/TestThing23/shadow/update",
232 | "Client Name": "TestThing23",
233 | "Buffer Size": 0,
234 | "Username": "",
235 | "Password": "",
236 | "CA Certificate": "",
237 | "Client Certificate": "",
238 | "Client Key": "",
239 | "CA Cert Filename": "AmazonRootCA1.pem",
240 | "Client Cert Filename": "TestThing23_DevCert.crt",
241 | "Client Key Filename": "TestThing23_Private.key"
242 | },
243 | ```
244 |
245 | Besides updating the `Server`, `MQTT Topic`, `Client Name`, `CA Cert Filename`, `Client Cert Filename`, and `Client Key Filename`, you will need to also ensure that the `port` is set to `8883`. The default in previous firmware versions was `1883`. As of firmware v01.00.04, the default is `8883`. You will need to adjust the port value to properly connect to the [AWS IoT service](https://aws.amazon.com/about-aws/whats-new/2018/02/aws-iot-core-now-supports-mqtt-connections-with-certificate-based-client-authentication-on-port-443/). Don't forget to enable AWS IoT service by setting the value to `true`. If the JSON file is saved in the microSD card, you can load the credentials to the DataLogger IoT.
246 |
247 | !!! tip
248 | To load the values by the system at startup using a JSON file and microSD card, you will need to [configure the Save Settings](../configuration#general-save-settings). This JSON file will be created with the "**Save to Fallback**" option. Make sure to enable the AWS IoT as well.
249 |
250 | ## Operation
251 |
252 | Once the device is configured and running, updates in AWS IoT are listed in the ***Activity*** tab of the devices page. For the test device in this document, this page looks like:
253 |
254 |
255 |
256 |
257 |
258 | Opening up an update, you can see the data being set to AWS IoT in a JSON format.
259 |
260 |
261 |
262 |
263 |
--------------------------------------------------------------------------------
/docs/example_azure.md:
--------------------------------------------------------------------------------
1 | # Creating and Connecting to an Azure IoT Device
2 |
3 | One of the key features of the DataLogger IoT is it's simplified access to IoT service providers. This document outlines how an Azure IoT device is used by the DataLogger IoT.
4 |
5 |
10 |
11 | The following is covered by this document:
12 |
13 | * Device creation Azure
14 | * Securely connecting the device
15 | * How data is posted from the DataLogger IoT to the Azure Device
16 |
17 | Currently, the Azure IoT device connection is a single direction - it is used to post data from the hardware to the Azure IoT Device. Configuration information from Azure IoT to the DataLogger IoT is currently not implemented.
18 |
19 |
20 |
21 | ## General Operation
22 |
23 | Azure IoT enables connectivity between an IoT / Edge device and the Azure Cloud Platform, implementing secure endpoints and device models within the Azure infrastructure. This infrastructure allows edge devices to post updates, status and state to the Azure infrastructure for analytics, monitoring and reporting.
24 |
25 | In Azure IoT, an virtual representation of an actual device is created and referred to as a *Device*. The virtual device is allocated a connection endpoint, security certificates and a device **digital twin** - a JSON document used to persist, communicate and manage device state within Azure. Unlike AWS IoT, data from the device isn't posted to the devices digital twin (AWS Shadow), but to the device directly.
26 |
27 | The actual IoT device communicates with it's Azure representation via a secure MQTT connection, posting JSON document payloads to a set of pre-defined topics. Updates are posted directly to the Azure device, which is then accessed within Azure for further process as defined by the users particular cloud implementation.
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | ## Creating a Device in Azure IoT
36 |
37 | The following discussion outlines the basic steps taken to create a Device in Azure IoT that the DataLogger IoT can connect to. First step is to log into your Azure account and create an IoT Hub for your device.
38 |
39 |
40 |
41 | Once logged into your Microsoft Azure account, select **Internet of Things > IoT Hub** from the menu of services.
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 | ### Create an IoT Hub
50 |
51 | This IoT Hub page lists all the IoT hubs available for your account. To add a device, you need to create a new IoT Hub.
52 |
53 | Follow the Hub Creation workflow - key settings used for a DataLogger demo device:
54 |
55 | * Used the "Free Tier" for testing and development.
56 | * Networking
57 | * Connectivity - ***Public Access***
58 | * Minimum TLS Version - ***1.0***
59 |
60 | The remaining settings were set at their default values.
61 |
62 |
63 |
64 | ## Create a Device
65 |
66 | Once the IoT Hub is created, a Device needs to be created within the hub. The device represents the connection to the actual DataLogger IoT device.
67 |
68 | To create a device, select the ***Device management > Devices*** from the IoT Hub menu and the select the ***+ Add Device*** menu item
69 |
70 |
71 |
72 |
73 |
74 | In the create device dialog:
75 |
76 | * Enter a name for the device
77 | * Select an Authentication type of ***Symmetric key***
78 | * Auto-generate keys ***enabled***
79 |
80 |
81 |
82 |
83 |
84 | Once created, the device is listed in the ***Devices*** list of the IoT Hub. Selecting the device gives you the device ID and keys used to communicate with the device. Note, when connecting to the device with the DataLogger IoT, the ***Primary Key*** value is used.
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 | ## Azure Configuration
93 |
94 | Once the DataLogger IoT is integrated into the application, the specifics for the Azure IoT Thing must be configured. This includes the following:
95 |
96 | * Server Name/Hostname
97 | * Device Key
98 | * Device ID
99 | * CA Certificate Chain
100 |
101 |
102 |
103 | ### Server Name/Hostname
104 |
105 | This value is hostname of the created IoT Hub and is obtained from the Overview page of the IoT Hub. Note a secure connection is used, so the port for the connection is `8883`.
106 |
107 |
108 |
109 |
110 |
111 | ### Device ID
112 |
113 | The Device ID is obtained from the device detail page. This page is accessible via the Device listing page, which is accessed via the ***Device management > Devices*** menu item. The selected device of interest (**TestDevice2023** for this example) provides the device ID and Primary Key.
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 | ### Device Primary Key
122 |
123 | This is obtained via the Device details page, as outlined in the previous section.
124 |
125 | !!! note
126 | You view and copy the key via the icons on the right of the key entry line.
127 |
128 |
129 |
130 | ### Root Certificate Authority - CA file
131 |
132 | The Certificate Authority file for Azure is downloaded from this page:
133 |
134 |
135 |
136 | The file to download is the ***Baltimore CyberTrust Root*** entry in the **Root Certificate Authorities** section of the page.
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 | ## Setting Properties
146 |
147 | The above property values must be set on the DataLogger IoT before use. They can be set manually by using the menu system like the previous MQTT example.
148 |
149 | For users that are interested in using the menu system, you will need to open a Serial Terminal, connect to the COM port that your DataLogger enumerated to, and set it to **115200** baud. In this case, we connected to **COM13**. Press any key to enter the Main Menu. Type 1 to enter the Settings menu. Then type 13 to enter the Azure IoT Menu. When the menu system for the Azure IoT connection is presented, you will need to configure the property values as listed in the JSON file. Saving the values through the menu system will save the credentials to the ESP32's persistent memory. The following options are displayed:
150 |
151 |
152 |
153 |
154 |
155 | The alternative to using the menu system is a JSON file. These values can be set using a JSON file that is loaded by the system at startup. For the example outlined in this document, the entries in the settings JSON file are as follows:
156 |
157 | ```json
158 | "Azure IoT": {
159 | "Enabled": true,
160 | "Port": 8883,
161 | "Server": "sparkfun-datalogger-hub.azure-devices.net",
162 | "MQTT Topic": "",
163 | "Client Name": "",
164 | "Buffer Size": 0,
165 | "Username": "",
166 | "Password": "",
167 | "Device Key" : "My-Super-Secret-Device-Key",
168 | "Device ID" : "TestDevice2023",
169 | "CA Cert Filename": "AzureRootCA.pem"
170 | },
171 | ```
172 |
173 | Besides updating the `Server`, `Device Key`, `Device ID`, and `CA Cert Filename`, you will need to also ensure that the `port` is set to `8883`. The default in previous firmware versions was `1883`. As of firmware v01.00.04, the default is `8883`. You will need to adjust the port value to properly connect to the Azure IoT service. Don't forget to enable Azure IoT service by setting the value to `true`. If the JSON file is saved in the microSD card, you can load the credentials to the DataLogger IoT.
174 |
175 |
176 | !!! tip
177 | To load the values by the system at startup using a JSON file and microSD card, you will need to [configure the Save Settings](../configuration#general-save-settings). This JSON file will be created with the "**Save to Fallback**" option. Make sure to enable the Azure IoT as well.
178 |
179 |
180 | ## Operation and Monitoring
181 |
182 | Once the DataLogger IoT device is configured and running, the Azure IoT capability in the DataLogger IoT posts messages via MQTT to the connected Azure Device via it's IoT Hub. Messages to the device are posted as ***Telemetry Data*** for the device.
183 |
184 | The easiest method to view the Telemetry data being sent to an Azure Iot Device is via the Azure IoT Hub extension for the Visual Studio Code editor.
185 |
186 |
187 |
188 |
189 |
190 | Once installed, and connected to Azure via the Azure Account extension, you can connect to the target IoT Hub, and monitor telemetry data for a IoT device.
191 |
192 |
193 |
194 | ### Connect to Your Azure IoT Hub
195 |
196 | On the Explorer panel of Visual Studio Code, click on the **...** menu of the **AZURE IOT HUB** section. In the popup menu, select the **Select IoT Hub** menu entry.
197 |
198 |
199 |
200 |
201 |
202 | The available IoT Hubs are displayed in the editors command prompt. Select the desired hub and press Enter (or click).
203 |
204 |
205 |
206 |
207 |
208 | The hub is then displayed in the **AZURE IOT HUB** section of the editor Explorer. Expanding the **Devices** section of the Hub will list the example device created above.
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 | ### Monitoring
218 |
219 | To monitor the telemetry data send to a device, right click on the device, ***TestDevice2023*** in this example, select the menu entry **Start Monitoring Build-in Event Endpoint**.
220 |
221 |
222 |
223 |
224 |
225 | Once selected, the editor output console will start displaying output for the selected device. For the above example, with a device that has environmental sensors attached, the output appears as follows:
226 |
227 |
228 |
229 |
230 |
231 | To stop monitoring, click the **Stop Monitoring build-in event endpoint** item that is displayed in the status bar of the editor.
232 |
233 |
234 |
235 |
236 |
237 | A menu option to stop monitoring is also available from the **...** menu of the **AZURE IOT HUB** section in the editor Explorer panel.
238 |
--------------------------------------------------------------------------------
/docs/example_http.md:
--------------------------------------------------------------------------------
1 | # Connecting and Sending Output to an HTTP Server
2 |
3 | One of the key features of the DataLogger IoT is it's simplified access to IoT service providers and servers. This document outlines how output from a DataLogger IoT device is sent to an HTTP server.
4 |
5 | The following is covered by this document:
6 |
7 | * Overview of the HTTP connection
8 | * How a user configures and uses the HTTP connection
9 | * Use examples
10 |
11 |
12 |
13 | ## General Operation
14 |
15 | HTTP connectivity allows data generated by the DataLogger IoT to be sent to an HTTP server. An HTTP endpoint is provided to the HTTP action within the DataLogger IoT, and when data is output, a JSON representation of the data is published to the endpoint via an HTTP POST operation. The body of the POST operation contains the a JSON document that encapsulates the sent DataLogger IoT data.
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | ### Data Structure
25 |
26 | Data is sent to the HTTP server as a JSON object, which contains a collection of sub-object. Each sub-object represents a data source in the sensor, and contains the current readings from that source.
27 |
28 | The following is an example of the data posted - note, this representation was "pretty printed" for readability.
29 |
30 | ```json
31 | {
32 | "MAX17048": {
33 | "Voltage (V)": 4.304999828,
34 | "State Of Charge (%)": 115.0625,
35 | "Change Rate (%/hr)": 0
36 | },
37 | "CCS811": {
38 | "CO2": 620,
39 | "VOC": 33
40 | },
41 | "BME280": {
42 | "Humidity": 25.03613281,
43 | "TemperatureF": 79.64599609,
44 | "TemperatureC": 26.46999931,
45 | "Pressure": 85280.23438,
46 | "AltitudeM": 1430.44104,
47 | "AltitudeF": 4693.04834
48 | },
49 | "ISM330": {
50 | "Accel X (milli-g)": -53.31399918,
51 | "Accel Y (milli-g)": -34.03800201,
52 | "Accel Z (milli-g)": 1017.236023,
53 | "Gyro X (milli-dps)": 542.5,
54 | "Gyro Y (milli-dps)": -1120,
55 | "Gyro Z (milli-dps)": 262.5,
56 | "Temperature (C)": 26
57 | },
58 | "MMC5983": {
59 | "X Field (Gauss)": -0.200622559,
60 | "Y Field (Gauss)": 0.076416016,
61 | "Z Field (Gauss)": 0.447570801,
62 | "Temperature (C)": 29
63 | }
64 | }
65 | ```
66 |
67 |
68 |
69 | ## HTTP Connection Setup
70 |
71 | To connect to an HTTP server endpoint, the following information is needed:
72 |
73 | * The URL of the endpoint
74 | * The SSL certificate for the target server, if the connection is secure (HTTPS)
75 |
76 | These values are set using the standard DataLogger methods - the interactive menu system, or a JSON file.
77 |
78 |
79 |
80 | ### Menu System
81 |
82 | For users that are interested in using the menu system, you will need to open a Serial Terminal, connect to the COM port that your DataLogger enumerated to, and set it to **115200** baud. In this case, we connected to **COM13**. Press any key to enter the Main Menu. Type 1 to enter the Settings menu. Then type 14 to enter the HTTP IoT Menu. When the menu system for the HTTP IoT connection is presented, you will need to configure the property values as listed in the JSON file. Saving the values through the menu system will save the credentials to the ESP32's persistent memory. The following options are displayed:
83 |
84 |
85 |
86 |
87 |
88 | The options are:
89 |
90 | * Enable/Disable the connection
91 | * Set the URL for the endpoint
92 | * Set the name of the CA Cert file for a secure connection (HTTP)
93 |
94 | To set the HTTP URL/endpoint - select two (2) in the menu, and enter the URL. For this example, we'll enter: http://mysparkfunexample.com:8091 .
95 |
96 |
97 |
98 |
99 |
100 | In the above example, the URL/HTTP Endpoint is on a server called `mysparkfunexample.com`, on port `8091`. Once set, the system will post data to this URL.
101 |
102 | If the endpoint is a secure ssl (HTTPS) connection, the certificate for the server is required. Because of the size of the certificates, the value is provided as a file that is loaded into the system by the attached SD card.
103 |
104 |
105 |
106 |
107 |
108 | The above example show providing a certificate filename of `example.cer`.
109 |
110 | Once all these values are set, the system will post data to the specified HTTP endpoint, following the JSON information structure noted earlier in this document.
111 |
112 |
113 |
114 | ### JSON File Entries
115 |
116 | If a JSON file is being used as an option to import settings into the DataLogger IoT, the following entries are used for the HTTP IoT connection:
117 |
118 | ```json
119 | "HTTP IoT": {
120 | "Enabled": false,
121 | "URL": "",
122 | "CA Cert Filename": ""
123 | }
124 | ```
125 |
126 | Where:
127 |
128 | * `Enabled` - Set to `true` to enable the connection.
129 | * `URL` - Set to the URL for the connection.
130 | * `CA Cert Filename` - Set to the cert filename on the SD card if being used.
131 |
132 | If the JSON file is saved in the microSD card, you can load the credentials to the DataLogger IoT.
133 |
134 | !!! tip
135 | To load the values by the system at startup using a JSON file and microSD card, you will need to [configure the Save Settings](../configuration#general-save-settings). This JSON file will be created with the "**Save to Fallback**" option. Make sure to enable the HTTP IoT as well.
136 |
137 |
138 |
139 | ## Example - Connecting to a HTTP Server
140 |
141 | In this example, a simple HTTP Server is creating using Node JS, and the HTTP connection in the DataLogger IoT is used to post data to this server. The received data is output to the console from there server.
142 |
143 |
144 |
145 | ### The Server
146 |
147 | The following javascript/node code creates a HTTP server on port `8090`, and outputs received data to the console.
148 |
149 | ```javascript
150 | var http = require('http');
151 |
152 | // Setup the endpoint server
153 | var myServer = http.createServer(function (req, res) {
154 |
155 | // Initialize our body string
156 | var body="";
157 |
158 | // on data callback, append chunk to our body string
159 | req.on('data', function(chunk){
160 | body += chunk;
161 | });
162 |
163 | // On end callback, output the body to the console
164 | req.on('end', function(){
165 | // parse json string, then stringify it back for 'pretty printing'
166 | console.log("payload: " + JSON.stringify(JSON.parse(body),null,2));
167 | });
168 |
169 | // send a reply
170 | res.writeHead(200, {'Content-Type': 'text/plain'});
171 | res.end('n');
172 | // Just listen on our port
173 | }).listen(8090);
174 | ```
175 |
176 | The setup and use of node js is system dependant is beyond the scope of this document. However, Node JS is easily installed with your systems package manager (`brew` on macOS, Linux distribution package manager (apt, yum, ...etc), on Windows, the WSL is recommended).
177 |
178 | Once Node is setup, the above server is run via the following command (assuming the implementation is in a file called `simple_http.js`):
179 |
180 | ```sh
181 | node ./simple_http.js
182 | ```
183 |
184 | As data is sent by the DataLogger IoT, the following is output to the console from the server:
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 | ## Obtaining a Sites Security Certificate
194 |
195 | Accessing a sites SSL/Secure Certificate is done via a web browser. The method for each browser is different. The following example uses Edge, which is similar to the operation in Chrome.
196 |
197 |
198 | First, browse to the desired site/server. Click the Secure/Security area/button next to the URL to bring up the security detail page. On this page, select the *Connection is secure* menu option
199 |
200 |
201 |
202 |
203 |
204 | Next, on the page shown, select the certificate button on the upper right of the dialog.
205 |
206 |
207 |
208 |
209 |
210 | When you select this button, the certificate details dialog is displayed. On this page, select the *Details* tab, and select the *Export...* button on the lower right of the dialog. This will save the sites SSL/Security certificate to a location you specify.
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 | Once saved, place this file on the SD card your system/DataLogger is using, and set the filename in the HTTP connection menu or settings JSON file.
219 |
--------------------------------------------------------------------------------
/docs/example_iot_web_server.md:
--------------------------------------------------------------------------------
1 | As of firmware v01.02.00, log files can be viewed and downloaded over a WiFi network! This saves you time by allowing you to download the files without the need to disconnect the DataLogger IoT and manually remove microSD card.
2 |
3 | The following is covered by this document:
4 |
5 | * How a user configures and uses the HTTP connection
6 | * Use examples
7 |
8 | ### IoT Web Server Connection Setup
9 |
10 | To connect to the ESP32's IoT Web Server, the following information is needed:
11 |
12 | * The server name/address
13 | * _[optional]_ A username - if required
14 | * _[optional]_ A password - if required
15 |
16 |
17 |
18 | #### IoT Web Server Menu System
19 |
20 | We'll need to adjust the settings for the IoT Web Server.
21 |
22 | For users that are interested in using the menu system, open a Serial Terminal, connect to the COM port that your DataLogger enumerated to, and set it to **115200** baud. In this case, we connected to **COM13**. Press any key to enter the Main Menu. Type 1 to enter the Settings menu. Then type 17 to enter the IoT Web Server Menu. When the menu system for the IoT Web Server is presented, the following options are displayed:
23 |
24 |
25 |
26 |
27 |
28 | The options are:
29 |
30 | * Enable/Disable the connection
31 | * Username
32 | * Password
33 | * Enable/Disable mDNS support
34 | * mDNS name
35 |
36 | At a minimum, you will just need to enable the connection. However, we recommend enabling mDNS support if it is supported in your network.
37 |
38 | Once all these values are set, the system will serve the log files in your local 2.4GHz WiFi network following the JSON information structure noted below in this document.
39 |
40 |
41 |
42 | ### JSON File Entries
43 |
44 | If a JSON file is being used as an option to import settings into the DataLogger IoT, the following entries are used for the IoT web server:
45 |
46 | ```json
47 | "IoT Web Server": {
48 | "Enabled": false,
49 | "Username": "",
50 | "Password": "",
51 | "mDNS Support": false,
52 | "mDNS Name": "dataloggerAD6B8"
53 | },
54 | ```
55 |
56 | Where:
57 |
58 | * `Enabled` - Set to `true` to enable the connection.
59 | * `Username` - Web server user name if being used.
60 | * `Password` - Web server password if being used.
61 | * `mDNS Support` - Set to `true` if multicast DNS is supported. This allows you to enter the address as "`http://dataloggerXXXXX.local`" (where `XXXXX` is generated from the last 5x characters from your board ID) rather than typing the exact IP address of the ESP32.
62 | * `mDNS Name` - Multicast DNS name. In this case, the default name was set to `dataloggerAD6B8`. This name will be different depending on your DataLogger IoT's board ID so `AD6B8` will be different for your board.
63 |
64 |
65 |
66 | !!! tip
67 | To load the values by the system at startup using a JSON file and microSD card, you will need to [configure the Save Settings](../configuration#general-save-settings). This JSON file will be created with the "**Save to Fallback**" option. Make sure to enable the MQTT Client as well.
68 |
69 |
70 |
71 | ### Connect and Download Log File
72 |
73 | !!! note
74 | You will need to make sure that the ESP32 is on the same network as your computer in order to access the log files.
75 |
76 | !!! note
77 | When authentication is enabled, some browsers might require a second login depending on user settings.
78 |
79 | Once the web server is enabled and the settings are saved, you will need to reboot the DataLogger IoT. As the DatLogger initializes, it will connect to your WiFi Network. Take note of the mDNS address, in this case, it was "`http://dataloggerAD6B8.local`".
80 |
81 |
82 |
83 |
84 |
85 | Once the DataLogger IoT has finished initializing, open web browser. Connect the DataLogger IoT by entering the address "`http://dataloggerXXXXX.local`", where `XXXX` is the last 5x characters of your board ID. You will be presented with the log files available on the microSD card. Click on a log file to download and save it to your computer.
86 |
87 |
88 |
89 |
90 |
91 | !!! note
92 | If mDNS is not supported, you can also enter the IP address of the Datalogger IoT into a web browser to view and download the log files. You can view the IP address when the DataLogger IoT is initializing. If you have administrative privileges to the WiFi Network, you can also view the IP address through your WiFi router as well.
93 |
94 |
95 |
96 |
97 |
98 | Now that you have downloaded the log files, try graphing the data on a spreadsheet!
99 |
--------------------------------------------------------------------------------
/docs/example_mqtt.md:
--------------------------------------------------------------------------------
1 | ## Connecting and Publishing Data to MQTT
2 |
3 | One of the key features of the DataLogger IoT is it's simplified access to IoT service providers and servers. This document outlines how output from a DataLogger device is sent to an MQTT Broker.
4 |
5 |
10 |
11 | The following is covered by this document:
12 |
13 | * Overview of the MQTT connection
14 | * How a user configures and uses the MQTT connection
15 | * MQTT examples
16 |
17 |
18 |
19 | ## General Operation
20 |
21 | MQTT connectivity allows data generated by the DataLogger IoT to be published to an MQTT Broker under a user configured topic. MQTT is an extremely flexible and low overhead data protocol that is widely used in the IoT field.
22 |
23 | The general use pattern for MQTT is that data is *published* to a *topic* on a MQTT broker. The data is then sent to any MQTT client that has subscribed to the specified *topic*.
24 |
25 |
26 |
27 |
28 |
29 | The DataLogger IoT supports MQTT connections, allowing an end user to enter the parameters for the particular MQTT Broker for the application to publish data to. When the application outputs data to the broker, the DataLogger IoT publishes the available information to the specified "topic" with the payload that is a JSON document.
30 |
31 |
32 |
33 | ### Data Structure
34 |
35 | Data is published to the MQTT broker as a JSON object, which contains a collection of sub-objects. Each sub-object represents a data source in the sensor, and contains the current readings from that source.
36 |
37 | The following is an example of the data posted - note, this representation was "pretty printed" for readability.
38 |
39 | ```json
40 | {
41 | "MAX17048": {
42 | "Voltage (V)": 4.304999828,
43 | "State Of Charge (%)": 115.0625,
44 | "Change Rate (%/hr)": 0
45 | },
46 | "CCS811": {
47 | "CO2": 620,
48 | "VOC": 33
49 | },
50 | "BME280": {
51 | "Humidity": 25.03613281,
52 | "TemperatureF": 79.64599609,
53 | "TemperatureC": 26.46999931,
54 | "Pressure": 85280.23438,
55 | "AltitudeM": 1430.44104,
56 | "AltitudeF": 4693.04834
57 | },
58 | "ISM330": {
59 | "Accel X (milli-g)": -53.31399918,
60 | "Accel Y (milli-g)": -34.03800201,
61 | "Accel Z (milli-g)": 1017.236023,
62 | "Gyro X (milli-dps)": 542.5,
63 | "Gyro Y (milli-dps)": -1120,
64 | "Gyro Z (milli-dps)": 262.5,
65 | "Temperature (C)": 26
66 | },
67 | "MMC5983": {
68 | "X Field (Gauss)": -0.200622559,
69 | "Y Field (Gauss)": 0.076416016,
70 | "Z Field (Gauss)": 0.447570801,
71 | "Temperature (C)": 29
72 | }
73 | }
74 | ```
75 |
76 |
77 |
78 | ## MQTT Broker Connection Setup
79 |
80 | To connect to a MQTT Broker, the following information is needed:
81 |
82 | * The server name/address
83 | * The server port
84 | * The topic to post to
85 | * [*optional*] The name of the device/Client name publishing the data
86 | * [*optional*] A username - if required
87 | * [*optional*] A password - if required
88 |
89 | These values are set using the standard DataLogger methods - the interactive menu system, or a JSON file.
90 |
91 |
92 |
93 | ### MQTT Menu System
94 |
95 | We'll need to adjust the settings for the MQTT Client using the MQTT Menu System.
96 |
97 | For users that are interested in using the menu system, open a Serial Terminal, connect to the COM port that your DataLogger enumerated to, and set it to **115200** baud. In this case, we connected to **COM13**. Press any key to enter the Main Menu. Type 1 to enter the Settings menu. Then type 9 to enter the MQTT Client Menu. When the menu system for the MQTT connection is presented, the following options are displayed:
98 |
99 |
100 |
101 |
102 |
103 | The options are:
104 |
105 | * Enable/Disable the connection
106 | * Broker Port - The standard port for mqtt is 1883
107 | * Broker Server - This is just the name of the server
108 | * MQTT Topic - A string
109 | * Client Name
110 | * Username
111 | * Password
112 | * Buffer Size
113 |
114 | At a minimum, the Broker Port, Broker Server Name, and MQTT Topic need to be set. What parameters are required depends on the settings of the broker being used.
115 |
116 | !!! note
117 | If a secure connection is being used with the MQTT broker, use the `MQTT Secure Client` option of the DataLogger IoT. This option supports secure connectivity.
118 |
119 | !!! note
120 | The `Buffer Size` option is **dynamic** by default, adapting to the size of the payload being sent. If runtime memory is a concern, set this value to a static size that supports the device operation.
121 |
122 | Once all these values are set, the system will publish data to the specified MQTT Broker, following the JSON information structure noted earlier in this document.
123 |
124 |
125 |
126 | ### JSON File Entries
127 |
128 | If a JSON file is being used as an option to import settings into the DataLogger IoT, the following entries are used for the MQTT IoT connection:
129 |
130 | ```json
131 | "MQTT Client": {
132 | "Enabled": false,
133 | "Port": 1883,
134 | "Server": "my-mqttserver.com",
135 | "MQTT Topic": "/sparkfun/datalogger1",
136 | "Client Name": "mysensor system",
137 | "Buffer Size": 0,
138 | "Username": "",
139 | "Password": ""
140 | },
141 | ```
142 |
143 | Where:
144 |
145 | * `Enabled` - Set to `true` to enable the connection.
146 | * `Port` - Set to the broker port.
147 | * `Server` - The MQTT broker server.
148 | * `MQTT Topic` - The topic to publish to.
149 | * `Client Name` - Optional client name.
150 | * `Buffer Size` - Internal transfer buffer size.
151 | * `Username` - Broker user name if being used.
152 | * `Password` - Broker password if being used.
153 |
154 | !!! tip
155 | To load the values by the system at startup using a JSON file and microSD card, you will need to [configure the Save Settings](../configuration#general-save-settings). This JSON file will be created with the "**Save to Fallback**" option. Make sure to enable the MQTT Client as well.
156 |
157 |
158 |
159 | ## Testing the MQTT Connection
160 |
161 | Use of a MQTT connection is fairly straightforward - just requiring the entry of broker details into the connection settings.
162 |
163 | To test the connection, you need a MQTT broker available. A quick method to setup a broker is by installing the `mosquitto` package on a Raspberry Pi computer. Our basic [MQTT Tutorial](https://learn.sparkfun.com/tutorials/introduction-to-mqtt) provides some basic setup for a broker.
164 |
165 |
178 |
179 | [This MQTT Broker Tutorial](https://randomnerdtutorials.com/how-to-install-mosquitto-broker-on-raspberry-pi/) has more details, covering the setup needed for modern mosquitto configurations.
180 |
181 |
182 |
183 | And once the broker is setup, the messages published by the IoT sensor are visible using the `mosquitto_sub` command as outlined. For example, to view messages posted to a the topic "/sparkfun/datalogger1", the following command is used:
184 |
185 | ```sh
186 | mosquitto_sub -t "/sparkfun/datalogger1"
187 | ```
188 |
189 | This assumes the MQTT broker is running on the same machine, and using the default port number.
190 |
--------------------------------------------------------------------------------
/docs/example_timestamp.md:
--------------------------------------------------------------------------------
1 | Open a Serial Terminal, connect to the COM port that your DataLogger enumerated to, and set it to **115200** baud. In this case, we connected to **COM13**. Press any key to enter the Main Menu. Type 1 to enter the Settings menu. Then send a 6 to adjust how data is logged.
2 |
3 |
4 |
5 |
6 |
7 | Send a 1 to configure the timestamp for each log entry. The settings in this menu relate to the system clock and is dependent on the reference clock. You'll be prompted with different formats. In this example, we sent a a 4 to have a timestamp with the USA date format.
8 |
9 |
13 |
14 | Follow the prompts to exit out of the menu properly so that the DataLogger IoT saves the settings. Once you see the message `[I] Saving System Settings`, the DataLogger IoT will add a timestamp with your preferred format to each log entry. Assuming that you have the output set to the serial terminal, you should see the timestamp attached to the output after the system settings are saved like the image below.
15 |
16 |
20 |
--------------------------------------------------------------------------------
/docs/factory_reset.md:
--------------------------------------------------------------------------------
1 | A factory reset will move the boot firmware of the device to the firmware imaged installed at the ***factory*** and erase any on-board stored settings on the device. This is helpful if an update fails, or an update has issues that prevent proper operations.
2 |
3 | This option is available on ESP32 devices that contained a ***factory*** firmware partition that contains a bootable firmware image. Consult the specific product's production and build system for further details.
4 |
5 | Open a Serial Terminal, connect to the COM port that your DataLogger enumerated to, and set it to **115200** baud. In this case, we connected to **COM13**. Press any key to enter the Main Menu. Type 1 to enter the Settings menu. Then type 16 to enter the System Update Menu. Finally, type 2 to enter the Factory Reset option.
6 |
7 | The user is presented a prompt to continue. To launch a factory reset, the value of Y should be entered. To abort the update, enter n or press the Esc key.
8 |
9 |
13 |
14 | When a Y is entered, the system performs the following:
15 |
16 | * Set the boot image to the Factory installed firmware
17 | * Erase any settings stored in the on-board flash memory
18 | * Reboot the device
19 |
20 |
24 |
--------------------------------------------------------------------------------
/docs/file_issue.md:
--------------------------------------------------------------------------------
1 | # Did we make a mistake?
2 |
3 | Spot something wrong? Please let us know.
4 |
5 | !!! attention
6 | This is not where customers should seek assistance on a product. If you require technical assistance or have questions about a product that is not working as expected, please head over to the [SparkFun Technical Assistance](https://www.sparkfun.com/technical_assistance) page for some initial troubleshooting.
7 |
10 |
11 | If you can't find what you need there, you'll need a [Forum Account](https://forum.sparkfun.com/ucp.php?mode=register) to search product forums and post questions.
12 |
13 | ## Discrepancies in the Documentation
14 |
15 | All of this documentation can be modified by you! Please help us make it better.
16 |
17 | * The documentation files for these pages are contained in the [`docs` folder of the SparkFun DataLogger IoT repository](https://github.com/sparkfun/SparkFun_DataLogger/tree/main/docs).
18 |
19 | ### Spot something wrong?
20 | If a section of the documentation is incorrect, please [open an issue](https://github.com/sparkfun/SparkFun_DataLogger/issues) and let us know.
21 |
22 | ### Do you have a suggested correction?
23 | 1. With a GitHub account, fork this repo
24 | 2. Add your correction(s) or improvement(s) to the markdown file(s)
25 | 3. File a pull request with your changes, and enjoy making the ~~words~~ ~~worlds~~ world a better place.
26 | * Once received, the documentation specialist will automatically be notified.
27 | * We will review your suggested improvement(s) to make sure they are correct and fit within our documentation standards.
28 |
29 | ## Problems in the Hardware Design
30 |
31 | All of our designs are open-source! Please help us make it better.
32 |
33 | * Our board design files are contained in the [`Hardware` folder of the SparkFun DataLogger IoT repository](https://github.com/sparkfun/SparkFun_DataLogger/tree/main/Hardware).
34 |
35 | ### Does something not make sense?
36 | If part of the design is confusing, please [open an issue](https://github.com/sparkfun/SparkFun_DataLogger/issues) and let us know.
37 |
38 | ### Did we forget to include an important function of the board?
39 | * Please keep in mind that we may intentionally exclude certain functions of the board to meet our product design requirements. *(For example, our Qwiic Micro boards are intended to fit on a small board layout and only use I2C communication; therefore, we may not have the SPI and interrupt pins available for users.)*
40 | * If part of the board's functionality is missing, please [open an issue](https://github.com/sparkfun/SparkFun_DataLogger/issues) and file a feature request.
41 |
42 | ### Do you wish to contribute directly to improving the board design?
43 | 1. With a GitHub account, Fork this repo
44 | 2. Add your design improvement(s)
45 | 3. File a pull request with your changes, and enjoy making the ~~words~~ ~~worlds~~ world a better place.
46 | * Once received, the engineer in charge of the original design will automatically be notified.
47 | * We will review your suggested improvement(s), if they are within our board design standards and meet our product design requirements, we will flag these changes for our next board revision. *(Please note, that even if your suggestion is accepted, these changes may not be immediate. We may have to cycle through our current product inventory first.)*
48 |
--------------------------------------------------------------------------------
/docs/hard_copy.md:
--------------------------------------------------------------------------------
1 | ---
2 | icon: material/book-open-variant
3 | ---
4 |
5 | Need to download or print our hookup guide?
6 |
7 | * [Print :fontawesome-solid-print:](../single_page) (Single-Page View)
8 | * To save as a `*.pdf` file, select the **Printer** or **Destination** labeled ++"Save as PDF"++. *(Instructions will vary based on the browser)*
9 |
10 |
--------------------------------------------------------------------------------
/docs/img/Applications_DataLogger_Banner.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sparkfun/SparkFun_DataLogger/8481d920bea47b3b8bde80f18946b96d25fecb90/docs/img/Applications_DataLogger_Banner.jpg
--------------------------------------------------------------------------------
/docs/img/datalogger_banner - Old.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sparkfun/SparkFun_DataLogger/8481d920bea47b3b8bde80f18946b96d25fecb90/docs/img/datalogger_banner - Old.png
--------------------------------------------------------------------------------
/docs/index.md:
--------------------------------------------------------------------------------
1 | Placeholder file for index redirect functionality.
2 |
--------------------------------------------------------------------------------
/docs/javascript/README.md:
--------------------------------------------------------------------------------
1 | javascript directory
2 | ====================
3 | This folder should contain the files for the custom javascript that is enabled in the product documentation
--------------------------------------------------------------------------------
/docs/javascript/mathjax.js:
--------------------------------------------------------------------------------
1 | window.MathJax = {
2 | tex: {
3 | inlineMath: [["\\(", "\\)"]],
4 | displayMath: [["\\[", "\\]"]],
5 | processEscapes: true,
6 | processEnvironments: true,
7 | // No Equation Numbering
8 | tags: 'none'
9 | },
10 | options: {
11 | ignoreHtmlClass: ".*|",
12 | processHtmlClass: "arithmatex"
13 | }
14 | };
15 |
16 | document$.subscribe(() => {
17 | MathJax.typesetPromise()
18 | })
19 |
--------------------------------------------------------------------------------
/docs/prepare_your_microsd_card.md:
--------------------------------------------------------------------------------
1 | Not all microSD cards are created equal. The [capacity, read/write speed, and format](https://learn.sparkfun.com/tutorials/sd-cards-and-writing-images) vary depending on the manufacturer. In order to log data to the microSD card, you will need to ensure that your memory card is formatted as **FAT32**. You can also use FAT16. If the memory card is formatted as a different memory card, the DataLogger IoT will not be able to recognize the microSD card.
2 |
3 |
4 |
5 | ## Checking MicroSD Card Format
6 |
7 | While you can simply insert the microSD card into your DataLogger IoT and start logging, there may be a chance that the it will not recognize the memory card due to the format.
8 |
9 |
10 |
11 | ### Checking MicroSD Card Format - Windows
12 |
13 | To check to see if it is the correct format on a Windows you could head to the drive, right click, and select **Properties**.
14 |
15 |
19 |
20 | Once the properties are open, you should be able to tell what file system that the memory card uses. In this case, it was exFAT which is not compatible with the DataLogger IoT. You will need to reformat the memory card since it is not formatted as FAT32.
21 |
22 |
26 |
27 |
28 |
29 | ### Checking MicroSD Card Format - macOS
30 |
31 | To check to see if it is the correct format on a macOS, you could head to the drive on your desktop. Then right click, and select **Get Info**.
32 |
33 |
37 |
38 | A window will pop up indicating the microSD card properties. Under **General:** > **Format:**, you should be able to tell what file system that the memory card uses. In this case, it was exFAT which is not compatible with the DataLogger IoT. You will need to reformat the memory card since it is not formatted as FAT32.
39 |
40 |
44 |
45 |
46 |
47 | ## Download Raspberry Pi Imager
48 |
49 | There are a few methods and programs available to reformat your microSD card as a FAT32. We found it easier to use the [Raspberry Pi Imager Tool](https://www.raspberrypi.com/software/). Of course, you will only be using the tool to erase the contents of the microSD card and formatting it as a FAT32 system. You will not actually flash any image to the memory card. Click on the button below to download the tool from the Raspberry Pi Foundation. It is supported on *Windows*, *macOS*, and *Ubuntu for x86*.
50 |
51 |
52 |
53 |
54 |
55 | ## Formatting as FAT32 using the Raspberry Pi Imager
56 |
57 | After downloading and installing the software, open the Raspberry Pi Imager.
58 |
59 |
84 |
85 | Once the memory card has finished formatting, eject the microSD from your computer. To check to see if the microSD card is formatted as FAT32, you can check its properties as explained earlier with your operating system. Below shows a screenshot from a Windows and macOS showing that the microSD card reformatted as a FAT32 file system.
86 |
96 |
--------------------------------------------------------------------------------
/docs/relnotes/README.md:
--------------------------------------------------------------------------------
1 | # Latest DataLogger IoT Firmware Release Notes
2 |
3 | * Version 01.1.01 - [Overview of the Release](rn_v010101.md)
4 |
--------------------------------------------------------------------------------
/docs/relnotes/res/v010101_aiot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sparkfun/SparkFun_DataLogger/8481d920bea47b3b8bde80f18946b96d25fecb90/docs/relnotes/res/v010101_aiot.png
--------------------------------------------------------------------------------
/docs/relnotes/res/v010200_startup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sparkfun/SparkFun_DataLogger/8481d920bea47b3b8bde80f18946b96d25fecb90/docs/relnotes/res/v010200_startup.png
--------------------------------------------------------------------------------
/docs/relnotes/res/v010200_webI.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sparkfun/SparkFun_DataLogger/8481d920bea47b3b8bde80f18946b96d25fecb90/docs/relnotes/res/v010200_webI.png
--------------------------------------------------------------------------------
/docs/relnotes/rn_v010101.md:
--------------------------------------------------------------------------------
1 |
2 | ## SparkFun DataLogger Iot Firmware - Version 1.1
3 |
4 | _November 11th, 2023_
5 |
6 | Today we’re releasing the latest firmware update for our line of DataLogger IoT products. While we’ve released a services of small defect correct releases over the base 6 months, this release, officially version v1.01.00, is the first to include major new functionality.
7 |
8 | And with the release, we feel we’ve covered all aspects of a 1.1 release – new functionality, feature enhancements, and a wide variety of bug fixes.
9 |
10 | ### New Feature – Arduino IoT Cloud Connectivity
11 |
12 | Being an IoT focused product, one of our goals is to enable easy access to leading IoT data services. With this in mind, for this release we worked closely with the Arduino Team to enabled easy access to the Arduino IoT Cloud directly from a DataLogger IoT Device.
13 |
14 | Setup a device in the Arduino IoT Cloud, add the credentials to your DataLogger IoT and you have a IoT based dashboard up and running in minutes. Want to add an additional device to your dashboard – add the device to the DataLogger IoT and the combined system automatically adds the additional data to the Arduino Cloud – ready for use in your dashboard.
15 |
16 | 
17 |
18 | The above image shows data from a DataLogger IoT with an Environmental Combo attached to it and mapping data to a plot graphic on an Arduino IoT Cloud dashboard.
19 |
20 | And like all DataLogger IoT functionality, no programming is required to produces these plots – all settings are provided via the intuitive serial console menu interface or set via a settings JSON file.
21 |
22 | With the combination of the DataLogger IoT, qwiic and Arduino IoT Cloud, creating a IoT dashboard is as easy as *Plug-in, Connect, Plot!*
23 |
24 | ## New qwiic Sensor Board Support
25 |
26 | The original release of the DataLogger IoT firmware supported around 50 SparkFun qwiic development boards and with this release we’ve added six boards additional qwiic boards.
27 |
28 | Selecting from our recently added qwiic products as well as from the list of popular products, the release of version 1.1 adds support for the following qwiic development boards.
29 |
30 | * SparkFun Indoor Air Quality Sensor - ENS160
31 | * SparkFun Photoacoustic Spectroscopy CO2 Sensor - PASCO2V01
32 | * SparkFun Human Presence and Motion Sensor - STHS34PF80
33 | * SparkFun Tristimulus Color Sensor - OPT4048DTSR
34 | * SparkFun Triad Spectroscopy Sensor - AS7265x
35 | * SparkFun 6DoF IMU Breakout - BMI270
36 |
37 | Like previously supported qwiic boards, the DataLogger IoT firmware automatically detects when a device is connected, making the new device automatically available to the logging, menu and IoT systems of the DataLogger IoT.
38 |
39 | All these new sensors are great adds on their own, but the ENS160 has the additional feature of supporting temperature and humidity calibration inputs. Connect an BME280 or an SHTC3 qwiic board along with an ENS160, and the DataLogger automatically connects the two devices!
40 |
41 | ## Feature Improvements
42 |
43 | In addition to the new functionality, we also took input from our customers (and our own use) to expand and enhance existing features. While a wide variety of small additions were made, a few notable additions include:
44 |
45 | **Improved Reference Clock Management –** the internal logic was reviewed and improved. Additionally, time zone support was moved out of the NTP system, and into the overall clock management subsystem.
46 |
47 | **Internal JSON Buffer Limits –** The initial firmware had fixed sizes for the internal JSON data buffers used for saving settings and log data output. These values are now user settable in the settings menu. This allows for larger buffer support, as well as reducing the internal buffers to what you need.
48 |
49 | **Add Device IDs to the Device Names –** As you add more devices to a DataLogger, it’s difficult to match the device to the actual devices address. Addresses are now included in device listings and the option to include the address in the device name is now available.
50 |
51 | **Board Information in the Log Stream –** To improve identification of a data source within the data log stream, the Board Name and Board ID can now be added if desired. As part of this functionality, a configurable name is now available for each DataLogger IoT.
52 |
53 | ## Bug Fixes
54 |
55 | We also squashed a variety of defects in the firmware. Some of the more notable issued fixed in this release:
56 |
57 | * Incorporated a fix in the RV8803 RTC Clock Arduino Library that resolved force ti* shifts based on time zone. This was a “real nasty one” to resolve!
58 | * Improved runtime memory (ram) consumption
59 | * Resolved issues with devices having the same name. Now the second device adds it* address to the name.
60 | * Improvements to the Machinechat IoT driver
61 |
62 | ## In Summary
63 |
64 | With the release of DataLogger IoT firmware version 1.1.0 we continue to enhance the capabilities of our DataLogger IoT line – adding to our IOT service, supported devices as well as improving the overall quality of the system.
65 |
66 | And this new functionality is available today at the DataLogger [repo](https://github.com/sparkfun/SparkFun_DataLogger). The update is free, available as an over-the-air upgrade, or as a file uploaded via an SD Card. Just select the “System Update” option within the DataLogger IoT menu system and select your desired upgrade option.
67 |
--------------------------------------------------------------------------------
/docs/relnotes/rn_v010200.md:
--------------------------------------------------------------------------------
1 |
2 | ## SparkFun DataLogger IoT Firmware - Version 1.2
3 |
4 | April 15th, 2024_
5 |
6 | With the release of our version 1.2 software for our DataLogger IoT products, we continue to add additional functionally to the products capability, as well as fix a number of issues.
7 |
8 | And with the release, we feel we’ve covered all aspects of a 1.1 release – new functionality, feature enhancements, and a wide variety of bug fixes.
9 |
10 | ### New Features and Enhancements
11 |
12 | #### Log File Download via a Web Interface
13 |
14 | To allow access to log files located on the DataLogger IoT device, without requiring the removal of the SD card, a new Web Interface is provided. Once enabled, you can browse the on-board log files of the DataLogger. Clicking on a a filename will download the file.
15 |
16 | 
17 |
18 | Currently file browse and download options are available, but we plan on expanding this feature in the future.
19 |
20 | Additionally, this feature has the following options:
21 |
22 | * mDNS functionality allowing you to set a network name for a device if mDNS is supported on your network
23 | * Username/Password authentication for the web interface.
24 |
25 | >Note: For authentication use - currently some browsers might require a second login depending on settings.
26 |
27 | > Note:
28 | > The datalogger requires restarting if the web interface is enabled
29 |
30 | This feature is enabled in settings under the **Preview** heading.
31 |
32 | #### Startup Command Menu and Delay
33 |
34 | To allow start-up time configuration and delay, a _**Startup Menu**_ was added to the system. Now, at startup a short menu is presented for a brief period, allowing modification of the startup options of the DataLogger.
35 |
36 | Startup Menu options:
37 |
38 | Pressing the highlighted letter while the menu is active, will change the behavior of the system. This change only affects the current system session.
39 |
40 | The options include:
41 |
42 | * 'n' - Normal startup
43 | * 'a' - Disable I2C device auto load on startup
44 | * 'l' - List the I2C devices supported. This device table is discarded after auto-load
45 | * 'w' - Disable WiFi
46 | * 's' - Disable preference restore during startup
47 |
48 | In addition, the amount of time the menu is displayed is adjustable. This settings is on the _Settings/Application Settings_ page, under the _Advanced_ section.
49 |
50 | ### Quick (!) Commands
51 |
52 | The addition of a quick (_!_) command system that allows for the direct execution of commands directly from the serial console, bypassing the serial menu system.
53 |
54 | An example of this is the display of the "about" page for the system. Normally this would require navigating the serial menu system. With the _quick_ command system, entering the value of "!about" at the serial console will display the about page.
55 |
56 | The following commands are supported:
57 |
58 | | command | Description|
59 | |--------------|---------|
60 | | !about | Display the system about page
61 | | !clear-settings | Clear the on board system preferences with a yes/no prompt|
62 | | !clear-settings-forced | Clear the on board system preferences with no prompt |
63 | | !devices | List the currently connected devices |
64 | | !factory-reset | Perform a factory reset - presents a Y/N prompt|
65 | | !heap | Display the current system heap memory usage |
66 | | !help | List the available quick commands |
67 | | !json-settings | For setting the device settings via a serial connection. When this command is sent, the system expects to receive a JSON settings file |
68 | | !log-now |Perform a log observation event |
69 | | !log-rate | If log rate measurement is enabled, the current log rate is printed |
70 | | !reset-device | Reset the device - erasing any saved settings and restarting the device |
71 | | !reset-device-forced | Reset the device, but without a Y/N prompt |
72 | | !restart | Restart the device |
73 | | !restart-forced | Restart the device without a Y/N prompt |
74 | | !save-settings | Save the current settings to on-board flash |
75 | | !sdcard | Output the current SD card usage statistics |
76 | | !systime | Output current system time |
77 | | !uptime | The uptime of the device |
78 | | !device-id | The ID for the device |
79 | | !version | The version of the firmware |
80 | | !wifi | Output current system WiFi state |
81 |
82 | #### Log Data Rate
83 |
84 | The DataLogger system can now measure the data logging rate. Once this feature is enabled, the system will monitor the time between log events. This value is averaged over the latest 10 log events.
85 |
86 | #### System Info in the log stream
87 |
88 | The system operational parameters can now be added to log stream. This is useful to monitor system resource uses over time, or just perform general debugging.
89 |
90 | Currently the following information is provided:
91 |
92 | * WiFi SSID
93 | * WiFi RSSI
94 | * Memory Heap free space in bytes
95 | * SD Card free space in bytes
96 | * Uptime in MS
97 |
98 | ## Feature Improvements
99 |
100 | In addition to the new functionality, we also took input from our customers (and our own use) to expand and enhance existing features. While a wide variety of small additions were made, a few notable additions include:
101 |
102 | **Serial Console - Value Display –** The serial console now shows the current setting value in the menu system. Previously this value was only show once that item was selected.
103 |
104 | **Serial Console Color –** Text highlighting and color were added to the serial console output. If your serial console application/command supports it, the menu system highlights key values. This setting is controlled in the **Settings/Application Settings** section of the settings menu.
105 |
106 | **Startup Messages –** Normally a verbose log of startup options and settings are displayed at system startup. The about of information is now controllable - with values of _Normal_, _Compact_, _Disabled_.
107 |
108 | **Improved Device Auto-Load –** A major update to the I2C auto-load device detection logic that improves device detection and address collision prevention.
109 |
110 | **General System Enhancements –** Internal system job dispatch subsystem update to increase performance throughput. Overall decrease in static and dynamic memory usage.
111 |
112 | ## Bug Fixes
113 |
114 | We also squashed a variety of defects in the firmware. Some of the more notable issued fixed in this release:
115 |
116 | * Fixed issue with the LED display logic that caused a system crash if the log interval was less than 100ms
117 | * Incorporate driver updates for greater NAU7802 device output value stability
118 | * Incorporate driver update for the MMC5983MA device
119 |
120 | ## In Summary
121 |
122 | With the release of DataLogger IoT firmware version 1.2.0 we continue to enhance the capabilities of our DataLogger IoT line – adding to our IOT service, supported devices as well as improving the overall quality of the system.
123 |
124 | And this new functionality is available today at the DataLogger [repo](https://github.com/sparkfun/SparkFun_DataLogger). The update is free, available as an over-the-air upgrade, or as a file uploaded via an SD Card. Just select the “System Update” option within the DataLogger IoT menu system and select your desired upgrade option.
125 |
--------------------------------------------------------------------------------
/docs/resources.md:
--------------------------------------------------------------------------------
1 | Now that you've successfully got your DataLogger IoT up and running, it's time to incorporate it into your own project! For more information, check out the resources below:
2 |
3 | * DataLogger IoT - 9DoF
4 | * [Schematic (PDF)](../assets/board_files/DataLogger_IoT_9DoF/SparkFun_Datalogger_IoT_9DOF_Schematic_v11.pdf)
5 | * [Eagle Files (ZIP)](../assets/board_files/DataLogger_IoT_9DoF/SparkFun_DataLogger_IoT_9DOF_v11.zip)
6 | * [Board Dimensions (PNG)](../assets/board_files/DataLogger_IoT_9DoF/SparkFun_Datalogger_IoT_9DOF_Board_Dimensions.png)
7 | * [Fritzing Part (FZPZ)](https://github.com/sparkfun/Fritzing_Parts/blob/main/products/20594_sfe_datalogger_iot_9dof_esp32_fuel_gauge_imu_micro_sd_card_qwiic.fzpz)
8 | * DataLogger IoT
9 | * [Schematic (PDF)](../assets/board_files/DataLogger_IoT/SparkFun_DataLogger_IoT_Schematic_V11.pdf)
10 | * [Eagle Files (ZIP)](../assets/board_files/DataLogger_IoT/SparkFun_DataLogger_IoT-V11.zip)
11 | * [Board Dimensions (PNG)](../assets/board_files/DataLogger_IoT/SparkFun_DataLogger_IoT_Board_Dimensions.png)
12 | * [Fritzing Part (FZPZ)](https://github.com/sparkfun/Fritzing_Parts/blob/main/products/22462_sfe_datalogger_iot_esp32_fuel_gauge_micro_sd_card_qwiic.fzpz)
13 | * [CH340 Drivers](https://learn.sparkfun.com/tutorials/how-to-install-ch340-drivers/all)
14 | * [Firmware](https://github.com/sparkfun/SparkFun_DataLogger/releases)
15 | * GitHub Hardware Repo
16 | * [SparkFun DataLogger IoT - 9DoF](https://github.com/sparkfun/SparkFun_DataLogger_IoT_9DoF)
17 | * [SparkFun DataLogger IoT](https://github.com/sparkfun/SparkFun_DataLogger_IoT)
18 | * SFE Showcase
19 | * [DataLogger IoT - 9DoF](https://youtu.be/RwCu-60sQOI)
20 | * [DataLogger IoT](https://youtu.be/iGVVyN-xJf0?si=zM0wO_6Qbf9--GVS)
21 |
22 | Or check out these related blog posts.
23 |
24 |
4 |
5 | If you need technical assistance and more information on a product that is not working as you expected, we recommend heading on over to the SparkFun Technical Assistance page for some initial troubleshooting.
8 |
9 | If you don't find what you need there, the SparkFun Forums are a great place to find and ask for help. If this is your first visit, you'll need to create a Forum Account to search product forums and post questions.
12 |
13 |
14 |
15 | ### Issues Connecting to IoT Service
16 |
17 | Having trouble connecting your DataLogger IoT to an IoT service? Make sure to check your credentials and ensure that the configuration matches the IoT Service (such as your WiFi network, port, server, topic, certificates, keys, etc. to name a few). Make sure to also include the associated certificates and keys in the microSD card as well. You may see an output similar to the following errors below.
18 |
19 |
20 |
21 | #### AWS IoT Error
22 |
23 | The following error occurred when the DataLogger IoT was initializing with AWS.
24 |
25 | ``` bash
26 | [W] AWS IoT disconnected - reconnecting.......[E] AWS IoT: MQTT connection failed. Error Code: -2
27 | ```
28 |
29 |
33 |
34 | In this case, the DataLogger IoT failed to connect to AWS IoT service because the port was using the default value that was saved: `1883`. Ensure that the port is set to `8883` for your IoT service (e.g. AWS IoT, Azure, and ThingSpeak) and saved in persistent memory in order for the DataLogger IoT to successfully connect. As of firmware v01.00.04, the default is `8883`.
35 |
36 |
37 |
38 | #### ThinkSpeak IoT Error
39 |
40 | The following error occurred when the DataLogger IoT was initializing with ThingSpeak.
41 |
42 | ``` bash
43 | [I] ThingSpeak MQTT: connecting to MQTT endpoint mqtt3.thingspeak.com:8883 .......[E] ThingSpeak MQTT: Connection Error [4]
44 | ```
45 |
46 |
50 |
51 | In this case, the DataLogger IoT failed to connect to ThingSpeak service because the credentials were entered incorrectly. Ensure that the and saved in persistent memory in order for the DataLogger IoT to successfully connect.
52 |
53 |
54 |
55 | #### Arduino Cloud Error 1
56 |
57 | The following error was occurred when the DataLogger IoT was initializing with Arduino Cloud.
58 |
59 | ``` bash
60 | [W] ArduinoIoT - Thing Name not provided
61 | .
62 | .
63 | .
64 | [I] Arduino IoT: setup variables...[E] ArduinoIoT HTTP communication error [401] - token request
65 | [E] Arduino IoT Cloud not available or account credentials incorrect
66 | ```
67 |
68 |
72 |
73 | In this case, the DataLogger IoT failed to connect to the Arduino Cloud service because the credentials were incorrect. Ensure that the credentials (i.e. API client ID, API secret, device secret, device ID) are entered correctly and saved in persistent memory in order for the DataLogger IoT to successfully connect.
74 |
75 |
76 |
77 | #### Arduino Cloud Error 2
78 |
79 | The following error was occurred when the DataLogger IoT was initializing with Arduino Cloud.
80 |
81 | ``` bash
82 | [I] Arduino IoT: setup variables...[E] Arduino IoT: return code=400, failed to decode request body with content type "application/json": uuid: incorrect UUID length 37 in string "a111aaa1-1111-1111-1a1a-1a11111a1111\r"
83 | ```
84 |
85 | In this case, the DataLogger IoT failed to connect to the Arduino Cloud service because the credentials were incorrect. The string was supposed to be the device ID. When copying and pasting the device ID from a PDF that was generated with the Arduino Cloud, a carriage return (`\r`) was also copied and entered in the serial terminal. By pasting the device ID into a text editor and then re-copying/pasting it into the serial terminal helped to ensure that the credentials were entered correctly.
86 |
87 |
88 | !!! note
89 | The device ID in this example was a randomly generated string. You will need to check to make sure that your device matches the one that the Arduino Cloud generated specifically for your account.
90 |
91 |
92 |
93 | #### Arduino Cloud Error 3
94 |
95 | The following error was occurred when the DataLogger IoT was initializing with Arduino Cloud.
96 |
97 | ``` bash
98 | [I] Arduino IoT: setup variables...ArduinoIoTCloudTCP::handle_ConnectMqttBroker could not connect to mqtts-up.iot.arduino.cc:8884
99 | ArduinoIoTCloudTCP::handle_ConnectMqttBroker 1 connection attempt at tick time 301939
100 | ArduinoIoTCloudTCP::handle_ConnectMqttBroker could not connect to mqtts-up.iot.arduino.cc:8884
101 | ArduinoIoTCloudTCP::handle_ConnectMqttBroker 2 connection attempt at tick time 307420
102 | [E] Arduino IoT: No Arduino Thing ID provided. Enter ID, delete Thing (SparkFunThing1) on Cloud, or enter new Thing Name.
103 | ```
104 |
105 | In this case, the DataLogger IoT failed to connect to the Arduino Cloud service because there was already a Thing that was created. By deleting the Thing in the Arduino Cloud, the DataLogger IoT was able to automatically create another Thing and setup the variables.
106 |
107 |
108 |
109 | ### ThingSpeak Data Points Not Updating
110 |
111 | If your DataLogger IoT is connected to ThingSpeak but you do not see any data, ensure that the device name matches the Qwiic device that is connect to the DataLogger IoT. For example, the DataLogger IoT and Qwiic-enabled ENS160 was able to connect to ThingSpeak as shown in the image on the bottom left. However, there were no data points in any of the graphs as shown on ThingSpeak as shown in the image on the bottom right.
112 |
113 |
114 |
116 |
117 |
118 |
119 |
120 |
121 |
122 | If you head back into the configuration menu for the DataLogger's ThingSpeak channel, make sure that the __ matches the connected Qwiic device's name that was shown during initialization. In this case, the device that was loaded and detected was **ENS160**. Then add the channel ID before saving the system settings.
123 |
124 |
128 |
129 | !!! note
130 | Only one device can be loaded per channel! ThingSpeak is not able graph two different devices in the same channel.
131 |
132 | Head back to your ThingSpeak Channel to verify that data is being plotted on the graphs.
133 |
134 |
138 |
139 |
140 |
141 | ### U-Blox I2C Device Disappears when IoT DataLogger Initializes
142 |
143 | If you have issues where a u-blox device that is connected to the I2C port fails to connect a second time when the IoT DataLogger initializes, this is due to a bug in the firmware from an initial release. You may see an output similar to the following message and image shown below.
144 |
145 | ``` bash
146 | [W] GNSS::isConnected no traffic seen (first attempt)
147 | ```
148 |
149 |
153 |
154 | If you see the following output and the IoT DataLogger not loading your u-blox device, you will need to [update the firmware to v01.00.03 and above](https://github.com/sparkfun/SparkFun_DataLogger/releases). For more information, make sure to check out the [tutorial on updating your IoT DataLogger's firmware](https://docs.sparkfun.com/SparkFun_DataLogger/updating_firmware/).
155 |
--------------------------------------------------------------------------------
/docs/updating_firmware.md:
--------------------------------------------------------------------------------
1 | !!! danger
2 |
3 | Please think very carefully before uploading any Arduino sketches to your DataLogger IoT.
4 |
5 | **You will overwrite the DataLogger IoT firmware, leaving it unable to update or restore itself.**
6 |
7 | Each DataLogger IoT comes pre-programmed with amazing firmware which can do _so_ much. It is designed to be able to update itself and restore itself if necessary. But it can not do that if you overwrite the firmware with any Arduino sketch. It is just like erasing the restore partition on your computer hard drive. Do not do it - unless you _really_ know what you are doing.
8 |
9 | Really. We mean it.
10 |
11 |
12 |
13 | ## Firmware Update - SD Card
14 |
15 | This action enables the ability to update the onboard firmware to an image file contained an SD card. This user is presented a list of available firmware images files contained in root directory of the on-board SD card, and updates the board to the selected file.
16 |
17 | This option is available on ESP32 devices that contained two update firmware (OTA type) partitions within the on-board device flash memory. Consult the specific products production and build system for further details.
18 |
19 | To download the latest firmware and update through the microSD card, you will need to head to the [GitHub repository containing the firmware](https://github.com/sparkfun/SparkFun_DataLogger/releases). Select the firmware version and download.
20 |
21 |
22 |
23 | Once downloaded, insert the microSD card into a card reader or USB adapter. Then move the files into the memory card's root directory. Below shows an image of v01.00.01 and v01.00.02 on a Windows OS.
24 |
25 |
29 |
30 | Once the files are copied to the memory card, eject the microSD card from your computer. Insert the card back into the DataLogger IoT's microSD card socket. Connect the DataLogger IoT to your computer using a USB cable.
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 | !!! note
42 | What's going on here?!? This tutorial was updated for firmware version **01.01.00**!!! You will notice this menu option has changed to 17 !!!
43 |
44 | Open a Serial Terminal, connect to the COM port that your DataLogger enumerated to, and set it to **115200** baud. In this case, we connected to **COM13**. Press any key to enter the Main Menu. Type 1 to enter the Settings menu. Then type 17 to enter the System Update Menu. Finally, type 3 to update the firmware from the microSD card. You should see an image similar to the output below.
45 |
46 |
50 |
51 | The system will search the root directory of the on-board SD card for available firmware files. The firmware files are selected using the following criteria:
52 |
53 | * The file is contained in the root "**/**" folder of the SD card.
54 | * The filename has a "**.bin**" extension.
55 | * The filename starts with a specified name ***prefix***. The prefix is optional and is set by the developers at SparkFun using this action.
56 | * For example, the DataLogger IoT boards use a prefix value of "**SparkFun_DataLoggerIoT_**".
57 |
58 | Once a file is selected, the system new firmware is read off the SD card and written to the device.
59 |
60 |
71 |
72 |
73 |
74 | ## Firmware Update - Over-the-Air (OTA)
75 |
76 | This action enables the ability to update the onboard firmware to an image file contained on an update server, which is accessed via the WiFi network the system is connected to. This Over-The-Air (OTA) capability contacts the systems update server and searches for newer firmware (later version) for the specific board.
77 |
78 | This option is available on ESP32 devices that contained two update firmware (OTA type) partitions within the on-board device flash memory. Consult the specific products production and build system for further details.
79 |
80 |
81 | If you have not already, connect the DataLogger IoT to your computer using a USB cable.
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 | Open a Serial Terminal, connect to the COM port that your DataLogger enumerated to, and set it to **115200** baud. In this case, we connected to **COM13**. Press any key to enter the Main Menu. Type 1 to enter the Settings menu. Then type 16 to enter the System Update Menu. Finally, type 4 to update the firmware over-the-air.
93 |
94 |
95 |
96 |
97 | When this option is selected, the system will contact the update server and search for available upgrade firmware, selecting the latest version available. If a newer version is found, a prompt is presented to confirm the upgrade.
98 |
99 |
103 |
104 | !!! note
105 |
106 | For the upgrade option to occur, a the system must be connected to a network and have access to the firmware OTA server.
107 |
108 | Typing Y (or hitting enter) starts the update operation. As the firmware is downloaded, the percent complete status is updated. If connectivity fails during the download, the operation is halted and the update aborted.
109 |
110 |
114 |
115 |
116 | Once the update file is downloaded, it is verified as being the correct file. Once verified, the system is rebooted and starts using the new firmware image! You will notice the firmware version change as the DataLogger IoT initializes.
117 |
118 |
122 |
--------------------------------------------------------------------------------
/docs/wifi_network.md:
--------------------------------------------------------------------------------
1 | !!! note
2 | The ESP32-WROOM can only connect to a 2.4GHz WiFi network. Unfortunately, 5GHz is not supported on the ESP32-WROOM module.
3 |
4 | To take advantage of syncing the DataLogger to the Network Time Protocol (NTP), logging data to an IoT service, or updating firmware OTA, you will need to connect to a 2.4GHz WiFi network.
5 |
6 | Open a Serial Terminal, connect to the COM port that your DataLogger enumerated to, and set it to **115200** baud. In this case, we connected to **COM13**. Press any key to enter the Main Menu. Type 1 to enter the Settings menu. Then send a 4 to configure the WiFi settings.
7 |
8 |
9 |
10 |
11 |
12 | Send a 2 to set the WiFi Network Name. You'll be prompted to set the network name. In this case, the network name is `sparkfun`. Once you enter the name, hit the enter key.
13 |
14 |
18 |
19 | Send a 2 to set the WiFi password. You'll be prompted to set the password. As you send the password, each character will be masked by a asterisk (i.e. *) Once you enter the name, hit the enter key.
20 |
21 |
25 |
26 | Follow the prompts to exit out of the menu properly so that the DataLogger IoT saves the settings.
27 |
28 |
29 |
30 |
31 |
32 | Once you see the message `[I] Saving System Settings` and data on the output, hit the reset button on the board. You can also use the menu to perform a device restart, however you will need to ensure that you receive the message indicating that the settings were saved before restarting the device.
33 |
34 | Once the device has restarted, the DataLogger will provide an output as it is initializing. If the WiFi credentials are saved properly, you will receive a message indicating that your chosen network is connected to your WiFi network. If the time source is set to the default NTP client, you will also notice that the time will be synced to the latest date and time!
35 |
36 |