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

Workaround for Alexa Bug #4235

Closed
reloxx13 opened this issue Jan 24, 2018 · 15 comments
Closed

Workaround for Alexa Bug #4235

reloxx13 opened this issue Jan 24, 2018 · 15 comments

Comments

@reloxx13
Copy link

reloxx13 commented Jan 24, 2018

Heya,

this library is used by the Tasmota Firmware to emulate HUE and WEMO Devices to control them with Amazon Alexa.

Currently their seems to be a bug in the Alexa Firmware where the header content is wrong resulting in a wrong parsing and missing args.

Another dev @OFreddy made a workaround for it.

Please check this out and tell us, if their is any chance to include it in your library, since we cannot do anything in the Alexa Firmware.

arendst/Tasmota#1639 (comment)
arendst/Tasmota#1434

@devyte
Copy link
Collaborator

devyte commented Jan 24, 2018

The referenced code rings a bell in my mind. There might already be a PR with the proposal, but I don't think Alexa was mentioned.
If there is no PR, please make one for review.

@reloxx13
Copy link
Author

seems u r right, but that pr is a lil bit diffrent.

#4151

i dont know which is better.

reloxx13 added a commit to reloxx13/Arduino that referenced this issue Jan 24, 2018
The PR for esp8266#4235

This esp8266#4151 is the same issue, but with a diffrent solution.
@devyte
Copy link
Collaborator

devyte commented Jan 25, 2018

@reloxx13 @Monarch73 please discuss the differences between this PR and #4151 .
Are they both aimed at Alexa?
Do they both work?
Are both code changes equivalent, or is one better than the other for some reason?

@reloxx13
Copy link
Author

Its independent from Alexa, but works for her, too.

As Monach said, it fixes the missing args if the server send the "application/x-www-form-urlencoded" header content-type instead of "application/json" and plain text (json) and not as suggestest for form-urlencoded a key/value pair.

i think monarches is better, cuz he made it in the _parseArguments method, while the one i posted is out of that method.

@OFreddy
Copy link

OFreddy commented Jan 25, 2018

I would prefer my solution as it saves code, because the code for adding the plain content is already existing.
Just the If clause in front is extended.

@reloxx13
Copy link
Author

good point 👍

@Monarch73
Copy link

I don't mind how it's done. Either way is fine with me.

@OFreddy
Copy link

OFreddy commented Jan 25, 2018

I am struggling with every byte to keep ota firmware update via web interface running ;-)
Not very satisfying

@Monarch73
Copy link

I think if you do a direct size-comparison of the binaries, you wouldn't get any differences. The optimizer in gcc picks up these kind of things pretty well...

how ever, like I said, I don't mind how it's done

@OFreddy
Copy link

OFreddy commented Jan 25, 2018

In that case I don't mind how it is done either.

@themindfactory
Copy link
Contributor

Can this work with Google home?

@reloxx13
Copy link
Author

any news about the PR ? :S

@devyte
Copy link
Collaborator

devyte commented Jan 31, 2018

Right now we're in a half-frozen state for 2.4.1, finishing up only critical stability issues and waiting on the imminent sdk 2.2. I'll revisit this after 2.4.1 is out the door.

@Winfried-Bantel
Copy link

I've got the same problem:

I want to control some electrical gimmicks via Hue-V1-Protocol saying "alexa test 50%".
The complete traffic alexa-ESP is working, but on the last function i can't access PUT-Data in JSON-form because alexa sends as Content-type x-www-form-urlencoded and in this case the ESP8266WebServer parses the HTTP-body as Form-Parameters which fails for JSON.

I can get "Content-Length" but no content!
Look here:
http://www.burgestrand.se/hue-api/api/lights/#changing-light-color-and-turning-them-onoff

In my opinion the best soolution would be a body-method.

@devyte
Copy link
Collaborator

devyte commented Oct 17, 2018

Fixed with #5252 .

@devyte devyte closed this as completed Oct 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants