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

Example doesnt use the same URLS #11

Open
IS512 opened this issue Feb 5, 2019 · 5 comments
Open

Example doesnt use the same URLS #11

IS512 opened this issue Feb 5, 2019 · 5 comments

Comments

@IS512
Copy link

IS512 commented Feb 5, 2019

Hello

I've been modifying this code to work with your home bridge plugin. I have modified the current state and current position but cannot get /set working at all

Is this correct for this line?
server.on("/set", HTTP_POST, handleLogin); //Position from Homebridge

and for server.arg(???) what has to be in place for this part??

`void handleLogin()
{
pers = server.arg("pers"); // Get persentage of position string

int persent = pers.toInt();`

I'm guessing this function 'void handleLogin()' is correct to receive http://x.x.x.x/set/0->100 from the home bridge??

@Nicnl
Copy link
Owner

Nicnl commented Feb 5, 2019

I'm sorry but I'm missing too much informations to help you.

Where does your server.on("/set", HTTP_POST, handleLogin); line comes from?
What programming language are you using?
What HTTP framework are you using?
And... uh... why is your function named 'handleLogin' ?

@IS512
Copy link
Author

IS512 commented Feb 5, 2019

Hey, sorry I thought i was raising an issue for a specific file.

It's the arduino example, I think the arduino side of things is correct but I did just find that Igor mentions modifying a JSON file in another issue. I can't find exactly what he's refrencing.

@Nicnl
Copy link
Owner

Nicnl commented Feb 5, 2019

Oh, my bad.
I've never noticed that this function was named as such.

This Arduino sketch is from Igor.
Sorry, I'm not very familiar with it...

Sorry to ping you, @IgorFX, but if you know what this brave fellow is talking about it would be very nice.

@IS512
Copy link
Author

IS512 commented Feb 6, 2019

Hi Nicnl

Got it working, I was over thinking it

Instead of '"set_target_position_url": "http://192.168.1.55/set/%position%",'

needs to be'"set_target_position_url": "http://192.168.1.55/set?pers=%position%",'

@IgorFX
Copy link

IgorFX commented Feb 8, 2019

Hello
I edited the sketch. Added comments for config.json

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