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

Why RBDimmer Lib. not capable with Arduino Iot cloud LIB #280

Closed
jamsyogendra opened this issue Oct 6, 2021 · 4 comments
Closed

Why RBDimmer Lib. not capable with Arduino Iot cloud LIB #280

jamsyogendra opened this issue Oct 6, 2021 · 4 comments
Labels
conclusion: duplicate Has already been submitted topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@jamsyogendra
Copy link

jamsyogendra commented Oct 6, 2021

Hello everyone i am trying to match Rbdimmer lib:
Link:- https://github.com/RobotDynOfficial/RBDDimmer

with this lib but I am getting errors with my sketch

Arduino: 1.8.12 (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), 4MB (FS:2MB OTA:~1019KB), 2, v2 Lower Memory, Disabled, None, Only Sketch, 115200"

In file included from C:\Users\jamsa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266/Arduino.h:29:0,

                 from sketch\Untitled_oct06b.ino.cpp:1:

C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\RBDDimmer-master\src/RBDdimmer.h:32:11: error: 'OFF' redeclared as different kind of symbol

     OFF = false,

           ^

In file included from C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\ArduinoIoTCloud\src/ArduinoIoTCloud.h:33:0,

                 from sketch\thingProperties.h:3,

                 from C:\Users\jamsa\OneDrive\Desktop\updates\Untitled_oct06b\Untitled_oct06b\Untitled_oct06b.ino:2:

C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\ArduinoIoTCloud\src/AIoTC_Const.h:26:19: error: previous declaration of 'const bool OFF'

 static bool const OFF = false;

                   ^

In file included from C:\Users\jamsa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266/Arduino.h:29:0,

                 from sketch\Untitled_oct06b.ino.cpp:1:

C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\RBDDimmer-master\src/RBDdimmer.h:33:10: error: 'ON' redeclared as different kind of symbol

     ON = true

          ^

In file included from C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\ArduinoIoTCloud\src/ArduinoIoTCloud.h:33:0,

                 from sketch\thingProperties.h:3,

                 from C:\Users\jamsa\OneDrive\Desktop\updates\Untitled_oct06b\Untitled_oct06b\Untitled_oct06b.ino:2:

C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\ArduinoIoTCloud\src/AIoTC_Const.h:25:19: error: previous declaration of 'const bool ON'

 static bool const ON  = true;

                   ^

C:\Users\jamsa\OneDrive\Desktop\updates\Untitled_oct06b\Untitled_oct06b\Untitled_oct06b.ino: In function 'void setup()':

Untitled_oct06b:101:31: error: no matching function for call to 'dimmerLamp::begin(DIMMER_MODE_typedef, const bool&)'

   dimmer.begin(NORMAL_MODE, ON);

                               ^

C:\Users\jamsa\OneDrive\Desktop\updates\Untitled_oct06b\Untitled_oct06b\Untitled_oct06b.ino:101:31: note: candidate is:

In file included from C:\Users\jamsa\OneDrive\Desktop\updates\Untitled_oct06b\Untitled_oct06b\Untitled_oct06b.ino:5:0:

C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\RBDDimmer-master\src/RBDdimmer.h:63:14: note: void dimmerLamp::begin(DIMMER_MODE_typedef, ON_OFF_typedef)

         void begin(DIMMER_MODE_typedef DIMMER_MODE, ON_OFF_typedef ON_OFF);

              ^

C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\RBDDimmer-master\src/RBDdimmer.h:63:14: note:   no known conversion for argument 2 from 'const bool' to 'ON_OFF_typedef'

Multiple libraries were found for "IRremote.h"
 Used: C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\IRremote
 Not used: C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\Arduino-IRremote-master
exit status 1
no matching function for call to 'dimmerLamp::begin(DIMMER_MODE_typedef, const bool&)'

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

anyone can explain why this happing 
@jamsyogendra
Copy link
Author

i already changed variable names ON/OFF in rbd, after that i got not compile with esp board error

@jamsyogendra
Copy link
Author

jamsyogendra commented Oct 7, 2021

i change the parameter name with different one, then i got zero compile error but after uploading my esp keep resetting

ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 3664, room 16 
tail 0
chksum 0xee
csum 0xee
v39c79d9b
~ld

 ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 3664, room 16 
tail 0
chksum 0xee
csum 0xee
v39c79d9b
~ld

@per1234
Copy link
Contributor

per1234 commented Jul 1, 2022

Thanks for your report @jamsyogendra.

I see we have another report about this problem of the library producing collisions due to the use of very common names at #315.

It is best to have only a single issue per subject so we can consolidate all relevant discussion to one place. Even though your issue came first, that one has more information so I will close this in favor of the other.

If you end up with additional information to share, feel free to comment in the other thread.

@per1234 per1234 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 1, 2022
@per1234 per1234 added type: imperfection Perceived defect in any part of project conclusion: duplicate Has already been submitted topic: code Related to content of the project itself labels Jul 1, 2022
@aentinger
Copy link
Collaborator

As long as there are defines in header files you will eventually have name collisions. Turn them into constants, put them behind a namespace. Now nearly everything is solved. Alas it's supposed to be "too complicated" for the average user ... Anyway, the child has fallen into the fountain already, there are gazillions of libraries that do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: duplicate Has already been submitted topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

3 participants