Creating a WiFi network with a Fipy



  • Hello Pyoneers,
    I want to create a Wi-Fi network with my FiPy so I can give a few IoT sensors a network where over they can send measured data.
    The plan is to create a Wi-Fi network like I can do with my mobile phone. Here for I have a SIM card that I can use for this function.

    Are there people the have tried to do this with a Fipy? Or is there an example that I can use of a tutorial that I can follow?
    And maybe the most important qeustion, is it even possible to do?

    Kind regards, Han



  • I would like to eventually do this as well. has anyone figured this out. how to allow fipy to act as wlan station and forward all data outbound via LTE?



  • @han said in Creating a WiFi network with a Fipy:

    I read that I need to set up a sever on the FiPy.
    In the Pycom Documentation (chapter 6.2.2.6.1. Cat M1) is the Google Webserver programmed.

    They mean that if you need to have e.g. 3 nodes and 2 of them communicate with 3rd by only Wifi.
    On this 3rd node ("server node") you have LTE. It need socket(server) listen for request from that 2 nodes and forward messages throught LTE to whatever service you like.



  • Hello, jcaron and robert-hh,

    Thanks for your replies and the tips.
    I read that I need to set up a sever on the FiPy.
    In the Pycom Documentation (chapter 6.2.2.6.1. Cat M1) is the Google Webserver programmed.

    For example to connect over LTE Cat M1 to Google's web server over secure SSL:


    import socket
    import ssl
    import time
    from network import LTE

    lte = LTE() # instantiate the LTE object
    lte.attach() # attach the cellular modem to a base station
    while not lte.isattached():
    time.sleep(0.25)
    lte.connect() # start a data session and obtain an IP address
    while not lte.isconnected():
    time.sleep(0.25)

    s = socket.socket()
    s = ssl.wrap_socket(s)
    s.connect(socket.getaddrinfo('www.google.com', 443)[0][-1])
    s.send(b"GET / HTTP/1.0\r\n\r\n")
    print(s.recv(4096))
    s.close()

    lte.disconnect()
    lte.dettach()


    Could I use that server of do I need a own server.
    My data is collected and presented with the IBM cloud server.

    Are there some examples for the FiPy that I can follow?
    I am pretty new with the FiPy.

    Are there more things that I need to know or have before I can set op a WiFi network and collect and send data from my devices?



  • Note that there have been reports of issues with the simultaneous use of WiFi and LTE.

    Beyond that, AFAIK the firmware does not include anything like packet forwarding or NAT, so you would need to have a server on the FiPy which would relay the requests over LTE.



  • @han You can of course setup up the Fipy as WiFI access point, which is the default mode, and have other devices connect to it by WiFi, submitting data. And of course you can use the LTE modem of the FiPy to send that data to somewhere else. You'll need some kind of server, and I do not know how many nodes the FiPy can serve simultaneously. It is not trivial, but should be possible.


Log in to reply
 

Pycom on Twitter