MQTT Import

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
tozett
Normal user
Posts: 734
Joined: 22 Dec 2015, 15:46
Location: Germany

Re: MQTT Import

#31 Post by tozett » 25 Jul 2016, 16:53

i did not tried to compile mqtt-import,
(as there is also an import -channel on the "normal" mqtt in espeasy, dont know if it get more open for more functions),
but i had normal compile issues with Core 2.3 on my arduino 1.6.5 IDE.
it worked with core 2.2.

may give IDE 1.6.5 and Core 2.2 a try, if this is the issue?

nightshark
Normal user
Posts: 25
Joined: 29 Apr 2016, 06:54

Re: MQTT Import

#32 Post by nightshark » 25 Jul 2016, 16:54

I am having the same problem as ricotrotter. I am using 1.6.5 with board version 2.2.0.

Code: Select all

ESPEasy.ino:249:29: error: no matching function for call to 'PubSubClient::PubSubClient(WiFiClient&)'
ESPEasy.ino:249:29: note: candidates are:
In file included from ESPEasy.ino:214:0:
C:\Users\garrem03\Documents\Arduino\libraries\pubsubclient\src/PubSubClient.h:47:4: note: PubSubClient::PubSubClient(String, uint16_t)
    PubSubClient(String hostname, uint16_t port = 1883);
    ^
C:\Users\garrem03\Documents\Arduino\libraries\pubsubclient\src/PubSubClient.h:47:4: note:   no known conversion for argument 1 from 'WiFiClient' to 'String'
C:\Users\garrem03\Documents\Arduino\libraries\pubsubclient\src/PubSubClient.h:46:4: note: PubSubClient::PubSubClient(IPAddress&, uint16_t)
    PubSubClient(IPAddress &ip, uint16_t port = 1883);
    ^
C:\Users\garrem03\Documents\Arduino\libraries\pubsubclient\src/PubSubClient.h:46:4: note:   no known conversion for argument 1 from 'WiFiClient' to 'IPAddress&'
C:\Users\garrem03\Documents\Arduino\libraries\pubsubclient\src/PubSubClient.h:43:4: note: PubSubClient::PubSubClient()
    PubSubClient();
    ^
C:\Users\garrem03\Documents\Arduino\libraries\pubsubclient\src/PubSubClient.h:43:4: note:   candidate expects 0 arguments, 1 provided
C:\Users\garrem03\Documents\Arduino\libraries\pubsubclient\src/PubSubClient.h:16:7: note: PubSubClient::PubSubClient(const PubSubClient&)
 class PubSubClient {
       ^
C:\Users\garrem03\Documents\Arduino\libraries\pubsubclient\src/PubSubClient.h:16:7: note:   no known conversion for argument 1 from 'WiFiClient' to 'const PubSubClient&'
C:\Users\garrem03\Documents\Arduino\libraries\pubsubclient\src/PubSubClient.h:16:7: note: PubSubClient::PubSubClient(PubSubClient&&)
C:\Users\garrem03\Documents\Arduino\libraries\pubsubclient\src/PubSubClient.h:16:7: note:   no known conversion for argument 1 from 'WiFiClient' to 'PubSubClient&&'
Controller.ino: In function 'void MQTTConnect()':
Controller.ino:75:14: error: 'class PubSubClient' has no member named 'setServer'
Controller.ino:76:14: error: 'class PubSubClient' has no member named 'setCallback'
Controller.ino:98:168: error: no matching function for call to 'PubSubClient::connect(const char*, char [26], char [64], const char*, int, int, const char [16])'
Controller.ino:98:168: note: candidates are:
In file included from ESPEasy.ino:214:0:
C:\Users\garrem03\Documents\Arduino\libraries\pubsubclient\src/PubSubClient.h:62:9: note: bool PubSubClient::connect(String)
    bool connect(String id);
         ^
C:\Users\garrem03\Documents\Arduino\libraries\pubsubclient\src/PubSubClient.h:62:9: note:   candidate expects 1 argument, 7 provided
C:\Users\garrem03\Documents\Arduino\libraries\pubsubclient\src/PubSubClient.h:65:9: note: bool PubSubClient::connect(String, String, uint8_t, bool, String)
    bool connect(String id, String willTopic, uint8_t willQos, bool willRetain, String willMessage);
         ^
C:\Users\garrem03\Documents\Arduino\libraries\pubsubclient\src/PubSubClient.h:65:9: note:   candidate expects 5 arguments, 7 provided
C:\Users\garrem03\Documents\Arduino\libraries\pubsubclient\src/PubSubClient.h:101:9: note: bool PubSubClient::connect(MQTT::Connect&)
    bool connect(MQTT::Connect &conn);
         ^
C:\Users\garrem03\Documents\Arduino\libraries\pubsubclient\src/PubSubClient.h:101:9: note:   candidate expects 1 argument, 7 provided
_P103_Event.ino: In function 'void Plugin_103_Action(byte, byte, int, int, byte)':
_P103_Event.ino:522:33: error: invalid conversion from 'char*' to 'byte {aka unsigned char}' [-fpermissive]
_P103_Event.ino:522:33: error: too few arguments to function 'void ExecuteCommand(byte, const char*)'
Command.ino:4:6: note: declared here
_P205_FrameOLED.ino: In function 'boolean Plugin_205(byte, EventStruct*, String&)':
_P205_FrameOLED.ino:210:34: error: no matching function for call to 'SSD1306Wire::init(int&)'
_P205_FrameOLED.ino:210:34: note: candidate is:
In file included from C:\Users\garrem03\Documents\Arduino\libraries\esp8266-oled-ssd1306-master/SSD1306Wire.h:31:0,
                 from C:\Users\garrem03\Documents\Arduino\libraries\esp8266-oled-ssd1306-master/SSD1306.h:30,
                 from _P205_FrameOLED.ino:30:
C:\Users\garrem03\Documents\Arduino\libraries\esp8266-oled-ssd1306-master/OLEDDisplay.h:114:10: note: bool OLEDDisplay::init()
     bool init();
          ^
C:\Users\garrem03\Documents\Arduino\libraries\esp8266-oled-ssd1306-master/OLEDDisplay.h:114:10: note:   candidate expects 0 arguments, 1 provided
_P205_FrameOLED.ino: In function 'void display_scroll(String*, String*, int)':
_P205_FrameOLED.ino:569:21: error: 'Dialog_Plain_12' was not declared in this scope
no matching function for call to 'PubSubClient::PubSubClient(WiFiClient&)'

tozett
Normal user
Posts: 734
Joined: 22 Dec 2015, 15:46
Location: Germany

Re: MQTT Import

#33 Post by tozett » 25 Jul 2016, 17:08

i tried it with arduino 1.6.5, core 2.20 and pubsubclient 1.9 and pubsub 2.6
always with errors.
the developer of mqtt-import-plugin should have a look an update his sources, i guess...

User avatar
jsilver
Normal user
Posts: 23
Joined: 24 May 2016, 14:45
Location: Lewes, UK
Contact:

Re: MQTT Import

#34 Post by jsilver » 01 Aug 2016, 12:36

Alas namirda hasn't been seen here since April 2016. Does anyone have a forwarding address?

At what point should someone else step in and take over the code?

Drum
Normal user
Posts: 300
Joined: 07 Feb 2016, 11:56

Re: MQTT Import

#35 Post by Drum » 01 Aug 2016, 14:21

I don't know if it will help, but check the ESP releases thread and maybe try R114.

Martinus wrote
"Because the current R108, marked stable, still contains some bugs, it would be better to replace it with a newer version. R114 is available for evaluation. We moved to a newer MQTT client, it may improve connection issues. We also moved to Arduino core 2.3.0 because the 2.1.0 has issues with the servo library.

With this build, only core 2.3.0 is supported, so you need to upgrade the core package. I had some issues with the core upgrade, so i decided to download and configure a brand new portable setup using Arduino 1.6.9 with a fresh core 2.3.0 install.

R114 has been running for a week now in my environment. I successfully upgraded all my unit's using OTA. (NodeMCU 1.0 and ESP-01 black editions)

Changes since R108:

// Cleanup code, conditional core 2.0.0/2.1.0 support removed, changed to core 2.3.0
// Bugfix in rules processing with multiple value devices, only the first value would work as expected
// Bugfix for timezones other than whole hours offset. It is now set in +/- minutes
// Bugfix parsing rfid (SENSOR_TYPE_LONG) values in parseTemplate function
// Improved Serial Server plugin, reconnect handling
// Improved thingspeak and emoncms plugins (contributed by pm-cz)
// Fix HTU21d timing
// Moved to pubsubclient 2.6 library (source no longer compatible with 1.9 library, so use the 2.6 version!)"

ricotrotter
New user
Posts: 7
Joined: 23 Jul 2016, 17:03

Re: MQTT Import

#36 Post by ricotrotter » 02 Aug 2016, 15:01

Thanks for reply.
Though, I get no issue compiling ESPEasy normally.
It's the MQTT plugin that is having issue.
I will investigate further!

Martinus

Re: MQTT Import

#37 Post by Martinus » 03 Aug 2016, 18:26

jsilver wrote:Alas namirda hasn't been seen here since April 2016. Does anyone have a forwarding address?
You could send him a PM and he should get a regular mail to it's registered email address.
jsilver wrote:At what point should someone else step in and take over the code?
We have no policy for this. But if there is no response on PM, i can have a look. But remember that he might be on holiday (and so will i as of today...)

What need's to be done, is a migration to make it compliant to the new api that came with the newer pubsub library.

namirda
Normal user
Posts: 53
Joined: 22 Jan 2016, 17:09

Re: MQTT Import

#38 Post by namirda » 05 Aug 2016, 06:31

Hi All,

Sorry about the silence but I have been busy on other projects for a while and did not realise how quickly stuff gets out of date in the ESPEasy world!

I have put an updated version of MQTTImport into the playground which runs with ESPEasy118, Core 2.3 and PubSub 2.6 - hopefully there will not be such frequent changes to the toolchain going forward!

Neil

ricotrotter
New user
Posts: 7
Joined: 23 Jul 2016, 17:03

Re: MQTT Import

#39 Post by ricotrotter » 05 Aug 2016, 11:28

Hi namirda,

thanks for the update!
I confirm I could compile it.
Not tested yet!
One only issue: string2float is duplicated from the extra_utilities files - I had to remove it manually as I need extra_utilities for other plugins.

Cheers
Rico

User avatar
jsilver
Normal user
Posts: 23
Joined: 24 May 2016, 14:45
Location: Lewes, UK
Contact:

Re: MQTT Import

#40 Post by jsilver » 05 Aug 2016, 20:01

namirda wrote:I have put an updated version of MQTTImport into the playground which runs with ESPEasy118, Core 2.3 and PubSub 2.6
Thank you Neil! I'll go and try it...

See, that's what happens when you write some really useful code and then get on with the rest of your life! :D

timsson
Normal user
Posts: 77
Joined: 25 Mar 2016, 22:00

Re: MQTT Import

#41 Post by timsson » 06 Aug 2016, 12:46

Thank you Neil! For me it works with ESPEasy118..
It is possiible to import a string or On/OFF with the mqtt-plugin?
I need it to write the state in my oled...

-----
mosquitto_sub -t /# -v
/ESP_03/window1/state open
/ESP_03/window2/state OFF
/Alarmsytem/state disarm
---
MQTT-plugin Name: Window1 -- Topic 1:/ESP_03/window1 -- Value Name 1: -- Formula Value1: string(open)
oled-plugin Line1: Floor: [Window1#Value1]
----->
Oled Line1:
Floor: open
or
System: disarm

User avatar
jsilver
Normal user
Posts: 23
Joined: 24 May 2016, 14:45
Location: Lewes, UK
Contact:

Re: MQTT Import

#42 Post by jsilver » 08 Aug 2016, 13:59

timsson wrote:It is possiible to import a string or On/OFF with the mqtt-plugin?
This would be really useful.

Also, I'm up and running with R118, OLED Framed, and MQTT-import too. Thanks Neil!

-macke-
Normal user
Posts: 20
Joined: 03 Sep 2016, 21:53

Re: MQTT Import

#43 Post by -macke- » 09 Sep 2016, 16:40

Hello!

I get this error when trying to install the plugin: I have Extra_Utilities in the same catalog:


C:\Users\Macke.BLUEBERRY\Documents\Arduino\libraries\ESPEasy\_P210_MQTTImport.ino: In function 'float string2float(String)':
_P210_MQTTImport:450: error: redefinition of 'float string2float(String)'

float string2float(String myString) {

^

Extra_Utilities:130: error: 'float string2float(String)' previously defined here

float string2float(String myString) {

namirda
Normal user
Posts: 53
Joined: 22 Jan 2016, 17:09

Re: MQTT Import

#44 Post by namirda » 10 Sep 2016, 11:57

Hi,

You can delete string2float from extra_utilities - the function is duplicated in MQTT Import.

-macke-
Normal user
Posts: 20
Joined: 03 Sep 2016, 21:53

Re: MQTT Import

#45 Post by -macke- » 12 Sep 2016, 08:18

namirda wrote:Hi,

You can delete string2float from extra_utilities - the function is duplicated in MQTT Import.
Thanks :) Now it´s working!

This plugin was excatly what I was looking for. Great work :)

timsson
Normal user
Posts: 77
Joined: 25 Mar 2016, 22:00

Re: MQTT Import

#46 Post by timsson » 15 Nov 2016, 21:26

Hello,
Unfortunately I still have my problem.
Could someone help me to send a text with mqtt to the display?
Thanks

bassmint
New user
Posts: 9
Joined: 26 Nov 2015, 20:12

Re: MQTT Import

#47 Post by bassmint » 25 Nov 2016, 06:31

-macke- wrote:
namirda wrote:Hi,

You can delete string2float from extra_utilities - the function is duplicated in MQTT Import.
Thanks :) Now it´s working!

This plugin was excatly what I was looking for. Great work :)
I tried and had this issue. Tried the fix of deleting >string2float< but it throws out other errors that I don't understand.
I am not sure of what exactly I should be deleting. just the string2float, the entire section of such. I have tried many combinations and read many pages but still have not found a fix.

I am using arduino ide latest version and tried with 1.6.5 as suggesting in a post.
deleted ide and all data files and used fresh install

used latest versions of easyesp and test versions. had no luck with the mqttimport

any help appreciated.

FWIW none of the links in the forum posts don't seem work.

tia

Code: Select all

Arduino: 1.6.13 Hourly Build 2016/09/30 06:12 (Mac OS X), Board: "NodeMCU 0.9 (ESP-12 Module), 80 MHz, 115200, 4M (3M SPIFFS)"

/Users/jpe/Documents/Arduino/ESPEasy/ESPEasy.ino: In function 'void setup()':
ESPEasy:547: error: 'PluginInit' was not declared in this scope
     PluginInit();
                ^
ESPEasy:548: error: 'CPluginInit' was not declared in this scope
     CPluginInit();
                 ^
/Users/jpe/Documents/Arduino/ESPEasy/ESPEasy.ino: In function 'void loop()':
ESPEasy:657: error: 'PluginCall' was not declared in this scope
       if (!PluginCall(PLUGIN_SERIAL_IN, 0, dummyString))
                                                       ^
/Users/jpe/Documents/Arduino/ESPEasy/ESPEasy.ino: In function 'void run10TimesPerSecond()':
ESPEasy:686: error: 'PluginCall' was not declared in this scope
   PluginCall(PLUGIN_TEN_PER_SECOND, 0, dummyString);
                                                   ^
/Users/jpe/Documents/Arduino/ESPEasy/ESPEasy.ino: In function 'void runOncePerSecond()':
ESPEasy:734: error: 'PluginCall' was not declared in this scope
   PluginCall(PLUGIN_ONCE_A_SECOND, 0, dummyString);
                                                  ^
/Users/jpe/Documents/Arduino/ESPEasy/ESPEasy.ino: In function 'void SensorSendTask(byte)':
ESPEasy:872: error: 'PluginCall' was not declared in this scope
       success = PluginCall(PLUGIN_READ, &TempEvent, dummyString);
                                                                ^
/Users/jpe/Documents/Arduino/ESPEasy/ESPEasy.ino: In function 'boolean checkSystemTimers()':
ESPEasy:978: error: 'PluginCall' was not declared in this scope
         if (!PluginCall(PLUGIN_WRITE, &TempEvent, systemCMDTimers[x].action))
                                                                            ^
/Users/jpe/Documents/Arduino/ESPEasy/Controller.ino: In function 'boolean sendData(EventStruct*)':
Controller:38: error: 'PluginCall' was not declared in this scope
   PluginCall(PLUGIN_EVENT_OUT, event, dummyString);
                                                  ^
/Users/jpe/Documents/Arduino/ESPEasy/Extra_Utilities.ino: At global scope:
Extra_Utilities:130: error: expected ')' before 'myString'
 float (String myString) { 
               ^
Multiple libraries were found for "Servo.h"
 Used: /Users/jpe/Library/Arduino15/packages/esp8266/hardware/esp8266/2.3.0/libraries/Servo
 Not used: /Applications/Arduino.app/Contents/Java/libraries/Servo
exit status 1
'PluginInit' was not declared in this scope

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

namirda
Normal user
Posts: 53
Joined: 22 Jan 2016, 17:09

Re: MQTT Import

#48 Post by namirda » 08 Dec 2016, 10:16

Hi Bassmint - Sorry, I don't come by this forum very often any more.

You must be doing something wrong here.

Just to be sure that there have been no breaking changes for MQTTImport in the last few months, I downloaded ESPEasy R147 from GitHub and added the version of MQTTImport from the playground into the sketch directory.

It compiled and ran without problems first time. There should be no need to delete anything. I was using Arduino 1.6.11

Good Luck

n

bassmint
New user
Posts: 9
Joined: 26 Nov 2015, 20:12

Re: MQTT Import

#49 Post by bassmint » 09 Dec 2016, 07:48

thanks

will try again

tried again and found the issue is with Arduino IDE on MacOS Sierra. Needed v 1.6.12.

went in ok.

thanks again

Jeff
Normal user
Posts: 26
Joined: 18 Nov 2016, 18:35

Re: MQTT Import

#50 Post by Jeff » 15 Jan 2017, 13:54

Thanks.

It work, i understand the operation.

On the other hand of the MQTT plugin with idx = "1", i have this error on domoticz,

Code: Select all

2017-01-15 13:51:13.517 MQTT: Topic: domoticz/in, Message: {"idx":1,"nvalue":0,"svalue":"1"}
2017-01-15 13:51:13.517 Error: MQTT: unknown idx received!
To solve this problem, I create a fake switch "text" with idx = 1 (open database and change the idx)

Code: Select all

2017-01-15 14:01:32.042 MQTT: Topic: domoticz/in, Message: {"idx":1,"nvalue":0,"svalue":"1"}
2017-01-15 14:02:02.069 MQTT: Topic: domoticz/in, Message: {"idx":1,"nvalue":0,"svalue":"1"}
2017-01-15 14:02:32.098 MQTT: Topic: domoticz/in, Message: {"idx":1,"nvalue":0,"svalue":"1"}
2017-01-15 14:03:02.132 MQTT: Topic: domoticz/in, Message: {"idx":1,"nvalue":0,"svalue":"1"}
:D

starfish
Normal user
Posts: 38
Joined: 16 Feb 2017, 23:46

Re: MQTT Import

#51 Post by starfish » 19 Feb 2017, 02:07

this plugin would be just what I need, unfortunately I cannot compile. searching the forum showed, that other users have the same problem but revealed no real solution.
I tried
arduino ide 1.8.1 / esp8266 package 2.3.0
arduino ide 1.6.5 / esp8266 package 2.0.0
as portable or installer version
on ESPEasy R120 / Wemos D1 4M (1M SPIFFS)

I need help -what else can I try?

edit Feb.24: - seems to work see:
viewtopic.php?f=4&t=1149&start=70#p13728

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 10 guests