-
Notifications
You must be signed in to change notification settings - Fork 127
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
TBPubSubClient.h conflicts with PubSubClient.h #165
Comments
It was done like this so there is no need to change any code for the users, but simply to include the The only difference is a small but important fix that wasn't merged into the main repository, because it is more or less dead. So simply do not install the original |
I see that, however many and 4 libraries I'm using would need to be updated. Granted small changes. however any lib updates would need to have those updates made again. I just created a PubSubClient.h which just includes TBPubSubClient.h and dropped this into the TBPubSubClient library directory. I then removed the original PubSubClient library. All seems to work okay. You may want to consider this in your next build as the impact is zero. John |
I'll create a pull request for this change in the ThingBoard fork of the PubSubClient and update the internal library files and the examples accordingly. Will probably be included in the next release. |
This case is solve or not ? I still found this issues. in Arduino_MQTT_Client.h It work!!! Someone please fix it. |
Hi, can I ask what versions of ThingsBoard are people using? During the updates I used 11.1 Thingsboard, and tried 12.0 and earlier versions. I started getting these Multiple redefinitions of the PubSubClient. and issues with MQTT. which appears to be a current topic. I cleaned up the library (default) folder and removed PubSubClient, but the compile fails still. (Redefinition and MQTT errors. ) I tried to "go back to the beginning" and recompile the current Examples. But also run into errors (much the same). MQTT not recognized etc, cannot compile. So, what versions of ThingsBoard are the examples based on? Is there any information or other specific Ver LIB I need to set? thanks in Advance. |
The examples of the library are updated, according to the version so the current changes of the library are always shipped with the newest up to date working examples. Additionally the library always ships with its examples so you can simply open the examples folder in your project and look at the examples in there, because those should compile. Using the examples of this page however with older versions won't work, especially if there were breaking changes. |
thanks for the reply. (background: I have used this for some years now, and reasonably all ok, but recently (late Nov) I have this PubSubClient and other MQTT issues. It's quite a complex project and has really been working fine. up to now, I just simply can't compile the complete project, it's about 3mB BIN.) I have not ever had this much of a problem. It's been a few weeks, at least. I have the LIB all updated, including the ThingsBoard12.0. I have on the TBPubSubClient in the Library folder. See screen Shot attached) not PubSubClient. Additionally, this test was the example: 0010-esp8266_esp32_rpc with only the SSID and KEY and TB / TOKEN Also Attached is the Error file from the compile. and the library screen shot. I had installed the IDE 2.2 as I have been using the 1.6 and then 1.8.18 IDE as that was fine for what I needed. But I uninstalled the 2.2 as the compile (end if Ping Time out) was taking 15 min or more, previously the compile was a minute or so, not significant. But now with the PubSub redefinition errors, it is taking also 5 min, which suggests a problem. See that attached file. Arduino 1.8.18 (Windows 10), Board Error list 06Dec2023.txt I would really appreciate some assistance; this has been going on a and is well past being fun. thanks, TPC. |
Sorry for the inconveniences caused. Your This will be fixed as well once the pull request has been merged and the newest hotfix released as |
MathewHDYT OK |
@imbeacon Can be closed because the most recent version fixes the aforementioned issue, because PubSubClient has been renamed. To not cause redefinition issues. |
I have had a problem building this Github https://github.com/darrylb123/ESP32_SMA-Inverter-MQTT which may be related to this release. Not a programmer so if someone wants to look at it and see if its the program or the library that is the issue. I fixed the build problem by renaming the ref TBPubSubClient.h to PubSubClient.h in the identified file from the error message. Error message in VSCode Platformio and Gitpod running in Chrome src/ESP32_SMA_Inverter_App.h:9:10: fatal error: TBPubSubClient.h: No such file or directory Platformio.ini entry for libraries lib_deps = VSCode and Gitpod build output ref these libraries Dependency Graph |
@kommando828 That is correct the Because currently it does not install the ThingsBoard fork of the PubSubClient which was changed, but instead my fork. In which the name of the file is still The fix is probably to simply use |
I will try the fix, but once I applied my fix it does compile and runs correctly sending out MQTT messages. Applied your suggested change to the platformio.ini and the build was successful. Thanks for clarifying the issue. |
Yeah sorry for the confusion. What I meant is the aforementioned fix should work as well. But of course you can also simply rename the |
Mathew I can confirm my builds are ok now, I had edited the file, but assume the roll up to ver 12.02 has included that now and the compile is OK. I am using the includes (and other unrelated) #include <ThingsBoard.h> |
Hi .
I have mine working again ..
I was doing roll up dates when it went pear shaped.
.
I am interested to discuss the MQTTsend .
Can do in email if you wish .
***@***.***
I would like to revert to Jason packet.
Cheers
…On Fri, 22 Dec 2023, 12:27 am kommando828, ***@***.***> wrote:
I will try the fix, but once I applied my fix it does compile and runs
correctly sending out MQTT messages.
—
Reply to this email directly, view it on GitHub
<#165 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANLX6T3BDQIKKGTTVNMKNCTYKQ2MDAVCNFSM6AAAAAA7T3T42CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRWGI2DAMRZGM>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
@TPCQitek I am really confused what mean? What do you mean with the roll up dates went pear shaped? What do you mean with |
Any suggestions on how TBPubSubClient.h which defines the PubSubClient class and the original PubSubClient can coexist within a single project?
Having both libraries installed creates multiple instance linker errors, while changing includes around creates a bunch of maintenance and version/compatibility level issues.
Why wasn't the new new class just called TBPubSubClient?
Thanks
John
The text was updated successfully, but these errors were encountered: