Wi-Fi functions
-
Hi all,
I am a Ph.D. student in telecommunications and for my research, I am planning to use the FiPy.
Until now, I used to work with an ESP8266 programmed in C. The cool thing of the FiPy, is that I can use Micro Python and that it has all the wireless interfaces I need in a very compact package.
The problem is that I need to access the following functions from the ESP32 API:esp_err_t esp_wifi_80211_tx(wifi_interface_tifx, const void *buffer, int len, bool en_sys_seq)
esp_err_t esp_wifi_scan_start(constwifi_scan_config_t *config, bool block)
I am willing to rebuild Micro Python myself, but I need some guidance on how to do it without breaking the current release, so that I don't lose access to the other modules.
What I need to do is:
-
Modify the WLAN.scan() function to accept a few parameters (the channel that I need to scan and the time to be spent per channel).
-
Add a function to send "free" beacons (I need it for my custom MAC protocol).
Can anyone help me with this?
The scan function is this one, STATIC mp_obj_t wlan_scan(mp_obj_t self_in) , at line 743 of modwlan.c.
The other one is not used anywhere (or at least I cannot find it), so I may very well write my own.- What I do not understand is, once I modify the C code, how do I link it to Micro Python?
- Where is the Micro Python source code? (except on the website of Micro Python).
- (as an alternative) Can I build a "standard" Micro Python with my custom C code and then add the missing libraries to make the FiPy work?
- Is anyone interested in having the final result (or cooperate with me)? My code will be open source anyway when it will be complete.
-
-
@ingframin Have you already tried rebuilding the firmware from source, without any modifications, and flashing that new firmware to the board?
-
@ingframin The source code is here https://github.com/pycom/pycom-micropython-sigfox
Including instructions to set up the build environment. Follow the instructions carefully. -
Thanks for pointing me in the right direction. I am looking at the documentation of MicroPython at the moment and trying to build the environment without adding anything.
I have some troubles with the xtensa kit, but I can figure out myself what's missing.
I decided however, not to modify the standard library but to add my own module.
It seems simpler and does not disrupt what is already there.
Also, I don't want to risk to brick the modules.
I'll post updates here when I am through with the build process. -
@ingframin Good luck. Feel free to post any querys here and ill get them answered ASAP.
-
@jcaron Yes, and it works!
Now I am trying to figure out where to put my module.
In the ESP8266 version there is a file called ESP8266.ld which contains the list of C files.
Where is the equivalent for ESP32? If there is no equivalent, what shall I look for? -
@ingframin Did you manage to modify the firmware? I would like to have a Wi-Fi advertising per 100 milliseconds; default LoPy-4 seem to send an advertising only if requested by a station.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better ๐
Register Login