Adding wps functionality to micropython [ESP8266]

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
thijsdv
Posts: 5
Joined: Mon Jan 30, 2017 8:35 am

Adding wps functionality to micropython [ESP8266]

Post by thijsdv » Mon Feb 13, 2017 1:41 pm

Hi,

For my project I need the wps functionality of the ESP8266, however it is not implemented yet into micropython.
When I implemented some basic wps functions myself into the esp8266/modnetwork.c file and tried to compile it, I got compilation errors:

Code: Select all

build/modnetwork.o:(.text.esp_wps_connect+0x14): undefined reference to `wifi_wps_enable'
build/modnetwork.o: In function `esp_wps_connect':
modnetwork.c:(.text.esp_wps_connect+0x41): undefined reference to `wifi_wps_enable'
By adding the -lwps flag to the LIBS in the Makefile, this resulted into the following errors:

Code: Select all

/home/thijs/Documents/renson/ventilator/test/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/lib/libwps.a(wps_common.o): In function `wps_fail_event':
(.irom0.text+0x4c0): undefined reference to `atoi'
Adding the -lc flag didn't give any good results : xtensa-lx106-elf-ld: cannot find -lc

Anybody who can point out what I'm doing wrong with the flags, ...?
Thanks in advance.

Code snippet:

Code: Select all

STATIC mp_obj_t esp_wps_connect(mp_obj_t self_in) {
    require_if(self_in, STATION_IF);
    if ((wifi_get_opmode() & STATION_MODE) == 0) {
        nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError,
            "STA must be active"));
    }

    // 1 = push button mode
    if (!wifi_wps_enable(1))
        nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError,
            "Could not activate wps"));

JensH
Posts: 3
Joined: Sun Oct 29, 2017 7:38 am

Re: Adding wps functionality to micropython [ESP8266]

Post by JensH » Sun Oct 29, 2017 7:55 am

Hi thijsdv,

I came across your post on WPS support for ESP and I am in need for this feature, too.
How did you proceed and what is the status?

I might be able to help you adding it to MicroPython.

Best,
Jens Henrik

JensH
Posts: 3
Joined: Sun Oct 29, 2017 7:38 am

Re: Adding wps functionality to micropython [ESP8266]

Post by JensH » Mon Oct 30, 2017 10:22 am

Hello,

I added experimentally WPS to the MicroPython ESP32 port, which is similar to ESP8266.
You can find it here: https://github.com/jhgoebbert/micropython-esp32

Best,
Jens Henrik

Post Reply