If you want to fork this repository and work with it, you'll need to set PlatformIO up a bit differently than you would to merely use this library.
First, fork this repository into your own GitHub space. Clone it to your local computer.
Open the folder you've cloned this repo into with either VSCode or Atom. Have PlatformIO create a new project for you, but instead of allowing it to create a new folder, select the folder you've already cloned this repo into.
Create a new source program to work with in a new directory. This is the directory you should reference in the src_dir
line of your platformio.ini. Also add this directory to your .gitignore file so you can test and play with your code without publishing personal passwords or other messiness to the web. I recommend you start with one of the programs in the compile_tests folder rather than one of the examples because the compiler test programs are much more extensive and include all sensors and many modems in them.
Set your platformio.ini configuration file up like this:
1; PlatformIO Project Configuration File
5description = ModularSensors Library
6; Pick your default environment, if you have more than one and don't want to build all of them every time
8; Set the director for the code you want to test from
9src_dir = your_directory/your_source_code
12; Default baud for all examples
15; To run code checks; cppcheck and clangtidy must be installed
16check_tool = cppcheck, clangtidy
22 cppcheck: --enable=all, --inline-suppr
23 clangtidy: --checks=-*
24; deep search for dependencies, evalulating preprocessor conditionals
26; look for the library directory
28; We have to ignore these folders or PlatformIO will double count all the dependencies
44; All these library dependencies must be listed out since we're in the library
45; source code and won't read the dependencies from the library.json like a
48 envirodiy/EnviroDIY_DS3231
49 arduino-libraries/RTCZero
50 greygnome/EnableInterrupt
53 knolleary/PubSubClient
54 adafruit/Adafruit BusIO
55 adafruit/Adafruit Unified Sensor
56 https://github.com/soligen2010/Adafruit_ADS1X15.git
57 adafruit/Adafruit AM2315
58 adafruit/Adafruit BME280 Library
59 adafruit/DHT sensor library
60 adafruit/Adafruit INA219
61 adafruit/Adafruit MPL115A2
62 adafruit/Adafruit SHT4x Library
64 paulstoffregen/OneWire
65 milesburton/DallasTemperature
68 https://github.com/EnviroDIY/Tally_Library.git#Dev_I2C
69 envirodiy/SensorModbusMaster
70 envirodiy/KellerModbus
71 envirodiy/YosemitechModbus
72 vshymanskyy/StreamDebugger
73; The directories for the ModularSensors library source code
78 +<../../src/publishers>
80 +<../../src/WatchDogs>
83; Some common build flags
85 -D SDI12_EXTERNAL_PCINT
86 -D NEOSWSERIAL_EXTERNAL_PCINT
87 -D MQTT_MAX_PACKET_SIZE=240
88 -D TINY_GSM_RX_BUFFER=64
89 -D TINY_GSM_YIELD_MS=2
90extra_scripts = pre:pioScripts/generate_compile_commands.py
94; Find your COM port, enter it here, and remove the semicolon at the start of the line
100; You probably need some software serial libraries
103 https://github.com/EnviroDIY/SoftwareSerial_ExternalInts.git
104 https://github.com/PaulStoffregen/AltSoftSerial.git
105 https://github.com/SRGDamia1/NeoSWSerial.git
106; AVR boards need to ignore RTCZero, it's for SAMD only and will not compile for AVR
110 Adafruit Zero DMA Library
111; Any extra build flags you want
114 -D STANDARD_SERIAL_OUTPUT=Serial
115 -D DEBUGGING_SERIAL_OUTPUT=Serial
116 -D DEEP_DEBUGGING_SERIAL_OUTPUT=Serial
117; when I'm uploading frequently, I disable verification of the write
122[env:adafruit_feather_m0]
123; Find your COM port, enter it here, and remove the semicolon at the start of the line
125; monitor_port = COM##
127board = adafruit_feather_m0
129; SAMD boards need RTCZero for the real time clock and sleeping
133; Most of the software serial libraries won't compile.
134; Use the SERCOM's; they're better anyway
137 SoftwareSerial_ExtInts
143build_unflags = -D USE_TINYUSB
While you're working on development, there is extensive debugging text built into this library. More on that is in the Code Debugging page. In fact, there is so much debugging that turning it on universally through a build flag will cause the program to be too big to fit on a Mayfly and will likely crash a SAMD board's on-board USB drivers.