probonopd / ESP8266HueEmulator

Emulate a Philips Hue bridge running on an ESP8266 using the Arduino IDE.
MIT License
411 stars 93 forks source link

First iteration of SPIFFS support #93

Closed Quanghoster closed 7 years ago

Quanghoster commented 7 years ago

Added functionality to store Groups and Scenes into files. Scene support requires further work to be usable at the moment, but Groups seem to work. I have also added some addition Json structures as seen in the API. Some of these are currently hard coded and, again, require some further work

Quanghoster commented 7 years ago

Note the addition of the data folder with a simple readme file in it. I use this to remove the cached group and scene files from the filesystem using the Arduino IDE "ESP8266 sketch data upload" plugin.

probonopd commented 7 years ago

Thanks @Quanghoster. For this to be able to be merged, please fix the

LightService.cpp:10:16: fatal error: fs.h: No such file or directory

If required, you may also need to edit the .travis.yml file that controls library installation and compilation.

Quanghoster commented 7 years ago

@probonopd , it looks like the ESP8266 version you are using doesn't have SPIFFS support? Is it possible to upgrade it? I'm using the github version

probonopd commented 7 years ago

Yes, you may also need to edit the .travis.yml file.

Quanghoster commented 7 years ago

Slight problem - I've updated the travis build to install the esp8266 support from GitHub but it looks like there is an issue with https://raw.githubusercontent.com/adafruit/travis-ci-arduino/master/install.sh also installing board support. Need to look into an updated copy of that I would guess to not install the board support and, possibly a new version of Arduino IDE

Quanghoster commented 7 years ago

I'm hoping this build will now pass. I've added travis to my fork so that I can test on my repo if more needs doing to this...

Quanghoster commented 7 years ago

Having issues with updating the build scripts and getting lots of error when it compiles the examples. Will try and resolve on a vm later On 21 Nov 2017 21:50, probonopd notifications@github.com wrote:Yes, you may also need to edit the .travis.yml file.

—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.

Quanghoster commented 7 years ago

I've spend quite a while looking in to travis, but just figured out that the file name may just be a case issue as I built on windows. I have have travis working on my repo so I can do a CI build before sending a PR. The only thing that remains is the about conflict which I created renaming parameters to match for the early function declaration. The older version of arduino seems to not like this where as the 1.8.5 is ok with it. Can you take a @probonopd , can you look at and resolve this conflict? If so I'm hoping the build should be now successful. Thanks.

Quanghoster commented 7 years ago

Err, ok - I've resolved the conflict but seems git still sees a conflict in whitespace....lol. I'll leave it with you to deal with as I don't think I can do any more now. It's been a bit of a learning curve for me with travis. I learnt a lot from it, but in the end it seems just difference between build environments. Hopefully I should not be able to resolve these things before I get to a PR with travis now running on my fork :-)

probonopd commented 7 years ago

Yay, last build succeeded.

Scene support requires further work to be usable at the moment I have also added some addition Json structures as seen in the API. Some of these are currently hard coded and, again, require some further work

Is this still the case?

Quanghoster commented 7 years ago

This code saves the scene config and restores it but, unlike the group implementation I haven't found an app that sees the restored scene, but it should work the same way as before otherwise. I will continue to work on over the next few days On 25 Nov 2017 09:18, probonopd notifications@github.com wrote: Scene support requires further work to be usable at the moment I have also added some addition Json structures as seen in the API. Some of these are currently hard coded and, again, require some further work

Is this still the case?

—You are receiving this because you modified the open/close state.Reply to this email directly, view it on GitHub, or mute the thread.

probonopd commented 7 years ago

Alright. Please let me know when you think it is time to merge this. Thank you!

Quanghoster commented 7 years ago

I think you can go ahead and merge now as the scenes work as before with the addition of saving the json to a file and restore on boot. This will will add the group persistence capability and a REST command and link on the new web page to clear the file cache which would be useful.