Skip to content
This repository was archived by the owner on Sep 6, 2023. It is now read-only.

esp32/modnetwork: Add esp_mac method, to get and set mac address #2

Closed
wants to merge 1 commit into from
Closed

esp32/modnetwork: Add esp_mac method, to get and set mac address #2

wants to merge 1 commit into from

Conversation

luaks
Copy link

@luaks luaks commented Dec 27, 2016

No description provided.

} wlan_if_obj_t;

const mp_obj_type_t wlan_if_type;
STATIC const wlan_if_obj_t wlan_sta_obj = {{&wlan_if_type}, WIFI_IF_STA};
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is one possible approach to store general configuration, like ssids, the mac address, auth configuration. Pycom does it this way in their modwlan imlementation.

Another way would be to always get and set this information via the esp_wifi_get_mac and esp_wifi_set_mac.

@dpgeorge
Copy link
Member

Thanks for the contribution!

The aim for us here is to make the user-facing API for the ESP32 port as similar as possible to the ESP8266, so that the same code can run on both. As such, the way to get/set the mac address would be via the wlan.config() method, ie wlan.config(mac=b'12341234') and wlan.config('mac').

Apart from that, let's wait for @nickzoic to merge the modsocket branch into the main esp32 branch before adding more features.

@luaks
Copy link
Author

luaks commented Dec 28, 2016

Oh, I have oriented my development on the documentation for the Hardware API.

It seems that there are multiple APIs documented. Is there any place where the APIs wanted for the esp32 are defined?
I'd love to help with porting micropython to the esp32, but without the knowledge of what is needed, it is rather hard.

@luaks luaks changed the base branch from esp32-modsocket to esp32 December 28, 2016 19:20
@dpgeorge
Copy link
Member

It seems that there are multiple APIs documented. Is there any place where the APIs wanted for the esp32 are defined?

Yes, please look here: http://docs.micropython.org/en/latest/esp8266/library/network.html . We want the esp32 to be as similar as possible to the esp8266, so go by those docs as much as is possible.

@nickzoic
Copy link
Collaborator

G'day Luaks, yeah I've implemented parts of network module but haven't filled in config() yet because I got distracted over in modsocket :-) ... if you can help out that's brilliant. You could probably just start by grabbing extmod/modlwip.c's version and adapting it one chunk at a time.

@dpgeorge
Copy link
Member

dpgeorge commented Jan 5, 2017

wlan.config() was added in 41534f1.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants