Adding wps functionality to micropython [ESP8266]

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
thijsdv
Posts: 4
Joined: Mon Jan 30, 2017 8:35 am

Adding wps functionality to micropython [ESP8266]

Postby 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"));

Return to “Development of MicroPython”

Who is online

Users browsing this forum: No registered users and 1 guest