bren1818 / TCPLightingWebInterface

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

Can't get code to work :( #3

Closed richardhughes260 closed 8 years ago

richardhughes260 commented 8 years ago

It may be me, not you.

Is the only thing I need to get started is the following in the include.php:

IP of controller token captured by some external method ip of the host of this code

I get the message that I do not have the token filled in, it is, on line 29.

bren1818 commented 8 years ago

You need to set the ip to the ip of the tcp bridge, then push the sync on the bridge and go to where you run the app. It should give you a token, which you copy and then paste into the include file.

I'll have a look tonight and push an update if need be.

Good luck!

On Sep 30, 2016 12:13 PM, "Richard Hughes" notifications@github.com wrote:

It may be me, not you.

Is the only thing I need to get started is the following in the include.php:

IP of controller token captured by some external method ip of the host of this code

I get the message that I do not have the token filled in, it is, on line 29.

— 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/3, or mute the thread https://github.com/notifications/unsubscribe-auth/ACDCH_NIKiaH5zPTogcLJ4vs5l4GazKEks5qvTUOgaJpZM4KLQek .

richardhughes260 commented 8 years ago

I loaded fresh code, added the ip of the lighting controller in include.php & rand index.php after pushing the sync button. I got the same message, that It did not get a token.

Is there other code that needs to be run to get the token?

bren1818 commented 8 years ago

Hmm I'll have to look into it tonight, default settings should work after those edits. Could be firewall issue. What OS are you using?

Thanks

On Sep 30, 2016 1:26 PM, "Richard Hughes" notifications@github.com wrote:

I loaded fresh code, added the ip of the lighting controller in include.php & rand index.php after pushing the sync button. I got the same message, that It did not get a token.

Is there other code that needs to be run to get the token?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bren1818/TCPLightingWebInterface/issues/3#issuecomment-250803549, or mute the thread https://github.com/notifications/unsubscribe-auth/ACDCH7dP-BZxyfnoitLvjFjJ9_DVqZyzks5qvUZVgaJpZM4KLQek .

richardhughes260 commented 8 years ago

I am running it on a Orange Pi PC, let me check permissions...

richardhughes260 commented 8 years ago

I did a chmod 777 * in the dir where in the index.php is. Still no success. This is all on the LAN, so no FW issues, if it is not phoning home.

bren1818 commented 8 years ago

Hmm I'll have a look tonight when I'm home. Could you try setting line 17 in includes to 0, so 'use token file' is false?

Many thanks

On Sep 30, 2016 2:48 PM, "Richard Hughes" notifications@github.com wrote:

I did a chmod 777 * in the dir where in the index.php is. Still no success. This is all on the LAN, so no FW issues, if it is not phoning home.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bren1818/TCPLightingWebInterface/issues/3#issuecomment-250823132, or mute the thread https://github.com/notifications/unsubscribe-auth/ACDCH9Gic31B4gOrxTfRbjjE28INRCW0ks5qvVmYgaJpZM4KLQek .

bren1818 commented 8 years ago

Iam unable to replicate the issue you;re encountering, however try the following: in the includes.php file set: line 8: LIGHTING_URL to the address of the bridge line 11: LOCAL_URL to: "127.0.0.1" (try this, localhost should work too, depends on how Orange Pi runs the webserver) Line 17: USE_TOKEN_FILE to 0

then run it, you should see:

image

Hit the sync button and re-fresh

It should generate your token, you want the highlighted part:

image

Put that as the token in line 29

image

Then you should be good.. Your config should look something like this: (places you need to adjust are highlighted)

image

richardhughes260 commented 8 years ago

Hi Bren, changing Line 17: USE_TOKEN_FILE to 0 made the token warning go away. Nothing else made any changes.

It may be the OS. I'll have to deploy it on a mac, pc or linux distro.

I was able to get a token using a python app. I tried pasting it in & no better results.

sdhip commented 8 years ago

Hi Bren

Great work -- well done (and to all those whose work you built on).

I tried with the wireless tcp bridge and had the errors that others mention above, i.e. no token returned, but then switched to a wired one I had spare from buying some bulbs on eBay and it all worked just fine.

Maybe the problems folk are reporting are down to wireless tcp bridges?

All the best Steve

bren1818 commented 8 years ago

Very interesting hypothesis, that may be the issue as I could not replicate it. I was unaware there even was a wireless version of the hub. Perhaps if I pick one up, I'll be able to find a work around. Thank you for posting that info.

Cheers, Bren

On Saturday, 8 October 2016, sdhip notifications@github.com wrote:

Hi Bren

Great work -- well done (and to all those whose work you built on).

I tried with the wireless tcp bridge and had the errors that others mention above, i.e. no token returned, but then switched to a wired one I had spare from buying some bulbs on eBay and it all worked just fine.

Maybe the problems folk are reporting are down to wireless tcp bridges?

All the best Steve

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bren1818/TCPLightingWebInterface/issues/3#issuecomment-252412931, or mute the thread https://github.com/notifications/unsubscribe-auth/ACDCH57GWLaqJRAShqFEGfb-2KoktkIkks5qx1uugaJpZM4KLQek .

bren1818 commented 8 years ago

For those of you using Windows 10, something I thought of (as I had issues connecting wireless to my Raspberry Pi - and this may be completely unrelated) is the following:

Click on your wireless network

image

Once connected click properties

image

Under make this PC discoverable, click yes.

image

I'm not sure if this will help, but I know after one of the Windows 10 updates, I couldn't connect to other items on my network, like smb on my Raspberry Pi, but this fixed it.

Try it out, let me know.

Thanks!

@richardhughes260 @sdhip

,

sdhip commented 8 years ago

Hi Bren

Wireless gateway is in the bulb packs with a white iPhone on the front: s-l1600

Let me have your address Bren if you'd like me to send you one!

I'm running your code on a Mac (with standard Apache & PHP setup -- see e.g. https://coolestguidesontheplanet.com/get-apache-mysql-php-and-phpmyadmin-working-on-macos-sierra/).

Cheers Steve

bren1818 commented 8 years ago

@sdhip Steve, that's very generous of you and would be awesome. I have not seen one of those packs before. Perhaps that version was not available in Canada or atleast in the Home Depots. I'm going to assume if the code did work with the wired version but not the wireless bridge perhaps it is either communicating on a different port or there is a issue in between. Out of curiosity is your Mac connected wired to your router or also connected wirelessly to it (not that it should make a difference)

I cannot imagine there is different api commands for the wireless version, I have decompiled the Android source so I'll be able to look at that a bit more scrutinizingly this week. I keep intending to add more features to this project like bulb discovery etc but just haven't had the time lately.

I'll send you my address details this week, I'm just on the road to visit family.

Thanks again!

Bren

bren1818 commented 8 years ago

@sdhip, @richardhughes260 - I was able to replicate the issue using the "official" android app on a wired bridge. (I think) - At my home I have my primary wireless network, and I have a wireless Bridg/Repeater Network too. My TCP bridge is connected to my primary network. When I tried to connect to my Bridged network, the application would not ever find the lights, it would fail, however, when I connected my phone to my primary network and ran the app, It did connect. This may be another thing to check - ensure the bridge and where you're controlling the lights from are all connected to the same hub / network.

bren1818 commented 8 years ago

@sdhip - shoot me an email @ bren1818@gmail.com, apparently there is no way to PM you.

Thanks!

richardhughes260 commented 8 years ago

Hi Bren, I was traveling on business & could not do further testing until now. I have a Bitnami LAMP VM & pulled down the code & it works fine! Thanks for being so responsive! I GREATLY appreciate the project!