Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Connecting the LoPy in STA mode

    Scheduled Pinned Locked Moved LoPy
    lopywificonnecttelnetftp
    12 Posts 4 Posters 3.4k Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B Offline
      binux
      last edited by

      Hello,

      I'm currently working on a project where my lopy is mounted on top of my roof for data logging. He's connecting my local wifi in STA mode.

      Since my code surely isn't perfect yet, but in the same time it is hard to quickly access the mounted lopy, I was asking myself if it was possible to connect to it via telnet and ftp in STA mode. I tried, but it failed with a "Connection refused" error. Can someone tell me what I have to do with my lopy so he's allowing to connect and upload new code?

      Thanks in adavance!

      L robert-hhR 2 Replies Last reply Reply Quote 0
      • L Offline
        livius @binux
        last edited by livius

        @binux
        better use WLAN.STA_AP mode instead of only STA- then you can be connected to the router and in the same time you have AP running - and you can connect to it simple as always :)

        think about people first, then computers

        1 Reply Last reply Reply Quote 0
        • B Offline
          binux
          last edited by binux

          I tried that mode in the past. I didn't work... On top in AP mode the LoPy also not always works and just times out the connection requests. So as long as the firmware is as unstable as it is right now it's not an option for me.

          I know you can answer HTTP requests with a socket and send a custom webpage as response however I don't know how I could possibly let someone interact with it. And that's why a simple FTP/Telnet connection would be so much better.

          Thanks for the suggestion though :)

          L 1 Reply Last reply Reply Quote 0
          • L Offline
            livius @binux
            last edited by

            @binux
            did you tried this on quite recent firmware?
            It work for me really good but i work with wipy2 not Lopy

            think about people first, then computers

            B 1 Reply Last reply Reply Quote 0
            • robert-hhR Offline
              robert-hh @binux
              last edited by

              @binux It works well for me with a LoPy in STA mode. Which OS do you use. Windows command line ftp connects, but you can not transfer any data or list files, but telnet should work.
              (sysname='LoPy', nodename='LoPy', release='1.7.3.b1', version='18f1fd8-dirty on 2017-06-15', machine='LoPy with ESP32', lorawan='1.0.0')

              1 Reply Last reply Reply Quote 0
              • J Offline
                jmarcelino
                last edited by

                The LoPy will answer on FTP and Telnet by default. Could you by any chance be trying the wrong IP address for it?

                I was also going to suggest there could be a firewall between your computer and the LoPy.

                1 Reply Last reply Reply Quote 0
                • B Offline
                  binux @livius
                  last edited by

                  @livius I'm on the most recent firmware. I have the WiPy aswell. The WiPy is a breeze to work with, sadly this doesn't apply to the LoPy where the most basic functions are pretty unstable. I think the Pycom guys yet didn't implement this mode on the LoPy (it's also not documented). At least I think I read that somewhere once.

                  J 1 Reply Last reply Reply Quote 0
                  • J Offline
                    jmarcelino @binux
                    last edited by

                    @binux
                    I can assure you STA mode is implemented on the LoPy, I'm actually using that right now with both FTP and telnet.

                    B 1 Reply Last reply Reply Quote 0
                    • B Offline
                      binux @jmarcelino
                      last edited by

                      @jmarcelino I'm sorry don't misunderstand me. I said the STA_AP mode is uinplemented or at least does not work for my 2 LoPys I have here.

                      However your guess might be right. I'm on a windows machine I will switch to my other machine which runs Linux and see if I can reach it there. The iP adress should be correct since I see the packets sent by it through wireshark.

                      L robert-hhR 2 Replies Last reply Reply Quote 0
                      • L Offline
                        livius @binux
                        last edited by livius

                        @binux
                        on Windows use Filezilla not built in Windows ftp.

                        think about people first, then computers

                        1 Reply Last reply Reply Quote 0
                        • robert-hhR Offline
                          robert-hh @binux
                          last edited by

                          @binux I just tested it with my LoPy:
                          STA_AP mode works. If enabled, I can connect to both the station and AP address with Telnet and ftp. The little script I use to set up the mode is:

                          import network
                          import time
                          # setup as a station and AP
                          wlan = network.WLAN(mode=network.WLAN.STA_AP)
                          wlan.connect(ssid="ROUTER_SSID", auth=(network.WLAN.WPA2, "ROUTER PWD"))
                          while not wlan.isconnected():
                              time.sleep_ms(50)
                          wlan.ifconfig(config=("my_fixed_IP", "255.255.255.0", "router_ip",  "router_ip"))
                          print(wlan.ifconfig())
                          

                          It sets a fixed IP address in station mode. If you remove that statement, it will ask you home router for an IP address. The default IP address in AP mode stays 192.168.4.1, as you know.

                          B 1 Reply Last reply Reply Quote 1
                          • B Offline
                            binux @robert-hh
                            last edited by

                            @robert-hh Thanks for the snippet. I can confirm that it seems to be a problem with my windows machine. I can now connect to the LoPy in STA mode via telnet and ftp (with my linux machine). Thanks for all the suggestions!

                            1 Reply Last reply Reply Quote 0

                            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
                            • 1 / 1
                            • First post
                              Last post

                            Pycom on Twitter

                            Pycom