Browse Source

Fix typos throughout code

Found with `codespell -w -i3 src/**` and reviewed manually.

Fixes: #1112
pull/1116/head
Alexander Dahl 1 year ago
parent
commit
ae3e98e77d
  1. 2
      src/app.h
  2. 4
      src/config/config_override_example.h
  3. 6
      src/hm/hmInverter.h
  4. 2
      src/hm/hmRadio.h
  5. 6
      src/hm/miPayload.h
  6. 8
      src/hms/cmt2300a.h
  7. 2
      src/plugins/Display/Display_ePaper.cpp
  8. 2
      src/publisher/pubMqtt.h
  9. 12
      src/utils/improv.h
  10. 2
      src/web/RestApi.h
  11. 2
      src/web/html/index.html
  12. 10
      src/web/html/setup.html
  13. 2
      src/web/web.h

2
src/app.h

@ -172,7 +172,7 @@ class app : public IApp, public ah::Scheduler {
} }
void ivSendHighPrio(Inverter<> *iv) { void ivSendHighPrio(Inverter<> *iv) {
if(mIVCommunicationOn) { // only send commands if communcation is enabled if(mIVCommunicationOn) { // only send commands if communication is enabled
if (iv->ivGen == IV_HM) if (iv->ivGen == IV_HM)
mPayload.ivSendHighPrio(iv); mPayload.ivSendHighPrio(iv);
else if (iv->ivGen == IV_MI) else if (iv->ivGen == IV_MI)

4
src/config/config_override_example.h

@ -9,11 +9,11 @@
// override fallback WiFi info // override fallback WiFi info
#define FB_WIFI_OVERRIDDEN #define FB_WIFI_OVERRIDDEN
// each ovveride must be preceeded with an #undef statement // each override must be preceded with an #undef statement
#undef FB_WIFI_SSID #undef FB_WIFI_SSID
#define FB_WIFI_SSID "MY_SSID" #define FB_WIFI_SSID "MY_SSID"
// each ovveride must be preceeded with an #undef statement // each override must be preceded with an #undef statement
#undef FB_WIFI_PWD #undef FB_WIFI_PWD
#define FB_WIFI_PWD "MY_WIFI_KEY" #define FB_WIFI_PWD "MY_WIFI_KEY"

6
src/hm/hmInverter.h

@ -65,7 +65,7 @@ struct calcFunc_t {
template<class T=float> template<class T=float>
struct record_t { struct record_t {
byteAssign_t* assign; // assigment of bytes in payload byteAssign_t* assign; // assignment of bytes in payload
uint8_t length; // length of the assignment list uint8_t length; // length of the assignment list
T *record; // data pointer T *record; // data pointer
uint32_t ts; // timestamp of last received payload uint32_t ts; // timestamp of last received payload
@ -151,7 +151,7 @@ class Inverter {
InverterStatus status; // indicates the current inverter status InverterStatus status; // indicates the current inverter status
std::array<alarm_t, 10> lastAlarm; // holds last 10 alarms std::array<alarm_t, 10> lastAlarm; // holds last 10 alarms
uint8_t alarmNxtWrPos; // indicates the position in array (rolling buffer) uint8_t alarmNxtWrPos; // indicates the position in array (rolling buffer)
uint16_t alarmCnt; // counts the total number of occured alarms uint16_t alarmCnt; // counts the total number of occurred alarms
int8_t rssi; // HMS and HMT inverters only int8_t rssi; // HMS and HMT inverters only
@ -361,7 +361,7 @@ class Inverter {
//} //}
} }
else else
DPRINTLN(DBG_WARN, F("add with unknown assginment")); DPRINTLN(DBG_WARN, F("add with unknown assignment"));
} }
else else
DPRINTLN(DBG_ERROR, F("addValue: assignment not found with cmd 0x")); DPRINTLN(DBG_ERROR, F("addValue: assignment not found with cmd 0x"));

2
src/hm/hmRadio.h

@ -231,7 +231,7 @@ class HmRadio {
uint8_t getDataRate(void) { uint8_t getDataRate(void) {
if(!mNrf24.isChipConnected()) if(!mNrf24.isChipConnected())
return 3; // unkown return 3; // unknown
return mNrf24.getDataRate(); return mNrf24.getDataRate();
} }

6
src/hm/miPayload.h

@ -271,7 +271,7 @@ const byteAssign_t InfoAssignment[] = {
} }
} else if ( p->packet[0] == (TX_REQ_INFO + ALL_FRAMES) // response from get information command } else if ( p->packet[0] == (TX_REQ_INFO + ALL_FRAMES) // response from get information command
|| (p->packet[0] == 0xB6 && mPayload[iv->id].txCmd != 0x36)) { // strange short response from MI-1500 3rd gen; might be missleading! || (p->packet[0] == 0xB6 && mPayload[iv->id].txCmd != 0x36)) { // strange short response from MI-1500 3rd gen; might be misleading!
// atm, we just do nothing else than print out what we got... // atm, we just do nothing else than print out what we got...
// for decoding see xls- Data collection instructions - #147ff // for decoding see xls- Data collection instructions - #147ff
//mPayload[iv->id].txId = p->packet[0]; //mPayload[iv->id].txId = p->packet[0];
@ -280,7 +280,7 @@ const byteAssign_t InfoAssignment[] = {
if (*pid == 0x00) { if (*pid == 0x00) {
DPRINT(DBG_DEBUG, F("fragment number zero received")); DPRINT(DBG_DEBUG, F("fragment number zero received"));
iv->setQueuedCmdFinished(); iv->setQueuedCmdFinished();
} else if (p->packet[9] == 0x81) { // might need some additional check, as this is only ment for short answers! } else if (p->packet[9] == 0x81) { // might need some additional check, as this is only meant for short answers!
DPRINT_IVID(DBG_WARN, iv->id); DPRINT_IVID(DBG_WARN, iv->id);
DBGPRINTLN(F("seems to use 3rd gen. protocol - switching ivGen!")); DBGPRINTLN(F("seems to use 3rd gen. protocol - switching ivGen!"));
iv->ivGen = IV_HM; iv->ivGen = IV_HM;
@ -404,7 +404,7 @@ const byteAssign_t InfoAssignment[] = {
(mPayload[iv->id].txId != (0x88)) && (mPayload[iv->id].txId != (0x88)) &&
(mPayload[iv->id].txId != (0x92)) && (mPayload[iv->id].txId != (0x92)) &&
(mPayload[iv->id].txId != 0 )) { (mPayload[iv->id].txId != 0 )) {
// no processing needed if txId is not one of 0x95, 0x88, 0x89, 0x91, 0x92 or resonse to 0x36ff // no processing needed if txId is not one of 0x95, 0x88, 0x89, 0x91, 0x92 or response to 0x36ff
mPayload[iv->id].complete = true; mPayload[iv->id].complete = true;
continue; // skip to next inverter continue; // skip to next inverter
} }

8
src/hms/cmt2300a.h

@ -8,7 +8,7 @@
#include "esp32_3wSpi.h" #include "esp32_3wSpi.h"
#define WORK_FREQ_KHZ 865000 // disired work frequency between DTU and #define WORK_FREQ_KHZ 865000 // desired work frequency between DTU and
// inverter in kHz // inverter in kHz
#define HOY_BASE_FREQ_KHZ 860000 // in kHz #define HOY_BASE_FREQ_KHZ 860000 // in kHz
#define HOY_MAX_FREQ_KHZ 923500 // 0xFE * 250kHz + Base_freq #define HOY_MAX_FREQ_KHZ 923500 // 0xFE * 250kHz + Base_freq
@ -153,7 +153,7 @@
#define CMT2300A_MASK_TX_DONE_FLG 0x08 #define CMT2300A_MASK_TX_DONE_FLG 0x08
#define CMT2300A_MASK_PKT_OK_FLG 0x01 #define CMT2300A_MASK_PKT_OK_FLG 0x01
// default CMT paramters // default CMT parameters
static uint8_t cmtConfig[0x60] PROGMEM { static uint8_t cmtConfig[0x60] PROGMEM {
// 0x00 - 0x0f -- RSSI offset +- 0 and 13dBm // 0x00 - 0x0f -- RSSI offset +- 0 and 13dBm
0x00, 0x66, 0xEC, 0x1C, 0x70, 0x80, 0x14, 0x08, 0x00, 0x66, 0xEC, 0x1C, 0x70, 0x80, 0x14, 0x08,
@ -360,7 +360,7 @@ class Cmt2300a {
inline uint8_t freq2Chan(const uint32_t freqKhz) { inline uint8_t freq2Chan(const uint32_t freqKhz) {
if((freqKhz % FREQ_STEP_KHZ) != 0) { if((freqKhz % FREQ_STEP_KHZ) != 0) {
DPRINT(DBG_WARN, F("swtich frequency to ")); DPRINT(DBG_WARN, F("switch frequency to "));
DBGPRINT(String(freqKhz)); DBGPRINT(String(freqKhz));
DBGPRINT(F("kHz not possible!")); DBGPRINT(F("kHz not possible!"));
return 0xff; // error return 0xff; // error
@ -373,7 +373,7 @@ class Cmt2300a {
return 0xff; // error return 0xff; // error
if((freqKhz < FREQ_WARN_MIN_KHZ) || (freqKhz > FREQ_WARN_MAX_KHZ)) if((freqKhz < FREQ_WARN_MIN_KHZ) || (freqKhz > FREQ_WARN_MAX_KHZ))
DPRINTLN(DBG_WARN, F("Disired frequency is out of EU legal range! (863 - 870MHz)")); DPRINTLN(DBG_WARN, F("Desired frequency is out of EU legal range! (863 - 870MHz)"));
return (freqKhz - HOY_BASE_FREQ_KHZ) / FREQ_STEP_KHZ; return (freqKhz - HOY_BASE_FREQ_KHZ) / FREQ_STEP_KHZ;
} }

2
src/plugins/Display/Display_ePaper.cpp

@ -205,7 +205,7 @@ void DisplayEPaper::actualPowerPaged(float totalPower, float totalYieldDay, floa
void DisplayEPaper::loop(float totalPower, float totalYieldDay, float totalYieldTotal, uint8_t isprod) { void DisplayEPaper::loop(float totalPower, float totalYieldDay, float totalYieldTotal, uint8_t isprod) {
// check if the IP has changed // check if the IP has changed
if (_settedIP != WiFi.localIP().toString().c_str()) { if (_settedIP != WiFi.localIP().toString().c_str()) {
// save the new IP and call the Headline Funktion to adapt the Headline // save the new IP and call the Headline Function to adapt the Headline
_settedIP = WiFi.localIP().toString().c_str(); _settedIP = WiFi.localIP().toString().c_str();
headlineIP(); headlineIP();
} }

2
src/publisher/pubMqtt.h

@ -606,7 +606,7 @@ class PubMqtt {
uint32_t mIvLastRTRpub[MAX_NUM_INVERTERS]; uint32_t mIvLastRTRpub[MAX_NUM_INVERTERS];
uint16_t mIntervalTimeout; uint16_t mIntervalTimeout;
// last will topic and payload must be available trough lifetime of 'espMqttClient' // last will topic and payload must be available through lifetime of 'espMqttClient'
char mLwtTopic[MQTT_TOPIC_LEN+5]; char mLwtTopic[MQTT_TOPIC_LEN+5];
const char *mDevName, *mVersion; const char *mDevName, *mVersion;
char mClientId[24]; // number of chars is limited to 23 up to v3.1 of MQTT char mClientId[24]; // number of chars is limited to 23 up to v3.1 of MQTT

12
src/utils/improv.h

@ -39,7 +39,7 @@ class Improv {
if(!checkPaket(&buf[0], len, [this](uint8_t type, uint8_t buf[], uint8_t len) { if(!checkPaket(&buf[0], len, [this](uint8_t type, uint8_t buf[], uint8_t len) {
parsePayload(type, buf, len); parsePayload(type, buf, len);
})) { })) {
DBGPRINTLN(F("check paket failed")); DBGPRINTLN(F("check packet failed"));
} }
dumpBuf(buf, len); dumpBuf(buf, len);
} }
@ -100,7 +100,7 @@ class Improv {
if(0 != strncmp((char*)buf, "IMPROV", 6)) if(0 != strncmp((char*)buf, "IMPROV", 6))
return false; return false;
// verison check (only version 1 is supported!) // version check (only version 1 is supported!)
if(0x01 != buf[6]) if(0x01 != buf[6])
return false; return false;
@ -124,7 +124,7 @@ class Improv {
void sendDevInfo(void) { void sendDevInfo(void) {
uint8_t buf[50]; uint8_t buf[50];
buf[7] = TYPE_RPC_RESPONSE; buf[7] = TYPE_RPC_RESPONSE;
buf[9] = GET_DEVICE_INFO; // repsonse to cmd buf[9] = GET_DEVICE_INFO; // response to cmd
uint8_t p = 11; uint8_t p = 11;
// firmware name // firmware name
p += char2Improv("AhoyDTU", &buf[p]); p += char2Improv("AhoyDTU", &buf[p]);
@ -140,7 +140,7 @@ class Improv {
p += char2Improv(mDevName, &buf[p]); p += char2Improv(mDevName, &buf[p]);
buf[10] = p - 11; // sub length buf[10] = p - 11; // sub length
buf[8] = p - 9; // paket length buf[8] = p - 9; // packet length
sendPaket(buf, p); sendPaket(buf, p);
} }
@ -157,7 +157,7 @@ class Improv {
uint8_t buf[50]; uint8_t buf[50];
buf[7] = TYPE_RPC_RESPONSE; buf[7] = TYPE_RPC_RESPONSE;
buf[9] = GET_WIFI_NETWORKS; // repsonse to cmd buf[9] = GET_WIFI_NETWORKS; // response to cmd
uint8_t p = 11; uint8_t p = 11;
JsonArray arr = obj[F("networks")]; JsonArray arr = obj[F("networks")];
@ -170,7 +170,7 @@ class Improv {
p += char2Improv(String(arr[i][F("rssi")]).c_str(), &buf[p]); p += char2Improv(String(arr[i][F("rssi")]).c_str(), &buf[p]);
buf[10] = p - 11; // sub length buf[10] = p - 11; // sub length
buf[8] = p - 9; // paket length buf[8] = p - 9; // packet length
sendPaket(buf, p); sendPaket(buf, p);
} }

2
src/web/RestApi.h

@ -280,7 +280,7 @@ class RestApi {
getGeneric(request, obj.createNestedObject(F("generic"))); getGeneric(request, obj.createNestedObject(F("generic")));
obj[F("refresh")] = 3; obj[F("refresh")] = 3;
obj[F("refresh_url")] = "/"; obj[F("refresh_url")] = "/";
obj[F("html")] = F("succesfully logged out"); obj[F("html")] = F("successfully logged out");
} }
void getHtmlReboot(AsyncWebServerRequest *request, JsonObject obj) { void getHtmlReboot(AsyncWebServerRequest *request, JsonObject obj) {

2
src/web/html/index.html

@ -47,7 +47,7 @@
function apiCb(obj) { function apiCb(obj) {
var e = document.getElementById("apiResult"); var e = document.getElementById("apiResult");
if(obj["success"]) { if(obj["success"]) {
e.innerHTML = " command excuted"; e.innerHTML = " command executed";
getAjax("/api/index", parse); getAjax("/api/index", parse);
} }
else else

10
src/web/html/setup.html

@ -65,7 +65,7 @@
<div class="col-12 col-sm-9"><input type="text" name="ap_pwd" minlength="8" /></div> <div class="col-12 col-sm-9"><input type="text" name="ap_pwd" minlength="8" /></div>
</div> </div>
<p>Enter the credentials to your prefered WiFi station. After rebooting the device tries to connect with this information.</p> <p>Enter the credentials to your preferred WiFi station. After rebooting the device tries to connect with this information.</p>
<div class="row mb-3"> <div class="row mb-3">
<div class="col-12 col-sm-3 my-2">Search Networks</div> <div class="col-12 col-sm-3 my-2">Search Networks</div>
@ -181,7 +181,7 @@
<div class="col-4 col-sm-9"><input type="checkbox" name="strtWthtTm"/></div> <div class="col-4 col-sm-9"><input type="checkbox" name="strtWthtTm"/></div>
</div> </div>
<div class="row mb-3"> <div class="row mb-3">
<div class="col-8 col-sm-3">Yield Effiency (should be between 0.95 and 0.96)</div> <div class="col-8 col-sm-3">Yield Efficiency (should be between 0.95 and 0.96)</div>
<div class="col-4 col-sm-9"><input type="number" name="yldEff" step="any"/></div> <div class="col-4 col-sm-9"><input type="number" name="yldEff" step="any"/></div>
</div> </div>
</fieldset> </fieldset>
@ -200,7 +200,7 @@
<div class="col-12 col-sm-9"><input type="number" name="ntpPort"/></div> <div class="col-12 col-sm-9"><input type="number" name="ntpPort"/></div>
</div> </div>
<div class="row mb-3"> <div class="row mb-3">
<div class="col-12 col-sm-3 my-2">NTP Intervall (in Minutes, min. 5 Minutes)</div> <div class="col-12 col-sm-3 my-2">NTP Interval (in Minutes, min. 5 Minutes)</div>
<div class="col-12 col-sm-9"><input type="number" name="ntpIntvl"/></div> <div class="col-12 col-sm-9"><input type="number" name="ntpIntvl"/></div>
</div> </div>
<div class="row mb-3"> <div class="row mb-3">
@ -487,7 +487,7 @@
function apiCbNtp(obj) { function apiCbNtp(obj) {
var e = document.getElementById("apiResultNtp"); var e = document.getElementById("apiResultNtp");
if(obj["success"]) if(obj["success"])
e.innerHTML = "command excuted, set new time ..."; e.innerHTML = "command executed, set new time ...";
else else
e.innerHTML = "Error: " + obj["error"]; e.innerHTML = "Error: " + obj["error"];
} }
@ -501,7 +501,7 @@
function apiCbMqtt(obj) { function apiCbMqtt(obj) {
var e = document.getElementById("apiResultMqtt"); var e = document.getElementById("apiResultMqtt");
if(obj["success"]) if(obj["success"])
e.innerHTML = "command excuted"; e.innerHTML = "command executed";
else else
e.innerHTML = "Error: " + obj["error"]; e.innerHTML = "Error: " + obj["error"];
} }

2
src/web/web.h

@ -666,7 +666,7 @@ class Web {
#ifdef ENABLE_PROMETHEUS_EP #ifdef ENABLE_PROMETHEUS_EP
// Note // Note
// Prometheus exposition format is defined here: https://github.com/prometheus/docs/blob/main/content/docs/instrumenting/exposition_formats.md // Prometheus exposition format is defined here: https://github.com/prometheus/docs/blob/main/content/docs/instrumenting/exposition_formats.md
// TODO: Check packetsize for MAX_NUM_INVERTERS. Successfull Tested with 4 Inverters (each with 4 channels) // TODO: Check packetsize for MAX_NUM_INVERTERS. Successfully Tested with 4 Inverters (each with 4 channels)
enum { enum {
metricsStateStart, metricsStateStart,
metricsStateInverter1, metricsStateInverter2, metricsStateInverter3, metricsStateInverter4, metricsStateInverter1, metricsStateInverter2, metricsStateInverter3, metricsStateInverter4,

Loading…
Cancel
Save