Espeasy: HX711: tareChanA doesn't seem to work

Created on 7 Feb 2019  路  7Comments  路  Source: letscontrolit/ESPEasy

ESP_Easy_mega-20190121_test_ESP8266_4096.bin

Measurement Channel A is initialized and working. I can tare on the Task Settings page.

But the command
tareChanA
isn't recognized.

I'm getting the answer
Unknown command!

Plugin Fixed Bug

All 7 comments

What is the log saying?

log is saying:

2555764: HX711: ChanA: 112854.187 = 174187.984
2555769: EVENT: Waage#WeightChanA=174.19
2555780: EVENT: Waage#WeightChanB=0.00
2556764: HX711: ChanA: 112846.687 = 174176.422
2556769: EVENT: Waage#WeightChanA=174.18
2556778: EVENT: Waage#WeightChanB=0.00
2557296: Command: tarechana
2557296: Command unknown: 'tarechana'
2557766: HX711: ChanA: 112871.437 = 174214.609
2557771: EVENT: Waage#WeightChanA=174.21

Is this a case sensitive issue?

There is no equalsIgnoreCase in the code.

If I change the code to the following (with lower letters), it works.

    case PLUGIN_WRITE:
      {
        String command = parseString(string, 1);
        if (command == F("tarechana"))
        {
          String log = F("HX711: tare channel A");

          float2int(-UserVar[event->BaseVarIndex + 2], &PCONFIG(1), &PCONFIG(2));
          Plugin_067_OversamplingValueChanA[event->TaskIndex] = 0;
          Plugin_067_OversamplingCountChanA[event->TaskIndex] = 0;

          addLog(LOG_LEVEL_INFO, log);
          success = true;
        }

Thanks, I will change it to do a case insensitive match.

Will be fixed when this is merged.

This code has been merged this morning, so it will be included in the next nightly build

Was this page helpful?
0 / 5 - 0 ratings