Skip to content

Commit 8bf9630

Browse files
committed
Add instructions for configuring modular sensors
Signed-off-by: Sara Damiano <[email protected]>
1 parent 5dd98dc commit 8bf9630

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

NGWOS_AWS_MQTT/ReadMe.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,23 @@ Do not proceed to this program until you have successfully connected to and publ
8888

8989
You need your thing name and endpoint again for this sketch.
9090

91+
## Configuring the ModularSensors library
92+
93+
To get consistent two-way communication with the USGS AWS instance, you need to increase the default timeout for MQTT messages within the ModularSensors library.
94+
This is a simple change to a single file.
95+
96+
- Find the ModularSensors configuration header
97+
- If you are using the Arduino IDE, the file will be here: `"C:\Users\{your_user_name}\Documents\Arduino\libraries\EnviroDIY_ModularSensors\src\ModSensorConfig.h"`
98+
- Open the configuration file in a text editor (like notepad)
99+
- You cannot open this header file in the Arduino IDE; you must use a text editor.
100+
- In line 317 of ModSensorConfig.h, find the define `#define MS_AWS_IOT_MAX_CONNECTION_TIME 30000L` and replace the `30000L` with `120000L`:
101+
- Line 317 will end up as `#define MS_AWS_IOT_MAX_CONNECTION_TIME 120000L`
102+
- Save and close the file.
103+
104+
If you are using PlatformIO you *do not* need to modify this file.
105+
Instead, add a the [build flag](https://docs.platformio.org/en/latest/projectconf/sections/env/options/build/build_flags.html) `-DMS_AWS_IOT_MAX_CONNECTION_TIME=120000L`to your platformio.ini file
106+
This build flag is already set in the platformio.ini file for this example.
107+
91108
## Customizing the Example Sketch
92109

93110
### Set your AWS IoT Core Endpoint

NGWOS_AWS_MQTT/platformio_example.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ monitor_speed = 115200
2020
board_build.variant = stonefly_m4
2121
board_build.variants_dir = ${platformio.core_dir}/variants
2222
board_build.ldscript = ${platformio.core_dir}/variants/stonefly_m4/linker_scripts/gcc/flash_with_bootloader.ld
23+
build_flags =
24+
-DMS_AWS_IOT_MAX_CONNECTION_TIME=120000L
2325
lib_ldf_mode = deep+
2426
lib_compat_mode = soft
2527
lib_deps =

0 commit comments

Comments
 (0)