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

How to publish in the callback or it bug ? #21

Open
dogrocker opened this issue May 15, 2015 · 1 comment
Open

How to publish in the callback or it bug ? #21

dogrocker opened this issue May 15, 2015 · 1 comment

Comments

@dogrocker
Copy link

I try to publish the data that received back to the broker but it seem like it loop multiple my publish data.

I test code like this.

void mqttData(void* response)
{
  RESPONSE res(response);
  debugPort.print("Received: topic=");
  String topic = res.popString();
  debugPort.println(topic);

  debugPort.print("data=");
  String data = res.popString();
  debugPort.println(data);

  mqtt.publish("test", "test");
  char buffTopic[64], buffPayload[64];
  topic.toCharArray(buffTopic, topic.length() + 1);
  data.toCharArray(buffPayload, data.length() + 1);
  mqtt.publish((const char*)buffTopic, (char*)buffPayload);
}

as expected it should send data to broker like.

olddata
test

but I got a lot of data like this.

olddata
test
olddata
test
olddata
test
olddata
test
olddata
test

What I'm wrong or this is a bug?

@ibrahimisim
Copy link

Hello,

When I upload software to esp8266 I get an error that is below. Please help me !!!.

pi@raspberrypi /usr/share/arduino/libraries/espduino $ sudo esp8266/tools/esptool.py -p /dev/ttyUSB0 write_flash 0x00000 esp8266/release/0x00000.bin 0x40000 esp8266/release/0x40000.bin
Could not find platform dependent libraries
Consider setting $PYTHONHOME to [:]
Traceback (most recent call last):
File "esp8266/tools/esptool.py", line 22, in
import serial
ImportError: No module named serial

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

2 participants