zbx-sadman / zabbuino

Zabbix agent for Arduino
93 stars 15 forks source link

'OneWire' was not declared in this scope #4

Closed StarT3 closed 8 years ago

StarT3 commented 8 years ago

Thanks for your work, it seems to combine everything needed.

While checking in Arduino IDE 1.6.12 i'm getting error:

busOneWire:259: error: 'OneWire' was not declared in this scope uint8_t getScratchPadFromDS18X20(OneWire _ow, const uint8_t _addr, uint8_t _scratchPad) It doesn't matter if i disable or enable OneWire feature. I've tried several OneWire libraries with no effect. What OneWire library version should be used?

zbx-sadman commented 8 years ago

So strange. I just download stable release (master branch) , and allow following features:

#define FEATURE_OW_ENABLE
#define FEATURE_DS18X20_ENABLE
#define FEATURE_EEPROM_ENABLE
#define FEATURE_DEBUG_COMMANDS_ENABLE
#define FEATURE_DEBUG_TO_SERIAL
#define GATHER_METRIC_USING_TIMER_INTERRUPT

Compile Zabbuino:

Using library Ethernet at version 1.1.2 in folder: C:\Program Files (x86)\Arduino\libraries\Ethernet 
Using library SPI at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI 
Using library Wire at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire 
Using library OneWire at version 2.3 in folder: C:\Users\sadman\Documents\Arduino\libraries\OneWire 
Using library EEPROM at version 2.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM 

Sketch uses 19,534 bytes (63%) of program storage space. Maximum is 30,720 bytes.
Global variables use 975 bytes (47%) of dynamic memory, leaving 1,073 bytes for local variables. Maximum is 2,048 bytes.

I have installed Arduino IDE 1.6.11 (for new release development), but early (on 1.5.x, 1.6.x) i just use default Arduino's OneWire library and haven't any problem.

I will try to install latest IDE and compile source at tommorow.

zbx-sadman commented 8 years ago

I quickly checked compilation on 1.6.12. No problem found:

Using library Ethernet at version 1.1.2 in folder: C:\Program Files (x86)\Arduino\libraries\Ethernet 
Using library SPI at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI 
Using library Wire at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire 
Using library OneWire at version 2.3 in folder: C:\Users\sadman\Documents\Arduino\libraries\OneWire 
Using library EEPROM at version 2.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM 

Sketch uses 19,534 bytes (63%) of program storage space. Maximum is 30,720 bytes.
Global variables use 975 bytes (47%) of dynamic memory, leaving 1,073 bytes for local variables. Maximum is 2,048 bytes.
StarT3 commented 8 years ago

Ok, seems to be IDE issue. Just installed Arduino IDE 1.6.12 on Windows, downloaded master branch, added Adafruit max31850 onewire library. And it compiled without any errors. (no changes were made to code at all, no feature list changes, just downloaded and unzipped). But on Mac OS 10.12 with same IDE, same library and same code - error. Will use Windows for that sketch.