Giter Site home page Giter Site logo

Comments (17)

BJvDL avatar BJvDL commented on August 22, 2024

Exactly the same issue here. i'm also using Arduino 1.6.4 with esp package from Adafruit 1.6.2
Maybe it comes from other mqtt clients publishing topics to the same broker but where this client is not subscribed to?

from pubsubclient.

Imroy avatar Imroy commented on August 22, 2024

I'm not seeing this problem. It may be caused by a problem that has since been fixed in the Arduino-ESP8266 port. AFAIK, Adafruit's builds are about a month old by now.

from pubsubclient.

BJvDL avatar BJvDL commented on August 22, 2024

I upgraded to arduino 1.6.4 and the latest version from Ivan Grokhotkov (https://github.com/esp8266/Arduino) via boardmanager and the problem still persists.
It even gets worse. After dropping the WiFi and restoring it again the WDT comes in.
Pubsubclient doesn't like loosing the WiFi

from pubsubclient.

gnih avatar gnih commented on August 22, 2024

Worst here because it doesn't even compile anymore... :-(

image

image

from pubsubclient.

BJvDL avatar BJvDL commented on August 22, 2024

Did you uninstall the Adafruit version first?
Delete the link in Preferences, reload arduino and load the board manager to see it has gone.
After that put in the new link from the ESP8266 community, reload arduino and install it in the Board Manager again. Maybe both versions get mixed up in the background

from pubsubclient.

CptanPanic avatar CptanPanic commented on August 22, 2024

Also check the latest esp-arduino as they added support for board manager directly. Should be most recent.

from pubsubclient.

BJvDL avatar BJvDL commented on August 22, 2024

I use http://arduino.esp8266.com/package_esp8266com_index.json and that one is always the latest

from pubsubclient.

gnih avatar gnih commented on August 22, 2024

Ok after complete fresh install : uninstalled arduino ide & manually deleted all arduino files and, last but not least, deleting the pubsub library in documents folder (how could it be altered!??).

So now it compiles, let check for the no free heap message...!

from pubsubclient.

Imroy avatar Imroy commented on August 22, 2024

@gnih That "PROGMEM" compile error was reported in #1 and fixed. Updating pubsubclient might have been all you needed.

from pubsubclient.

BJvDL avatar BJvDL commented on August 22, 2024

I'm still having 'No heap available, failed to malloc 0' .Arduino IDE is 1.6.4 with the latest version of ESP8266 in the Board Manager and Pubsubclient is up to date. I'm using pubsubclient-master.
There is also a pubsubclient-OOP-monster. What is the difference?

from pubsubclient.

gnih avatar gnih commented on August 22, 2024

Same here with latest version.
The strange thing is that by using
Serial.print("free heap="); Serial.println(ESP.getFreeHeap());
in the main loop, I always get >32k free heap but the debug still prints
No heap available, failed to malloc 0

Any idea?

from pubsubclient.

igrr avatar igrr commented on August 22, 2024

failed to malloc 0 means that someone tried to malloc 0 bytes. While malloc(0) is certainly legal, is seems to be not supported well by the underlying implementation.

Edit: So it's just the message that is a bit misleading, it is not related to not having heap available.

from pubsubclient.

Imroy avatar Imroy commented on August 22, 2024

I've added checks in a few places that use malloc() and could be called with a value of zero. See if this fixes your problem.

from pubsubclient.

igrr avatar igrr commented on August 22, 2024

Actually i thought to fix that in our malloc() so that it would guard against this error in pvPortMalloc. But handling this in the library is also okay.

from pubsubclient.

igrr avatar igrr commented on August 22, 2024

Also i see some places in 47cfda7 where you guard against free(NULL), which should actually work.

from pubsubclient.

Imroy avatar Imroy commented on August 22, 2024

@gnih @BJvDL Can this be closed now?

from pubsubclient.

BJvDL avatar BJvDL commented on August 22, 2024

@Imroy , I tested with your latest library and no problems anymore.
Please close this issue.
Thank you

from pubsubclient.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.