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

NodeMCU v3 Reset #33

Open
konig87nikkinakki opened this issue Dec 24, 2019 · 19 comments
Open

NodeMCU v3 Reset #33

konig87nikkinakki opened this issue Dec 24, 2019 · 19 comments

Comments

@konig87nikkinakki
Copy link

Hi,
i receive this error (and reset) on serial when i run the following code:

Exception (3):
epc1=0x40100691 epc2=0x00000000 epc3=0x00000000 excvaddr=0x4006e7e8 depc=0x00000000

 stack >  >   >

ctx: cont
sp: 3ffffd70 end: 3fffffc0 offset: 01a0
3fffff10: 007a1200 f669d6b0 00000000 3ffee874
3fffff20: 3fffdad0 00000000 00000020 4010093b
3fffff30: 3ffee0d0 3ffee8d0 000003e8 3ffee874
3fffff40: 3fffdad0 3ffee8d0 3fffff88 4020636e
3fffff50: 40207135 000003e8 3ffee7ec 40206384
3fffff60: 3fffdad0 00000000 3ffee7ec 40201174
3fffff70: 3fffdad0 3ffee790 3ffee6b8 402049a8
3fffff80: 3fffdad0 3ffee790 3ffee7ec 402010b9
3fffff90: 40208ed8 a7bd1f00 feefeffe 80efeffe
3fffffa0: feefeffe 00000000 3ffee834 40206c90
3fffffb0: feefeffe feefeffe 3ffe8538 40100bfd
<<<stack<<<

I would like to turn off and on a led with telegram bot, so this is the code (it's not complete but it crashes so i cannot continue coding):

#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
#include <TelegramBot.h>

int led = 2;
 
const char* ssid = "MySSID";
const char* password = "MyWPAkey";
const char BotToken[] = "mybot:token";

WiFiClientSecure net_ssl;
TelegramBot bot (BotToken, net_ssl);


void setup() {
  pinMode(pin, OUTPUT);
  Serial.begin(9600);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
     delay(500);
     Serial.print(".");
  }
  Serial.println("");
  Serial.println("WiFi connected");
  Serial.println(WiFi.localIP());
  bot.begin(); 
}




void loop() 
{  
digitalWrite(led, HIGH);   // turn the LED off 
  Serial.println("Led OFF");
  delay(1000);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED on 
 Serial.println("Led ON");
  delay(1000);               // wait for a second
 message m = bot.getUpdates(); // Read new messages
//it wait a lot after Led On and then errors
//here i want to continue coding but i cannot because it crashes so it doesnt worth it.
delay(1000);

}

i m using nodeMCU v3, with ESP8266MOD chip on it, i tried with 8v input and 2200uF big capacitor, it crashes. i tried blinking sketch with serial.println inside, it doesnt crashes. seems to crash only when using message m = bot.getUpdates(); or other using BOT library. i also tried to upgrade firmware but i don't know if i chose the last or correct one. i have another NodeMCU v3 board, i tried (without upgrading firmware) and it still crashes. i don t know what else to try to do.

it connects to wifi at
WiFi connected
172.31.189.167

it's correct ip of my net. i also tried to change network, it still crashes: it's not a wifi problem but (i think) a bot telegram library problem.

Can someone please help me?
Thanks a lot!

@fmarzocca
Copy link

fmarzocca commented Dec 27, 2019

I am getting the same on a normal NodeMCU ESP-12E...
The example EchoBot 8266 fails completely and resets the device forever. Useless.

@konig87nikkinakki
Copy link
Author

I am getting the same on a normal NodeMCU ESP-12E...
The example EchoBot 8266 fails completely and resets the device forever. Useless.

internet is good because we can share problems and SOMETIME solve it.
i think it will be hard to solve it. new year's eve is near, i propose to drink a lot and burn nodemcu into Etna's vulcano (in Lord of Rings' style).

@fmarzocca
Copy link

The reset is generated from the getUpdates() function.

@konig87nikkinakki
Copy link
Author

The reset is generated from the getUpdates() function.

probably, if i dont use it (only blinking) it never crashes. are they other TelegramBot library that could i use? please if you find solutions write here, i ll do the same.

@fmarzocca
Copy link

i propose to drink a lot and burn nodemcu into Etna's vulcano (in Lord of Rings' style).

Accepted suggestion! :-)

@fmarzocca
Copy link

are they other TelegramBot library that could i use? please if you find solutions write here, i ll do the same.

..this is not fair.... look on google.

@konig87nikkinakki
Copy link
Author

are they other TelegramBot library that could i use? please if you find solutions write here, i ll do the same.

..this is not fair.... look on google.

i'm trying to use Gianbacchio's library, looks more professional, but i have another issue: it doesnt connect to my wifi, even if i set up with my SSID and WPA key (i tried to change to WPA2 or WEP).
https://github.com/Gianbacchio/ESP8266-TelegramBot
please tell me if it works with your NodeMCU. I'm trying Example "echoBot".

@konig87nikkinakki
Copy link
Author

I am getting the same on a normal NodeMCU ESP-12E...
The example EchoBot 8266 fails completely and resets the device forever. Useless.

HEY I SOLVED!!!!
here what i m using:

  1. arduino ide 1.8.6
  2. Strumenti --> Gestione Schede --> ESP8266 old version 2.3.0 installed (OLD VERSION!)
  3. CasaJasmina Telegrambot v1.2.5 (today it's the last version)
  4. CasaJasmina need ArduinoJson library by Benoit Blanchon to work, NOT THE LAST ONE, i m using v5.13.1

if you installed 2) ESP8266 newer version, you have to

  1. uninstall Arduino (c:\users\user\Document\Arduino\Libraries will not be deleted, so don't worry!)
  2. go to %appdata% --> Local --> Arduino15 and DELETE that folder (it contains ESP8266 new version, you have to delete)
  3. install arduino ide 1.8.6
  4. install new shield ESP8266 and choose 2.3.0 version like mine.

Now i m running this code and it works (no reset)

/*
  EchoBot on ESP8266

  This example shows how to program a Telegram Bot
  that echoes your messages.

  For a step-by-step tutorial visit:
  https://create.arduino.cc/projecthub/Arduino_Genuino/telegram-bot-library-ced4d4

  Updated 13 February 2018
  by Tommaso Laterza

  This example code is in the public domain.

*/

#include "arduino_secrets.h"
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
#include <TelegramBot.h>

// Initialize Wifi connection to the router
const char* ssid  = SECRET_SSID;
const char* password = SECRET_PASS;


// Initialize Telegram BOT
const char BotToken[] = SECRET_BOT_TOKEN;

WiFiClientSecure net_ssl;
TelegramBot bot (BotToken, net_ssl);


void setup() {

  Serial.begin(9600);
 // while (!Serial); // Wait for the Serial monitor to be opened

  // attempt to connect to Wifi network:
  Serial.print("Connecting Wifi: ");
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("");
  Serial.println("WiFi connected");


  bot.begin();

}

void loop() {
 
    message m = bot.getUpdates(); // Read new messages
    if ( m.chat_id != 0 ){ // Checks if there are some updates
      Serial.println(m.text);
      bot.sendMessage(m.chat_id, m.text);  // Reply to the same chat with the same text
    } else {
      Serial.println("no new message");
    }

}

that is EXAMPLE: EchoBot-ESP8266.ino into CasaJasmina Telegrambot v1.2.5 Library. Of course i had to put my data (SSID, WPA, token).
Let me know if you have problems.
Tomorrow i ll look for a better stable library ;-)
keep in touch!

@konig87nikkinakki
Copy link
Author

With those library and settings that i ve written to you, you can program this:
https://www.instructables.com/id/Smart-House-Telegram-Bot-With-Nodemcu-esp8266-Rela/
and it works (NOTE: image in the guide is wrong connecting Rele and Led, please only use to read code and try to run it, it will work with these settings).

@fmarzocca
Copy link

I am using another library, with no need to downgrade board manager! 2.3.0 is a very old core for esp8266

@konig87nikkinakki
Copy link
Author

I am using another library, with no need to downgrade board manager! 2.3.0 is a very old core for esp8266

Ok, can you please tell me what's your library name? i d apprieciate.

@fmarzocca
Copy link

We cannot use this support thread as a chat. I told you, it's not fair. This is a support ticket for this Library.

@konig87nikkinakki
Copy link
Author

We cannot use this support thread as a chat. I told you, it's not fair. This is a support ticket for this Library.

certo, come no.
Thank you.

@kilbasovich
Copy link

accept this method in your code

WiFiClientSecure client;
TelegramBot bot (BotToken, client);
void setup() {

client.setInsecure();

@fabriziorosi92
Copy link

accept this method in your code

WiFiClientSecure client;
TelegramBot bot (BotToken, client);
void setup() {

client.setInsecure();

'class WiFiClientSecure' has no member named 'setInsecure'

@kilbasovich
Copy link

what error displays?

@fabriziorosi92
Copy link

Exactly this one:
error: 'class WiFiClientSecure' has no member named 'setInsecure' 'class WiFiClientSecure' has no member named 'setInsecure'

@kilbasovich
Copy link

kilbasovich commented Feb 21, 2020

I use:
arduino 1.8.10
esp8266 v2.6.3

send all your code

@kilbasovich
Copy link

#31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants