Configuring the settings is as easy as opening a serial menu. You can use any serial monitor or terminal emulator to quickly and easily change and store the DataLogger IoT settings via its USB-C interface.
+
There are plenty of free alternatives out there to configure the DataLogger IoT. For the scope of this tutorial we will be using Tera Term.
You will need a serial terminal client that supports edit characters. Most if not all modern serial terminal programs will have the ability to support interactive edits. Unfortunately, we have not had any success with CoolTerm. We have tested the DataLogger IoT with Tera Term, Minicom, and Screen.
+
+
If this is the your first time using a terminal window, We recommend checking out the tutorial below for more information on serial terminal basics.
The above guides will show you how to open the correct port for the DataLogger IoT and how to set the baud rate to 115200 baud. You can change the DataLogger IoT's baud rate through the configuration menus too should you need to.
+
+
Note
+
For users with an Arduino IDE, you could also use the Arduino Serial Monitor by setting the line ending to Newline. Users will also need to CTRL + Enter when sending any character to the DataLogger IoT. However, we recommend using one of the terminals mentioned earlier.
+
+
Initialization and Serial Output
+
Connect the DataLogger IoT to a USB cable and connect to your computer. The addressable RGB LED will light up green as it initializes. As of firmware v1.0.2.00 - build 00013e, a Startup Menu was added to the system. This allows you to change the behavior of the DataLogger at start-up. This change only affects the current system session.
+
+
+
+
+
+
'n' — Normal startup
+
'a' — Disable I2C device auto load on startup
+
'l' — List the I2C devices supported. This device table is discarded after auto-load
+
'w' — Disable WiFi
+
's' — Disable preference restore during startup
+
+
+
Note
+
The amount of time the start-up menu is displayed is adjustable. This settings can be configured in the Settings/Application Settings page, under the Advanced section.
+
+
You should see the following output when the board initializes:
+
+
+
+
+
The messages in the serial terminal provide us with the DataLogger's configuration and will vary depending on the firmware version that is loaded on the board.
+
+
The DataLogger IoT software version (in this case is v01.02.00 - build 00013e).
+
As the DataLogger IoT is initializing, the system settings are being restored from the last saved preference.
+
There no WiFi credentials and the board has failed to connect. This output will change once you provide the WiFi credentials and are able to connect to the network.
+
There are 3x devices currently detected and they are connected through I2C through the Qwiic port and SPI. These are the on-board sensors for the DataLogger IoT. There may be more devices that are detected depending on the firmware and what is connected to the ports. Since these were recognized, they were loaded onto the DataLogger IoT.
+
The current date and time is shown (by default), the date and time is set to 1-1-1970 and 00:00:00). This value will change depending on the clock source through NTP, RTC, or a u-blox GNSS module.
+
The time the board has been running will be shown in the uptime.
+
The primary external time source that the board syncs is currently through the NTP client. This can be configured depending on your clock source.
+
The board name (in this case, it was SparkFun DataLogger IoT - 9DoF)
+
The board ID (in this case, it was SFD16C8F0D1AD6B8)
+
The microSD card has been found, the type of memory card it is, the size of the memory card, how much memory is used, and how much is available.
+
If there is a WiFi network name saved, the SSID will be shown along with information indicating whether the board was able to connect to the WiFi network. By default there is no SSID saved in memory.
+
If there is a battery connected, the LiPo Battery Fuel Guage will indicate if there is one attached to the board.
+
Parameters for low power mode will be provided indicating if deep sleep is enabled, sleep interval, and wake interval.
+
Parameters for logging are also provided for the logging interval, the format for the serial output, format for the microSD card, current saved filename, and file rotation period.
+
The board will also show the available IoT services that are enabled for the DataLogger IoT.
+
Current settings to download log files via a web interface (included in firmware v01.02.00)
+
Supported devices through Qwiic or SPI will be listed if they are connected.
+
The output will finish by telling you what devices are connected to the DataLogger IoT again.
+
+
+
Note
+
As of firmware v01.02.00, there is also a compact mode! By adjusting the setting, the ESP32 will output less at startup. This settings can be configured in the Settings/Application Settings page, under the Advanced section.
+
+
+
+
+
Once the DataLogger IoT has initialized, the DataLogger IoT will begin outputting comma separated values (CSV). This is the default output that is set for the DataLogger IoT - 9DoF. Of course, you will not have as many readings on the DataLogger IoT since the 6DoF IMU and magnetometer are not populated on that version of the board.
+
+
+
+
+
+
Note
+
Depending on your DataLogger IoT preferences, your device may output as a JSON format like the image shown below.
+
+
+
+
+
The data scrolling up the screen show what each device's output is along with their associated unit if it is available. Your mileage will vary depending on the board version that you have and what device is connected:
+
+
MAX17048.Voltage (V)
+
MAX17048.State of Charge (%)
+
MAX17048.Charge Rate (%/hr)
+
ISM330.Accel X (milli-g)
+
ISM330.Accel Y (milli-g)
+
ISM330.Accel Z (milli-g)
+
ISM330.Gyro X (milli-dps)
+
ISM330.Gyro Y (milli-dps)
+
ISM330.Gyro Z (milli-dps)
+
ISM330.Temperature (C)
+
MMC5983.X Field (Gauss)
+
MMC5983.Y Field (Gauss)
+
MMC5983.Z Field (Gauss)
+
MMC5983.Temperature (C)
+
+
The output will vary depending on what is connected so you may get additional readings in the output and it may not be in the following order listed above. The logging rate defaults to about 0.067Hz (or 15000ms), so as the data scrolls past, you will see the last value settle at about 0.067Hz.
+
Main Menu
+
Right! Let's open the main menu by pressing on any key in the serial terminal program.
+
+
+
+
+
You will be prompted with a few options. Once in the configuration menu, all three colors of the addressable RGB LED will turn on to produce the color white indicating that you are navigating through the menu. Before we dive into the settings, lets check out a few commands and saving settings.
+
Quick (!) Command Reference
+
As of firmware v01.02.00, commands can be executed directly from the serial console thus bypassing the serial menu system! The following commands are supported.
+
+
+
+
Quick Command
+
+
Command Description
+
+
+
+
+ !about
+
+
+
+ Display the system about page
+
+
+
+
+ !clear-settings
+
+
+
+ Clear the on board system preferences with a yes/no prompt
+
+
+
+
+ !clear-settings-forced
+
+
+
+ Clear the on board system preferences with no prompt
+
+
+
+
+ !devices
+
+
+
+ List the currently connected devices
+
+
+
+
+ !factory-reset
+
+
+
+ Perform a factory reset - presents a Y/N prompt
+
+
+
+
+ !heap
+
+
+
+ Display the current system heap memory usage
+
+
+
+
+ !help
+
+
+
+ List the available quick commands
+
+
+
+
+ !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
+
+
+
+
+ !log-now
+
+
+
+ Perform a log observation event
+
+
+
+
+ !log-rate
+
+
+
+ If log rate measurement is enabled, the current log rate is printed
+
+
+
+
+ !reset-device
+
+
+
+ Reset the device - erasing any saved settings and restarting the device
+
+
+
+
+ !reset-device-forced
+
+
+
+ Reset the device, but without a Y/N prompt
+
+
+
+
+ !restart
+
+
+
+ Restart the device
+
+
+
+ !restart-forced
+
+
+
+ Restart the device without a Y/N prompt
+
+
+
+
+ !save-settings
+
+
+
+ Save the current settings to on-board flash
+
+
+
+
+ !sdcard
+
+
+
+ Output the current SD card usage statistics
+
+
+
+
+ !systime
+
+
+
+ Output current system time
+
+
+
+
+ !uptime
+
+
+
+ The uptime of the device
+
+
+
+
+ !device-id
+
+
+
+ The ID for the device
+
+
+
+
+ !version
+
+
+
+ The version of the firmware
+
+
+
+
+ !wifi
+
+
+
+ Output current system WiFi state
+
+
+
+
+
+
Typing a quick command and hitting the Enter button will result in the DataLogger IoT executing the command without the need to go through the menu system. Below is an example showing the !about quick command being sent and then executing the command as the DataLogger IoT is outputting CSV values to the serial terminal.
+
+
+
+
+
Exiting and Saving
+
When exiting the menus, you will be prompted with either an x or b. You can use either character when exiting the menus as well as X or B. Note that you will need to use either of these keys when making a change in order for the DataLogger IoT to save any changes in memory. Make sure that you receive the following message indicating that the settings were saved: [I] Saving System Settings. The DataLogger IoT will the continue reading the devices and outputting the readings through the serial terminal.
+
+
+
+
+
Cancelling Changes
+
You can also use any of your Esc or arrow keys (i.e. ↑, ↓, ←, →) to exit. However, using the escape or arrow keys will not save any changes in memory once the reset button is hit or whenever power is cycled.
+
+
+
+
+
Timeout from Inactivity
+
The menus will slowly exit out after 2 minutes of inactivity, so if you do not press a key the DataLogger IoT will return to its previous menu. It will continue to move back until it reaches the main menu. After another additional 2 minutes of inactivity, the board will exit begin logging data again. When the menu exits from inactivity, any changes will not be saved in memory as well.
+
+
+
+
+
Settings
+
Let's start by configuring the DataLogger's system settings. Send a 1 through the serial terminal. You will have the option to adjust various settings ranging from the your preferences, time source to synchronize the date and time, WiFi network, how the device logs data, which IoT service to use, and firmware updates.
+
+
+
+
+
+
Note
+
You may notice after entering a 1 that there is a slight delay before the DataLogger IoT responds. The delay was added to allow some time for the DataLogger IoT to receive an additional digit for any option greater than 9. If you want to head to option 1 immediately without the slight delay, you can hit the Enter key to enter the Application Settings.
+
+
We'll go over each of these options below.
+
General: Application Settings
+
In the Settings Menu, send a 1 to adjust the Application Settings. As of firmware v01.00.02, users can now adjust the baud rate of the serial console output and the menu system's timeout value.
+
+
+
+
+
In the Application Settings Menu, users will be able to configure the addressable RGB's LED through software, menu timeout, microSD card's output format, serial console's output format, terminal's baud rate, deep sleep parameters, and view the current settings of the DataLogger IoT similar to when the board was initialized. Depending on your preference and how you are logging data, you can adjust the data as CSV or JSON.
+
+
1LED Enabled — Enable/Disable the on-board RGB LED activity
+
Accepts a boolean value:
+
1 to enable (default)
+
0 to disable
+
+
+
+
+
2Menu Timeout — Inactivity timeout period for the menu system
+
Accepts the following values:
+
1 30 Seconds = 30
+
2 60 Seconds = 60 (default)
+
3 2 Minutes = 120
+
4 5 Minutes = 300
+
5 10 Minutes = 600
+
b Back
+
+
+
+
+
3Color Output — Use color output with the Serial console. (added as of firmware v01.02.00)
+
Accepts a boolean value:
+
1 to enable (default)
+
0 to disable
+
+
+
+
+
4Board Name — A specific name for this DataLogger
+
Accepts a string
+
+
+
5SD Card Format — Enable and set the output format
+
Accepts the following values:
+
1 to disable = 0
+
2 CSV format (default) = 1
+
3 JSON format = 2
+
+
+
+
+
6Serial Console Format — Enable and set the output format
+
Accepts the following values:
+
1 to disable = 0
+
2 CSV format (default) = 1
+
3 JSON format = 2
+
+
+
+
+
7JSON Buffer Size — Output buffer size in bytes
+
Accepts an integer between 100 to 5000 :
+
1600 bytes (default)
+
+
+
+
+
8Terminal Baud Rate — Update terminal baud rate. Changes take effect on restart.
+
Accepts an unsigned integer between 1200 to 50000:
+
115200(default)
+
+
+
+
+
9Enable System Sleep — If enabled, sleep the system
+
Accepts a boolean value:
+
1 to enable
+
0 to disable (default)
+
+
+
+
+
10Sleep Interval (sec) — The interval the system will sleep for
+
Accepts an integer between 5 to 86400 :
+
30 seconds (default)
+
+
+
+
+
11Wake Interval (sec) — The interval the system will operate between sleep period
+
Accepts an unsigned integer between 60 to 86400 :
+
120 seconds (default)
+
+
+
+
+
12Startup Messages Level of message output at startup
+
Accepts a value between 1 to 3 :
+
1 Normal = 0 (default)
+
2 Compact = 1
+
3 Disabled = 2
+
+
+
13Startup Delay Startup Menu Delay in Seconds
+
Accepts a value between 0 to 60 :
+
2 seconds (default)
+
+
+
+
+
14Device Names Name always includes the device address
+
Accepts a boolean value:
+
1 to enable (default)
+
0 to disable
+
+
+
+
+
15About... — Details about the system
+
bBack
+
+
+
Note
+
Once the baud rate is changed and saved, make sure to adjust the baud rate of your serial terminal when the board is reset. If you forgot the baud rate, you can hold the BOOT button down for 20 seconds to erase the on-board preferences (besides the baud rate, this also includes any other settings that were saved) and restart the board.
+
+
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
+
+
+
+
+
General: Save Settings
+
In the Settings menu, send a 2 to adjust the Save Settings. As of firmware v01.01.01, the JSON output buffer size is now user configurable. This will be under option "JSON File Buffer Size" when in the Save Settings Menu.
+
+
+
+
+
In the Save Settings Menu, users will be able to save, restore, or clear any preferences in memory (i.e. persistent storage) or a saved file to a fallback device (i.e. microSD card). Note that any passwords and secret keys are not saved in the save settings file. You will need to manually enter those values in the file saved on the microSD card.
+
+
1Fallback Restore — If unable to restore settings, use the fallback source (JSON File)
+
Accepts a boolean value:
+
1 to enable (default)
+
0 to disable
+
+
+
+
+
2Fallback Save — Save settings also saves on the fallback storage (JSON File)
+
Accepts a boolean value:
+
1 to enable
+
0 to disable (default)
+
+
+
+
+
3JSON File Buffer Size — The size in bytes used for the internal I/O buffer
+
Accepts an unsigned integer:
+
6400(default, as of firmware v01.01.01)
+
+
+
4Save Settings — Save current settings to persistent storage
+
Accepts a yes/no:
+
Y or y for yes
+
N or n for no
+
+
+
+
+
5Restore Settings — Restore saved settings
+
Accepts a yes/no:
+
Y or y for yes
+
N or n for no
+
+
+
+
+
6Clear Settings — Erase the saved settings on the device
+
Accepts a yes/no:
+
Y or y for yes
+
N or n for no
+
+
+
+
+
7Save to Fallback — Save System Settings to the fallback storage (JSON File)
+
Accepts a yes/no:
+
Y or y for yes
+
N or n for no
+
+
+
+
+
8Restore from Fallback — Restore system settings from the fallback storage (JSON File)
+
Accepts a yes/no:
+
Y or y for yes
+
N or n for no
+
+
+
+
+
bBack
+
+
If you have the Fallback Save enabled or selected the option Save to Fallback, you will notice an additional file called datalogger.json saved in the microSD card. This is the fallback file that is saved. Using a text editor, you can edit this file to adjust the settings or provide WiFi credentials, certificates, and keys. You can use option 7 to restore the settings on your DataLogger IoT.
+
+
+
+
+
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
+
+
+
+
+
General: Time Sources
+
+
Note
+
Make sure to connect the ESP32-WROOM to a 2.4GHz WiFi network and ensure that is not a guest network that requires you to sign in. Unfortunately, 5GHz WiFi is not supported on the ESP32-WROOM module.
+
+
In the Settings Menu, send 3 to manage the time reference sources. As of firmware v01.01.01, time zone support is at the clock level, not tied to NTP. The option to adjust the Time Zone is moved to the Time Sources menu.
+
+
+
+
+
In this menu, you will have options to update the primary reference clock, update interval, add a secondary reference clock, and update it's interval. By default, the primary reference clock is set to use the Network Time Protocol (NTP). To synchronization the time, you will need to connect to a 2.4GHz WiFi network in order to update the time. To add a secondary clock, make sure to connect a compatible Qwiic-enabled devices that can keep track of time (i.e. Qwiic Real Time Clock Module - RV-8803 or a Qwiic-enabled u-blox GNSS module).
1The Time Zone — Time zone setting string for the device
+
Accepts a string:
+
MST7MDT,M3.2.0,M11.1.0(default, as of firmware v01.01.01)
+
+
+
+
+
2Reference Clock — The current reference clock source
+
Accepts the following values:
+
1 for no clock
+
2 for NTP Client (default)
+
+
+
+
+
3Update Interval — Main clock update interval in minutes. 0 = No update
+
Accepts an unsigned integer:
+
0 = No update
+
60 seconds (default)
+
+
+
+
+
4Enable Clock Fallback — Use a valid reference clock if the primary is not available
+
Accepts a boolean value:
+
1 to enable (default)
+
0 to disable
+
+
+
+
+
5Dependant Interval — Connected depedant clock update interval in minutes. 0 = No update
+
Accepts an unsigned integer:
+
0 = No update
+
60 seconds (default)
+
+
+
+
+
6Update Connected — Update connected clocks on main clock update
+
Accepts a boolean value:
+
1 to enable (default)
+
0 to disable
+
+
+
+
+
bBack
+
+
+
Note
+
As an alternative to using the NTP, users can also add a compatible Qwiic-enabled device that can keep track of time (i.e. Qwiic Real Time Clock Module - RV-8803 or a Qwiic-enabled u-blox GNSS module). These can be set as the primary or secondary clock.
+
+
+
+
+
+
+
+
+
Once attached, you will be prompted with additional options to select a primary reference clock.
+
+
+
+
If you are using a u-blox GNSS module, make sure that you have enough satellites in view. The option to add or configure the GNSS will not be available if there are not enough satellites in view. If you are using the Qwiic Real Time Clock Module - RV-8803, you may need to go into the device settings to manually adjust the date and time.
+
+
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
+
+
+
+
+
Network: WiFi Network
+
+
Note
+
The ESP32-WROOM can only connect to a 2.4GHz WiFi network. Unfortunately, 5GHz is not supported on the ESP32-WROOM module.
+
+
In the Settings Menu, send a 4 to configure the WiFi settings. As of firmware v01.00.02, up to 4 sets of WiFi credentials can be saved.
+
+
+
+
+
Once you are in the WiFi Network menu, you can enable/disable WiFi and save the WiFi network credentials. Once connected to a 2.4GHz WiFi network, you can synchronize the date and time, connect to an IoT service to log data, and update the latest firmware over-the-air. Since the WiFi is turned on by default, you will simply need to save the WiFi network's name and password.
+
+
1Enabled — Enable or Disable the WiFi Network connection
+
Accepts a boolean value:
+
1 to enable (default)
+
0 to disable
+
+
+
+
+
2Network Name — The SSID of the WiFi network
+
Accepts a string:
+
For example, if my network name is "MY_NETWORK_NAME", you would manually type MY_NETWORK_NAME. When finished hit the ENTER key
+
+
+
+
+
3Password — The Password to connect to the WiFi network
+
Accepts a string:
+
For example, if my network name is "MY_SUPER_SECRET_PASSWORD", you would manually type MY_SUPER_SECRET_PASSWORD. Note that as you type the password, each character will be replaced with an asterisk (*). When finished hit the ENTER key.
+
+
+
+
+
4Network 2 Name — Alternative network 2 SSID
+
Accepts a string:
+
For example, if my network name is "MY_NETWORK_NAME_2", you would manually type MY_NETWORK_NAME_2. When finished hit the ENTER key
+
+
+
+
+
5Network 2 Password — Alternative network 2 Password
+
Accepts a string:
+
For example, if my network name is "MY_SUPER_SECRET_PASSWORD_2", you would manually type MY_SUPER_SECRET_PASSWORD_2. Note that as you type the password, each character will be replaced with an asterisk (*). When finished hit the ENTER key.
+
+
+
+
+
6Network 3 Name — Alternative network 2 SSID
+
Accepts a string:
+
For example, if my network name is "MY_NETWORK_NAME_3", you would manually type MY_NETWORK_NAME_3. When finished hit the ENTER key
+
+
+
+
+
7Network 3 Password — Alternative network 3 Password
+
Accepts a string:
+
For example, if my network name is "MY_SUPER_SECRET_PASSWORD_3", you would manually type MY_SUPER_SECRET_PASSWORD_3. Note that as you type the password, each character will be replaced with an asterisk (*). When finished hit the ENTER key.
+
+
+
+
+
8Network 4 Name — Alternative network 2 SSID
+
Accepts a string:
+
For example, if my network name is "MY_NETWORK_NAME_4", you would manually type MY_NETWORK_NAME_4. When finished hit the ENTER key
+
+
+
+
+
9Network 4 Password — Alternative network 4 Password
+
Accepts a string:
+
For example, if my network name is "MY_SUPER_SECRET_PASSWORD_4", you would manually type MY_SUPER_SECRET_PASSWORD_4. Note that as you type the password, each character will be replaced with an asterisk (*). When finished hit the ENTER key.
+
+
+
+
+
bBack
+
+
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
+
+
+
+
+
Press the reset button or cycle power to restart the DataLogger IoT. You can also go through the menu and reset the device through software as well. Once the board is reset, the DataLogger will attempt to connect to a WiFi network. If you are successful, the output will indicate that the board connected to a WiFi network and will update the current time through a NTP Client.
+
+
+
+
+
+
Note
+
If you have a Qwiic Dynamic NFC/RFID Tag connected to the board's Qwiic connector, you can easily update your WiFi credentials! Just make sure to save the WiFi credentials to the tag.
+
+
+
Note
+
If you saved your preferences to a JSON file on your microSD card's root directory, you can also save your WiFi credentials and load the system settings from the menu as well!
+
+
Network: NTP Client
+
In the Settings menu, send a 5 to adjust the NTP Client settings. As of firmware v01.01.01, time zone support is at the clock level, not tied to the NTP. The option to adjust the Time Zone is moved to the Time Sources menu.
+
+
+
+
+
In this menu, users will have the option to enable/disable the NTP client, select the primary/secondary server, or adjust the time zone for your area.
+
+
1Enabled — Enable or Disable the NTP Client
+
Accepts a boolean value:
+
1 to enable (default)
+
0 to disable
+
+
+
+
+
2NTP Server One — The primary NTP Server to use
+
Accepts a string:
+
time.nist.gov(default)
+
+
+
+
+
3NTP Server Two — The secondary NTP Server to use
+
Accepts a string:
+
pool.ntp.org(default)
+
+
+
+
+
bBack
+
+
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
+
+
+
+
+
Logging: Logger
+
In the Settings menu, send a 6 to adjust how data is logged.
+
+
+
+
+
In the Logger menu, users will have the option to add a timestamp, increment sample numbering, data format, or reset the sample counter. Note that the timestamp is the system clock and syncs with the reference clock that was chosen. Data from the Qwiic-enabled devices that keep track of time can also be included for each data entry by default.
+
+
1Timestamp Mode — Enable timestamp output and set the format of a log entry timestamp
+
1 for no timestamp (default) = 0
+
2 for milliseconds since program start = 1
+
3 for seconds since Epoch = 2
+
4 for Date Time - USA Date format = 3
+
5 for Date Time = 4
+
6 for ISO08601 Timestamp = 5
+
7 for ISO08601 Timestamp with Time Zone = 6
+
+
+
2Sample Numbering — An incremental count of the current log entry
+
Accepts a boolean value:
+
1 to enable
+
0 to disable (default)
+
+
+
+
+
3Numbering Increment — Increment amount for Sample Numbering
+
Accepts an unsigned integer between 1 to 10000:
+
1(default)
+
+
+
+
+
4Output ID — Include the Board ID in the log output (added as of firmware v01.02.00)
+
Accepts a boolean value:
+
1 to enable
+
0 to disable (default)
+
+
+
+
+
5Output Name — Include the Board Name in the log output (added as of firmware v01.02.00)
+
Accepts a boolean value:
+
1 to enable
+
0 to disable (default)
+
+
+
+
+
6Rate Metric — Enable to record the logging rate data (added as of firmware v01.02.00)
+
Accepts a boolean value:
+
1 to enable
+
0 to disable (default)
+
+
+
+
+
7SD Card Format — Enable and set the output format
+
Accepts an integer:
+
1 to disable = 0
+
2 CSV format = 1 (default)
+
3 JSON format = 2
+
+
+
+
+
8Serial Console Format — Enable and set the output format
+
Accepts an integer:
+
1 to disable = 0
+
2 CSV format = 1 (default)
+
3 JSON format = 2
+
+
+
+
+
9System Info — Log system information (added as of firmware v01.02.00)
+
Accepts a boolean value:
+
1 to enable
+
0 to disable (default)
+
+
+
+
+
10Reset Sample Counter — Reset the sample number counter to the provided value
+
Accepts an unsigned integer between 0 to 10000:
+
0(default)
+
+
+
+
+
bBack
+
+
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
+
+
+
+
+
Press the reset button or cycle power to restart the DataLogger IoT. You can also go through the menu and reset the device through software as well. Below is an example with the ISO08601 time that was added to the output.
+
+
+
+
+
Logging: Logging Timer
+
In the Settings menu, send an 7 to adjust the Logging Timer.
+
+
+
+
+
Adjusting the interval for the Logging Timer will change the amount of time between log entries.
+
+
1Interval — The timer interval in milliseconds
+
Accepts an integer:
+
15000 milliseconds (default)
+
+
+
+
+
bBack
+
+
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
+
+
+
+
+
Logging: Data File
+
In the Settings menu, send an 8 to adjust the Logging Data File.
+
+
+
+
+
Adjusting these parameters allows you to change the filename prefix, the number the files starts at, and how often the DataLogger will create a new file on the microSD card. For example, the default file will be saved as sfe0001.txt. After 1 day, the DataLogger will rotate files by creating a new file named sfe0002.txt. The DataLogger will begin logging data in this new file. The purpose of this log rotation is to limit the size of each file prevent issues when opening large files.
+
+
1Rotate Period — Time between file rotation
+
Accepts the following values:
+
1 for 6 hours = 6
+
2 for 12 hours = 12
+
3 for 1 day (24 hours) = 24 (default)
+
4 for 2 days (48 hours) = 48
+
5 for 1 week (168 hours) = 168
+
+
+
+
+
2File Start Number — The number the filename rotation starts with
+
Accepts an unsigned integer:
+
1(default)
+
+
+
+
+
3Filename Prefix — The prefix string for the generated filenames
+
Accepts a string:
+
sfe(default)
+
+
+
+
+
bBack
+
+
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
+
+
+
+
+
The contents of the file will depend on how the data was saved (either CSV or JSON). Make sure that the SD Card format is enabled to either CSV or JSON with your desired device outputs turned on so that the DataLogger can save the readings.
+
When removing the microSD card, make sure to remove your power source. Then insert into it into microSD card adapter or USB reader. When connecting the memory card to your computer, you can use a text editor to view the saved readings. In this case, a Windows operating system was viewing the file sfe0000.txt and it was only file available in the microSD card.
+
+
+
+
+
IoT Services: MQTT Client
+
In the Settings menu, send an 9 to adjust settings for the MQTT Client.
+
+
+
+
+
+
1Enabled — Enable or Disable MQTT Client
+
Accepts a boolean value:
+
1 to enable
+
0 to disable (default)
+
+
+
+
+
2Port — The MQTT broker port to connect to
+
Accepts an unsigned integer:
+
1883(default)
+
+
+
+
+
3Server — The MQTT server to connect to
+
Accepts a string
+
+
+
4MQTT Topic — The MQTT topic to publish to
+
Accepts a string
+
+
+
5Client Name — Name of this device used for MQTT Communications
+
Accepts a string
+
+
+
6Username — Username to connect to an MQTT broker, if required.
+
Accepts a string
+
+
+
7Password — Password to connect to an MQTT broker, if required.
+
Accepts a string
+
+
+
8Buffer Size — MQTT payload buffer size. If 0, the buffer size is dynamic
+
Accepts an unsigned int16:
+
0 for dynamic buffer size (default)
+
+
+
+
+
bBack
+
+
IoT Services: MQTT Secure Client
+
In the Settings menu, send an 10 to adjust settings for the MQTT Secure Client.
+
+
+
+
+
+
1Enabled — Enable or Disable MQTT Secure Client
+
Accepts a boolean value:
+
1 to enable
+
0 to disable (default)
+
+
+
+
+
2Port — The MQTT broker port to connect to
+
Accepts an unsigned integer:
+
8883(default, as of firmware v01.00.04)
+
+
+
+
+
3Server — The MQTT server to connect to
+
Accepts a string
+
+
+
4MQTT Topic — The MQTT topic to publish to
+
Accepts a string
+
+
+
5Client Name — Name of this device used for MQTT Communications
+
Accepts a string
+
+
+
6Username — Username to connect to an MQTT broker, if required.
+
Accepts a string
+
+
+
7Password — Password to connect to an MQTT broker, if required.
+
Accepts a string
+
+
+
8Buffer Size — MQTT payload buffer size. If 0, the buffer size is dynamic
+
Accepts an unsigned int16:
+
0 for dynamic buffer size (default)
+
+
+
+
+
9CA Cert Filename — The File to load the certificate from
+
Accepts a string
+
+
+
10Client Cert Filename — The File to load the client certificate from
+
Accepts a string
+
+
+
11Client Key Filename — The File to load the client key from
+
Accepts a string
+
+
+
bBack
+
+
IoT Services: AWS IoT
+
In the Settings menu, send an 11 to adjust settings for the AWS IoT.
+
+
+
+
+
+
1Enabled — Enable or Disable AWS IoT
+
Accepts a boolean value:
+
1 to enable
+
0 to disable (default)
+
+
+
+
+
2Port — The MQTT broker port to connect to
+
Accepts an unsigned integer:
+
8883(default, as of firmware v01.00.04)
+
+
+
+
+
3Server — The MQTT server to connect to
+
Accepts a string
+
+
+
4MQTT Topic — The MQTT topic to publish to
+
Accepts a string
+
$aws/things//shadow/update(default)
+
+
+
+
+
5Client Name — Name of this device used for MQTT Communications
+
Accepts a string
+
+
+
6Username — Username to connect to an MQTT broker, if required.
+
Accepts a string
+
+
+
7Password — Password to connect to an MQTT broker, if required.
+
Accepts a string
+
+
+
8Buffer Size — MQTT payload buffer size. If 0, the buffer size is dynamic
+
Accepts an unsigned int16:
+
0 for dynamic buffer size (default)
+
+
+
+
+
9CA Cert Filename — The File to load the certificate from
+
Accepts a string
+
+
+
10Client Cert Filename — The File to load the client certificate from
+
Accepts a string
+
+
+
11Client Key Filename — The File to load the client key from
+
Accepts a string
+
+
+
bBack
+
+
IoT Services: ThingSpeak MQTT
+
In the Settings menu, send an 12 to adjust settings for ThingSpeak MQTT
+
+
+
+
+
+
1Enabled — Enable or Disable ThingSpeak MQTT
+
Accepts a boolean value:
+
1 to enable
+
0 to disable (default)
+
+
+
+
+
2Port — The MQTT broker port to connect to
+
Accepts an unsigned integer:
+
8883(default, as of firmware v01.00.04)
+
+
+
+
+
3Server — The MQTT server to connect to
+
Accepts a string
+
+
+
4MQTT Topic — The MQTT topic to publish to
+
Accepts a string
+
+
+
5Client Name — Name of this device used for MQTT Communications
+
Accepts a string
+
+
+
6Username — Username to connect to an MQTT broker, if required.
+
Accepts a string
+
+
+
7Password — Password to connect to an MQTT broker, if required.
+
Accepts a string
+
+
+
8Buffer Size — MQTT payload buffer size. If 0, the buffer size is dynamic
+
Accepts an unsigned int16:
+
0 for dynamic buffer size (default)
+
+
+
+
+
9CA Cert Filename — The File to load the certificate from
+
Accepts a string
+
+
+
10Client Cert Filename — The File to load the client certificate from
+
Accepts a string
+
+
+
11Client Key Filename — The File to load the client key from
+
Accepts a string
+
+
+
12Channels — Comma separated list of =
+
Accepts a string
+
+
+
bBack
+
+
IoT Services: Azure IoT
+
In the Settings menu, send an 13 to adjust settings for the Azure IoT.
+
+
+
+
+
+
1Enabled — Enable or Disable Azure IoT
+
Accepts a boolean value:
+
1 to enable
+
0 to disable (default)
+
+
+
+
+
2Port — The MQTT broker port to connect to
+
Accepts an unsigned integer:
+
8883(default, as of firmware v01.00.04)
+
+
+
+
+
3Server — The MQTT server to connect to
+
Accepts a string
+
+
+
4MQTT Topic — The MQTT topic to publish to
+
Accepts a string
+
+
+
5Client Name — Name of this device used for MQTT Communications
+
Accepts a string
+
+
+
6Username — Username to connect to an MQTT broker, if required.
+
Accepts a string
+
+
+
7Password — Password to connect to an MQTT broker, if required.
+
Accepts a string
+
+
+
8Buffer Size — MQTT payload buffer size. If 0, the buffer size is dynamic
+
Accepts an unsigned int16:
+
0 for dynamic buffer size (default)
+
+
+
+
+
9CA Cert Filename — The File to load the certificate from
+
Accepts a string
+
+
+
10Client Cert Filename — The File to load the client certificate from
+
Accepts a string
+
+
+
11Client Key Filename — The File to load the client key from
+
Accepts a string
+
+
+
11Device ID — The device id for the Azure IoT device
+
Accepts a string
+
+
+
12Device Key — The device key for the Azure IoT device
+
Accepts a string
+
+
+
bBack
+
+
IoT Services: HTTP IoT
+
In the Settings menu, send an 14 to adjust settings for the Azure IoT.
+
+
+
+
+
+
1Enabled — Enable or Disable the HTTP Client
+
Accepts a boolean value:
+
1 to enable
+
0 to disable (default)
+
+
+
+
+
2URL — The URL to call with log information
+
Accepts a string
+
+
+
3CA Cert Filename — The File to load the certificate from
+
Accepts a string
+
+
+
bBack
+
+
IoT Services: MachineChat
+
In the Settings menu, send an 15 to adjust settings for MachineChat.
+
+
+
+
+
+
1Enabled — Enable or Disable the HTTP Client
+
Accepts a boolean value:
+
1 to enable
+
0 to disable (default)
+
+
+
+
+
2URL — The URL to call with log information
+
Accepts a string
+
+
+
3CA Cert Filename — The File to load the certificate from
In the Settings menu, send an 16 to adjust settings for Arduino Cloud. This feature was added as of firmware v01.01.01.
+
+
+
+
+
+
1Enabled — Enable or Disable the Arduino IoT Client
+
Accepts a boolean value:
+
1 to enable
+
0 to disable (default)
+
+
+
+
+
2Thing Name — The Thing Name to use for the IoT Device connection
+
Accepts a string
+
+
+
3Thing ID — The Thing ID to use for the IoT Device connection
+
Accepts a string
+
+
+
4API Client ID — The Arduino Cloud API Client ID
+
Accepts a string
+
+
+
5API Secret — The Arduino Cloud API Secret
+
Accepts a string
+
+
+
6Device Secret — The Arduino IoT Device Secret
+
Accepts a string
+
+
+
7Device ID — The Arduino IoT Cloud Device ID
+
Accepts a string
+
+
+
bBack
+
+
IoT Web Server
+
As of firmware v01.02.00, log files can be viewed and downloaded using the IoT Web Server feature if mDNS (multicast DNS) is supported on your network. This functionality is accessed via the Settings Menu, Type 17 to enter the System Update menu. Once this menu entry is selected, the following menu options are presented:
+
+
+
+
+
+
1Enabled — Enabled or Disable the Web Server
+
Accepts a boolean value
+
1 to enable
+
0 to disable (default)
+
+
+
+
+
2Username — Web access control. Leave empty to disable authentication
+
Accepts a string
+
+
+
3Password — Web access control.
+
Accepts a string
+
+
+
4mDNS Support — Enable a name for the web address this device
+
Accepts a boolean value
+
1 to enable
+
0 to disable (default)
+
+
+
+
+
5mDNS Name — mDNS Name used for this device address
+
Accepts a string
+
dataloggerXXXXX, where XXXXX is the taken from the last 5x characters from your DataLogger IoT's board ID (default)
+
+
+
+
+
bBack
+
+
+
Note
+
You will need to make sure that the ESP32 is on the same network as your computer in order to access the log files.
+
+
+
Note
+
When authentication is enabled, some browsers might require a second login depending on user settings.
+
+
+
Note
+
The SparkFun Datalogger IoT requires restarting if the web interface is enabled.
New sensors and features are being added all the time and we've made it really easy for you to keep your DataLogger IoT up to date. The System Update option provides the following functionality to the end user:
+
+
Restart the device
+
Performing a Factory Reset on the device
+
Updated the device firmware from a file on an SD Card.
+
+
+
Note
+
What's going on here?!? This tutorial was updated for firmware version 01.02.00!!! You will notice this menu option has changed to 18 !!!
+
+
This functionality is accessed via the Settings Menu, which is required to use this capability. Type 18 to enter the System Update menu. Once this menu entry is selected, the following menu options are presented:
+
+
+
+
+
+
1Device Restart — Restart/reboot the device
+
Accepts the following values:
+
Y or Y to restart or reboot the device using the current firmware and system preferences
+
N or n to cancel
+
+
+
+
+
2Factory Reset — Erase all settings and revert to original firmware
+
Accepts the following values:
+
Y or Y to factory reset the device
+
N or n to cancel
+
+
+
+
+
3Update Firmware - SD Card — Update the firmware from the SD card
+
Accepts firmware in the /root directory of the microSD card with the file naming pattern SparkFunDataLoggerIoT*.bin, where the asterisk * is the firmware version number (i.e. SparkFunDataLoggerIoT_01.00.01.bin).
+
+
+
4Update Firmware - OTA — Update the firmware over-the-air
+
Connects to a server and searches for the latest firmware that is available. Note that you must be connected to a WiFi network to be able to update the board over-the-air.
+
Accepts the following values if there is new firmware available.
+
Y or Y to update over-the-air
+
N or n to cancel
+
+
+
+
+
bBack
+
+
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
+
+
+
+
+
For more information on how to update firmware manually or over-the-air, check out the section under Examples: Updating Firmware.
In the Main Menu, send a 2 through the serial terminal to adjust the devices settings.
+
+
+
+
+
This will bring up the connected devices that are currently available. You can configure each device and enable/disable each output. Below is a sample of the on-board devices available for the DataLogger IoT - 9DoF when only the MAX17048, ISM330, and MMC5983 are connected. As the DataLogger IoT - 9DoF initializes, the board will populate additional devices in this window if they are detected. Your mileage will vary depending on what is connected. On the DataLogger IoT you will not see the ISM330 or MMC5983 as an option since the 6DoF IMU and magnetometer are not populated on that version of the board.
+
+
1MAX17048 — MAX17048 LiPo Battery Fuel Gauge
+
1Voltage (V) — Battery voltage (Volts)
+
1 to enable Voltage (V) (default)
+
2 to disable Voltage (V)
+
+
+
2State of Charge (%) — Battery state of charge (%)
1Filter Bandwidth (Hz) — The filter bandwidth in Hz
+
1 100 Hz (default)
+
2 200 Hz
+
3 400 Hz
+
4 800 Hz
+
+
+
2Auto-Reset — Auto-Reset
+
1 to enable
+
2 to disable
+
+
+
3X Field (Gauss) — The X Field strength in Gauss
+
1 to enable
+
2 to disable
+
+
+
4Y Field (Gauss) — The Y Field strength in Gauss
+
1 to enable
+
2 to disable
+
+
+
5Z Field (Gauss) — The Z Field strength in Gauss
+
1 to enable
+
2 to disable
+
+
+
6Temperature (C) — The ambient temperature in degrees C
+
1 to enable
+
2 to disable
+
+
+
+
+
bBack
+
+
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
+
+
+
+
+
+
Warning
+
As you connect additional devices to the DataLogger IoT, the values associated with each device in this menu will change! Make sure to check your device settings menu after additional devices are attached should you decide to configure the additional devices and enable/disable their outputs.
+
File a pull request with your changes, and enjoy making the wordsworlds world a better place.
+
Once received, the engineer in charge of the original design will automatically be notified.
+
We will review your suggested improvements, 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.)
+
+
+
+
Contributors
+
Let's provided some recognition to the contributors for this project!
How to Convert Comma Separated Values (CSV) to a Spreadsheet
+
+
The DataLogger IoT is great at displaying real time data with an IoT service whenever there is an Internet connection available. For those that want to use the DataLogger IoT without a WiFi connection and/or you just want to save data to a microSD card, you can import the comma separated values (CSV) from the text file into a spreadsheet to graph the values.
+
There are a few spreadsheet programs available that can take text files with CSV but for the scope of this tutorial, we will be using Google Sheets™ to convert the CSV output to a graph.
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. 😉
+
+
Log Some Data!
+
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.
+
+
Tip
+
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.
+
+
+
Note
+
For users that require a timestamp with their datasets, make sure to enable timestamp.
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.
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.
+
+
+
+
+
+
Note
+
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. In this case, we are using the default CSV format.
+
+
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.
+
+
+
+
+
+
Note
+
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.
+
+
+
+
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.
+
+
+
+
+
+
Tip
+
To separate the values to each column, highlight everything in the column. Then head to the menu and select: Data > Split text into columns
+
+
+
+
+
Graphing Your Datasets
+
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.
+
+
+
+
+
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.
+
+
+
+
+
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.
+
+
+
+
+
+
Note
+
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.
Creating and Connecting to an Arduino Cloud Device
+
One of the key features of the SparkFun DataLogger IoT is it's simplified access to IoT service providers. This document outlines how an Arduino Cloud Device is used by the DataLogger IoT.
+
The following is covered by this document:
+
+
Structure of the Arduino Cloud Devices
+
Device creation in the Arduino Cloud
+
Setup of the Arduino Driver
+
How data is posted from the DataLogger IoT to the Arduino Device
+
+
Currently, the Arduino Cloud device connection is a single direction - used to post data from the DataLogger IoT to an Arduino Cloud device.
To take advantage of the API's in Arduino Cloud, you will also need to have a service plan with your account.
+
+
General Operation
+
The Arduino Cloud enables connectivity between an IoT/Edge Arduino enabled device and the cloud. The edge device updates data in the Arduino Cloud by updating variables or parameters attached to a cloud device.
+
In the Arduino Cloud, the edge device is represented by a Device which has a virtual Thing attached/associated with it. The Thing acts as a container for a list of parameters or variables which represent the data values received from the edge device. As values on the edge device update, they are transmitted to the Arduino Cloud.
+
For a SparkFun DataLogger IoT connected to an Arduino Cloud device, the output parameters of a device connected to the DataLogger are mapped to variables within the Arduino Cloud Device's Thing using a simple pattern of DeviceName_ParameterName for the name of the variable in the Arduino Cloud.
+
+
+
+
+
Creating a Device in Arduino Cloud
+
The first step connecting to the Arduino Cloud is setting up a device within the cloud. A device is a logical element that represents a physical device.
Click on the expand menu icon on the upper left (e.g. the three lines stacked like a "hamburger"; ☰) and select Devices. If your window is big enough, then it will show up on the navigation bar.
+
+
+
+
+
This page lists your currently defined devices. If there are no defined devices, select the Add Device button. This will probably be at the bottom of the page. The location of this button will change once the page has a device (or if there is an update to Arduino's user interface).
+
+
+
+
+
A device type selection dialog is then shown. Since we are connecting a DataLogger IoT board to the system, and not connected a known device, select DIY - Any Device to manually include the DataLogger IoT.
+
+
+
+
+
Once selected, another dialog is presented. Just select Continue. At this point you can provide a name for your device. In this case we named it as "MyDataLoggerIoT."
+
+
+
+
+
The next screen is the critical step of the device creation process. This step is the one time the Device Secret Key is available. The provided Device ID and Device Secret Key values are needed to connect to the Arduino Cloud. Once this step is completed, the Secret Key is no longer available.
+
+
+
+
+
The easiest way to capture these values is by downloading as a PDF file, which is offered on the setup page. Click on the download the PDF and save it to a safe location. When ready, click on the check box indicating that you have saved the values and select the Continue button.
+
Arduino Cloud API Keys
+
In addition to creating a device, to access the Arduino Cloud, the driver requires an API Key. This allows the DataLogger IoT's Arduino Cloud driver to access the web API of the Arduino Cloud. This API is used to setup the connection to the Arduino Cloud.
+
To create an API key, click on the menu bar to expand and select your Arduino account profile > Personal Settings.
+
+
+
+
+
This menu takes you to a list of existing API Keys. If you have not created one yet, the list will have nothing in it like the image below. From this page, select the CREATE API KEY button.
+
+
+
+
+
+
Note
+
Users will need a service plan in order to take advantage of the API.
+
+
In the presented dialog, enter a name for the API key. In this case, we named it "MyDataLoggerKey".
+
+
+
+
+
Once the name is entered, click CONTINUE. A page with the new API key is presented. Like in Device Creation, this page contains a secret that is only available on this page during this process.
+
+
+
+
+
Make note of the Client ID and Client Secret values on this page. The best method to capture these values is to download the PDF file offered on this page. Click on the download the PDF and save it to a safe location. When ready, click on the check box indicating that you have saved the values and select the DONE button.
+
At this point, the Arduino Cloud is setup for connection by the driver.
+
Arduino Cloud Configuration
+
To add an Arduino Cloud Device as a destination DataLogger IoT, the Arduino Cloud connection is enabled via the DataLogger menu system and the connection values, obtained from the Arduino Cloud (see above), are set in the connection properties.
+
The specifics for the Arduino Cloud must be configured. This includes the following:
+
+
Thing Name
+
Thing ID
+
API Client ID
+
API Secret
+
Device Secret
+
Device ID
+
+
+
Note
+
The Thing Name does not necessarily need to be configured. However, there will be less confusion if you set this up before connecting the DataLogger IoT to the Cloud. The Thing ID will automatically be generated and saved once there is a connection available.
+
+
Thing Name
+
The name of the Arduino Cloud Thing to use. If the Thing doesn't exist on startup, the driver will create a Thing and be named "Untitled" if you do not provide a name.
+
+
Note
+
Note satisfied with the default "Untitled" as the Thing's name? You can rename the Thing Name after creating the Thing. Note that you will need to manually rename the Thing Name on the Arduino Cloud and DataLogger IoT.
+
+
Thing ID
+
This is the ID of the Thing being used. This value is obtained by the following methods:
+
+
If the driver creates a new Thing, the ID is obtained and used.
+
If an existing Thing is connected to the DataLogger IoT, the driver retrieves it's ID.
+
+
+
Note
+
In this case, the driver cannot create any new variables until the system is restarted.
+
+
+
The user creates a new Thing using the web interface of Arduino Cloud, and provides the Thing Name and Thing ID .
+
+
API Client ID and Secret
+
These values are used to provide API access by the driver. This access allows for the creation/use of a Thing and Variables within the Arduino Cloud. These are obtained via the steps outlined earlier in this document.
+
Device Secret and ID
+
These values are used to identify the Arduino device that is connected to. These are obtained via the steps outlined earlier in this document.
+
Setting Properties
+
The above property values must be set in the DataLogger's Arduino Cloud driver before use. They can be manually by using the menu system like the previous MQTT example.
+
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 16 to enter the Arduino IoT Menu. When the menu system for the Arduino IoT 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:
+
+
+
+
+
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 Arduino Cloud example outlined in this document, the entries in the setting's JSON file are as follows:
You will need to update the API Client ID, API Secret, Device Secret, and Device ID with the values that were obtained earlier. Don't forget to enable Arduino Cloud service by setting the value to true. If the JSON file is saved in the microSD card, you will need to load the credentials to the DataLogger IoT.
+
+
Tip
+
To load the values by the system at startup using a JSON file and microSD card, you will need to configure the Save Settings. This JSON file will be created with the "Save to Fallback" option. Make sure to enable the Arduino IoT as well.
+
+
Operation
+
On startup, when the first values are written from the DataLogger IoT, the connection to the Arduino Cloud is made. During this connection, the system connects to the specified Thing and variables are mapped between the DataLogger Device values and Arduino Cloud Variables. If needed, variables can be created manually in the cloud.
+
While this initial setup takes seconds to complete, updates to the values on the Arduino Cloud are rapid as soon as there is a connection available.
+
Viewing Values
+
Once the DataLogger IoT device is configured and running, updates in Arduino Cloud are listed in the Things tab of the Arduino Cloud page. Clicking the target Thing provides access to the current variable values that are connected to the DataLogger IoT. Your mileage may vary depending on the compatible device that is connected to the DataLogger IoT. In this case, we were able to see the built-in sensors that were connected on the DataLogger IoT - 9DoF.
+
+
+
+
+
+
Note
+
Not seeing certain variables on your list? Check your connections to make sure that the compatible device is connected to the DataLogger IoT. You may also have certain outputs disabled (like the connected sensors or timestamp).
+
+
+
Note
+
Having problems connecting new variables with the DataLogger IoT? When swapping out compatible Qwiic enabled devices, you may need to delete previous cloud variables so that the DataLogger IoT is able re-initialize them on the next power cycle.
+
+
Create a Dashboard
+
With the data now available in the Arduino Cloud as variables, it is a simple step create a dashboard that plots the data values.
+
The general steps to create a simple dashboard include:
+
+
Select the Dashboards section of the Arduino Cloud.
+
Select the Build Dashboard button. If you have a dashboard already built, the location of the button will change and the button will be renamed: Create.
+
Click the edit button (i.e. the icon that looks like a paper and pencil, this is next to the eye).
+
Add an element to the dashboard -- for this example select ADD ^ > Advanced Chart.
+
On the Chart's Widget Settings select Link Variables to add readings.
+
The DataLogger IoT Variables are listed - select the variable to link.
+
Continue this step until all the desired variables are linked to the chart. You can select up to 5x variables at a time. Click on the Link Variables button after selecting the variables.
+
This will bring you back to the Chart's Widget Settings window. Configure any preferences that to display (i.e. variable colors, labels, etc.). When all variables are linked and the Chart Widget Settings is configured, select Done.
+
+
+
+
+
+
The created dashboard then displays the values posted from the SparkFun DataLogger IoT. You can continue adding additional readings on the dashboard that you were not able to fit on graph or even rename the Dashboard view. In this case, we displayed accelerometer values and temperature in degrees Celsius from the DataLogger IoT - 9DoF.
+
+
+
+
+
+
Note
+
Not seeing any values on the LIVE view? Try clicking on the other time periods to see the values posted.
+
+
Using compatible Qwiic enabled devices, you can also display additional readings that are not available with the built-in sensors. In this case, we were able to display humidity, temperature in degrees Fahrenheit, equivalent CO2, TVOC, and AQI with the DataLogger IoT and Environmental Combo Breakout (ENS160/BME280).
Creating and Connecting to an AWS IoT Device (Thing)
+
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.
How data is posted from the DataLogger IoT to the AWS Device via it's Shadow
+
+
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.
+
General Operation
+
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.
+
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.
+
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.
+
+
+
+
+
Creating a Device in AWS IoT
+
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.
Once logged into your AWS account, select IoT Core from the menu of services.
+
+
+
+
+
From the IoT Core console page, under the Manage section, select All Devices > Things
+
On the resultant Things Page, select the Create Things button.
+
+
+
+
+
AWS IoT will then take you through the steps to create a device. Selections made for a demo Thing are:
+
+
Create single thing
+
Thing Properties
+
Enter a name for your thing - for this example TestThing23
+
Device Shadow - select Unnamed shadow (classic)
+
Auto-generate a new certificate
+
Attach policies to certificate - This is discussed later in this document
+
Select Create thing
+
+
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:
+
+
Device Certificate
+
Public Key File
+
Private Key File
+
Root CA certificates - (for example: Amazon Root CA 1 )
+
+
At this point, the new AWS IoT thing is created and listed on the AWS IoT Things Console
+
+
+
+
+
Security Policy
+
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.
+
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.
+
+
+
+
+
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:
Once the policy is created, go back to the IoT Device/Thing created above and associate this policy to the device Certificate.
+
+
Go to your device Manage > All devices > Things
+
Select the device - TestThing23 for this example
+
Select the Certificates tab
+
Select the listed Certificate (it's a very long hex number)
+
At the bottom right of the page, select the Attach policies button and select the Policy created above.
+
+
+
+
+
+
At this point, AWS IoT is ready for a device to connect and receive data.
+
AWS Configuration
+
The specifics for the AWS IoT Thing must be configured. This includes the following:
+
+
Server name/host
+
MQTT topic to update
+
Client Name - The AWS IoT Thing Name
+
CA Certificate Chain
+
Client Certificate
+
Client Key
+
+
Server Name/Hostname
+
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.
+
+
+
+
+
Selecting the Classic Shadow entry provides the Server Name/Hostname for the device, as well as the MQTT topic for this device.
+
+
+
+
+
+
Note
+
The server name is obtained from the Device Shadow URL entry
+
+
MQTT Topic
+
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:
+
$aws/things/TestThing23/shadow/update
+
+
Client Name
+
This is the AWS IoT name of the thing. For the provided example, the value is TestThing23
+
CA Certificate Chain
+
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.
+
Client Certificate
+
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.
+
Client Key
+
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.
+
Setting Properties
+
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.
+
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:
+
+
+
+
+
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:
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. 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.
+
+
Tip
+
To load the values by the system at startup using a JSON file and microSD card, you will need to configure the Save Settings. This JSON file will be created with the "Save to Fallback" option. Make sure to enable the AWS IoT as well.
+
+
Operation
+
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:
+
+
+
+
+
Opening up an update, you can see the data being set to AWS IoT in a JSON format.
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.
How data is posted from the DataLogger IoT to the Azure Device
+
+
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.
+
General Operation
+
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.
+
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.
+
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.
+
+
+
+
+
Creating a Device in Azure IoT
+
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.
Once logged into your Microsoft Azure account, select Internet of Things > IoT Hub from the menu of services.
+
+
+
+
+
Create an IoT Hub
+
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.
+
Follow the Hub Creation workflow - key settings used for a DataLogger demo device:
+
+
Used the "Free Tier" for testing and development.
+
Networking
+
Connectivity - Public Access
+
Minimum TLS Version - 1.0
+
+
+
+
The remaining settings were set at their default values.
+
Create a Device
+
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.
+
To create a device, select the Device management > Devices from the IoT Hub menu and the select the + Add Device menu item
+
+
+
+
+
In the create device dialog:
+
+
Enter a name for the device
+
Select an Authentication type of Symmetric key
+
Auto-generate keys enabled
+
+
+
+
+
+
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.
+
+
+
+
+
Azure Configuration
+
Once the DataLogger IoT is integrated into the application, the specifics for the Azure IoT Thing must be configured. This includes the following:
+
+
Server Name/Hostname
+
Device Key
+
Device ID
+
CA Certificate Chain
+
+
Server Name/Hostname
+
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.
+
+
+
+
+
Device ID
+
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.
+
+
+
+
+
Device Primary Key
+
This is obtained via the Device details page, as outlined in the previous section.
+
+
Note
+
You view and copy the key via the icons on the right of the key entry line.
+
+
Root Certificate Authority - CA file
+
The Certificate Authority file for Azure is downloaded from this page:
The file to download is the Baltimore CyberTrust Root entry in the Root Certificate Authorities section of the page.
+
+
+
+
+
Setting Properties
+
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.
+
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:
+
+
+
+
+
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:
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.
+
+
Tip
+
To load the values by the system at startup using a JSON file and microSD card, you will need to configure the Save Settings. This JSON file will be created with the "Save to Fallback" option. Make sure to enable the Azure IoT as well.
+
+
Operation and Monitoring
+
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.
+
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.
+
+
+
+
+
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.
+
Connect to Your Azure IoT Hub
+
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.
+
+
+
+
+
The available IoT Hubs are displayed in the editors command prompt. Select the desired hub and press Enter (or click).
+
+
+
+
+
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.
+
+
+
+
+
Monitoring
+
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.
+
+
+
+
+
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:
+
+
+
+
+
To stop monitoring, click the Stop Monitoring build-in event endpoint item that is displayed in the status bar of the editor.
+
+
+
+
+
A menu option to stop monitoring is also available from the ... menu of the AZURE IOT HUB section in the editor Explorer panel.
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.
+
The following is covered by this document:
+
+
Overview of the HTTP connection
+
How a user configures and uses the HTTP connection
+
Use examples
+
+
General Operation
+
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.
+
+
+
+
+
Data Structure
+
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.
+
The following is an example of the data posted - note, this representation was "pretty printed" for readability.
+
{
+"MAX17048":{
+"Voltage (V)":4.304999828,
+"State Of Charge (%)":115.0625,
+"Change Rate (%/hr)":0
+},
+"CCS811":{
+"CO2":620,
+"VOC":33
+},
+"BME280":{
+"Humidity":25.03613281,
+"TemperatureF":79.64599609,
+"TemperatureC":26.46999931,
+"Pressure":85280.23438,
+"AltitudeM":1430.44104,
+"AltitudeF":4693.04834
+},
+"ISM330":{
+"Accel X (milli-g)":-53.31399918,
+"Accel Y (milli-g)":-34.03800201,
+"Accel Z (milli-g)":1017.236023,
+"Gyro X (milli-dps)":542.5,
+"Gyro Y (milli-dps)":-1120,
+"Gyro Z (milli-dps)":262.5,
+"Temperature (C)":26
+},
+"MMC5983":{
+"X Field (Gauss)":-0.200622559,
+"Y Field (Gauss)":0.076416016,
+"Z Field (Gauss)":0.447570801,
+"Temperature (C)":29
+}
+}
+
+
HTTP Connection Setup
+
To connect to an HTTP server endpoint, the following information is needed:
+
+
The URL of the endpoint
+
The SSL certificate for the target server, if the connection is secure (HTTPS)
+
+
These values are set using the standard DataLogger methods - the interactive menu system, or a JSON file.
+
Menu System
+
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:
+
+
+
+
+
The options are:
+
+
Enable/Disable the connection
+
Set the URL for the endpoint
+
Set the name of the CA Cert file for a secure connection (HTTP)
+
+
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 .
+
+
+
+
+
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.
+
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.
+
+
+
+
+
The above example show providing a certificate filename of example.cer.
+
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.
+
JSON File Entries
+
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:
CA Cert Filename - Set to the cert filename on the SD card if being used.
+
+
If the JSON file is saved in the microSD card, you can load the credentials to the DataLogger IoT.
+
+
Tip
+
To load the values by the system at startup using a JSON file and microSD card, you will need to configure the Save Settings. This JSON file will be created with the "Save to Fallback" option. Make sure to enable the HTTP IoT as well.
+
+
Example - Connecting to a HTTP Server
+
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.
+
The Server
+
The following javascript/node code creates a HTTP server on port 8090, and outputs received data to the console.
+
varhttp=require('http');
+
+// Setup the endpoint server
+varmyServer=http.createServer(function(req,res){
+
+// Initialize our body string
+varbody="";
+
+// on data callback, append chunk to our body string
+req.on('data',function(chunk){
+body+=chunk;
+});
+
+// On end callback, output the body to the console
+req.on('end',function(){
+// parse json string, then stringify it back for 'pretty printing'
+console.log("payload: "+JSON.stringify(JSON.parse(body),null,2));
+});
+
+// send a reply
+res.writeHead(200,{'Content-Type':'text/plain'});
+res.end('n');
+// Just listen on our port
+}).listen(8090);
+
+
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).
+
Once Node is setup, the above server is run via the following command (assuming the implementation is in a file called simple_http.js):
+
node./simple_http.js
+
+
As data is sent by the DataLogger IoT, the following is output to the console from the server:
+
+
+
+
+
Obtaining a Sites Security Certificate
+
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.
+
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
+
+
+
+
+
Next, on the page shown, select the certificate button on the upper right of the dialog.
+
+
+
+
+
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.
+
+
+
+
+
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.
Viewing and Downloading Log Files using the IoT Web Server
+
+
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.
+
The following is covered by this document:
+
+
How a user configures and uses the HTTP connection
+
Use examples
+
+
IoT Web Server Connection Setup
+
To connect to the ESP32's IoT Web Server, the following information is needed:
+
+
The server name/address
+
[optional] A username - if required
+
[optional] A password - if required
+
+
IoT Web Server Menu System
+
We'll need to adjust the settings for the IoT Web Server.
+
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:
+
+
+
+
+
The options are:
+
+
Enable/Disable the connection
+
Username
+
Password
+
Enable/Disable mDNS support
+
mDNS name
+
+
At a minimum, you will just need to enable the connection. However, we recommend enabling mDNS support if it is supported in your network.
+
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.
+
JSON File Entries
+
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:
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.
+
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.
+
+
+
Tip
+
To load the values by the system at startup using a JSON file and microSD card, you will need to configure the Save Settings. This JSON file will be created with the "Save to Fallback" option. Make sure to enable the MQTT Client as well.
+
+
Connect and Download Log File
+
+
Note
+
You will need to make sure that the ESP32 is on the same network as your computer in order to access the log files.
+
+
+
Note
+
When authentication is enabled, some browsers might require a second login depending on user settings.
+
+
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".
+
+
+
+
+
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.
+
+
+
+
+
+
Note
+
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.
+
+
+
+
+
Now that you have downloaded the log files, try graphing the data on a spreadsheet!
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.
How a user configures and uses the MQTT connection
+
MQTT examples
+
+
General Operation
+
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.
+
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.
+
+
+
+
+
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.
+
Data Structure
+
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.
+
The following is an example of the data posted - note, this representation was "pretty printed" for readability.
+
{
+"MAX17048":{
+"Voltage (V)":4.304999828,
+"State Of Charge (%)":115.0625,
+"Change Rate (%/hr)":0
+},
+"CCS811":{
+"CO2":620,
+"VOC":33
+},
+"BME280":{
+"Humidity":25.03613281,
+"TemperatureF":79.64599609,
+"TemperatureC":26.46999931,
+"Pressure":85280.23438,
+"AltitudeM":1430.44104,
+"AltitudeF":4693.04834
+},
+"ISM330":{
+"Accel X (milli-g)":-53.31399918,
+"Accel Y (milli-g)":-34.03800201,
+"Accel Z (milli-g)":1017.236023,
+"Gyro X (milli-dps)":542.5,
+"Gyro Y (milli-dps)":-1120,
+"Gyro Z (milli-dps)":262.5,
+"Temperature (C)":26
+},
+"MMC5983":{
+"X Field (Gauss)":-0.200622559,
+"Y Field (Gauss)":0.076416016,
+"Z Field (Gauss)":0.447570801,
+"Temperature (C)":29
+}
+}
+
+
MQTT Broker Connection Setup
+
To connect to a MQTT Broker, the following information is needed:
+
+
The server name/address
+
The server port
+
The topic to post to
+
[optional] The name of the device/Client name publishing the data
+
[optional] A username - if required
+
[optional] A password - if required
+
+
These values are set using the standard DataLogger methods - the interactive menu system, or a JSON file.
+
MQTT Menu System
+
We'll need to adjust the settings for the MQTT Client using the MQTT Menu System.
+
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:
+
+
+
+
+
The options are:
+
+
Enable/Disable the connection
+
Broker Port - The standard port for mqtt is 1883
+
Broker Server - This is just the name of the server
+
MQTT Topic - A string
+
Client Name
+
Username
+
Password
+
Buffer Size
+
+
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.
+
+
Note
+
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.
+
+
+
Note
+
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.
+
+
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.
+
JSON File Entries
+
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:
To load the values by the system at startup using a JSON file and microSD card, you will need to configure the Save Settings. This JSON file will be created with the "Save to Fallback" option. Make sure to enable the MQTT Client as well.
+
+
Testing the MQTT Connection
+
Use of a MQTT connection is fairly straightforward - just requiring the entry of broker details into the connection settings.
+
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 provides some basic setup for a broker.
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:
+
mosquitto_sub-t"/sparkfun/datalogger1"
+
+
This assumes the MQTT broker is running on the same machine, and using the default port number.
One of the key features of the DataLogger IoT is it's simplified access to IoT service providers. This document outlines how a ThinkSpeak output is used by the DataLogger IoT.
How data is posted from the DataLogger IoT to ThingSpeak
+
+
General Operation
+
ThingSpeak Structure
+
The structure of ThingSpeak is based off of the concept of Channels, with each channel supporting up to eight fields for data specific to the data source. Each channel is named, and has a unique ID associated with it. One what to think of it is that a Channel is a grouping of associated data values or fields.
+
The fields of a channel are enumerated as Field1, Field2, ..., Field8, but each field can be named to simplify data access and understanding.
+
As data is reported to a ThingSpeak channel, the field values are accessible for further processing or visualization output.
+
Data Structure
+
The DataLogger IoT is constructed around the concept of Devices which are often a type of sensor that can output a set of data values per observation or sample.
+
Mapping Data to ThingSpeak
+
The concept of Channels that contain Fields in ThingSpeak is similar to the Devices that contain Data within the DataLogger IoT, and this similarity is the mapping model used by the DataLogger IoT. Specifically:
+
+
Devices == Channels
+
Data == Fields
+
+
+
+
+
+
During configuration of the DataLogger IoT, the mapping between the Device and ThingSpeak channel is specified. The data to field mapping is automatically created by the DataLogger IoT following the data reporting order from the specific device driver.
+
Creating a Device to a ThingSpeak Channel
+
The following discussion outlines the basic steps taken to create a Channel in ThingSpeak and then connect it to the DataLogger's Device. First step is to log into your ThingSpeak and create a Channel.
Once logged into your ThingSpeak account, select Channels > My Channels menu item and on the My Channel page, select the New Channel button.
+
+
+
+
+
On the presented channel page, name the channel and fill in the specific channel fields. The fields should map to the data fields reported from the Device being linked to this channel. Order is important, and is determined by looking at output of a device to the serial device (or reviewing the device driver code).
+
+
+
+
+
Once the values are entered, select Save Channel. ThingSpeak will now show list of Channel Stats, made up of line plots for each field specified for the channel.
+
+
Note
+
Key note - at the top of this page is listed the Channel ID. Note this number - it is used to map a Device to a ThingSpeak Channel.
+
+
Setting Up ThingSpeak MQTT
+
The DataLogger IoT uses MQTT to post data to a channel. From the ThingSpeak menu, select Devices > MQTT, which displays a list of your MQTT devices. From this page, select the Add a new device button.
+
On the presented dialog, enter a name for the MQTT connection and in the Authorize channels to access, select the channel created earlier. Once you select a channel, click the Add Channel button.
+
+
Note
+
More channels can be added later.
+
+
+
+
+
+
+
Note
+
When the MQTT device is created, a set of credentials (Client ID, Username, and Password) is provided. Copy or download these values, since the password in not accessible after this step.
+
+
The selected Channel is then listed in the Authorized Channel table. Ensure that the Allow Publish and Allow Subscribe attributes are enabled for the added channel.
+
+
+
+
+
At this point, the ThingSpeak Channel is setup for access by the DataLogger IoT.
+
ThingSpeak Configuration
+
Once the device is integrated into the application, the specifics for the ThingSpeak Channel(s) must be configured. This includes the following:
+
+
Server Name/Hostname
+
Client Name
+
User Name
+
Password
+
Device to Channel mapping
+
CA Certificate Chain
+
+
Server Name/Hostname
+
This value is hostname of the ThingSpeak mqtt connection, which is mqtt3.thingspeak.com as note at ThingSpeakMQTT Basics page. Note a secure connection is used, so the port for the connection is 8883.
+
Client Name/ID
+
The Client Name/ID is found under MQTT connection details listed in the Devices > MQTT section of ThingSpeak.
+
Username
+
The Username is found under MQTT connection details listed in the Devices > MQTT section of ThingSpeak.
+
Password
+
The connection password was provided when the MQTT device was created. If you lost this value, you can regenerate a password on the MQTT Device information page.
+
Certificate File
+
You can download the cert file for ThingSpeak.com page using a web-browser. Click on the security details of this page, and navigate the dialog (browser dependent) to download the certificate. The downloaded file is the made available for the DataLogger IoT to use as a file that is loaded at runtime)
+
Setting Properties
+
The above property values must be set on the DataLogger IoT before use. They can be manually by using the menu system like the previous MQTT example.
+
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 12 to enter the ThingSpeak MQTT Menu. When the menu system for the ThingSpeak MQTT 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:
+
+
+
+
+
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 ThingSpeak example outlined in this document, the entries in the settings JSON file are as follows:
The Channels value is a list of [DEVICE NAME]=[Channel ID] pairs. Each pair is separated by a comma. In this case, the device name BME280 and the channel ID was 2054891. Make sure to match the device name that was loaded on start up with the unique channel ID that was generated when creating a ThingSpeak Channel.
+
+
Besides updating the Server, Client Name, Username, Password, CA Cert Filename, and Channels, 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 ThingSpeak service. Don't forget to enable ThingSpeak MQTT 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.
+
+
Tip
+
To load the values by the system at startup using a JSON file and microSD card, you will need to configure the Save Settings. This JSON file will be created with the "Save to Fallback" option. Make sure to enable the ThingSpeak MQTT as well.
+
+
Monitoring Output
+
Once the connector is configured and the DataLogger IoT is connected to ThingSpeak, as data is posted, the results are show on the Channel Stats page for your Channel. For the above example, the output of a SparkFun BME280 sensor produces the following output:
+
+
+
+
+
Setting Up 2x or More Devices
+
For users that are setting up 2x or more devices on the DataLogger IoT, you will need to ensure that each device has their own ThingSpeak Channel. Unfortunately, you are not able to plot sensor readings from two devices in the same channel.
+
The following example demonstrates how to set up two devices for ThingSpeak on the DataLogger IoT. In this case, we will use the BME688 and BME680 and their respective default I2C address. This is also a good example of what to do when two devices use the same device driver. Head to ThingSpeak to create a channel for each device connected to the DataLogger IoT. Include a field for each device data that the DataLogger provides. The name of the channel does not need to match the device name or I2C address.
+
+
+
+
+
+
+
+
Creating a Channel for the BME688
+
Creating a Channel for the BME680
+
+
+
+
+
Once the channels are created, you will be provided with a unique channel ID for each channel. Make sure to take note of the number as explained earlier.
+
+
Note
+
The alternative I2C address for the BME688 and BME680 uses the same address as the default of the other sensor:
+
+
BME680: 0x77 (Default) or 0x76
+
BME688: 0x76 (Default) or 0x77
+
+
Make sure to avoid using the same address when connecting the sensors to the same DataLogger IoT.
+
+
When setting up the connection, you will need to authorize both channels. In this example, we included the channels for the BME688 [x076] and BME680 [x077].
+
+
+
+
+
+
+
Authorizing 2x Channels through the Same Connection
+
+
+
+
+
Now that the ThingSpeak MQTT connection is setup, adjust the ThingSpeak configuration for the DataLogger IoT by including the credentials (i.e. Client Name, Username, and Password) and channels. We will assume that you have included the ThingSpeak CA certificate file in the root directory of the microSD card already. When including the device name with their respective channel, ensure that the device name matches the name that was loaded on startup. For example, the BME688 and BME680 were loaded on startup as BME68x and BME68x [x77], respectively. Since we are only interested in plotting the BME688 and BME680, we will ignore the MAX17048 that was loaded on startup as well. Under /Settings/ThingSpeak MQTT/Channels, you will enter the string for the device names, each of their respective channel IDs, and a comma separating the two channels like so: BME68x=2613826, BME68x [x77]=2613825.
+
+
+
+
+
+
+
+
DataLogger IoT Device Name Loaded during Startup
+
Device Name and Channel for Both Sensors
+
+
+
+
+
+
Note
+
Whenever there are multiple devices using the same device driver (each with unique I2C addresses), the DataLogger IoT will display the device address for each additional device that is loading the same driver. As shown above, the first device name did not include the device's I2C address. The second device name using the same driver included its I2C address. Of course, there is an configuration that enables you to always include the address of all the device names.
+
+
The alternative to using the menu system is the JSON file. In this case, we updated channels for the BME688 and BME680. Not shown are the ThingSpeak Client Name, Username, and Password.
If users configure the DataLogger IoT to always include the device address with the device names (i.e. /Settings/Application Settings with Device Names=1), you will need to match the device names for BME688 and BME680 that were loaded on startup as BME68x [x76] and BME68x [x77], respectively. Note the BME688 device name included a space and [x76] in this case. Remember, we are only interested in plotting hte BME688 and BME680 in this case so we will ignore the MAX17048 that was loaded on startup.
+
+
+
+
+
+
+
+
DataLogger IoT Device Names Loaded during Startup
+
Device Name and Channel for Both Sensors with Respective Addresses
+
+
+
+
Again, the alternative to using the menu system is the JSON file. In this case, we updated channels for the BME688 and BME680. We also included the address name for the BME688 like the configuration menu. Not shown are the ThingSpeak Client Name, Username, and Password.
Save the configuration to persistent memory and exit out of the configuration menu. Wait a few seconds for the DataLogger IoT to read the sensors and output the readings to the Serial Terminal. Open ThingSpeak channels in separate browser windows. In this case, we had the BME688 and the BME680 in private view. You should see sensor readings update and plot on the charts.
+
+
+
+
+
+
+
ThingSpeak Graphing the BME688 and BME680 in Seperate Channels on Two Browser Windows
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.
+
+
+
+
+
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.
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.
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.
+
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.
+
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.
+
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.
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 page for some initial troubleshooting.
+
If part of the design is confusing, please open an issue and let us know.
+
Did we forget to include an important function of the board?
+
+
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.)
+
If part of the board's functionality is missing, please open an issue and file a feature request.
+
+
Do you wish to contribute directly to improving the board design?
+
+
With a GitHub account, Fork this repo
+
Add your design improvement(s)
+
File a pull request with your changes, and enjoy making the wordsworlds world a better place.
+
Once received, the engineer in charge of the original design will automatically be notified.
+
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.)
In this section, we will go over how to connect to the SparkFun DataLogger IoT. At the time of writing, we used the DataLogger IoT - 9DoF. This hardware hookup explained in this section also applies for the DataLogger IoT.
+
Soldering to the PTHs
+
+
Note
+
The UART, SPI, analog, and digital I/O pins are not currently supported in the firmware for data logging.
+
+
For users that are interested in soldering to the edge of the board, we recommend soldering headers to the PTHs on the breakout for a permanent connection and using jumper wires. Of course, you could also solder wires to the breakout board as well. For a temporary connection during prototyping, you can use IC hooks like these.
If all you want to do is display your sensor readings in a serial terminal or monitor (connected via USB-C) then, strictly, you don’t need to add a microSD card. But of course the whole point of the DataLogger IoT is that it can log readings from whatever sensors you have attached to microSD card. The data is logged in easy-to-read Comma Separated Value (CSV) text format by default. You can also set the format as JSON.
+
You probably already have a microSD card laying around but if you need any additional units, we have plenty in the store. The DataLogger IoT can use any size microSD card as long as it is formatted correctly. Please ensure your SD card is formatted correctly. There are different software tools available. Some are built into your operating system. We recommend using the Raspberry Pi Imager Tool to easily format the memory card as FAT32 using the GUI. Flip over the DataLogger IoT and you’ll see the latching microSD card socket. Slide in your formatted SD card and it will click neatly into place. Part of the edge of the SD card will stick out when fully inserted in the microSD card socket.
+
+
+
+
+
+
+
+
+
You should only insert or remove the SD card while the power is turned off or disconnected. Removing the card while the DataLogger IoT is logging will almost certainly corrupt your data. You can tell when the board has just logged by observing the addressable RGB LED. When enabled, the LED will blink blue after it has logged one data point.
+
After you’ve logged some data, you will find a new file on your SD card. There may also be additional files if you manually saved the firmware or preferences to the memory card.
+
+
sfe0001.txt: This is the file that contains the CSV or JSON sensor data. The format will depend on how you configured the DataLogger's output. We use .TXT as the file type so that your computer can open it in a simple text editor. The contents are all human-readable. But, if you want to, you can rename it as .CSV or .JSON instead. The file number is incremented for the next logging session.
+
datalogger.json: This file only appears when you save the settings as your fallback storage. The file will include all preferences saved for any connected device, WiFi credentials, certificates, and keys.
+
SparkFun_DataLoggerIoT*.bin: This file only appears when you save the firmware to the microSD card. Note that the asterisk (*) is the firmware version number (i.e. SparkFunDataLoggerIoT_01.00.01.bin).
+
+
To remove the microSD card, make sure power is disconnected from the DataLogger IoT. Then press the microSD card into the microSD socket. The memory card will be ejected and you will hear a click again. Once the card is ejected, you can insert it into a microSD card adapter or USB reader to be read on a computer.
+
+
+
+
+
+
+
+
+
Qwiic Sensors
+
If you are going to attach extra sensors or any Qwiic-enabled device to the DataLogger IoT, then those need to be connected first before attaching a USB cable. It is a good idea to only attach or disconnect Qwiic sensors when the power is turned off or disconnected. The Qwiic bus is pretty tolerant to “hot swapping”, but: disconnecting a sensor while it is in use will confuse the DataLogger IoT software (most likely each value associated with the device will remain constant); and a new sensor won’t be detected until the firmware restarts.
+
Plug one end of your Qwiic cable into the DataLogger IoT and plug the other end into your sensor. If you want to add extra sensors, you can simply connect them to each other in a daisy chain. You will need a Qwiic cable for each sensor. Our Qwiic Cable Kit covers all the options.
+
+
+
+
+
+
+
+
DataLogger IoT and a Qwiic-Enabled Device
+
DataLogger IoT and several Qwiic-Enabled Devices Daisy Chained
+
+
+
+
+
Our Qwiic sensors usually all have power indicator LEDs and I2C pull-up resistors. Depending on your application, you may want or need to disable these by cutting the jumper links on the sensor circuit boards. We have a tutorial that will show you how to do that safely.
+
Sometimes you might want to connect more than one of the same type of sensor to the DataLogger IoT. On the I2C bus, each device needs to have a unique address. On many of our boards, there are jumpers links which you can use to change the address and some have addresses that can be configured in software. But there are some where you cannot change the address - the NAU7802 Qwiic Scale being one example.
+
Typically one would use a multiplexor. However, we currently do not have the DataLogger IoT configured to work with any multiplexors (i.e. Qwiic Mux Breakout).
+
+
Note
+
Currently the Qwiic Mux is not compatible with the DataLogger IoT.
+
+
LiPo Battery
+
+
Battery Polarity
+
Please make sure that you use one of our recommended Lithium Ion batteries. Some batteries use the same JST connector as ours but have the opposite polarity. Connecting one of these to your DataLogger IoT will destroy it. If you are going to use your own battery, it is up to you to ensure it has the correct polarity.
+
+
Now is a good time to attach a LiPo battery, if you want the DataLogger IoT to keep logging when you disconnect USB-C.
+
+
+
+
+
+
+
+
+
You can connect one of our standard single cell LiPo batteries to the DataLogger IoT and power it for hours, days or weeks depending on what sensors you have attached and how often you log data. The DataLogger IoT has a built-in charger too which will charge your battery at 500mA when USB-C is connected. Please make sure your battery capacity is at least 500mAh (0.5Ah); bad things will happen if you try to charge our smallest batteries at 500mA. The yellow CHG charging LED will light up while the battery is charging and will go out once charging is complete.
+
+
Warning
+
The MCP73831 charge IC on the board is used on a few SparkFun products. For more information about the CHG status LED, we recommend taking look at the Hardware Overview. We also recommend taking a look at this tutorial for Single Cell LiPo Battery Care.
+
+
USB Cable
+
The USB-C connector provides power to the DataLogger IoT and acts as a serial interface for configuration and data display.
+
+
+
+
+
+
+
+
+
If you are going to use a microSD card to store your data, and why wouldn’t you, then insert that first before attaching your USB cable. You should only insert or remove the SD card while the power is turned off or disconnected. Removing the card while the DataLogger IoT is logging will almost certainly corrupt your data.
+
Likewise, it is a good idea to only attach or disconnect Qwiic sensors when the power is turned off or disconnected. The Qwiic bus is pretty tolerant to “hot swapping”, but: disconnecting a sensor while it is in use will confuse the DataLogger IoT software; and a new sensor won’t be detected until the firmware restarts.
+
Depending on what ports your computer has available, you will need one of the following cables:
Use the cable to connect your DataLogger IoT to your computer and you will see the LEDs light as the DataLogger IoT starts up. The addressable RGB RGB LED will light up green for a second or two while the DataLogger IoT configures itself. It will flash blue while data is being logged to the microSD card. If you have jumped the gun and have a LiPo battery already connected, the yellow CHG charging LED may light up too.
+
If the addressable RGB LED does not light up, your DataLogger IoT is probably in deep sleep following a previous logging session. Pressing the RST reset button will wake it.
+
You’ll find full instructions on how to configure the DataLogger IoT later in this tutorial.
+
Standoffs
+
For users interested in stacking the Qwiic-enabled device on the DataLogger IoT or mounting in an enclosure, you will need some standoffs to mount the boards. When mounting, note that all four mounting holes are not positioned exactly for a 1.0"x1.0" sized Qwiic board. Only two of the four mounting holes are compatible for a 1.0"x1.0" sized Qwiic board. For example the image below shows the boards stacked on each side of the DataLogger IoT. On top, the Qwiic GPS (SAM-M10Q) breakout was also able to stack by rotating the board slightly and aligning the mounting holes on the 1.6"x1.6" sized board to the other mounting holes
In this section, we will highlight the hardware and pins that are broken out on the SparkFun DataLogger IoT. At the time of writing, we highlighted the SparkFun DataLogger IoT - 9DoF. However, this also applies for the SparkFun DataLogger IoT.
+
+
+
+
+
+
+
+
DataLogger IoT - 9DoF (Top View)
+
DataLogger IoT - 9DoF (Bottom View)
+
+
+
+
+
The SparkFun DataLogger is pretty much the same with the exception of the following features listed below. We'll include notes highlighting the differences in each section.
+
+
No built - in 6DoF IMU - ISM330DHCX
+
No built - in magnetometer - MMC5983
+
The addressable RGB LED - WS2812 is replaced with the side emitting addressable RGB LED - B3DQ3BRG
+
No IMU INT2 jumper
+
No Mag INT jumper
+
Included MEAS PTH Jumper
+
The "35 / A7" PTH on the edge of the board is replace with a "5" PTH.
+
+
+
+
+
+
+
+
+
+
+
DataLogger IoT (Top View)
+
DataLogger IoT (Bottom View)
+
+
+
+
+
ESP32-WROOM Module
+
The DataLogger IoT is populated with Espressif's ESP32-WROOM-32E module. Espressif's ESP32 WROOM ubiquitous IoT microcontroller is a powerful WiFi, BT, and BLE MCU module that targets a wide variety of applications. For the DataLogger IoT, the firmware currently utilizes the WiFi feature.
+
+
+
+
+
+
+
+
+
+
Note
+
Currently the DataLogger IoT does not have BT or BLE. However, BT or BLE is being considered on a future firmware build to include this as a feature.
+
+
Power
+
There are a variety of power and power-related nets broken out to connectors and through hole pads. Below list a few methods of powering the board up. There are protection diodes for the USB-C, 5V pin, and single cell LiPo battery. Power is regulated down to 3.3V for the system voltage. Depending on the settings and what is connected to the DataLogger IoT, the board can pull a minimum of 200µA in low power mode by itself.
+
+
USB-C
+
5V Pin
+
Single Cell LiPo Battery
+
3V3 Pin
+
+
USB-C and 5V
+
The DataLogger IoT comes equipped with a USB type C socket which you can use to connect it to your computer to view the output and configuration through the serial terminal, or plug in a USB-C power supply. The DataLogger IoT includes the configuration channel resistors needed to tell the power supply to deliver 5V. You can use your USB-C laptop charger as the power source should you need to, even though it normally delivers a much higher voltage.
+
There is also a 5V power input pin. You can use this to feed in 5V power from an external source. The maximum voltage is 6.0V. The 5V pin is diode-protected and so is the USB-C power input, so it is OK to have both connected at the same time. This pin is ideal if you want to power your DataLogger from regulated solar power or a different type of power supply. You can not use the 5V pin as an output.
+
+
+
+
+
+
+
+
+
+
+
+
Voltage from the USB is regulated down to the XC6222 3.3V/700mA voltage regulators for the system voltage and Qwiic-enabled devices. USB power is also connected to the MCP73831 to charge a single cell LiPo battery at a default rate of 500mA.
Battery Polarity: Please make sure that you use one of our recommended Lithium Ion batteries. Some batteries use the same JST connector as ours but have the opposite polarity. Connecting one of these to your DataLogger IoT will destroy it. If you are going to use your own battery, it is up to you to ensure it has the correct polarity.
+
+
But of course you’re going to want to use the DataLogger IoT to log sensor data while on the move too. You can connect one of our standard single cell LiPo batteries to the DataLogger IoT and power it for hours, days or weeks depending on what sensors you have attached and how often you log data. The DataLogger IoT uses the built-in MCP73831 charger too which will charge your battery at 500mA when USB-C is connected. Please make sure your battery capacity is at least 500mAh (0.5Ah); bad things will happen if you try to charge our smallest batteries at 500mA. The board also includes the MAX17048 LiPo Fuel Gauge which allows you to determine how much power your LiPo battery has available. The 2-pin JST connector pins are broken out to PTHs on the edge of the board if you decide to solder a single cell LiPo battery directly to the board or power another device.
+
+
+
+
+
+
+
+
+
+
3V3 Pins
+
For those going the old school route, you can also bypass the voltage regulators by soldering directly to the 3V3 and GND pin to provide power if your application has a regulated 3.3V. Note that this is only connected to the system voltage. You will also need to provide power to the 3V3 SWCH or Qwiic-enabled devices should you decide to bypass the voltage regulator.
+
+
+
+
+
+
+
+
+
+
CH340 USB-to-Serial Converter
+
The top side of the board includes a CH340 USB-to-Serial Converter. The chip can be used to send serial data between the device and computer. You can view the output or configure the device through a serial terminal.
+
+
+
+
+
+
+
+
+
The driver should automatically install on most operating systems. However, there is a wide range of operating systems out there. You may need to install drivers the first time you connect the chip to your computer's USB port or when there are operating system updates. For more information, check out our How to Install CH340 Drivers Tutorial.
The hardware serial UART pins are broken out on the edge of the board. For more information about Serial UART, check out the tutorial about Serial Communication for more information.
+
+
TXD: UART transmit pin. This is connected to pin 16.
+
RXD: UART receive pin. This is connected to pin 17.
+
+
+
Note
+
The UART pins are not currently supported in the firmware for data logging.
+
+
+
+
+
+
+
+
+
+
+
Qwiic and I2C
+
+
Note
+
You may notice a thin film over the vertial Qwiic connector. This is used by a pick-and-place machine when populating the component on the board before it goes through the reflow oven. This can be removed if you decide to use the vertical Qwiic connector with Qwiic-enabled devices.
+
+
SparkFun's Qwiic Connect System uses 4-pin JST style connectors to quickly interface development boards with I2C sensors and more. No soldering required and there's no need to worry about accidentally swapping the SDA and SCL wires. The Qwiic connector is polarized so you know you’ll have it wired correctly every time, right from the start. Qwiic boards are daisy chain-able too so you can connect multiple sensors to the DataLogger IoT and log readings from all of them.
+
The board is populated with vertical and horizontal Qwiic connectors. These are also broken out to PTHs on the edge of the board.
+
+
+
+
+
+
+
+
+
+
+
SCL: I2C clock pin. This is connected to pin 22 and a 2.2kΩ pull-up resistor.
+
SDA: I2C data pin. This is connected to pin 21 and a 2.2kΩ pull-up resistor.
+
3V3 SW: The 3.3v pin is connected to the XC6222 voltage regulator's output to power the Qwiic devices.
+
GND: Common, ground voltage (0V reference) for the system
+
+
Connected to the line I2C line is the MAX17048 LiPo fuel gauge (7-bit unshifted address = 0x36).
+
Sometimes you might want to connect more than one of the same type of sensor to the DataLogger IoT. On the I2C bus, each device needs to have a unique address. On many of our boards, there are jumpers links which you can use to change the address and some have addresses that can be configured in software. But there are some where you cannot change the address. Typically, one would use a multiplexor. However, we currently do not have the DataLogger IoT configured to work with any multiplexors (i.e. Qwiic Mux Breakout).
+
+
Note
+
Currently the Qwiic Mux is not compatible with the DataLogger IoT.
+
+
The DataLogger IoT includes a dedicated 3.3V regulator for the Qwiic connector. This has several advantages including:
+
+
The DataLogger IoT can completely power-down the I2C sensors during sleep to prolong your battery life
+
There’s no risk of the Qwiic bus gulping too much current and causing problems for the ESP32
+
+
SPI
+
+
Note
+
Besides the built-in ISM330DHCX and MMC5983MA, the SPI pins are not currently supported in the firmware for data logging.
+
+
The SPI pins are broken out on the edge of the board. For those that are unfamiliar to PICO and POCI, check out the SPI tutorial for more information.
+
+
SCK: SPI clock pin. This is connect to pin 18.
+
PICO: SPI Peripheral In Controller Out. This is connected to pin 23.
+
POCI: SPI Peripheral Out Controller In. This is connected to pin 19.
+
+
+
+
+
+
+
+
+
+
+
Not shown in the image are the chip select (CS) pins. The 6DoF IMU's CS pin is connected to pin 5. The magnetometer's CS pin is connected to pin 27 which is not broken out.
+
+
Note
+
On the DataLogger IoT, the IMU and magnetometer are not connected to the SPI port since they are not included on the board. Instead of pin "35 / A7" being broken out, pin "5" is broken out on the edge of the board.
+
+
+
+
+
+
+
+
+
+
MicroSD Card Socket
+
The DataLogger IoT supports full 4-bit SDIO for fast logging and uses common microSD cards to record clear text, comma separated files. Flip over the DataLogger IoT and you'll see the latching microSD card socket. You probably already have a microSD card laying around. However, if you need any additional units, we have plenty in the SparkFun catalog. The DataLogger can use any size microSD card and supports FAT32 cards in addition to FAT16. Please ensure that your SD card is formatted correctly; we recommend the Raspberry Pi Imager Tool.
+
+
+
+
+
+
+
+
+
Slide in your formatted SD card and it will click neatly into place. The edge of the SD card will stick out on the edge of the circuit board when it is inserted correctly.
+
+
Warning
+
You should only insert or remove the SD card while the power is turned off or disconnected. Removing the card while the DataLogger IoT is logging will almost certainly corrupt your data.
+
+
9 Degrees of Freedom (9DOF)
+
As stated earlier, included on every DataLogger IoT - 9DoF is a 6DoF Inertial Measurement Unit (IMU) for built-in logging of triple-axis accelerometer and gyro. There is also a built-in triple-axis magnetometer for a complete 9 degrees of freedom. Beside each IC is a silkcreen showing the reference axis. Both are connected to the ESP32 via the SPI port. Combined, you have 9 degrees of inertial measurement! Whereas the original 9DOF Razor used the old MPU-9250, this uses the ISM330DHCX and MMC5983MA. Oh, and if that wasn’t enough, it comes with a built-in temperature sensor on each IC too. So if you want to use the DataLogger IoT as a transportation logger, it will do that straight out of the anti-static bag!
+
+
+
+
+
+
+
+
+
+
Note
+
For users using the SparkFun DataLogger, there 6DoF IMU and magnetometer is not populated on the board. The associated silkscreen and jumpers for the sensors are also not included on the board.
+
+
+
+
+
+
+
+
+
+
+
+
Analog Pins
+
+
Note
+
The analog pins are not currently supported in the firmware for data logging.
+
+
There are three 12-bit analog pins available and broken out on edge of the board.
+
+
36 / A0: Analog A0. This is connected to pin 36.
+
39 / A3: Analog A3. This is connected to pin 39.
+
35 / A7: Analog A7. This is connected to pin 35.
+
+
+
+
+
+
+
+
+
+
+
+
Note
+
Instead of pin "35 / A7" being broken out on the DataLogger IoT, pin "5" is broken out on the edge of the board.
+
+
+
+
+
+
+
+
+
+
Reset and Boot Buttons
+
+
Note
+
You may notice a thin film over buttons. This is used by a pick-and-place machine when populating the component on the board before it goes through the reflow oven. This can be removed.
+
+
There are two buttons available on the board for reset and boot. These are also broken out on the edge of the board as PTHs. If you have your DataLogger IoT mounted in an enclosure, you can also attach an external boot or reset switch too. Any Single Pole Normally-Open Push-To-Close momentary switch will do. Solder pin headers or wires to the RST and GND breakout pins and connect your external switch to those.
+
+
RESET: Pressing this button will pull the pin LOW and reset the program running on the ESP32 without unplugging the board.
+
BOOT: The boot button usually allows users to force the ESP32 into bootloader mode to manually flash new firmware to the ESP32. The ESP32 will remain in this mode until there is a power cycle or the reset button is pressed. As of firmware v01.00.02, this button has an extra function: pressing down on the user button for 20 seconds will erase on-board preference storage and restart the board. This is connected to pin 0 on the ESP32.
+
+
+
+
+
+
+
+
+
+
+
Like other ESP32 development boards, these buttons are populated so that users can place the ESP32 module in bootloader mode. For users that need to place the board in bootloader mode when powered, you will need to:
+
+
Press the BOOT button.
+
While holding on the BOOT button, press the RESET button momentarily.
+
Finally, release the BOOT button.
+
+
Most of the time, users will simply have the board executing the firmware that is loaded on the ESP32 module and updating through the configuration menu either through the microSD card or OTA.
+
+
Danger
+
Please think very carefully before uploading any Arduino sketches to your DataLogger IoT.
+
You will overwrite the DataLogger IoT firmware, leaving it unable to update or restore itself.
+
The 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.
+
Really. We mean it.
+
+
LEDs
+
There are three LEDs populated on the board. These can be disabled with their respective jumpers on the back of the board.
+
+
STAT: The status LED is connected to pin 25.
+
RGB: The WS2812-2020 RGB addressable LED is connected to pin 26. In addition to being disabled through the jumper on the back, you can also disable the LED through software. The following colors represent different states that the board is in.
+
White: A solid white LED indicates that the board is currently being configured through the configuration menu.
+
Green: A solid green LED indicates that the board is initializing. As of firmware v01.00.02, the LED blinks green when on battery power indicating that the battery level is VBATT > 50%.
+
Blue: A blinking blue LED indicates that the board is reading sensor data and logging the values.
+
Yellow: A solid yellow LED indicates that a firmware update is in progress. As of firmware v01.00.02, the LED blinks yellow when on battery power indicating that the battery level is between 50% > VBATT > 10%.
+
Red: As of firmware v01.00.02, the LED blinks red when on battery power indicating that the battery level is VBATT < 10%.
+
+
+
CHG: The on-board yellow CHG LED can be used to get an indication of the charge status of your battery. Below is a table of other status indicators depending on the state of the charge IC.
+
+
+
+
+
Charge State
+
LED status
+
+
+
No Battery
+
Floating (should be OFF, but may flicker)
+
+
+
Shutdown
+
Floating (should be OFF, but may flicker)
+
+
+
Charging
+
ON
+
+
+
Charge Complete
+
OFF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Note
+
On the DataLogger IoT, we included the B3DQ3BRG addressable RGB LED instead of the WS2812 with the light emitting from the top of the IC. This side emitting LED uses the same protocol as the WS2812 and was a design choice for users placing the board in an enclosure.
+
+
+
+
+
+
+
+
+
Jumpers
+
There are seven jumpers on the back of the DataLogger IoT - 9DoF. For more information, check out our tutorial on working with jumper pads and PCB traces should you decide to cut the traces with a hobby knife.
+
+
SHLD: This jumper connects the USB Type C connector's shield pin to GND. Cut this to isolate the USB Type C connector's shield pin.
+
I2C: This three way jumper labeled as I2C are closed by default. By cutting the jumpers, it will disconnect the 2.2kΩ pull-up resistors for the I2C bus. Most of the time you can leave these alone unless your project requires you to disconnect the pull-up resistors.
+
STAT: This jumper connects the status LED to pin 25 and it is closed by default. Open the jumper to disable the LED.
+
RGB: This jumper connects the WS2812-2020 RGB addressable LED to pin 26 and it is closed by default. Open the jumper to disable the LED.
+
CHG: This jumper connects the charge LED on the MCP73831 charge IC and it is closed by default. Open the jumper to disable the LED.
+
IMU INT2: This jumper connects the ISM330DHCX IMU's interrupt pin to pin 35 and it is open by default. Add a solder jumper to connect.
+
MAG INT: This jumper connects the MMC5983MA magnetometer's interrupt pin to pin 35 and it is open by default. Add a solder jumper to connect.
+
+
+
+
+
+
+
+
+
+
+
Note
+
On the DataLogger IoT, the IMU INT2 or MAG INT jumpers are not included since it does not have the built in 6DoF IMU or magnetometer. With the extra real estate on the board, we were able to include a MEAS PTH and jumper on the board. By default, the jumper is closed. You can cut this jumper on the bottom side of the board to measure the DataLogger IoT’s current draw from external power.
+
+
+
+
+
+
+
+
+
+
Board Dimensions
+
The overall length and width with the antenna connector is about 1.66" x 2.00". There are four mounting holes in the center of the board. Due to the size of the board and the ESP32 module, the mounting holes are positioned in a way for users to add two Qwiic enabled boards with a width of 1.0" instead of one Qwiic board.
The SparkFun DataLogger IoT is a data logger that comes preprogrammed to automatically log IMU, GPS, and various pressure, humidity, and distance sensors. All without writing a single line of code! They come in two flavors: The SparkFun DataLogger IoT - 9DoF and the SparkFun DataLogger IoT. Both versions of the DataLogger IoT automatically detects, configures, and logs Qwiic sensors. It was specifically designed for users who just need to capture a lot of data to a CSV or JSON file, and get back to their larger project. Save the data to a microSD card or send it wirelessly to your preferred Internet of Things (IoT) service!
Please make sure that you use one of our recommended Lithium Ion batteries. Some batteries use the same JST connector as ours but have the opposite polarity. Connecting one of these to your DataLogger IoT will destroy it. If you are going to use your own battery, it is up to you to ensure it has the correct polarity.
+
+
To follow along with this tutorial, you will need the following materials. You may not need everything though depending on what you have. Add it to your cart, read through the guide, and adjust the cart as necessary.
Straight out of the box anti-static bag, the DataLogger IoT is ready to log data from its built-in ISM330DHCX Inertial Measurement Unit (IMU) and MMC5983MA magnetometer. Only want to log magnetometer, accelerometer, gyro or temperature data? You’re good to go! But the fun is only just beginning…
+
The DataLogger IoT is preprogrammed to automatically log data from all of the following sensors, so you may wish to add one or more of these to your shopping cart too. (More sensors are being added all the time and it is really easy to upgrade the DataLogger IoT to support them. But we'll get to that in a moment!). Currently, auto-detection is supported on the following Qwiic-enabled products (with the exception of the ISM330DHCX and MMC5983 which is built-in on the SPI port):
+
+
Note
+
For a list of supported devices based on the firmware, you can check out the list of supported Qwiic Devices in the appendix. We simply categorized the supported devices below based on the type.
+
+
+
Any u-Blox GNSS Modules (Lat/Long, Altitude, Velocity, SIV, Time, Date) such as:
Not all microSD cards are created equal. The capacity, read/write speed, and format 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.
+
Checking MicroSD Card Format
+
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.
+
Checking MicroSD Card Format - Windows
+
To check to see if it is the correct format on a Windows you could head to the drive, right click, and select Properties.
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.
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.
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. 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.
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.
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.
+
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.
+
New Feature – Arduino IoT Cloud Connectivity
+
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.
+
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.
+
+
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.
+
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.
+
With the combination of the DataLogger IoT, qwiic and Arduino IoT Cloud, creating a IoT dashboard is as easy as Plug-in, Connect, Plot!
+
New qwiic Sensor Board Support
+
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.
+
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.
+
+
SparkFun Indoor Air Quality Sensor - ENS160
+
SparkFun Photoacoustic Spectroscopy CO2 Sensor - PASCO2V01
+
SparkFun Human Presence and Motion Sensor - STHS34PF80
+
SparkFun Tristimulus Color Sensor - OPT4048DTSR
+
SparkFun Triad Spectroscopy Sensor - AS7265x
+
SparkFun 6DoF IMU Breakout - BMI270
+
+
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.
+
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!
+
Feature Improvements
+
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:
+
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.
+
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.
+
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.
+
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.
+
Bug Fixes
+
We also squashed a variety of defects in the firmware. Some of the more notable issued fixed in this release:
+
+
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!
+
Improved runtime memory (ram) consumption
+
Resolved issues with devices having the same name. Now the second device adds it* address to the name.
+
Improvements to the Machinechat IoT driver
+
+
In Summary
+
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.
+
And this new functionality is available today at the DataLogger repo. 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.
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.
+
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.
+
New Features and Enhancements
+
Log File Download via a Web Interface
+
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.
+
+
Currently file browse and download options are available, but we plan on expanding this feature in the future.
+
Additionally, this feature has the following options:
+
+
mDNS functionality allowing you to set a network name for a device if mDNS is supported on your network
+
Username/Password authentication for the web interface.
+
+
+
Note: For authentication use - currently some browsers might require a second login depending on settings.
+
Note:
+The datalogger requires restarting if the web interface is enabled
+
+
This feature is enabled in settings under the Preview heading.
+
Startup Command Menu and Delay
+
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.
+
Startup Menu options:
+
Pressing the highlighted letter while the menu is active, will change the behavior of the system. This change only affects the current system session.
+
The options include:
+
+
'n' - Normal startup
+
'a' - Disable I2C device auto load on startup
+
'l' - List the I2C devices supported. This device table is discarded after auto-load
+
'w' - Disable WiFi
+
's' - Disable preference restore during startup
+
+
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.
+
Quick (!) Commands
+
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.
+
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.
+
The following commands are supported:
+
+
+
+
command
+
Description
+
+
+
+
+
!about
+
Display the system about page
+
+
+
!clear-settings
+
Clear the on board system preferences with a yes/no prompt
+
+
+
!clear-settings-forced
+
Clear the on board system preferences with no prompt
+
+
+
!devices
+
List the currently connected devices
+
+
+
!factory-reset
+
Perform a factory reset - presents a Y/N prompt
+
+
+
!heap
+
Display the current system heap memory usage
+
+
+
!help
+
List the available quick commands
+
+
+
!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
+
+
+
!log-now
+
Perform a log observation event
+
+
+
!log-rate
+
If log rate measurement is enabled, the current log rate is printed
+
+
+
!reset-device
+
Reset the device - erasing any saved settings and restarting the device
+
+
+
!reset-device-forced
+
Reset the device, but without a Y/N prompt
+
+
+
!restart
+
Restart the device
+
+
+
!restart-forced
+
Restart the device without a Y/N prompt
+
+
+
!save-settings
+
Save the current settings to on-board flash
+
+
+
!sdcard
+
Output the current SD card usage statistics
+
+
+
!systime
+
Output current system time
+
+
+
!uptime
+
The uptime of the device
+
+
+
!device-id
+
The ID for the device
+
+
+
!version
+
The version of the firmware
+
+
+
!wifi
+
Output current system WiFi state
+
+
+
+
Log Data Rate
+
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.
+
System Info in the log stream
+
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.
+
Currently the following information is provided:
+
+
WiFi SSID
+
WiFi RSSI
+
Memory Heap free space in bytes
+
SD Card free space in bytes
+
Uptime in MS
+
+
Feature Improvements
+
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:
+
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.
+
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.
+
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.
+
Improved Device Auto-Load – A major update to the I2C auto-load device detection logic that improves device detection and address collision prevention.
+
General System Enhancements – Internal system job dispatch subsystem update to increase performance throughput. Overall decrease in static and dynamic memory usage.
+
Bug Fixes
+
We also squashed a variety of defects in the firmware. Some of the more notable issued fixed in this release:
+
+
Fixed issue with the LED display logic that caused a system crash if the log interval was less than 100ms
+
Incorporate driver updates for greater NAU7802 device output value stability
+
Incorporate driver update for the MMC5983MA device
+
+
In Summary
+
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.
+
And this new functionality is available today at the DataLogger repo. 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.
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:
Configuring the settings is as easy as opening a serial menu. You can use any serial monitor or terminal emulator to quickly and easily change and store the DataLogger IoT settings via its USB-C interface.
There are plenty of free alternatives out there to configure the DataLogger IoT. For the scope of this tutorial we will be using Tera Term.
Tera Term (Windows)
RealTerm (Windows)
Minicom (Linux, Unix, MacOS)
Screen (Linux, Unix, MacOS)
Note
You will need a serial terminal client that supports edit characters. Most if not all modern serial terminal programs will have the ability to support interactive edits. Unfortunately, we have not had any success with CoolTerm. We have tested the DataLogger IoT with Tera Term, Minicom, and Screen.
If this is the your first time using a terminal window, We recommend checking out the tutorial below for more information on serial terminal basics.
Serial Terminal Basics
The above guides will show you how to open the correct port for the DataLogger IoT and how to set the baud rate to 115200 baud. You can change the DataLogger IoT's baud rate through the configuration menus too should you need to.
Note
For users with an Arduino IDE, you could also use the Arduino Serial Monitor by setting the line ending to Newline. Users will also need to CTRL + Enter when sending any character to the DataLogger IoT. However, we recommend using one of the terminals mentioned earlier.
"},{"location":"configuration/#initialization-and-serial-output","title":"Initialization and Serial Output","text":"
Connect the DataLogger IoT to a USB cable and connect to your computer. The addressable RGB LED will light up green as it initializes. As of firmware v1.0.2.00 - build 00013e, a Startup Menu was added to the system. This allows you to change the behavior of the DataLogger at start-up. This change only affects the current system session.
'n' \u2014 Normal startup
'a' \u2014 Disable I2C device auto load on startup
'l' \u2014 List the I2C devices supported. This device table is discarded after auto-load
'w' \u2014 Disable WiFi
's' \u2014 Disable preference restore during startup
Note
The amount of time the start-up menu is displayed is adjustable. This settings can be configured in the Settings/Application Settings page, under the Advanced section.
You should see the following output when the board initializes:
The messages in the serial terminal provide us with the DataLogger's configuration and will vary depending on the firmware version that is loaded on the board.
The DataLogger IoT software version (in this case is v01.02.00 - build 00013e).
As the DataLogger IoT is initializing, the system settings are being restored from the last saved preference.
There no WiFi credentials and the board has failed to connect. This output will change once you provide the WiFi credentials and are able to connect to the network.
There are 3x devices currently detected and they are connected through I2C through the Qwiic port and SPI. These are the on-board sensors for the DataLogger IoT. There may be more devices that are detected depending on the firmware and what is connected to the ports. Since these were recognized, they were loaded onto the DataLogger IoT.
The current date and time is shown (by default), the date and time is set to 1-1-1970 and 00:00:00). This value will change depending on the clock source through NTP, RTC, or a u-blox GNSS module.
The time the board has been running will be shown in the uptime.
The primary external time source that the board syncs is currently through the NTP client. This can be configured depending on your clock source.
The board name (in this case, it was SparkFun DataLogger IoT - 9DoF)
The board ID (in this case, it was SFD16C8F0D1AD6B8)
The microSD card has been found, the type of memory card it is, the size of the memory card, how much memory is used, and how much is available.
If there is a WiFi network name saved, the SSID will be shown along with information indicating whether the board was able to connect to the WiFi network. By default there is no SSID saved in memory.
If there is a battery connected, the LiPo Battery Fuel Guage will indicate if there is one attached to the board.
Parameters for low power mode will be provided indicating if deep sleep is enabled, sleep interval, and wake interval.
Parameters for logging are also provided for the logging interval, the format for the serial output, format for the microSD card, current saved filename, and file rotation period.
The board will also show the available IoT services that are enabled for the DataLogger IoT.
Current settings to download log files via a web interface (included in firmware v01.02.00)
Supported devices through Qwiic or SPI will be listed if they are connected.
The output will finish by telling you what devices are connected to the DataLogger IoT again.
Note
As of firmware v01.02.00, there is also a compact mode! By adjusting the setting, the ESP32 will output less at startup. This settings can be configured in the Settings/Application Settings page, under the Advanced section.
Once the DataLogger IoT has initialized, the DataLogger IoT will begin outputting comma separated values (CSV). This is the default output that is set for the DataLogger IoT - 9DoF. Of course, you will not have as many readings on the DataLogger IoT since the 6DoF IMU and magnetometer are not populated on that version of the board.
Note
Depending on your DataLogger IoT preferences, your device may output as a JSON format like the image shown below.
The data scrolling up the screen show what each device's output is along with their associated unit if it is available. Your mileage will vary depending on the board version that you have and what device is connected:
MAX17048.Voltage (V)
MAX17048.State of Charge (%)
MAX17048.Charge Rate (%/hr)
ISM330.Accel X (milli-g)
ISM330.Accel Y (milli-g)
ISM330.Accel Z (milli-g)
ISM330.Gyro X (milli-dps)
ISM330.Gyro Y (milli-dps)
ISM330.Gyro Z (milli-dps)
ISM330.Temperature (C)
MMC5983.X Field (Gauss)
MMC5983.Y Field (Gauss)
MMC5983.Z Field (Gauss)
MMC5983.Temperature (C)
The output will vary depending on what is connected so you may get additional readings in the output and it may not be in the following order listed above. The logging rate defaults to about 0.067Hz (or 15000ms), so as the data scrolls past, you will see the last value settle at about 0.067Hz.
Right! Let's open the main menu by pressing on any key in the serial terminal program.
You will be prompted with a few options. Once in the configuration menu, all three colors of the addressable RGB LED will turn on to produce the color white indicating that you are navigating through the menu. Before we dive into the settings, lets check out a few commands and saving settings.
As of firmware v01.02.00, commands can be executed directly from the serial console thus bypassing the serial menu system! The following commands are supported.
Quick Command Command Description !about Display the system about page !clear-settings Clear the on board system preferences with a yes/no prompt !clear-settings-forced Clear the on board system preferences with no prompt !devices List the currently connected devices !factory-reset Perform a factory reset - presents a Y/N prompt !heap Display the current system heap memory usage !help List the available quick commands !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 !log-now Perform a log observation event !log-rate If log rate measurement is enabled, the current log rate is printed !reset-device Reset the device - erasing any saved settings and restarting the device !reset-device-forced Reset the device, but without a Y/N prompt !restart Restart the device !restart-forced Restart the device without a Y/N prompt !save-settings Save the current settings to on-board flash !sdcard Output the current SD card usage statistics !systime Output current system time !uptime The uptime of the device !device-id The ID for the device !version The version of the firmware !wifi Output current system WiFi state
Typing a quick command and hitting the Enter button will result in the DataLogger IoT executing the command without the need to go through the menu system. Below is an example showing the !about quick command being sent and then executing the command as the DataLogger IoT is outputting CSV values to the serial terminal.
"},{"location":"configuration/#exiting-and-saving","title":"Exiting and Saving","text":"
When exiting the menus, you will be prompted with either an x or b. You can use either character when exiting the menus as well as X or B. Note that you will need to use either of these keys when making a change in order for the DataLogger IoT to save any changes in memory. Make sure that you receive the following message indicating that the settings were saved: [I] Saving System Settings. The DataLogger IoT will the continue reading the devices and outputting the readings through the serial terminal.
You can also use any of your Esc or arrow keys (i.e. \u2191, \u2193, \u2190, \u2192) to exit. However, using the escape or arrow keys will not save any changes in memory once the reset button is hit or whenever power is cycled.
"},{"location":"configuration/#timeout-from-inactivity","title":"Timeout from Inactivity","text":"
The menus will slowly exit out after 2 minutes of inactivity, so if you do not press a key the DataLogger IoT will return to its previous menu. It will continue to move back until it reaches the main menu. After another additional 2 minutes of inactivity, the board will exit begin logging data again. When the menu exits from inactivity, any changes will not be saved in memory as well.
Let's start by configuring the DataLogger's system settings. Send a 1 through the serial terminal. You will have the option to adjust various settings ranging from the your preferences, time source to synchronize the date and time, WiFi network, how the device logs data, which IoT service to use, and firmware updates.
Note
You may notice after entering a 1 that there is a slight delay before the DataLogger IoT responds. The delay was added to allow some time for the DataLogger IoT to receive an additional digit for any option greater than 9. If you want to head to option 1 immediately without the slight delay, you can hit the Enter key to enter the Application Settings.
In the Settings Menu, send a 1 to adjust the Application Settings. As of firmware v01.00.02, users can now adjust the baud rate of the serial console output and the menu system's timeout value.
In the Application Settings Menu, users will be able to configure the addressable RGB's LED through software, menu timeout, microSD card's output format, serial console's output format, terminal's baud rate, deep sleep parameters, and view the current settings of the DataLogger IoT similar to when the board was initialized. Depending on your preference and how you are logging data, you can adjust the data as CSV or JSON.
1 LED Enabled \u2014 Enable/Disable the on-board RGB LED activity
Accepts a boolean value:
1 to enable (default)
0 to disable
2 Menu Timeout \u2014 Inactivity timeout period for the menu system
Accepts the following values:
1 30 Seconds = 30
2 60 Seconds = 60 (default)
3 2 Minutes = 120
4 5 Minutes = 300
5 10 Minutes = 600
b Back
3 Color Output \u2014 Use color output with the Serial console. (added as of firmware v01.02.00)
Accepts a boolean value:
1 to enable (default)
0 to disable
4 Board Name \u2014 A specific name for this DataLogger
Accepts a string
5 SD Card Format \u2014 Enable and set the output format
Accepts the following values:
1 to disable = 0
2 CSV format (default) = 1
3 JSON format = 2
6 Serial Console Format \u2014 Enable and set the output format
Accepts the following values:
1 to disable = 0
2 CSV format (default) = 1
3 JSON format = 2
7 JSON Buffer Size \u2014 Output buffer size in bytes
Accepts an integer between 100 to 5000 :
1600 bytes (default)
8 Terminal Baud Rate \u2014 Update terminal baud rate. Changes take effect on restart.
Accepts an unsigned integer between 1200 to 50000:
115200 (default)
9 Enable System Sleep \u2014 If enabled, sleep the system
Accepts a boolean value:
1 to enable
0 to disable (default)
10 Sleep Interval (sec) \u2014 The interval the system will sleep for
Accepts an integer between 5 to 86400 :
30 seconds (default)
11 Wake Interval (sec) \u2014 The interval the system will operate between sleep period
Accepts an unsigned integer between 60 to 86400 :
120 seconds (default)
12 Startup Messages Level of message output at startup
Accepts a value between 1 to 3 :
1 Normal = 0 (default)
2 Compact = 1
3 Disabled = 2
13 Startup Delay Startup Menu Delay in Seconds
Accepts a value between 0 to 60 :
2 seconds (default)
14 Device Names Name always includes the device address
Accepts a boolean value:
1 to enable (default)
0 to disable
15 About... \u2014 Details about the system
b Back
Note
Once the baud rate is changed and saved, make sure to adjust the baud rate of your serial terminal when the board is reset. If you forgot the baud rate, you can hold the BOOT button down for 20 seconds to erase the on-board preferences (besides the baud rate, this also includes any other settings that were saved) and restart the board.
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
"},{"location":"configuration/#general-save-settings","title":"General: Save Settings","text":"
In the Settings menu, send a 2 to adjust the Save Settings. As of firmware v01.01.01, the JSON output buffer size is now user configurable. This will be under option \"JSON File Buffer Size\" when in the Save Settings Menu.
In the Save Settings Menu, users will be able to save, restore, or clear any preferences in memory (i.e. persistent storage) or a saved file to a fallback device (i.e. microSD card). Note that any passwords and secret keys are not saved in the save settings file. You will need to manually enter those values in the file saved on the microSD card.
1 Fallback Restore \u2014 If unable to restore settings, use the fallback source (JSON File)
Accepts a boolean value:
1 to enable (default)
0 to disable
2 Fallback Save \u2014 Save settings also saves on the fallback storage (JSON File)
Accepts a boolean value:
1 to enable
0 to disable (default)
3 JSON File Buffer Size \u2014 The size in bytes used for the internal I/O buffer
Accepts an unsigned integer:
6400 (default, as of firmware v01.01.01)
4 Save Settings \u2014 Save current settings to persistent storage
Accepts a yes/no:
Y or y for yes
N or n for no
5 Restore Settings \u2014 Restore saved settings
Accepts a yes/no:
Y or y for yes
N or n for no
6 Clear Settings \u2014 Erase the saved settings on the device
Accepts a yes/no:
Y or y for yes
N or n for no
7 Save to Fallback \u2014 Save System Settings to the fallback storage (JSON File)
Accepts a yes/no:
Y or y for yes
N or n for no
8 Restore from Fallback \u2014 Restore system settings from the fallback storage (JSON File)
Accepts a yes/no:
Y or y for yes
N or n for no
b Back
If you have the Fallback Save enabled or selected the option Save to Fallback, you will notice an additional file called datalogger.json saved in the microSD card. This is the fallback file that is saved. Using a text editor, you can edit this file to adjust the settings or provide WiFi credentials, certificates, and keys. You can use option 7 to restore the settings on your DataLogger IoT.
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
"},{"location":"configuration/#general-time-sources","title":"General: Time Sources","text":"
Note
Make sure to connect the ESP32-WROOM to a 2.4GHz WiFi network and ensure that is not a guest network that requires you to sign in. Unfortunately, 5GHz WiFi is not supported on the ESP32-WROOM module.
In the Settings Menu, send 3 to manage the time reference sources. As of firmware v01.01.01, time zone support is at the clock level, not tied to NTP. The option to adjust the Time Zone is moved to the Time Sources menu.
In this menu, you will have options to update the primary reference clock, update interval, add a secondary reference clock, and update it's interval. By default, the primary reference clock is set to use the Network Time Protocol (NTP). To synchronization the time, you will need to connect to a 2.4GHz WiFi network in order to update the time. To add a secondary clock, make sure to connect a compatible Qwiic-enabled devices that can keep track of time (i.e. Qwiic Real Time Clock Module - RV-8803 or a Qwiic-enabled u-blox GNSS module).
Note
To adjust the time zone, you will need to enter a POSIX timezone string variable. Try checking out this CSV in this GitHub repo and searching for the timezone string variable in your area. For more information about POSIX format specification check out this article from IBM.
1 The Time Zone \u2014 Time zone setting string for the device
Accepts a string:
MST7MDT,M3.2.0,M11.1.0 (default, as of firmware v01.01.01)
2 Reference Clock \u2014 The current reference clock source
Accepts the following values:
1 for no clock
2 for NTP Client (default)
3 Update Interval \u2014 Main clock update interval in minutes. 0 = No update
Accepts an unsigned integer:
0 = No update
60 seconds (default)
4 Enable Clock Fallback \u2014 Use a valid reference clock if the primary is not available
Accepts a boolean value:
1 to enable (default)
0 to disable
5 Dependant Interval \u2014 Connected depedant clock update interval in minutes. 0 = No update
Accepts an unsigned integer:
0 = No update
60 seconds (default)
6 Update Connected \u2014 Update connected clocks on main clock update
Accepts a boolean value:
1 to enable (default)
0 to disable
b Back
Note
As an alternative to using the NTP, users can also add a compatible Qwiic-enabled device that can keep track of time (i.e. Qwiic Real Time Clock Module - RV-8803 or a Qwiic-enabled u-blox GNSS module). These can be set as the primary or secondary clock.
Once attached, you will be prompted with additional options to select a primary reference clock.
If you are using a u-blox GNSS module, make sure that you have enough satellites in view. The option to add or configure the GNSS will not be available if there are not enough satellites in view. If you are using the Qwiic Real Time Clock Module - RV-8803, you may need to go into the device settings to manually adjust the date and time.
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
The ESP32-WROOM can only connect to a 2.4GHz WiFi network. Unfortunately, 5GHz is not supported on the ESP32-WROOM module.
In the Settings Menu, send a 4 to configure the WiFi settings. As of firmware v01.00.02, up to 4 sets of WiFi credentials can be saved.
Once you are in the WiFi Network menu, you can enable/disable WiFi and save the WiFi network credentials. Once connected to a 2.4GHz WiFi network, you can synchronize the date and time, connect to an IoT service to log data, and update the latest firmware over-the-air. Since the WiFi is turned on by default, you will simply need to save the WiFi network's name and password.
1 Enabled \u2014 Enable or Disable the WiFi Network connection
Accepts a boolean value:
1 to enable (default)
0 to disable
2 Network Name \u2014 The SSID of the WiFi network
Accepts a string:
For example, if my network name is \"MY_NETWORK_NAME\", you would manually type MY_NETWORK_NAME. When finished hit the ENTER key
3 Password \u2014 The Password to connect to the WiFi network
Accepts a string:
For example, if my network name is \"MY_SUPER_SECRET_PASSWORD\", you would manually type MY_SUPER_SECRET_PASSWORD. Note that as you type the password, each character will be replaced with an asterisk (*). When finished hit the ENTER key.
4 Network 2 Name \u2014 Alternative network 2 SSID
Accepts a string:
For example, if my network name is \"MY_NETWORK_NAME_2\", you would manually type MY_NETWORK_NAME_2. When finished hit the ENTER key
5 Network 2 Password \u2014 Alternative network 2 Password
Accepts a string:
For example, if my network name is \"MY_SUPER_SECRET_PASSWORD_2\", you would manually type MY_SUPER_SECRET_PASSWORD_2. Note that as you type the password, each character will be replaced with an asterisk (*). When finished hit the ENTER key.
6 Network 3 Name \u2014 Alternative network 2 SSID
Accepts a string:
For example, if my network name is \"MY_NETWORK_NAME_3\", you would manually type MY_NETWORK_NAME_3. When finished hit the ENTER key
7 Network 3 Password \u2014 Alternative network 3 Password
Accepts a string:
For example, if my network name is \"MY_SUPER_SECRET_PASSWORD_3\", you would manually type MY_SUPER_SECRET_PASSWORD_3. Note that as you type the password, each character will be replaced with an asterisk (*). When finished hit the ENTER key.
8 Network 4 Name \u2014 Alternative network 2 SSID
Accepts a string:
For example, if my network name is \"MY_NETWORK_NAME_4\", you would manually type MY_NETWORK_NAME_4. When finished hit the ENTER key
9 Network 4 Password \u2014 Alternative network 4 Password
Accepts a string:
For example, if my network name is \"MY_SUPER_SECRET_PASSWORD_4\", you would manually type MY_SUPER_SECRET_PASSWORD_4. Note that as you type the password, each character will be replaced with an asterisk (*). When finished hit the ENTER key.
b Back
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
Press the reset button or cycle power to restart the DataLogger IoT. You can also go through the menu and reset the device through software as well. Once the board is reset, the DataLogger will attempt to connect to a WiFi network. If you are successful, the output will indicate that the board connected to a WiFi network and will update the current time through a NTP Client.
Note
If you have a Qwiic Dynamic NFC/RFID Tag connected to the board's Qwiic connector, you can easily update your WiFi credentials! Just make sure to save the WiFi credentials to the tag.
Note
If you saved your preferences to a JSON file on your microSD card's root directory, you can also save your WiFi credentials and load the system settings from the menu as well!
In the Settings menu, send a 5 to adjust the NTP Client settings. As of firmware v01.01.01, time zone support is at the clock level, not tied to the NTP. The option to adjust the Time Zone is moved to the Time Sources menu.
In this menu, users will have the option to enable/disable the NTP client, select the primary/secondary server, or adjust the time zone for your area.
1 Enabled \u2014 Enable or Disable the NTP Client
Accepts a boolean value:
1 to enable (default)
0 to disable
2 NTP Server One \u2014 The primary NTP Server to use
Accepts a string:
time.nist.gov (default)
3 NTP Server Two \u2014 The secondary NTP Server to use
Accepts a string:
pool.ntp.org (default)
b Back
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
In the Settings menu, send a 6 to adjust how data is logged.
In the Logger menu, users will have the option to add a timestamp, increment sample numbering, data format, or reset the sample counter. Note that the timestamp is the system clock and syncs with the reference clock that was chosen. Data from the Qwiic-enabled devices that keep track of time can also be included for each data entry by default.
1 Timestamp Mode \u2014 Enable timestamp output and set the format of a log entry timestamp
1 for no timestamp (default) = 0
2 for milliseconds since program start = 1
3 for seconds since Epoch = 2
4 for Date Time - USA Date format = 3
5 for Date Time = 4
6 for ISO08601 Timestamp = 5
7 for ISO08601 Timestamp with Time Zone = 6
2 Sample Numbering \u2014 An incremental count of the current log entry
Accepts a boolean value:
1 to enable
0 to disable (default)
3 Numbering Increment \u2014 Increment amount for Sample Numbering
Accepts an unsigned integer between 1 to 10000:
1 (default)
4 Output ID \u2014 Include the Board ID in the log output (added as of firmware v01.02.00)
Accepts a boolean value:
1 to enable
0 to disable (default)
5 Output Name \u2014 Include the Board Name in the log output (added as of firmware v01.02.00)
Accepts a boolean value:
1 to enable
0 to disable (default)
6 Rate Metric \u2014 Enable to record the logging rate data (added as of firmware v01.02.00)
Accepts a boolean value:
1 to enable
0 to disable (default)
7 SD Card Format \u2014 Enable and set the output format
Accepts an integer:
1 to disable = 0
2 CSV format = 1 (default)
3 JSON format = 2
8 Serial Console Format \u2014 Enable and set the output format
Accepts an integer:
1 to disable = 0
2 CSV format = 1 (default)
3 JSON format = 2
9 System Info \u2014 Log system information (added as of firmware v01.02.00)
Accepts a boolean value:
1 to enable
0 to disable (default)
10 Reset Sample Counter \u2014 Reset the sample number counter to the provided value
Accepts an unsigned integer between 0 to 10000:
0 (default)
b Back
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
Press the reset button or cycle power to restart the DataLogger IoT. You can also go through the menu and reset the device through software as well. Below is an example with the ISO08601 time that was added to the output.
In the Settings menu, send an 7 to adjust the Logging Timer.
Adjusting the interval for the Logging Timer will change the amount of time between log entries.
1 Interval \u2014 The timer interval in milliseconds
Accepts an integer:
15000 milliseconds (default)
b Back
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
"},{"location":"configuration/#logging-data-file","title":"Logging: Data File","text":"
In the Settings menu, send an 8 to adjust the Logging Data File.
Adjusting these parameters allows you to change the filename prefix, the number the files starts at, and how often the DataLogger will create a new file on the microSD card. For example, the default file will be saved as sfe0001.txt. After 1 day, the DataLogger will rotate files by creating a new file named sfe0002.txt. The DataLogger will begin logging data in this new file. The purpose of this log rotation is to limit the size of each file prevent issues when opening large files.
1 Rotate Period \u2014 Time between file rotation
Accepts the following values:
1 for 6 hours = 6
2 for 12 hours = 12
3 for 1 day (24 hours) = 24 (default)
4 for 2 days (48 hours) = 48
5 for 1 week (168 hours) = 168
2 File Start Number \u2014 The number the filename rotation starts with
Accepts an unsigned integer:
1 (default)
3 Filename Prefix \u2014 The prefix string for the generated filenames
Accepts a string:
sfe (default)
b Back
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
The contents of the file will depend on how the data was saved (either CSV or JSON). Make sure that the SD Card format is enabled to either CSV or JSON with your desired device outputs turned on so that the DataLogger can save the readings.
When removing the microSD card, make sure to remove your power source. Then insert into it into microSD card adapter or USB reader. When connecting the memory card to your computer, you can use a text editor to view the saved readings. In this case, a Windows operating system was viewing the file sfe0000.txt and it was only file available in the microSD card.
At the time of writing, Arduino's IoT service was referred to as the \"Arduino IoT Cloud.\" Arduino updated the service with a different UI and is now referring to the service as the \"Arduino Cloud\".\" When referencing the Arduino IoT or Arduino IoT Cloud in this tutorial, we are referring to the Arduino Cloud.
In the Settings menu, send an 16 to adjust settings for Arduino Cloud. This feature was added as of firmware v01.01.01.
1 Enabled \u2014 Enable or Disable the Arduino IoT Client
Accepts a boolean value:
1 to enable
0 to disable (default)
2 Thing Name \u2014 The Thing Name to use for the IoT Device connection
Accepts a string
3 Thing ID \u2014 The Thing ID to use for the IoT Device connection
Accepts a string
4 API Client ID \u2014 The Arduino Cloud API Client ID
Accepts a string
5 API Secret \u2014 The Arduino Cloud API Secret
Accepts a string
6 Device Secret \u2014 The Arduino IoT Device Secret
Accepts a string
7 Device ID \u2014 The Arduino IoT Cloud Device ID
Accepts a string
b Back
"},{"location":"configuration/#iot-web-server","title":"IoT Web Server","text":"
As of firmware v01.02.00, log files can be viewed and downloaded using the IoT Web Server feature if mDNS (multicast DNS) is supported on your network. This functionality is accessed via the Settings Menu, Type 17 to enter the System Update menu. Once this menu entry is selected, the following menu options are presented:
1 Enabled \u2014 Enabled or Disable the Web Server
Accepts a boolean value
1 to enable
0 to disable (default)
2 Username \u2014 Web access control. Leave empty to disable authentication
Accepts a string
3 Password \u2014 Web access control.
Accepts a string
4 mDNS Support \u2014 Enable a name for the web address this device
Accepts a boolean value
1 to enable
0 to disable (default)
5 mDNS Name \u2014 mDNS Name used for this device address
Accepts a string
dataloggerXXXXX, where XXXXX is the taken from the last 5x characters from your DataLogger IoT's board ID (default)
b Back
Note
You will need to make sure that the ESP32 is on the same network as your computer in order to access the log files.
Note
When authentication is enabled, some browsers might require a second login depending on user settings.
Note
The SparkFun Datalogger IoT requires restarting if the web interface is enabled.
For more information on how to use this feature, check out the section on viewing and downloading log files using the IoT web server.
Examples: Viewing and Downloading Log Files using the IoT Web Server"},{"location":"configuration/#advanced-system-update","title":"Advanced: System Update","text":"
New sensors and features are being added all the time and we've made it really easy for you to keep your DataLogger IoT up to date. The System Update option provides the following functionality to the end user:
Restart the device
Performing a Factory Reset on the device
Updated the device firmware from a file on an SD Card.
Note
What's going on here?!? This tutorial was updated for firmware version 01.02.00!!! You will notice this menu option has changed to 18 !!!
This functionality is accessed via the Settings Menu, which is required to use this capability. Type 18 to enter the System Update menu. Once this menu entry is selected, the following menu options are presented:
1 Device Restart \u2014 Restart/reboot the device
Accepts the following values:
Y or Y to restart or reboot the device using the current firmware and system preferences
N or n to cancel
2 Factory Reset \u2014 Erase all settings and revert to original firmware
Accepts the following values:
Y or Y to factory reset the device
N or n to cancel
3 Update Firmware - SD Card \u2014 Update the firmware from the SD card
Accepts firmware in the /root directory of the microSD card with the file naming pattern SparkFunDataLoggerIoT*.bin, where the asterisk * is the firmware version number (i.e. SparkFunDataLoggerIoT_01.00.01.bin).
4 Update Firmware - OTA \u2014 Update the firmware over-the-air
Connects to a server and searches for the latest firmware that is available. Note that you must be connected to a WiFi network to be able to update the board over-the-air.
Accepts the following values if there is new firmware available.
Y or Y to update over-the-air
N or n to cancel
b Back
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
For more information on how to update firmware manually or over-the-air, check out the section under Examples: Updating Firmware.
In the Main Menu, send a 2 through the serial terminal to adjust the devices settings.
This will bring up the connected devices that are currently available. You can configure each device and enable/disable each output. Below is a sample of the on-board devices available for the DataLogger IoT - 9DoF when only the MAX17048, ISM330, and MMC5983 are connected. As the DataLogger IoT - 9DoF initializes, the board will populate additional devices in this window if they are detected. Your mileage will vary depending on what is connected. On the DataLogger IoT you will not see the ISM330 or MMC5983 as an option since the 6DoF IMU and magnetometer are not populated on that version of the board.
9 Accel X (milli-g) \u2014 Accelerometer X (milli-g)
1 to enable
2 to disable
10 Accel Y (milli-g) \u2014 Accelerometer Y (milli-g)
1 to enable
2 to disable
11 Accel Z (milli-g) \u2014 Accelerometer Z (milli-g)
1 to enable
2 to disable
12 Gyro X (milli-dps) \u2014 Gyro X (milli-g)
1 to enable
2 to disable
13 Gyro Y (milli-dps) \u2014 Gyro Y (milli-g)
1 to enable
2 to disable
14 Gyro Z (milli-dps) \u2014 Gyro Z (milli-g)
1 to enable
2 to disable
15 Temperature (C) \u2014 The temperature in degrees C
1 to enable
2 to disable
3 MMC5983 \u2014 MMC5983 Magnetometer
1 Filter Bandwidth (Hz) \u2014 The filter bandwidth in Hz
1 100 Hz (default)
2 200 Hz
3 400 Hz
4 800 Hz
2 Auto-Reset \u2014 Auto-Reset
1 to enable
2 to disable
3 X Field (Gauss) \u2014 The X Field strength in Gauss
1 to enable
2 to disable
4 Y Field (Gauss) \u2014 The Y Field strength in Gauss
1 to enable
2 to disable
5 Z Field (Gauss) \u2014 The Z Field strength in Gauss
1 to enable
2 to disable
6 Temperature (C) \u2014 The ambient temperature in degrees C
1 to enable
2 to disable
b Back
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
Warning
As you connect additional devices to the DataLogger IoT, the values associated with each device in this menu will change! Make sure to check your device settings menu after additional devices are attached should you decide to configure the additional devices and enable/disable their outputs.
"},{"location":"contribute/","title":"Contribute: Help Fix our Mistake!","text":"
Spot something wrong? Feel free to contribute our documentation.
This hardware design is open-source! Please help us make it better.
Our board design files are contained in the Hardware folder of the SparkFun DataLogger IoT repository.
"},{"location":"contribute/#submit-a-design-improvement","title":"Submit a Design Improvement","text":"
Fork this repo
Add your design improvements
File a pull request with your changes, and enjoy making the words worlds world a better place.
Once received, the engineer in charge of the original design will automatically be notified.
We will review your suggested improvements, 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.)
Let's provided some recognition to the contributors for this project!
"},{"location":"example_CSV_to_spreadsheet/","title":"How to Convert Comma Separated Values (CSV) to a Spreadsheet","text":"
The DataLogger IoT is great at displaying real time data with an IoT service whenever there is an Internet connection available. For those that want to use the DataLogger IoT without a WiFi connection and/or you just want to save data to a microSD card, you can import the comma separated values (CSV) from the text file into a spreadsheet to graph the values.
There are a few spreadsheet programs available that can take text files with CSV but for the scope of this tutorial, we will be using Google Sheets\u2122 to convert the CSV output to a graph.
Image Courtesy of Google Sheets.
Note
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. \ud83d\ude09
"},{"location":"example_CSV_to_spreadsheet/#log-some-data","title":"Log Some Data!","text":"
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.
Tip
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.
Note
For users that require a timestamp with their datasets, make sure to enable timestamp.
"},{"location":"example_CSV_to_spreadsheet/#download-the-log-files","title":"Download the Log Files","text":"
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.
Examples: Viewing and Downloading Log Files using the IoT Web Server
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.
"},{"location":"example_CSV_to_spreadsheet/#importing-csv-to-a-spreadsheet","title":"Importing CSV to a Spreadsheet","text":"
Log into your Google account and open Google Sheets to create a new spreadsheet.
Click Here to Create a New Google Spreadsheet
Head to the menu and select: File > Import.
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.
Note
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. In this case, we are using the default CSV format.
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.
Note
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.
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.
Tip
To separate the values to each column, highlight everything in the column. Then head to the menu and select: Data > Split text into columns
"},{"location":"example_CSV_to_spreadsheet/#graphing-your-datasets","title":"Graphing Your Datasets","text":"
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.
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.
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.
Note
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.
At the time of writing, Arduino's IoT service was referred to as the \"Arduino IoT Cloud.\" Arduino updated the service with a different UI and is now referring to the service as the \"Arduino Cloud\".\" When referencing the Arduino IoT or Arduino IoT Cloud in this tutorial, we are referring to the Arduino Cloud.
"},{"location":"example_arduino_iot_cloud/#creating-and-connecting-to-an-arduino-cloud-device","title":"Creating and Connecting to an Arduino Cloud Device","text":"
One of the key features of the SparkFun DataLogger IoT is it's simplified access to IoT service providers. This document outlines how an Arduino Cloud Device is used by the DataLogger IoT.
The following is covered by this document:
Structure of the Arduino Cloud Devices
Device creation in the Arduino Cloud
Setup of the Arduino Driver
How data is posted from the DataLogger IoT to the Arduino Device
Currently, the Arduino Cloud device connection is a single direction - used to post data from the DataLogger IoT to an Arduino Cloud device.
Image Courtesy of Arduino
Note
To take advantage of the API's in Arduino Cloud, you will also need to have a service plan with your account.
The Arduino Cloud enables connectivity between an IoT/Edge Arduino enabled device and the cloud. The edge device updates data in the Arduino Cloud by updating variables or parameters attached to a cloud device.
In the Arduino Cloud, the edge device is represented by a Device which has a virtual Thing attached/associated with it. The Thing acts as a container for a list of parameters or variables which represent the data values received from the edge device. As values on the edge device update, they are transmitted to the Arduino Cloud.
For a SparkFun DataLogger IoT connected to an Arduino Cloud device, the output parameters of a device connected to the DataLogger are mapped to variables within the Arduino Cloud Device's Thing using a simple pattern of DeviceName_ParameterName for the name of the variable in the Arduino Cloud.
"},{"location":"example_arduino_iot_cloud/#creating-a-device-in-arduino-cloud","title":"Creating a Device in Arduino Cloud","text":"
The first step connecting to the Arduino Cloud is setting up a device within the cloud. A device is a logical element that represents a physical device.
Log into your Arduino Cloud account.
Click Here to Log into Arduino Cloud
Click on the expand menu icon on the upper left (e.g. the three lines stacked like a \"hamburger\"; \u2630) and select Devices. If your window is big enough, then it will show up on the navigation bar.
This page lists your currently defined devices. If there are no defined devices, select the Add Device button. This will probably be at the bottom of the page. The location of this button will change once the page has a device (or if there is an update to Arduino's user interface).
A device type selection dialog is then shown. Since we are connecting a DataLogger IoT board to the system, and not connected a known device, select DIY - Any Device to manually include the DataLogger IoT.
Once selected, another dialog is presented. Just select Continue. At this point you can provide a name for your device. In this case we named it as \"MyDataLoggerIoT.\"
The next screen is the critical step of the device creation process. This step is the one time the Device Secret Key is available. The provided Device ID and Device Secret Key values are needed to connect to the Arduino Cloud. Once this step is completed, the Secret Key is no longer available.
The easiest way to capture these values is by downloading as a PDF file, which is offered on the setup page. Click on the download the PDF and save it to a safe location. When ready, click on the check box indicating that you have saved the values and select the Continue button.
"},{"location":"example_arduino_iot_cloud/#arduino-cloud-api-keys","title":"Arduino Cloud API Keys","text":"
In addition to creating a device, to access the Arduino Cloud, the driver requires an API Key. This allows the DataLogger IoT's Arduino Cloud driver to access the web API of the Arduino Cloud. This API is used to setup the connection to the Arduino Cloud.
To create an API key, click on the menu bar to expand and select your Arduino account profile > Personal Settings.
This menu takes you to a list of existing API Keys. If you have not created one yet, the list will have nothing in it like the image below. From this page, select the CREATE API KEY button.
Note
Users will need a service plan in order to take advantage of the API.
In the presented dialog, enter a name for the API key. In this case, we named it \"MyDataLoggerKey\".
Once the name is entered, click CONTINUE. A page with the new API key is presented. Like in Device Creation, this page contains a secret that is only available on this page during this process.
Make note of the Client ID and Client Secret values on this page. The best method to capture these values is to download the PDF file offered on this page. Click on the download the PDF and save it to a safe location. When ready, click on the check box indicating that you have saved the values and select the DONE button.
At this point, the Arduino Cloud is setup for connection by the driver.
To add an Arduino Cloud Device as a destination DataLogger IoT, the Arduino Cloud connection is enabled via the DataLogger menu system and the connection values, obtained from the Arduino Cloud (see above), are set in the connection properties.
The specifics for the Arduino Cloud must be configured. This includes the following:
Thing Name
Thing ID
API Client ID
API Secret
Device Secret
Device ID
Note
The Thing Name does not necessarily need to be configured. However, there will be less confusion if you set this up before connecting the DataLogger IoT to the Cloud. The Thing ID will automatically be generated and saved once there is a connection available.
The name of the Arduino Cloud Thing to use. If the Thing doesn't exist on startup, the driver will create a Thing and be named \"Untitled\" if you do not provide a name.
Note
Note satisfied with the default \"Untitled\" as the Thing's name? You can rename the Thing Name after creating the Thing. Note that you will need to manually rename the Thing Name on the Arduino Cloud and DataLogger IoT.
This is the ID of the Thing being used. This value is obtained by the following methods:
If the driver creates a new Thing, the ID is obtained and used.
If an existing Thing is connected to the DataLogger IoT, the driver retrieves it's ID.
Note
In this case, the driver cannot create any new variables until the system is restarted.
The user creates a new Thing using the web interface of Arduino Cloud, and provides the Thing Name and Thing ID .
"},{"location":"example_arduino_iot_cloud/#api-client-id-and-secret","title":"API Client ID and Secret","text":"
These values are used to provide API access by the driver. This access allows for the creation/use of a Thing and Variables within the Arduino Cloud. These are obtained via the steps outlined earlier in this document.
"},{"location":"example_arduino_iot_cloud/#device-secret-and-id","title":"Device Secret and ID","text":"
These values are used to identify the Arduino device that is connected to. These are obtained via the steps outlined earlier in this document.
The above property values must be set in the DataLogger's Arduino Cloud driver before use. They can be manually by using the menu system like the previous MQTT example.
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 16 to enter the Arduino IoT Menu. When the menu system for the Arduino IoT 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:
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 Arduino Cloud example outlined in this document, the entries in the setting's JSON file are as follows:
You will need to update the API Client ID, API Secret, Device Secret, and Device ID with the values that were obtained earlier. Don't forget to enable Arduino Cloud service by setting the value to true. If the JSON file is saved in the microSD card, you will need to load the credentials to the DataLogger IoT.
Tip
To load the values by the system at startup using a JSON file and microSD card, you will need to configure the Save Settings. This JSON file will be created with the \"Save to Fallback\" option. Make sure to enable the Arduino IoT as well.
On startup, when the first values are written from the DataLogger IoT, the connection to the Arduino Cloud is made. During this connection, the system connects to the specified Thing and variables are mapped between the DataLogger Device values and Arduino Cloud Variables. If needed, variables can be created manually in the cloud.
While this initial setup takes seconds to complete, updates to the values on the Arduino Cloud are rapid as soon as there is a connection available.
Once the DataLogger IoT device is configured and running, updates in Arduino Cloud are listed in the Things tab of the Arduino Cloud page. Clicking the target Thing provides access to the current variable values that are connected to the DataLogger IoT. Your mileage may vary depending on the compatible device that is connected to the DataLogger IoT. In this case, we were able to see the built-in sensors that were connected on the DataLogger IoT - 9DoF.
Note
Not seeing certain variables on your list? Check your connections to make sure that the compatible device is connected to the DataLogger IoT. You may also have certain outputs disabled (like the connected sensors or timestamp).
Note
Having problems connecting new variables with the DataLogger IoT? When swapping out compatible Qwiic enabled devices, you may need to delete previous cloud variables so that the DataLogger IoT is able re-initialize them on the next power cycle.
"},{"location":"example_arduino_iot_cloud/#create-a-dashboard","title":"Create a Dashboard","text":"
With the data now available in the Arduino Cloud as variables, it is a simple step create a dashboard that plots the data values.
The general steps to create a simple dashboard include:
Select the Dashboards section of the Arduino Cloud.
Select the Build Dashboard button. If you have a dashboard already built, the location of the button will change and the button will be renamed: Create.
Click the edit button (i.e. the icon that looks like a paper and pencil, this is next to the eye).
Add an element to the dashboard -- for this example select ADD ^ > Advanced Chart.
On the Chart's Widget Settings select Link Variables to add readings.
The DataLogger IoT Variables are listed - select the variable to link.
Continue this step until all the desired variables are linked to the chart. You can select up to 5x variables at a time. Click on the Link Variables button after selecting the variables.
This will bring you back to the Chart's Widget Settings window. Configure any preferences that to display (i.e. variable colors, labels, etc.). When all variables are linked and the Chart Widget Settings is configured, select Done.
The created dashboard then displays the values posted from the SparkFun DataLogger IoT. You can continue adding additional readings on the dashboard that you were not able to fit on graph or even rename the Dashboard view. In this case, we displayed accelerometer values and temperature in degrees Celsius from the DataLogger IoT - 9DoF.
Note
Not seeing any values on the LIVE view? Try clicking on the other time periods to see the values posted.
Using compatible Qwiic enabled devices, you can also display additional readings that are not available with the built-in sensors. In this case, we were able to display humidity, temperature in degrees Fahrenheit, equivalent CO2, TVOC, and AQI with the DataLogger IoT and Environmental Combo Breakout (ENS160/BME280).
"},{"location":"example_aws/","title":"Creating and Connecting to an AWS IoT Device (Thing)","text":"
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.
Image Courtesy of Amazon Web Services (AWS)
The following is covered by this document:
Device (Thing) creation in AWS
Securely connecting the device
How data is posted from the DataLogger IoT to the AWS Device via it's Shadow
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.
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.
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.
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.
"},{"location":"example_aws/#creating-a-device-in-aws-iot","title":"Creating a Device in AWS IoT","text":"
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.
Click Here to Log into AWS
Once logged into your AWS account, select IoT Core from the menu of services.
From the IoT Core console page, under the Manage section, select All Devices > Things
On the resultant Things Page, select the Create Things button.
AWS IoT will then take you through the steps to create a device. Selections made for a demo Thing are:
Create single thing
Thing Properties
Enter a name for your thing - for this example TestThing23
Device Shadow - select Unnamed shadow (classic)
Auto-generate a new certificate
Attach policies to certificate - This is discussed later in this document
Select Create thing
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:
Device Certificate
Public Key File
Private Key File
Root CA certificates - (for example: Amazon Root CA 1 )
At this point, the new AWS IoT thing is created and listed on the AWS IoT Things Console
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.
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.
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:
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.
Selecting the Classic Shadow entry provides the Server Name/Hostname for the device, as well as the MQTT topic for this device.
Note
The server name is obtained from the Device Shadow URL entry
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.
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.
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.
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.
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:
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:
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. 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.
Tip
To load the values by the system at startup using a JSON file and microSD card, you will need to configure the Save Settings. This JSON file will be created with the \"Save to Fallback\" option. Make sure to enable the AWS IoT as well.
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:
Opening up an update, you can see the data being set to AWS IoT in a JSON format.
"},{"location":"example_azure/","title":"Creating and Connecting to an Azure IoT Device","text":"
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.
Image Courtesy of Microsoft Azure
The following is covered by this document:
Device creation Azure
Securely connecting the device
How data is posted from the DataLogger IoT to the Azure Device
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.
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.
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.
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.
"},{"location":"example_azure/#creating-a-device-in-azure-iot","title":"Creating a Device in Azure IoT","text":"
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.
Click Here to Log into Microsoft Azure
Once logged into your Microsoft Azure account, select Internet of Things > IoT Hub from the menu of services.
"},{"location":"example_azure/#create-an-iot-hub","title":"Create an IoT Hub","text":"
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.
Follow the Hub Creation workflow - key settings used for a DataLogger demo device:
Used the \"Free Tier\" for testing and development.
Networking
Connectivity - Public Access
Minimum TLS Version - 1.0
The remaining settings were set at their default values.
"},{"location":"example_azure/#create-a-device","title":"Create a Device","text":"
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.
To create a device, select the Device management > Devices from the IoT Hub menu and the select the + Add Device menu item
In the create device dialog:
Enter a name for the device
Select an Authentication type of Symmetric key
Auto-generate keys enabled
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.
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.
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.
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.
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:
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:
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.
Tip
To load the values by the system at startup using a JSON file and microSD card, you will need to configure the Save Settings. This JSON file will be created with the \"Save to Fallback\" option. Make sure to enable the Azure IoT as well.
"},{"location":"example_azure/#operation-and-monitoring","title":"Operation and Monitoring","text":"
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.
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.
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.
"},{"location":"example_azure/#connect-to-your-azure-iot-hub","title":"Connect to Your Azure IoT Hub","text":"
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.
The available IoT Hubs are displayed in the editors command prompt. Select the desired hub and press Enter (or click).
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.
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.
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:
To stop monitoring, click the Stop Monitoring build-in event endpoint item that is displayed in the status bar of the editor.
A menu option to stop monitoring is also available from the ... menu of the AZURE IOT HUB section in the editor Explorer panel.
"},{"location":"example_http/","title":"Connecting and Sending Output to an HTTP Server","text":"
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.
The following is covered by this document:
Overview of the HTTP connection
How a user configures and uses the HTTP connection
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.
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.
The following is an example of the data posted - note, this representation was \"pretty printed\" for readability.
{\n \"MAX17048\": {\n \"Voltage (V)\": 4.304999828,\n \"State Of Charge (%)\": 115.0625,\n \"Change Rate (%/hr)\": 0\n },\n \"CCS811\": {\n \"CO2\": 620,\n \"VOC\": 33\n },\n \"BME280\": {\n \"Humidity\": 25.03613281,\n \"TemperatureF\": 79.64599609,\n \"TemperatureC\": 26.46999931,\n \"Pressure\": 85280.23438,\n \"AltitudeM\": 1430.44104,\n \"AltitudeF\": 4693.04834\n },\n \"ISM330\": {\n \"Accel X (milli-g)\": -53.31399918,\n \"Accel Y (milli-g)\": -34.03800201,\n \"Accel Z (milli-g)\": 1017.236023,\n \"Gyro X (milli-dps)\": 542.5,\n \"Gyro Y (milli-dps)\": -1120,\n \"Gyro Z (milli-dps)\": 262.5,\n \"Temperature (C)\": 26\n },\n \"MMC5983\": {\n \"X Field (Gauss)\": -0.200622559,\n \"Y Field (Gauss)\": 0.076416016,\n \"Z Field (Gauss)\": 0.447570801,\n \"Temperature (C)\": 29\n }\n}\n
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:
The options are:
Enable/Disable the connection
Set the URL for the endpoint
Set the name of the CA Cert file for a secure connection (HTTP)
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 .
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.
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.
The above example show providing a certificate filename of example.cer.
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.
CA Cert Filename - Set to the cert filename on the SD card if being used.
If the JSON file is saved in the microSD card, you can load the credentials to the DataLogger IoT.
Tip
To load the values by the system at startup using a JSON file and microSD card, you will need to configure the Save Settings. This JSON file will be created with the \"Save to Fallback\" option. Make sure to enable the HTTP IoT as well.
"},{"location":"example_http/#example-connecting-to-a-http-server","title":"Example - Connecting to a HTTP Server","text":"
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.
The following javascript/node code creates a HTTP server on port 8090, and outputs received data to the console.
var http = require('http');\n\n// Setup the endpoint server\nvar myServer = http.createServer(function (req, res) {\n\n // Initialize our body string\n var body=\"\";\n\n // on data callback, append chunk to our body string\n req.on('data', function(chunk){\n body += chunk;\n });\n\n // On end callback, output the body to the console\n req.on('end', function(){\n // parse json string, then stringify it back for 'pretty printing'\n console.log(\"payload: \" + JSON.stringify(JSON.parse(body),null,2));\n });\n\n // send a reply\n res.writeHead(200, {'Content-Type': 'text/plain'});\n res.end('n');\n // Just listen on our port\n}).listen(8090);\n
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).
Once Node is setup, the above server is run via the following command (assuming the implementation is in a file called simple_http.js):
node ./simple_http.js\n
As data is sent by the DataLogger IoT, the following is output to the console from the server:
"},{"location":"example_http/#obtaining-a-sites-security-certificate","title":"Obtaining a Sites Security Certificate","text":"
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.
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
Next, on the page shown, select the certificate button on the upper right of the dialog.
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.
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.
"},{"location":"example_iot_web_server/","title":"Viewing and Downloading Log Files using the IoT Web Server","text":"
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.
The following is covered by this document:
How a user configures and uses the HTTP connection
Use examples
"},{"location":"example_iot_web_server/#iot-web-server-connection-setup","title":"IoT Web Server Connection Setup","text":"
To connect to the ESP32's IoT Web Server, the following information is needed:
The server name/address
[optional] A username - if required
[optional] A password - if required
"},{"location":"example_iot_web_server/#iot-web-server-menu-system","title":"IoT Web Server Menu System","text":"
We'll need to adjust the settings for the IoT Web Server.
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:
The options are:
Enable/Disable the connection
Username
Password
Enable/Disable mDNS support
mDNS name
At a minimum, you will just need to enable the connection. However, we recommend enabling mDNS support if it is supported in your network.
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.
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.
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.
Tip
To load the values by the system at startup using a JSON file and microSD card, you will need to configure the Save Settings. This JSON file will be created with the \"Save to Fallback\" option. Make sure to enable the MQTT Client as well.
"},{"location":"example_iot_web_server/#connect-and-download-log-file","title":"Connect and Download Log File","text":"
Note
You will need to make sure that the ESP32 is on the same network as your computer in order to access the log files.
Note
When authentication is enabled, some browsers might require a second login depending on user settings.
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\".
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.
Note
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.
Now that you have downloaded the log files, try graphing the data on a spreadsheet!
"},{"location":"example_mqtt/","title":"MQTT","text":""},{"location":"example_mqtt/#connecting-and-publishing-data-to-mqtt","title":"Connecting and Publishing Data to MQTT","text":"
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.
Image Courtesy of MQTT
The following is covered by this document:
Overview of the MQTT connection
How a user configures and uses the MQTT connection
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.
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.
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.
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.
The following is an example of the data posted - note, this representation was \"pretty printed\" for readability.
{\n \"MAX17048\": {\n \"Voltage (V)\": 4.304999828,\n \"State Of Charge (%)\": 115.0625,\n \"Change Rate (%/hr)\": 0\n },\n \"CCS811\": {\n \"CO2\": 620,\n \"VOC\": 33\n },\n \"BME280\": {\n \"Humidity\": 25.03613281,\n \"TemperatureF\": 79.64599609,\n \"TemperatureC\": 26.46999931,\n \"Pressure\": 85280.23438,\n \"AltitudeM\": 1430.44104,\n \"AltitudeF\": 4693.04834\n },\n \"ISM330\": {\n \"Accel X (milli-g)\": -53.31399918,\n \"Accel Y (milli-g)\": -34.03800201,\n \"Accel Z (milli-g)\": 1017.236023,\n \"Gyro X (milli-dps)\": 542.5,\n \"Gyro Y (milli-dps)\": -1120,\n \"Gyro Z (milli-dps)\": 262.5,\n \"Temperature (C)\": 26\n },\n \"MMC5983\": {\n \"X Field (Gauss)\": -0.200622559,\n \"Y Field (Gauss)\": 0.076416016,\n \"Z Field (Gauss)\": 0.447570801,\n \"Temperature (C)\": 29\n }\n}\n
To connect to a MQTT Broker, the following information is needed:
The server name/address
The server port
The topic to post to
[optional] The name of the device/Client name publishing the data
[optional] A username - if required
[optional] A password - if required
These values are set using the standard DataLogger methods - the interactive menu system, or a JSON file.
"},{"location":"example_mqtt/#mqtt-menu-system","title":"MQTT Menu System","text":"
We'll need to adjust the settings for the MQTT Client using the MQTT Menu System.
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:
The options are:
Enable/Disable the connection
Broker Port - The standard port for mqtt is 1883
Broker Server - This is just the name of the server
MQTT Topic - A string
Client Name
Username
Password
Buffer Size
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.
Note
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.
Note
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.
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.
To load the values by the system at startup using a JSON file and microSD card, you will need to configure the Save Settings. This JSON file will be created with the \"Save to Fallback\" option. Make sure to enable the MQTT Client as well.
"},{"location":"example_mqtt/#testing-the-mqtt-connection","title":"Testing the MQTT Connection","text":"
Use of a MQTT connection is fairly straightforward - just requiring the entry of broker details into the connection settings.
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 provides some basic setup for a broker.
Introduction to MQTT
This MQTT Broker Tutorial has more details, covering the setup needed for modern mosquitto configurations.
Random Nerd Tutorials: Install Mosquitto Broker on Raspberry Pi
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:
mosquitto_sub -t \"/sparkfun/datalogger1\"\n
This assumes the MQTT broker is running on the same machine, and using the default port number.
"},{"location":"example_thingspeak/","title":"Creating and Connecting to ThingSpeak","text":"
One of the key features of the DataLogger IoT is it's simplified access to IoT service providers. This document outlines how a ThinkSpeak output is used by the DataLogger IoT.
Image Courtesy of ThingSpeak
The following is covered by this document:
Creating a ThingSpeak Channel and MQTT Connection
Securely connecting the ThingSpeak
How data is posted from the DataLogger IoT to ThingSpeak
The structure of ThingSpeak is based off of the concept of Channels, with each channel supporting up to eight fields for data specific to the data source. Each channel is named, and has a unique ID associated with it. One what to think of it is that a Channel is a grouping of associated data values or fields.
The fields of a channel are enumerated as Field1, Field2, ..., Field8, but each field can be named to simplify data access and understanding.
As data is reported to a ThingSpeak channel, the field values are accessible for further processing or visualization output.
The DataLogger IoT is constructed around the concept of Devices which are often a type of sensor that can output a set of data values per observation or sample.
"},{"location":"example_thingspeak/#mapping-data-to-thingspeak","title":"Mapping Data to ThingSpeak","text":"
The concept of Channels that contain Fields in ThingSpeak is similar to the Devices that contain Data within the DataLogger IoT, and this similarity is the mapping model used by the DataLogger IoT. Specifically:
Devices == Channels
Data == Fields
During configuration of the DataLogger IoT, the mapping between the Device and ThingSpeak channel is specified. The data to field mapping is automatically created by the DataLogger IoT following the data reporting order from the specific device driver.
"},{"location":"example_thingspeak/#creating-a-device-to-a-thingspeak-channel","title":"Creating a Device to a ThingSpeak Channel","text":"
The following discussion outlines the basic steps taken to create a Channel in ThingSpeak and then connect it to the DataLogger's Device. First step is to log into your ThingSpeak and create a Channel.
Click Here to Log into ThingSpeak
Once logged into your ThingSpeak account, select Channels > My Channels menu item and on the My Channel page, select the New Channel button.
On the presented channel page, name the channel and fill in the specific channel fields. The fields should map to the data fields reported from the Device being linked to this channel. Order is important, and is determined by looking at output of a device to the serial device (or reviewing the device driver code).
Once the values are entered, select Save Channel. ThingSpeak will now show list of Channel Stats, made up of line plots for each field specified for the channel.
Note
Key note - at the top of this page is listed the Channel ID. Note this number - it is used to map a Device to a ThingSpeak Channel.
"},{"location":"example_thingspeak/#setting-up-thingspeak-mqtt","title":"Setting Up ThingSpeak MQTT","text":"
The DataLogger IoT uses MQTT to post data to a channel. From the ThingSpeak menu, select Devices > MQTT, which displays a list of your MQTT devices. From this page, select the Add a new device button.
On the presented dialog, enter a name for the MQTT connection and in the Authorize channels to access, select the channel created earlier. Once you select a channel, click the Add Channel button.
Note
More channels can be added later.
Note
When the MQTT device is created, a set of credentials (Client ID, Username, and Password) is provided. Copy or download these values, since the password in not accessible after this step.
The selected Channel is then listed in the Authorized Channel table. Ensure that the Allow Publish and Allow Subscribe attributes are enabled for the added channel.
At this point, the ThingSpeak Channel is setup for access by the DataLogger IoT.
This value is hostname of the ThingSpeak mqtt connection, which is mqtt3.thingspeak.com as note at ThingSpeakMQTT Basics page. Note a secure connection is used, so the port for the connection is 8883.
The connection password was provided when the MQTT device was created. If you lost this value, you can regenerate a password on the MQTT Device information page.
You can download the cert file for ThingSpeak.com page using a web-browser. Click on the security details of this page, and navigate the dialog (browser dependent) to download the certificate. The downloaded file is the made available for the DataLogger IoT to use as a file that is loaded at runtime)
The above property values must be set on the DataLogger IoT before use. They can be manually by using the menu system like the previous MQTT example.
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 12 to enter the ThingSpeak MQTT Menu. When the menu system for the ThingSpeak MQTT 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:
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 ThingSpeak example outlined in this document, the entries in the settings JSON file are as follows:
The Channels value is a list of [DEVICE NAME]=[Channel ID] pairs. Each pair is separated by a comma. In this case, the device name BME280 and the channel ID was 2054891. Make sure to match the device name that was loaded on start up with the unique channel ID that was generated when creating a ThingSpeak Channel.
Besides updating the Server, Client Name, Username, Password, CA Cert Filename, and Channels, 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 ThingSpeak service. Don't forget to enable ThingSpeak MQTT 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.
Tip
To load the values by the system at startup using a JSON file and microSD card, you will need to configure the Save Settings. This JSON file will be created with the \"Save to Fallback\" option. Make sure to enable the ThingSpeak MQTT as well.
Once the connector is configured and the DataLogger IoT is connected to ThingSpeak, as data is posted, the results are show on the Channel Stats page for your Channel. For the above example, the output of a SparkFun BME280 sensor produces the following output:
"},{"location":"example_thingspeak/#setting-up-2x-or-more-devices","title":"Setting Up 2x or More Devices","text":"
For users that are setting up 2x or more devices on the DataLogger IoT, you will need to ensure that each device has their own ThingSpeak Channel. Unfortunately, you are not able to plot sensor readings from two devices in the same channel.
The following example demonstrates how to set up two devices for ThingSpeak on the DataLogger IoT. In this case, we will use the BME688 and BME680 and their respective default I2C address. This is also a good example of what to do when two devices use the same device driver. Head to ThingSpeak to create a channel for each device connected to the DataLogger IoT. Include a field for each device data that the DataLogger provides. The name of the channel does not need to match the device name or I2C address.
Creating a Channel for the BME688 Creating a Channel for the BME680
Once the channels are created, you will be provided with a unique channel ID for each channel. Make sure to take note of the number as explained earlier.
Note
The alternative I2C address for the BME688 and BME680 uses the same address as the default of the other sensor:
BME680: 0x77 (Default) or 0x76
BME688: 0x76 (Default) or 0x77
Make sure to avoid using the same address when connecting the sensors to the same DataLogger IoT.
When setting up the connection, you will need to authorize both channels. In this example, we included the channels for the BME688 [x076] and BME680 [x077].
Authorizing 2x Channels through the Same Connection
Now that the ThingSpeak MQTT connection is setup, adjust the ThingSpeak configuration for the DataLogger IoT by including the credentials (i.e. Client Name, Username, and Password) and channels. We will assume that you have included the ThingSpeak CA certificate file in the root directory of the microSD card already. When including the device name with their respective channel, ensure that the device name matches the name that was loaded on startup. For example, the BME688 and BME680 were loaded on startup as BME68x and BME68x [x77], respectively. Since we are only interested in plotting the BME688 and BME680, we will ignore the MAX17048 that was loaded on startup as well. Under /Settings/ThingSpeak MQTT/Channels, you will enter the string for the device names, each of their respective channel IDs, and a comma separating the two channels like so: BME68x=2613826, BME68x [x77]=2613825.
DataLogger IoT Device Name Loaded during Startup Device Name and Channel for Both Sensors
Note
Whenever there are multiple devices using the same device driver (each with unique I2C addresses), the DataLogger IoT will display the device address for each additional device that is loading the same driver. As shown above, the first device name did not include the device's I2C address. The second device name using the same driver included its I2C address. Of course, there is an configuration that enables you to always include the address of all the device names.
The alternative to using the menu system is the JSON file. In this case, we updated channels for the BME688 and BME680. Not shown are the ThingSpeak Client Name, Username, and Password.
If users configure the DataLogger IoT to always include the device address with the device names (i.e. /Settings/Application Settings with Device Names=1), you will need to match the device names for BME688 and BME680 that were loaded on startup as BME68x [x76] and BME68x [x77], respectively. Note the BME688 device name included a space and [x76] in this case. Remember, we are only interested in plotting hte BME688 and BME680 in this case so we will ignore the MAX17048 that was loaded on startup.
DataLogger IoT Device Names Loaded during Startup Device Name and Channel for Both Sensors with Respective Addresses
Again, the alternative to using the menu system is the JSON file. In this case, we updated channels for the BME688 and BME680. We also included the address name for the BME688 like the configuration menu. Not shown are the ThingSpeak Client Name, Username, and Password.
Save the configuration to persistent memory and exit out of the configuration menu. Wait a few seconds for the DataLogger IoT to read the sensors and output the readings to the Serial Terminal. Open ThingSpeak channels in separate browser windows. In this case, we had the BME688 and the BME680 in private view. You should see sensor readings update and plot on the charts.
ThingSpeak Graphing the BME688 and BME680 in Seperate Channels on Two Browser Windows"},{"location":"example_timestamp/","title":"Adding a Timestamp to Data","text":"
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.
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.
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.
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.
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.
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.
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.
When a Y is entered, the system performs the following:
Set the boot image to the Factory installed firmware
Erase any settings stored in the on-board flash memory
Reboot the device
"},{"location":"file_issue/","title":"Did we make a mistake?","text":"
Spot something wrong? Please let us know.
Attention
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 page for some initial troubleshooting. SparkFun Technical Assistance Page
If you can't find what you need there, you'll need a Forum Account to search product forums and post questions.
"},{"location":"file_issue/#discrepancies-in-the-documentation","title":"Discrepancies in the Documentation","text":"
All of this documentation can be modified by you! Please help us make it better.
The documentation files for these pages are contained in the docs folder of the SparkFun DataLogger IoT repository.
If a section of the documentation is incorrect, please open an issue and let us know.
"},{"location":"file_issue/#do-you-have-a-suggested-correction","title":"Do you have a suggested correction?","text":"
With a GitHub account, fork this repo
Add your correction(s) or improvement(s) to the markdown file(s)
File a pull request with your changes, and enjoy making the words worlds world a better place.
Once received, the documentation specialist will automatically be notified.
We will review your suggested improvement(s) to make sure they are correct and fit within our documentation standards.
"},{"location":"file_issue/#problems-in-the-hardware-design","title":"Problems in the Hardware Design","text":"
All of our designs are open-source! Please help us make it better.
Our board design files are contained in the Hardware folder of the SparkFun DataLogger IoT repository.
"},{"location":"file_issue/#does-something-not-make-sense","title":"Does something not make sense?","text":"
If part of the design is confusing, please open an issue and let us know.
"},{"location":"file_issue/#did-we-forget-to-include-an-important-function-of-the-board","title":"Did we forget to include an important function of the board?","text":"
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.)
If part of the board's functionality is missing, please open an issue and file a feature request.
"},{"location":"file_issue/#do-you-wish-to-contribute-directly-to-improving-the-board-design","title":"Do you wish to contribute directly to improving the board design?","text":"
With a GitHub account, Fork this repo
Add your design improvement(s)
File a pull request with your changes, and enjoy making the words worlds world a better place.
Once received, the engineer in charge of the original design will automatically be notified.
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.)
In this section, we will go over how to connect to the SparkFun DataLogger IoT. At the time of writing, we used the DataLogger IoT - 9DoF. This hardware hookup explained in this section also applies for the DataLogger IoT.
"},{"location":"hardware_hookup/#soldering-to-the-pths","title":"Soldering to the PTHs","text":"
Note
The UART, SPI, analog, and digital I/O pins are not currently supported in the firmware for data logging.
For users that are interested in soldering to the edge of the board, we recommend soldering headers to the PTHs on the breakout for a permanent connection and using jumper wires. Of course, you could also solder wires to the breakout board as well. For a temporary connection during prototyping, you can use IC hooks like these.
If all you want to do is display your sensor readings in a serial terminal or monitor (connected via USB-C) then, strictly, you don\u2019t need to add a microSD card. But of course the whole point of the DataLogger IoT is that it can log readings from whatever sensors you have attached to microSD card. The data is logged in easy-to-read Comma Separated Value (CSV) text format by default. You can also set the format as JSON.
You probably already have a microSD card laying around but if you need any additional units, we have plenty in the store. The DataLogger IoT can use any size microSD card as long as it is formatted correctly. Please ensure your SD card is formatted correctly. There are different software tools available. Some are built into your operating system. We recommend using the Raspberry Pi Imager Tool to easily format the memory card as FAT32 using the GUI. Flip over the DataLogger IoT and you\u2019ll see the latching microSD card socket. Slide in your formatted SD card and it will click neatly into place. Part of the edge of the SD card will stick out when fully inserted in the microSD card socket.
You should only insert or remove the SD card while the power is turned off or disconnected. Removing the card while the DataLogger IoT is logging will almost certainly corrupt your data. You can tell when the board has just logged by observing the addressable RGB LED. When enabled, the LED will blink blue after it has logged one data point.
After you\u2019ve logged some data, you will find a new file on your SD card. There may also be additional files if you manually saved the firmware or preferences to the memory card.
sfe0001.txt: This is the file that contains the CSV or JSON sensor data. The format will depend on how you configured the DataLogger's output. We use .TXT as the file type so that your computer can open it in a simple text editor. The contents are all human-readable. But, if you want to, you can rename it as .CSV or .JSON instead. The file number is incremented for the next logging session.
datalogger.json: This file only appears when you save the settings as your fallback storage. The file will include all preferences saved for any connected device, WiFi credentials, certificates, and keys.
SparkFun_DataLoggerIoT*.bin: This file only appears when you save the firmware to the microSD card. Note that the asterisk (*) is the firmware version number (i.e. SparkFunDataLoggerIoT_01.00.01.bin).
To remove the microSD card, make sure power is disconnected from the DataLogger IoT. Then press the microSD card into the microSD socket. The memory card will be ejected and you will hear a click again. Once the card is ejected, you can insert it into a microSD card adapter or USB reader to be read on a computer.
If you are going to attach extra sensors or any Qwiic-enabled device to the DataLogger IoT, then those need to be connected first before attaching a USB cable. It is a good idea to only attach or disconnect Qwiic sensors when the power is turned off or disconnected. The Qwiic bus is pretty tolerant to \u201chot swapping\u201d, but: disconnecting a sensor while it is in use will confuse the DataLogger IoT software (most likely each value associated with the device will remain constant); and a new sensor won\u2019t be detected until the firmware restarts.
Plug one end of your Qwiic cable into the DataLogger IoT and plug the other end into your sensor. If you want to add extra sensors, you can simply connect them to each other in a daisy chain. You will need a Qwiic cable for each sensor. Our Qwiic Cable Kit covers all the options.
DataLogger IoT and a Qwiic-Enabled Device DataLogger IoT and several Qwiic-Enabled Devices Daisy Chained
Our Qwiic sensors usually all have power indicator LEDs and I2C pull-up resistors. Depending on your application, you may want or need to disable these by cutting the jumper links on the sensor circuit boards. We have a tutorial that will show you how to do that safely.
Sometimes you might want to connect more than one of the same type of sensor to the DataLogger IoT. On the I2C bus, each device needs to have a unique address. On many of our boards, there are jumpers links which you can use to change the address and some have addresses that can be configured in software. But there are some where you cannot change the address - the NAU7802 Qwiic Scale being one example.
Typically one would use a multiplexor. However, we currently do not have the DataLogger IoT configured to work with any multiplexors (i.e. Qwiic Mux Breakout).
Note
Currently the Qwiic Mux is not compatible with the DataLogger IoT.
Please make sure that you use one of our recommended Lithium Ion batteries. Some batteries use the same JST connector as ours but have the opposite polarity. Connecting one of these to your DataLogger IoT will destroy it. If you are going to use your own battery, it is up to you to ensure it has the correct polarity.
Now is a good time to attach a LiPo battery, if you want the DataLogger IoT to keep logging when you disconnect USB-C.
You can connect one of our standard single cell LiPo batteries to the DataLogger IoT and power it for hours, days or weeks depending on what sensors you have attached and how often you log data. The DataLogger IoT has a built-in charger too which will charge your battery at 500mA when USB-C is connected. Please make sure your battery capacity is at least 500mAh (0.5Ah); bad things will happen if you try to charge our smallest batteries at 500mA. The yellow CHG charging LED will light up while the battery is charging and will go out once charging is complete.
Warning
The MCP73831 charge IC on the board is used on a few SparkFun products. For more information about the CHG status LED, we recommend taking look at the Hardware Overview. We also recommend taking a look at this tutorial for Single Cell LiPo Battery Care.
The USB-C connector provides power to the DataLogger IoT and acts as a serial interface for configuration and data display.
If you are going to use a microSD card to store your data, and why wouldn\u2019t you, then insert that first before attaching your USB cable. You should only insert or remove the SD card while the power is turned off or disconnected. Removing the card while the DataLogger IoT is logging will almost certainly corrupt your data.
Likewise, it is a good idea to only attach or disconnect Qwiic sensors when the power is turned off or disconnected. The Qwiic bus is pretty tolerant to \u201chot swapping\u201d, but: disconnecting a sensor while it is in use will confuse the DataLogger IoT software; and a new sensor won\u2019t be detected until the firmware restarts.
Depending on what ports your computer has available, you will need one of the following cables:
USB 2.0 A to C Cable
USB 3.1 A to C Cable
USB 2.0 C to C Cable
Use the cable to connect your DataLogger IoT to your computer and you will see the LEDs light as the DataLogger IoT starts up. The addressable RGB RGB LED will light up green for a second or two while the DataLogger IoT configures itself. It will flash blue while data is being logged to the microSD card. If you have jumped the gun and have a LiPo battery already connected, the yellow CHG charging LED may light up too.
If the addressable RGB LED does not light up, your DataLogger IoT is probably in deep sleep following a previous logging session. Pressing the RST reset button will wake it.
You\u2019ll find full instructions on how to configure the DataLogger IoT later in this tutorial.
For users interested in stacking the Qwiic-enabled device on the DataLogger IoT or mounting in an enclosure, you will need some standoffs to mount the boards. When mounting, note that all four mounting holes are not positioned exactly for a 1.0\"x1.0\" sized Qwiic board. Only two of the four mounting holes are compatible for a 1.0\"x1.0\" sized Qwiic board. For example the image below shows the boards stacked on each side of the DataLogger IoT. On top, the Qwiic GPS (SAM-M10Q) breakout was also able to stack by rotating the board slightly and aligning the mounting holes on the 1.6\"x1.6\" sized board to the other mounting holes
In this section, we will highlight the hardware and pins that are broken out on the SparkFun DataLogger IoT. At the time of writing, we highlighted the SparkFun DataLogger IoT - 9DoF. However, this also applies for the SparkFun DataLogger IoT.
The SparkFun DataLogger is pretty much the same with the exception of the following features listed below. We'll include notes highlighting the differences in each section.
No built - in 6DoF IMU - ISM330DHCX
No built - in magnetometer - MMC5983
The addressable RGB LED - WS2812 is replaced with the side emitting addressable RGB LED - B3DQ3BRG
No IMU INT2 jumper
No Mag INT jumper
Included MEAS PTH Jumper
The \"35 / A7\" PTH on the edge of the board is replace with a \"5\" PTH.
The DataLogger IoT is populated with Espressif's ESP32-WROOM-32E module. Espressif's ESP32 WROOM ubiquitous IoT microcontroller is a powerful WiFi, BT, and BLE MCU module that targets a wide variety of applications. For the DataLogger IoT, the firmware currently utilizes the WiFi feature.
Note
Currently the DataLogger IoT does not have BT or BLE. However, BT or BLE is being considered on a future firmware build to include this as a feature.
There are a variety of power and power-related nets broken out to connectors and through hole pads. Below list a few methods of powering the board up. There are protection diodes for the USB-C, 5V pin, and single cell LiPo battery. Power is regulated down to 3.3V for the system voltage. Depending on the settings and what is connected to the DataLogger IoT, the board can pull a minimum of 200\u00b5A in low power mode by itself.
USB-C
5V Pin
Single Cell LiPo Battery
3V3 Pin
"},{"location":"hardware_overview/#usb-c-and-5v","title":"USB-C and 5V","text":"
The DataLogger IoT comes equipped with a USB type C socket which you can use to connect it to your computer to view the output and configuration through the serial terminal, or plug in a USB-C power supply. The DataLogger IoT includes the configuration channel resistors needed to tell the power supply to deliver 5V. You can use your USB-C laptop charger as the power source should you need to, even though it normally delivers a much higher voltage.
There is also a 5V power input pin. You can use this to feed in 5V power from an external source. The maximum voltage is 6.0V. The 5V pin is diode-protected and so is the USB-C power input, so it is OK to have both connected at the same time. This pin is ideal if you want to power your DataLogger from regulated solar power or a different type of power supply. You can not use the 5V pin as an output.
Voltage from the USB is regulated down to the XC6222 3.3V/700mA voltage regulators for the system voltage and Qwiic-enabled devices. USB power is also connected to the MCP73831 to charge a single cell LiPo battery at a default rate of 500mA.
For customers in North America, our NEMA Raspberry Pi Wall Adapter is a perfect choice. You can power the DataLogger IoT from our USB Battery Pack / Power Bank - TOL-15204 but you will need a USB-C cable too:
Our USB 2.0 A to C Cable - CAB-15092 will do nicely
Our USB 3.1 A to C Cable - CAB-14743 is a good choice too
"},{"location":"hardware_overview/#lipo-battery-input-charger-and-fuel-gauge","title":"LiPo Battery Input, Charger, and Fuel Gauge","text":"
Warning
Battery Polarity: Please make sure that you use one of our recommended Lithium Ion batteries. Some batteries use the same JST connector as ours but have the opposite polarity. Connecting one of these to your DataLogger IoT will destroy it. If you are going to use your own battery, it is up to you to ensure it has the correct polarity.
But of course you\u2019re going to want to use the DataLogger IoT to log sensor data while on the move too. You can connect one of our standard single cell LiPo batteries to the DataLogger IoT and power it for hours, days or weeks depending on what sensors you have attached and how often you log data. The DataLogger IoT uses the built-in MCP73831 charger too which will charge your battery at 500mA when USB-C is connected. Please make sure your battery capacity is at least 500mAh (0.5Ah); bad things will happen if you try to charge our smallest batteries at 500mA. The board also includes the MAX17048 LiPo Fuel Gauge which allows you to determine how much power your LiPo battery has available. The 2-pin JST connector pins are broken out to PTHs on the edge of the board if you decide to solder a single cell LiPo battery directly to the board or power another device.
For those going the old school route, you can also bypass the voltage regulators by soldering directly to the 3V3 and GND pin to provide power if your application has a regulated 3.3V. Note that this is only connected to the system voltage. You will also need to provide power to the 3V3 SWCH or Qwiic-enabled devices should you decide to bypass the voltage regulator.
The top side of the board includes a CH340 USB-to-Serial Converter. The chip can be used to send serial data between the device and computer. You can view the output or configure the device through a serial terminal.
The driver should automatically install on most operating systems. However, there is a wide range of operating systems out there. You may need to install drivers the first time you connect the chip to your computer's USB port or when there are operating system updates. For more information, check out our How to Install CH340 Drivers Tutorial.
How to Install CH340 Drivers"},{"location":"hardware_overview/#uart","title":"UART","text":"
The hardware serial UART pins are broken out on the edge of the board. For more information about Serial UART, check out the tutorial about Serial Communication for more information.
TXD: UART transmit pin. This is connected to pin 16.
RXD: UART receive pin. This is connected to pin 17.
Note
The UART pins are not currently supported in the firmware for data logging.
"},{"location":"hardware_overview/#qwiic-and-i2c","title":"Qwiic and I2C","text":"
Note
You may notice a thin film over the vertial Qwiic connector. This is used by a pick-and-place machine when populating the component on the board before it goes through the reflow oven. This can be removed if you decide to use the vertical Qwiic connector with Qwiic-enabled devices.
SparkFun's Qwiic Connect System uses 4-pin JST style connectors to quickly interface development boards with I2C sensors and more. No soldering required and there's no need to worry about accidentally swapping the SDA and SCL wires. The Qwiic connector is polarized so you know you\u2019ll have it wired correctly every time, right from the start. Qwiic boards are daisy chain-able too so you can connect multiple sensors to the DataLogger IoT and log readings from all of them.
The board is populated with vertical and horizontal Qwiic connectors. These are also broken out to PTHs on the edge of the board.
SCL: I2C clock pin. This is connected to pin 22 and a 2.2k\u03a9 pull-up resistor.
SDA: I2C data pin. This is connected to pin 21 and a 2.2k\u03a9 pull-up resistor.
3V3 SW: The 3.3v pin is connected to the XC6222 voltage regulator's output to power the Qwiic devices.
GND: Common, ground voltage (0V reference) for the system
Connected to the line I2C line is the MAX17048 LiPo fuel gauge (7-bit unshifted address = 0x36).
Sometimes you might want to connect more than one of the same type of sensor to the DataLogger IoT. On the I2C bus, each device needs to have a unique address. On many of our boards, there are jumpers links which you can use to change the address and some have addresses that can be configured in software. But there are some where you cannot change the address. Typically, one would use a multiplexor. However, we currently do not have the DataLogger IoT configured to work with any multiplexors (i.e. Qwiic Mux Breakout).
Note
Currently the Qwiic Mux is not compatible with the DataLogger IoT.
The DataLogger IoT includes a dedicated 3.3V regulator for the Qwiic connector. This has several advantages including:
The DataLogger IoT can completely power-down the I2C sensors during sleep to prolong your battery life
There\u2019s no risk of the Qwiic bus gulping too much current and causing problems for the ESP32
Besides the built-in ISM330DHCX and MMC5983MA, the SPI pins are not currently supported in the firmware for data logging.
The SPI pins are broken out on the edge of the board. For those that are unfamiliar to PICO and POCI, check out the SPI tutorial for more information.
SCK: SPI clock pin. This is connect to pin 18.
PICO: SPI Peripheral In Controller Out. This is connected to pin 23.
POCI: SPI Peripheral Out Controller In. This is connected to pin 19.
Not shown in the image are the chip select (CS) pins. The 6DoF IMU's CS pin is connected to pin 5. The magnetometer's CS pin is connected to pin 27 which is not broken out.
Note
On the DataLogger IoT, the IMU and magnetometer are not connected to the SPI port since they are not included on the board. Instead of pin \"35 / A7\" being broken out, pin \"5\" is broken out on the edge of the board.
The DataLogger IoT supports full 4-bit SDIO for fast logging and uses common microSD cards to record clear text, comma separated files. Flip over the DataLogger IoT and you'll see the latching microSD card socket. You probably already have a microSD card laying around. However, if you need any additional units, we have plenty in the SparkFun catalog. The DataLogger can use any size microSD card and supports FAT32 cards in addition to FAT16. Please ensure that your SD card is formatted correctly; we recommend the Raspberry Pi Imager Tool.
Slide in your formatted SD card and it will click neatly into place. The edge of the SD card will stick out on the edge of the circuit board when it is inserted correctly.
Warning
You should only insert or remove the SD card while the power is turned off or disconnected. Removing the card while the DataLogger IoT is logging will almost certainly corrupt your data.
"},{"location":"hardware_overview/#9-degrees-of-freedom-9dof","title":"9 Degrees of Freedom (9DOF)","text":"
As stated earlier, included on every DataLogger IoT - 9DoF is a 6DoF Inertial Measurement Unit (IMU) for built-in logging of triple-axis accelerometer and gyro. There is also a built-in triple-axis magnetometer for a complete 9 degrees of freedom. Beside each IC is a silkcreen showing the reference axis. Both are connected to the ESP32 via the SPI port. Combined, you have 9 degrees of inertial measurement! Whereas the original 9DOF Razor used the old MPU-9250, this uses the ISM330DHCX and MMC5983MA. Oh, and if that wasn\u2019t enough, it comes with a built-in temperature sensor on each IC too. So if you want to use the DataLogger IoT as a transportation logger, it will do that straight out of the anti-static bag!
Note
For users using the SparkFun DataLogger, there 6DoF IMU and magnetometer is not populated on the board. The associated silkscreen and jumpers for the sensors are also not included on the board.
The analog pins are not currently supported in the firmware for data logging.
There are three 12-bit analog pins available and broken out on edge of the board.
36 / A0: Analog A0. This is connected to pin 36.
39 / A3: Analog A3. This is connected to pin 39.
35 / A7: Analog A7. This is connected to pin 35.
Note
Instead of pin \"35 / A7\" being broken out on the DataLogger IoT, pin \"5\" is broken out on the edge of the board.
"},{"location":"hardware_overview/#reset-and-boot-buttons","title":"Reset and Boot Buttons","text":"
Note
You may notice a thin film over buttons. This is used by a pick-and-place machine when populating the component on the board before it goes through the reflow oven. This can be removed.
There are two buttons available on the board for reset and boot. These are also broken out on the edge of the board as PTHs. If you have your DataLogger IoT mounted in an enclosure, you can also attach an external boot or reset switch too. Any Single Pole Normally-Open Push-To-Close momentary switch will do. Solder pin headers or wires to the RST and GND breakout pins and connect your external switch to those.
RESET: Pressing this button will pull the pin LOW and reset the program running on the ESP32 without unplugging the board.
BOOT: The boot button usually allows users to force the ESP32 into bootloader mode to manually flash new firmware to the ESP32. The ESP32 will remain in this mode until there is a power cycle or the reset button is pressed. As of firmware v01.00.02, this button has an extra function: pressing down on the user button for 20 seconds will erase on-board preference storage and restart the board. This is connected to pin 0 on the ESP32.
Like other ESP32 development boards, these buttons are populated so that users can place the ESP32 module in bootloader mode. For users that need to place the board in bootloader mode when powered, you will need to:
Press the BOOT button.
While holding on the BOOT button, press the RESET button momentarily.
Finally, release the BOOT button.
Most of the time, users will simply have the board executing the firmware that is loaded on the ESP32 module and updating through the configuration menu either through the microSD card or OTA.
Danger
Please think very carefully before uploading any Arduino sketches to your DataLogger IoT.
You will overwrite the DataLogger IoT firmware, leaving it unable to update or restore itself.
The 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.
There are three LEDs populated on the board. These can be disabled with their respective jumpers on the back of the board.
STAT: The status LED is connected to pin 25.
RGB: The WS2812-2020 RGB addressable LED is connected to pin 26. In addition to being disabled through the jumper on the back, you can also disable the LED through software. The following colors represent different states that the board is in.
White: A solid white LED indicates that the board is currently being configured through the configuration menu.
Green: A solid green LED indicates that the board is initializing. As of firmware v01.00.02, the LED blinks green when on battery power indicating that the battery level is VBATT > 50%.
Blue: A blinking blue LED indicates that the board is reading sensor data and logging the values.
Yellow: A solid yellow LED indicates that a firmware update is in progress. As of firmware v01.00.02, the LED blinks yellow when on battery power indicating that the battery level is between 50% > VBATT > 10%.
Red: As of firmware v01.00.02, the LED blinks red when on battery power indicating that the battery level is VBATT < 10%.
CHG: The on-board yellow CHG LED can be used to get an indication of the charge status of your battery. Below is a table of other status indicators depending on the state of the charge IC.
Charge State LED status No Battery Floating (should be OFF, but may flicker) Shutdown Floating (should be OFF, but may flicker) Charging ON Charge Complete OFF
Note
On the DataLogger IoT, we included the B3DQ3BRG addressable RGB LED instead of the WS2812 with the light emitting from the top of the IC. This side emitting LED uses the same protocol as the WS2812 and was a design choice for users placing the board in an enclosure.
There are seven jumpers on the back of the DataLogger IoT - 9DoF. For more information, check out our tutorial on working with jumper pads and PCB traces should you decide to cut the traces with a hobby knife.
SHLD: This jumper connects the USB Type C connector's shield pin to GND. Cut this to isolate the USB Type C connector's shield pin.
I2C: This three way jumper labeled as I2C are closed by default. By cutting the jumpers, it will disconnect the 2.2k\u03a9 pull-up resistors for the I2C bus. Most of the time you can leave these alone unless your project requires you to disconnect the pull-up resistors.
STAT: This jumper connects the status LED to pin 25 and it is closed by default. Open the jumper to disable the LED.
RGB: This jumper connects the WS2812-2020 RGB addressable LED to pin 26 and it is closed by default. Open the jumper to disable the LED.
CHG: This jumper connects the charge LED on the MCP73831 charge IC and it is closed by default. Open the jumper to disable the LED.
IMU INT2: This jumper connects the ISM330DHCX IMU's interrupt pin to pin 35 and it is open by default. Add a solder jumper to connect.
MAG INT: This jumper connects the MMC5983MA magnetometer's interrupt pin to pin 35 and it is open by default. Add a solder jumper to connect.
Note
On the DataLogger IoT, the IMU INT2 or MAG INT jumpers are not included since it does not have the built in 6DoF IMU or magnetometer. With the extra real estate on the board, we were able to include a MEAS PTH and jumper on the board. By default, the jumper is closed. You can cut this jumper on the bottom side of the board to measure the DataLogger IoT\u2019s current draw from external power.
The overall length and width with the antenna connector is about 1.66\" x 2.00\". There are four mounting holes in the center of the board. Due to the size of the board and the ESP32 module, the mounting holes are positioned in a way for users to add two Qwiic enabled boards with a width of 1.0\" instead of one Qwiic board.
The SparkFun DataLogger IoT is a data logger that comes preprogrammed to automatically log IMU, GPS, and various pressure, humidity, and distance sensors. All without writing a single line of code! They come in two flavors: The SparkFun DataLogger IoT - 9DoF and the SparkFun DataLogger IoT. Both versions of the DataLogger IoT automatically detects, configures, and logs Qwiic sensors. It was specifically designed for users who just need to capture a lot of data to a CSV or JSON file, and get back to their larger project. Save the data to a microSD card or send it wirelessly to your preferred Internet of Things (IoT) service!
SparkFun DataLogger IoT - 9DoF DEV-20594 Purchase from SparkFun
SparkFun DataLogger IoT DEV-22462 Purchase from SparkFun
Please make sure that you use one of our recommended Lithium Ion batteries. Some batteries use the same JST connector as ours but have the opposite polarity. Connecting one of these to your DataLogger IoT will destroy it. If you are going to use your own battery, it is up to you to ensure it has the correct polarity.
To follow along with this tutorial, you will need the following materials. You may not need everything though depending on what you have. Add it to your cart, read through the guide, and adjust the cart as necessary.
1x SparkFun DataLogger IoT
SparkFun DataLogger IoT - 9DoF [DEV-20594]
SparkFun DataLogger IoT [DEV-22462]
1x microSD card formatted with FAT32 [COM-15107]
1x A USB-C cable for configuring and LiPo charging
Our USB 2.0 A to C Cable [CAB-15092] will do nicely
Our USB 3.1 A to C Cable [CAB-14743] is a good choice too
1x Lithium Ion Battery
At least one Qwiic cable
A single 50mm Cable is all you need to get going
Our Qwiic Cable Kit covers all the options
At least one Qwiic enabled devices that is compatible that you may need
SparkFun DataLogger IoT - 9DoF DEV-20594
USB 3.1 Cable A to C - 3 Foot CAB-14743
microSD Card - 1GB (Class 4) COM-15107
Qwiic Cable - 50mm PRT-14426
Lithium Ion Battery - 1250mAh (IEC62133 Certified) PRT-18286
Straight out of the box anti-static bag, the DataLogger IoT is ready to log data from its built-in ISM330DHCX Inertial Measurement Unit (IMU) and MMC5983MA magnetometer. Only want to log magnetometer, accelerometer, gyro or temperature data? You\u2019re good to go! But the fun is only just beginning\u2026
The DataLogger IoT is preprogrammed to automatically log data from all of the following sensors, so you may wish to add one or more of these to your shopping cart too. (More sensors are being added all the time and it is really easy to upgrade the DataLogger IoT to support them. But we'll get to that in a moment!). Currently, auto-detection is supported on the following Qwiic-enabled products (with the exception of the ISM330DHCX and MMC5983 which is built-in on the SPI port):
Note
For a list of supported devices based on the firmware, you can check out the list of supported Qwiic Devices in the appendix. We simply categorized the supported devices below based on the type.
Any u-Blox GNSS Modules (Lat/Long, Altitude, Velocity, SIV, Time, Date) such as:
ZED-F9P 1cm High Precision GPS
NEO-M8P 2.5cm High Precision GPS
SAM-M10Q 1.5m GPS
SAM-M8Q 1.5m 72 Channel GPS
ZOE-M8Q 1.5m Compact GPS
NEO-M9N 1.5m GPS
MAX-M10S 1.5m Ultra-Low Power GPS
Inertial Measurement Unit (Accelerometer and Gyro):
ISM330DHCX IMU (Built-in for the 9DoF version via SPI)
Magnetometer:
MMC5983 (Built-in for the 9DoF version via SPI)
Distance:
STHS34PF80] Human Presence Sensor - 4 Meter
TMF8820 dToF Imager
TMF8821 dToF Imager
VCNL4040 Proximity and Lux
VL53L1X Distance - 4 Meter
VL53L4 Distance - 1.3 Meter
VL53L5 ToF Imager
Pressure, Altitude, Humidity and Temperature Data:
BME280 Atmospheric
LPS25HB Absolute Pressure
MPR Series - MPRLS0025PA00001A MicroPressure
MS8607 Pressure, Humidity, and Temperature
MS5637 Barometric Pressure and Temperature
AHT20 Humidity and Temperature
SHTC3 Humidity and Temperature
SDP31 Differential Pressure
BMP384 Pressure and Temperature
BMP581 Pressure and Temperature
Air Quality and Environmental Sensors:
CCS811 Air Quality (CO2 and VOC)
ENS160 Indoor Air Quality (AQI, eCO2, and TVOC)
PASCO2V01 Air Quality (CO2)
SGP30 Air Quality (TVOC, CO2, H2, Ethanol)
SGP40 Air Quality (VOC, Humidity, Temperature)
SCD30 CO2, Humidity, and Temperature
SCD40 CO2, Humidity, and Temperature
BME680 Air Quality (Pressure, Humidity, Temperature, Gas, VOCs)
If you aren't familiar with the Qwiic system, we recommend reading here for an overview.
Qwiic Connect System
If you aren\u2019t familiar with the following concepts, we also recommend checking out a few of these tutorials before continuing.
Accelerometer Basics
Gyroscope
Qwiic 9DoF - ISM330DHCX, MMC5983MA Hookup Guide
Serial Terminal Basics
How to Work with Jumper Pads and PCB Traces
I2C
Battery Technologies
Single Cell LiPo Battery Care
"},{"location":"prepare_your_microsd_card/","title":"Preparing Your MicroSD Card","text":"
Not all microSD cards are created equal. The capacity, read/write speed, and format 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.
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.
"},{"location":"prepare_your_microsd_card/#checking-microsd-card-format-windows","title":"Checking MicroSD Card Format - Windows","text":"
To check to see if it is the correct format on a Windows you could head to the drive, right click, and select Properties.
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.
"},{"location":"prepare_your_microsd_card/#checking-microsd-card-format-macos","title":"Checking MicroSD Card Format - macOS","text":"
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.
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.
"},{"location":"prepare_your_microsd_card/#download-raspberry-pi-imager","title":"Download Raspberry Pi Imager","text":"
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. 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.
Raspberry Pi Imager Tool"},{"location":"prepare_your_microsd_card/#formatting-as-fat32-using-the-raspberry-pi-imager","title":"Formatting as FAT32 using the Raspberry Pi Imager","text":"
After downloading and installing the software, open the Raspberry Pi Imager.
Under \"Operating System\", select \"Erase\" to \"format card as FAT32.\"
Under \"Storage\", select the drive that the microSD card appeared as on your computer.
When ready, select \"Write\". After a few minutes, the microSD card should be formatted with FAT32.
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.
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:
The SparkFun DataLogger IoT is a data logger that comes preprogrammed to automatically log IMU, GPS, and various pressure, humidity, and distance sensors. All without writing a single line of code! They come in two flavors: The SparkFun DataLogger IoT - 9DoF and the SparkFun DataLogger IoT. Both versions of the DataLogger IoT automatically detects, configures, and logs Qwiic sensors. It was specifically designed for users who just need to capture a lot of data to a CSV or JSON file, and get back to their larger project. Save the data to a microSD card or send it wirelessly to your preferred Internet of Things (IoT) service!
SparkFun DataLogger IoT - 9DoF DEV-20594 Purchase from SparkFun
SparkFun DataLogger IoT DEV-22462 Purchase from SparkFun
Please make sure that you use one of our recommended Lithium Ion batteries. Some batteries use the same JST connector as ours but have the opposite polarity. Connecting one of these to your DataLogger IoT will destroy it. If you are going to use your own battery, it is up to you to ensure it has the correct polarity.
To follow along with this tutorial, you will need the following materials. You may not need everything though depending on what you have. Add it to your cart, read through the guide, and adjust the cart as necessary.
1x SparkFun DataLogger IoT
SparkFun DataLogger IoT - 9DoF [DEV-20594]
SparkFun DataLogger IoT [DEV-22462]
1x microSD card formatted with FAT32 [COM-15107]
1x A USB-C cable for configuring and LiPo charging
Our USB 2.0 A to C Cable [CAB-15092] will do nicely
Our USB 3.1 A to C Cable [CAB-14743] is a good choice too
1x Lithium Ion Battery
At least one Qwiic cable
A single 50mm Cable is all you need to get going
Our Qwiic Cable Kit covers all the options
At least one Qwiic enabled devices that is compatible that you may need
SparkFun DataLogger IoT - 9DoF DEV-20594
USB 3.1 Cable A to C - 3 Foot CAB-14743
microSD Card - 1GB (Class 4) COM-15107
Qwiic Cable - 50mm PRT-14426
Lithium Ion Battery - 1250mAh (IEC62133 Certified) PRT-18286
Straight out of the box anti-static bag, the DataLogger IoT is ready to log data from its built-in ISM330DHCX Inertial Measurement Unit (IMU) and MMC5983MA magnetometer. Only want to log magnetometer, accelerometer, gyro or temperature data? You\u2019re good to go! But the fun is only just beginning\u2026
The DataLogger IoT is preprogrammed to automatically log data from all of the following sensors, so you may wish to add one or more of these to your shopping cart too. (More sensors are being added all the time and it is really easy to upgrade the DataLogger IoT to support them. But we'll get to that in a moment!). Currently, auto-detection is supported on the following Qwiic-enabled products (with the exception of the ISM330DHCX and MMC5983 which is built-in on the SPI port):
Note
For a list of supported devices based on the firmware, you can check out the list of supported Qwiic Devices in the appendix. We simply categorized the supported devices below based on the type.
Any u-Blox GNSS Modules (Lat/Long, Altitude, Velocity, SIV, Time, Date) such as:
ZED-F9P 1cm High Precision GPS
NEO-M8P 2.5cm High Precision GPS
SAM-M10Q 1.5m GPS
SAM-M8Q 1.5m 72 Channel GPS
ZOE-M8Q 1.5m Compact GPS
NEO-M9N 1.5m GPS
MAX-M10S 1.5m Ultra-Low Power GPS
Inertial Measurement Unit (Accelerometer and Gyro):
ISM330DHCX IMU (Built-in for the 9DoF version via SPI)
Magnetometer:
MMC5983 (Built-in for the 9DoF version via SPI)
Distance:
STHS34PF80] Human Presence Sensor - 4 Meter
TMF8820 dToF Imager
TMF8821 dToF Imager
VCNL4040 Proximity and Lux
VL53L1X Distance - 4 Meter
VL53L4 Distance - 1.3 Meter
VL53L5 ToF Imager
Pressure, Altitude, Humidity and Temperature Data:
BME280 Atmospheric
LPS25HB Absolute Pressure
MPR Series - MPRLS0025PA00001A MicroPressure
MS8607 Pressure, Humidity, and Temperature
MS5637 Barometric Pressure and Temperature
AHT20 Humidity and Temperature
SHTC3 Humidity and Temperature
SDP31 Differential Pressure
BMP384 Pressure and Temperature
BMP581 Pressure and Temperature
Air Quality and Environmental Sensors:
CCS811 Air Quality (CO2 and VOC)
ENS160 Indoor Air Quality (AQI, eCO2, and TVOC)
PASCO2V01 Air Quality (CO2)
SGP30 Air Quality (TVOC, CO2, H2, Ethanol)
SGP40 Air Quality (VOC, Humidity, Temperature)
SCD30 CO2, Humidity, and Temperature
SCD40 CO2, Humidity, and Temperature
BME680 Air Quality (Pressure, Humidity, Temperature, Gas, VOCs)
In this section, we will highlight the hardware and pins that are broken out on the SparkFun DataLogger IoT. At the time of writing, we highlighted the SparkFun DataLogger IoT - 9DoF. However, this also applies for the SparkFun DataLogger IoT.
The SparkFun DataLogger is pretty much the same with the exception of the following features listed below. We'll include notes highlighting the differences in each section.
No built - in 6DoF IMU - ISM330DHCX
No built - in magnetometer - MMC5983
The addressable RGB LED - WS2812 is replaced with the side emitting addressable RGB LED - B3DQ3BRG
No IMU INT2 jumper
No Mag INT jumper
Included MEAS PTH Jumper
The \"35 / A7\" PTH on the edge of the board is replace with a \"5\" PTH.
The DataLogger IoT is populated with Espressif's ESP32-WROOM-32E module. Espressif's ESP32 WROOM ubiquitous IoT microcontroller is a powerful WiFi, BT, and BLE MCU module that targets a wide variety of applications. For the DataLogger IoT, the firmware currently utilizes the WiFi feature.
Note
Currently the DataLogger IoT does not have BT or BLE. However, BT or BLE is being considered on a future firmware build to include this as a feature.
There are a variety of power and power-related nets broken out to connectors and through hole pads. Below list a few methods of powering the board up. There are protection diodes for the USB-C, 5V pin, and single cell LiPo battery. Power is regulated down to 3.3V for the system voltage. Depending on the settings and what is connected to the DataLogger IoT, the board can pull a minimum of 200\u00b5A in low power mode by itself.
USB-C
5V Pin
Single Cell LiPo Battery
3V3 Pin
"},{"location":"single_page/#usb-c-and-5v","title":"USB-C and 5V","text":"
The DataLogger IoT comes equipped with a USB type C socket which you can use to connect it to your computer to view the output and configuration through the serial terminal, or plug in a USB-C power supply. The DataLogger IoT includes the configuration channel resistors needed to tell the power supply to deliver 5V. You can use your USB-C laptop charger as the power source should you need to, even though it normally delivers a much higher voltage.
There is also a 5V power input pin. You can use this to feed in 5V power from an external source. The maximum voltage is 6.0V. The 5V pin is diode-protected and so is the USB-C power input, so it is OK to have both connected at the same time. This pin is ideal if you want to power your DataLogger from regulated solar power or a different type of power supply. You can not use the 5V pin as an output.
Voltage from the USB is regulated down to the XC6222 3.3V/700mA voltage regulators for the system voltage and Qwiic-enabled devices. USB power is also connected to the MCP73831 to charge a single cell LiPo battery at a default rate of 500mA.
For customers in North America, our NEMA Raspberry Pi Wall Adapter is a perfect choice. You can power the DataLogger IoT from our USB Battery Pack / Power Bank - TOL-15204 but you will need a USB-C cable too:
Our USB 2.0 A to C Cable - CAB-15092 will do nicely
Our USB 3.1 A to C Cable - CAB-14743 is a good choice too
"},{"location":"single_page/#lipo-battery-input-charger-and-fuel-gauge","title":"LiPo Battery Input, Charger, and Fuel Gauge","text":"
Warning
Battery Polarity: Please make sure that you use one of our recommended Lithium Ion batteries. Some batteries use the same JST connector as ours but have the opposite polarity. Connecting one of these to your DataLogger IoT will destroy it. If you are going to use your own battery, it is up to you to ensure it has the correct polarity.
But of course you\u2019re going to want to use the DataLogger IoT to log sensor data while on the move too. You can connect one of our standard single cell LiPo batteries to the DataLogger IoT and power it for hours, days or weeks depending on what sensors you have attached and how often you log data. The DataLogger IoT uses the built-in MCP73831 charger too which will charge your battery at 500mA when USB-C is connected. Please make sure your battery capacity is at least 500mAh (0.5Ah); bad things will happen if you try to charge our smallest batteries at 500mA. The board also includes the MAX17048 LiPo Fuel Gauge which allows you to determine how much power your LiPo battery has available. The 2-pin JST connector pins are broken out to PTHs on the edge of the board if you decide to solder a single cell LiPo battery directly to the board or power another device.
For those going the old school route, you can also bypass the voltage regulators by soldering directly to the 3V3 and GND pin to provide power if your application has a regulated 3.3V. Note that this is only connected to the system voltage. You will also need to provide power to the 3V3 SWCH or Qwiic-enabled devices should you decide to bypass the voltage regulator.
The top side of the board includes a CH340 USB-to-Serial Converter. The chip can be used to send serial data between the device and computer. You can view the output or configure the device through a serial terminal.
The driver should automatically install on most operating systems. However, there is a wide range of operating systems out there. You may need to install drivers the first time you connect the chip to your computer's USB port or when there are operating system updates. For more information, check out our How to Install CH340 Drivers Tutorial.
How to Install CH340 Drivers"},{"location":"single_page/#uart","title":"UART","text":"
The hardware serial UART pins are broken out on the edge of the board. For more information about Serial UART, check out the tutorial about Serial Communication for more information.
TXD: UART transmit pin. This is connected to pin 16.
RXD: UART receive pin. This is connected to pin 17.
Note
The UART pins are not currently supported in the firmware for data logging.
"},{"location":"single_page/#qwiic-and-i2c","title":"Qwiic and I2C","text":"
Note
You may notice a thin film over the vertial Qwiic connector. This is used by a pick-and-place machine when populating the component on the board before it goes through the reflow oven. This can be removed if you decide to use the vertical Qwiic connector with Qwiic-enabled devices.
SparkFun's Qwiic Connect System uses 4-pin JST style connectors to quickly interface development boards with I2C sensors and more. No soldering required and there's no need to worry about accidentally swapping the SDA and SCL wires. The Qwiic connector is polarized so you know you\u2019ll have it wired correctly every time, right from the start. Qwiic boards are daisy chain-able too so you can connect multiple sensors to the DataLogger IoT and log readings from all of them.
The board is populated with vertical and horizontal Qwiic connectors. These are also broken out to PTHs on the edge of the board.
SCL: I2C clock pin. This is connected to pin 22 and a 2.2k\u03a9 pull-up resistor.
SDA: I2C data pin. This is connected to pin 21 and a 2.2k\u03a9 pull-up resistor.
3V3 SW: The 3.3v pin is connected to the XC6222 voltage regulator's output to power the Qwiic devices.
GND: Common, ground voltage (0V reference) for the system
Connected to the line I2C line is the MAX17048 LiPo fuel gauge (7-bit unshifted address = 0x36).
Sometimes you might want to connect more than one of the same type of sensor to the DataLogger IoT. On the I2C bus, each device needs to have a unique address. On many of our boards, there are jumpers links which you can use to change the address and some have addresses that can be configured in software. But there are some where you cannot change the address. Typically, one would use a multiplexor. However, we currently do not have the DataLogger IoT configured to work with any multiplexors (i.e. Qwiic Mux Breakout).
Note
Currently the Qwiic Mux is not compatible with the DataLogger IoT.
The DataLogger IoT includes a dedicated 3.3V regulator for the Qwiic connector. This has several advantages including:
The DataLogger IoT can completely power-down the I2C sensors during sleep to prolong your battery life
There\u2019s no risk of the Qwiic bus gulping too much current and causing problems for the ESP32
Besides the built-in ISM330DHCX and MMC5983MA, the SPI pins are not currently supported in the firmware for data logging.
The SPI pins are broken out on the edge of the board. For those that are unfamiliar to PICO and POCI, check out the SPI tutorial for more information.
SCK: SPI clock pin. This is connect to pin 18.
PICO: SPI Peripheral In Controller Out. This is connected to pin 23.
POCI: SPI Peripheral Out Controller In. This is connected to pin 19.
Not shown in the image are the chip select (CS) pins. The 6DoF IMU's CS pin is connected to pin 5. The magnetometer's CS pin is connected to pin 27 which is not broken out.
Note
On the DataLogger IoT, the IMU and magnetometer are not connected to the SPI port since they are not included on the board. Instead of pin \"35 / A7\" being broken out, pin \"5\" is broken out on the edge of the board.
The DataLogger IoT supports full 4-bit SDIO for fast logging and uses common microSD cards to record clear text, comma separated files. Flip over the DataLogger IoT and you'll see the latching microSD card socket. You probably already have a microSD card laying around. However, if you need any additional units, we have plenty in the SparkFun catalog. The DataLogger can use any size microSD card and supports FAT32 cards in addition to FAT16. Please ensure that your SD card is formatted correctly; we recommend the Raspberry Pi Imager Tool.
Slide in your formatted SD card and it will click neatly into place. The edge of the SD card will stick out on the edge of the circuit board when it is inserted correctly.
Warning
You should only insert or remove the SD card while the power is turned off or disconnected. Removing the card while the DataLogger IoT is logging will almost certainly corrupt your data.
"},{"location":"single_page/#9-degrees-of-freedom-9dof","title":"9 Degrees of Freedom (9DOF)","text":"
As stated earlier, included on every DataLogger IoT - 9DoF is a 6DoF Inertial Measurement Unit (IMU) for built-in logging of triple-axis accelerometer and gyro. There is also a built-in triple-axis magnetometer for a complete 9 degrees of freedom. Beside each IC is a silkcreen showing the reference axis. Both are connected to the ESP32 via the SPI port. Combined, you have 9 degrees of inertial measurement! Whereas the original 9DOF Razor used the old MPU-9250, this uses the ISM330DHCX and MMC5983MA. Oh, and if that wasn\u2019t enough, it comes with a built-in temperature sensor on each IC too. So if you want to use the DataLogger IoT as a transportation logger, it will do that straight out of the anti-static bag!
Note
For users using the SparkFun DataLogger, there 6DoF IMU and magnetometer is not populated on the board. The associated silkscreen and jumpers for the sensors are also not included on the board.
The analog pins are not currently supported in the firmware for data logging.
There are three 12-bit analog pins available and broken out on edge of the board.
36 / A0: Analog A0. This is connected to pin 36.
39 / A3: Analog A3. This is connected to pin 39.
35 / A7: Analog A7. This is connected to pin 35.
Note
Instead of pin \"35 / A7\" being broken out on the DataLogger IoT, pin \"5\" is broken out on the edge of the board.
"},{"location":"single_page/#reset-and-boot-buttons","title":"Reset and Boot Buttons","text":"
Note
You may notice a thin film over buttons. This is used by a pick-and-place machine when populating the component on the board before it goes through the reflow oven. This can be removed.
There are two buttons available on the board for reset and boot. These are also broken out on the edge of the board as PTHs. If you have your DataLogger IoT mounted in an enclosure, you can also attach an external boot or reset switch too. Any Single Pole Normally-Open Push-To-Close momentary switch will do. Solder pin headers or wires to the RST and GND breakout pins and connect your external switch to those.
RESET: Pressing this button will pull the pin LOW and reset the program running on the ESP32 without unplugging the board.
BOOT: The boot button usually allows users to force the ESP32 into bootloader mode to manually flash new firmware to the ESP32. The ESP32 will remain in this mode until there is a power cycle or the reset button is pressed. As of firmware v01.00.02, this button has an extra function: pressing down on the user button for 20 seconds will erase on-board preference storage and restart the board. This is connected to pin 0 on the ESP32.
Like other ESP32 development boards, these buttons are populated so that users can place the ESP32 module in bootloader mode. For users that need to place the board in bootloader mode when powered, you will need to:
Press the BOOT button.
While holding on the BOOT button, press the RESET button momentarily.
Finally, release the BOOT button.
Most of the time, users will simply have the board executing the firmware that is loaded on the ESP32 module and updating through the configuration menu either through the microSD card or OTA.
Danger
Please think very carefully before uploading any Arduino sketches to your DataLogger IoT.
You will overwrite the DataLogger IoT firmware, leaving it unable to update or restore itself.
The 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.
There are three LEDs populated on the board. These can be disabled with their respective jumpers on the back of the board.
STAT: The status LED is connected to pin 25.
RGB: The WS2812-2020 RGB addressable LED is connected to pin 26. In addition to being disabled through the jumper on the back, you can also disable the LED through software. The following colors represent different states that the board is in.
White: A solid white LED indicates that the board is currently being configured through the configuration menu.
Green: A solid green LED indicates that the board is initializing. As of firmware v01.00.02, the LED blinks green when on battery power indicating that the battery level is VBATT > 50%.
Blue: A blinking blue LED indicates that the board is reading sensor data and logging the values.
Yellow: A solid yellow LED indicates that a firmware update is in progress. As of firmware v01.00.02, the LED blinks yellow when on battery power indicating that the battery level is between 50% > VBATT > 10%.
Red: As of firmware v01.00.02, the LED blinks red when on battery power indicating that the battery level is VBATT < 10%.
CHG: The on-board yellow CHG LED can be used to get an indication of the charge status of your battery. Below is a table of other status indicators depending on the state of the charge IC.
Charge State LED status No Battery Floating (should be OFF, but may flicker) Shutdown Floating (should be OFF, but may flicker) Charging ON Charge Complete OFF
Note
On the DataLogger IoT, we included the B3DQ3BRG addressable RGB LED instead of the WS2812 with the light emitting from the top of the IC. This side emitting LED uses the same protocol as the WS2812 and was a design choice for users placing the board in an enclosure.
There are seven jumpers on the back of the DataLogger IoT - 9DoF. For more information, check out our tutorial on working with jumper pads and PCB traces should you decide to cut the traces with a hobby knife.
SHLD: This jumper connects the USB Type C connector's shield pin to GND. Cut this to isolate the USB Type C connector's shield pin.
I2C: This three way jumper labeled as I2C are closed by default. By cutting the jumpers, it will disconnect the 2.2k\u03a9 pull-up resistors for the I2C bus. Most of the time you can leave these alone unless your project requires you to disconnect the pull-up resistors.
STAT: This jumper connects the status LED to pin 25 and it is closed by default. Open the jumper to disable the LED.
RGB: This jumper connects the WS2812-2020 RGB addressable LED to pin 26 and it is closed by default. Open the jumper to disable the LED.
CHG: This jumper connects the charge LED on the MCP73831 charge IC and it is closed by default. Open the jumper to disable the LED.
IMU INT2: This jumper connects the ISM330DHCX IMU's interrupt pin to pin 35 and it is open by default. Add a solder jumper to connect.
MAG INT: This jumper connects the MMC5983MA magnetometer's interrupt pin to pin 35 and it is open by default. Add a solder jumper to connect.
Note
On the DataLogger IoT, the IMU INT2 or MAG INT jumpers are not included since it does not have the built in 6DoF IMU or magnetometer. With the extra real estate on the board, we were able to include a MEAS PTH and jumper on the board. By default, the jumper is closed. You can cut this jumper on the bottom side of the board to measure the DataLogger IoT\u2019s current draw from external power.
The overall length and width with the antenna connector is about 1.66\" x 2.00\". There are four mounting holes in the center of the board. Due to the size of the board and the ESP32 module, the mounting holes are positioned in a way for users to add two Qwiic enabled boards with a width of 1.0\" instead of one Qwiic board.
In this section, we will go over how to connect to the SparkFun DataLogger IoT. At the time of writing, we used the DataLogger IoT - 9DoF. This hardware hookup explained in this section also applies for the DataLogger IoT.
"},{"location":"single_page/#soldering-to-the-pths","title":"Soldering to the PTHs","text":"
Note
The UART, SPI, analog, and digital I/O pins are not currently supported in the firmware for data logging.
For users that are interested in soldering to the edge of the board, we recommend soldering headers to the PTHs on the breakout for a permanent connection and using jumper wires. Of course, you could also solder wires to the breakout board as well. For a temporary connection during prototyping, you can use IC hooks like these.
If all you want to do is display your sensor readings in a serial terminal or monitor (connected via USB-C) then, strictly, you don\u2019t need to add a microSD card. But of course the whole point of the DataLogger IoT is that it can log readings from whatever sensors you have attached to microSD card. The data is logged in easy-to-read Comma Separated Value (CSV) text format by default. You can also set the format as JSON.
You probably already have a microSD card laying around but if you need any additional units, we have plenty in the store. The DataLogger IoT can use any size microSD card as long as it is formatted correctly. Please ensure your SD card is formatted correctly. There are different software tools available. Some are built into your operating system. We recommend using the Raspberry Pi Imager Tool to easily format the memory card as FAT32 using the GUI. Flip over the DataLogger IoT and you\u2019ll see the latching microSD card socket. Slide in your formatted SD card and it will click neatly into place. Part of the edge of the SD card will stick out when fully inserted in the microSD card socket.
You should only insert or remove the SD card while the power is turned off or disconnected. Removing the card while the DataLogger IoT is logging will almost certainly corrupt your data. You can tell when the board has just logged by observing the addressable RGB LED. When enabled, the LED will blink blue after it has logged one data point.
After you\u2019ve logged some data, you will find a new file on your SD card. There may also be additional files if you manually saved the firmware or preferences to the memory card.
sfe0001.txt: This is the file that contains the CSV or JSON sensor data. The format will depend on how you configured the DataLogger's output. We use .TXT as the file type so that your computer can open it in a simple text editor. The contents are all human-readable. But, if you want to, you can rename it as .CSV or .JSON instead. The file number is incremented for the next logging session.
datalogger.json: This file only appears when you save the settings as your fallback storage. The file will include all preferences saved for any connected device, WiFi credentials, certificates, and keys.
SparkFun_DataLoggerIoT*.bin: This file only appears when you save the firmware to the microSD card. Note that the asterisk (*) is the firmware version number (i.e. SparkFunDataLoggerIoT_01.00.01.bin).
To remove the microSD card, make sure power is disconnected from the DataLogger IoT. Then press the microSD card into the microSD socket. The memory card will be ejected and you will hear a click again. Once the card is ejected, you can insert it into a microSD card adapter or USB reader to be read on a computer.
If you are going to attach extra sensors or any Qwiic-enabled device to the DataLogger IoT, then those need to be connected first before attaching a USB cable. It is a good idea to only attach or disconnect Qwiic sensors when the power is turned off or disconnected. The Qwiic bus is pretty tolerant to \u201chot swapping\u201d, but: disconnecting a sensor while it is in use will confuse the DataLogger IoT software (most likely each value associated with the device will remain constant); and a new sensor won\u2019t be detected until the firmware restarts.
Plug one end of your Qwiic cable into the DataLogger IoT and plug the other end into your sensor. If you want to add extra sensors, you can simply connect them to each other in a daisy chain. You will need a Qwiic cable for each sensor. Our Qwiic Cable Kit covers all the options.
DataLogger IoT and a Qwiic-Enabled Device DataLogger IoT and several Qwiic-Enabled Devices Daisy Chained
Our Qwiic sensors usually all have power indicator LEDs and I2C pull-up resistors. Depending on your application, you may want or need to disable these by cutting the jumper links on the sensor circuit boards. We have a tutorial that will show you how to do that safely.
Sometimes you might want to connect more than one of the same type of sensor to the DataLogger IoT. On the I2C bus, each device needs to have a unique address. On many of our boards, there are jumpers links which you can use to change the address and some have addresses that can be configured in software. But there are some where you cannot change the address - the NAU7802 Qwiic Scale being one example.
Typically one would use a multiplexor. However, we currently do not have the DataLogger IoT configured to work with any multiplexors (i.e. Qwiic Mux Breakout).
Note
Currently the Qwiic Mux is not compatible with the DataLogger IoT.
Please make sure that you use one of our recommended Lithium Ion batteries. Some batteries use the same JST connector as ours but have the opposite polarity. Connecting one of these to your DataLogger IoT will destroy it. If you are going to use your own battery, it is up to you to ensure it has the correct polarity.
Now is a good time to attach a LiPo battery, if you want the DataLogger IoT to keep logging when you disconnect USB-C.
You can connect one of our standard single cell LiPo batteries to the DataLogger IoT and power it for hours, days or weeks depending on what sensors you have attached and how often you log data. The DataLogger IoT has a built-in charger too which will charge your battery at 500mA when USB-C is connected. Please make sure your battery capacity is at least 500mAh (0.5Ah); bad things will happen if you try to charge our smallest batteries at 500mA. The yellow CHG charging LED will light up while the battery is charging and will go out once charging is complete.
Warning
The MCP73831 charge IC on the board is used on a few SparkFun products. For more information about the CHG status LED, we recommend taking look at the Hardware Overview. We also recommend taking a look at this tutorial for Single Cell LiPo Battery Care.
The USB-C connector provides power to the DataLogger IoT and acts as a serial interface for configuration and data display.
If you are going to use a microSD card to store your data, and why wouldn\u2019t you, then insert that first before attaching your USB cable. You should only insert or remove the SD card while the power is turned off or disconnected. Removing the card while the DataLogger IoT is logging will almost certainly corrupt your data.
Likewise, it is a good idea to only attach or disconnect Qwiic sensors when the power is turned off or disconnected. The Qwiic bus is pretty tolerant to \u201chot swapping\u201d, but: disconnecting a sensor while it is in use will confuse the DataLogger IoT software; and a new sensor won\u2019t be detected until the firmware restarts.
Depending on what ports your computer has available, you will need one of the following cables:
USB 2.0 A to C Cable
USB 3.1 A to C Cable
USB 2.0 C to C Cable
Use the cable to connect your DataLogger IoT to your computer and you will see the LEDs light as the DataLogger IoT starts up. The addressable RGB RGB LED will light up green for a second or two while the DataLogger IoT configures itself. It will flash blue while data is being logged to the microSD card. If you have jumped the gun and have a LiPo battery already connected, the yellow CHG charging LED may light up too.
If the addressable RGB LED does not light up, your DataLogger IoT is probably in deep sleep following a previous logging session. Pressing the RST reset button will wake it.
You\u2019ll find full instructions on how to configure the DataLogger IoT later in this tutorial.
For users interested in stacking the Qwiic-enabled device on the DataLogger IoT or mounting in an enclosure, you will need some standoffs to mount the boards. When mounting, note that all four mounting holes are not positioned exactly for a 1.0\"x1.0\" sized Qwiic board. Only two of the four mounting holes are compatible for a 1.0\"x1.0\" sized Qwiic board. For example the image below shows the boards stacked on each side of the DataLogger IoT. On top, the Qwiic GPS (SAM-M10Q) breakout was also able to stack by rotating the board slightly and aligning the mounting holes on the 1.6\"x1.6\" sized board to the other mounting holes
"},{"location":"single_page/#preparing-your-microsd-card","title":"Preparing Your MicroSD card","text":"
Not all microSD cards are created equal. The capacity, read/write speed, and format 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.
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.
"},{"location":"single_page/#checking-microsd-card-format-windows","title":"Checking MicroSD Card Format - Windows","text":"
To check to see if it is the correct format on a Windows you could head to the drive, right click, and select Properties.
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.
"},{"location":"single_page/#checking-microsd-card-format-macos","title":"Checking MicroSD Card Format - macOS","text":"
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.
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.
"},{"location":"single_page/#download-raspberry-pi-imager","title":"Download Raspberry Pi Imager","text":"
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. 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.
Raspberry Pi Imager Tool"},{"location":"single_page/#formatting-as-fat32-using-the-raspberry-pi-imager","title":"Formatting as FAT32 using the Raspberry Pi Imager","text":"
After downloading and installing the software, open the Raspberry Pi Imager.
Under \"Operating System\", select \"Erase\" to \"format card as FAT32.\"
Under \"Storage\", select the drive that the microSD card appeared as on your computer.
When ready, select \"Write\". After a few minutes, the microSD card should be formatted with FAT32.
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.
Configuring the settings is as easy as opening a serial menu. You can use any serial monitor or terminal emulator to quickly and easily change and store the DataLogger IoT settings via its USB-C interface.
There are plenty of free alternatives out there to configure the DataLogger IoT. For the scope of this tutorial we will be using Tera Term.
Tera Term (Windows)
RealTerm (Windows)
Minicom (Linux, Unix, MacOS)
Screen (Linux, Unix, MacOS)
Note
You will need a serial terminal client that supports edit characters. Most if not all modern serial terminal programs will have the ability to support interactive edits. Unfortunately, we have not had any success with CoolTerm. We have tested the DataLogger IoT with Tera Term, Minicom, and Screen.
If this is the your first time using a terminal window, We recommend checking out the tutorial below for more information on serial terminal basics.
Serial Terminal Basics
The above guides will show you how to open the correct port for the DataLogger IoT and how to set the baud rate to 115200 baud. You can change the DataLogger IoT's baud rate through the configuration menus too should you need to.
Note
For users with an Arduino IDE, you could also use the Arduino Serial Monitor by setting the line ending to Newline. Users will also need to CTRL + Enter when sending any character to the DataLogger IoT. However, we recommend using one of the terminals mentioned earlier.
"},{"location":"single_page/#initialization-and-serial-output","title":"Initialization and Serial Output","text":"
Connect the DataLogger IoT to a USB cable and connect to your computer. The addressable RGB LED will light up green as it initializes. As of firmware v1.0.2.00 - build 00013e, a Startup Menu was added to the system. This allows you to change the behavior of the DataLogger at start-up. This change only affects the current system session.
'n' \u2014 Normal startup
'a' \u2014 Disable I2C device auto load on startup
'l' \u2014 List the I2C devices supported. This device table is discarded after auto-load
'w' \u2014 Disable WiFi
's' \u2014 Disable preference restore during startup
Note
The amount of time the start-up menu is displayed is adjustable. This settings can be configured in the Settings/Application Settings page, under the Advanced section.
You should see the following output when the board initializes:
The messages in the serial terminal provide us with the DataLogger's configuration and will vary depending on the firmware version that is loaded on the board.
The DataLogger IoT software version (in this case is v01.02.00 - build 00013e).
As the DataLogger IoT is initializing, the system settings are being restored from the last saved preference.
There no WiFi credentials and the board has failed to connect. This output will change once you provide the WiFi credentials and are able to connect to the network.
There are 3x devices currently detected and they are connected through I2C through the Qwiic port and SPI. These are the on-board sensors for the DataLogger IoT. There may be more devices that are detected depending on the firmware and what is connected to the ports. Since these were recognized, they were loaded onto the DataLogger IoT.
The current date and time is shown (by default), the date and time is set to 1-1-1970 and 00:00:00). This value will change depending on the clock source through NTP, RTC, or a u-blox GNSS module.
The time the board has been running will be shown in the uptime.
The primary external time source that the board syncs is currently through the NTP client. This can be configured depending on your clock source.
The board name (in this case, it was SparkFun DataLogger IoT - 9DoF)
The board ID (in this case, it was SFD16C8F0D1AD6B8)
The microSD card has been found, the type of memory card it is, the size of the memory card, how much memory is used, and how much is available.
If there is a WiFi network name saved, the SSID will be shown along with information indicating whether the board was able to connect to the WiFi network. By default there is no SSID saved in memory.
If there is a battery connected, the LiPo Battery Fuel Guage will indicate if there is one attached to the board.
Parameters for low power mode will be provided indicating if deep sleep is enabled, sleep interval, and wake interval.
Parameters for logging are also provided for the logging interval, the format for the serial output, format for the microSD card, current saved filename, and file rotation period.
The board will also show the available IoT services that are enabled for the DataLogger IoT.
Current settings to download log files via a web interface (included in firmware v01.02.00)
Supported devices through Qwiic or SPI will be listed if they are connected.
The output will finish by telling you what devices are connected to the DataLogger IoT again.
Note
As of firmware v01.02.00, there is also a compact mode! By adjusting the setting, the ESP32 will output less at startup. This settings can be configured in the Settings/Application Settings page, under the Advanced section.
Once the DataLogger IoT has initialized, the DataLogger IoT will begin outputting comma separated values (CSV). This is the default output that is set for the DataLogger IoT - 9DoF. Of course, you will not have as many readings on the DataLogger IoT since the 6DoF IMU and magnetometer are not populated on that version of the board.
Note
Depending on your DataLogger IoT preferences, your device may output as a JSON format like the image shown below.
The data scrolling up the screen show what each device's output is along with their associated unit if it is available. Your mileage will vary depending on the board version that you have and what device is connected:
MAX17048.Voltage (V)
MAX17048.State of Charge (%)
MAX17048.Charge Rate (%/hr)
ISM330.Accel X (milli-g)
ISM330.Accel Y (milli-g)
ISM330.Accel Z (milli-g)
ISM330.Gyro X (milli-dps)
ISM330.Gyro Y (milli-dps)
ISM330.Gyro Z (milli-dps)
ISM330.Temperature (C)
MMC5983.X Field (Gauss)
MMC5983.Y Field (Gauss)
MMC5983.Z Field (Gauss)
MMC5983.Temperature (C)
The output will vary depending on what is connected so you may get additional readings in the output and it may not be in the following order listed above. The logging rate defaults to about 0.067Hz (or 15000ms), so as the data scrolls past, you will see the last value settle at about 0.067Hz.
Right! Let's open the main menu by pressing on any key in the serial terminal program.
You will be prompted with a few options. Once in the configuration menu, all three colors of the addressable RGB LED will turn on to produce the color white indicating that you are navigating through the menu. Before we dive into the settings, lets check out a few commands and saving settings.
As of firmware v01.02.00, commands can be executed directly from the serial console thus bypassing the serial menu system! The following commands are supported.
Quick Command Command Description !about Display the system about page !clear-settings Clear the on board system preferences with a yes/no prompt !clear-settings-forced Clear the on board system preferences with no prompt !devices List the currently connected devices !factory-reset Perform a factory reset - presents a Y/N prompt !heap Display the current system heap memory usage !help List the available quick commands !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 !log-now Perform a log observation event !log-rate If log rate measurement is enabled, the current log rate is printed !reset-device Reset the device - erasing any saved settings and restarting the device !reset-device-forced Reset the device, but without a Y/N prompt !restart Restart the device !restart-forced Restart the device without a Y/N prompt !save-settings Save the current settings to on-board flash !sdcard Output the current SD card usage statistics !systime Output current system time !uptime The uptime of the device !device-id The ID for the device !version The version of the firmware !wifi Output current system WiFi state
Typing a quick command and hitting the Enter button will result in the DataLogger IoT executing the command without the need to go through the menu system. Below is an example showing the !about quick command being sent and then executing the command as the DataLogger IoT is outputting CSV values to the serial terminal.
"},{"location":"single_page/#exiting-and-saving","title":"Exiting and Saving","text":"
When exiting the menus, you will be prompted with either an x or b. You can use either character when exiting the menus as well as X or B. Note that you will need to use either of these keys when making a change in order for the DataLogger IoT to save any changes in memory. Make sure that you receive the following message indicating that the settings were saved: [I] Saving System Settings. The DataLogger IoT will the continue reading the devices and outputting the readings through the serial terminal.
You can also use any of your Esc or arrow keys (i.e. \u2191, \u2193, \u2190, \u2192) to exit. However, using the escape or arrow keys will not save any changes in memory once the reset button is hit or whenever power is cycled.
"},{"location":"single_page/#timeout-from-inactivity","title":"Timeout from Inactivity","text":"
The menus will slowly exit out after 2 minutes of inactivity, so if you do not press a key the DataLogger IoT will return to its previous menu. It will continue to move back until it reaches the main menu. After another additional 2 minutes of inactivity, the board will exit begin logging data again. When the menu exits from inactivity, any changes will not be saved in memory as well.
Let's start by configuring the DataLogger's system settings. Send a 1 through the serial terminal. You will have the option to adjust various settings ranging from the your preferences, time source to synchronize the date and time, WiFi network, how the device logs data, which IoT service to use, and firmware updates.
Note
You may notice after entering a 1 that there is a slight delay before the DataLogger IoT responds. The delay was added to allow some time for the DataLogger IoT to receive an additional digit for any option greater than 9. If you want to head to option 1 immediately without the slight delay, you can hit the Enter key to enter the Application Settings.
In the Settings Menu, send a 1 to adjust the Application Settings. As of firmware v01.00.02, users can now adjust the baud rate of the serial console output and the menu system's timeout value.
In the Application Settings Menu, users will be able to configure the addressable RGB's LED through software, menu timeout, microSD card's output format, serial console's output format, terminal's baud rate, deep sleep parameters, and view the current settings of the DataLogger IoT similar to when the board was initialized. Depending on your preference and how you are logging data, you can adjust the data as CSV or JSON.
1 LED Enabled \u2014 Enable/Disable the on-board RGB LED activity
Accepts a boolean value:
1 to enable (default)
0 to disable
2 Menu Timeout \u2014 Inactivity timeout period for the menu system
Accepts the following values:
1 30 Seconds = 30
2 60 Seconds = 60 (default)
3 2 Minutes = 120
4 5 Minutes = 300
5 10 Minutes = 600
b Back
3 Color Output \u2014 Use color output with the Serial console. (added as of firmware v01.02.00)
Accepts a boolean value:
1 to enable (default)
0 to disable
4 Board Name \u2014 A specific name for this DataLogger
Accepts a string
5 SD Card Format \u2014 Enable and set the output format
Accepts the following values:
1 to disable = 0
2 CSV format (default) = 1
3 JSON format = 2
6 Serial Console Format \u2014 Enable and set the output format
Accepts the following values:
1 to disable = 0
2 CSV format (default) = 1
3 JSON format = 2
7 JSON Buffer Size \u2014 Output buffer size in bytes
Accepts an integer between 100 to 5000 :
1600 bytes (default)
8 Terminal Baud Rate \u2014 Update terminal baud rate. Changes take effect on restart.
Accepts an unsigned integer between 1200 to 50000:
115200 (default)
9 Enable System Sleep \u2014 If enabled, sleep the system
Accepts a boolean value:
1 to enable
0 to disable (default)
10 Sleep Interval (sec) \u2014 The interval the system will sleep for
Accepts an integer between 5 to 86400 :
30 seconds (default)
11 Wake Interval (sec) \u2014 The interval the system will operate between sleep period
Accepts an unsigned integer between 60 to 86400 :
120 seconds (default)
12 Startup Messages Level of message output at startup
Accepts a value between 1 to 3 :
1 Normal = 0 (default)
2 Compact = 1
3 Disabled = 2
13 Startup Delay Startup Menu Delay in Seconds
Accepts a value between 0 to 60 :
2 seconds (default)
14 Device Names Name always includes the device address
Accepts a boolean value:
1 to enable (default)
0 to disable
15 About... \u2014 Details about the system
b Back
Note
Once the baud rate is changed and saved, make sure to adjust the baud rate of your serial terminal when the board is reset. If you forgot the baud rate, you can hold the BOOT button down for 20 seconds to erase the on-board preferences (besides the baud rate, this also includes any other settings that were saved) and restart the board.
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
"},{"location":"single_page/#general-save-settings","title":"General: Save Settings","text":"
In the Settings menu, send a 2 to adjust the Save Settings. As of firmware v01.01.01, the JSON output buffer size is now user configurable. This will be under option \"JSON File Buffer Size\" when in the Save Settings Menu.
In the Save Settings Menu, users will be able to save, restore, or clear any preferences in memory (i.e. persistent storage) or a saved file to a fallback device (i.e. microSD card). Note that any passwords and secret keys are not saved in the save settings file. You will need to manually enter those values in the file saved on the microSD card.
1 Fallback Restore \u2014 If unable to restore settings, use the fallback source (JSON File)
Accepts a boolean value:
1 to enable (default)
0 to disable
2 Fallback Save \u2014 Save settings also saves on the fallback storage (JSON File)
Accepts a boolean value:
1 to enable
0 to disable (default)
3 JSON File Buffer Size \u2014 The size in bytes used for the internal I/O buffer
Accepts an unsigned integer:
6400 (default, as of firmware v01.01.01)
4 Save Settings \u2014 Save current settings to persistent storage
Accepts a yes/no:
Y or y for yes
N or n for no
5 Restore Settings \u2014 Restore saved settings
Accepts a yes/no:
Y or y for yes
N or n for no
6 Clear Settings \u2014 Erase the saved settings on the device
Accepts a yes/no:
Y or y for yes
N or n for no
7 Save to Fallback \u2014 Save System Settings to the fallback storage (JSON File)
Accepts a yes/no:
Y or y for yes
N or n for no
8 Restore from Fallback \u2014 Restore system settings from the fallback storage (JSON File)
Accepts a yes/no:
Y or y for yes
N or n for no
b Back
If you have the Fallback Save enabled or selected the option Save to Fallback, you will notice an additional file called datalogger.json saved in the microSD card. This is the fallback file that is saved. Using a text editor, you can edit this file to adjust the settings or provide WiFi credentials, certificates, and keys. You can use option 7 to restore the settings on your DataLogger IoT.
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
"},{"location":"single_page/#general-time-sources","title":"General: Time Sources","text":"
Note
Make sure to connect the ESP32-WROOM to a 2.4GHz WiFi network and ensure that is not a guest network that requires you to sign in. Unfortunately, 5GHz WiFi is not supported on the ESP32-WROOM module.
In the Settings Menu, send 3 to manage the time reference sources. As of firmware v01.01.01, time zone support is at the clock level, not tied to NTP. The option to adjust the Time Zone is moved to the Time Sources menu.
In this menu, you will have options to update the primary reference clock, update interval, add a secondary reference clock, and update it's interval. By default, the primary reference clock is set to use the Network Time Protocol (NTP). To synchronization the time, you will need to connect to a 2.4GHz WiFi network in order to update the time. To add a secondary clock, make sure to connect a compatible Qwiic-enabled devices that can keep track of time (i.e. Qwiic Real Time Clock Module - RV-8803 or a Qwiic-enabled u-blox GNSS module).
Note
To adjust the time zone, you will need to enter a POSIX timezone string variable. Try checking out this CSV in this GitHub repo and searching for the timezone string variable in your area. For more information about POSIX format specification check out this article from IBM.
1 The Time Zone \u2014 Time zone setting string for the device
Accepts a string:
MST7MDT,M3.2.0,M11.1.0 (default, as of firmware v01.01.01)
2 Reference Clock \u2014 The current reference clock source
Accepts the following values:
1 for no clock
2 for NTP Client (default)
3 Update Interval \u2014 Main clock update interval in minutes. 0 = No update
Accepts an unsigned integer:
0 = No update
60 seconds (default)
4 Enable Clock Fallback \u2014 Use a valid reference clock if the primary is not available
Accepts a boolean value:
1 to enable (default)
0 to disable
5 Dependant Interval \u2014 Connected depedant clock update interval in minutes. 0 = No update
Accepts an unsigned integer:
0 = No update
60 seconds (default)
6 Update Connected \u2014 Update connected clocks on main clock update
Accepts a boolean value:
1 to enable (default)
0 to disable
b Back
Note
As an alternative to using the NTP, users can also add a compatible Qwiic-enabled device that can keep track of time (i.e. Qwiic Real Time Clock Module - RV-8803 or a Qwiic-enabled u-blox GNSS module). These can be set as the primary or secondary clock.
Once attached, you will be prompted with additional options to select a primary reference clock.
If you are using a u-blox GNSS module, make sure that you have enough satellites in view. The option to add or configure the GNSS will not be available if there are not enough satellites in view. If you are using the Qwiic Real Time Clock Module - RV-8803, you may need to go into the device settings to manually adjust the date and time.
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
The ESP32-WROOM can only connect to a 2.4GHz WiFi network. Unfortunately, 5GHz is not supported on the ESP32-WROOM module.
In the Settings Menu, send a 4 to configure the WiFi settings. As of firmware v01.00.02, up to 4 sets of WiFi credentials can be saved.
Once you are in the WiFi Network menu, you can enable/disable WiFi and save the WiFi network credentials. Once connected to a 2.4GHz WiFi network, you can synchronize the date and time, connect to an IoT service to log data, and update the latest firmware over-the-air. Since the WiFi is turned on by default, you will simply need to save the WiFi network's name and password.
1 Enabled \u2014 Enable or Disable the WiFi Network connection
Accepts a boolean value:
1 to enable (default)
0 to disable
2 Network Name \u2014 The SSID of the WiFi network
Accepts a string:
For example, if my network name is \"MY_NETWORK_NAME\", you would manually type MY_NETWORK_NAME. When finished hit the ENTER key
3 Password \u2014 The Password to connect to the WiFi network
Accepts a string:
For example, if my network name is \"MY_SUPER_SECRET_PASSWORD\", you would manually type MY_SUPER_SECRET_PASSWORD. Note that as you type the password, each character will be replaced with an asterisk (*). When finished hit the ENTER key.
4 Network 2 Name \u2014 Alternative network 2 SSID
Accepts a string:
For example, if my network name is \"MY_NETWORK_NAME_2\", you would manually type MY_NETWORK_NAME_2. When finished hit the ENTER key
5 Network 2 Password \u2014 Alternative network 2 Password
Accepts a string:
For example, if my network name is \"MY_SUPER_SECRET_PASSWORD_2\", you would manually type MY_SUPER_SECRET_PASSWORD_2. Note that as you type the password, each character will be replaced with an asterisk (*). When finished hit the ENTER key.
6 Network 3 Name \u2014 Alternative network 2 SSID
Accepts a string:
For example, if my network name is \"MY_NETWORK_NAME_3\", you would manually type MY_NETWORK_NAME_3. When finished hit the ENTER key
7 Network 3 Password \u2014 Alternative network 3 Password
Accepts a string:
For example, if my network name is \"MY_SUPER_SECRET_PASSWORD_3\", you would manually type MY_SUPER_SECRET_PASSWORD_3. Note that as you type the password, each character will be replaced with an asterisk (*). When finished hit the ENTER key.
8 Network 4 Name \u2014 Alternative network 2 SSID
Accepts a string:
For example, if my network name is \"MY_NETWORK_NAME_4\", you would manually type MY_NETWORK_NAME_4. When finished hit the ENTER key
9 Network 4 Password \u2014 Alternative network 4 Password
Accepts a string:
For example, if my network name is \"MY_SUPER_SECRET_PASSWORD_4\", you would manually type MY_SUPER_SECRET_PASSWORD_4. Note that as you type the password, each character will be replaced with an asterisk (*). When finished hit the ENTER key.
b Back
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
Press the reset button or cycle power to restart the DataLogger IoT. You can also go through the menu and reset the device through software as well. Once the board is reset, the DataLogger will attempt to connect to a WiFi network. If you are successful, the output will indicate that the board connected to a WiFi network and will update the current time through a NTP Client.
Note
If you have a Qwiic Dynamic NFC/RFID Tag connected to the board's Qwiic connector, you can easily update your WiFi credentials! Just make sure to save the WiFi credentials to the tag.
Note
If you saved your preferences to a JSON file on your microSD card's root directory, you can also save your WiFi credentials and load the system settings from the menu as well!
In the Settings menu, send a 5 to adjust the NTP Client settings. As of firmware v01.01.01, time zone support is at the clock level, not tied to the NTP. The option to adjust the Time Zone is moved to the Time Sources menu.
In this menu, users will have the option to enable/disable the NTP client, select the primary/secondary server, or adjust the time zone for your area.
1 Enabled \u2014 Enable or Disable the NTP Client
Accepts a boolean value:
1 to enable (default)
0 to disable
2 NTP Server One \u2014 The primary NTP Server to use
Accepts a string:
time.nist.gov (default)
3 NTP Server Two \u2014 The secondary NTP Server to use
Accepts a string:
pool.ntp.org (default)
b Back
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
In the Settings menu, send a 6 to adjust how data is logged.
In the Logger menu, users will have the option to add a timestamp, increment sample numbering, data format, or reset the sample counter. Note that the timestamp is the system clock and syncs with the reference clock that was chosen. Data from the Qwiic-enabled devices that keep track of time can also be included for each data entry by default.
1 Timestamp Mode \u2014 Enable timestamp output and set the format of a log entry timestamp
1 for no timestamp (default) = 0
2 for milliseconds since program start = 1
3 for seconds since Epoch = 2
4 for Date Time - USA Date format = 3
5 for Date Time = 4
6 for ISO08601 Timestamp = 5
7 for ISO08601 Timestamp with Time Zone = 6
2 Sample Numbering \u2014 An incremental count of the current log entry
Accepts a boolean value:
1 to enable
0 to disable (default)
3 Numbering Increment \u2014 Increment amount for Sample Numbering
Accepts an unsigned integer between 1 to 10000:
1 (default)
4 Output ID \u2014 Include the Board ID in the log output (added as of firmware v01.02.00)
Accepts a boolean value:
1 to enable
0 to disable (default)
5 Output Name \u2014 Include the Board Name in the log output (added as of firmware v01.02.00)
Accepts a boolean value:
1 to enable
0 to disable (default)
6 Rate Metric \u2014 Enable to record the logging rate data (added as of firmware v01.02.00)
Accepts a boolean value:
1 to enable
0 to disable (default)
7 SD Card Format \u2014 Enable and set the output format
Accepts an integer:
1 to disable = 0
2 CSV format = 1 (default)
3 JSON format = 2
8 Serial Console Format \u2014 Enable and set the output format
Accepts an integer:
1 to disable = 0
2 CSV format = 1 (default)
3 JSON format = 2
9 System Info \u2014 Log system information (added as of firmware v01.02.00)
Accepts a boolean value:
1 to enable
0 to disable (default)
10 Reset Sample Counter \u2014 Reset the sample number counter to the provided value
Accepts an unsigned integer between 0 to 10000:
0 (default)
b Back
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
Press the reset button or cycle power to restart the DataLogger IoT. You can also go through the menu and reset the device through software as well. Below is an example with the ISO08601 time that was added to the output.
In the Settings menu, send an 7 to adjust the Logging Timer.
Adjusting the interval for the Logging Timer will change the amount of time between log entries.
1 Interval \u2014 The timer interval in milliseconds
Accepts an integer:
15000 milliseconds (default)
b Back
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
"},{"location":"single_page/#logging-data-file","title":"Logging: Data File","text":"
In the Settings menu, send an 8 to adjust the Logging Data File.
Adjusting these parameters allows you to change the filename prefix, the number the files starts at, and how often the DataLogger will create a new file on the microSD card. For example, the default file will be saved as sfe0001.txt. After 1 day, the DataLogger will rotate files by creating a new file named sfe0002.txt. The DataLogger will begin logging data in this new file. The purpose of this log rotation is to limit the size of each file prevent issues when opening large files.
1 Rotate Period \u2014 Time between file rotation
Accepts the following values:
1 for 6 hours = 6
2 for 12 hours = 12
3 for 1 day (24 hours) = 24 (default)
4 for 2 days (48 hours) = 48
5 for 1 week (168 hours) = 168
2 File Start Number \u2014 The number the filename rotation starts with
Accepts an unsigned integer:
1 (default)
3 Filename Prefix \u2014 The prefix string for the generated filenames
Accepts a string:
sfe (default)
b Back
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
The contents of the file will depend on how the data was saved (either CSV or JSON). Make sure that the SD Card format is enabled to either CSV or JSON with your desired device outputs turned on so that the DataLogger can save the readings.
When removing the microSD card, make sure to remove your power source. Then insert into it into microSD card adapter or USB reader. When connecting the memory card to your computer, you can use a text editor to view the saved readings. In this case, a Windows operating system was viewing the file sfe0000.txt and it was only file available in the microSD card.
At the time of writing, Arduino's IoT service was referred to as the \"Arduino IoT Cloud.\" Arduino updated the service with a different UI and is now referring to the service as the \"Arduino Cloud\".\" When referencing the Arduino IoT or Arduino IoT Cloud in this tutorial, we are referring to the Arduino Cloud.
In the Settings menu, send an 16 to adjust settings for Arduino Cloud. This feature was added as of firmware v01.01.01.
1 Enabled \u2014 Enable or Disable the Arduino IoT Client
Accepts a boolean value:
1 to enable
0 to disable (default)
2 Thing Name \u2014 The Thing Name to use for the IoT Device connection
Accepts a string
3 Thing ID \u2014 The Thing ID to use for the IoT Device connection
Accepts a string
4 API Client ID \u2014 The Arduino Cloud API Client ID
Accepts a string
5 API Secret \u2014 The Arduino Cloud API Secret
Accepts a string
6 Device Secret \u2014 The Arduino IoT Device Secret
Accepts a string
7 Device ID \u2014 The Arduino IoT Cloud Device ID
Accepts a string
b Back
"},{"location":"single_page/#iot-web-server","title":"IoT Web Server","text":"
As of firmware v01.02.00, log files can be viewed and downloaded using the IoT Web Server feature if mDNS (multicast DNS) is supported on your network. This functionality is accessed via the Settings Menu, Type 17 to enter the System Update menu. Once this menu entry is selected, the following menu options are presented:
1 Enabled \u2014 Enabled or Disable the Web Server
Accepts a boolean value
1 to enable
0 to disable (default)
2 Username \u2014 Web access control. Leave empty to disable authentication
Accepts a string
3 Password \u2014 Web access control.
Accepts a string
4 mDNS Support \u2014 Enable a name for the web address this device
Accepts a boolean value
1 to enable
0 to disable (default)
5 mDNS Name \u2014 mDNS Name used for this device address
Accepts a string
dataloggerXXXXX, where XXXXX is the taken from the last 5x characters from your DataLogger IoT's board ID (default)
b Back
Note
You will need to make sure that the ESP32 is on the same network as your computer in order to access the log files.
Note
When authentication is enabled, some browsers might require a second login depending on user settings.
Note
The SparkFun Datalogger IoT requires restarting if the web interface is enabled.
For more information on how to use this feature, check out the section on viewing and downloading log files using the IoT web server.
Examples: Viewing and Downloading Log Files using the IoT Web Server"},{"location":"single_page/#advanced-system-update","title":"Advanced: System Update","text":"
New sensors and features are being added all the time and we've made it really easy for you to keep your DataLogger IoT up to date. The System Update option provides the following functionality to the end user:
Restart the device
Performing a Factory Reset on the device
Updated the device firmware from a file on an SD Card.
Note
What's going on here?!? This tutorial was updated for firmware version 01.02.00!!! You will notice this menu option has changed to 18 !!!
This functionality is accessed via the Settings Menu, which is required to use this capability. Type 18 to enter the System Update menu. Once this menu entry is selected, the following menu options are presented:
1 Device Restart \u2014 Restart/reboot the device
Accepts the following values:
Y or Y to restart or reboot the device using the current firmware and system preferences
N or n to cancel
2 Factory Reset \u2014 Erase all settings and revert to original firmware
Accepts the following values:
Y or Y to factory reset the device
N or n to cancel
3 Update Firmware - SD Card \u2014 Update the firmware from the SD card
Accepts firmware in the /root directory of the microSD card with the file naming pattern SparkFunDataLoggerIoT*.bin, where the asterisk * is the firmware version number (i.e. SparkFunDataLoggerIoT_01.00.01.bin).
4 Update Firmware - OTA \u2014 Update the firmware over-the-air
Connects to a server and searches for the latest firmware that is available. Note that you must be connected to a WiFi network to be able to update the board over-the-air.
Accepts the following values if there is new firmware available.
Y or Y to update over-the-air
N or n to cancel
b Back
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
For more information on how to update firmware manually or over-the-air, check out the section under Examples: Updating Firmware.
In the Main Menu, send a 2 through the serial terminal to adjust the devices settings.
This will bring up the connected devices that are currently available. You can configure each device and enable/disable each output. Below is a sample of the on-board devices available for the DataLogger IoT - 9DoF when only the MAX17048, ISM330, and MMC5983 are connected. As the DataLogger IoT - 9DoF initializes, the board will populate additional devices in this window if they are detected. Your mileage will vary depending on what is connected. On the DataLogger IoT you will not see the ISM330 or MMC5983 as an option since the 6DoF IMU and magnetometer are not populated on that version of the board.
9 Accel X (milli-g) \u2014 Accelerometer X (milli-g)
1 to enable
2 to disable
10 Accel Y (milli-g) \u2014 Accelerometer Y (milli-g)
1 to enable
2 to disable
11 Accel Z (milli-g) \u2014 Accelerometer Z (milli-g)
1 to enable
2 to disable
12 Gyro X (milli-dps) \u2014 Gyro X (milli-g)
1 to enable
2 to disable
13 Gyro Y (milli-dps) \u2014 Gyro Y (milli-g)
1 to enable
2 to disable
14 Gyro Z (milli-dps) \u2014 Gyro Z (milli-g)
1 to enable
2 to disable
15 Temperature (C) \u2014 The temperature in degrees C
1 to enable
2 to disable
3 MMC5983 \u2014 MMC5983 Magnetometer
1 Filter Bandwidth (Hz) \u2014 The filter bandwidth in Hz
1 100 Hz (default)
2 200 Hz
3 400 Hz
4 800 Hz
2 Auto-Reset \u2014 Auto-Reset
1 to enable
2 to disable
3 X Field (Gauss) \u2014 The X Field strength in Gauss
1 to enable
2 to disable
4 Y Field (Gauss) \u2014 The Y Field strength in Gauss
1 to enable
2 to disable
5 Z Field (Gauss) \u2014 The Z Field strength in Gauss
1 to enable
2 to disable
6 Temperature (C) \u2014 The ambient temperature in degrees C
1 to enable
2 to disable
b Back
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
Warning
As you connect additional devices to the DataLogger IoT, the values associated with each device in this menu will change! Make sure to check your device settings menu after additional devices are attached should you decide to configure the additional devices and enable/disable their outputs.
"},{"location":"single_page/#example-connecting-to-a-wifi-network","title":"Example - Connecting to a WiFi Network","text":"
Note
The ESP32-WROOM can only connect to a 2.4GHz WiFi network. Unfortunately, 5GHz is not supported on the ESP32-WROOM module.
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.
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.
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.
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.
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 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.
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!
"},{"location":"single_page/#example-adding-a-timestamp-to-data","title":"Example - Adding a Timestamp to Data","text":"
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.
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.
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.
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.
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.
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.
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.
When a Y is entered, the system performs the following:
Set the boot image to the Factory installed firmware
Erase any settings stored in the on-board flash memory
Please think very carefully before uploading any Arduino sketches to your DataLogger IoT.
You will overwrite the DataLogger IoT firmware, leaving it unable to update or restore itself.
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.
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.
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.
To download the latest firmware and update through the microSD card, you will need to head to the GitHub repository containing the firmware. Select the firmware version and download.
GitHub: SparkFun DataLogger | Firmware Releases
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.
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.
Note
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 !!!
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.
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:
The file is contained in the root \"/\" folder of the SD card.
The filename has a \".bin\" extension.
The filename starts with a specified name prefix. The prefix is optional and is set by the developers at SparkFun using this action.
For example, the DataLogger IoT boards use a prefix value of \"SparkFun_DataLoggerIoT_\".
Once a file is selected, the system new firmware is read off the SD card and written to the device.
And once updated, the system is rebooted and starts using the new firmware image!
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.
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.
If you have not already, connect the DataLogger IoT to your computer using a USB cable.
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.
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.
Note
For the upgrade option to occur, a the system must be connected to a network and have access to the firmware OTA server.
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.
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.
"},{"location":"single_page/#example-mqtt","title":"Example - MQTT","text":""},{"location":"single_page/#connecting-and-publishing-data-to-mqtt","title":"Connecting and Publishing Data to MQTT","text":"
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.
Image Courtesy of MQTT
The following is covered by this document:
Overview of the MQTT connection
How a user configures and uses the MQTT connection
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.
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.
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.
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.
The following is an example of the data posted - note, this representation was \"pretty printed\" for readability.
{\n \"MAX17048\": {\n \"Voltage (V)\": 4.304999828,\n \"State Of Charge (%)\": 115.0625,\n \"Change Rate (%/hr)\": 0\n },\n \"CCS811\": {\n \"CO2\": 620,\n \"VOC\": 33\n },\n \"BME280\": {\n \"Humidity\": 25.03613281,\n \"TemperatureF\": 79.64599609,\n \"TemperatureC\": 26.46999931,\n \"Pressure\": 85280.23438,\n \"AltitudeM\": 1430.44104,\n \"AltitudeF\": 4693.04834\n },\n \"ISM330\": {\n \"Accel X (milli-g)\": -53.31399918,\n \"Accel Y (milli-g)\": -34.03800201,\n \"Accel Z (milli-g)\": 1017.236023,\n \"Gyro X (milli-dps)\": 542.5,\n \"Gyro Y (milli-dps)\": -1120,\n \"Gyro Z (milli-dps)\": 262.5,\n \"Temperature (C)\": 26\n },\n \"MMC5983\": {\n \"X Field (Gauss)\": -0.200622559,\n \"Y Field (Gauss)\": 0.076416016,\n \"Z Field (Gauss)\": 0.447570801,\n \"Temperature (C)\": 29\n }\n}\n
To connect to a MQTT Broker, the following information is needed:
The server name/address
The server port
The topic to post to
[optional] The name of the device/Client name publishing the data
[optional] A username - if required
[optional] A password - if required
These values are set using the standard DataLogger methods - the interactive menu system, or a JSON file.
"},{"location":"single_page/#mqtt-menu-system","title":"MQTT Menu System","text":"
We'll need to adjust the settings for the MQTT Client using the MQTT Menu System.
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:
The options are:
Enable/Disable the connection
Broker Port - The standard port for mqtt is 1883
Broker Server - This is just the name of the server
MQTT Topic - A string
Client Name
Username
Password
Buffer Size
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.
Note
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.
Note
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.
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.
To load the values by the system at startup using a JSON file and microSD card, you will need to configure the Save Settings. This JSON file will be created with the \"Save to Fallback\" option. Make sure to enable the MQTT Client as well.
"},{"location":"single_page/#testing-the-mqtt-connection","title":"Testing the MQTT Connection","text":"
Use of a MQTT connection is fairly straightforward - just requiring the entry of broker details into the connection settings.
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 provides some basic setup for a broker.
Introduction to MQTT
This MQTT Broker Tutorial has more details, covering the setup needed for modern mosquitto configurations.
Random Nerd Tutorials: Install Mosquitto Broker on Raspberry Pi
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:
mosquitto_sub -t \"/sparkfun/datalogger1\"\n
This assumes the MQTT broker is running on the same machine, and using the default port number.
"},{"location":"single_page/#example-aws","title":"Example - AWS","text":""},{"location":"single_page/#creating-and-connecting-to-an-aws-iot-device-thing","title":"Creating and Connecting to an AWS IoT Device (Thing)","text":"
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.
Image Courtesy of Amazon Web Services (AWS)
The following is covered by this document:
Device (Thing) creation in AWS
Securely connecting the device
How data is posted from the DataLogger IoT to the AWS Device via it's Shadow
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.
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.
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.
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.
"},{"location":"single_page/#creating-a-device-in-aws-iot","title":"Creating a Device in AWS IoT","text":"
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.
Click Here to Log into AWS
Once logged into your AWS account, select IoT Core from the menu of services.
From the IoT Core console page, under the Manage section, select All Devices > Things
On the resultant Things Page, select the Create Things button.
AWS IoT will then take you through the steps to create a device. Selections made for a demo Thing are:
Create single thing
Thing Properties
Enter a name for your thing - for this example TestThing23
Device Shadow - select Unnamed shadow (classic)
Auto-generate a new certificate
Attach policies to certificate - This is discussed later in this document
Select Create thing
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:
Device Certificate
Public Key File
Private Key File
Root CA certificates - (for example: Amazon Root CA 1 )
At this point, the new AWS IoT thing is created and listed on the AWS IoT Things Console
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.
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.
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:
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.
Selecting the Classic Shadow entry provides the Server Name/Hostname for the device, as well as the MQTT topic for this device.
Note
The server name is obtained from the Device Shadow URL entry
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.
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.
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.
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.
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:
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:
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. 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.
Tip
To load the values by the system at startup using a JSON file and microSD card, you will need to configure the Save Settings. This JSON file will be created with the \"Save to Fallback\" option. Make sure to enable the AWS IoT as well.
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:
Opening up an update, you can see the data being set to AWS IoT in a JSON format.
"},{"location":"single_page/#example-thingspeak","title":"Example - ThingSpeak","text":""},{"location":"single_page/#creating-and-connecting-to-thingspeak","title":"Creating and Connecting to ThingSpeak","text":"
One of the key features of the DataLogger IoT is it's simplified access to IoT service providers. This document outlines how a ThinkSpeak output is used by the DataLogger IoT.
Image Courtesy of ThingSpeak
The following is covered by this document:
Creating a ThingSpeak Channel and MQTT Connection
Securely connecting the ThingSpeak
How data is posted from the DataLogger IoT to ThingSpeak
The structure of ThingSpeak is based off of the concept of Channels, with each channel supporting up to eight fields for data specific to the data source. Each channel is named, and has a unique ID associated with it. One what to think of it is that a Channel is a grouping of associated data values or fields.
The fields of a channel are enumerated as Field1, Field2, ..., Field8, but each field can be named to simplify data access and understanding.
As data is reported to a ThingSpeak channel, the field values are accessible for further processing or visualization output.
The DataLogger IoT is constructed around the concept of Devices which are often a type of sensor that can output a set of data values per observation or sample.
"},{"location":"single_page/#mapping-data-to-thingspeak","title":"Mapping Data to ThingSpeak","text":"
The concept of Channels that contain Fields in ThingSpeak is similar to the Devices that contain Data within the DataLogger IoT, and this similarity is the mapping model used by the DataLogger IoT. Specifically:
Devices == Channels
Data == Fields
During configuration of the DataLogger IoT, the mapping between the Device and ThingSpeak channel is specified. The data to field mapping is automatically created by the DataLogger IoT following the data reporting order from the specific device driver.
"},{"location":"single_page/#creating-a-device-to-a-thingspeak-channel","title":"Creating a Device to a ThingSpeak Channel","text":"
The following discussion outlines the basic steps taken to create a Channel in ThingSpeak and then connect it to the DataLogger's Device. First step is to log into your ThingSpeak and create a Channel.
Click Here to Log into ThingSpeak
Once logged into your ThingSpeak account, select Channels > My Channels menu item and on the My Channel page, select the New Channel button.
On the presented channel page, name the channel and fill in the specific channel fields. The fields should map to the data fields reported from the Device being linked to this channel. Order is important, and is determined by looking at output of a device to the serial device (or reviewing the device driver code).
Once the values are entered, select Save Channel. ThingSpeak will now show list of Channel Stats, made up of line plots for each field specified for the channel.
Note
Key note - at the top of this page is listed the Channel ID. Note this number - it is used to map a Device to a ThingSpeak Channel.
"},{"location":"single_page/#setting-up-thingspeak-mqtt","title":"Setting Up ThingSpeak MQTT","text":"
The DataLogger IoT uses MQTT to post data to a channel. From the ThingSpeak menu, select Devices > MQTT, which displays a list of your MQTT devices. From this page, select the Add a new device button.
On the presented dialog, enter a name for the MQTT connection and in the Authorize channels to access, select the channel created earlier. Once you select a channel, click the Add Channel button.
Note
More channels can be added later.
Note
When the MQTT device is created, a set of credentials (Client ID, Username, and Password) is provided. Copy or download these values, since the password in not accessible after this step.
The selected Channel is then listed in the Authorized Channel table. Ensure that the Allow Publish and Allow Subscribe attributes are enabled for the added channel.
At this point, the ThingSpeak Channel is setup for access by the DataLogger IoT.
This value is hostname of the ThingSpeak mqtt connection, which is mqtt3.thingspeak.com as note at ThingSpeakMQTT Basics page. Note a secure connection is used, so the port for the connection is 8883.
The connection password was provided when the MQTT device was created. If you lost this value, you can regenerate a password on the MQTT Device information page.
You can download the cert file for ThingSpeak.com page using a web-browser. Click on the security details of this page, and navigate the dialog (browser dependent) to download the certificate. The downloaded file is the made available for the DataLogger IoT to use as a file that is loaded at runtime)
The above property values must be set on the DataLogger IoT before use. They can be manually by using the menu system like the previous MQTT example.
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 12 to enter the ThingSpeak MQTT Menu. When the menu system for the ThingSpeak MQTT 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:
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 ThingSpeak example outlined in this document, the entries in the settings JSON file are as follows:
The Channels value is a list of [DEVICE NAME]=[Channel ID] pairs. Each pair is separated by a comma. In this case, the device name BME280 and the channel ID was 2054891. Make sure to match the device name that was loaded on start up with the unique channel ID that was generated when creating a ThingSpeak Channel.
Besides updating the Server, Client Name, Username, Password, CA Cert Filename, and Channels, 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 ThingSpeak service. Don't forget to enable ThingSpeak MQTT 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.
Tip
To load the values by the system at startup using a JSON file and microSD card, you will need to configure the Save Settings. This JSON file will be created with the \"Save to Fallback\" option. Make sure to enable the ThingSpeak MQTT as well.
Once the connector is configured and the DataLogger IoT is connected to ThingSpeak, as data is posted, the results are show on the Channel Stats page for your Channel. For the above example, the output of a SparkFun BME280 sensor produces the following output:
"},{"location":"single_page/#setting-up-2x-or-more-devices","title":"Setting Up 2x or More Devices","text":"
For users that are setting up 2x or more devices on the DataLogger IoT, you will need to ensure that each device has their own ThingSpeak Channel. Unfortunately, you are not able to plot sensor readings from two devices in the same channel.
The following example demonstrates how to set up two devices for ThingSpeak on the DataLogger IoT. In this case, we will use the BME688 and BME680 and their respective default I2C address. This is also a good example of what to do when two devices use the same device driver. Head to ThingSpeak to create a channel for each device connected to the DataLogger IoT. Include a field for each device data that the DataLogger provides. The name of the channel does not need to match the device name or I2C address.
Creating a Channel for the BME688 Creating a Channel for the BME680
Once the channels are created, you will be provided with a unique channel ID for each channel. Make sure to take note of the number as explained earlier.
Note
The alternative I2C address for the BME688 and BME680 uses the same address as the default of the other sensor:
BME680: 0x77 (Default) or 0x76
BME688: 0x76 (Default) or 0x77
Make sure to avoid using the same address when connecting the sensors to the same DataLogger IoT.
When setting up the connection, you will need to authorize both channels. In this example, we included the channels for the BME688 [x076] and BME680 [x077].
Authorizing 2x Channels through the Same Connection
Now that the ThingSpeak MQTT connection is setup, adjust the ThingSpeak configuration for the DataLogger IoT by including the credentials (i.e. Client Name, Username, and Password) and channels. We will assume that you have included the ThingSpeak CA certificate file in the root directory of the microSD card already. When including the device name with their respective channel, ensure that the device name matches the name that was loaded on startup. For example, the BME688 and BME680 were loaded on startup as BME68x and BME68x [x77], respectively. Since we are only interested in plotting the BME688 and BME680, we will ignore the MAX17048 that was loaded on startup as well. Under /Settings/ThingSpeak MQTT/Channels, you will enter the string for the device names, each of their respective channel IDs, and a comma separating the two channels like so: BME68x=2613826, BME68x [x77]=2613825.
DataLogger IoT Device Name Loaded during Startup Device Name and Channel for Both Sensors
Note
Whenever there are multiple devices using the same device driver (each with unique I2C addresses), the DataLogger IoT will display the device address for each additional device that is loading the same driver. As shown above, the first device name did not include the device's I2C address. The second device name using the same driver included its I2C address. Of course, there is an configuration that enables you to always include the address of all the device names.
The alternative to using the menu system is the JSON file. In this case, we updated channels for the BME688 and BME680. Not shown are the ThingSpeak Client Name, Username, and Password.
If users configure the DataLogger IoT to always include the device address with the device names (i.e. /Settings/Application Settings with Device Names=1), you will need to match the device names for BME688 and BME680 that were loaded on startup as BME68x [x76] and BME68x [x77], respectively. Note the BME688 device name included a space and [x76] in this case. Remember, we are only interested in plotting hte BME688 and BME680 in this case so we will ignore the MAX17048 that was loaded on startup.
DataLogger IoT Device Names Loaded during Startup Device Name and Channel for Both Sensors with Respective Addresses
Again, the alternative to using the menu system is the JSON file. In this case, we updated channels for the BME688 and BME680. We also included the address name for the BME688 like the configuration menu. Not shown are the ThingSpeak Client Name, Username, and Password.
Save the configuration to persistent memory and exit out of the configuration menu. Wait a few seconds for the DataLogger IoT to read the sensors and output the readings to the Serial Terminal. Open ThingSpeak channels in separate browser windows. In this case, we had the BME688 and the BME680 in private view. You should see sensor readings update and plot on the charts.
ThingSpeak Graphing the BME688 and BME680 in Seperate Channels on Two Browser Windows"},{"location":"single_page/#example-azure","title":"Example - Azure","text":""},{"location":"single_page/#creating-and-connecting-to-an-azure-iot-device","title":"Creating and Connecting to an Azure IoT Device","text":"
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.
Image Courtesy of Microsoft Azure
The following is covered by this document:
Device creation Azure
Securely connecting the device
How data is posted from the DataLogger IoT to the Azure Device
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.
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.
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.
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.
"},{"location":"single_page/#creating-a-device-in-azure-iot","title":"Creating a Device in Azure IoT","text":"
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.
Click Here to Log into Microsoft Azure
Once logged into your Microsoft Azure account, select Internet of Things > IoT Hub from the menu of services.
"},{"location":"single_page/#create-an-iot-hub","title":"Create an IoT Hub","text":"
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.
Follow the Hub Creation workflow - key settings used for a DataLogger demo device:
Used the \"Free Tier\" for testing and development.
Networking
Connectivity - Public Access
Minimum TLS Version - 1.0
The remaining settings were set at their default values.
"},{"location":"single_page/#create-a-device","title":"Create a Device","text":"
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.
To create a device, select the Device management > Devices from the IoT Hub menu and the select the + Add Device menu item
In the create device dialog:
Enter a name for the device
Select an Authentication type of Symmetric key
Auto-generate keys enabled
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.
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.
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.
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.
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:
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:
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.
Tip
To load the values by the system at startup using a JSON file and microSD card, you will need to configure the Save Settings. This JSON file will be created with the \"Save to Fallback\" option. Make sure to enable the Azure IoT as well.
"},{"location":"single_page/#operation-and-monitoring","title":"Operation and Monitoring","text":"
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.
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.
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.
"},{"location":"single_page/#connect-to-your-azure-iot-hub","title":"Connect to Your Azure IoT Hub","text":"
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.
The available IoT Hubs are displayed in the editors command prompt. Select the desired hub and press Enter (or click).
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.
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.
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:
To stop monitoring, click the Stop Monitoring build-in event endpoint item that is displayed in the status bar of the editor.
A menu option to stop monitoring is also available from the ... menu of the AZURE IOT HUB section in the editor Explorer panel.
"},{"location":"single_page/#example-http","title":"Example - HTTP","text":""},{"location":"single_page/#connecting-and-sending-output-to-an-http-server","title":"Connecting and Sending Output to an HTTP Server","text":"
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.
The following is covered by this document:
Overview of the HTTP connection
How a user configures and uses the HTTP connection
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.
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.
The following is an example of the data posted - note, this representation was \"pretty printed\" for readability.
{\n \"MAX17048\": {\n \"Voltage (V)\": 4.304999828,\n \"State Of Charge (%)\": 115.0625,\n \"Change Rate (%/hr)\": 0\n },\n \"CCS811\": {\n \"CO2\": 620,\n \"VOC\": 33\n },\n \"BME280\": {\n \"Humidity\": 25.03613281,\n \"TemperatureF\": 79.64599609,\n \"TemperatureC\": 26.46999931,\n \"Pressure\": 85280.23438,\n \"AltitudeM\": 1430.44104,\n \"AltitudeF\": 4693.04834\n },\n \"ISM330\": {\n \"Accel X (milli-g)\": -53.31399918,\n \"Accel Y (milli-g)\": -34.03800201,\n \"Accel Z (milli-g)\": 1017.236023,\n \"Gyro X (milli-dps)\": 542.5,\n \"Gyro Y (milli-dps)\": -1120,\n \"Gyro Z (milli-dps)\": 262.5,\n \"Temperature (C)\": 26\n },\n \"MMC5983\": {\n \"X Field (Gauss)\": -0.200622559,\n \"Y Field (Gauss)\": 0.076416016,\n \"Z Field (Gauss)\": 0.447570801,\n \"Temperature (C)\": 29\n }\n}\n
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:
The options are:
Enable/Disable the connection
Set the URL for the endpoint
Set the name of the CA Cert file for a secure connection (HTTP)
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 .
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.
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.
The above example show providing a certificate filename of example.cer.
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.
CA Cert Filename - Set to the cert filename on the SD card if being used.
If the JSON file is saved in the microSD card, you can load the credentials to the DataLogger IoT.
Tip
To load the values by the system at startup using a JSON file and microSD card, you will need to configure the Save Settings. This JSON file will be created with the \"Save to Fallback\" option. Make sure to enable the HTTP IoT as well.
"},{"location":"single_page/#example-connecting-to-a-http-server","title":"Example - Connecting to a HTTP Server","text":"
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.
The following javascript/node code creates a HTTP server on port 8090, and outputs received data to the console.
var http = require('http');\n\n// Setup the endpoint server\nvar myServer = http.createServer(function (req, res) {\n\n // Initialize our body string\n var body=\"\";\n\n // on data callback, append chunk to our body string\n req.on('data', function(chunk){\n body += chunk;\n });\n\n // On end callback, output the body to the console\n req.on('end', function(){\n // parse json string, then stringify it back for 'pretty printing'\n console.log(\"payload: \" + JSON.stringify(JSON.parse(body),null,2));\n });\n\n // send a reply\n res.writeHead(200, {'Content-Type': 'text/plain'});\n res.end('n');\n // Just listen on our port\n}).listen(8090);\n
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).
Once Node is setup, the above server is run via the following command (assuming the implementation is in a file called simple_http.js):
node ./simple_http.js\n
As data is sent by the DataLogger IoT, the following is output to the console from the server:
"},{"location":"single_page/#obtaining-a-sites-security-certificate","title":"Obtaining a Sites Security Certificate","text":"
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.
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
Next, on the page shown, select the certificate button on the upper right of the dialog.
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.
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.
At the time of writing, Arduino's IoT service was referred to as the \"Arduino IoT Cloud.\" Arduino updated the service with a different UI and is now referring to the service as the \"Arduino Cloud\".\" When referencing the Arduino IoT or Arduino IoT Cloud in this tutorial, we are referring to the Arduino Cloud.
"},{"location":"single_page/#creating-and-connecting-to-an-arduino-cloud-device","title":"Creating and Connecting to an Arduino Cloud Device","text":"
One of the key features of the SparkFun DataLogger IoT is it's simplified access to IoT service providers. This document outlines how an Arduino Cloud Device is used by the DataLogger IoT.
The following is covered by this document:
Structure of the Arduino Cloud Devices
Device creation in the Arduino Cloud
Setup of the Arduino Driver
How data is posted from the DataLogger IoT to the Arduino Device
Currently, the Arduino Cloud device connection is a single direction - used to post data from the DataLogger IoT to an Arduino Cloud device.
Image Courtesy of Arduino
Note
To take advantage of the API's in Arduino Cloud, you will also need to have a service plan with your account.
The Arduino Cloud enables connectivity between an IoT/Edge Arduino enabled device and the cloud. The edge device updates data in the Arduino Cloud by updating variables or parameters attached to a cloud device.
In the Arduino Cloud, the edge device is represented by a Device which has a virtual Thing attached/associated with it. The Thing acts as a container for a list of parameters or variables which represent the data values received from the edge device. As values on the edge device update, they are transmitted to the Arduino Cloud.
For a SparkFun DataLogger IoT connected to an Arduino Cloud device, the output parameters of a device connected to the DataLogger are mapped to variables within the Arduino Cloud Device's Thing using a simple pattern of DeviceName_ParameterName for the name of the variable in the Arduino Cloud.
"},{"location":"single_page/#creating-a-device-in-arduino-cloud","title":"Creating a Device in Arduino Cloud","text":"
The first step connecting to the Arduino Cloud is setting up a device within the cloud. A device is a logical element that represents a physical device.
Log into your Arduino Cloud account.
Click Here to Log into Arduino Cloud
Click on the expand menu icon on the upper left (e.g. the three lines stacked like a \"hamburger\"; \u2630) and select Devices. If your window is big enough, then it will show up on the navigation bar.
This page lists your currently defined devices. If there are no defined devices, select the Add Device button. This will probably be at the bottom of the page. The location of this button will change once the page has a device (or if there is an update to Arduino's user interface).
A device type selection dialog is then shown. Since we are connecting a DataLogger IoT board to the system, and not connected a known device, select DIY - Any Device to manually include the DataLogger IoT.
Once selected, another dialog is presented. Just select Continue. At this point you can provide a name for your device. In this case we named it as \"MyDataLoggerIoT.\"
The next screen is the critical step of the device creation process. This step is the one time the Device Secret Key is available. The provided Device ID and Device Secret Key values are needed to connect to the Arduino Cloud. Once this step is completed, the Secret Key is no longer available.
The easiest way to capture these values is by downloading as a PDF file, which is offered on the setup page. Click on the download the PDF and save it to a safe location. When ready, click on the check box indicating that you have saved the values and select the Continue button.
"},{"location":"single_page/#arduino-cloud-api-keys","title":"Arduino Cloud API Keys","text":"
In addition to creating a device, to access the Arduino Cloud, the driver requires an API Key. This allows the DataLogger IoT's Arduino Cloud driver to access the web API of the Arduino Cloud. This API is used to setup the connection to the Arduino Cloud.
To create an API key, click on the menu bar to expand and select your Arduino account profile > Personal Settings.
This menu takes you to a list of existing API Keys. If you have not created one yet, the list will have nothing in it like the image below. From this page, select the CREATE API KEY button.
Note
Users will need a service plan in order to take advantage of the API.
In the presented dialog, enter a name for the API key. In this case, we named it \"MyDataLoggerKey\".
Once the name is entered, click CONTINUE. A page with the new API key is presented. Like in Device Creation, this page contains a secret that is only available on this page during this process.
Make note of the Client ID and Client Secret values on this page. The best method to capture these values is to download the PDF file offered on this page. Click on the download the PDF and save it to a safe location. When ready, click on the check box indicating that you have saved the values and select the DONE button.
At this point, the Arduino Cloud is setup for connection by the driver.
To add an Arduino Cloud Device as a destination DataLogger IoT, the Arduino Cloud connection is enabled via the DataLogger menu system and the connection values, obtained from the Arduino Cloud (see above), are set in the connection properties.
The specifics for the Arduino Cloud must be configured. This includes the following:
Thing Name
Thing ID
API Client ID
API Secret
Device Secret
Device ID
Note
The Thing Name does not necessarily need to be configured. However, there will be less confusion if you set this up before connecting the DataLogger IoT to the Cloud. The Thing ID will automatically be generated and saved once there is a connection available.
The name of the Arduino Cloud Thing to use. If the Thing doesn't exist on startup, the driver will create a Thing and be named \"Untitled\" if you do not provide a name.
Note
Note satisfied with the default \"Untitled\" as the Thing's name? You can rename the Thing Name after creating the Thing. Note that you will need to manually rename the Thing Name on the Arduino Cloud and DataLogger IoT.
This is the ID of the Thing being used. This value is obtained by the following methods:
If the driver creates a new Thing, the ID is obtained and used.
If an existing Thing is connected to the DataLogger IoT, the driver retrieves it's ID.
Note
In this case, the driver cannot create any new variables until the system is restarted.
The user creates a new Thing using the web interface of Arduino Cloud, and provides the Thing Name and Thing ID .
"},{"location":"single_page/#api-client-id-and-secret","title":"API Client ID and Secret","text":"
These values are used to provide API access by the driver. This access allows for the creation/use of a Thing and Variables within the Arduino Cloud. These are obtained via the steps outlined earlier in this document.
"},{"location":"single_page/#device-secret-and-id","title":"Device Secret and ID","text":"
These values are used to identify the Arduino device that is connected to. These are obtained via the steps outlined earlier in this document.
The above property values must be set in the DataLogger's Arduino Cloud driver before use. They can be manually by using the menu system like the previous MQTT example.
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 16 to enter the Arduino IoT Menu. When the menu system for the Arduino IoT 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:
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 Arduino Cloud example outlined in this document, the entries in the setting's JSON file are as follows:
You will need to update the API Client ID, API Secret, Device Secret, and Device ID with the values that were obtained earlier. Don't forget to enable Arduino Cloud service by setting the value to true. If the JSON file is saved in the microSD card, you will need to load the credentials to the DataLogger IoT.
Tip
To load the values by the system at startup using a JSON file and microSD card, you will need to configure the Save Settings. This JSON file will be created with the \"Save to Fallback\" option. Make sure to enable the Arduino IoT as well.
On startup, when the first values are written from the DataLogger IoT, the connection to the Arduino Cloud is made. During this connection, the system connects to the specified Thing and variables are mapped between the DataLogger Device values and Arduino Cloud Variables. If needed, variables can be created manually in the cloud.
While this initial setup takes seconds to complete, updates to the values on the Arduino Cloud are rapid as soon as there is a connection available.
Once the DataLogger IoT device is configured and running, updates in Arduino Cloud are listed in the Things tab of the Arduino Cloud page. Clicking the target Thing provides access to the current variable values that are connected to the DataLogger IoT. Your mileage may vary depending on the compatible device that is connected to the DataLogger IoT. In this case, we were able to see the built-in sensors that were connected on the DataLogger IoT - 9DoF.
Note
Not seeing certain variables on your list? Check your connections to make sure that the compatible device is connected to the DataLogger IoT. You may also have certain outputs disabled (like the connected sensors or timestamp).
Note
Having problems connecting new variables with the DataLogger IoT? When swapping out compatible Qwiic enabled devices, you may need to delete previous cloud variables so that the DataLogger IoT is able re-initialize them on the next power cycle.
"},{"location":"single_page/#create-a-dashboard","title":"Create a Dashboard","text":"
With the data now available in the Arduino Cloud as variables, it is a simple step create a dashboard that plots the data values.
The general steps to create a simple dashboard include:
Select the Dashboards section of the Arduino Cloud.
Select the Build Dashboard button. If you have a dashboard already built, the location of the button will change and the button will be renamed: Create.
Click the edit button (i.e. the icon that looks like a paper and pencil, this is next to the eye).
Add an element to the dashboard -- for this example select ADD ^ > Advanced Chart.
On the Chart's Widget Settings select Link Variables to add readings.
The DataLogger IoT Variables are listed - select the variable to link.
Continue this step until all the desired variables are linked to the chart. You can select up to 5x variables at a time. Click on the Link Variables button after selecting the variables.
This will bring you back to the Chart's Widget Settings window. Configure any preferences that to display (i.e. variable colors, labels, etc.). When all variables are linked and the Chart Widget Settings is configured, select Done.
The created dashboard then displays the values posted from the SparkFun DataLogger IoT. You can continue adding additional readings on the dashboard that you were not able to fit on graph or even rename the Dashboard view. In this case, we displayed accelerometer values and temperature in degrees Celsius from the DataLogger IoT - 9DoF.
Note
Not seeing any values on the LIVE view? Try clicking on the other time periods to see the values posted.
Using compatible Qwiic enabled devices, you can also display additional readings that are not available with the built-in sensors. In this case, we were able to display humidity, temperature in degrees Fahrenheit, equivalent CO2, TVOC, and AQI with the DataLogger IoT and Environmental Combo Breakout (ENS160/BME280).
"},{"location":"single_page/#viewing-and-downloading-log-files-using-the-iot-web-server","title":"Viewing and Downloading Log Files using the IoT Web Server","text":"
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.
The following is covered by this document:
How a user configures and uses the HTTP connection
Use examples
"},{"location":"single_page/#iot-web-server-connection-setup","title":"IoT Web Server Connection Setup","text":"
To connect to the ESP32's IoT Web Server, the following information is needed:
The server name/address
[optional] A username - if required
[optional] A password - if required
"},{"location":"single_page/#iot-web-server-menu-system","title":"IoT Web Server Menu System","text":"
We'll need to adjust the settings for the IoT Web Server.
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:
The options are:
Enable/Disable the connection
Username
Password
Enable/Disable mDNS support
mDNS name
At a minimum, you will just need to enable the connection. However, we recommend enabling mDNS support if it is supported in your network.
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.
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.
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.
Tip
To load the values by the system at startup using a JSON file and microSD card, you will need to configure the Save Settings. This JSON file will be created with the \"Save to Fallback\" option. Make sure to enable the MQTT Client as well.
"},{"location":"single_page/#connect-and-download-log-file","title":"Connect and Download Log File","text":"
Note
You will need to make sure that the ESP32 is on the same network as your computer in order to access the log files.
Note
When authentication is enabled, some browsers might require a second login depending on user settings.
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\".
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.
Note
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.
Now that you have downloaded the log files, try graphing the data on a spreadsheet!
"},{"location":"single_page/#example-how-to-convert-comma-separated-values-csv-to-a-spreadsheet","title":"Example - How to Convert Comma Separated Values (CSV) to a Spreadsheet","text":"
The DataLogger IoT is great at displaying real time data with an IoT service whenever there is an Internet connection available. For those that want to use the DataLogger IoT without a WiFi connection and/or you just want to save data to a microSD card, you can import the comma separated values (CSV) from the text file into a spreadsheet to graph the values.
There are a few spreadsheet programs available that can take text files with CSV but for the scope of this tutorial, we will be using Google Sheets\u2122 to convert the CSV output to a graph.
Image Courtesy of Google Sheets.
Note
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. \ud83d\ude09
"},{"location":"single_page/#log-some-data","title":"Log Some Data!","text":"
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.
Tip
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.
Note
For users that require a timestamp with their datasets, make sure to enable timestamp.
"},{"location":"single_page/#download-the-log-files","title":"Download the Log Files","text":"
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.
Examples: Viewing and Downloading Log Files using the IoT Web Server
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.
"},{"location":"single_page/#importing-csv-to-a-spreadsheet","title":"Importing CSV to a Spreadsheet","text":"
Log into your Google account and open Google Sheets to create a new spreadsheet.
Click Here to Create a New Google Spreadsheet
Head to the menu and select: File > Import.
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.
Note
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. In this case, we are using the default CSV format.
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.
Note
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.
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.
Tip
To separate the values to each column, highlight everything in the column. Then head to the menu and select: Data > Split text into columns
"},{"location":"single_page/#graphing-your-datasets","title":"Graphing Your Datasets","text":"
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.
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.
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.
Note
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.
The following lists the devices/boards supported by the DataLogger IoT boards. New drivers to support a device will be listed under the firmware version.
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.
SparkFun Technical Assistance Page
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.
Create New Forum Account Log Into SparkFun Forums
"},{"location":"single_page/#issues-connecting-to-iot-service","title":"Issues Connecting to IoT Service","text":"
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.
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.
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.
The following error was occurred when the DataLogger IoT was initializing with Arduino Cloud.
[W] ArduinoIoT - Thing Name not provided\n.\n.\n.\n[I] Arduino IoT: setup variables...[E] ArduinoIoT HTTP communication error [401] - token request\n[E] Arduino IoT Cloud not available or account credentials incorrect\n
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.
The following error was occurred when the DataLogger IoT was initializing with Arduino Cloud.
[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\"\n
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.
Note
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.
The following error was occurred when the DataLogger IoT was initializing with Arduino Cloud.
[I] Arduino IoT: setup variables...ArduinoIoTCloudTCP::handle_ConnectMqttBroker could not connect to mqtts-up.iot.arduino.cc:8884\nArduinoIoTCloudTCP::handle_ConnectMqttBroker 1 connection attempt at tick time 301939\nArduinoIoTCloudTCP::handle_ConnectMqttBroker could not connect to mqtts-up.iot.arduino.cc:8884\nArduinoIoTCloudTCP::handle_ConnectMqttBroker 2 connection attempt at tick time 307420\n[E] Arduino IoT: No Arduino Thing ID provided. Enter ID, delete Thing (SparkFunThing1) on Cloud, or enter new Thing Name.\n
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.
"},{"location":"single_page/#thingspeak-data-points-not-updating","title":"ThingSpeak Data Points Not Updating","text":"
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.
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.
Note
Only one device can be loaded per channel! ThingSpeak is not able graph two different devices in the same channel.
Head back to your ThingSpeak Channel to verify that data is being plotted on the graphs.
"},{"location":"single_page/#u-blox-i2c-device-disappears-when-iot-datalogger-initializes","title":"U-Blox I2C Device Disappears when IoT DataLogger Initializes","text":"
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.
[W] GNSS::isConnected no traffic seen (first attempt)\n
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. For more information, make sure to check out the tutorial on updating your IoT DataLogger's firmware.
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:
The following lists the devices/boards supported by the DataLogger IoT boards. New drivers to support a device will be listed under the firmware version.
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.
SparkFun Technical Assistance Page
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.
Create New Forum Account Log Into SparkFun Forums
"},{"location":"troubleshooting/#issues-connecting-to-iot-service","title":"Issues Connecting to IoT Service","text":"
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.
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.
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.
The following error was occurred when the DataLogger IoT was initializing with Arduino Cloud.
[W] ArduinoIoT - Thing Name not provided\n.\n.\n.\n[I] Arduino IoT: setup variables...[E] ArduinoIoT HTTP communication error [401] - token request\n[E] Arduino IoT Cloud not available or account credentials incorrect\n
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.
The following error was occurred when the DataLogger IoT was initializing with Arduino Cloud.
[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\"\n
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.
Note
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.
The following error was occurred when the DataLogger IoT was initializing with Arduino Cloud.
[I] Arduino IoT: setup variables...ArduinoIoTCloudTCP::handle_ConnectMqttBroker could not connect to mqtts-up.iot.arduino.cc:8884\nArduinoIoTCloudTCP::handle_ConnectMqttBroker 1 connection attempt at tick time 301939\nArduinoIoTCloudTCP::handle_ConnectMqttBroker could not connect to mqtts-up.iot.arduino.cc:8884\nArduinoIoTCloudTCP::handle_ConnectMqttBroker 2 connection attempt at tick time 307420\n[E] Arduino IoT: No Arduino Thing ID provided. Enter ID, delete Thing (SparkFunThing1) on Cloud, or enter new Thing Name.\n
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.
"},{"location":"troubleshooting/#thingspeak-data-points-not-updating","title":"ThingSpeak Data Points Not Updating","text":"
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.
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.
Note
Only one device can be loaded per channel! ThingSpeak is not able graph two different devices in the same channel.
Head back to your ThingSpeak Channel to verify that data is being plotted on the graphs.
"},{"location":"troubleshooting/#u-blox-i2c-device-disappears-when-iot-datalogger-initializes","title":"U-Blox I2C Device Disappears when IoT DataLogger Initializes","text":"
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.
[W] GNSS::isConnected no traffic seen (first attempt)\n
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. For more information, make sure to check out the tutorial on updating your IoT DataLogger's firmware.
Please think very carefully before uploading any Arduino sketches to your DataLogger IoT.
You will overwrite the DataLogger IoT firmware, leaving it unable to update or restore itself.
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.
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.
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.
To download the latest firmware and update through the microSD card, you will need to head to the GitHub repository containing the firmware. Select the firmware version and download.
GitHub: SparkFun DataLogger | Firmware Releases
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.
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.
Note
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 !!!
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.
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:
The file is contained in the root \"/\" folder of the SD card.
The filename has a \".bin\" extension.
The filename starts with a specified name prefix. The prefix is optional and is set by the developers at SparkFun using this action.
For example, the DataLogger IoT boards use a prefix value of \"SparkFun_DataLoggerIoT_\".
Once a file is selected, the system new firmware is read off the SD card and written to the device.
And once updated, the system is rebooted and starts using the new firmware image!
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.
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.
If you have not already, connect the DataLogger IoT to your computer using a USB cable.
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.
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.
Note
For the upgrade option to occur, a the system must be connected to a network and have access to the firmware OTA server.
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.
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.
"},{"location":"wifi_network/","title":"Connecting to a WiFi Network","text":"
Note
The ESP32-WROOM can only connect to a 2.4GHz WiFi network. Unfortunately, 5GHz is not supported on the ESP32-WROOM module.
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.
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.
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.
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.
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 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.
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!
"},{"location":"relnotes/rn_v010101/","title":"Rn v010101","text":""},{"location":"relnotes/rn_v010101/#sparkfun-datalogger-iot-firmware-version-11","title":"SparkFun DataLogger Iot Firmware - Version 1.1","text":"
November 11th, 2023
Today we\u2019re releasing the latest firmware update for our line of DataLogger IoT products. While we\u2019ve 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.
And with the release, we feel we\u2019ve covered all aspects of a 1.1 release \u2013 new functionality, feature enhancements, and a wide variety of bug fixes.
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.
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 \u2013 add the device to the DataLogger IoT and the combined system automatically adds the additional data to the Arduino Cloud \u2013 ready for use in your dashboard.
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.
And like all DataLogger IoT functionality, no programming is required to produces these plots \u2013 all settings are provided via the intuitive serial console menu interface or set via a settings JSON file.
With the combination of the DataLogger IoT, qwiic and Arduino IoT Cloud, creating a IoT dashboard is as easy as Plug-in, Connect, Plot!
The original release of the DataLogger IoT firmware supported around 50 SparkFun qwiic development boards and with this release we\u2019ve added six boards additional qwiic boards.
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.
SparkFun Indoor Air Quality Sensor - ENS160
SparkFun Photoacoustic Spectroscopy CO2 Sensor - PASCO2V01
SparkFun Human Presence and Motion Sensor - STHS34PF80
SparkFun Tristimulus Color Sensor - OPT4048DTSR
SparkFun Triad Spectroscopy Sensor - AS7265x
SparkFun 6DoF IMU Breakout - BMI270
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.
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!
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:
Improved Reference Clock Management \u2013 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.
Internal JSON Buffer Limits \u2013 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.
Add Device IDs to the Device Names \u2013 As you add more devices to a DataLogger, it\u2019s 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.
Board Information in the Log Stream \u2013 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.
We also squashed a variety of defects in the firmware. Some of the more notable issued fixed in this release:
Incorporated a fix in the RV8803 RTC Clock Arduino Library that resolved force ti* shifts based on time zone. This was a \u201creal nasty one\u201d to resolve!
Improved runtime memory (ram) consumption
Resolved issues with devices having the same name. Now the second device adds it* address to the name.
With the release of DataLogger IoT firmware version 1.1.0 we continue to enhance the capabilities of our DataLogger IoT line \u2013 adding to our IOT service, supported devices as well as improving the overall quality of the system.
And this new functionality is available today at the DataLogger repo. The update is free, available as an over-the-air upgrade, or as a file uploaded via an SD Card. Just select the \u201cSystem Update\u201d option within the DataLogger IoT menu system and select your desired upgrade option.
"},{"location":"relnotes/rn_v010200/","title":"Rn v010200","text":""},{"location":"relnotes/rn_v010200/#sparkfun-datalogger-iot-firmware-version-12","title":"SparkFun DataLogger IoT Firmware - Version 1.2","text":"
April 15th, 2024_
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.
And with the release, we feel we\u2019ve covered all aspects of a 1.1 release \u2013 new functionality, feature enhancements, and a wide variety of bug fixes.
"},{"location":"relnotes/rn_v010200/#new-features-and-enhancements","title":"New Features and Enhancements","text":""},{"location":"relnotes/rn_v010200/#log-file-download-via-a-web-interface","title":"Log File Download via a Web Interface","text":"
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.
Currently file browse and download options are available, but we plan on expanding this feature in the future.
Additionally, this feature has the following options:
mDNS functionality allowing you to set a network name for a device if mDNS is supported on your network
Username/Password authentication for the web interface.
Note: For authentication use - currently some browsers might require a second login depending on settings.
Note: The datalogger requires restarting if the web interface is enabled
This feature is enabled in settings under the Preview heading.
"},{"location":"relnotes/rn_v010200/#startup-command-menu-and-delay","title":"Startup Command Menu and Delay","text":"
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.
Startup Menu options:
Pressing the highlighted letter while the menu is active, will change the behavior of the system. This change only affects the current system session.
The options include:
'n' - Normal startup
'a' - Disable I2C device auto load on startup
'l' - List the I2C devices supported. This device table is discarded after auto-load
'w' - Disable WiFi
's' - Disable preference restore during startup
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.
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.
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.
The following commands are supported:
command Description !about Display the system about page !clear-settings Clear the on board system preferences with a yes/no prompt !clear-settings-forced Clear the on board system preferences with no prompt !devices List the currently connected devices !factory-reset Perform a factory reset - presents a Y/N prompt !heap Display the current system heap memory usage !help List the available quick commands !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 !log-now Perform a log observation event !log-rate If log rate measurement is enabled, the current log rate is printed !reset-device Reset the device - erasing any saved settings and restarting the device !reset-device-forced Reset the device, but without a Y/N prompt !restart Restart the device !restart-forced Restart the device without a Y/N prompt !save-settings Save the current settings to on-board flash !sdcard Output the current SD card usage statistics !systime Output current system time !uptime The uptime of the device !device-id The ID for the device !version The version of the firmware !wifi Output current system WiFi state"},{"location":"relnotes/rn_v010200/#log-data-rate","title":"Log Data Rate","text":"
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.
"},{"location":"relnotes/rn_v010200/#system-info-in-the-log-stream","title":"System Info in the log stream","text":"
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.
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:
Serial Console - Value Display \u2013 The serial console now shows the current setting value in the menu system. Previously this value was only show once that item was selected.
Serial Console Color \u2013 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.
Startup Messages \u2013 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.
Improved Device Auto-Load \u2013 A major update to the I2C auto-load device detection logic that improves device detection and address collision prevention.
General System Enhancements \u2013 Internal system job dispatch subsystem update to increase performance throughput. Overall decrease in static and dynamic memory usage.
With the release of DataLogger IoT firmware version 1.2.0 we continue to enhance the capabilities of our DataLogger IoT line \u2013 adding to our IOT service, supported devices as well as improving the overall quality of the system.
And this new functionality is available today at the DataLogger repo. The update is free, available as an over-the-air upgrade, or as a file uploaded via an SD Card. Just select the \u201cSystem Update\u201d option within the DataLogger IoT menu system and select your desired upgrade option.
The SparkFun DataLogger IoT is a data logger that comes preprogrammed to automatically log IMU, GPS, and various pressure, humidity, and distance sensors. All without writing a single line of code! They come in two flavors: The SparkFun DataLogger IoT - 9DoF and the SparkFun DataLogger IoT. Both versions of the DataLogger IoT automatically detects, configures, and logs Qwiic sensors. It was specifically designed for users who just need to capture a lot of data to a CSV or JSON file, and get back to their larger project. Save the data to a microSD card or send it wirelessly to your preferred Internet of Things (IoT) service!
Please make sure that you use one of our recommended Lithium Ion batteries. Some batteries use the same JST connector as ours but have the opposite polarity. Connecting one of these to your DataLogger IoT will destroy it. If you are going to use your own battery, it is up to you to ensure it has the correct polarity.
+
+
To follow along with this tutorial, you will need the following materials. You may not need everything though depending on what you have. Add it to your cart, read through the guide, and adjust the cart as necessary.
Straight out of the box anti-static bag, the DataLogger IoT is ready to log data from its built-in ISM330DHCX Inertial Measurement Unit (IMU) and MMC5983MA magnetometer. Only want to log magnetometer, accelerometer, gyro or temperature data? You’re good to go! But the fun is only just beginning…
+
The DataLogger IoT is preprogrammed to automatically log data from all of the following sensors, so you may wish to add one or more of these to your shopping cart too. (More sensors are being added all the time and it is really easy to upgrade the DataLogger IoT to support them. But we'll get to that in a moment!). Currently, auto-detection is supported on the following Qwiic-enabled products (with the exception of the ISM330DHCX and MMC5983 which is built-in on the SPI port):
+
+
Note
+
For a list of supported devices based on the firmware, you can check out the list of supported Qwiic Devices in the appendix. We simply categorized the supported devices below based on the type.
+
+
+
Any u-Blox GNSS Modules (Lat/Long, Altitude, Velocity, SIV, Time, Date) such as:
In this section, we will highlight the hardware and pins that are broken out on the SparkFun DataLogger IoT. At the time of writing, we highlighted the SparkFun DataLogger IoT - 9DoF. However, this also applies for the SparkFun DataLogger IoT.
+
+
+
+
+
+
+
+
DataLogger IoT - 9DoF (Top View)
+
DataLogger IoT - 9DoF (Bottom View)
+
+
+
+
+
The SparkFun DataLogger is pretty much the same with the exception of the following features listed below. We'll include notes highlighting the differences in each section.
+
+
No built - in 6DoF IMU - ISM330DHCX
+
No built - in magnetometer - MMC5983
+
The addressable RGB LED - WS2812 is replaced with the side emitting addressable RGB LED - B3DQ3BRG
+
No IMU INT2 jumper
+
No Mag INT jumper
+
Included MEAS PTH Jumper
+
The "35 / A7" PTH on the edge of the board is replace with a "5" PTH.
+
+
+
+
+
+
+
+
+
+
+
DataLogger IoT (Top View)
+
DataLogger IoT (Bottom View)
+
+
+
+
+
ESP32-WROOM Module
+
The DataLogger IoT is populated with Espressif's ESP32-WROOM-32E module. Espressif's ESP32 WROOM ubiquitous IoT microcontroller is a powerful WiFi, BT, and BLE MCU module that targets a wide variety of applications. For the DataLogger IoT, the firmware currently utilizes the WiFi feature.
+
+
+
+
+
+
+
+
+
+
Note
+
Currently the DataLogger IoT does not have BT or BLE. However, BT or BLE is being considered on a future firmware build to include this as a feature.
+
+
Power
+
There are a variety of power and power-related nets broken out to connectors and through hole pads. Below list a few methods of powering the board up. There are protection diodes for the USB-C, 5V pin, and single cell LiPo battery. Power is regulated down to 3.3V for the system voltage. Depending on the settings and what is connected to the DataLogger IoT, the board can pull a minimum of 200µA in low power mode by itself.
+
+
USB-C
+
5V Pin
+
Single Cell LiPo Battery
+
3V3 Pin
+
+
USB-C and 5V
+
The DataLogger IoT comes equipped with a USB type C socket which you can use to connect it to your computer to view the output and configuration through the serial terminal, or plug in a USB-C power supply. The DataLogger IoT includes the configuration channel resistors needed to tell the power supply to deliver 5V. You can use your USB-C laptop charger as the power source should you need to, even though it normally delivers a much higher voltage.
+
There is also a 5V power input pin. You can use this to feed in 5V power from an external source. The maximum voltage is 6.0V. The 5V pin is diode-protected and so is the USB-C power input, so it is OK to have both connected at the same time. This pin is ideal if you want to power your DataLogger from regulated solar power or a different type of power supply. You can not use the 5V pin as an output.
+
+
+
+
+
+
+
+
+
+
+
+
Voltage from the USB is regulated down to the XC6222 3.3V/700mA voltage regulators for the system voltage and Qwiic-enabled devices. USB power is also connected to the MCP73831 to charge a single cell LiPo battery at a default rate of 500mA.
Battery Polarity: Please make sure that you use one of our recommended Lithium Ion batteries. Some batteries use the same JST connector as ours but have the opposite polarity. Connecting one of these to your DataLogger IoT will destroy it. If you are going to use your own battery, it is up to you to ensure it has the correct polarity.
+
+
But of course you’re going to want to use the DataLogger IoT to log sensor data while on the move too. You can connect one of our standard single cell LiPo batteries to the DataLogger IoT and power it for hours, days or weeks depending on what sensors you have attached and how often you log data. The DataLogger IoT uses the built-in MCP73831 charger too which will charge your battery at 500mA when USB-C is connected. Please make sure your battery capacity is at least 500mAh (0.5Ah); bad things will happen if you try to charge our smallest batteries at 500mA. The board also includes the MAX17048 LiPo Fuel Gauge which allows you to determine how much power your LiPo battery has available. The 2-pin JST connector pins are broken out to PTHs on the edge of the board if you decide to solder a single cell LiPo battery directly to the board or power another device.
+
+
+
+
+
+
+
+
+
+
3V3 Pins
+
For those going the old school route, you can also bypass the voltage regulators by soldering directly to the 3V3 and GND pin to provide power if your application has a regulated 3.3V. Note that this is only connected to the system voltage. You will also need to provide power to the 3V3 SWCH or Qwiic-enabled devices should you decide to bypass the voltage regulator.
+
+
+
+
+
+
+
+
+
+
CH340 USB-to-Serial Converter
+
The top side of the board includes a CH340 USB-to-Serial Converter. The chip can be used to send serial data between the device and computer. You can view the output or configure the device through a serial terminal.
+
+
+
+
+
+
+
+
+
The driver should automatically install on most operating systems. However, there is a wide range of operating systems out there. You may need to install drivers the first time you connect the chip to your computer's USB port or when there are operating system updates. For more information, check out our How to Install CH340 Drivers Tutorial.
The hardware serial UART pins are broken out on the edge of the board. For more information about Serial UART, check out the tutorial about Serial Communication for more information.
+
+
TXD: UART transmit pin. This is connected to pin 16.
+
RXD: UART receive pin. This is connected to pin 17.
+
+
+
Note
+
The UART pins are not currently supported in the firmware for data logging.
+
+
+
+
+
+
+
+
+
+
+
Qwiic and I2C
+
+
Note
+
You may notice a thin film over the vertial Qwiic connector. This is used by a pick-and-place machine when populating the component on the board before it goes through the reflow oven. This can be removed if you decide to use the vertical Qwiic connector with Qwiic-enabled devices.
+
+
SparkFun's Qwiic Connect System uses 4-pin JST style connectors to quickly interface development boards with I2C sensors and more. No soldering required and there's no need to worry about accidentally swapping the SDA and SCL wires. The Qwiic connector is polarized so you know you’ll have it wired correctly every time, right from the start. Qwiic boards are daisy chain-able too so you can connect multiple sensors to the DataLogger IoT and log readings from all of them.
+
The board is populated with vertical and horizontal Qwiic connectors. These are also broken out to PTHs on the edge of the board.
+
+
+
+
+
+
+
+
+
+
+
SCL: I2C clock pin. This is connected to pin 22 and a 2.2kΩ pull-up resistor.
+
SDA: I2C data pin. This is connected to pin 21 and a 2.2kΩ pull-up resistor.
+
3V3 SW: The 3.3v pin is connected to the XC6222 voltage regulator's output to power the Qwiic devices.
+
GND: Common, ground voltage (0V reference) for the system
+
+
Connected to the line I2C line is the MAX17048 LiPo fuel gauge (7-bit unshifted address = 0x36).
+
Sometimes you might want to connect more than one of the same type of sensor to the DataLogger IoT. On the I2C bus, each device needs to have a unique address. On many of our boards, there are jumpers links which you can use to change the address and some have addresses that can be configured in software. But there are some where you cannot change the address. Typically, one would use a multiplexor. However, we currently do not have the DataLogger IoT configured to work with any multiplexors (i.e. Qwiic Mux Breakout).
+
+
Note
+
Currently the Qwiic Mux is not compatible with the DataLogger IoT.
+
+
The DataLogger IoT includes a dedicated 3.3V regulator for the Qwiic connector. This has several advantages including:
+
+
The DataLogger IoT can completely power-down the I2C sensors during sleep to prolong your battery life
+
There’s no risk of the Qwiic bus gulping too much current and causing problems for the ESP32
+
+
SPI
+
+
Note
+
Besides the built-in ISM330DHCX and MMC5983MA, the SPI pins are not currently supported in the firmware for data logging.
+
+
The SPI pins are broken out on the edge of the board. For those that are unfamiliar to PICO and POCI, check out the SPI tutorial for more information.
+
+
SCK: SPI clock pin. This is connect to pin 18.
+
PICO: SPI Peripheral In Controller Out. This is connected to pin 23.
+
POCI: SPI Peripheral Out Controller In. This is connected to pin 19.
+
+
+
+
+
+
+
+
+
+
+
Not shown in the image are the chip select (CS) pins. The 6DoF IMU's CS pin is connected to pin 5. The magnetometer's CS pin is connected to pin 27 which is not broken out.
+
+
Note
+
On the DataLogger IoT, the IMU and magnetometer are not connected to the SPI port since they are not included on the board. Instead of pin "35 / A7" being broken out, pin "5" is broken out on the edge of the board.
+
+
+
+
+
+
+
+
+
+
MicroSD Card Socket
+
The DataLogger IoT supports full 4-bit SDIO for fast logging and uses common microSD cards to record clear text, comma separated files. Flip over the DataLogger IoT and you'll see the latching microSD card socket. You probably already have a microSD card laying around. However, if you need any additional units, we have plenty in the SparkFun catalog. The DataLogger can use any size microSD card and supports FAT32 cards in addition to FAT16. Please ensure that your SD card is formatted correctly; we recommend the Raspberry Pi Imager Tool.
+
+
+
+
+
+
+
+
+
Slide in your formatted SD card and it will click neatly into place. The edge of the SD card will stick out on the edge of the circuit board when it is inserted correctly.
+
+
Warning
+
You should only insert or remove the SD card while the power is turned off or disconnected. Removing the card while the DataLogger IoT is logging will almost certainly corrupt your data.
+
+
9 Degrees of Freedom (9DOF)
+
As stated earlier, included on every DataLogger IoT - 9DoF is a 6DoF Inertial Measurement Unit (IMU) for built-in logging of triple-axis accelerometer and gyro. There is also a built-in triple-axis magnetometer for a complete 9 degrees of freedom. Beside each IC is a silkcreen showing the reference axis. Both are connected to the ESP32 via the SPI port. Combined, you have 9 degrees of inertial measurement! Whereas the original 9DOF Razor used the old MPU-9250, this uses the ISM330DHCX and MMC5983MA. Oh, and if that wasn’t enough, it comes with a built-in temperature sensor on each IC too. So if you want to use the DataLogger IoT as a transportation logger, it will do that straight out of the anti-static bag!
+
+
+
+
+
+
+
+
+
+
Note
+
For users using the SparkFun DataLogger, there 6DoF IMU and magnetometer is not populated on the board. The associated silkscreen and jumpers for the sensors are also not included on the board.
+
+
+
+
+
+
+
+
+
+
+
+
Analog Pins
+
+
Note
+
The analog pins are not currently supported in the firmware for data logging.
+
+
There are three 12-bit analog pins available and broken out on edge of the board.
+
+
36 / A0: Analog A0. This is connected to pin 36.
+
39 / A3: Analog A3. This is connected to pin 39.
+
35 / A7: Analog A7. This is connected to pin 35.
+
+
+
+
+
+
+
+
+
+
+
+
Note
+
Instead of pin "35 / A7" being broken out on the DataLogger IoT, pin "5" is broken out on the edge of the board.
+
+
+
+
+
+
+
+
+
+
Reset and Boot Buttons
+
+
Note
+
You may notice a thin film over buttons. This is used by a pick-and-place machine when populating the component on the board before it goes through the reflow oven. This can be removed.
+
+
There are two buttons available on the board for reset and boot. These are also broken out on the edge of the board as PTHs. If you have your DataLogger IoT mounted in an enclosure, you can also attach an external boot or reset switch too. Any Single Pole Normally-Open Push-To-Close momentary switch will do. Solder pin headers or wires to the RST and GND breakout pins and connect your external switch to those.
+
+
RESET: Pressing this button will pull the pin LOW and reset the program running on the ESP32 without unplugging the board.
+
BOOT: The boot button usually allows users to force the ESP32 into bootloader mode to manually flash new firmware to the ESP32. The ESP32 will remain in this mode until there is a power cycle or the reset button is pressed. As of firmware v01.00.02, this button has an extra function: pressing down on the user button for 20 seconds will erase on-board preference storage and restart the board. This is connected to pin 0 on the ESP32.
+
+
+
+
+
+
+
+
+
+
+
Like other ESP32 development boards, these buttons are populated so that users can place the ESP32 module in bootloader mode. For users that need to place the board in bootloader mode when powered, you will need to:
+
+
Press the BOOT button.
+
While holding on the BOOT button, press the RESET button momentarily.
+
Finally, release the BOOT button.
+
+
Most of the time, users will simply have the board executing the firmware that is loaded on the ESP32 module and updating through the configuration menu either through the microSD card or OTA.
+
+
Danger
+
Please think very carefully before uploading any Arduino sketches to your DataLogger IoT.
+
You will overwrite the DataLogger IoT firmware, leaving it unable to update or restore itself.
+
The 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.
+
Really. We mean it.
+
+
LEDs
+
There are three LEDs populated on the board. These can be disabled with their respective jumpers on the back of the board.
+
+
STAT: The status LED is connected to pin 25.
+
RGB: The WS2812-2020 RGB addressable LED is connected to pin 26. In addition to being disabled through the jumper on the back, you can also disable the LED through software. The following colors represent different states that the board is in.
+
White: A solid white LED indicates that the board is currently being configured through the configuration menu.
+
Green: A solid green LED indicates that the board is initializing. As of firmware v01.00.02, the LED blinks green when on battery power indicating that the battery level is VBATT > 50%.
+
Blue: A blinking blue LED indicates that the board is reading sensor data and logging the values.
+
Yellow: A solid yellow LED indicates that a firmware update is in progress. As of firmware v01.00.02, the LED blinks yellow when on battery power indicating that the battery level is between 50% > VBATT > 10%.
+
Red: As of firmware v01.00.02, the LED blinks red when on battery power indicating that the battery level is VBATT < 10%.
+
+
+
CHG: The on-board yellow CHG LED can be used to get an indication of the charge status of your battery. Below is a table of other status indicators depending on the state of the charge IC.
+
+
+
+
+
Charge State
+
LED status
+
+
+
No Battery
+
Floating (should be OFF, but may flicker)
+
+
+
Shutdown
+
Floating (should be OFF, but may flicker)
+
+
+
Charging
+
ON
+
+
+
Charge Complete
+
OFF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Note
+
On the DataLogger IoT, we included the B3DQ3BRG addressable RGB LED instead of the WS2812 with the light emitting from the top of the IC. This side emitting LED uses the same protocol as the WS2812 and was a design choice for users placing the board in an enclosure.
+
+
+
+
+
+
+
+
+
Jumpers
+
There are seven jumpers on the back of the DataLogger IoT - 9DoF. For more information, check out our tutorial on working with jumper pads and PCB traces should you decide to cut the traces with a hobby knife.
+
+
SHLD: This jumper connects the USB Type C connector's shield pin to GND. Cut this to isolate the USB Type C connector's shield pin.
+
I2C: This three way jumper labeled as I2C are closed by default. By cutting the jumpers, it will disconnect the 2.2kΩ pull-up resistors for the I2C bus. Most of the time you can leave these alone unless your project requires you to disconnect the pull-up resistors.
+
STAT: This jumper connects the status LED to pin 25 and it is closed by default. Open the jumper to disable the LED.
+
RGB: This jumper connects the WS2812-2020 RGB addressable LED to pin 26 and it is closed by default. Open the jumper to disable the LED.
+
CHG: This jumper connects the charge LED on the MCP73831 charge IC and it is closed by default. Open the jumper to disable the LED.
+
IMU INT2: This jumper connects the ISM330DHCX IMU's interrupt pin to pin 35 and it is open by default. Add a solder jumper to connect.
+
MAG INT: This jumper connects the MMC5983MA magnetometer's interrupt pin to pin 35 and it is open by default. Add a solder jumper to connect.
+
+
+
+
+
+
+
+
+
+
+
Note
+
On the DataLogger IoT, the IMU INT2 or MAG INT jumpers are not included since it does not have the built in 6DoF IMU or magnetometer. With the extra real estate on the board, we were able to include a MEAS PTH and jumper on the board. By default, the jumper is closed. You can cut this jumper on the bottom side of the board to measure the DataLogger IoT’s current draw from external power.
+
+
+
+
+
+
+
+
+
+
Board Dimensions
+
The overall length and width with the antenna connector is about 1.66" x 2.00". There are four mounting holes in the center of the board. Due to the size of the board and the ESP32 module, the mounting holes are positioned in a way for users to add two Qwiic enabled boards with a width of 1.0" instead of one Qwiic board.
+
+
+
+
+
+
+
+
+
+
+
+
DataLogger IoT - 9DoF
+
DataLogger IoT
+
+
+
+
+
Hardware Hookup
+
In this section, we will go over how to connect to the SparkFun DataLogger IoT. At the time of writing, we used the DataLogger IoT - 9DoF. This hardware hookup explained in this section also applies for the DataLogger IoT.
+
Soldering to the PTHs
+
+
Note
+
The UART, SPI, analog, and digital I/O pins are not currently supported in the firmware for data logging.
+
+
For users that are interested in soldering to the edge of the board, we recommend soldering headers to the PTHs on the breakout for a permanent connection and using jumper wires. Of course, you could also solder wires to the breakout board as well. For a temporary connection during prototyping, you can use IC hooks like these.
If all you want to do is display your sensor readings in a serial terminal or monitor (connected via USB-C) then, strictly, you don’t need to add a microSD card. But of course the whole point of the DataLogger IoT is that it can log readings from whatever sensors you have attached to microSD card. The data is logged in easy-to-read Comma Separated Value (CSV) text format by default. You can also set the format as JSON.
+
You probably already have a microSD card laying around but if you need any additional units, we have plenty in the store. The DataLogger IoT can use any size microSD card as long as it is formatted correctly. Please ensure your SD card is formatted correctly. There are different software tools available. Some are built into your operating system. We recommend using the Raspberry Pi Imager Tool to easily format the memory card as FAT32 using the GUI. Flip over the DataLogger IoT and you’ll see the latching microSD card socket. Slide in your formatted SD card and it will click neatly into place. Part of the edge of the SD card will stick out when fully inserted in the microSD card socket.
+
+
+
+
+
+
+
+
+
You should only insert or remove the SD card while the power is turned off or disconnected. Removing the card while the DataLogger IoT is logging will almost certainly corrupt your data. You can tell when the board has just logged by observing the addressable RGB LED. When enabled, the LED will blink blue after it has logged one data point.
+
After you’ve logged some data, you will find a new file on your SD card. There may also be additional files if you manually saved the firmware or preferences to the memory card.
+
+
sfe0001.txt: This is the file that contains the CSV or JSON sensor data. The format will depend on how you configured the DataLogger's output. We use .TXT as the file type so that your computer can open it in a simple text editor. The contents are all human-readable. But, if you want to, you can rename it as .CSV or .JSON instead. The file number is incremented for the next logging session.
+
datalogger.json: This file only appears when you save the settings as your fallback storage. The file will include all preferences saved for any connected device, WiFi credentials, certificates, and keys.
+
SparkFun_DataLoggerIoT*.bin: This file only appears when you save the firmware to the microSD card. Note that the asterisk (*) is the firmware version number (i.e. SparkFunDataLoggerIoT_01.00.01.bin).
+
+
To remove the microSD card, make sure power is disconnected from the DataLogger IoT. Then press the microSD card into the microSD socket. The memory card will be ejected and you will hear a click again. Once the card is ejected, you can insert it into a microSD card adapter or USB reader to be read on a computer.
+
+
+
+
+
+
+
+
+
Qwiic Sensors
+
If you are going to attach extra sensors or any Qwiic-enabled device to the DataLogger IoT, then those need to be connected first before attaching a USB cable. It is a good idea to only attach or disconnect Qwiic sensors when the power is turned off or disconnected. The Qwiic bus is pretty tolerant to “hot swapping”, but: disconnecting a sensor while it is in use will confuse the DataLogger IoT software (most likely each value associated with the device will remain constant); and a new sensor won’t be detected until the firmware restarts.
+
Plug one end of your Qwiic cable into the DataLogger IoT and plug the other end into your sensor. If you want to add extra sensors, you can simply connect them to each other in a daisy chain. You will need a Qwiic cable for each sensor. Our Qwiic Cable Kit covers all the options.
+
+
+
+
+
+
+
+
DataLogger IoT and a Qwiic-Enabled Device
+
DataLogger IoT and several Qwiic-Enabled Devices Daisy Chained
+
+
+
+
+
Our Qwiic sensors usually all have power indicator LEDs and I2C pull-up resistors. Depending on your application, you may want or need to disable these by cutting the jumper links on the sensor circuit boards. We have a tutorial that will show you how to do that safely.
+
Sometimes you might want to connect more than one of the same type of sensor to the DataLogger IoT. On the I2C bus, each device needs to have a unique address. On many of our boards, there are jumpers links which you can use to change the address and some have addresses that can be configured in software. But there are some where you cannot change the address - the NAU7802 Qwiic Scale being one example.
+
Typically one would use a multiplexor. However, we currently do not have the DataLogger IoT configured to work with any multiplexors (i.e. Qwiic Mux Breakout).
+
+
Note
+
Currently the Qwiic Mux is not compatible with the DataLogger IoT.
+
+
LiPo Battery
+
+
Battery Polarity
+
Please make sure that you use one of our recommended Lithium Ion batteries. Some batteries use the same JST connector as ours but have the opposite polarity. Connecting one of these to your DataLogger IoT will destroy it. If you are going to use your own battery, it is up to you to ensure it has the correct polarity.
+
+
Now is a good time to attach a LiPo battery, if you want the DataLogger IoT to keep logging when you disconnect USB-C.
+
+
+
+
+
+
+
+
+
You can connect one of our standard single cell LiPo batteries to the DataLogger IoT and power it for hours, days or weeks depending on what sensors you have attached and how often you log data. The DataLogger IoT has a built-in charger too which will charge your battery at 500mA when USB-C is connected. Please make sure your battery capacity is at least 500mAh (0.5Ah); bad things will happen if you try to charge our smallest batteries at 500mA. The yellow CHG charging LED will light up while the battery is charging and will go out once charging is complete.
+
+
Warning
+
The MCP73831 charge IC on the board is used on a few SparkFun products. For more information about the CHG status LED, we recommend taking look at the Hardware Overview. We also recommend taking a look at this tutorial for Single Cell LiPo Battery Care.
+
+
USB Cable
+
The USB-C connector provides power to the DataLogger IoT and acts as a serial interface for configuration and data display.
+
+
+
+
+
+
+
+
+
If you are going to use a microSD card to store your data, and why wouldn’t you, then insert that first before attaching your USB cable. You should only insert or remove the SD card while the power is turned off or disconnected. Removing the card while the DataLogger IoT is logging will almost certainly corrupt your data.
+
Likewise, it is a good idea to only attach or disconnect Qwiic sensors when the power is turned off or disconnected. The Qwiic bus is pretty tolerant to “hot swapping”, but: disconnecting a sensor while it is in use will confuse the DataLogger IoT software; and a new sensor won’t be detected until the firmware restarts.
+
Depending on what ports your computer has available, you will need one of the following cables:
Use the cable to connect your DataLogger IoT to your computer and you will see the LEDs light as the DataLogger IoT starts up. The addressable RGB RGB LED will light up green for a second or two while the DataLogger IoT configures itself. It will flash blue while data is being logged to the microSD card. If you have jumped the gun and have a LiPo battery already connected, the yellow CHG charging LED may light up too.
+
If the addressable RGB LED does not light up, your DataLogger IoT is probably in deep sleep following a previous logging session. Pressing the RST reset button will wake it.
+
You’ll find full instructions on how to configure the DataLogger IoT later in this tutorial.
+
Standoffs
+
For users interested in stacking the Qwiic-enabled device on the DataLogger IoT or mounting in an enclosure, you will need some standoffs to mount the boards. When mounting, note that all four mounting holes are not positioned exactly for a 1.0"x1.0" sized Qwiic board. Only two of the four mounting holes are compatible for a 1.0"x1.0" sized Qwiic board. For example the image below shows the boards stacked on each side of the DataLogger IoT. On top, the Qwiic GPS (SAM-M10Q) breakout was also able to stack by rotating the board slightly and aligning the mounting holes on the 1.6"x1.6" sized board to the other mounting holes
+
+
+
+
+
+
+
+
+
Preparing Your MicroSD card
+
Not all microSD cards are created equal. The capacity, read/write speed, and format 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.
+
Checking MicroSD Card Format
+
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.
+
Checking MicroSD Card Format - Windows
+
To check to see if it is the correct format on a Windows you could head to the drive, right click, and select Properties.
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.
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.
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. 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.
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.
Configuring the settings is as easy as opening a serial menu. You can use any serial monitor or terminal emulator to quickly and easily change and store the DataLogger IoT settings via its USB-C interface.
+
There are plenty of free alternatives out there to configure the DataLogger IoT. For the scope of this tutorial we will be using Tera Term.
You will need a serial terminal client that supports edit characters. Most if not all modern serial terminal programs will have the ability to support interactive edits. Unfortunately, we have not had any success with CoolTerm. We have tested the DataLogger IoT with Tera Term, Minicom, and Screen.
+
+
If this is the your first time using a terminal window, We recommend checking out the tutorial below for more information on serial terminal basics.
The above guides will show you how to open the correct port for the DataLogger IoT and how to set the baud rate to 115200 baud. You can change the DataLogger IoT's baud rate through the configuration menus too should you need to.
+
+
Note
+
For users with an Arduino IDE, you could also use the Arduino Serial Monitor by setting the line ending to Newline. Users will also need to CTRL + Enter when sending any character to the DataLogger IoT. However, we recommend using one of the terminals mentioned earlier.
+
+
Initialization and Serial Output
+
Connect the DataLogger IoT to a USB cable and connect to your computer. The addressable RGB LED will light up green as it initializes. As of firmware v1.0.2.00 - build 00013e, a Startup Menu was added to the system. This allows you to change the behavior of the DataLogger at start-up. This change only affects the current system session.
+
+
+
+
+
+
'n' — Normal startup
+
'a' — Disable I2C device auto load on startup
+
'l' — List the I2C devices supported. This device table is discarded after auto-load
+
'w' — Disable WiFi
+
's' — Disable preference restore during startup
+
+
+
Note
+
The amount of time the start-up menu is displayed is adjustable. This settings can be configured in the Settings/Application Settings page, under the Advanced section.
+
+
You should see the following output when the board initializes:
+
+
+
+
+
The messages in the serial terminal provide us with the DataLogger's configuration and will vary depending on the firmware version that is loaded on the board.
+
+
The DataLogger IoT software version (in this case is v01.02.00 - build 00013e).
+
As the DataLogger IoT is initializing, the system settings are being restored from the last saved preference.
+
There no WiFi credentials and the board has failed to connect. This output will change once you provide the WiFi credentials and are able to connect to the network.
+
There are 3x devices currently detected and they are connected through I2C through the Qwiic port and SPI. These are the on-board sensors for the DataLogger IoT. There may be more devices that are detected depending on the firmware and what is connected to the ports. Since these were recognized, they were loaded onto the DataLogger IoT.
+
The current date and time is shown (by default), the date and time is set to 1-1-1970 and 00:00:00). This value will change depending on the clock source through NTP, RTC, or a u-blox GNSS module.
+
The time the board has been running will be shown in the uptime.
+
The primary external time source that the board syncs is currently through the NTP client. This can be configured depending on your clock source.
+
The board name (in this case, it was SparkFun DataLogger IoT - 9DoF)
+
The board ID (in this case, it was SFD16C8F0D1AD6B8)
+
The microSD card has been found, the type of memory card it is, the size of the memory card, how much memory is used, and how much is available.
+
If there is a WiFi network name saved, the SSID will be shown along with information indicating whether the board was able to connect to the WiFi network. By default there is no SSID saved in memory.
+
If there is a battery connected, the LiPo Battery Fuel Guage will indicate if there is one attached to the board.
+
Parameters for low power mode will be provided indicating if deep sleep is enabled, sleep interval, and wake interval.
+
Parameters for logging are also provided for the logging interval, the format for the serial output, format for the microSD card, current saved filename, and file rotation period.
+
The board will also show the available IoT services that are enabled for the DataLogger IoT.
+
Current settings to download log files via a web interface (included in firmware v01.02.00)
+
Supported devices through Qwiic or SPI will be listed if they are connected.
+
The output will finish by telling you what devices are connected to the DataLogger IoT again.
+
+
+
Note
+
As of firmware v01.02.00, there is also a compact mode! By adjusting the setting, the ESP32 will output less at startup. This settings can be configured in the Settings/Application Settings page, under the Advanced section.
+
+
+
+
+
Once the DataLogger IoT has initialized, the DataLogger IoT will begin outputting comma separated values (CSV). This is the default output that is set for the DataLogger IoT - 9DoF. Of course, you will not have as many readings on the DataLogger IoT since the 6DoF IMU and magnetometer are not populated on that version of the board.
+
+
+
+
+
+
Note
+
Depending on your DataLogger IoT preferences, your device may output as a JSON format like the image shown below.
+
+
+
+
+
The data scrolling up the screen show what each device's output is along with their associated unit if it is available. Your mileage will vary depending on the board version that you have and what device is connected:
+
+
MAX17048.Voltage (V)
+
MAX17048.State of Charge (%)
+
MAX17048.Charge Rate (%/hr)
+
ISM330.Accel X (milli-g)
+
ISM330.Accel Y (milli-g)
+
ISM330.Accel Z (milli-g)
+
ISM330.Gyro X (milli-dps)
+
ISM330.Gyro Y (milli-dps)
+
ISM330.Gyro Z (milli-dps)
+
ISM330.Temperature (C)
+
MMC5983.X Field (Gauss)
+
MMC5983.Y Field (Gauss)
+
MMC5983.Z Field (Gauss)
+
MMC5983.Temperature (C)
+
+
The output will vary depending on what is connected so you may get additional readings in the output and it may not be in the following order listed above. The logging rate defaults to about 0.067Hz (or 15000ms), so as the data scrolls past, you will see the last value settle at about 0.067Hz.
+
Main Menu
+
Right! Let's open the main menu by pressing on any key in the serial terminal program.
+
+
+
+
+
You will be prompted with a few options. Once in the configuration menu, all three colors of the addressable RGB LED will turn on to produce the color white indicating that you are navigating through the menu. Before we dive into the settings, lets check out a few commands and saving settings.
+
Quick (!) Command Reference
+
As of firmware v01.02.00, commands can be executed directly from the serial console thus bypassing the serial menu system! The following commands are supported.
+
+
+
+
Quick Command
+
+
Command Description
+
+
+
+
+ !about
+
+
+
+ Display the system about page
+
+
+
+
+ !clear-settings
+
+
+
+ Clear the on board system preferences with a yes/no prompt
+
+
+
+
+ !clear-settings-forced
+
+
+
+ Clear the on board system preferences with no prompt
+
+
+
+
+ !devices
+
+
+
+ List the currently connected devices
+
+
+
+
+ !factory-reset
+
+
+
+ Perform a factory reset - presents a Y/N prompt
+
+
+
+
+ !heap
+
+
+
+ Display the current system heap memory usage
+
+
+
+
+ !help
+
+
+
+ List the available quick commands
+
+
+
+
+ !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
+
+
+
+
+ !log-now
+
+
+
+ Perform a log observation event
+
+
+
+
+ !log-rate
+
+
+
+ If log rate measurement is enabled, the current log rate is printed
+
+
+
+
+ !reset-device
+
+
+
+ Reset the device - erasing any saved settings and restarting the device
+
+
+
+
+ !reset-device-forced
+
+
+
+ Reset the device, but without a Y/N prompt
+
+
+
+
+ !restart
+
+
+
+ Restart the device
+
+
+
+ !restart-forced
+
+
+
+ Restart the device without a Y/N prompt
+
+
+
+
+ !save-settings
+
+
+
+ Save the current settings to on-board flash
+
+
+
+
+ !sdcard
+
+
+
+ Output the current SD card usage statistics
+
+
+
+
+ !systime
+
+
+
+ Output current system time
+
+
+
+
+ !uptime
+
+
+
+ The uptime of the device
+
+
+
+
+ !device-id
+
+
+
+ The ID for the device
+
+
+
+
+ !version
+
+
+
+ The version of the firmware
+
+
+
+
+ !wifi
+
+
+
+ Output current system WiFi state
+
+
+
+
+
+
Typing a quick command and hitting the Enter button will result in the DataLogger IoT executing the command without the need to go through the menu system. Below is an example showing the !about quick command being sent and then executing the command as the DataLogger IoT is outputting CSV values to the serial terminal.
+
+
+
+
+
Exiting and Saving
+
When exiting the menus, you will be prompted with either an x or b. You can use either character when exiting the menus as well as X or B. Note that you will need to use either of these keys when making a change in order for the DataLogger IoT to save any changes in memory. Make sure that you receive the following message indicating that the settings were saved: [I] Saving System Settings. The DataLogger IoT will the continue reading the devices and outputting the readings through the serial terminal.
+
+
+
+
+
Cancelling Changes
+
You can also use any of your Esc or arrow keys (i.e. ↑, ↓, ←, →) to exit. However, using the escape or arrow keys will not save any changes in memory once the reset button is hit or whenever power is cycled.
+
+
+
+
+
Timeout from Inactivity
+
The menus will slowly exit out after 2 minutes of inactivity, so if you do not press a key the DataLogger IoT will return to its previous menu. It will continue to move back until it reaches the main menu. After another additional 2 minutes of inactivity, the board will exit begin logging data again. When the menu exits from inactivity, any changes will not be saved in memory as well.
+
+
+
+
+
Settings
+
Let's start by configuring the DataLogger's system settings. Send a 1 through the serial terminal. You will have the option to adjust various settings ranging from the your preferences, time source to synchronize the date and time, WiFi network, how the device logs data, which IoT service to use, and firmware updates.
+
+
+
+
+
+
Note
+
You may notice after entering a 1 that there is a slight delay before the DataLogger IoT responds. The delay was added to allow some time for the DataLogger IoT to receive an additional digit for any option greater than 9. If you want to head to option 1 immediately without the slight delay, you can hit the Enter key to enter the Application Settings.
+
+
We'll go over each of these options below.
+
General: Application Settings
+
In the Settings Menu, send a 1 to adjust the Application Settings. As of firmware v01.00.02, users can now adjust the baud rate of the serial console output and the menu system's timeout value.
+
+
+
+
+
In the Application Settings Menu, users will be able to configure the addressable RGB's LED through software, menu timeout, microSD card's output format, serial console's output format, terminal's baud rate, deep sleep parameters, and view the current settings of the DataLogger IoT similar to when the board was initialized. Depending on your preference and how you are logging data, you can adjust the data as CSV or JSON.
+
+
1LED Enabled — Enable/Disable the on-board RGB LED activity
+
Accepts a boolean value:
+
1 to enable (default)
+
0 to disable
+
+
+
+
+
2Menu Timeout — Inactivity timeout period for the menu system
+
Accepts the following values:
+
1 30 Seconds = 30
+
2 60 Seconds = 60 (default)
+
3 2 Minutes = 120
+
4 5 Minutes = 300
+
5 10 Minutes = 600
+
b Back
+
+
+
+
+
3Color Output — Use color output with the Serial console. (added as of firmware v01.02.00)
+
Accepts a boolean value:
+
1 to enable (default)
+
0 to disable
+
+
+
+
+
4Board Name — A specific name for this DataLogger
+
Accepts a string
+
+
+
5SD Card Format — Enable and set the output format
+
Accepts the following values:
+
1 to disable = 0
+
2 CSV format (default) = 1
+
3 JSON format = 2
+
+
+
+
+
6Serial Console Format — Enable and set the output format
+
Accepts the following values:
+
1 to disable = 0
+
2 CSV format (default) = 1
+
3 JSON format = 2
+
+
+
+
+
7JSON Buffer Size — Output buffer size in bytes
+
Accepts an integer between 100 to 5000 :
+
1600 bytes (default)
+
+
+
+
+
8Terminal Baud Rate — Update terminal baud rate. Changes take effect on restart.
+
Accepts an unsigned integer between 1200 to 50000:
+
115200(default)
+
+
+
+
+
9Enable System Sleep — If enabled, sleep the system
+
Accepts a boolean value:
+
1 to enable
+
0 to disable (default)
+
+
+
+
+
10Sleep Interval (sec) — The interval the system will sleep for
+
Accepts an integer between 5 to 86400 :
+
30 seconds (default)
+
+
+
+
+
11Wake Interval (sec) — The interval the system will operate between sleep period
+
Accepts an unsigned integer between 60 to 86400 :
+
120 seconds (default)
+
+
+
+
+
12Startup Messages Level of message output at startup
+
Accepts a value between 1 to 3 :
+
1 Normal = 0 (default)
+
2 Compact = 1
+
3 Disabled = 2
+
+
+
13Startup Delay Startup Menu Delay in Seconds
+
Accepts a value between 0 to 60 :
+
2 seconds (default)
+
+
+
+
+
14Device Names Name always includes the device address
+
Accepts a boolean value:
+
1 to enable (default)
+
0 to disable
+
+
+
+
+
15About... — Details about the system
+
bBack
+
+
+
Note
+
Once the baud rate is changed and saved, make sure to adjust the baud rate of your serial terminal when the board is reset. If you forgot the baud rate, you can hold the BOOT button down for 20 seconds to erase the on-board preferences (besides the baud rate, this also includes any other settings that were saved) and restart the board.
+
+
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
+
+
+
+
+
General: Save Settings
+
In the Settings menu, send a 2 to adjust the Save Settings. As of firmware v01.01.01, the JSON output buffer size is now user configurable. This will be under option "JSON File Buffer Size" when in the Save Settings Menu.
+
+
+
+
+
In the Save Settings Menu, users will be able to save, restore, or clear any preferences in memory (i.e. persistent storage) or a saved file to a fallback device (i.e. microSD card). Note that any passwords and secret keys are not saved in the save settings file. You will need to manually enter those values in the file saved on the microSD card.
+
+
1Fallback Restore — If unable to restore settings, use the fallback source (JSON File)
+
Accepts a boolean value:
+
1 to enable (default)
+
0 to disable
+
+
+
+
+
2Fallback Save — Save settings also saves on the fallback storage (JSON File)
+
Accepts a boolean value:
+
1 to enable
+
0 to disable (default)
+
+
+
+
+
3JSON File Buffer Size — The size in bytes used for the internal I/O buffer
+
Accepts an unsigned integer:
+
6400(default, as of firmware v01.01.01)
+
+
+
4Save Settings — Save current settings to persistent storage
+
Accepts a yes/no:
+
Y or y for yes
+
N or n for no
+
+
+
+
+
5Restore Settings — Restore saved settings
+
Accepts a yes/no:
+
Y or y for yes
+
N or n for no
+
+
+
+
+
6Clear Settings — Erase the saved settings on the device
+
Accepts a yes/no:
+
Y or y for yes
+
N or n for no
+
+
+
+
+
7Save to Fallback — Save System Settings to the fallback storage (JSON File)
+
Accepts a yes/no:
+
Y or y for yes
+
N or n for no
+
+
+
+
+
8Restore from Fallback — Restore system settings from the fallback storage (JSON File)
+
Accepts a yes/no:
+
Y or y for yes
+
N or n for no
+
+
+
+
+
bBack
+
+
If you have the Fallback Save enabled or selected the option Save to Fallback, you will notice an additional file called datalogger.json saved in the microSD card. This is the fallback file that is saved. Using a text editor, you can edit this file to adjust the settings or provide WiFi credentials, certificates, and keys. You can use option 7 to restore the settings on your DataLogger IoT.
+
+
+
+
+
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
+
+
+
+
+
General: Time Sources
+
+
Note
+
Make sure to connect the ESP32-WROOM to a 2.4GHz WiFi network and ensure that is not a guest network that requires you to sign in. Unfortunately, 5GHz WiFi is not supported on the ESP32-WROOM module.
+
+
In the Settings Menu, send 3 to manage the time reference sources. As of firmware v01.01.01, time zone support is at the clock level, not tied to NTP. The option to adjust the Time Zone is moved to the Time Sources menu.
+
+
+
+
+
In this menu, you will have options to update the primary reference clock, update interval, add a secondary reference clock, and update it's interval. By default, the primary reference clock is set to use the Network Time Protocol (NTP). To synchronization the time, you will need to connect to a 2.4GHz WiFi network in order to update the time. To add a secondary clock, make sure to connect a compatible Qwiic-enabled devices that can keep track of time (i.e. Qwiic Real Time Clock Module - RV-8803 or a Qwiic-enabled u-blox GNSS module).
1The Time Zone — Time zone setting string for the device
+
Accepts a string:
+
MST7MDT,M3.2.0,M11.1.0(default, as of firmware v01.01.01)
+
+
+
+
+
2Reference Clock — The current reference clock source
+
Accepts the following values:
+
1 for no clock
+
2 for NTP Client (default)
+
+
+
+
+
3Update Interval — Main clock update interval in minutes. 0 = No update
+
Accepts an unsigned integer:
+
0 = No update
+
60 seconds (default)
+
+
+
+
+
4Enable Clock Fallback — Use a valid reference clock if the primary is not available
+
Accepts a boolean value:
+
1 to enable (default)
+
0 to disable
+
+
+
+
+
5Dependant Interval — Connected depedant clock update interval in minutes. 0 = No update
+
Accepts an unsigned integer:
+
0 = No update
+
60 seconds (default)
+
+
+
+
+
6Update Connected — Update connected clocks on main clock update
+
Accepts a boolean value:
+
1 to enable (default)
+
0 to disable
+
+
+
+
+
bBack
+
+
+
Note
+
As an alternative to using the NTP, users can also add a compatible Qwiic-enabled device that can keep track of time (i.e. Qwiic Real Time Clock Module - RV-8803 or a Qwiic-enabled u-blox GNSS module). These can be set as the primary or secondary clock.
+
+
+
+
+
+
+
+
+
Once attached, you will be prompted with additional options to select a primary reference clock.
+
+
+
+
If you are using a u-blox GNSS module, make sure that you have enough satellites in view. The option to add or configure the GNSS will not be available if there are not enough satellites in view. If you are using the Qwiic Real Time Clock Module - RV-8803, you may need to go into the device settings to manually adjust the date and time.
+
+
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
+
+
+
+
+
Network: WiFi Network
+
+
Note
+
The ESP32-WROOM can only connect to a 2.4GHz WiFi network. Unfortunately, 5GHz is not supported on the ESP32-WROOM module.
+
+
In the Settings Menu, send a 4 to configure the WiFi settings. As of firmware v01.00.02, up to 4 sets of WiFi credentials can be saved.
+
+
+
+
+
Once you are in the WiFi Network menu, you can enable/disable WiFi and save the WiFi network credentials. Once connected to a 2.4GHz WiFi network, you can synchronize the date and time, connect to an IoT service to log data, and update the latest firmware over-the-air. Since the WiFi is turned on by default, you will simply need to save the WiFi network's name and password.
+
+
1Enabled — Enable or Disable the WiFi Network connection
+
Accepts a boolean value:
+
1 to enable (default)
+
0 to disable
+
+
+
+
+
2Network Name — The SSID of the WiFi network
+
Accepts a string:
+
For example, if my network name is "MY_NETWORK_NAME", you would manually type MY_NETWORK_NAME. When finished hit the ENTER key
+
+
+
+
+
3Password — The Password to connect to the WiFi network
+
Accepts a string:
+
For example, if my network name is "MY_SUPER_SECRET_PASSWORD", you would manually type MY_SUPER_SECRET_PASSWORD. Note that as you type the password, each character will be replaced with an asterisk (*). When finished hit the ENTER key.
+
+
+
+
+
4Network 2 Name — Alternative network 2 SSID
+
Accepts a string:
+
For example, if my network name is "MY_NETWORK_NAME_2", you would manually type MY_NETWORK_NAME_2. When finished hit the ENTER key
+
+
+
+
+
5Network 2 Password — Alternative network 2 Password
+
Accepts a string:
+
For example, if my network name is "MY_SUPER_SECRET_PASSWORD_2", you would manually type MY_SUPER_SECRET_PASSWORD_2. Note that as you type the password, each character will be replaced with an asterisk (*). When finished hit the ENTER key.
+
+
+
+
+
6Network 3 Name — Alternative network 2 SSID
+
Accepts a string:
+
For example, if my network name is "MY_NETWORK_NAME_3", you would manually type MY_NETWORK_NAME_3. When finished hit the ENTER key
+
+
+
+
+
7Network 3 Password — Alternative network 3 Password
+
Accepts a string:
+
For example, if my network name is "MY_SUPER_SECRET_PASSWORD_3", you would manually type MY_SUPER_SECRET_PASSWORD_3. Note that as you type the password, each character will be replaced with an asterisk (*). When finished hit the ENTER key.
+
+
+
+
+
8Network 4 Name — Alternative network 2 SSID
+
Accepts a string:
+
For example, if my network name is "MY_NETWORK_NAME_4", you would manually type MY_NETWORK_NAME_4. When finished hit the ENTER key
+
+
+
+
+
9Network 4 Password — Alternative network 4 Password
+
Accepts a string:
+
For example, if my network name is "MY_SUPER_SECRET_PASSWORD_4", you would manually type MY_SUPER_SECRET_PASSWORD_4. Note that as you type the password, each character will be replaced with an asterisk (*). When finished hit the ENTER key.
+
+
+
+
+
bBack
+
+
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
+
+
+
+
+
Press the reset button or cycle power to restart the DataLogger IoT. You can also go through the menu and reset the device through software as well. Once the board is reset, the DataLogger will attempt to connect to a WiFi network. If you are successful, the output will indicate that the board connected to a WiFi network and will update the current time through a NTP Client.
+
+
+
+
+
+
Note
+
If you have a Qwiic Dynamic NFC/RFID Tag connected to the board's Qwiic connector, you can easily update your WiFi credentials! Just make sure to save the WiFi credentials to the tag.
+
+
+
Note
+
If you saved your preferences to a JSON file on your microSD card's root directory, you can also save your WiFi credentials and load the system settings from the menu as well!
+
+
Network: NTP Client
+
In the Settings menu, send a 5 to adjust the NTP Client settings. As of firmware v01.01.01, time zone support is at the clock level, not tied to the NTP. The option to adjust the Time Zone is moved to the Time Sources menu.
+
+
+
+
+
In this menu, users will have the option to enable/disable the NTP client, select the primary/secondary server, or adjust the time zone for your area.
+
+
1Enabled — Enable or Disable the NTP Client
+
Accepts a boolean value:
+
1 to enable (default)
+
0 to disable
+
+
+
+
+
2NTP Server One — The primary NTP Server to use
+
Accepts a string:
+
time.nist.gov(default)
+
+
+
+
+
3NTP Server Two — The secondary NTP Server to use
+
Accepts a string:
+
pool.ntp.org(default)
+
+
+
+
+
bBack
+
+
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
+
+
+
+
+
Logging: Logger
+
In the Settings menu, send a 6 to adjust how data is logged.
+
+
+
+
+
In the Logger menu, users will have the option to add a timestamp, increment sample numbering, data format, or reset the sample counter. Note that the timestamp is the system clock and syncs with the reference clock that was chosen. Data from the Qwiic-enabled devices that keep track of time can also be included for each data entry by default.
+
+
1Timestamp Mode — Enable timestamp output and set the format of a log entry timestamp
+
1 for no timestamp (default) = 0
+
2 for milliseconds since program start = 1
+
3 for seconds since Epoch = 2
+
4 for Date Time - USA Date format = 3
+
5 for Date Time = 4
+
6 for ISO08601 Timestamp = 5
+
7 for ISO08601 Timestamp with Time Zone = 6
+
+
+
2Sample Numbering — An incremental count of the current log entry
+
Accepts a boolean value:
+
1 to enable
+
0 to disable (default)
+
+
+
+
+
3Numbering Increment — Increment amount for Sample Numbering
+
Accepts an unsigned integer between 1 to 10000:
+
1(default)
+
+
+
+
+
4Output ID — Include the Board ID in the log output (added as of firmware v01.02.00)
+
Accepts a boolean value:
+
1 to enable
+
0 to disable (default)
+
+
+
+
+
5Output Name — Include the Board Name in the log output (added as of firmware v01.02.00)
+
Accepts a boolean value:
+
1 to enable
+
0 to disable (default)
+
+
+
+
+
6Rate Metric — Enable to record the logging rate data (added as of firmware v01.02.00)
+
Accepts a boolean value:
+
1 to enable
+
0 to disable (default)
+
+
+
+
+
7SD Card Format — Enable and set the output format
+
Accepts an integer:
+
1 to disable = 0
+
2 CSV format = 1 (default)
+
3 JSON format = 2
+
+
+
+
+
8Serial Console Format — Enable and set the output format
+
Accepts an integer:
+
1 to disable = 0
+
2 CSV format = 1 (default)
+
3 JSON format = 2
+
+
+
+
+
9System Info — Log system information (added as of firmware v01.02.00)
+
Accepts a boolean value:
+
1 to enable
+
0 to disable (default)
+
+
+
+
+
10Reset Sample Counter — Reset the sample number counter to the provided value
+
Accepts an unsigned integer between 0 to 10000:
+
0(default)
+
+
+
+
+
bBack
+
+
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
+
+
+
+
+
Press the reset button or cycle power to restart the DataLogger IoT. You can also go through the menu and reset the device through software as well. Below is an example with the ISO08601 time that was added to the output.
+
+
+
+
+
Logging: Logging Timer
+
In the Settings menu, send an 7 to adjust the Logging Timer.
+
+
+
+
+
Adjusting the interval for the Logging Timer will change the amount of time between log entries.
+
+
1Interval — The timer interval in milliseconds
+
Accepts an integer:
+
15000 milliseconds (default)
+
+
+
+
+
bBack
+
+
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
+
+
+
+
+
Logging: Data File
+
In the Settings menu, send an 8 to adjust the Logging Data File.
+
+
+
+
+
Adjusting these parameters allows you to change the filename prefix, the number the files starts at, and how often the DataLogger will create a new file on the microSD card. For example, the default file will be saved as sfe0001.txt. After 1 day, the DataLogger will rotate files by creating a new file named sfe0002.txt. The DataLogger will begin logging data in this new file. The purpose of this log rotation is to limit the size of each file prevent issues when opening large files.
+
+
1Rotate Period — Time between file rotation
+
Accepts the following values:
+
1 for 6 hours = 6
+
2 for 12 hours = 12
+
3 for 1 day (24 hours) = 24 (default)
+
4 for 2 days (48 hours) = 48
+
5 for 1 week (168 hours) = 168
+
+
+
+
+
2File Start Number — The number the filename rotation starts with
+
Accepts an unsigned integer:
+
1(default)
+
+
+
+
+
3Filename Prefix — The prefix string for the generated filenames
+
Accepts a string:
+
sfe(default)
+
+
+
+
+
bBack
+
+
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
+
+
+
+
+
The contents of the file will depend on how the data was saved (either CSV or JSON). Make sure that the SD Card format is enabled to either CSV or JSON with your desired device outputs turned on so that the DataLogger can save the readings.
+
When removing the microSD card, make sure to remove your power source. Then insert into it into microSD card adapter or USB reader. When connecting the memory card to your computer, you can use a text editor to view the saved readings. In this case, a Windows operating system was viewing the file sfe0000.txt and it was only file available in the microSD card.
+
+
+
+
+
IoT Services: MQTT Client
+
In the Settings menu, send an 9 to adjust settings for the MQTT Client.
+
+
+
+
+
+
1Enabled — Enable or Disable MQTT Client
+
Accepts a boolean value:
+
1 to enable
+
0 to disable (default)
+
+
+
+
+
2Port — The MQTT broker port to connect to
+
Accepts an unsigned integer:
+
1883(default)
+
+
+
+
+
3Server — The MQTT server to connect to
+
Accepts a string
+
+
+
4MQTT Topic — The MQTT topic to publish to
+
Accepts a string
+
+
+
5Client Name — Name of this device used for MQTT Communications
+
Accepts a string
+
+
+
6Username — Username to connect to an MQTT broker, if required.
+
Accepts a string
+
+
+
7Password — Password to connect to an MQTT broker, if required.
+
Accepts a string
+
+
+
8Buffer Size — MQTT payload buffer size. If 0, the buffer size is dynamic
+
Accepts an unsigned int16:
+
0 for dynamic buffer size (default)
+
+
+
+
+
bBack
+
+
IoT Services: MQTT Secure Client
+
In the Settings menu, send an 10 to adjust settings for the MQTT Secure Client.
+
+
+
+
+
+
1Enabled — Enable or Disable MQTT Secure Client
+
Accepts a boolean value:
+
1 to enable
+
0 to disable (default)
+
+
+
+
+
2Port — The MQTT broker port to connect to
+
Accepts an unsigned integer:
+
8883(default, as of firmware v01.00.04)
+
+
+
+
+
3Server — The MQTT server to connect to
+
Accepts a string
+
+
+
4MQTT Topic — The MQTT topic to publish to
+
Accepts a string
+
+
+
5Client Name — Name of this device used for MQTT Communications
+
Accepts a string
+
+
+
6Username — Username to connect to an MQTT broker, if required.
+
Accepts a string
+
+
+
7Password — Password to connect to an MQTT broker, if required.
+
Accepts a string
+
+
+
8Buffer Size — MQTT payload buffer size. If 0, the buffer size is dynamic
+
Accepts an unsigned int16:
+
0 for dynamic buffer size (default)
+
+
+
+
+
9CA Cert Filename — The File to load the certificate from
+
Accepts a string
+
+
+
10Client Cert Filename — The File to load the client certificate from
+
Accepts a string
+
+
+
11Client Key Filename — The File to load the client key from
+
Accepts a string
+
+
+
bBack
+
+
IoT Services: AWS IoT
+
In the Settings menu, send an 11 to adjust settings for the AWS IoT.
+
+
+
+
+
+
1Enabled — Enable or Disable AWS IoT
+
Accepts a boolean value:
+
1 to enable
+
0 to disable (default)
+
+
+
+
+
2Port — The MQTT broker port to connect to
+
Accepts an unsigned integer:
+
8883(default, as of firmware v01.00.04)
+
+
+
+
+
3Server — The MQTT server to connect to
+
Accepts a string
+
+
+
4MQTT Topic — The MQTT topic to publish to
+
Accepts a string
+
$aws/things//shadow/update(default)
+
+
+
+
+
5Client Name — Name of this device used for MQTT Communications
+
Accepts a string
+
+
+
6Username — Username to connect to an MQTT broker, if required.
+
Accepts a string
+
+
+
7Password — Password to connect to an MQTT broker, if required.
+
Accepts a string
+
+
+
8Buffer Size — MQTT payload buffer size. If 0, the buffer size is dynamic
+
Accepts an unsigned int16:
+
0 for dynamic buffer size (default)
+
+
+
+
+
9CA Cert Filename — The File to load the certificate from
+
Accepts a string
+
+
+
10Client Cert Filename — The File to load the client certificate from
+
Accepts a string
+
+
+
11Client Key Filename — The File to load the client key from
+
Accepts a string
+
+
+
bBack
+
+
IoT Services: ThingSpeak MQTT
+
In the Settings menu, send an 12 to adjust settings for ThingSpeak MQTT
+
+
+
+
+
+
1Enabled — Enable or Disable ThingSpeak MQTT
+
Accepts a boolean value:
+
1 to enable
+
0 to disable (default)
+
+
+
+
+
2Port — The MQTT broker port to connect to
+
Accepts an unsigned integer:
+
8883(default, as of firmware v01.00.04)
+
+
+
+
+
3Server — The MQTT server to connect to
+
Accepts a string
+
+
+
4MQTT Topic — The MQTT topic to publish to
+
Accepts a string
+
+
+
5Client Name — Name of this device used for MQTT Communications
+
Accepts a string
+
+
+
6Username — Username to connect to an MQTT broker, if required.
+
Accepts a string
+
+
+
7Password — Password to connect to an MQTT broker, if required.
+
Accepts a string
+
+
+
8Buffer Size — MQTT payload buffer size. If 0, the buffer size is dynamic
+
Accepts an unsigned int16:
+
0 for dynamic buffer size (default)
+
+
+
+
+
9CA Cert Filename — The File to load the certificate from
+
Accepts a string
+
+
+
10Client Cert Filename — The File to load the client certificate from
+
Accepts a string
+
+
+
11Client Key Filename — The File to load the client key from
+
Accepts a string
+
+
+
12Channels — Comma separated list of =
+
Accepts a string
+
+
+
bBack
+
+
IoT Services: Azure IoT
+
In the Settings menu, send an 13 to adjust settings for the Azure IoT.
+
+
+
+
+
+
1Enabled — Enable or Disable Azure IoT
+
Accepts a boolean value:
+
1 to enable
+
0 to disable (default)
+
+
+
+
+
2Port — The MQTT broker port to connect to
+
Accepts an unsigned integer:
+
8883(default, as of firmware v01.00.04)
+
+
+
+
+
3Server — The MQTT server to connect to
+
Accepts a string
+
+
+
4MQTT Topic — The MQTT topic to publish to
+
Accepts a string
+
+
+
5Client Name — Name of this device used for MQTT Communications
+
Accepts a string
+
+
+
6Username — Username to connect to an MQTT broker, if required.
+
Accepts a string
+
+
+
7Password — Password to connect to an MQTT broker, if required.
+
Accepts a string
+
+
+
8Buffer Size — MQTT payload buffer size. If 0, the buffer size is dynamic
+
Accepts an unsigned int16:
+
0 for dynamic buffer size (default)
+
+
+
+
+
9CA Cert Filename — The File to load the certificate from
+
Accepts a string
+
+
+
10Client Cert Filename — The File to load the client certificate from
+
Accepts a string
+
+
+
11Client Key Filename — The File to load the client key from
+
Accepts a string
+
+
+
11Device ID — The device id for the Azure IoT device
+
Accepts a string
+
+
+
12Device Key — The device key for the Azure IoT device
+
Accepts a string
+
+
+
bBack
+
+
IoT Services: HTTP IoT
+
In the Settings menu, send an 14 to adjust settings for the Azure IoT.
+
+
+
+
+
+
1Enabled — Enable or Disable the HTTP Client
+
Accepts a boolean value:
+
1 to enable
+
0 to disable (default)
+
+
+
+
+
2URL — The URL to call with log information
+
Accepts a string
+
+
+
3CA Cert Filename — The File to load the certificate from
+
Accepts a string
+
+
+
bBack
+
+
IoT Services: MachineChat
+
In the Settings menu, send an 15 to adjust settings for MachineChat.
+
+
+
+
+
+
1Enabled — Enable or Disable the HTTP Client
+
Accepts a boolean value:
+
1 to enable
+
0 to disable (default)
+
+
+
+
+
2URL — The URL to call with log information
+
Accepts a string
+
+
+
3CA Cert Filename — The File to load the certificate from
In the Settings menu, send an 16 to adjust settings for Arduino Cloud. This feature was added as of firmware v01.01.01.
+
+
+
+
+
+
1Enabled — Enable or Disable the Arduino IoT Client
+
Accepts a boolean value:
+
1 to enable
+
0 to disable (default)
+
+
+
+
+
2Thing Name — The Thing Name to use for the IoT Device connection
+
Accepts a string
+
+
+
3Thing ID — The Thing ID to use for the IoT Device connection
+
Accepts a string
+
+
+
4API Client ID — The Arduino Cloud API Client ID
+
Accepts a string
+
+
+
5API Secret — The Arduino Cloud API Secret
+
Accepts a string
+
+
+
6Device Secret — The Arduino IoT Device Secret
+
Accepts a string
+
+
+
7Device ID — The Arduino IoT Cloud Device ID
+
Accepts a string
+
+
+
bBack
+
+
IoT Web Server
+
As of firmware v01.02.00, log files can be viewed and downloaded using the IoT Web Server feature if mDNS (multicast DNS) is supported on your network. This functionality is accessed via the Settings Menu, Type 17 to enter the System Update menu. Once this menu entry is selected, the following menu options are presented:
+
+
+
+
+
+
1Enabled — Enabled or Disable the Web Server
+
Accepts a boolean value
+
1 to enable
+
0 to disable (default)
+
+
+
+
+
2Username — Web access control. Leave empty to disable authentication
+
Accepts a string
+
+
+
3Password — Web access control.
+
Accepts a string
+
+
+
4mDNS Support — Enable a name for the web address this device
+
Accepts a boolean value
+
1 to enable
+
0 to disable (default)
+
+
+
+
+
5mDNS Name — mDNS Name used for this device address
+
Accepts a string
+
dataloggerXXXXX, where XXXXX is the taken from the last 5x characters from your DataLogger IoT's board ID (default)
+
+
+
+
+
bBack
+
+
+
Note
+
You will need to make sure that the ESP32 is on the same network as your computer in order to access the log files.
+
+
+
Note
+
When authentication is enabled, some browsers might require a second login depending on user settings.
+
+
+
Note
+
The SparkFun Datalogger IoT requires restarting if the web interface is enabled.
New sensors and features are being added all the time and we've made it really easy for you to keep your DataLogger IoT up to date. The System Update option provides the following functionality to the end user:
+
+
Restart the device
+
Performing a Factory Reset on the device
+
Updated the device firmware from a file on an SD Card.
+
+
+
Note
+
What's going on here?!? This tutorial was updated for firmware version 01.02.00!!! You will notice this menu option has changed to 18 !!!
+
+
This functionality is accessed via the Settings Menu, which is required to use this capability. Type 18 to enter the System Update menu. Once this menu entry is selected, the following menu options are presented:
+
+
+
+
+
+
1Device Restart — Restart/reboot the device
+
Accepts the following values:
+
Y or Y to restart or reboot the device using the current firmware and system preferences
+
N or n to cancel
+
+
+
+
+
2Factory Reset — Erase all settings and revert to original firmware
+
Accepts the following values:
+
Y or Y to factory reset the device
+
N or n to cancel
+
+
+
+
+
3Update Firmware - SD Card — Update the firmware from the SD card
+
Accepts firmware in the /root directory of the microSD card with the file naming pattern SparkFunDataLoggerIoT*.bin, where the asterisk * is the firmware version number (i.e. SparkFunDataLoggerIoT_01.00.01.bin).
+
+
+
4Update Firmware - OTA — Update the firmware over-the-air
+
Connects to a server and searches for the latest firmware that is available. Note that you must be connected to a WiFi network to be able to update the board over-the-air.
+
Accepts the following values if there is new firmware available.
+
Y or Y to update over-the-air
+
N or n to cancel
+
+
+
+
+
bBack
+
+
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
+
+
+
+
+
For more information on how to update firmware manually or over-the-air, check out the section under Examples: Updating Firmware.
In the Main Menu, send a 2 through the serial terminal to adjust the devices settings.
+
+
+
+
+
This will bring up the connected devices that are currently available. You can configure each device and enable/disable each output. Below is a sample of the on-board devices available for the DataLogger IoT - 9DoF when only the MAX17048, ISM330, and MMC5983 are connected. As the DataLogger IoT - 9DoF initializes, the board will populate additional devices in this window if they are detected. Your mileage will vary depending on what is connected. On the DataLogger IoT you will not see the ISM330 or MMC5983 as an option since the 6DoF IMU and magnetometer are not populated on that version of the board.
+
+
1MAX17048 — MAX17048 LiPo Battery Fuel Gauge
+
1Voltage (V) — Battery voltage (Volts)
+
1 to enable Voltage (V) (default)
+
2 to disable Voltage (V)
+
+
+
2State of Charge (%) — Battery state of charge (%)
1Filter Bandwidth (Hz) — The filter bandwidth in Hz
+
1 100 Hz (default)
+
2 200 Hz
+
3 400 Hz
+
4 800 Hz
+
+
+
2Auto-Reset — Auto-Reset
+
1 to enable
+
2 to disable
+
+
+
3X Field (Gauss) — The X Field strength in Gauss
+
1 to enable
+
2 to disable
+
+
+
4Y Field (Gauss) — The Y Field strength in Gauss
+
1 to enable
+
2 to disable
+
+
+
5Z Field (Gauss) — The Z Field strength in Gauss
+
1 to enable
+
2 to disable
+
+
+
6Temperature (C) — The ambient temperature in degrees C
+
1 to enable
+
2 to disable
+
+
+
+
+
bBack
+
+
When finished, you will need to exit the menus so that the DataLogger IoT saves the changes. Send a b to exit out this menu, b to exit out of the DataLogger IoT settings, and x to exit out of the main menu.
+
+
+
+
+
+
Warning
+
As you connect additional devices to the DataLogger IoT, the values associated with each device in this menu will change! Make sure to check your device settings menu after additional devices are attached should you decide to configure the additional devices and enable/disable their outputs.
+
+
+
+
+
Example - Connecting to a WiFi Network
+
+
Note
+
The ESP32-WROOM can only connect to a 2.4GHz WiFi network. Unfortunately, 5GHz is not supported on the ESP32-WROOM module.
+
+
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.
+
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.
+
+
+
+
+
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.
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.
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 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.
+
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!
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.
+
+
+
+
+
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.
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.
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.
+
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.
+
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.
+
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.
Please think very carefully before uploading any Arduino sketches to your DataLogger IoT.
+
You will overwrite the DataLogger IoT firmware, leaving it unable to update or restore itself.
+
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.
+
Really. We mean it.
+
+
Firmware Update - SD Card
+
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.
+
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.
+
To download the latest firmware and update through the microSD card, you will need to head to the GitHub repository containing the firmware. Select the firmware version and download.
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.
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.
+
+
+
+
+
+
+
+
+
+
+
Note
+
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 !!!
+
+
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.
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:
+
+
The file is contained in the root "/" folder of the SD card.
+
The filename has a ".bin" extension.
+
The filename starts with a specified name prefix. The prefix is optional and is set by the developers at SparkFun using this action.
+
For example, the DataLogger IoT boards use a prefix value of "SparkFun_DataLoggerIoT_".
+
+
+
+
Once a file is selected, the system new firmware is read off the SD card and written to the device.
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.
+
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.
+
If you have not already, connect the DataLogger IoT to your computer using a USB cable.
+
+
+
+
+
+
+
+
+
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.
+
+
+
+
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.
For the upgrade option to occur, a the system must be connected to a network and have access to the firmware OTA server.
+
+
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.
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.
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.
How a user configures and uses the MQTT connection
+
MQTT examples
+
+
General Operation
+
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.
+
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.
+
+
+
+
+
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.
+
Data Structure
+
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.
+
The following is an example of the data posted - note, this representation was "pretty printed" for readability.
+
{
+"MAX17048":{
+"Voltage (V)":4.304999828,
+"State Of Charge (%)":115.0625,
+"Change Rate (%/hr)":0
+},
+"CCS811":{
+"CO2":620,
+"VOC":33
+},
+"BME280":{
+"Humidity":25.03613281,
+"TemperatureF":79.64599609,
+"TemperatureC":26.46999931,
+"Pressure":85280.23438,
+"AltitudeM":1430.44104,
+"AltitudeF":4693.04834
+},
+"ISM330":{
+"Accel X (milli-g)":-53.31399918,
+"Accel Y (milli-g)":-34.03800201,
+"Accel Z (milli-g)":1017.236023,
+"Gyro X (milli-dps)":542.5,
+"Gyro Y (milli-dps)":-1120,
+"Gyro Z (milli-dps)":262.5,
+"Temperature (C)":26
+},
+"MMC5983":{
+"X Field (Gauss)":-0.200622559,
+"Y Field (Gauss)":0.076416016,
+"Z Field (Gauss)":0.447570801,
+"Temperature (C)":29
+}
+}
+
+
MQTT Broker Connection Setup
+
To connect to a MQTT Broker, the following information is needed:
+
+
The server name/address
+
The server port
+
The topic to post to
+
[optional] The name of the device/Client name publishing the data
+
[optional] A username - if required
+
[optional] A password - if required
+
+
These values are set using the standard DataLogger methods - the interactive menu system, or a JSON file.
+
MQTT Menu System
+
We'll need to adjust the settings for the MQTT Client using the MQTT Menu System.
+
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:
+
+
+
+
+
The options are:
+
+
Enable/Disable the connection
+
Broker Port - The standard port for mqtt is 1883
+
Broker Server - This is just the name of the server
+
MQTT Topic - A string
+
Client Name
+
Username
+
Password
+
Buffer Size
+
+
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.
+
+
Note
+
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.
+
+
+
Note
+
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.
+
+
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.
+
JSON File Entries
+
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:
To load the values by the system at startup using a JSON file and microSD card, you will need to configure the Save Settings. This JSON file will be created with the "Save to Fallback" option. Make sure to enable the MQTT Client as well.
+
+
Testing the MQTT Connection
+
Use of a MQTT connection is fairly straightforward - just requiring the entry of broker details into the connection settings.
+
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 provides some basic setup for a broker.
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:
+
mosquitto_sub-t"/sparkfun/datalogger1"
+
+
This assumes the MQTT broker is running on the same machine, and using the default port number.
+
Example - AWS
+
Creating and Connecting to an AWS IoT Device (Thing)
+
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.
How data is posted from the DataLogger IoT to the AWS Device via it's Shadow
+
+
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.
+
General Operation
+
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.
+
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.
+
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.
+
+
+
+
+
Creating a Device in AWS IoT
+
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.
Once logged into your AWS account, select IoT Core from the menu of services.
+
+
+
+
+
From the IoT Core console page, under the Manage section, select All Devices > Things
+
On the resultant Things Page, select the Create Things button.
+
+
+
+
+
AWS IoT will then take you through the steps to create a device. Selections made for a demo Thing are:
+
+
Create single thing
+
Thing Properties
+
Enter a name for your thing - for this example TestThing23
+
Device Shadow - select Unnamed shadow (classic)
+
Auto-generate a new certificate
+
Attach policies to certificate - This is discussed later in this document
+
Select Create thing
+
+
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:
+
+
Device Certificate
+
Public Key File
+
Private Key File
+
Root CA certificates - (for example: Amazon Root CA 1 )
+
+
At this point, the new AWS IoT thing is created and listed on the AWS IoT Things Console
+
+
+
+
+
Security Policy
+
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.
+
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.
+
+
+
+
+
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:
Once the policy is created, go back to the IoT Device/Thing created above and associate this policy to the device Certificate.
+
+
Go to your device Manage > All devices > Things
+
Select the device - TestThing23 for this example
+
Select the Certificates tab
+
Select the listed Certificate (it's a very long hex number)
+
At the bottom right of the page, select the Attach policies button and select the Policy created above.
+
+
+
+
+
+
At this point, AWS IoT is ready for a device to connect and receive data.
+
AWS Configuration
+
The specifics for the AWS IoT Thing must be configured. This includes the following:
+
+
Server name/host
+
MQTT topic to update
+
Client Name - The AWS IoT Thing Name
+
CA Certificate Chain
+
Client Certificate
+
Client Key
+
+
Server Name/Hostname
+
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.
+
+
+
+
+
Selecting the Classic Shadow entry provides the Server Name/Hostname for the device, as well as the MQTT topic for this device.
+
+
+
+
+
+
Note
+
The server name is obtained from the Device Shadow URL entry
+
+
MQTT Topic
+
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:
+
$aws/things/TestThing23/shadow/update
+
+
Client Name
+
This is the AWS IoT name of the thing. For the provided example, the value is TestThing23
+
CA Certificate Chain
+
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.
+
Client Certificate
+
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.
+
Client Key
+
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.
+
Setting Properties
+
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.
+
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:
+
+
+
+
+
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:
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. 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.
+
+
Tip
+
To load the values by the system at startup using a JSON file and microSD card, you will need to configure the Save Settings. This JSON file will be created with the "Save to Fallback" option. Make sure to enable the AWS IoT as well.
+
+
Operation
+
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:
+
+
+
+
+
Opening up an update, you can see the data being set to AWS IoT in a JSON format.
+
+
+
+
+
Example - ThingSpeak
+
Creating and Connecting to ThingSpeak
+
One of the key features of the DataLogger IoT is it's simplified access to IoT service providers. This document outlines how a ThinkSpeak output is used by the DataLogger IoT.
How data is posted from the DataLogger IoT to ThingSpeak
+
+
General Operation
+
ThingSpeak Structure
+
The structure of ThingSpeak is based off of the concept of Channels, with each channel supporting up to eight fields for data specific to the data source. Each channel is named, and has a unique ID associated with it. One what to think of it is that a Channel is a grouping of associated data values or fields.
+
The fields of a channel are enumerated as Field1, Field2, ..., Field8, but each field can be named to simplify data access and understanding.
+
As data is reported to a ThingSpeak channel, the field values are accessible for further processing or visualization output.
+
Data Structure
+
The DataLogger IoT is constructed around the concept of Devices which are often a type of sensor that can output a set of data values per observation or sample.
+
Mapping Data to ThingSpeak
+
The concept of Channels that contain Fields in ThingSpeak is similar to the Devices that contain Data within the DataLogger IoT, and this similarity is the mapping model used by the DataLogger IoT. Specifically:
+
+
Devices == Channels
+
Data == Fields
+
+
+
+
+
+
During configuration of the DataLogger IoT, the mapping between the Device and ThingSpeak channel is specified. The data to field mapping is automatically created by the DataLogger IoT following the data reporting order from the specific device driver.
+
Creating a Device to a ThingSpeak Channel
+
The following discussion outlines the basic steps taken to create a Channel in ThingSpeak and then connect it to the DataLogger's Device. First step is to log into your ThingSpeak and create a Channel.
Once logged into your ThingSpeak account, select Channels > My Channels menu item and on the My Channel page, select the New Channel button.
+
+
+
+
+
On the presented channel page, name the channel and fill in the specific channel fields. The fields should map to the data fields reported from the Device being linked to this channel. Order is important, and is determined by looking at output of a device to the serial device (or reviewing the device driver code).
+
+
+
+
+
Once the values are entered, select Save Channel. ThingSpeak will now show list of Channel Stats, made up of line plots for each field specified for the channel.
+
+
Note
+
Key note - at the top of this page is listed the Channel ID. Note this number - it is used to map a Device to a ThingSpeak Channel.
+
+
Setting Up ThingSpeak MQTT
+
The DataLogger IoT uses MQTT to post data to a channel. From the ThingSpeak menu, select Devices > MQTT, which displays a list of your MQTT devices. From this page, select the Add a new device button.
+
On the presented dialog, enter a name for the MQTT connection and in the Authorize channels to access, select the channel created earlier. Once you select a channel, click the Add Channel button.
+
+
Note
+
More channels can be added later.
+
+
+
+
+
+
+
Note
+
When the MQTT device is created, a set of credentials (Client ID, Username, and Password) is provided. Copy or download these values, since the password in not accessible after this step.
+
+
The selected Channel is then listed in the Authorized Channel table. Ensure that the Allow Publish and Allow Subscribe attributes are enabled for the added channel.
+
+
+
+
+
At this point, the ThingSpeak Channel is setup for access by the DataLogger IoT.
+
ThingSpeak Configuration
+
Once the device is integrated into the application, the specifics for the ThingSpeak Channel(s) must be configured. This includes the following:
+
+
Server Name/Hostname
+
Client Name
+
User Name
+
Password
+
Device to Channel mapping
+
CA Certificate Chain
+
+
Server Name/Hostname
+
This value is hostname of the ThingSpeak mqtt connection, which is mqtt3.thingspeak.com as note at ThingSpeakMQTT Basics page. Note a secure connection is used, so the port for the connection is 8883.
+
Client Name/ID
+
The Client Name/ID is found under MQTT connection details listed in the Devices > MQTT section of ThingSpeak.
+
Username
+
The Username is found under MQTT connection details listed in the Devices > MQTT section of ThingSpeak.
+
Password
+
The connection password was provided when the MQTT device was created. If you lost this value, you can regenerate a password on the MQTT Device information page.
+
Certificate File
+
You can download the cert file for ThingSpeak.com page using a web-browser. Click on the security details of this page, and navigate the dialog (browser dependent) to download the certificate. The downloaded file is the made available for the DataLogger IoT to use as a file that is loaded at runtime)
+
Setting Properties
+
The above property values must be set on the DataLogger IoT before use. They can be manually by using the menu system like the previous MQTT example.
+
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 12 to enter the ThingSpeak MQTT Menu. When the menu system for the ThingSpeak MQTT 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:
+
+
+
+
+
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 ThingSpeak example outlined in this document, the entries in the settings JSON file are as follows:
The Channels value is a list of [DEVICE NAME]=[Channel ID] pairs. Each pair is separated by a comma. In this case, the device name BME280 and the channel ID was 2054891. Make sure to match the device name that was loaded on start up with the unique channel ID that was generated when creating a ThingSpeak Channel.
+
+
Besides updating the Server, Client Name, Username, Password, CA Cert Filename, and Channels, 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 ThingSpeak service. Don't forget to enable ThingSpeak MQTT 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.
+
+
Tip
+
To load the values by the system at startup using a JSON file and microSD card, you will need to configure the Save Settings. This JSON file will be created with the "Save to Fallback" option. Make sure to enable the ThingSpeak MQTT as well.
+
+
Monitoring Output
+
Once the connector is configured and the DataLogger IoT is connected to ThingSpeak, as data is posted, the results are show on the Channel Stats page for your Channel. For the above example, the output of a SparkFun BME280 sensor produces the following output:
+
+
+
+
+
Setting Up 2x or More Devices
+
For users that are setting up 2x or more devices on the DataLogger IoT, you will need to ensure that each device has their own ThingSpeak Channel. Unfortunately, you are not able to plot sensor readings from two devices in the same channel.
+
The following example demonstrates how to set up two devices for ThingSpeak on the DataLogger IoT. In this case, we will use the BME688 and BME680 and their respective default I2C address. This is also a good example of what to do when two devices use the same device driver. Head to ThingSpeak to create a channel for each device connected to the DataLogger IoT. Include a field for each device data that the DataLogger provides. The name of the channel does not need to match the device name or I2C address.
+
+
+
+
+
+
+
+
Creating a Channel for the BME688
+
Creating a Channel for the BME680
+
+
+
+
+
Once the channels are created, you will be provided with a unique channel ID for each channel. Make sure to take note of the number as explained earlier.
+
+
Note
+
The alternative I2C address for the BME688 and BME680 uses the same address as the default of the other sensor:
+
+
BME680: 0x77 (Default) or 0x76
+
BME688: 0x76 (Default) or 0x77
+
+
Make sure to avoid using the same address when connecting the sensors to the same DataLogger IoT.
+
+
When setting up the connection, you will need to authorize both channels. In this example, we included the channels for the BME688 [x076] and BME680 [x077].
+
+
+
+
+
+
+
Authorizing 2x Channels through the Same Connection
+
+
+
+
+
Now that the ThingSpeak MQTT connection is setup, adjust the ThingSpeak configuration for the DataLogger IoT by including the credentials (i.e. Client Name, Username, and Password) and channels. We will assume that you have included the ThingSpeak CA certificate file in the root directory of the microSD card already. When including the device name with their respective channel, ensure that the device name matches the name that was loaded on startup. For example, the BME688 and BME680 were loaded on startup as BME68x and BME68x [x77], respectively. Since we are only interested in plotting the BME688 and BME680, we will ignore the MAX17048 that was loaded on startup as well. Under /Settings/ThingSpeak MQTT/Channels, you will enter the string for the device names, each of their respective channel IDs, and a comma separating the two channels like so: BME68x=2613826, BME68x [x77]=2613825.
+
+
+
+
+
+
+
+
DataLogger IoT Device Name Loaded during Startup
+
Device Name and Channel for Both Sensors
+
+
+
+
+
+
Note
+
Whenever there are multiple devices using the same device driver (each with unique I2C addresses), the DataLogger IoT will display the device address for each additional device that is loading the same driver. As shown above, the first device name did not include the device's I2C address. The second device name using the same driver included its I2C address. Of course, there is an configuration that enables you to always include the address of all the device names.
+
+
The alternative to using the menu system is the JSON file. In this case, we updated channels for the BME688 and BME680. Not shown are the ThingSpeak Client Name, Username, and Password.
If users configure the DataLogger IoT to always include the device address with the device names (i.e. /Settings/Application Settings with Device Names=1), you will need to match the device names for BME688 and BME680 that were loaded on startup as BME68x [x76] and BME68x [x77], respectively. Note the BME688 device name included a space and [x76] in this case. Remember, we are only interested in plotting hte BME688 and BME680 in this case so we will ignore the MAX17048 that was loaded on startup.
+
+
+
+
+
+
+
+
DataLogger IoT Device Names Loaded during Startup
+
Device Name and Channel for Both Sensors with Respective Addresses
+
+
+
+
Again, the alternative to using the menu system is the JSON file. In this case, we updated channels for the BME688 and BME680. We also included the address name for the BME688 like the configuration menu. Not shown are the ThingSpeak Client Name, Username, and Password.
Save the configuration to persistent memory and exit out of the configuration menu. Wait a few seconds for the DataLogger IoT to read the sensors and output the readings to the Serial Terminal. Open ThingSpeak channels in separate browser windows. In this case, we had the BME688 and the BME680 in private view. You should see sensor readings update and plot on the charts.
+
+
+
+
+
+
+
ThingSpeak Graphing the BME688 and BME680 in Seperate Channels on Two Browser Windows
+
+
+
+
+
Example - Azure
+
Creating and Connecting to an Azure IoT Device
+
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.
How data is posted from the DataLogger IoT to the Azure Device
+
+
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.
+
General Operation
+
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.
+
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.
+
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.
+
+
+
+
+
Creating a Device in Azure IoT
+
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.
Once logged into your Microsoft Azure account, select Internet of Things > IoT Hub from the menu of services.
+
+
+
+
+
Create an IoT Hub
+
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.
+
Follow the Hub Creation workflow - key settings used for a DataLogger demo device:
+
+
Used the "Free Tier" for testing and development.
+
Networking
+
Connectivity - Public Access
+
Minimum TLS Version - 1.0
+
+
+
+
The remaining settings were set at their default values.
+
Create a Device
+
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.
+
To create a device, select the Device management > Devices from the IoT Hub menu and the select the + Add Device menu item
+
+
+
+
+
In the create device dialog:
+
+
Enter a name for the device
+
Select an Authentication type of Symmetric key
+
Auto-generate keys enabled
+
+
+
+
+
+
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.
+
+
+
+
+
Azure Configuration
+
Once the DataLogger IoT is integrated into the application, the specifics for the Azure IoT Thing must be configured. This includes the following:
+
+
Server Name/Hostname
+
Device Key
+
Device ID
+
CA Certificate Chain
+
+
Server Name/Hostname
+
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.
+
+
+
+
+
Device ID
+
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.
+
+
+
+
+
Device Primary Key
+
This is obtained via the Device details page, as outlined in the previous section.
+
+
Note
+
You view and copy the key via the icons on the right of the key entry line.
+
+
Root Certificate Authority - CA file
+
The Certificate Authority file for Azure is downloaded from this page:
The file to download is the Baltimore CyberTrust Root entry in the Root Certificate Authorities section of the page.
+
+
+
+
+
Setting Properties
+
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.
+
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:
+
+
+
+
+
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:
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.
+
+
Tip
+
To load the values by the system at startup using a JSON file and microSD card, you will need to configure the Save Settings. This JSON file will be created with the "Save to Fallback" option. Make sure to enable the Azure IoT as well.
+
+
Operation and Monitoring
+
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.
+
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.
+
+
+
+
+
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.
+
Connect to Your Azure IoT Hub
+
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.
+
+
+
+
+
The available IoT Hubs are displayed in the editors command prompt. Select the desired hub and press Enter (or click).
+
+
+
+
+
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.
+
+
+
+
+
Monitoring
+
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.
+
+
+
+
+
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:
+
+
+
+
+
To stop monitoring, click the Stop Monitoring build-in event endpoint item that is displayed in the status bar of the editor.
+
+
+
+
+
A menu option to stop monitoring is also available from the ... menu of the AZURE IOT HUB section in the editor Explorer panel.
+
Example - HTTP
+
Connecting and Sending Output to an HTTP Server
+
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.
+
The following is covered by this document:
+
+
Overview of the HTTP connection
+
How a user configures and uses the HTTP connection
+
Use examples
+
+
General Operation
+
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.
+
+
+
+
+
Data Structure
+
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.
+
The following is an example of the data posted - note, this representation was "pretty printed" for readability.
+
{
+"MAX17048":{
+"Voltage (V)":4.304999828,
+"State Of Charge (%)":115.0625,
+"Change Rate (%/hr)":0
+},
+"CCS811":{
+"CO2":620,
+"VOC":33
+},
+"BME280":{
+"Humidity":25.03613281,
+"TemperatureF":79.64599609,
+"TemperatureC":26.46999931,
+"Pressure":85280.23438,
+"AltitudeM":1430.44104,
+"AltitudeF":4693.04834
+},
+"ISM330":{
+"Accel X (milli-g)":-53.31399918,
+"Accel Y (milli-g)":-34.03800201,
+"Accel Z (milli-g)":1017.236023,
+"Gyro X (milli-dps)":542.5,
+"Gyro Y (milli-dps)":-1120,
+"Gyro Z (milli-dps)":262.5,
+"Temperature (C)":26
+},
+"MMC5983":{
+"X Field (Gauss)":-0.200622559,
+"Y Field (Gauss)":0.076416016,
+"Z Field (Gauss)":0.447570801,
+"Temperature (C)":29
+}
+}
+
+
HTTP Connection Setup
+
To connect to an HTTP server endpoint, the following information is needed:
+
+
The URL of the endpoint
+
The SSL certificate for the target server, if the connection is secure (HTTPS)
+
+
These values are set using the standard DataLogger methods - the interactive menu system, or a JSON file.
+
Menu System
+
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:
+
+
+
+
+
The options are:
+
+
Enable/Disable the connection
+
Set the URL for the endpoint
+
Set the name of the CA Cert file for a secure connection (HTTP)
+
+
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 .
+
+
+
+
+
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.
+
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.
+
+
+
+
+
The above example show providing a certificate filename of example.cer.
+
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.
+
JSON File Entries
+
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:
CA Cert Filename - Set to the cert filename on the SD card if being used.
+
+
If the JSON file is saved in the microSD card, you can load the credentials to the DataLogger IoT.
+
+
Tip
+
To load the values by the system at startup using a JSON file and microSD card, you will need to configure the Save Settings. This JSON file will be created with the "Save to Fallback" option. Make sure to enable the HTTP IoT as well.
+
+
Example - Connecting to a HTTP Server
+
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.
+
The Server
+
The following javascript/node code creates a HTTP server on port 8090, and outputs received data to the console.
+
varhttp=require('http');
+
+// Setup the endpoint server
+varmyServer=http.createServer(function(req,res){
+
+// Initialize our body string
+varbody="";
+
+// on data callback, append chunk to our body string
+req.on('data',function(chunk){
+body+=chunk;
+});
+
+// On end callback, output the body to the console
+req.on('end',function(){
+// parse json string, then stringify it back for 'pretty printing'
+console.log("payload: "+JSON.stringify(JSON.parse(body),null,2));
+});
+
+// send a reply
+res.writeHead(200,{'Content-Type':'text/plain'});
+res.end('n');
+// Just listen on our port
+}).listen(8090);
+
+
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).
+
Once Node is setup, the above server is run via the following command (assuming the implementation is in a file called simple_http.js):
+
node./simple_http.js
+
+
As data is sent by the DataLogger IoT, the following is output to the console from the server:
+
+
+
+
+
Obtaining a Sites Security Certificate
+
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.
+
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
+
+
+
+
+
Next, on the page shown, select the certificate button on the upper right of the dialog.
+
+
+
+
+
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.
+
+
+
+
+
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.
Creating and Connecting to an Arduino Cloud Device
+
One of the key features of the SparkFun DataLogger IoT is it's simplified access to IoT service providers. This document outlines how an Arduino Cloud Device is used by the DataLogger IoT.
+
The following is covered by this document:
+
+
Structure of the Arduino Cloud Devices
+
Device creation in the Arduino Cloud
+
Setup of the Arduino Driver
+
How data is posted from the DataLogger IoT to the Arduino Device
+
+
Currently, the Arduino Cloud device connection is a single direction - used to post data from the DataLogger IoT to an Arduino Cloud device.
To take advantage of the API's in Arduino Cloud, you will also need to have a service plan with your account.
+
+
General Operation
+
The Arduino Cloud enables connectivity between an IoT/Edge Arduino enabled device and the cloud. The edge device updates data in the Arduino Cloud by updating variables or parameters attached to a cloud device.
+
In the Arduino Cloud, the edge device is represented by a Device which has a virtual Thing attached/associated with it. The Thing acts as a container for a list of parameters or variables which represent the data values received from the edge device. As values on the edge device update, they are transmitted to the Arduino Cloud.
+
For a SparkFun DataLogger IoT connected to an Arduino Cloud device, the output parameters of a device connected to the DataLogger are mapped to variables within the Arduino Cloud Device's Thing using a simple pattern of DeviceName_ParameterName for the name of the variable in the Arduino Cloud.
+
+
+
+
+
Creating a Device in Arduino Cloud
+
The first step connecting to the Arduino Cloud is setting up a device within the cloud. A device is a logical element that represents a physical device.
Click on the expand menu icon on the upper left (e.g. the three lines stacked like a "hamburger"; ☰) and select Devices. If your window is big enough, then it will show up on the navigation bar.
+
+
+
+
+
This page lists your currently defined devices. If there are no defined devices, select the Add Device button. This will probably be at the bottom of the page. The location of this button will change once the page has a device (or if there is an update to Arduino's user interface).
+
+
+
+
+
A device type selection dialog is then shown. Since we are connecting a DataLogger IoT board to the system, and not connected a known device, select DIY - Any Device to manually include the DataLogger IoT.
+
+
+
+
+
Once selected, another dialog is presented. Just select Continue. At this point you can provide a name for your device. In this case we named it as "MyDataLoggerIoT."
+
+
+
+
+
The next screen is the critical step of the device creation process. This step is the one time the Device Secret Key is available. The provided Device ID and Device Secret Key values are needed to connect to the Arduino Cloud. Once this step is completed, the Secret Key is no longer available.
+
+
+
+
+
The easiest way to capture these values is by downloading as a PDF file, which is offered on the setup page. Click on the download the PDF and save it to a safe location. When ready, click on the check box indicating that you have saved the values and select the Continue button.
+
Arduino Cloud API Keys
+
In addition to creating a device, to access the Arduino Cloud, the driver requires an API Key. This allows the DataLogger IoT's Arduino Cloud driver to access the web API of the Arduino Cloud. This API is used to setup the connection to the Arduino Cloud.
+
To create an API key, click on the menu bar to expand and select your Arduino account profile > Personal Settings.
+
+
+
+
+
This menu takes you to a list of existing API Keys. If you have not created one yet, the list will have nothing in it like the image below. From this page, select the CREATE API KEY button.
+
+
+
+
+
+
Note
+
Users will need a service plan in order to take advantage of the API.
+
+
In the presented dialog, enter a name for the API key. In this case, we named it "MyDataLoggerKey".
+
+
+
+
+
Once the name is entered, click CONTINUE. A page with the new API key is presented. Like in Device Creation, this page contains a secret that is only available on this page during this process.
+
+
+
+
+
Make note of the Client ID and Client Secret values on this page. The best method to capture these values is to download the PDF file offered on this page. Click on the download the PDF and save it to a safe location. When ready, click on the check box indicating that you have saved the values and select the DONE button.
+
At this point, the Arduino Cloud is setup for connection by the driver.
+
Arduino Cloud Configuration
+
To add an Arduino Cloud Device as a destination DataLogger IoT, the Arduino Cloud connection is enabled via the DataLogger menu system and the connection values, obtained from the Arduino Cloud (see above), are set in the connection properties.
+
The specifics for the Arduino Cloud must be configured. This includes the following:
+
+
Thing Name
+
Thing ID
+
API Client ID
+
API Secret
+
Device Secret
+
Device ID
+
+
+
Note
+
The Thing Name does not necessarily need to be configured. However, there will be less confusion if you set this up before connecting the DataLogger IoT to the Cloud. The Thing ID will automatically be generated and saved once there is a connection available.
+
+
Thing Name
+
The name of the Arduino Cloud Thing to use. If the Thing doesn't exist on startup, the driver will create a Thing and be named "Untitled" if you do not provide a name.
+
+
Note
+
Note satisfied with the default "Untitled" as the Thing's name? You can rename the Thing Name after creating the Thing. Note that you will need to manually rename the Thing Name on the Arduino Cloud and DataLogger IoT.
+
+
Thing ID
+
This is the ID of the Thing being used. This value is obtained by the following methods:
+
+
If the driver creates a new Thing, the ID is obtained and used.
+
If an existing Thing is connected to the DataLogger IoT, the driver retrieves it's ID.
+
+
+
Note
+
In this case, the driver cannot create any new variables until the system is restarted.
+
+
+
The user creates a new Thing using the web interface of Arduino Cloud, and provides the Thing Name and Thing ID .
+
+
API Client ID and Secret
+
These values are used to provide API access by the driver. This access allows for the creation/use of a Thing and Variables within the Arduino Cloud. These are obtained via the steps outlined earlier in this document.
+
Device Secret and ID
+
These values are used to identify the Arduino device that is connected to. These are obtained via the steps outlined earlier in this document.
+
Setting Properties
+
The above property values must be set in the DataLogger's Arduino Cloud driver before use. They can be manually by using the menu system like the previous MQTT example.
+
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 16 to enter the Arduino IoT Menu. When the menu system for the Arduino IoT 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:
+
+
+
+
+
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 Arduino Cloud example outlined in this document, the entries in the setting's JSON file are as follows:
You will need to update the API Client ID, API Secret, Device Secret, and Device ID with the values that were obtained earlier. Don't forget to enable Arduino Cloud service by setting the value to true. If the JSON file is saved in the microSD card, you will need to load the credentials to the DataLogger IoT.
+
+
Tip
+
To load the values by the system at startup using a JSON file and microSD card, you will need to configure the Save Settings. This JSON file will be created with the "Save to Fallback" option. Make sure to enable the Arduino IoT as well.
+
+
Operation
+
On startup, when the first values are written from the DataLogger IoT, the connection to the Arduino Cloud is made. During this connection, the system connects to the specified Thing and variables are mapped between the DataLogger Device values and Arduino Cloud Variables. If needed, variables can be created manually in the cloud.
+
While this initial setup takes seconds to complete, updates to the values on the Arduino Cloud are rapid as soon as there is a connection available.
+
Viewing Values
+
Once the DataLogger IoT device is configured and running, updates in Arduino Cloud are listed in the Things tab of the Arduino Cloud page. Clicking the target Thing provides access to the current variable values that are connected to the DataLogger IoT. Your mileage may vary depending on the compatible device that is connected to the DataLogger IoT. In this case, we were able to see the built-in sensors that were connected on the DataLogger IoT - 9DoF.
+
+
+
+
+
+
Note
+
Not seeing certain variables on your list? Check your connections to make sure that the compatible device is connected to the DataLogger IoT. You may also have certain outputs disabled (like the connected sensors or timestamp).
+
+
+
Note
+
Having problems connecting new variables with the DataLogger IoT? When swapping out compatible Qwiic enabled devices, you may need to delete previous cloud variables so that the DataLogger IoT is able re-initialize them on the next power cycle.
+
+
Create a Dashboard
+
With the data now available in the Arduino Cloud as variables, it is a simple step create a dashboard that plots the data values.
+
The general steps to create a simple dashboard include:
+
+
Select the Dashboards section of the Arduino Cloud.
+
Select the Build Dashboard button. If you have a dashboard already built, the location of the button will change and the button will be renamed: Create.
+
Click the edit button (i.e. the icon that looks like a paper and pencil, this is next to the eye).
+
Add an element to the dashboard -- for this example select ADD ^ > Advanced Chart.
+
On the Chart's Widget Settings select Link Variables to add readings.
+
The DataLogger IoT Variables are listed - select the variable to link.
+
Continue this step until all the desired variables are linked to the chart. You can select up to 5x variables at a time. Click on the Link Variables button after selecting the variables.
+
This will bring you back to the Chart's Widget Settings window. Configure any preferences that to display (i.e. variable colors, labels, etc.). When all variables are linked and the Chart Widget Settings is configured, select Done.
+
+
+
+
+
+
The created dashboard then displays the values posted from the SparkFun DataLogger IoT. You can continue adding additional readings on the dashboard that you were not able to fit on graph or even rename the Dashboard view. In this case, we displayed accelerometer values and temperature in degrees Celsius from the DataLogger IoT - 9DoF.
+
+
+
+
+
+
Note
+
Not seeing any values on the LIVE view? Try clicking on the other time periods to see the values posted.
+
+
Using compatible Qwiic enabled devices, you can also display additional readings that are not available with the built-in sensors. In this case, we were able to display humidity, temperature in degrees Fahrenheit, equivalent CO2, TVOC, and AQI with the DataLogger IoT and Environmental Combo Breakout (ENS160/BME280).
+
+
+
+
+
Viewing and Downloading Log Files using the IoT Web Server
+
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.
+
The following is covered by this document:
+
+
How a user configures and uses the HTTP connection
+
Use examples
+
+
IoT Web Server Connection Setup
+
To connect to the ESP32's IoT Web Server, the following information is needed:
+
+
The server name/address
+
[optional] A username - if required
+
[optional] A password - if required
+
+
IoT Web Server Menu System
+
We'll need to adjust the settings for the IoT Web Server.
+
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:
+
+
+
+
+
The options are:
+
+
Enable/Disable the connection
+
Username
+
Password
+
Enable/Disable mDNS support
+
mDNS name
+
+
At a minimum, you will just need to enable the connection. However, we recommend enabling mDNS support if it is supported in your network.
+
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.
+
JSON File Entries
+
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:
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.
+
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.
+
+
+
Tip
+
To load the values by the system at startup using a JSON file and microSD card, you will need to configure the Save Settings. This JSON file will be created with the "Save to Fallback" option. Make sure to enable the MQTT Client as well.
+
+
Connect and Download Log File
+
+
Note
+
You will need to make sure that the ESP32 is on the same network as your computer in order to access the log files.
+
+
+
Note
+
When authentication is enabled, some browsers might require a second login depending on user settings.
+
+
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".
+
+
+
+
+
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.
+
+
+
+
+
+
Note
+
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.
+
+
+
+
+
Now that you have downloaded the log files, try graphing the data on a spreadsheet!
+
Example - How to Convert Comma Separated Values (CSV) to a Spreadsheet
+
The DataLogger IoT is great at displaying real time data with an IoT service whenever there is an Internet connection available. For those that want to use the DataLogger IoT without a WiFi connection and/or you just want to save data to a microSD card, you can import the comma separated values (CSV) from the text file into a spreadsheet to graph the values.
+
There are a few spreadsheet programs available that can take text files with CSV but for the scope of this tutorial, we will be using Google Sheets™ to convert the CSV output to a graph.
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. 😉
+
+
Log Some Data!
+
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.
+
+
Tip
+
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.
+
+
+
Note
+
For users that require a timestamp with their datasets, make sure to enable timestamp.
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.
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.
+
+
+
+
+
+
Note
+
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. In this case, we are using the default CSV format.
+
+
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.
+
+
+
+
+
+
Note
+
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.
+
+
+
+
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.
+
+
+
+
+
+
Tip
+
To separate the values to each column, highlight everything in the column. Then head to the menu and select: Data > Split text into columns
+
+
+
+
+
Graphing Your Datasets
+
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.
+
+
+
+
+
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.
+
+
+
+
+
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.
+
+
+
+
+
+
Note
+
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.
+
+
+
+
+
Appendix - Supported Qwiic Devices
+
DataLogger IoT Supported Devices
+
The following lists the devices/boards supported by the DataLogger IoT boards. New drivers to support a device will be listed under the firmware version.
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.
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.
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.
+
AWS IoT Error
+
The following error occurred when the DataLogger IoT was initializing with AWS.
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.
+
ThinkSpeak IoT Error
+
The following error occurred when the DataLogger IoT was initializing with ThingSpeak.
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.
+
Arduino Cloud Error 1
+
The following error was occurred when the DataLogger IoT was initializing with Arduino Cloud.
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.
+
Arduino Cloud Error 2
+
The following error was occurred when the DataLogger IoT was initializing with Arduino Cloud.
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.
+
+
Note
+
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.
+
+
Arduino Cloud Error 3
+
The following error was occurred when the DataLogger IoT was initializing with Arduino Cloud.
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.
+
ThingSpeak Data Points Not Updating
+
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.
+
+
+
+
+
+
+
+
+
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.
U-Blox I2C Device Disappears when IoT DataLogger Initializes
+
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.
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:
The following lists the devices/boards supported by the DataLogger IoT boards. New drivers to support a device will be listed under the firmware version.
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.
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.
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.
+
AWS IoT Error
+
The following error occurred when the DataLogger IoT was initializing with AWS.
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.
+
ThinkSpeak IoT Error
+
The following error occurred when the DataLogger IoT was initializing with ThingSpeak.
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.
+
Arduino Cloud Error 1
+
The following error was occurred when the DataLogger IoT was initializing with Arduino Cloud.
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.
+
Arduino Cloud Error 2
+
The following error was occurred when the DataLogger IoT was initializing with Arduino Cloud.
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.
+
+
Note
+
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.
+
+
Arduino Cloud Error 3
+
The following error was occurred when the DataLogger IoT was initializing with Arduino Cloud.
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.
+
ThingSpeak Data Points Not Updating
+
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.
+
+
+
+
+
+
+
+
+
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.
U-Blox I2C Device Disappears when IoT DataLogger Initializes
+
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.
Please think very carefully before uploading any Arduino sketches to your DataLogger IoT.
+
You will overwrite the DataLogger IoT firmware, leaving it unable to update or restore itself.
+
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.
+
Really. We mean it.
+
+
Firmware Update - SD Card
+
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.
+
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.
+
To download the latest firmware and update through the microSD card, you will need to head to the GitHub repository containing the firmware. Select the firmware version and download.
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.
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.
+
+
+
+
+
+
+
+
+
+
+
Note
+
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 !!!
+
+
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.
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:
+
+
The file is contained in the root "/" folder of the SD card.
+
The filename has a ".bin" extension.
+
The filename starts with a specified name prefix. The prefix is optional and is set by the developers at SparkFun using this action.
+
For example, the DataLogger IoT boards use a prefix value of "SparkFun_DataLoggerIoT_".
+
+
+
+
Once a file is selected, the system new firmware is read off the SD card and written to the device.
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.
+
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.
+
If you have not already, connect the DataLogger IoT to your computer using a USB cable.
+
+
+
+
+
+
+
+
+
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.
+
+
+
+
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.
For the upgrade option to occur, a the system must be connected to a network and have access to the firmware OTA server.
+
+
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.
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.
The ESP32-WROOM can only connect to a 2.4GHz WiFi network. Unfortunately, 5GHz is not supported on the ESP32-WROOM module.
+
+
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.
+
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.
+
+
+
+
+
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.
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.
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 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.
+
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!