bren1818 / TCPLightingWebInterface

Web App interface to control the "Connected by TCP" bulbs
MIT License
30 stars 15 forks source link

Using Bulbs with Remote Only? - 601rcw #17

Open gotminer opened 4 years ago

gotminer commented 4 years ago

Is there a way to connect bulbs to a zone on the remote and eliminate the gateway altogether? I saw someone mention it, but I never found any instructions.

I've been using my system with the remote only since the app stopped working, but I recently had a power outage at my house and it caused more than half of my bulbs to reset. The remote still works with one set of bulbs in one lighting fixture, but the other three fixtures just flash when I flip the light switch on the wall. At this point my preference would be to pair the bulbs with my remote and not use the gateway at all.

I've attempted to use the web interface with XAMPP, but I'm still getting a connection refused error when I enter the IP into a browser. Not sure where to go from here in terms of the web interface. I edited the config.inc.php file with the IP address of the gateway, pressed the sync gateway button on the gateway, but always get a connection refused error in my browser.

bren1818 commented 4 years ago

Two things to check.

  1. Make sure the machine you're running the app on doesn't have a firewall blocking traffic . (If your connecting not by localhost or on another device).

  2. If you're running the new xampp with php 7, you may need to uncomment line 39 in the include.php to specify a cipher.

The app should have pretty much all the functionality to create rooms, add or remove bulbs etc.

I recommend setting up a static ip for your bridge on your router so it doesn't change. You will need the tcp bridge since it is what connects to the lights.

You -> TCP App on webserver-> Bridge->Lights

One other thing you can try is delete the .htaccess file and see if it loads up then.

I'm AFK currently but can help more Monday if you can't get it to go

On Sat, Jan 18, 2020, 1:57 PM gotminer notifications@github.com wrote:

Is there a way to connect bulbs to a zone on the remote and eliminate the gateway altogether? I saw someone mention it, but I never found any instructions.

I've been using my system with the remote only since the app stopped working, but I recently had a power outage at my house and it caused more than half of my bulbs to reset. The remote still works with one set of bulbs in one lighting fixture, but the other three fixtures just flash when I flip the light switch on the wall. At this point my preference would be to pair the bulbs with my remote and not use the gateway at all.

I've attempted to use the web interface with XAMPP, but I'm still getting a connection refused error when I enter the IP into a browser. Not sure where to go from here in terms of the web interface. I edited the config.inc.php file with the IP address of the gateway, pressed the sync gateway button on the gateway, but always get a connection refused error in my browser.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bren1818/TCPLightingWebInterface/issues/17?email_source=notifications&email_token=AAQMEH2PADJJJ2BDV447VFDQ6NGJ7A5CNFSM4KIUSKY2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IHD56DA, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQMEH7UESZ7ZUV7TVLZHNLQ6NGJ7ANCNFSM4KIUSKYQ .

gotminer commented 4 years ago

I have tested with Windows Firewall Disabled and Enabled. There are no other firewalls on this machine. I can ping the gateway in both instances.

I am running XAMPP version 5.6.40.

I have deleted the .htaccess file.

Can the bulbs be put in discovery mode or whatever you call it when you flip the switch on-off-on-off-on-off-on to make them flash and then paired to a zone on the remote without using the gateway and web interface?

1

2

3

bren1818 commented 4 years ago

Ok so looking at your screen shot, you connect to the webserver ip in the browser, not your bridge ip. Try 127.0.0.1 or localhost or the ip of your computer in your browser. (You can figure that one out by opening command prompt and typing ipconfig and looking for the ipv4 address) Assuming xampp is running it should give you the landing page.

You need either the webapp or one of the mobile apps to program the lights / put them in rooms / groups. I believe I did include pdfs of the original product documentation with this project to help reset the bulbs if you need to.

On Sat, Jan 18, 2020, 3:00 PM gotminer notifications@github.com wrote:

I have tested with Windows Firewall Disabled and Enabled. There are no other firewalls on this machine. I can ping the gateway in both instances.

I am running XAMPP version 5.6.40.

I have deleted the .htaccess file.

Can the bulbs be put in discovery mode or whatever you call it when you flip the switch on-off-on-off-on-off-on to make them flash and then paired to a zone on the remote without using the gateway and web interface?

[image: 1] https://user-images.githubusercontent.com/44104559/72669664-be94f480-3a02-11ea-8662-2a8d4ac4e03a.JPG

[image: 2] https://user-images.githubusercontent.com/44104559/72669666-c2287b80-3a02-11ea-9853-2863ca13af75.JPG

[image: 3] https://user-images.githubusercontent.com/44104559/72669669-c48ad580-3a02-11ea-8ff9-55f0f149d5b4.JPG

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bren1818/TCPLightingWebInterface/issues/17?email_source=notifications&email_token=AAQMEHYHGJY3BETS367VAWLQ6NNXXA5CNFSM4KIUSKY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJKAY2A#issuecomment-575933544, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQMEH2UG72IFZKNQPWH2WTQ6NNXXANCNFSM4KIUSKYQ .

gotminer commented 4 years ago

Thanks so much for your help! I'm getting further than I was before. Apparently VMWare was using port 443 and preventing Apache from running. That part is working now, but when I type localhost or the ip of my machine into a browser I get the attached message.

What does it mean by "paste your token in the config.inc.php."? I don't see any instructions for this part.

4

gotminer commented 4 years ago

I do see where to paste the token, but I guess my question is where do I get the token? The wiki says to paste the code that is generated during the gateway sync, but I'm not sure where I'm supposed to see that code.

5

bren1818 commented 4 years ago

Assuming you have the ip correct for your bridge and you've pressed the sync button on the bridge, when you refresh the page it should grab and save the token automatically. The pasting is for an older setup.

You may have to uncomment (remove the //) on the line i mentioned earlier if it isn't getting the token. Also make sure that the php. Ini has curl enabled but xampp should have it correct by default.

On Sat, Jan 18, 2020, 6:40 PM gotminer notifications@github.com wrote:

I do see where to paste the token, but I guess my question is where do I get the token? The wiki says to paste the code that is generated during the gateway sync, but I'm not sure where I'm supposed to see that code.

[image: 5] https://user-images.githubusercontent.com/44104559/72672034-00816300-3a22-11ea-8fd2-33815b528357.JPG

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bren1818/TCPLightingWebInterface/issues/17?email_source=notifications&email_token=AAQMEHYMBQJ4JHQR7W53BQTQ6OHQBA5CNFSM4KIUSKY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJKEN6Q#issuecomment-575948538, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQMEH4IER6Y4IHICCWD7O3Q6OHQBANCNFSM4KIUSKYQ .

gotminer commented 4 years ago

Hmmm. I'm positive the bridge ip is correct.

I did uncomment line 39 in the include.php file and checked the php.ini file. It appears to have curl enabled. Still having the same issue though.

6

7

8

9

bren1818 commented 4 years ago

Everything looks right. You had mentioned this was running on a vm?

Are you able to access the bridge ip via https or ping it from command prompt?

On Sat, Jan 18, 2020, 7:11 PM gotminer notifications@github.com wrote:

Hmmm. I'm positive the bridge ip is correct.

I did uncomment line 39 in the include.php file and checked the php.ini file. It appears to have curl enabled. Still having the same issue though.

[image: 6] https://user-images.githubusercontent.com/44104559/72672314-29a3f280-3a26-11ea-98aa-e08b4e52be55.JPG

[image: 7] https://user-images.githubusercontent.com/44104559/72672315-2b6db600-3a26-11ea-9209-7c84654ebf44.JPG

[image: 8] https://user-images.githubusercontent.com/44104559/72672316-2dd01000-3a26-11ea-8f5e-5070d4b2e7bc.JPG

[image: 9] https://user-images.githubusercontent.com/44104559/72672318-2f99d380-3a26-11ea-81dd-ee9388094b24.JPG

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bren1818/TCPLightingWebInterface/issues/17?email_source=notifications&email_token=AAQMEH6SOX7D2XHJXSXGRTTQ6OLBNA5CNFSM4KIUSKY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJKE7DI#issuecomment-575950733, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQMEHY3VB4Q7J2VNTPISGDQ6OLBNANCNFSM4KIUSKYQ .

sktaylortrash commented 4 years ago

If this is XAMPP for Linux the web server doesn't have write permissions to the html directory by default. So it can't create tcp.token automatically. I've always just recommended creating the file manually and using chmod to set the permissions to 766 This should let the automatic token creation work properly

gotminer commented 4 years ago

It's not running on a vm. I just had VMWare workstation installed on this computer for something else and it was using port 443 for something. After I removed the software, Apache connected without an issue.

Yes I can ping the ip of the bridge from this pc. Can't access via https though.

It's XAMPP for Windows. I did give "everyone" full control of c:\xampp.

sktaylortrash commented 4 years ago

Odd, but it still couldn't hurt to try making a blank file called tcp.token

bren1818 commented 4 years ago

Odd. So in theory, if you go to https://{your bridge ip} you should get an invalid cert warning and then it resolve to a 403.

The lighting web app doesn’t necessarily need to be run on 443 (https) you can also access it on http

On Sat, Jan 18, 2020 at 8:05 PM gotminer notifications@github.com wrote:

It's not running on a vm. I just had VMWare workstation installed on this computer for something else and it was using port 443 for something. After I removed the software, Apache connected without an issue.

Yes I can ping the ip of the bridge from this pc. Can't access via https though.

It's XAMPP for Windows. I did give "everyone" full control of c:\xampp.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/bren1818/TCPLightingWebInterface/issues/17?email_source=notifications&email_token=AAQMEH2YC6GUBFJPYV6OAF3Q6ORO5A5CNFSM4KIUSKY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJKF23I#issuecomment-575954285, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQMEH47NP5M7H4UG56HJSDQ6ORO5ANCNFSM4KIUSKYQ .

gotminer commented 4 years ago

Yes, Bren. When I try to access the bridge ip via https, I get invalid cert and then a 403.

So I changed the lighting bridge port from 443 to 80 in the config.inc.php file and I get this ...

10

And then if I create a tcp.token file in htdocs folder, I get this ...

11

bren1818 commented 4 years ago

Really based on what you described, everything seems correct. The only two lines you would/should need to update are:

define("LIGTHING_BRIDGE_IP", "10.0.0.179"); // IP address of TCP Bridge/Gateway define("LIGHTING_BRIDGE_PORT",

define("LOCAL_URL", http://xamp-server-ip

Then once you refresh the page after tapping the sync button everything should be good. If not, the only thing I can think is perhaps the newer version of xampp is doing something odd or theres an update with php preventing it from writing the token.

I'll try downloading it and setting it up from scratch tomorrow when I'm in front of my desktop.

There may be logs you can check in an xampp sub directory

On Sat, Jan 18, 2020, 8:31 PM gotminer notifications@github.com wrote:

Yes, Bren. When I try to access the bridge ip via https, I get invalid cert and then a 403.

So I changed the lighting bridge port from 443 to 80 in the config.inc.php file and I get this ...

[image: 10] https://user-images.githubusercontent.com/44104559/72672977-67f2df00-3a31-11ea-84ec-2b41add95dd2.JPG

And then if I create a tcp.token file in htdocs folder, I get this ...

[image: 11] https://user-images.githubusercontent.com/44104559/72672983-7e993600-3a31-11ea-9b91-beb7d93de425.JPG

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bren1818/TCPLightingWebInterface/issues/17?email_source=notifications&email_token=AAQMEH4IKMWGDAX6T6MEXVTQ6OUQZA5CNFSM4KIUSKY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJKGIIY#issuecomment-575956003, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQMEHZKZD2CFYLU4ASUHATQ6OUQZANCNFSM4KIUSKYQ .

gotminer commented 4 years ago

What version of xampp would you suggest I go back to? I'm currently on 5.6.40.

bren1818 commented 4 years ago

I just downloaded 7.4.1 (latest) version of xammp. Did the standard install but skipped perl, sendmail.

Then stated xampp.

I then Deployed the application into the htdocs folder. Edited the config.inc setting my bridge ip to my bridge ip and the local url to the ip address of my server.

I navigated to the page and got a 500 telling me the .htaccess was problematic so I deleted that.

Refreshed the page and it prompts that it needs the token from the bridge, so I hit the sync button on the bridge and refreshed the page and viola, worked ok.

So perhaps download the latest xampp and try again. I only needed to edit two lines of the config.inc and removed the htaccess. No other changes were needed.

Good luck!

On Sun, Jan 19, 2020, 11:51 AM gotminer notifications@github.com wrote:

What version of xampp would you suggest I go back to? I'm currently on 5.6.40.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bren1818/TCPLightingWebInterface/issues/17?email_source=notifications&email_token=AAQMEH4EMFPHH3ND5Z5UGS3Q6SAK3A5CNFSM4KIUSKY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJKWZNA#issuecomment-576023732, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQMEHZP33EWTSLDUP34FLLQ6SAK3ANCNFSM4KIUSKYQ .

gotminer commented 4 years ago

So I just performed the exact same thing on a machine with a fresh install of Win10 and disabled the firewall.

Standard install of xampp 7.4.1 minus perl and sendmail.

Started xampp. Apache is the only thing running in the xampp control panel.

Deployed application to htdocs folder.

Edited the config.inc file with only what you mentioned above.

Navigated to the page and got the 500 error.

Deleted htaccess, refreshed page, and got the "if you are seeing this, you haven't generated your token yet" error.

Pressed the sync button on the bridge and refreshed page. Same token error.

This is my bridge. Power light on. Lan light off. Wan light red. Lan light is off but bridge ip is still pingable. Anything out of the ordinary here? Anything in my router config that could be causing a problem?

bridge

bren1818 commented 4 years ago

It's possible you need to restart the bridge, they can be fussy. Pull the power plug, let it sit off for a while and start it back up but otherwise I see no reason for you to have an issue unless your router has a built in firewall preventing your bridge to communicate which would be really odd.

Your LED indicator seems right. Mine has Wan lit up red, power illuminated and lan off too.

All I can suggest really is see if you can assign an ip to the bridge versus using dhcp (if you haven't already) this may give you a bit more control. Another option you can try is if you have another router , plug just your pc and the bridge into it. You'd need to update your config accordingly though for the new ips.

Not sure how much help I can be beyond this since each router is a bit different.

On Sun, Jan 19, 2020, 3:50 PM gotminer notifications@github.com wrote:

So I just performed the exact same thing on a machine with a fresh install of Win10 and disabled the firewall.

Standard install of xampp 7.4.1 minus perl and sendmail.

Started xampp. Apache is the only thing running in the xampp control panel.

Deployed application to htdocs folder.

Edited the config.inc file with only what you mentioned above.

Navigated to the page and got the 500 error.

Deleted htaccess, refreshed page, and got the "if you are seeing this, you haven't generated your token yet" error.

Pressed the sync button on the bridge and refreshed page. Same token error.

This is my bridge. Power light on. Lan light off. Wan light red. Lan light is off but bridge ip is still pingable. Anything out of the ordinary here? Anything in my router config that could be causing a problem?

[image: bridge] https://user-images.githubusercontent.com/44104559/72688051-c40d4000-3ad1-11ea-88d8-d28b67d3e4ed.jpg

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bren1818/TCPLightingWebInterface/issues/17?email_source=notifications&email_token=AAQMEH5LT7272RHKII5IFXTQ6S4IDA5CNFSM4KIUSKY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJK4C3A#issuecomment-576045420, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQMEHYRET6ZFHE6H27P2TLQ6S4IDANCNFSM4KIUSKYQ .

gotminer commented 4 years ago

I'll leave it unplugged for several hours and see if that does anything. I've restarted it a zillion times, but only leaving it unplugged for a couple of seconds.

How do I set a static ip on the bridge? I can't get to a web interface when putting the bridge ip into a browser.

I have a friend who has a spare bridge that I'm going to test tomorrow.

If all else fails, I'll test with a different router.

Thanks for all of your help!

bren1818 commented 4 years ago

I set the static ip by assigning a specific ip address to a specific MAC address (configured on my router). I try to statically assign as many devices as possible in my network as it makes it easier for me to identify them.

I hope the spare bridge assists. So long as the two devices are on the same network it should work. I'm thinking there must be something on your network preventing the cross communication.

Keep us posted,

Good luck

On Mon, Jan 20, 2020, 6:03 PM gotminer notifications@github.com wrote:

I'll leave it unplugged for several hours and see if that does anything. I've restarted it a zillion times, but only leaving it unplugged for a couple of seconds.

How do I set a static ip on the bridge? I can't get to a web interface when putting the bridge ip into a browser.

I have a friend who has a spare bridge that I'm going to test tomorrow.

If all else fails, I'll test with a different router.

Thanks for all of your help!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bren1818/TCPLightingWebInterface/issues/17?email_source=notifications&email_token=AAQMEH6JUFUOS3AZJN4BIBLQ6YUSHA5CNFSM4KIUSKY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJOAEQY#issuecomment-576455235, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQMEH6M6IFMDVU4TLNL2O3Q6YUSHANCNFSM4KIUSKYQ .

gotminer commented 4 years ago

I tested it on a different router and tried my friends gateway last week, still had the same problems.

Gave up on it for a few days and then was reading another thread where someone was powering on the gateway with the sync button held in. What exactly does that do? I tried it and ended up with a ip, but the wan light would never turn solid red like normal. And the sync button didn't work at that point. After it sat there for awhile, I rebooted it again. It booted up like normal and the wan light turned solid red.

So then I checked the webpage, got the sync message. Hit the sync button on the gateway, refreshed the page, and it finally worked! I can see my lighting groups and after it found all of the bulbs again, it knew which bulbs belonged to which group.

Whatever the gateway did when I powered it on while holding the sync button was what it needed. I'm really curious to know what it was.

bren1818 commented 4 years ago

It sounds like your bridge might have been flaking out or had static built up on it. Usually having it unplugged a short while resolves this.

I believe holding the sync button on boot does a mini reset, but I would have to read the original documents. Holding the bottom may have even been a placebo. Im glad it worked for you though, Hopefully no further problems and I'll keep your trick in mind in the event any others run into the same issue.

Cheers :)

On Mon, Jan 27, 2020, 6:49 PM gotminer notifications@github.com wrote:

I tested it on a different router and tried my friends gateway last week, still had the same problems.

Gave up on it for a few days and then was reading another thread where someone was powering on the gateway with the sync button held in. What exactly does that do? I tried it and ended up with a ip, but the wan light would never turn solid red like normal. And the sync button didn't work at that point. After it sat there for awhile, I rebooted it again. It booted up like normal and the wan light turned solid red.

So then I checked the webpage, got the sync message. Hit the sync button on the gateway, refreshed the page, and it finally worked! I can see my lighting groups and after it found all of the bulbs again, it knew which bulbs belonged to which group.

Whatever the gateway did when I powered it on while holding the sync button was what it needed. I'm really curious to know what it was.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bren1818/TCPLightingWebInterface/issues/17?email_source=notifications&email_token=AAQMEHZNMSMCWCWTCFSRBFTQ75XJVA5CNFSM4KIUSKY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKBQICQ#issuecomment-579011594, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQMEHZ7P3WD4HMXISLKEJ3Q75XJVANCNFSM4KIUSKYQ .

TDBatt commented 4 years ago

Yes you can pair the bulbs directly to a remote. I bought a set that was programmed like that, a remote and two bulbs. I reprogrammed them to my gateway.