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

Add missing option ssid_hidden for Wifi.startAP() #1358

Closed
MaBecker opened this issue Mar 18, 2018 · 10 comments
Closed

Add missing option ssid_hidden for Wifi.startAP() #1358

MaBecker opened this issue Mar 18, 2018 · 10 comments
Assignees
Labels
enhancement ESP8266 This is only a problem on ESP8266 devices implemented

Comments

@MaBecker
Copy link
Contributor

Extend list of possible option with "hidden" to start a AP visible or hidden.

AP is visible

"hidden" : 0          default value

AP is hidden

"hidden" : 1         

Gordon where do I find the API reference for Wifi.startAP(), because I like to add this to the reference too.

@MaBecker MaBecker added enhancement ESP8266 This is only a problem on ESP8266 devices labels Mar 18, 2018
@MaBecker MaBecker changed the title Add missing option ssid_hidden to Wifi.startAP() Add missing option ssid_hidden for Wifi.startAP() Mar 18, 2018
@wilberforce
Copy link
Member

wilberforce commented Mar 18, 2018

@MaBecker

The `options` object can contain the following properties.
* `authMode` - The authentication mode to use. Can be one of "open", "wpa2", "wpa", "wpa_wpa2". The default is open (but open access points are not recommended).
* `password` - The password for connecting stations if authMode is not open.
* `channel` - The channel to be used for the access point in the range 1..13. If the device is also connected to an access point as a station then that access point determines the channel.
Notes:

@MaBecker
Copy link
Contributor Author

Thanks

what about ESP32 and hidden option?

@MaBecker
Copy link
Contributor Author

How do you create this nice looking source code links?

@wilberforce
Copy link
Member

wilberforce commented Mar 18, 2018

I did a search to find startAP
In the results page clicked on the line number 261 here libs/network/jswrap_wifi.c

Then clicked on line 272 and shift-clicked line 278. This updates the URL to have this line range.
Then cut and paste into the comment. I have added a single back tick to make this appear:

https://github.com/espruino/Espruino/blob/0ad87619ddbbeefa91fc6e9ff712c34ed2e98c2a/libs/network/jswrap_wifi.c#L272-L278

Git hub does the rest of the magic

@wilberforce
Copy link
Member

wilberforce commented Mar 18, 2018

what about ESP32 and hidden option?

Here is an example

"#if" : "defined(ESP32) || defined(ESP8266)",

Not sure you can use a condtition for part of the options list - you just say ESP8266 specfic

@gfwilliams
Copy link
Member

Yes, there's no way to have one argument only for one platform. You'd just have to document it manually in the /*JSON comment

@wilberforce
Copy link
Member

Oh I think your asking if esp32 supports hidden AP - yes!

Set as part of the struct here:

apConfig.ssid_hidden = 0;

@MaBecker
Copy link
Contributor Author

Cool Wilberforce

So adding option hidden has to take place in ESP8266,ESP32 and ESP8266WiFi.js - correct?

Just checked AT Instructions and figured out how to handle this

AT+CWSAP=<ssid>,<pwd>,<chl>,<ecn>[,<max	conn>][,<ssid	hidden>]

• [<ssid	hidden>]	(optional):
‣ 0: SSID is broadcasted. (the default setting)
‣ 1: SSID is not broadcasted.

@gfwilliams
Copy link
Member

The main JS one to add it to is EspruinoWiFi.js, but ESP8266WiFi.js and ESP8266WiFi_0v25.js would be the ones for Espruino & ESP8266.

The thing to watch out for is whether the ESP8266 firmware actually supports the AT command. Adding the extra arguments if it didn't would make the call fail :(

@MaBecker
Copy link
Contributor Author

MaBecker commented Mar 19, 2018

So what to order to be able to test (got a pico and some ESP01)?

Ok. - will use my Espruino Wifi board

@MaBecker MaBecker self-assigned this May 9, 2018
@MaBecker MaBecker closed this as completed May 9, 2018
MaBecker added a commit that referenced this issue May 9, 2018
gfwilliams added a commit that referenced this issue May 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ESP8266 This is only a problem on ESP8266 devices implemented
Projects
None yet
Development

No branches or pull requests

3 participants