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

Compile errors using Arduino in Windows #73

Closed
xoseperez opened this issue Feb 17, 2017 · 31 comments
Closed

Compile errors using Arduino in Windows #73

xoseperez opened this issue Feb 17, 2017 · 31 comments

Comments

@xoseperez
Copy link
Owner

Originally reported by: Ido (Bitbucket: Guru_shastri, GitHub: Unknown)


Hi,
I've tried following your instructions, but its not easy.
in the compiling stage i'm getting an error msg:

Arduino: 1.6.12 (Windows 10), Board: "Generic ESP8285 Module, 80 MHz, 115200, 1M (128K SPIFFS)"

In file included from sketch\config/all.h:6:0,

             from C:\Users\Ido\AppData\Local\Temp\untitled2112280827.tmp\sketch_feb17a\espurna\espurna.ino:23:

C:\Users\Ido\AppData\Local\Temp\untitled2112280827.tmp\sketch_feb17a\espurna\button.ino: In function 'void buttonSetup()':

sketch\config/hardware.h:67:33: error: 'BUTTON_PUSHBUTTON' was not declared in this scope

 #define BUTTON1_MODE        BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH

and it goes on like that, it seems that the button1_mode is not properly defined. what am i missing?
thanks for all your work!

@xoseperez
Copy link
Owner Author

BUTTON_PUSHBUTTON is declared in the DebounceEvent library. Check if you have it installed (https://bitbucket.org/xoseperez/debounceevent).

@xoseperez
Copy link
Owner Author

Original comment by Ido (Bitbucket: Guru_shastri, GitHub: Unknown):


i think i got it installed, i think if i didn't i'd get a message about the #include <DebounceEvent.h> line.
i can also see it in the arduino sketch>include library menu.

I've opened the DebounceEvent.h file, don't see a declaration there of the BUTTON_PUSHBUTTON.

@xoseperez
Copy link
Owner Author

My bad, I forgot to update the ZIP link to the 1.1.0 version of DeboounceEvent library.
Please update your library with this zip file: https://bitbucket.org/xoseperez/debounceevent/get/1.1.0.zip

@xoseperez
Copy link
Owner Author

Original comment by Ido (Bitbucket: Guru_shastri, GitHub: Unknown):


thanks!
that got me over that bump...unfortunately i got this error now:
Arduino: 1.6.12 (Windows 10), Board: "Generic ESP8285 Module, 80 MHz, 115200, 1M (128K SPIFFS)"

C:\Users\Ido\AppData\Local\Temp\untitled2112280827.tmp\sketch_feb17a\espurna\relay.ino: In function 'bool relayStatus(unsigned char, bool, bool)':

relay:145: error: 'relayDomoticzSend' was not declared in this scope

         relayDomoticzSend(id);

                             ^

exit status 1
'relayDomoticzSend' was not declared in this scope"

i'm probably not activating something..

@xoseperez
Copy link
Owner Author

Weird, that method is defined in the same file, albeit a few lines below. You are using Arduino IDE, right?

@xoseperez
Copy link
Owner Author

Original comment by Ido (Bitbucket: Guru_shastri, GitHub: Unknown):


yes

@xoseperez
Copy link
Owner Author

Original comment by Ido (Bitbucket: Guru_shastri, GitHub: Unknown):


I've cancelled the domoticz option from the arduino.h file, everything else seems to compile ok.
its just the domoticz thing...
i tried moving the functions around and just got other kinds of errors. i'm lost here.

@xoseperez
Copy link
Owner Author

Don't have access to a W10, but I just tried on W7 with and Arduino IDE fresh install and everything compiled fine.
Maybe you could add a prototype definition for that function in the prototypes.h file.

@xoseperez
Copy link
Owner Author

Original comment by Ido (Bitbucket: Guru_shastri, GitHub: Unknown):


what did you activate in the arduino.h file?

because i tried compiling thru win7 - and got the same relayDomoticzSend error msg as in win10.
that happens when i compile with the #enable_domoticz.

without the domoticz it compiles just fine.

@xoseperez
Copy link
Owner Author

Only the target board.

Can you test it adding this line to the code/espurna/config/prototype.h file?

void relayDomoticzSend(unsigned int relayID);

@xoseperez
Copy link
Owner Author

Original comment by Ido (Bitbucket: Guru_shastri, GitHub: Unknown):


Hi

i've downloaded the newest version of the files, tried to compile again with the line you told me to add.
getting this now:
Arduino: 1.8.0 (Windows 10), Board: "Generic ESP8266 Module, 80 MHz, 40MHz, DIO, 115200, 512K (64K SPIFFS), ck, Disabled, None"

sketch\espurna.ino.cpp.o: In function `relayWS()':

D:\ido\Downloads\xoseperez-espurna-6ed59b537532\xoseperez-espurna-6ed59b537532\code\espurna/button.ino:53: undefined reference to `relayDomoticzSend(unsigned int)'

sketch\espurna.ino.cpp.o: In function `relayStatus(unsigned char, bool, bool)':

D:\ido\Downloads\xoseperez-espurna-6ed59b537532\xoseperez-espurna-6ed59b537532\code\espurna/button.ino:53: undefined reference to `relayDomoticzSend(unsigned int)'

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Generic ESP8285 Module.

@xoseperez
Copy link
Owner Author

Wow, that's the same reference somewhere else. Did you copy the line in the prototype.h file?

Also, in the beginning it says "Generic ESP8266 Module" but at the end it is a "Generic ESP8285 Module" ???

BTW, if you want to use the web interface with current version of ESPurna you will need more than 64Kb of flash for the SPIFFS partition. If your board has only 512Kb you won't we able to fit the web in it. With next release you will be able to embed the web interface in the firmware and everything will fit in 512Kb (no OTA thou), but right now it's not possible.

@xoseperez
Copy link
Owner Author

Original comment by Ido (Bitbucket: Guru_shastri, GitHub: Unknown):


I did.
That is very weird indeed.
I want to be able to connect the sonoff to my domoticz,
Could you upload the arduino.h file I should be using? Or at least the list of lines I should trigger.

As for the board properties, I'll update them and try again later.
Thanks again!

@xoseperez
Copy link
Owner Author

I cannot reproduce the error using Windows 7 and Arduino 1.8.0 or 1.8.1.

My guess is that there is something that prevents the builder from generating the prototypes for the methods in the files. Can anyone facing this issue attach the preprocessed sketch. It should be in C:\Users\--your_username--\AppData\Local\Temp\arduino_build_-- and 6 digits--\sketch\espurna.ino.cpp

@xoseperez
Copy link
Owner Author

Original comment by Ido (Bitbucket: Guru_shastri, GitHub: Unknown):


that is my arduino.h filie looks like. is it ok?

//--------------------------------------------------------------------------------
// These settings are normally provided by PlatformIO
// Uncomment the appropiate line(s) to build from the Arduino IDE
//--------------------------------------------------------------------------------

//--------------------------------------------------------------------------------
// General
//--------------------------------------------------------------------------------

//#define DEBUG_PORT Serial

//--------------------------------------------------------------------------------
// Hardware
//--------------------------------------------------------------------------------

//#define D1_RELAYSHIELD
//#define NODEMCUV2
//#define SONOFF
#define SONOFF_TH
//#define SLAMPHER
//#define S20
//#define SONOFF_SV
//#define SONOFF_POW
//#define SONOFF_DUAL
//#define SONOFF_4CH
//#define ESP_RELAY_BOARD
//#define ECOPLUG
//#define WIFI_RELAY_NC
//#define WIFI_RELAY_NO
//#define MQTT_RELAY
//#define WIFI_RELAYS_BOARD_KIT

//--------------------------------------------------------------------------------
// Features (values below are non-default values)
//--------------------------------------------------------------------------------

#define ENABLE_DHT 1
#define ENABLE_DS18B20 1
//#define ENABLE_EMON 1
//#define ENABLE_HLW8018 1
//#define ENABLE_RF 1
#define ENABLE_FAUXMO 0
//#define ENABLE_NOFUSS 1
#define ENABLE_DOMOTICZ 0

@xoseperez
Copy link
Owner Author

Found!

Can you test changing the file code/espurna/relay.ino, line 149 to:

#if ENABLE_DOMOTICZ

(changing the #ifdef by #if)

Thank you!

@xoseperez
Copy link
Owner Author

Original comment by Ido (Bitbucket: Guru_shastri, GitHub: Unknown):


I'll try it.
What I have tried already is changing the 0 to 1 in the last line of the arduino.h file. The line of the enable_domoticz.
After that the compiling went thru OK. Does that makes sense?

@xoseperez
Copy link
Owner Author

Yes it does. If you change the line I said you will be able to build it without Domoticz support too.

@xoseperez
Copy link
Owner Author

Original comment by Ido (Bitbucket: Guru_shastri, GitHub: Unknown):


But I'll still be able to work with domoticz?

@xoseperez
Copy link
Owner Author

The firmware supports domoticz by default. If you uncomment the

#define ENABLE_DOMOTICZ 0

it will build it without support.

@xoseperez
Copy link
Owner Author

Original comment by Ido (Bitbucket: Guru_shastri, GitHub: Unknown):


I see. So I've made a mess. I could've just ignore that domoticz line and I would get what I wanted.
Thank you very much!

@xoseperez
Copy link
Owner Author

Original comment by Ido (Bitbucket: Guru_shastri, GitHub: Unknown):


i've managed to flash the device ok.
plugged it to the electric, LED waving blue. connected to the new network that was created, tried accessing the espurna.local, and i'm getting error 404.
tried 192.168.4.1, getting the same error.

@xoseperez
Copy link
Owner Author

Did you flash the filesystem image too? https://bitbucket.org/xoseperez/espurna/wiki/Filesystem.md

@xoseperez
Copy link
Owner Author

Original comment by Ido (Bitbucket: Guru_shastri, GitHub: Unknown):


got it. works now. thanks.

@xoseperez
Copy link
Owner Author

Great. Will release 1.6.5 with these changes very soon.

@xoseperez
Copy link
Owner Author

Fixed with version 1.6.5

@xoseperez
Copy link
Owner Author

Original comment by Ido (Bitbucket: Guru_shastri, GitHub: Unknown):


Didn't have much time play with it yet, but after changing the password I seem to be locked out of the device. Is there a hard reset functionality (long press on the button or something) or do I need to flash it again?

@xoseperez
Copy link
Owner Author

Original comment by f-fish (Bitbucket: f-fish, GitHub: Unknown):


On terminal / usb -

#!arduino

set adminPass 1234ABcd

Should allow you to log on again.

Later Ferdie

@xoseperez
Copy link
Owner Author

Original comment by Ido (Bitbucket: Guru_shastri, GitHub: Unknown):


I'm sorry. This is just to hard.
I've managed to connect to device (one time) changed passwords and so on, since then I'm locked out. It's connecting to my router, but I have no access to it.
After connecting to the WiFi I just don't get the password screen again.
Tried flashing again - didn't work. I think I need to format it first somehow...
Can't this be a little more like esp easy?

@xoseperez
Copy link
Owner Author

There is no hard reset and I realise it's a needed feature. You will have to connect via serial and change the password like @F-Fish says. Right now there is no other way. I'm sorry.

@xoseperez
Copy link
Owner Author

Added issue #87 to implement hard-reset option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant