Your device couldnt connect to the network

keeps sticking at the last part and then an error …

please and thank you for your assistance

'''
#include <SoftwareSerial.h>

#include <PZEM004Tv30.h>


// Fill-in information from your Blynk Template here
#define BLYNK_TEMPLATE_ID "TMPLLxar8jOp"
#define BLYNK_DEVICE_NAME "Project"

#define BLYNK_FIRMWARE_VERSION        "0.1.0"

#define BLYNK_PRINT Serial
//#define BLYNK_DEBUG

#define APP_DEBUG

// Uncomment your board, or configure a custom board in Settings.h
//#define USE_SPARKFUN_BLYNK_BOARD
#define USE_NODE_MCU_BOARD
//#define USE_WITTY_CLOUD_BOARD
//#define USE_WEMOS_D1_MINI

#include "BlynkEdgent.h"

PZEM004Tv30 pzem1(D1, D2, 0x07);
PZEM004Tv30 pzem2(D1, D2, 0x02);
PZEM004Tv30 pzem3(D1, D2, 0x03);
PZEM004Tv30 pzem4(D5, D6, 0x04);
PZEM004Tv30 pzem5(D5, D6, 0x05);
PZEM004Tv30 pzem6(D5, D6, 0x06);

void setup()
{
  Serial.begin(115200);
  delay(100);

  BlynkEdgent.begin();
}

void loop() {
  BlynkEdgent.run();

  float voltage1   = pzem1.voltage();   Blynk.virtualWrite(V1, voltage1);

float voltage2   = pzem2.voltage();   Blynk.virtualWrite(V2, voltage1);

float voltage3   = pzem3.voltage();   Blynk.virtualWrite(V3, voltage3);

float voltage4   = pzem4.voltage();   Blynk.virtualWrite(V4, voltage4);

float voltage5   = pzem5.voltage();   Blynk.virtualWrite(V5, voltage5);

float voltage6   = pzem6.voltage();   Blynk.virtualWrite(V6, voltage6);




Serial.println();
delay(10);
}
'''
00:37:25.883 → [651201] Found networks: 10
00:37:43.798 → [669143] Applying configuration…
00:37:43.798 → [669143] WiFi SSID: HUAWEI-E597FA Pass: GeTyOuRoWn0012
00:37:43.834 → [669144] Blynk cloud: gzoREbmk0DjUWouvTM__uKjv9a8cVQSg @ blynk.cloud:443
00:37:43.834 → [669148] CONFIGURING => SWITCH_TO_STA
00:37:44.463 →
00:37:44.501 → [669811] Switching to STA…
00:37:45.566 → [670912] SWITCH_TO_STA => CONNECTING_NET
00:37:46.240 →
00:37:46.240 → [671577] Connecting to WiFi: HUAWEI-E597FA
00:37:49.791 → [675117] Using Dynamic IP: 192.168.192.2
00:37:49.791 → [675117] CONNECTING_NET => CONNECTING_CLOUD
00:37:50.455 →
00:37:50.770 → [676093] Current time: Sat Aug 27 04:37:50 2022
00:37:50.770 → [676093] Connecting to blynk.cloud:443
00:37:50.877 →
00:37:50.877 → User exception (panic/abort/assert)
00:37:50.877 → --------------- CUT HERE FOR EXCEPTION DECODER ---------------
00:37:50.877 →
00:37:50.877 → Unhandled C++ exception: OOM
00:37:50.877 →
00:37:50.877 → >>>stack>>>
00:37:50.877 →
00:37:50.877 → ctx: cont
00:37:50.877 → sp: 3ffffd80 end: 3fffffc0 offset: 0000
00:37:50.877 → 3ffffd80: 3fffa14c 00000000 3fff0805 00000030
00:37:50.910 → 3ffffd90: 000000fe 00000000 00000000 00000000
00:37:50.910 → 3ffffda0: 00000000 00000000 00000000 00000001
00:37:50.910 → 3ffffdb0: 00007fff 00000000 3fffa15c 3fff0805
00:37:50.910 → 3ffffdc0: 00000000 4020d00d 00000c08 40212f0a
00:37:50.910 → 3ffffdd0: 00000000 4020d00d 00000020 40212f29
00:37:50.910 → 3ffffde0: c014c00a c031c02d 00000c08 40212664
00:37:50.910 → 3ffffdf0: c02ac026 3ffffe10 3fff19c4 4020d00d
00:37:50.910 → 3ffffe00: 00000000 00000000 3fff19c4 4020d160
00:37:50.946 → 3ffffe10: 00000000 c00dc003 3fff000a 4020ccec
00:37:50.946 → 3ffffe20: 00000000 00000000 00000d60 3fff0805
00:37:50.946 → 3ffffe30: 00000000 3fffa14c 3fff19c4 4020d521
00:37:50.946 → 3ffffe40: 40106575 3fff0b44 3fff0b44 00000069
00:37:50.946 → 3ffffe50: 00000000 00000000 000001bb 40213022
00:37:50.946 → 3ffffe60: 00000000 3fff8a5c 3fff19c4 4020c12e
00:37:50.946 → 3ffffe70: 3fff8cbc 3ffe88e0 3fff0958 3ffe9364
00:37:50.983 → 3ffffe80: 000001bb 3fff0805 3fff19c4 3ffe9364
00:37:50.983 → 3ffffe90: 000001bb 3fff0805 3fff19c4 4020d6ad
00:37:50.983 → 3ffffea0: 40216470 1610e140 40216470 1610e140
00:37:50.983 → 3ffffeb0: 3fff0805 3fff0958 3fff0868 4021505a
00:37:50.983 → 3ffffec0: 3fff0868 3fff0958 3fff0868 402032a8
00:37:50.983 → 3ffffed0: 3fff0868 000a4fd0 0000001a 4021050a
00:37:50.983 → 3ffffee0: 00000000 0018001f 00000000 00000000
00:37:50.983 → 3ffffef0: 3fff0868 000a4fd0 3fff0958 402033d0
00:37:50.983 → 3fffff00: 00000032 00000025 00000004 0000001b
00:37:51.016 → 3fffff10: 00000007 0000007a 00000006 000000ee
00:37:51.016 → 3fffff20: 00000000 3fff9b4c 0018001f 80000000
00:37:51.016 → 3fffff30: 63099f9e 00000000 3fff0844 402154a8
00:37:51.016 → 3fffff40: 00000000 000a4fd0 3fff0844 40203551
00:37:51.016 → 3fffff50: 000b3a26 3fff0b44 0000000a 40212930
00:37:51.016 → 3fffff60: 4021302d 0000000a fffffffd fffffffd
00:37:51.016 → 3fffff70: 000b3a26 3fff076d 3fff0844 40204173
00:37:51.050 → 3fffff80: 3fffdad0 00000000 3fff0ac8 3fff0adc
00:37:51.050 → 3fffff90: 3fffdad0 00000000 3fff0ac8 402089da
00:37:51.050 → 3fffffa0: 3fffdad0 00000000 3fff0ac8 40212a50
00:37:51.050 → 3fffffb0: feefeffe feefeffe 3ffe8680 4010138d
00:37:51.050 → <<<stack<<<
00:37:51.050 →
00:37:51.050 → last failed alloc call: 4020D00D(3080)
00:37:51.050 →
00:37:51.050 → --------------- CUT HERE FOR EXCEPTION DECODER ---------------
00:37:51.050 →
00:37:51.050 → last failed alloc caller: 0x4020d00d
00:37:51.086 →
00:37:51.086 → ets Jan 8 2013,rst cause:2, boot mode:(3,7)
00:37:51.086 →
00:37:51.086 → load 0x4010f000, len 3460, room 16
00:37:51.086 → tail 4
00:37:51.086 → chksum 0xcc
00:37:51.086 → load 0x3fff20b8, len 40, room 4
00:37:51.086 → tail 4
00:37:51.086 → chksum 0xc9
00:37:51.086 → csum 0xc9
00:37:51.086 → v00073cb0
00:37:51.086 → ~ld
00:37:51.465 → [386] Using default config.
00:37:51.465 →
00:37:51.465 → >[386]
00:37:51.465 → ___ __ __
00:37:51.465 → / _ )/ /_ _____ / /__
00:37:51.465 → / _ / / // / _ / '/
00:37:51.499 → ///_, /////_
00:37:51.499 → /__/ v1.0.1 on ESP8266
00:37:51.499 →
00:37:51.499 → [390] --------------------------
00:37:51.499 → [393] Product: Project
00:37:51.499 → [395] Firmware: 0.1.0 (build Aug 27 2022 00:20:46)
00:37:51.499 → [400] Device: ESP8266 @ 80MHz
00:37:51.499 → [403] MAC: 30:83:98:B6:30:3C
00:37:51.499 → [406] Flash: 4096K
00:37:51.499 → [408] ESP core: 3.0.2
00:37:51.499 → [410] ESP SDK: 2.2.2-dev(38a443e)
00:37:51.499 → [413] Boot Ver: 5
00:37:51.499 → [414] Boot Mode:1
00:37:51.499 → [416] FW info: 474288/1622016, MD5:217e03cf40026d7d09fc99acef461bee
00:37:51.705 → [600] Free mem: 14000
00:37:51.705 → [600] --------------------------
00:37:51.705 → [601] INIT => WAIT_CONFIG
00:37:52.301 → [1208] AP SSID: Blynk Project-28D92
00:37:52.301 → [1208] AP IP: 192.168.4.1
00:37:52.301 → [1209] AP URL: blynk.setup

So you weren’t interested in taking my advice then?….

Pete.

1 Like

i am trying your advise Mr pete …but if u can elaborate more on it …would appreciate it

I thought that was fairly self explanatory.

Pete.

#include <SoftwareSerial.h>
// Fill-in information from your Blynk Template here
#define BLYNK_TEMPLATE_ID "TMPLLxar8jOp"
#define BLYNK_DEVICE_NAME "Project"
#include <PZEM004Tv30.h>

#define BLYNK_FIRMWARE_VERSION        "0.1.0"

#define BLYNK_PRINT Serial

//#define BLYNK_DEBUG

#define APP_DEBUG

// Uncomment your board, or configure a custom board in Settings.h
//#define USE_SPARKFUN_BLYNK_BOARD
#define USE_NODE_MCU_BOARD
//#define USE_WITTY_CLOUD_BOARD
//#define USE_WEMOS_D1_MINI

#include "BlynkEdgent.h"

PZEM004Tv30 pzem1(D5, D6, 0x07);
PZEM004Tv30 pzem2(D5, D6, 0x02);
PZEM004Tv30 pzem3(D5, D6, 0x03);
PZEM004Tv30 pzem4(D5, D6, 0x04);
PZEM004Tv30 pzem5(D5, D6, 0x05);
PZEM004Tv30 pzem6(D5, D6, 0x06);

void setup()
{
  Serial.begin(115200);
  delay(100);

  BlynkEdgent.begin();
}

void loop() {
  BlynkEdgent.run();


float voltage1   = pzem1.voltage();   Blynk.virtualWrite(V1, voltage1);

float voltage2   = pzem2.voltage();   Blynk.virtualWrite(V2, voltage2);

float voltage3   = pzem3.voltage();   Blynk.virtualWrite(V3, voltage3);

float voltage4   = pzem4.voltage();   Blynk.virtualWrite(V4, voltage4);

float voltage5   = pzem5.voltage();   Blynk.virtualWrite(V5, voltage5);

float voltage6   = pzem6.voltage();   Blynk.virtualWrite(V6, voltage6);

Serial.println(voltage5);
Serial.println(voltage1);

delay (5000);
}


so mr pete i put all the sensors on pone pin and the esp connected to the blynk app but no readings are showing


14:21:42.100 -> >[382] 
14:21:42.100 ->     ___  __          __
14:21:42.100 ->    / _ )/ /_ _____  / /__
14:21:42.100 ->   / _  / / // / _ \/  '_/
14:21:42.100 ->  /____/_/\_, /_//_/_/\_\
14:21:42.100 ->         /___/ v1.0.1 on ESP8266
14:21:42.100 -> 
14:21:42.100 -> [384] --------------------------
14:21:42.100 -> [387] Product:  Project
14:21:42.100 -> [389] Firmware: 0.1.0 (build Aug 27 2022 14:20:54)
14:21:42.100 -> [393] Token:    ...UTOb
14:21:42.100 -> [395] Device:   ESP8266 @ 80MHz
14:21:42.138 -> [398] MAC:      30:83:98:B6:30:3C
14:21:42.138 -> [401] Flash:    4096K
14:21:42.138 -> [403] ESP core: 3.0.2
14:21:42.138 -> [405] ESP SDK:  2.2.2-dev(38a443e)
14:21:42.138 -> [408] Boot Ver: 5
14:21:42.138 -> [410] Boot Mode:1
14:21:42.138 -> [412] FW info:  475040/1622016, MD5:e286902803a05267a6d83883250f34a0
14:21:42.308 -> [596] Free mem: 14000
14:21:42.308 -> [596] --------------------------
14:21:42.308 -> [597] INIT => CONNECTING_NET
14:21:42.308 -> [598] Connecting to WiFi: HUAWEI-E597FA
14:21:47.660 -> [5930] Using Dynamic IP: 192.168.192.2
14:21:47.660 -> [5930] CONNECTING_NET => CONNECTING_CLOUD
14:21:48.209 -> 116.10
14:21:48.209 -> 116.10
14:21:53.496 -> [11795] Current time: Sat Aug 27 18:21:53 2022
14:21:53.496 -> [11795] Connecting to blynk.cloud:443
14:21:55.206 -> [13486] Ready (ping: 11ms).
14:21:55.386 -> [13677] CONNECTING_CLOUD => RUNNING
14:21:56.755 -> 116.30
14:21:56.755 -> 116.10 (voltages from serial print)

i did but it never say how to implement with blynk what i used was codes that i found that someone wrote for the old blynk app

Have you tried reading what it says on the GitHub page for the PZEM004Tv30.h library and looking at the examples there?

When you read things like this…

but then don’t use the ESP8266 example as the basis for your PZEM portion of the sketch then it’s not surprising that it doesn’t work.

I’d suggest that you get the PZEM portion of the sketch working first, and understand how it works, then add that working code into your Blynk sketch.

You should then search the forum for “keep your void loop clean” and understand how to use timers to call a function rather than placing everything in your void loop and using delays.

In other words…

Pete.

1 Like