Safecast / bGeigieNanoKit

bGeigieNano is a kit version of the bGeigie mobile survey geiger counter designed to fit into a Pelican Micro Case 1010.
https://safecast.org/devices/bgeigie-nano/
113 stars 43 forks source link

SAFECAST.TXT setting #55

Closed cw1812 closed 3 years ago

cw1812 commented 3 years ago

Hi there,

Anyone can tell how to setup SAFECAST.TXT? tried google but no result.

Thanks.

nokton commented 3 years ago

Below is the file format and explanation for the most relevant parameters. The definition should be on GitHub as well.

SAFECAST.TXT

============== nm=NNNNNNN did=XXXX gt=0 gm=0 cpmf=334 cpmn=Cs137 bqmf=37 bqmn=Cs137 al=100 tz=9 cn=JPN st=0 ss=0 sh=100 sm=0 cw=60

Nm - your name without a space - shows up when booting up did - the device ID - should match the number on the bGeigie top plate

cpmf - conversion factor for CPM cpmn - nuclide for cpm conversion factor bqmf - conversion factor for Becquerel/cm2 Bqmn - nuclide for Becquerel conversion factor al - level at which ALARM LED starts to blink (in CPM)

On Oct 7, 2020, at 12:23 AM, cw1812 notifications@github.com wrote:

Hi there,

Anyone can tell how to setup SAFECAST.TXT? tried google but no result.

Thanks.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Safecast/bGeigieNanoKit/issues/55, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAITQXOOP54OF4JR3BX2LB3SJMY6BANCNFSM4SGFV2EA.

cw1812 commented 3 years ago

I know "al=100" is alarm level.

I can guess "tz=9" and "cn=JPN" refer to time zone.

But seems no reference to other setting...

robouden commented 3 years ago

cw1812,

Sorry for the late reply. I had to dig into the source code to figure out myself what the other options are. Hereby the part of the code that "decode" the SAFECAST.TXT file. Check the DEBUG_PRINTLN statements in bold for the "cpmf" part of the file:

_// // Process matching keys // if(strcmp(key, "cpmf") == 0) { // Update cpm factor float factor = atoi(value); if (mConfig.cpm_factor != factor) { mConfig.cpm_factor = factor; config_changed = true; DEBUG_PRINTLN(" - Update cpm factor"); } } else if(strcmp(key, "bqmf") == 0) { // Update bq/m2 factor float factor = atoi(value); if (mConfig.bqm_factor != factor) { mConfig.bqm_factor = factor; config_changed = true; DEBUG_PRINTLN(" - Update bq/m2 factor"); } } else if(strcmp(key, "nm") == 0) { // Update name in EEPROM if (strcmp(mConfig.user_name, value) != 0 ) { strcpy(mConfig.user_name, value); config_changed = true; DEBUG_PRINTLN(" - Update name in EEPROM"); } } else if(strcmp(key, "did") == 0) { // Update device id in EEPROM if (mConfig.device_id != (unsigned int)atoi(value)) { mConfig.device_id = atoi(value); config_changed = true; DEBUG_PRINTLN(" - Update devide id in EEPROM"); } } else if(strcmp(key, "gt") == 0) { // Update geiger type in EEPROM if (mConfig.type != atoi(value)) { mConfig.type = atoi(value); config_changed = true; DEBUG_PRINTLN(" - Update geiger type in EEPROM"); } } else if(strcmp(key, "gm") == 0) { // Update geiger mode in EEPROM if (mConfig.mode != atoi(value)) { mConfig.mode = atoi(value); config_changed = true; DEBUG_PRINTLN(" - Update geiger mode in EEPROM"); } } else if(strcmp(key, "al") == 0) { // Update alarm threshold in EEPROM if (mConfig.alarm_level != (unsigned int)atoi(value)) { mConfig.alarm_level = atoi(value); config_changed = true; DEBUG_PRINTLN(" - Update alarm threshold in EEPROM"); } } else if(strcmp(key, "cn") == 0) { // Update country code in EEPROM value[3] = '\0'; // force 3 characters code if (strcmp(mConfig.country_code, value) != 0 ) { strcpy(mConfig.country_code, value); config_changed = true; DEBUG_PRINTLN(" - Update country code in EEPROM"); } } else if(strcmp(key, "tz") == 0) { // Update timezone in EEPROM if (mConfig.timezone != atoi(value)) { mConfig.timezone = atoi(value); config_changed = true; DEBUG_PRINTLN(" - Update timezone in EEPROM"); } } else if(strcmp(key, "st") == 0) { // Update sensor type in EEPROM if (mConfig.sensor_type != atoi(value)) { mConfig.sensor_type = atoi(value); config_changed = true; DEBUG_PRINTLN(" - Update sensor type in EEPROM"); } } else if(strcmp(key, "ss") == 0) { // Update sensor shield in EEPROM if (mConfig.sensor_shield != atoi(value)) { mConfig.sensor_shield = atoi(value); config_changed = true; DEBUG_PRINTLN(" - Update sensor shield in EEPROM"); } } else if(strcmp(key, "sh") == 0) { // Update sensor height in EEPROM if (mConfig.sensor_height != (unsigned int)atoi(value)) { mConfig.sensor_height = atoi(value); config_changed = true; DEBUG_PRINTLN(" - Update sensor height in EEPROM"); } } else if(strcmp(key, "sm") == 0) { // Update sensor mode in EEPROM if (mConfig.sensor_mode != atoi(value)) { mConfig.sensor_mode = atoi(value); config_changed = true; DEBUG_PRINTLN(" - Update sensor mode in EEPROM"); } }

regards, Rob Oudendijk

robouden commented 3 years ago

cw1812,

I took the code out and left the comments (much easier to read):

"cpmf" " - Update cpm factor" "bqmf" " - Update bq/m2 factor" "nm" " - Update name in EEPROM" "did" " - Update devide id in EEPROM" "gt" " - Update geiger type in EEPROM" "gm" " - Update geiger mode in EEPROM" "al" " - Update alarm threshold in EEPROM" "cn" " - Update country code in EEPROM" "tz" " - Update timezone in EEPROM" "st" " - Update sensor type in EEPROM" "ss" " - Update sensor shield in EEPROM" "sh" " - Update sensor height in EEPROM" "sm" " - Update sensor mode in EEPROM" "dose" " - Reset total dose in EEPROM"