ESP8266 send message problem

Pushsafer make it easy and safe to get push-notifications in real time on your Android or Windows mobile device, iPhone, iPad and Desktop!

Mit Pushsafer kann man in Echtzeit, einfach und sicher, Push-Benachrichtigungen auf sein iPhone, iPad, Android oder Windows Gerät sowie auf den Desktop senden lassen!

======================
Google Play
App Store
Windows 10 Store
Homepage
array81
Posts: 3
Joined: 22. Jan 2019, 13:18

ESP8266 send message problem

Postby array81 » 22. Jan 2019, 13:34

I'm trying to add PushSafer on my NodeMCU (ESP8266) project.
I use the pushsafer-arduino-library library and this code (this is an extract):

Code: Select all

WiFiClientSecure pushsaferClient;
Pushsafer *pushsafer;
String pushsaferKey = "myKEY";

void Log(String msg){

  ...

  if (pushsaferKey != "") {
    struct PushSaferInput input;
    input.message = msg;
    input.title = "MrGarden";
    input.sound = "8";
    input.vibration = "1";
    input.icon = "2";
    input.device = "a";

    pushsafer->sendEvent(input); 
  }

  ...

}

void setup() {
  // put your setup code here, to run once:

  ...
  
  if (pushsaferKey != "") { 
    pushsafer = new Pushsafer(pushsaferKey, pushsaferClient);
    pushsafer->debug = true;
  }

  ...
}

void loop() {
  // put your main code here, to run repeatedly:

}
Everytime I Log function is call I have a big lag (about 10 seconds) and the message is not sent. Moreover I didn't have message on serial.

Where am I wrong?

User avatar
admin
Site Admin
Posts: 391
Joined: 1. Dec 2014, 12:41
Location: Germany

Re: ESP8266 send message problem

Postby admin » 22. Jan 2019, 19:14

can you provide an error log?

Kevin
DE: Dir gefällt Service und Support! Dann freuen wir uns auf deine Bewertung!
EN: You like Service and Support! Then we look forward to your review!

Pushsafer.com Website - iOS - Android - Windows 10

array81
Posts: 3
Joined: 22. Jan 2019, 13:18

Re: ESP8266 send message problem

Postby array81 » 23. Jan 2019, 08:04

admin wrote:
22. Jan 2019, 19:14
can you provide an error log?

Kevin
This is the serial message:

Code: Select all

01:00:30 - SPIFFS caricato
01:00:30 - Esecuzione loadSettingsDevice()
01:00:30 - Preferenze APP aggiornate
*WM: 
*WM: AutoConnect
*WM: Connecting as wifi client...
*WM: Using last saved values, should be faster
scandone
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 4
cnt 

connected with Martin 7490, channel 6
dhcp client start...
ip:192.168.188.57,mask:255.255.255.0,gw:192.168.188.1
*WM: Connection result: 
*WM: 3
*WM: IP Address:
*WM: 192.168.188.57
Dispositivo connesso alla rete wifi con IP 01:00:33 - 
08:59:42 - Orario aggiornato in 08:59:42
08:59:42 - Client Telegram avviato
08:59:42 - Client PushSafer avviato
08:59:42 - Server HTTP avviato
*WM: freeing allocated params!
08:59:43 - Esecuzione loadSettingsZoneA()
08:59:43 - Impossibile leggere il file /json/zone_a.json
Fatal exception 29(StoreProhibitedCause):
epc1=0x402207bc, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000204, depc=0x00000000

Exception (29):
epc1=0x402207bc epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000204 depc=0x00000000

ctx: sys 
sp: 3ffff110 end: 3fffffb0 offset: 01a0

>>>stack>>>
3ffff2b0:  8660a357 72f24bc7 b7b4bf1c 9457fe0e  
3ffff2c0:  25a2744d 80000000 00000000 3fff0cec  
3ffff2d0:  3fffbb2c 00000408 3fffbb2c 40100694  
3ffff2e0:  00000204 0000a920 00001524 00000082  
3ffff2f0:  63a83896 00000000 00000001 00000001  
3ffff300:  3fffb8d4 00000082 3fffbb14 4022dbae  
3ffff310:  3fffb8d4 3fffbb14 00000081 4022e8ae  
3ffff320:  8ec20219 00000000 00000001 00000040  
3ffff330:  3fffbe5c 3fffbd34 00000040 00000000  
3ffff340:  3fffbb2c 3fffb834 00000041 00000041  
3ffff350:  00000000 00000001 00001524 00000041  
3ffff360:  3fffb9f4 3fffb834 00000000 0000007f  
3ffff370:  3fffbb14 00000081 3fffbb14 0000007f  
3ffff380:  3fffbb14 3fffb834 3fffb834 4022eb71  
3ffff390:  00000002 00000001 3ffff81c 4022dc54  
3ffff3a0:  00000100 00000100 3fffb0cc 3fffb8a4  
3ffff3b0:  3fffb014 00000100 3fffb834 4022fd2d  
3ffff3c0:  3fffb0cc 3fffacd4 00000003 402339a1  
3ffff3d0:  00000001 00000081 00000000 00000000  
3ffff3e0:  00000100 3fff900a 3ffff81c 40233e3d  
3ffff3f0:  3fffacd4 3fffb0cc 3ffeacee 40233cc9  
3ffff400:  3fffafd4 0000002d 00000003 40233b6a  
3ffff410:  3fff5ab0 3fffafd4 3fff900a 00000000  
3ffff420:  00000004 3fffafd4 3fff900a 4022bde2  
3ffff430:  00000480 00000000 ce885fac 21c29334  
3ffff440:  ff591c4d fb645360 37a40173 409fd0a2  
3ffff450:  b4f8a7dd 893d31a7 00000000 00000000  
3ffff460:  00000000 00000000 00000000 00000000  
3ffff470:  00000000 00000000 00000000 00000000  
3ffff480:  00000000 00000000 00000000 00000000  
3ffff490:  00000000 e0210000 feefeffe feefeffe  
3ffff4a0:  feefeffe feefeffe feefeffe feefeffe  
3ffff4b0:  feefeffe feefeffe feefeffe feefeffe  
3ffff4c0:  feefeffe feefeffe feefeffe feefeffe  
3ffff4d0:  feefeffe feefeffe feefeffe feefeffe  
3ffff4e0:  feefeffe feefeffe feefeffe feefeffe  
3ffff4f0:  feefeffe feefeffe feefeffe feefeffe  
3ffff500:  feefeffe feefeffe feefeffe feefeffe  
3ffff510:  feefeffe feefeffe feefeffe feefeffe  
3ffff520:  feefeffe feefeffe feefeffe feefeffe  
3ffff530:  feefeffe feefeffe feefeffe feefeffe  
3ffff540:  feefeffe feefeffe feefeffe feefeffe  
3ffff550:  feefeffe feefeffe feefeffe feefeffe  
3ffff560:  feefeffe feefeffe feefeffe feefeffe  
3ffff570:  00000002 00000000 00000020 40100f22  
3ffff580:  3ffeb052 40104304 3ffee7c0 feefeffe  
3ffff590:  00000001 40103523 3ffef218 feefeffe  
3ffff5a0:  40103986 feefeffe feefeffe feefeffe  
3ffff5b0:  feefeffe feefeffe feefeffe feefeffe  
3ffff5c0:  4010346a 00000031 7fffffff 00000002  
3ffff5d0:  00000131 feefeffe feefeffe feefeffe  
3ffff5e0:  401022eb 00080000 feefeffe feefeffe  
3ffff5f0:  00000000 feefeffe 00002200 4000050c  
3ffff600:  3fffc278 40101fe8 3fffc200 00000022  
3ffff610:  3ffff620 feefeffe feefeffe feefeffe  
3ffff620:  40000656 00000030 00000010 ffffffff  
3ffff630:  4022e055 00ea45ac 00000000 00000001  
3ffff640:  00000000 00000000 0000001f 40104bfd  
3ffff650:  4000050c 3fff6a5c 4024615f 00000001  
3ffff660:  ffffffff 00000000 3ffeb1a1 00000008  
3ffff670:  402461ae 3ffee7e8 3fff12e4 00000001  
3ffff680:  402462ba 3ffee7e8 3fff12e4 3ffee7e8  
3ffff690:  00000002 00000000 00000020 40100f22  
3ffff6a0:  3ffeb052 40245267 3ffee7e8 3fff288c  
3ffff6b0:  00000000 402386c3 3ffefc88 3fffaaa8  
3ffff6c0:  00000000 00000002 00000000 3ffee7e8  
3ffff6d0:  3fff59ea 401049a3 3fff288c 3fff16ac  
3ffff6e0:  3fff59b4 00000002 00000000 3ffee7c0  
3ffff6f0:  3fffaac2 40220a99 3fff0d18 3fff16ac  
3ffff700:  00000140 00000000 3c23d3b4 529e7ab4  
3ffff710:  fb9d80c2 0606bb82 ba36a7ce c1e4ec73  
3ffff720:  a03058dc e784c8fc de154a75 860883b8  
3ffff730:  88597633 84253d6f 433e9eba d98a835c  
3ffff740:  1d4488fe 0f88f7c7 0103021d 00800100  
3ffff750:  00000000 00000000 00000000 00000000  
3ffff760:  00000000 30090000 9716add1 b1b5fd5f  
3ffff770:  f7dab509 150f7f76 2403966b 00000000  
3ffff780:  00000000 00000000 00000000 00000000  
3ffff790:  00000000 00000000 00000000 00000000  
3ffff7a0:  00000000 00000000 00000000 00000000  
3ffff7b0:  00000000 00000000 00000000 00000000  
3ffff7c0:  00000000 3ffe0000 ac5f88ce 3493c221  
3ffff7d0:  4d1c59ff 605364fb 7301a437 a2d09f40  
3ffff7e0:  dda7f8b4 a7313d89 00002200 4000050c  
3ffff7f0:  3fffc278 40101fe8 3fffc200 00000022  
3ffff800:  3ffeb900 00000000 000002b7 000002c5  
3ffff810:  00000440 00000002 0000060c 0000028f  
3ffff820:  000003f8 00000001 402173ec 3fffefb0  
3ffff830:  00000169 3fff5ab0 00002710 402174a6  
3ffff840:  00000000 00000000 00000000 402174e9  
3ffff850:  3fff8aa9 0000000c 00000561 00000001  
3ffff860:  3fff5ab0 3fff8aa9 00000561 40229a55  
3ffff870:  000010e1 3fff517c 000010e8 3fff5aac  
3ffff880:  3fff5abc 00000007 00860011 3fff51d0  
3ffff890:  0000060c 9a30bee5 9be5e235 daf2028d  
3ffff8a0:  ba9d5ce4 3fffa634 8a67aca6 000010e8  
3ffff8b0:  3fff8aa9 000010e8 3fff517c 4022b092  
3ffff8c0:  dc98ff6d c938906e 722598b7 79dbe2d4  
3ffff8d0:  c1e39b10 00000218 3ffe86a4 00000000  
3ffff8e0:  00000042 3fff9b7c 3fff9b7c 3fffa634  
3ffff8f0:  00000000 00001095 00000064 402174a6  
3ffff900:  00000050 00000000 0000002d 000010e8  
3ffff910:  3fff8aa9 000010e8 3fff517c 000010e8  
3ffff920:  3fff8aa9 000010e8 3fff517c 4022aadc  
3ffff930:  16c7054f 00000000 00000000 00000028  
3ffff940:  00000000 4bc6a7f0 b0624dd2 00000000  
3ffff950:  00000000 00000000 4bc6a7f0 00000000  
3ffff960:  3ffff9b8 0000000b 00000010 000090bb  
3ffff970:  00000000 3fff517c 00000014 01000000  
3ffff980:  3ffff9b8 00009018 3fff517c 4022ac44  
3ffff990:  40104d40 3ffea304 3ffff9b0 3fff5a6c  
3ffff9a0:  3fff597c 00009018 3fff5a44 4020dc0d  
3ffff9b0:  3fff517c 3fff5a94 00000014 402172c4  
3ffff9c0:  00003a98 00003a98 3fff09f8 4020dc4c  
3ffff9d0:  00000000 00000000 3fff597c 3ffe94a8  
3ffff9e0:  000001bb 3ffea304 3fff09e0 4020de5b  
3ffff9f0:  00000000 00000000 3ffea304 3ffe94a8  
3ffffa00:  000001bb 3fff09e0 3ffea304 4020df01  
3ffffa10:  40219100 5b2453d4 40219100 5b2453d4  
3ffffa20:  3ffe9ea4 3ffffad0 3fff27a4 402154e0  
3ffffa30:  00000010 00000010 00000000 40100575  
3ffffa40:  3fff8274 00000020 3fff8604 401006a8  
3ffffa50:  00000014 000073f8 00000e7f 3ffe94a8  
3ffffa60:  00000010 3ffffb90 3ffffb90 402167c7  
3ffffa70:  3fff34f4 00000000 3ffffb90 40216813  
3ffffa80:  3ffe8b1c 3fff589c 0000002f 00000028  
3ffffa90:  3fff8444 0000000f 00000000 40216948  
3ffffaa0:  3ffffc68 00000198 3ffffb9c 40216970  
3ffffab0:  3ffe8ddc 00000001 3ffe9ea4 3ffe94a8  
3ffffac0:  3fff27a4 3ffffc68 3fff0ae8 40207b96  
3ffffad0:  3fff829c 0000001f 00000016 3fff8604  
3ffffae0:  0000000f 00000008 3fff82c4 0000000f  
3ffffaf0:  00000001 3fff82dc 0000000f 00000001  
3ffffb00:  3fff82f4 0000000f 00000001 3fff830c  
3ffffb10:  0000000f 00000007 3fff8324 0000000f  
3ffffb20:  00000001 3fff833c 0000000f 00000000  
3ffffb30:  3fff8354 0000000f 00000000 3fff836c  
3ffffb40:  0000000f 00000000 3fff8384 0000000f  
3ffffb50:  00000001 3fff839c 0000000f 00000000  
3ffffb60:  3fff83b4 0000000f 00000000 3fff83cc  
3ffffb70:  0000000f 00000000 3fff83e4 0000000f  
3ffffb80:  00000000 3fff83fc 0000000f 00000000  
3ffffb90:  3fff8414 0000000f 00000000 3fff8274  
3ffffba0:  0000001f 00000016 3fff861c 0000000f  
3ffffbb0:  00000008 3fff8634 0000000f 00000001  
3ffffbc0:  3fff864c 0000000f 00000001 3fff8664  
3ffffbd0:  0000000f 00000001 3fff867c 0000000f  
3ffffbe0:  00000007 3fff3404 0000000f 00000001  
3ffffbf0:  3fff341c 0000000f 00000000 3fff3434  
3ffffc00:  0000000f 00000000 3fff344c 0000000f  
3ffffc10:  00000000 3fff3464 0000000f 00000001  
3ffffc20:  3fff347c 0000000f 00000000 3fff3494  
3ffffc30:  0000000f 00000000 3fff34ac 0000000f  
3ffffc40:  00000000 3fff34c4 0000000f 00000000  
3ffffc50:  3fff34dc 0000000f 00000000 3fff34f4  
3ffffc60:  0000000f 00000000 3fff842c 0000000f  
3ffffc70:  00000000 3fff337c 0000000f 00000008  
3ffffc80:  00000000 3fff08f0 3ffffe90 40209fdb  
3ffffc90:  40218df0 3ffffca0 00000212 00000210  
3ffffca0:  3ffffc90 3ffffcb4 00314163 736c6166  
3ffffcb0:  5c5c0065 3ffffcd0 3ffffca8 00000001  
3ffffcc0:  3ffffcac 00314174 303a3030 3b120030  
3ffffcd0:  3ffffce8 3ffffcc4 00000002 3ffffcc8  
3ffffce0:  00314173 0d003031 3ffffd04 3ffffce0  
3ffffcf0:  00000002 3ffffce4 00324163 736c6166  
3ffffd00:  4eb90065 3ffffd20 3ffffcf8 00000001  
3ffffd10:  3ffffcfc 00324174 303a3030 3d5f0030  
3ffffd20:  3ffffd38 3ffffd14 00000002 3ffffd18  
3ffffd30:  00324173 3f003031 3ffffd54 3ffffd30  
3ffffd40:  00000002 3ffffd34 00334163 736c6166  
3ffffd50:  00000065 3ffffd70 3ffffd48 00000001  
3ffffd60:  3ffffd4c 00334174 303a3030 40220030  
3ffffd70:  3ffffd88 3ffffd64 00000002 3ffffd68  
3ffffd80:  00334173 00003031 3ffffda4 3ffffd80  
3ffffd90:  00000002 3ffffd84 00344163 736c6166  
3ffffda0:  00000065 3ffffdc0 3ffffd98 00000001  
3ffffdb0:  3ffffd9c 00344174 303a3030 40230030  
3ffffdc0:  3ffffdd8 3ffffdb4 00000002 3ffffdb8  
3ffffdd0:  00344173 00003031 3ffffdf4 3ffffdd0  
3ffffde0:  00000002 3ffffdd4 00354163 736c6166  
3ffffdf0:  40ca0065 3ffffe10 3ffffde8 00000001  
3ffffe00:  3ffffdec 00354174 303a3030 b4ac0030  
3ffffe10:  3ffffe28 3ffffe04 00000002 3ffffe08  
3ffffe20:  00354173 00003031 3ffffe44 3ffffe20  
3ffffe30:  00000002 3ffffe24 00364163 736c6166  
3ffffe40:  3fff0065 3ffffe60 3ffffe38 00000001  
3ffffe50:  3ffffe3c 00364174 303a3030 40100030  
3ffffe60:  3ffffe78 3ffffe54 00000002 3ffffe58  
3ffffe70:  00364173 3f003031 3ffffe94 3ffffe70  
3ffffe80:  00000002 3ffffe74 00374163 736c6166  
3ffffe90:  3fff0065 00000000 3ffffe88 00000001  
3ffffea0:  3ffffe8c 00374174 303a3030 40100030  
3ffffeb0:  3fff8360 402190a8 00000000 000003e8  
3ffffec0:  3fff8360 3fff858c 3fff174c 3fff85cc  
3ffffed0:  0000002f 0000002d 3ffffc90 40216709  
3ffffee0:  00000000 4bc6a7f0 f6041893 3fff3364  
3ffffef0:  0000000f 00000000 3fff334c 0000000f  
3fffff00:  00000000 3fff3334 0000000f 00000000  
3fffff10:  3fff18d4 0000000f 00000000 3fff77ec  
3fffff20:  0000000f 00000000 00000000 3ffe94a8  
3fffff30:  00000000 3fff0abc 5c482cfe 40213322  
3fffff40:  000003e7 5c482cfe 3fff0914 3ffe94a8  
3fffff50:  00000000 5c482cfe 3fff0914 4020a2e4  
3fffff60:  00000000 0000000a 3fff174c 00000000  
3fffff70:  00000000 00000000 40218488 00000000  
3fffff80:  00000000 00000000 00000000 00000000  
3fffff90:  00000000 feefeffe feefeffe feefeffe  
3fffffa0:  feefeffe feefeffe feefeffe 3fff0ba8  
<<<stack<<<

last failed alloc call: 3FFFBB2C(1032)

 ets Jan  8 2013,rst cause:2, boot mode:(1,6)


 ets Jan  8 2013,rst cause:4, boot mode:(1,6)

wdt reset
After line "08:59:43 - Impossibile leggere il file /json/zone_a.json" is call this code:

Code: Select all

          struct PushSaferInput input;
          input.message = "This is a test message";
          input.title = "MrGarden";
          input.sound = "8";
          input.vibration = "1";
          input.icon = "1";
          input.iconcolor = "#FF0000";
          input.priority = "1";
          input.device = "a";
        
        Serial.println(psafer->sendEvent(input));
        Serial.println("ok");

User avatar
admin
Site Admin
Posts: 391
Joined: 1. Dec 2014, 12:41
Location: Germany

Re: ESP8266 send message problem

Postby admin » 23. Jan 2019, 09:12

no secure connection can be established.

I can solved the issue by including

Code: Select all

#include <WiFiClientSecure.h>
like in this working exampe

https://github.com/appzer/pushsafer-ard ... dEvent.ino

Kevin
DE: Dir gefällt Service und Support! Dann freuen wir uns auf deine Bewertung!
EN: You like Service and Support! Then we look forward to your review!

Pushsafer.com Website - iOS - Android - Windows 10

array81
Posts: 3
Joined: 22. Jan 2019, 13:18

Re: ESP8266 send message problem

Postby array81 » 23. Jan 2019, 13:40

admin wrote:
23. Jan 2019, 09:12
no secure connection can be established.

I can solved the issue by including

Code: Select all

#include <WiFiClientSecure.h>
like in this working exampe

https://github.com/appzer/pushsafer-ard ... dEvent.ino

Kevin
I just use it because I need if it on telegram library and telegram works without problem. These are my includes:

Code: Select all

#include <FS.h> 
#include <Time.h>
#include <DNSServer.h>
#include <ESP8266WiFi.h>         // https://github.com/esp8266/Arduino
#include <WiFiClient.h> 
#include <ESP8266WebServer.h>
#include "WiFiManager.h"         // https://github.com/tzapu/WiFiManager
#include <NTPClient.h>           // https://github.com/arduino-libraries/NTPClient
#include <WiFiUdp.h>             // utilizzata per aggiornare l'orario da internet
#include "TimeLib.h"             // https://github.com/PaulStoffregen/Time
#include <ArduinoJson.h>         // https://github.com/bblanchon/ArduinoJson
#include <WiFiClientSecure.h>
#include <UniversalTelegramBot.h>// https://github.com/witnessmenow/Universal-Arduino-Telegram-Bot
#include <Pushsafer.h>           // https://github.com/appzer/pushsafer-arduino-library

User avatar
admin
Site Admin
Posts: 391
Joined: 1. Dec 2014, 12:41
Location: Germany

Re: ESP8266 send message problem

Postby admin » 23. Jan 2019, 16:07

thats strange!

My script based on one off the script from https://github.com/witnessmenow/ (also telegram)
maybe the two disturb each other!

Delete the telegram plugin and try again!

If that does not help, unfortunately I have no more advice and you should search help in an Arduino board, they can help you

Kevin
DE: Dir gefällt Service und Support! Dann freuen wir uns auf deine Bewertung!
EN: You like Service and Support! Then we look forward to your review!

Pushsafer.com Website - iOS - Android - Windows 10


Who is online

Users browsing this forum: No registered users and 2 guests