Skip to content

Commit

Permalink
Fixed Typos
Browse files Browse the repository at this point in the history
  • Loading branch information
foorschtbar committed Dec 29, 2021
1 parent c3f1506 commit 5aacb49
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 31 deletions.
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,16 @@ The module can be used:

## How to use

1. Manufacture PCB. Here you find the [Gerber](pcb) files
1. Assemble PCB. Here you find the [Bill of Materials](https://foorschtbar.github.io/LoRaProMini/pcb/bom/ibom.html) (BOM)
- **Attention:** The current version (v3.0) of the PCB has no ISP header! A pre-burned MEGA328P must be installed. I got one from an Arduino Pro Mini Board, because a completely assembled Arduino is cheaper than a single chip.
1. Manufacture the PCB. Here you find the [Gerber](pcb) files
1. Assemble the PCB. Here you find the [Bill of Materials](https://foorschtbar.github.io/LoRaProMini/pcb/bom/ibom.html) (BOM)
- **Attention:** The current version (v3.1) of the PCB has no ISP header! A pre-burned Atmega328P must be installed. I got one from an Arduino Pro Mini Board (3.3V 8 Mhz), because a completely assembled Arduino is cheaper than a single chip
1. Flash config firmware (See [How to flash](#how-to-flash))
1. Start voltage calibration from menu
1. Set a voltage, measure the voltage with a multimeter and note the analog value. The range is optimized up to 6V
1. Use volts-per-bit calculator to get VBP factor for config
1. Create configuration with [Configuration Builder](https://foorschtbar.github.io/LoRaProMini/configbuilder)
1. Start configuration builder [Configuration Builder](https://foorschtbar.github.io/LoRaProMini/configbuilder)
1. Measure the voltage with a multimeter.
1. Insert multimeter voltage and the analog value in the Volts-per-bit (VPB) calculator to get VPB factor.
1. If u have a adjustable power supply, try different voltages to find best factor. Warning: The maximum voltage is 6 Volt
1. Fill out the other fields like activation methode, session keys and EUIs
1. Write configuration to EEPROM using configuration menu
1. Check written configuration via configuration menu
1. Flash debug or release firmware (See [How to flash](#how-to-flash))
Expand All @@ -97,10 +99,14 @@ avrdude -F -v -c arduino -p atmega328p -P COM4 -b 57600 -D -U flash:w:firmware_1

## Firmware Changelog

### Version 2.3

- Fixed Typo

### Version 2.2

- An additional send delay between 0 and 20s has been added to avoid overlaps between different nodes with exactly the same send interval
- Some Flash memory optimizations
- Some flash memory optimizations

### Version 2.1

Expand Down Expand Up @@ -210,6 +216,7 @@ function decodeUplink(input) {
## ToDo

- [ ] Go to sleep immediately when voltage is too low
- [ ] Multi point calibration for battery voltage
- [x] Add wake up trough interrupt pins
- [x] Move Major- and Minorversion byte to single byte. 4 bits for major and 4 bits for minor.
- [x] Add option for Confirmed Uplink to config
Expand Down
8 changes: 4 additions & 4 deletions configbuilder/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
<div class="invalid-feedback"></div>
</div>
<div class="form-floating input-group has-validation mb-3">
<input type="text" class="form-control" id="BAT_SENSE_VBP">
<label for="BAT_SENSE_VBP">Adjustment for voltage divider (Volts per bit, 4 bytes)</label>
<button class="btn btn-outline-primary calc" type="button" title="VBP Calculator">
<input type="text" class="form-control" id="BAT_SENSE_VPB">
<label for="BAT_SENSE_VPB">Adjustment for voltage divider (Volts per bit, 4 bytes)</label>
<button class="btn btn-outline-primary calc" type="button" title="VPB Calculator">
<i class="bi bi-calculator"></i>
</button>
<div class="invalid-feedback"></div>
Expand Down Expand Up @@ -213,7 +213,7 @@
// NAME DATATYPE DATALEN FLIPP GROUP
"CONFIG_IS_VALID": ["int", "1", true, 0],
"SLEEPTIME": ["int", "2", true, 0],
"BAT_SENSE_VBP": ["float", "4", true, 0],
"BAT_SENSE_VPB": ["float", "4", true, 0],
"BAT_MIN_VOLTAGE": ["float", "4", true, 0],
"WAKEUP_BY_INTERRUPT_PINS": ["int", "1", true, 0],
"CONFIRMED_DATA_UP": ["int", "1", true, 0],
Expand Down
26 changes: 13 additions & 13 deletions configbuilder/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,24 @@ $("form").on('click', 'button:not(:disabled)', function (e) {
} catch (err) {}
} else if ($(this).hasClass("calc")) {
$("#calc").toggle();
calcVBP();
calcVPB();

} else if ($(this).hasClass("add")) {
let masterrow = $("#calc > div:first");
masterrow.clone().appendTo("#calc").find("input[type='text']").val("");
calcVBP();
checkVBPInputs();
calcVPB();
checkVPBInputs();

} else if ($(this).hasClass("remove")) {
$(this).parent().remove();
calcVBP();
checkVBPInputs();
calcVPB();
checkVPBInputs();
}

});

$("form").on('keyup change', '#calc input', function (e) {
calcVBP(e);
calcVPB(e);
});

$(":not(#calc) input, select").on('keyup change', function (e) {
Expand All @@ -51,20 +51,20 @@ $("#configStr").on('keyup blur change', function (e) {

$(document).ready(function (e) {
makeConfig(e);
checkVBPInputs();
checkVPBInputs();
});

function checkVBPInputs() {
function checkVPBInputs() {
$("#calc>div>button.add").prop("disabled", false).removeClass("btn-outline-secondary").addClass("btn-outline-success");
$("#calc>div>button.remove").prop("disabled", false).removeClass("btn-outline-secondary").addClass("btn-outline-danger");
$("#calc>div:not(:last-child)>button.add").prop("disabled", true).removeClass("btn-outline-success").addClass("btn-outline-secondary");
$("#calc>div:only-child>button.remove").prop("disabled", true).removeClass("btn-outline-danger").addClass("btn-outline-secondary");
}

function calcVBP(event) {
function calcVPB(event) {

let fields = $("#calc input");
let vbp = 0;
let vpb = 0;
let count = 0;
for (i = 0; i < fields.length; i += 2) {
let error = false;
Expand Down Expand Up @@ -100,17 +100,17 @@ function calcVBP(event) {
// }

if (!error) {
vbp += (voltage / analog);
vpb += (voltage / analog);
count++;
}

}

if (count > 0) {
vbp /= count;
vpb /= count;
}

$("#BAT_SENSE_VBP").val(vbp).change();
$("#BAT_SENSE_VPB").val(VPB).change();

}

Expand Down
2 changes: 1 addition & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ build_flags =
-D USE_IDEETRON_AES
-D MIC_ENABLE_arbitrary_clock_error
-D VERSION_MAJOR=2
-D VERSION_MINOR=2
-D VERSION_MINOR=3

[env:config]
build_flags =
Expand Down
12 changes: 6 additions & 6 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ typedef struct
{
uint8_t CONFIG_IS_VALID; // 1 byte
uint16_t SLEEPTIME; // 2 byte - (Deep) Sleep time between data acquisition and transmission
float BAT_SENSE_VBP; // 4 byte - Volts per Bit. See documentation
float BAT_SENSE_VPB; // 4 byte - Volts per Bit. See documentation
float BAT_MIN_VOLTAGE; // 4 byte - Minimum voltage for operation, otherwise the node continues to sleep
uint8_t WAKEUP_BY_INTERRUPT_PINS; // 1 byte - 0 = Disabled, 1 = Enabled
uint8_t CONFIRMED_DATA_UP; // 1 byte - 0 = Unconfirmed Data Up, 1 = Confirmed Data Up
Expand Down Expand Up @@ -204,7 +204,7 @@ float readBat()

value = value / numReadings;

float batteryV = value * cfg.BAT_SENSE_VBP;
float batteryV = value * cfg.BAT_SENSE_VPB;
if (CONFIG_MODE_ENABLED)
{
Serial.print(F("Analoge voltage: "));
Expand All @@ -217,8 +217,8 @@ float readBat()
Serial.print(batteryV, 1);
Serial.print(F(" V ("));
Serial.print(batteryV, 2);
Serial.print(F(" V, VBP="));
Serial.print(cfg.BAT_SENSE_VBP, 10);
Serial.print(F(" V, VPB="));
Serial.print(cfg.BAT_SENSE_VPB, 10);
Serial.println(F(")"));
}

Expand Down Expand Up @@ -333,8 +333,8 @@ void showConfig(bool raw = false)
}
Serial.print(F("> SLEEPTIME: "));
Serial.println(cfg.SLEEPTIME, DEC);
Serial.print(F("> BAT_SENSE_VBP: "));
Serial.println(cfg.BAT_SENSE_VBP, DEC);
Serial.print(F("> BAT_SENSE_VPB: "));
Serial.println(cfg.BAT_SENSE_VPB, DEC);
Serial.print(F("> BAT_MIN_VOLTAGE: "));
Serial.println(cfg.BAT_MIN_VOLTAGE, DEC);
Serial.print(F("> WAKEUP_BY_INTERRUPT_PINS: "));
Expand Down

0 comments on commit 5aacb49

Please sign in to comment.