• 0 Votes
    1 Posts
    1k Views
    No one has replied
  • 1 Votes
    6 Posts
    2k Views
    T
    if the error code changes it certainly is another error. No clue what -1 means, sorry.
  • SSL Socket Server Side on WiPy 2.0

    WiPy 2&3 wipy 2.0 ssl socket server
    3
    2
    1 Votes
    3 Posts
    1k Views
    C
    @Innocenzo did you solve the problem?
  • Too many [Errno 113] EHOSTUNREACH

    Moved MicroPython wipy 2.0 lopy socket
    1
    1 Votes
    1 Posts
    1k Views
    No one has replied
  • 0 Votes
    12 Posts
    5k Views
    robert-hhR
    @shariq I have the code below in main.py, which sets up the device for connecting to my router with a fixed IP, which you then can use to access the device. WIFI_IP = "aa.bb.cc.ss" ROUTER_IP = "aa.bb.cc.rr") WIFI_SSID = "your AP SSID" WIFI_PASS = "your AP Password" def do_connect(): import network import time wlan = network.WLAN(mode=network.WLAN.STA) # create station interface if not wlan.isconnected(): # check if the station is connected to an AP wlan.ifconfig(config=(WIFI_IP, "255.255.255.0", ROUTER_IP, ROUTER_IP)) wlan.connect(ssid=WIFI_SSID, auth=(network.WLAN.WPA2, WIFI_PASSWD)) for _ in range(100): if wlan.isconnected(): # check if the station is connected to an AP break print('.', end='') time.sleep_ms(200) else: print("Connect attempt timed out\n") return print('\nnetwork config:', wlan.ifconfig()) do_connect()
  • Socket connect address

    WiPy 2&3 wipy wipy 1 wifi socket
    9
    0 Votes
    9 Posts
    4k Views
    robert-hhR
    @michalt38 OK. Then you'll need two steps: First, you have to connect the WiPy to the network. That's done with wlan.connect, as given in my sample scripts. Second: you have to write a little program for you WiPy and your PC that connects through sockets and sends the data. The IP adresses used are those of the WiPy and the PC, not the one of the router. You have to define which entity connects (socket.connect() ) and which entity accepts (socket.accept()). For initial testing, you can use for the PC side netcat (nc), which is a simple raw socket send/receive program. Examples for the WIPy side are here: https://docs.python.org/3/howto/sockets.html or here: https://www.tutorialspoint.com/python3/python_networking.htm
  • Problem with TCP and UDP at the same time

    Issues & Bugs bug pycom socket
    3
    0 Votes
    3 Posts
    2k Views
    C
    @beyonlo I found the solution with wireshark. I was testing the web page with chrome. Chrome is a litle bit buggy to test single threaded web servers. It does a pre-connection without sending any data in order to be ready for next request.
  • LoRa-Raw: Cannot transmit more than 64B

    LoPy lopy lora socket
    5
    0 Votes
    5 Posts
    2k Views
    S
    @Clemens Thank you Clemens to pointing this out for me , Actually the Maximum Payload is 64B for the Lopy . i was thinking that packets were cut internally but not. Nice to see that no one had this problem before. I have already bypassed the problem by cutting the packets. Thanks again .
  • How to get acknowledgement when sending message?

    SiPy sipy socket sigfox network
    17
    0 Votes
    17 Posts
    5k Views
    D
    similar problem. this: sigfox = Sigfox(mode=Sigfox.SIGFOX, rcz=Sigfox.RCZ1) s = socket.socket(socket.AF_SIGFOX, socket.SOCK_RAW) s.setblocking(True) s.setsockopt(socket.SOL_SIGFOX, socket.SO_RX, True) s.send(bytes([0x00, scale(lux.light()[0]), 3, 4, 5, 6, 7, 8, 9, 10, 0xAA, 0xFF])) retval = s.recv(32) print ("received " + retval) gives me: Traceback (most recent call last): File "<stdin>", line 164, in <module> OSError: [Errno 100] ENETDOWN whilst the backend shows me: Status : [ACKED] Data (Hexa) : cafecafecafecafe any idea what i'm missing here? It's definitively not the link - sender and receiver have free LOS. avgSnr=20.74 rssi=-52.00 Used HW: FiPy on '1.17.5.b6'
  • socket.fileno()

    Moved Discussion select asyncio socket
    5
    0 Votes
    5 Posts
    2k Views
    D
    Hello, fileno method added here: https://forum.pycom.io/topic/1951/new-firmware-release-version-v1-9-2-b1 Cheers, Daniel