Skip to content

Commit

Permalink
Merge branch 'rel1_dvlp1m' 0.34.1.base into release1
Browse files Browse the repository at this point in the history
  • Loading branch information
neilh20 authored and neilh20 committed Feb 18, 2025
2 parents f2504c2 + 0a289cc commit 96c12c9
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 35 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.34.1-bac
0.34.1-bae
18 changes: 10 additions & 8 deletions a/tu_xx01/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ cmn_lib_deps=
; production see (release1) examples\tu_ex
;
; For alpha coding,
; (2023-Jan-02 : this worked, however PIO can change, and now seems to be doing realtime analysis of dependencies)
; (2024-Dec-05 : this worked, however PIO can change, and now seems to be doing realtime analysis of dependencies)
; and periodically when need to update all libs including ModularSensors #rel1_dvlp1m
; for clean lib - delete .pio,
; pio pkg install - execute
; leave .pio/libdeps/xxx/EnviroDIY_modularSensors as doing realtime dependencie checks
https://github.com/neilh10/ModularSensors#rel1_dvlp1m
; pio pkg install - or let PlatformIO do it.
; and comment out branch #rel1_dvlp1m
; delete .pio/libdeps/xxx/EnviroDIY_modularSensors - so forced to use src
; https://github.com/neilh10/ModularSensors#rel1_dvlp1m
; ^^ Use this when you want to pull from a specific branch
; These are latest beyond EnviroDIY releases
https://github.com/vshymanskyy/StreamDebugger ;Debug when needed
Expand Down Expand Up @@ -71,7 +72,7 @@ cmn_lib_deps=
https://github.com/neilh10/STC3100arduino.git ;#v0.3.0 # For Mayfly board Knh002rev7
https://github.com/neilh10/Arduino-SerialCommand
https://github.com/neilh10/InsituModbus
;https://github.com/neilh10/KellerModbus
https://github.com/neilh10/KellerModbus

; Ignore these folders or PlatformIO will double count all the dependencies
; Development: ModularSensors Release1: src ?
Expand Down Expand Up @@ -108,16 +109,16 @@ cmn_build_flags =
;-DUSE_RTCLIB=RTC_DS3231 ;not compiling
;-DMS_TU_XX_DEBUG
;-DMS_TU_XX_DEBUG_DEEP
;-DSTREAMDEBUGGER_DBG
;-DSTREAMDEBUGGER_DBG ;become MS_DIGIxxxx_DEBUG_DEEP
;-DMS_DUMP_FREE_RAM
;-DMS_TTY_USER_INPUT
;-DSerialCommand_inFlash ;requires MS_TTY_USER_INPUT
;-DMS_TTY_INPUT_COUNT ;only if no MS_TTY_USER_INPUT
;-DSERIALCOMMAND_DEBUG
-DMS_LOGGERBASE_POSTS
;-DMS_LOGGERBASE_SLEEP_DEBUG ;Need or below
-DMS_LOGGERBASE_DEBUG
-DMS_LOGGERBASE_DEEP_DEBUG
;-DMS_LOGGERBASE_DEBUG
;-DMS_LOGGERBASE_DEEP_DEBUG
;-DMS_LOGGERMODEM_DEBUG
;-DMS_LOGGERMODEM_DEBUG_DEEP
;-DMS_SENSORBASE_DEBUG
Expand Down Expand Up @@ -151,6 +152,7 @@ cmn_build_flags =
;-DMS_AOSONGAM2315_DEBUG
;-DMS_EXTERNALVOLTAGE_DEBUG
;-DMS_EXTERNALVOLTAGE_DEBUG_DEEP
;-DMS_INSITUPARENT_DEBUG
;-DMS_KELLERPARENT_DEBUG
;-DMS_KELLERPARENT_DEBUG_DEEP has problem
;-DMS_MODBUS_DEBUG
Expand Down
2 changes: 1 addition & 1 deletion examples/tu_xx01/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

These can be built with
in shell step to exampes\tu_xx01
.\doMe.ps1 <release_num> eg .\doMe.ps1 0.34.1-bac .hex are put in ../../../releases
.\doMe.ps1 <release_num> eg .\doMe.ps1 0.34.1-bae .hex are put in ../../../releases

This sketch uses
a) ms_cfg.ini where all the MMW UUID keys are added. This enables scaling multiple Mayflys with same software.
Expand Down
2 changes: 1 addition & 1 deletion examples/tu_xx01/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ cmn_lib_deps=
https://github.com/neilh10/STC3100arduino.git # For Mayfly board Knh002rev7
https://github.com/neilh10/Arduino-SerialCommand
https://github.com/neilh10/InsituModbus
;https://github.com/neilh10/KellerModbus
https://github.com/neilh10/KellerModbus
https://github.com/EnviroDIY/YosemitechModbus
martinl1/BMP388_DEV@^1.0.11 ; dissapeared from github.com/MartinL1/BMP388_DEV.git

Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@
"platforms": "atmelavr, atmelsam"
},
{
"name": "KellerModbus",
"name": "KellerModbus-use-neilh10",
"owner": "envirodiy",
"library id": "5439",
"url": "https://github.com/EnviroDIY/KellerModbus",
Expand Down
19 changes: 12 additions & 7 deletions src/LoggerBaseExtCpp.h
Original file line number Diff line number Diff line change
Expand Up @@ -960,9 +960,11 @@ void Logger::logDataAndPubReliably(uint8_t cia_val_override) {
} // logDataAndPubReliably

bool Logger::publishRspCodeAccepted(int16_t rspCode) {
if ((HTTPSTATUS_SUCCESS_2XX+1) > rspCode) return true;
//return (HTTPSTATUS_CREATED_201 == rspCode);
#if defined MS_DISCARD_HTTP_500
// Accept any 2XX SUCCESS
if (((HTTPSTATUS_SUCCESS_2XX+1) > rspCode)
&& (HTTPSTATUS_OK_200 <= rspCode)) {return true;}

#if 0 // defined MS_DISCARD_HTTP_500
if (HTTPSTATUS_GT_500 == rspCode) {
//As of 2022Sept15 this error is repetitive and prevents more messages being sent
// https://github.com/ODM2/ODM2DataSharingPortal/issues/628
Expand Down Expand Up @@ -1103,15 +1105,16 @@ void Logger::publishDataQuedToRemotes(bool internetPresent) {
uint16_t tot_posted = 0;
uint16_t cnt_for_pwr_analysis = 1;
MS_DBG(F("pubDQTR retry from"), serzQuedFn);
deszQuedStart();
deszQuedStart();
tmrGateway_ms = millis();
while ((dslStatus = deszQuedLine()) ) {

/*At least one publish has been sucessfull.
* Slow Down sending based on publishers acceptance rate
* Each publish creates and tears down a TCP connection */
MS_DBG(F("pubDQTR2 delay"),delay_posted_pacing_ms ,F("mS : total posted"), published_this_pass);
delay(delay_posted_pacing_ms);
tmrGateway_ms = millis();
tmrThisPublish_ms = millis();
// setup for publisher to call deszqNextCh()
rspCode = dataPublishers[i]->publishData();
watchDogTimer.resetWatchDog();
Expand Down Expand Up @@ -1144,6 +1147,8 @@ void Logger::publishDataQuedToRemotes(bool internetPresent) {
break; /// unsent lines are copied through
}
} //while
PRINTOUT(F("Sent retrys"), deszLinesRead, F("readings in"),
((float)(millis() - tmrGateway_ms)) / 1000);
// increment status of number attempts
#if 0
if (deszq_line[DESLZ_STATUS_POS]++ >=
Expand Down Expand Up @@ -1403,7 +1408,7 @@ char* Logger::deszFind(const char* in_line, char caller_id) {


bool Logger::deszRdelStart() {
deszLinesRead = deszLinesUnsent = 0;
deszLinesRead = 0;

deszq_nextChar = deszq_line;
// Open - RD & WR. WR needed to be able to delete when complete.
Expand All @@ -1417,7 +1422,7 @@ bool Logger::deszRdelStart() {
}

bool Logger::deszQuedStart() {
deszLinesRead = deszLinesUnsent = 0;
deszLinesRead = 0;

deszq_nextChar = deszq_line;
// Open - RD & WR. WR needed to be able to delete when complete.
Expand Down
1 change: 0 additions & 1 deletion src/LoggerBaseHextClass.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ uint16_t deszq_timeVariant_sz;
#define sd1_Err(s) sd1_card_fatfs.errorPrint(F(s))
uint16_t deszq_status = 0; // Bit wise status of reading
uint16_t deszLinesRead = 0;
uint16_t deszLinesUnsent = 0;
#define QUEFILE_MAX_LINE 100
char deszq_line[QUEFILE_MAX_LINE] = "";
uint16_t desz_pending_records = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/ModularSensors.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* A pre-release version will always be indicated as slightly ahead of the
* EnviroDIY branch that it is based on.
*/
#define MODULAR_SENSORS_VERSION "0.34.1-bac"
#define MODULAR_SENSORS_VERSION "0.34.1-bae"

// To get all of the base classes for ModularSensors, include LoggerBase.
// NOTE: Individual sensor definitions must be included separately.
Expand Down
1 change: 1 addition & 0 deletions src/dataPublisherBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ class dataPublisher {
* https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
*/

#define HTTPSTATUS_OK_200 200
#define HTTPSTATUS_CREATED_201 201
#define HTTPSTATUS_SUCCESS_2XX 299
// Server Error indicating a Gateway Timeout.
Expand Down
16 changes: 9 additions & 7 deletions src/sensors/InsituParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,11 @@ bool InsituParent::addSingleMeasurementResult(void) {
bool success = false;

// Initialize float variables
float waterPressureBar = -9999;
float waterTempertureC = -9999;
float waterDepthM = -9999;


float waterPressureBar = SNSRDEF_IP_WATERPRESSUREBAR;
float waterTempertureC = SNSRDEF_IP_WATERTEMPERATUREC;
float waterDepthM = SNSRDEF_IP_WATERDEPTHM;
float waterPressure_mBar = -9999;

// Check a measurement was *successfully* started (status bit 6 set)
Expand All @@ -149,12 +151,12 @@ bool InsituParent::addSingleMeasurementResult(void) {
// float waterTempertureC)

// Fix not-a-number values
if (!success || isnan(waterPressureBar)) waterPressureBar = -9999;
if (!success || isnan(waterTempertureC)) waterTempertureC = -9999;
if (!success || isnan(waterDepthM)) waterDepthM = -9999;
if (!success || isnan(waterPressureBar)) waterPressureBar = SNSRDEF_IP_WATERPRESSUREBAR ;
if (!success || isnan(waterTempertureC)) waterTempertureC = SNSRDEF_IP_WATERTEMPERATUREC;
if (!success || isnan(waterDepthM)) waterDepthM = SNSRDEF_IP_WATERDEPTHM;

// For waterPressureBar, convert bar to millibar
if (waterPressureBar != -9999)
if (waterPressureBar != SNSRDEF_IP_WATERPRESSUREBAR )
waterPressure_mBar = 1000 * waterPressureBar;

MS_DBG(F(" Pressure_mbar:"), waterPressure_mBar);
Expand Down
14 changes: 7 additions & 7 deletions src/sensors/KellerParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ bool KellerParent::addSingleMeasurementResult(void) {
bool success = false;

// Initialize float variables
float waterPressureBar = -9999;
float waterTempertureC = -9999;
float waterDepthM = -9999;
float waterPressureBar = SNSRDEF_KP_WATERPRESSUREBAR;
float waterTempertureC = SNSRDEF_KP_WATERTEMPERATUREC ;
float waterDepthM = SNSRDEF_KP_WATERDEPTHM;
float waterPressure_mBar = -9999;

// Check a measurement was *successfully* started (status bit 6 set)
Expand All @@ -155,12 +155,12 @@ bool KellerParent::addSingleMeasurementResult(void) {
// float waterTempertureC)

// Fix not-a-number values
if (!success || isnan(waterPressureBar)) waterPressureBar = -9999;
if (!success || isnan(waterTempertureC)) waterTempertureC = -9999;
if (!success || isnan(waterDepthM)) waterDepthM = -9999;
if (!success || isnan(waterPressureBar)) waterPressureBar = SNSRDEF_KP_WATERPRESSUREBAR;
if (!success || isnan(waterTempertureC)) waterTempertureC = SNSRDEF_KP_WATERTEMPERATUREC;
if (!success || isnan(waterDepthM)) waterDepthM = SNSRDEF_KP_WATERDEPTHM;

// For waterPressureBar, convert bar to millibar
if (waterPressureBar != -9999)
if (waterPressureBar != SNSRDEF_KP_WATERPRESSUREBAR)
waterPressure_mBar = 1000 * waterPressureBar;

MS_DBG(F(" Pressure_mbar:"), waterPressure_mBar);
Expand Down

0 comments on commit 96c12c9

Please sign in to comment.