Skip to content

bofh69/AiLight

 
 

Repository files navigation

Build Status

This is a fork of AiLight that sets the lamp's colour from the results from holfuy weather stations.

Status

The code works, but it is a bit rough.

Setup & Building

Prerequisites

Install atom and within atom install the platformio-ide plugin.

Platformio can also be installed without Atom. Install python (2.7) and run:

pip install -U platformio

The project's web pages are packaged with gulp, it is done automatically when the platformio builds the project, but needed modules needs to be installed.

Install npm (it also comes with node.js).

In the project folder run:

npm update
npm install -g gulp-cli
npm install

Copy platformio.exmaple.ini to platform.ini and update it as needed. Copy src/config.example.h to src/config.h and update it as needed.

Building the project.

Open the project's dir in Atom and build it via the platformio-ide plugin or build it on the commandline with:

platformio run -e dev-ota

The firmware can be build and uploaded over the air. To do so chose "Run other target..." and "PIO Upload (dev-ota)" or on the command line:

platformio run -e dev-ota -t upload

Development & Testing

While developing, it is a good idea to always startup with the new module disabled. If the code crashes the OTA functionality will stop as well, forcing you to upload via a cable which can be a PIA.

In main.ino there is a setup function. After EEPROM_read(cfg); add:

  cfg.holfuy_enabled = false;

You have to turn it back on after each restart, but you're less likely to brick the device.

If you want any custom settings while developing, put them in src/config.h.

This bash command is used to simulate the response from a holfuy server:

while true; do
  echo -e 'HTTP/1.1 200 OK\r\n\r\n101,TestStation,'`date -I`,`date +%H:%M:%S`',3,4,m/s,10,20.1,C,56.8,1019,0 ' |
  sudo nc -n -vvv -l -p 80
done

Web development

If you want to serve the web pages localy, you have to build a css file:

gulp css

If you want to add more icons to the page, build a new font with Icomoon The current icons are from the Typicons set.

Credits and License

The AiLight Firmware is open-sourced software licensed under the MIT license. For the full copyright and license information, please see the file that was distributed with this source code.

Packages

No packages published

Languages

  • C++ 62.5%
  • JavaScript 17.2%
  • HTML 13.6%
  • CSS 4.5%
  • C 1.7%
  • Python 0.3%
  • Shell 0.2%