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

Sonoff-pow-debug build failure (HW8012.h missing) #10

Closed
xoseperez opened this issue Dec 2, 2016 · 16 comments
Closed

Sonoff-pow-debug build failure (HW8012.h missing) #10

xoseperez opened this issue Dec 2, 2016 · 16 comments

Comments

@xoseperez
Copy link
Owner

Originally reported by: Jean-Luc A. (Bitbucket: cnxsoft2016, GitHub: Unknown)


Building with "run -e sonoff-pow-debug" end with:

#!arduino

Compiling .pioenvs/sonoff-pow-debug/FrameworkArduino/Stream.o
/media/hdd/edev/esp8266/sonoff/espurna/code/src/pow.ino:13:21: fatal error: HLW8012.h: No such file or directory
#include <HLW8012.h>
^
compilation terminated.

It looks like hlw8012 library is not installed automatically even though https://bitbucket.org/xoseperez/hlw8012.git is listed in platformio.ini

@xoseperez
Copy link
Owner Author

I just test it and it worked.
Can you remove the library and run the builder again? (check the library has been removed)

pio lib uninstall hlw8012
ls -la .piolibdeps/
pio run -e sonoff-pow-debug

@xoseperez
Copy link
Owner Author

Original comment by Jean-Luc A. (Bitbucket: cnxsoft2016, GitHub: Unknown):


Thanks for the prompt reply. I've done that, hlw8012 actually installs properly but the error remains the same.

See pastebin with all three commands output @ [http://pastebin.com/YTqrcuJS](Link URL)

Do I need to configure the path for the lib somewhere?

Update: I've tried another Ubuntu 16.04 computer, and the result is the same. node-debug builds fine by the way.

@xoseperez
Copy link
Owner Author

Original comment by Jean-Luc A. (Bitbucket: cnxsoft2016, GitHub: Unknown):


Finally I found a workaround -> platformio/platformio-core#672 (comment)

I added <HLW8012.h> in src/main.ino, and the build could complete:

#!arduino


#include <Arduino.h>
#include "config/all.h"
#ifdef SONOFF_POW
#include <HLW8012.h>
#endif

I guess it's not a proper fix though...

@xoseperez
Copy link
Owner Author

Original comment by Jean-Luc A. (Bitbucket: cnxsoft2016, GitHub: Unknown):


I think it's a PlatformIO bug, so I mark it as invalid.

@xoseperez
Copy link
Owner Author

Have you tested turning on deep scanning, as Ivan suggests? Can't see a reason why this would not work for HLW2012.h but it would for NtpClientLib.h, which is also included from an included file... Still, I can't reproduce the issue so I cannot test the different options...

@xoseperez
Copy link
Owner Author

Original comment by Jean-Luc A. (Bitbucket: cnxsoft2016, GitHub: Unknown):


I had seen that, but I can't find any "deep search" lib_dfcyclic option in platformIO. The bug was filed for 2.x, I'm using 3.x:

#!arduino

pio --version
PlatformIO, version 3.2.0b5

I've tested it on three different Ubuntu 16.04 machines by the way. All three have that issue.

@xoseperez
Copy link
Owner Author

Original comment by Jean-Luc A. (Bitbucket: cnxsoft2016, GitHub: Unknown):


FYR. this happens with the latest firmware too, but this time I had to edit espurna.ino, and add:

#!arduino

#ifdef SONOFF_POW
#include <DebounceEvent.h>
#include <fauxmoESP.h>
#include <HLW8012.h>
#endif

in order to complete the build.

Update, after running:

#!arduino

platformio upgrade
platformio platform update

The problem is gone, and no need to edit espurna.ino.

@xoseperez
Copy link
Owner Author

It makes no sense this is only failing for the POW, the DebounceEvent and fauxmoESP libraries are common to all builds. You said that after running upgrade & update there is no need to modify the espurna.ino file?

@xoseperez
Copy link
Owner Author

Original comment by Jean-Luc A. (Bitbucket: cnxsoft2016, GitHub: Unknown):


Sorry, for the latest firmware, I did not try the others only POW, and I had to add the new header files manually in the ino file. So I guess it failed for all builds.

But anyway, once I update platformio, there is no need to modify espurna.ino, and the build works. So this confirms this was a platformio issue.

@xoseperez
Copy link
Owner Author

Original comment by sjp770 (Bitbucket: sjp770, GitHub: sjp770):


Where can i download DebounceEvent.h? I need it for your sonoff SC build.

@xoseperez
Copy link
Owner Author

This is the repo: https://bitbucket.org/xoseperez/debounceevent

If you just need the library you can download it as a ZIP and install it from the Arduino IDE: https://bitbucket.org/xoseperez/debounceevent/get/1.0.0.zip

@xoseperez
Copy link
Owner Author

Original comment by sjp770 (Bitbucket: sjp770, GitHub: sjp770):


Thanks, that worked to allow me to flash through the Arduino IDE but it
didn't seem to upload the webpages. I get the author challenge at
192.168.4.1 but it won't load. Is there a different program I should upload
from? And any tips on how to flash the sonoff sc's atmega chip - which
software and or settings?

@xoseperez
Copy link
Owner Author

You have to upload the filesystem image too. Check the "Install the SPIFFS uploader" and "Flashing the filesystem" sections in this wiki page: https://bitbucket.org/xoseperez/espurna/wiki/ArduinoIDE.md

@xoseperez
Copy link
Owner Author

Original comment by sjp770 (Bitbucket: sjp770, GitHub: sjp770):


Thanks, this worked well. I still can't get the atmega328p to flash - what
board type and programmer should I use?

@xoseperez
Copy link
Owner Author

You can use a standard USB2UART board with an FTDI chip, for instance. Remove the two jumpers that connect the two controllera.

But, please. This conversation is not related to ESPurna. You can open an issue in my SonoffSC repo. It certainly needs better documentation.

@xoseperez
Copy link
Owner Author

Original comment by sjp770 (Bitbucket: sjp770, GitHub: sjp770):


Thanks, will do as that wasn't working.

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