arduino-libraries / ArduinoIoTCloud

Home Page:https://app.arduino.cc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why RBDimmer Lib. not capable with Arduino Iot cloud LIB

jamsyogendra opened this issue · comments

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 

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

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

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.

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.