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

difference between protocols #7

Closed
mralperem opened this issue Sep 7, 2022 · 5 comments
Closed

difference between protocols #7

mralperem opened this issue Sep 7, 2022 · 5 comments
Labels
question Further information is requested

Comments

@mralperem
Copy link

Hello,

What is the difference between EspTouch vs EspTouch V2? Which one should i use and why? Could you please explain this

@abobija abobija added the question Further information is requested label Sep 7, 2022
@abobija
Copy link
Owner

abobija commented Sep 7, 2022

Hi @mralperem

TL;DR: V2 is more secure than V1.

In V1, data is transmitted in plain mode, so if anyone in network intercept your data (ssid/password), he will be able to read it. In the other hand, EspTouch V2, uses key to encrypt data. When you initialize V2 protocol you need to provide key in format of string. ESP device needs to have the same key in order to decrypt received data.

@mralperem
Copy link
Author

thank you for your response. When i looked at your code i understand the difference but when i looked at the code for esp8266 provided from espressif system both protocol use the same code and there is no decrypt method. Could you provide a link for the esp8266 code you have used for esp touch v2. I might be looking at the wrong code.

@abobija
Copy link
Owner

abobija commented Sep 7, 2022

Use esp_smartconfig_set_type function, and set type to SC_TYPE_ESPTOUCH_V2. Then, before calling esp_smartconfig_start function, provide crypt key into smartconfig_start_config_t configuration struct.

Your code for setting SmartConfig to use EspTouchV2 with encryption key should look something like this:

...
esp_smartconfig_set_type(SC_TYPE_ESPTOUCH_V2);

smartconfig_start_config_t start_config = {
  .esp_touch_v2_enable_crypt = true,
  .esp_touch_v2_key = "SecretKeyHere123",
};

esp_smartconfig_start(&start_config);
...

Rest of the code should be the same as in your example.

@mralperem
Copy link
Author

thank you for the answer. I was able to find understand it. But do you know if does it support esp8266 or only esp32?

@abobija
Copy link
Owner

abobija commented Sep 7, 2022

You'r welcome. It supports 8266 as well. Here is SmartConfig docs for 8266 RTOS SDK.

@abobija abobija closed this as not planned Won't fix, can't repro, duplicate, stale Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants