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

installation and options #1

Closed
hycday opened this issue Feb 16, 2019 · 8 comments
Closed

installation and options #1

hycday opened this issue Feb 16, 2019 · 8 comments

Comments

@hycday
Copy link

hycday commented Feb 16, 2019

hi,

planning on getting a LYT8266, and saw your library.
before buying it, i am studying the options i have.
I like your list of features, it actually looked exactly like what I wanted.
however, i am not sure of what to do with your library... this is "only" the firmware ?
how to install it ?
how to use it to do a "sunrise" effect ? (the "poll webserver" option is the deal i guess)
will it be possible to link it with blynk so that i can control the lamp bulb with blynk instead of the web app ?
what software to send to the arduino ?

thanks for your help !

@pmoscetta
Copy link

@Torxgewinde
Copy link
Owner

Torxgewinde commented Feb 19, 2019

Hi,
Yes, this project is the Arduino sourcecode so you can compile a binary. This binary is a file that can be copied (aka flashed) to the LYT8266 lamp. It makes use of several libraries that can be selected in the Arduino-IDE (the Program), but this project is not a library itself. A library normally is focused on being reusable in other projects, while this project here combines everything to resemble a more or less useful software for the LYT8266 lamp.

To install you need the programming cable that can be purchased from Authometion as well. Other programmers could also be used as long as they provide the same electrical signals. The maximum voltage is important, it should not exceed 3.3V. Also, if you consider purchasing from Authometion they will provide a connector that fits the socket on the LYT8266 lamp. Without that connector it is a bit difficult to establish electrical contact. From within the Arduino-IDE you can then upload (=copy) the binary to the little flash-storage inside the LYT8266 lamp. Once the binary was copied subsequent transfers can also be done via WiFi once the lamp successfully connects to your WiFi. See the video from the Readme.md file, it shows how the firmware is compiled and flashed. Also, you can see the serial to USB converter used to flash the device.

To create a sunrise effect you can either change the firmware and implement such a feature. This requires some experience but is a rewarding experience. Also, once done and debugged you can share your sourcecode with others so they participate from the fruits of your work.

Alternatively you can remote control the LYT8266 from a home automation server. Many people like FHEM, OpenHAB, Homeassistant, NodeRed and many more. Those automation servers can send a HTTP request to the LYT8266 and set the color that way.

There is a strong trend for opensource projects to use MQTT protocol to control several little networking enabled devices at home. The matching buzzword is IoT and MQTT is definitely a protocol to consider for such a task. It is well supported by truly open homeautomation-servers. MQTT was not implemented for this firmware.

As the origin for this project was a light that was not installed in my home, but at a remote location without a homeautomation server, I decided the LYT8266 can query an internet server every minute. Contacting a server was necessary anyway to retrieve the current time, so I thought why not polling the server for the desired colors. This enables me to change the code for the color by changing the program that runs at the server and this way I can react to new wishes for the remote LYT8266 once the owners tell me on the phone. Polling a server is not the best approach, but it is easy to grasp.

I haven't looked into Blynk, so I cannot say how that works in detail.

I hope that already gives a good overview, just ask away if you like to know more.

Kind regards,
Tom

@hycday
Copy link
Author

hycday commented Feb 20, 2019

thanks a lot for the info Tom !

so i guess your library is compatible with what i had in mind :)
i will buy the bulb + the cable to update the firmware to yours.
then i will point out the bulb to my server to get info about the time and about the color to display for sunrise (i can share some code of course), but i will extend the logic to : get update from server to get sunrise time, stop checking server until sunrise, when sunrise comes, update colors ever 20seconds by fading.
I only need to understand, this code, it will need to be another library ? i.e. i still dont get the files that are the firmware, and the files that are an example code.

also, there is no clock in the LYT8266 ? that would highly ease up the code :/

pmoscetta, thanks for the link for Blynk, will check it out

@hycday
Copy link
Author

hycday commented Feb 20, 2019

also, the LYT8266 Programming cable kit is out of stock :( if you know where i can find another one (Europe) at a reasonable price, lmk :)

@pmoscetta
Copy link

You can try from our Switzerland distributor: https://www.play-zone.ch/en/authometion-lyt8266-programming-cable-kit.html

@hycday
Copy link
Author

hycday commented Feb 21, 2019

You can try from our Switzerland distributor: https://www.play-zone.ch/en/authometion-lyt8266-programming-cable-kit.html

Fr.21.06 of delivery fee, thats too much :( i will find a way no worries

@Torxgewinde
Copy link
Owner

Hello hycday,
all the *.ino files are the firmware. When clicking the checkmark-button or the upload button the Arduino IDE will join all the *.ino files together, create temporary files for the compiler and compile the firmware image. This project is not a library but can be used as a start to write your own firmware. I found it easier to separate the firmware into several *.ino files, but I agree that this seems to be uncommon for typical Arduino-projects. Each files is dedicated to a certain topic, one for example deals with the WiFi topics, another one deals with the LED topics. To have them in a certain order in the tabs, I named the *.ino files so that they are sorted how I liked it.

The ESP8266 does not have an internal clock, true. Due to this, the LYT8266 needs to query a server to get the time. This is the reason why I started to poll the time and desired color anyway from an internet-server. Alternatively there is a NTP library for ESP that might be useful in your scenario. To use it you need to install it and then make use of it by adding the include statement in your code.

Kind regards,
Tom

@Torxgewinde
Copy link
Owner

Closing as I assume issues are sorted. Please reopen if not.

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

No branches or pull requests

3 participants