Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESP8266 0.5.78 Exception durch inverter alarm (ohne MQTT broker) #653

Closed
fsck-block opened this issue Feb 5, 2023 · 1 comment
Closed
Assignees
Labels
bug Something isn't working fixed dev fixed good first issue Good for newcomers

Comments

@fsck-block
Copy link
Contributor

fsck-block commented Feb 5, 2023

Wenn der Inverter einen Alarm meldet, aber MQTT nicht enabled ist, gibt's eine user exception.

08:54:34.001 > I: Alarm #2 'DTU command failed' start: 07:53:27, end: 07:53:27
08:54:34.006 > 
08:54:34.006 > User exception (panic/abort/assert)
08:54:34.009 > --------------- CUT HERE FOR EXCEPTION DECODER ---------------

Liegt meines erachtens an folgenden Stellen:

  • Einer fehlenden Abfrage ob mCbAlarm initialisiert ist (payload.h@269)
    if(AlarmData == mPayload[iv->id].txCmd) {
        uint8_t i = 0;
        uint16_t code;
        uint32_t start, end;
        while(1) {
            code = iv->parseAlarmLog(i++, payload, payloadLen, &start, &end);
            if(0 == code)
                break;
            (mCbAlarm)(code, start, end);
            yield();
        }
  • und dem setzen des AlarmListeners nur bei mMQttEnabled (app.cpp @ 57). Zumindest habe ich keine weitere Stelle mit addAlarmListener gefunden
    mMqttEnabled = (mConfig->mqtt.broker[0] > 0);
    if (mMqttEnabled) {
        mMqtt.setup(&mConfig->mqtt, mConfig->sys.deviceName, mVersion, mSys, &mTimestamp);
        mMqtt.setSubscriptionCb(std::bind(&app::mqttSubRxCb, this, std::placeholders::_1));
        mPayload.addAlarmListener(std::bind(&PubMqttType::alarmEventListener, &mMqtt, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
    }

payload.h @ 60

        void addAlarmListener(alarmListenerType cb) {
            mCbAlarm = cb;
        }

Fazit:
Hat man keinen mqtt broker dann Sprung in's Nirvana.

p.s.
Bei der Methode notfiy (payload.h@292) fehlt die Abfrage auch.

void notify(uint16_t code, uint32_t start, uint32_t endTime) {
            (mCbAlarm)(code, start, endTime);
        }
@stefan123t stefan123t added bug Something isn't working good first issue Good for newcomers labels Feb 5, 2023
@beegee3
Copy link
Contributor

beegee3 commented Feb 5, 2023

mCbAlarm mit NULL initialisieren und an den beiden genannten payload Stellen darauf abfragen, ist in #652

@lumapu lumapu added the fixed dev fixed label Feb 5, 2023
lumapu added a commit that referenced this issue Feb 5, 2023
fixed `mCbAlarm` if MQTT is not used #653
@lumapu lumapu closed this as completed Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed dev fixed good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants