• @user130485

    I assume you are talking about the DiY Smart Meter from https://www.espruino.com/Smart+Meter - and - some additional code and wiring (or BLE), that talks to the ESP32.

    My initial thought was that on uploading the code and on start up / init, something must fall between the cracks - not clean setup with all in onInit(), or in cooperation with the other device something with the sequencing creates an issue. Looking at the example, all happens in onInit() (at least what the espruino example shows... except the creation of the Counter).

    A last ditch effort could be in taking a more subtile approach on detecting a pulse of the meter LED. In a nutshell: have a state machine that uses falling as well as rising non-repeat watches and monitors the state changes with additional, separate timeouts. This would allow to detect meter's LED staying on too long for being counted as a pulse for counting (on because the is busy with communication... which also throws a shadow on the accuracy of the setup of counting blinks).

    An additional option is to control the 'powering' of the LDR: set D1 high to end a stuck cycle.

    After a power-meter-LED-on-for-too-long cycle, I assume, the power meter returns to normal blinking.

  • Yes, it was based on the Smart Meter but with a heap of extra code to optimise it for my situation. ESP32 is just a BLE receiver that sends the data to Home Assistant.
    It's suppose to get unstuck. I have already implemented some routines with Gordon's help to get past the stuck LED state plus I am restarting it nightly in a hope to clear whatever issues happen during the day. So far 2 days gone ok without issues
    @Gordon Highly unlikely. Its in a metal box where smartmeter is. I could not connect to it from the room, so had to get my ESP32 board in the same cabinet as the smartmeter. But agree, it was a plausible suggestion. Problem is that I cannot connect to it with anything - it no longer sends the data and not visible in BT devices to connect via IDE
    I just don't know how to debug it so that I know what when the issue happens

About

Avatar for allObjects @allObjects started