WiFi AP
-
Hi everyone,
I am following this tutorial:
https://docs.pycom.io/tutorials/networks/wlan/#connecting-to-the-device
But I can not see created AP from NTB.When Connecting to a Router everything alright (ftp, ssh, ping).
https://docs.pycom.io/tutorials/networks/wlan/#connecting-to-a-routerThank you in advance for your assistance.
Regards, VojtechTest script:
from network import WLAN wlan = WLAN(mode=WLAN.AP, ssid='hello world') wlan.init() print(wlan.ifconfig(id=1)) #id =1 signifies the AP interface while True: print("isconnected:",wlan.isconnected(), wlan.ifconfig(id=1))output:
('192.168.4.1', '255.255.255.0', '192.168.4.1', '0.0.0.0') isconnected: False ('192.168.4.1', '255.255.255.0', '192.168.4.1', '0.0.0.0') isconnected: False ('192.168.4.1', '255.255.255.0', '192.168.4.1', '0.0.0.0')I am getting wlan.antenna() = 2 ?
>>> wlan.antenna() 2 >>> WLAN.EXT_ANT 1 >>> WLAN.INT_ANT 0system version:
(sysname='GPy', nodename='GPy', release='1.20.2.r4', version='v1.11-ffb0e1c on 2021-01-12', machine='GPy with ESP32', pybytes='1.6.1') -
@nadvorvo You could try to deactivate pybytes, for instance with:
import pycom
pycom.pybytes_on_boot(False) -
@robert-hh said in WiFi AP:
You could try to deactivate pybytes, for instance with:
import pycom
pycom.pybytes_on_boot(False)Hi @robert-hh,
Thank you for your reply.I have deactivated pybytes, but I can not see created AP from NTB.
pycom.pybytes_on_boot() FalseThen I tried to activate wifi_on_boot
import pycom from network import WLAN pycom.pybytes_on_boot(False) #we do not want Pybytes using the WLAN pycom.smart_config_on_boot(False) #we also do not want smart config pycom.wifi_on_boot(True) pycom.wifi_mode_on_boot(WLAN.AP) pycom.wifi_ssid_ap('ssid')I can see wifi AP now.
Then I tried to deactivate wifi_on_boot
pycom.wifi_on_boot(False)no wifi AP now.
-
-
I am getting wlan.antenna() = 2 ?
This is
WLAN.MAN_ANT, as you're not explicitly setting the antenna.MAN_ANTrefers to manual antenna, and defaults to the internal antenna selected. In this mode, you can manually change P12 to reflect the antenna setting, and is used for the OEM modules, as they do not have an antenna switch.I looked at this for a long time, but then figured it out. There is a slight mistake in the example. If you remove the line
wlan.init(), or transfer the arguments fromwlan = WLAN()towlan.init()it will work. What is happening is thatwlan.init()overrides the settings inwlan = WLAN().
I will change the example
Sorry for the inconvenience,
Gijs -
@Gijs this is a common trap. The init() calls of a device have to carry all parameters that are different from the default, since it usually sets all parameters.
-
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