Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5077

MicroPython • Re: Raspberry Pico W program not working after updating to firmware v1.24

$
0
0
I need to bring to life again this thread and I have to admit that I am confused. A couple of days ago somebody told me that my code with the addition sugested by scruss was not working. He was using lasted 1.24.1 version of micropyton firmware. I told him to go install 1.24 version.

I was shocked when he told me that it was not working either, he need to go bak to 1.23 version to make it work. I tested myself today and it is really not working. So, I really don't know what I did previously but this is going back to square one. My code is not working with versions 1.24 and 1.24.1 even dissabling station interface. I can connect to the Pico AP but it doesn't receive any mesages.

I put below the code in the actual form.

Code:

import networkimport timeimport socketfrom machine import Pinr1=Pin(16,Pin.OUT)r2=Pin(17,Pin.OUT)led2= Pin("LED", Pin.OUT)led2.on()r1.off()r2.on()# if you do not see the network you may have to power cycle# unplug your pico w for 10 seconds and plug it in againdef ap_mode(ssid, password):    """        Description: This is a function to activate AP mode        Parameters:        ssid[str]: The name of your internet connection        password[str]: Password for your internet connection        Returns: Nada    """        # Now making our WiFi AP and disabling WiFI station interface     ap = network.WLAN(network.AP_IF)    sta_if = network.WLAN(network.STA_IF)    sta_if.active(False)    ap.config(essid=ssid, password=password, pm = 0x111022)    ap.active(True)    while ap.active() == False:        pass    print('AP Mode Is Active, You can Now Connect')    print('IP Address To Connect to:: ' + ap.ifconfig()[0])    s2 = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)    s2.bind(('', 5005))    while True:      data, addre = s2.recvfrom(1024)      #print('Got a connection from %s' % str(addre))      #print('Content = %s' % str(data))      r1.toggle()      r2.toggle()ap_mode('DISPARA','DISPARAFILM')

Statistics: Posted by visogonzalez — Fri Dec 27, 2024 9:34 pm



Viewing all articles
Browse latest Browse all 5077

Trending Articles