henryk / openmili

Open implementation of the Mi-Light 2.4GHz LED light control protocol
GNU General Public License v3.0
105 stars 33 forks source link

Execution problems #13

Open john1158way opened 4 years ago

john1158way commented 4 years ago

So far I have:

Connected Arduino to an nRF24L01+ and validated the connectivity using the helpful information and code in the link below.

Re: Simple nRF24L01+ 2.4GHz transceiver demo https://forum.arduino.cc/index.php?topic=421081.15

I then installed the Arduino code and added the libraries required by the sketch. note:downloading all the files into a folder named openmili is a requirement

I changed pins for CE and CSN definition to 9 and 10 respectively as that was the proven combination from the nRF24L01 tutorials referenced above

I ran the python script and found the error serial not defined and resolved that by installing pyserial. note:the script runs in python 2 and you have to install pyserial for your python 2 install as the defaults are now all to python3. if you need to run python 3 other issues will point you to some required changes to the python code

I started the arduino and checked the serial monitor showed the program starting I started python and it said the serial port was busy so had to exit the serial monitor I restarted the python script and it showed the start up message

I am stuck. I did not buy a remote or a bridge and I need to pair the light with the emulator and do not know process

john1158way commented 4 years ago

I have also loaded the gateway code that utilizes Henryk's code but has everything in an all Arduino sketch that does not require the python code it is at https://github.com/madnerdorg/openlight I ran it on two arduino's and if i force some sends into one they register on the other so communication is ok via radios really think i am down to figuring out the paring command to get the bulb communicating. if anyone has a pointer to good documentation on this it would be great

john1158way commented 4 years ago

still struggling to pair. I have now started to analyze the code in an ESP8266 implementation of the hub to work out paring found here https://github.com/sidoh/esp8266_milight_hub/wiki/Pairing-new-bulbs

Instructions Choose a Device ID arbitrarily and pair your device with it following these instructions:

Power off the bulb or lighting device. If it's a bulb, it's best to remove it from the socket entirely. Enter your chosen Device ID into the "Device ID" field in the UI. Choose a Group ID to pair with. Supply power to the bulb or lighting device. Within five seconds, click on the "Pair" button in the UI. The light should flash on and off a few times to indicate success. Appendix: Directionality Except for some corner cases that can mostly be ignored (see #91), bulbs never communicate back to the hub. Pairing can therefore be thought of as assigning a Device ID to a lighting device, rather than a two-way handshake.

john1158way commented 4 years ago

I do not have access to my hardware this weekend so continuing research into other arduino milight solutions and came across this site that claims to have used Henryk's work to create beginner friendly clode. http://fablab.ruc.dk/controlling-the-mi-light-from-arduino/

among other informaiton It included a reference to a raspberry pi implementation https://www.torsten-traenkner.de/wissen/smarthome/openmilight.php it made the point more clear about the need to repeat the command to get any reliablity with 30 times being the default number In my earlier experiments with having 2 arduinos on the commands were only being sent once.

john1158way commented 4 years ago

well I was looking at the milight gateway project by Chris Mullins https://blog.christophermullins.com/2017/02/11/milight-wifi-gateway-emulator-on-an-esp8266/ the project sent me on detour to use platformio instead of Arduino IDE and I haven't really moved on.