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

link fail when wifi password contain «%» #6

Open
swil85 opened this issue Apr 16, 2020 · 4 comments
Open

link fail when wifi password contain «%» #6

swil85 opened this issue Apr 16, 2020 · 4 comments

Comments

@swil85
Copy link

swil85 commented Apr 16, 2020

Hello,
i have a wifi password containing some special characters like % or !
When removing them everything work great with a tuya curtain switch.

I read the code from smartLinkEncode, but dont really see what’s wrong !

Can u help me !

thank’s in advance.

@codetheweb codetheweb transferred this issue from TuyaAPI/cli Apr 17, 2020
@codetheweb
Copy link
Member

Does it link correctly with special characters if you use the official Tuya Smart app?

@swil85
Copy link
Author

swil85 commented Apr 17, 2020

Hello,
yes it work with tuya smart app and smart life app.
(but ifttt dont see my devices :( )

@swil85
Copy link
Author

swil85 commented Apr 24, 2020

Hi,
have you successfully reproduced the issue ?
Can it caused by "string substitution patterns" like "%d" "%s" "%f" … ?

@codetheweb
Copy link
Member

Sorry, this slipped through the cracks.

It's possible the device is expecting ASCII encoding instead of the UTF8 that we're currently doing. To test that theory, we would have to edit

const wifiPasswordBytes = Buffer.from(options.wifiPassword);
and
const ssidBytes = Buffer.from(options.ssid);

to look like Buffer.from(..., 'ascii'). Might also have to then change

_getLength(str) {
, but I think that should work as-is.

It's not a huge priority for me ATM, but if you or someone else wants to see if that fixes it I can merge in the changes.

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

2 participants