Skip to content

How do I receive data, like numbers and text, through the GET method in MicroPython? #10981

Discussion options

You must be logged in to vote

So like I said before, I just parse it myself. There may be a library out there that can do it, but here is some of my code that I've adapted to your example quick.

import network
import time
import socket


def network_connect(network_name, network_password):
    station = network.WLAN(network.STA_IF)
    station.active(True)
    station.connect(network_name, network_password)

    timeout = 60
    while not station.isconnected() and timeout > 0:
        time.sleep_ms(1000)
        timeout -= 1
    if station.isconnected():
        ips_and_mask = station.ifconfig()
        print(ips_and_mask)
        my_ip = ips_and_mask[0]
        return my_ip
    return False


  
def page_data():
    …

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@alekthegenius
Comment options

@alekthegenius
Comment options

Comment options

You must be logged in to vote
1 reply
@alekthegenius
Comment options

Answer selected by alekthegenius
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants