Cannot access FTP on GPy



  • Cannot access FTP server on GPy using IP 192.168.4.1

    Also, I understand by default the GPy boots with WLAN configured as AP yet I cannot see any wireless networks that would associated with the GPy when I scan available wireless connections from either my phone or computer.



  • @guyc Be advised, my experience with rc6 was that the GPy broadcast the SSID only one time which was enough to get it in the cache device wanting to connect but not enough to connect.

    Downgrading to rc2 worked for me.

    Can you manually set it up as a station (I like to see the blinking lights and write progress to a log file)

    import machine
    import pycom
    import time
    pycom.heartbeat(False)      # show that it's me by turning off heartbeat  and
    pycom.rgbled(0x006000)      # green (careful of sunlight)
    from network import WLAN
    wlan = WLAN(mode=WLAN.STA)  # configure the WLAN subsystem in station mode (the default is AP)  DROPS connection if run interactively
    
    # use fixed (not dhcp) IP settings (IP,         Subnet,             Gateway,        DNS)
    wlan.ifconfig(config=('192.168.1.3', '255.255.255.0', '192.168.1.1', '192.168.1.1'))        # UGLY use DHCPC (_)
    wlan.connect(ssid='zzbled', auth=(WLAN.WPA2, '5Caace'))
    time.sleep(3)       # always takes a couple of seconds. If we're lucky dont complain at all
    for i in range(5):
        f = open('boot.log', 'a')    # append
        f.write(  'wlan.isconnected:' + str(wlan.isconnected()) + ',' + str(wlan.ifconfig()) + '; '  +  str(i) + '\n')
        f.close()
        if  wlan.isconnected() == False:
            pycom.rgbled(0x100000) # faint RED
            time.sleep(.5)
            pycom.rgbled(0x800000) # RED         if loop ends stays red
            time.sleep(.5)
        if  wlan.isconnected() == True:
            pycom.rgbled(0x005000) # green  main.py
            time.sleep(.5)      # let him see it  before heartbeat wipes it out
            pycom.heartbeat(True) # incase main.py is broken (or not there so we can get to REPL) it's kinda frequent
            break
    
    
    
    


  • I downgraded the firmware to 1.20.1.r2 v1.11-06dfad0 on 2019-11-30 and still cannot FTP to 192.168.4.1. I also do not see GPy network being broadcast.

    I then tried to manually setup the GPy as an AP doing the following;

    import os
    os.uname()
    (sysname='GPy', nodename='GPy', release='1.20.1.r2', version='v1.11-06dfad0 on 2019-11-30', machine='GPy with ESP32', pybytes='1.3.0')

    import network
    ap = network.WLAN(mode=network.WLAN.AP, ssid='GPyTest', auth=(network.WLAN.WPA2, 'password'))
    ap.ifconfig()
    ('0.0.0.0', '0.0.0.0', '0.0.0.0', '0.0.0.0')

    ap.ifconfig(id=1, config=('192.168.4.1', '255.255.255.252', '0.0.0.0', '0.0.0.0'))
    ap.hostname('AEDRMS')
    True

    That still did not work.
    I then upgraded the code back to 1.20.2.rc6 and after the upgrade completed I could see GPy-wlan-xxxx being broadcast from both the Android phone and the PC but I could still not connect to it using FTP.



  • The code I am using is 1.20.2.rc6 v1.11-01f49f7 on 2020-02-28

    I am using an android phone and a windows 10 PC. Both saw a SSID being broadcast at one point but I could never connect. If I setup WLAN as a station I can connect to my router just fine but when I try setting WLAN as an AP I see nothing. I powered off and on the Gpy with Boot.py and Main.py having no code in them and I cannot see any AP and cannot FTP to the default 192.168.4.1.

    I followed the thread on https://github.com/pycom/pycom-micropython-sigfox/issues/430

    it looks like the exact same issue I am fighting but I am not sure I understand how it got resolved or if it actually did?



  • @dgerman The code I am using is 1.20.2.rc6 v1.11-01f49f7 on 2020-02-28

    I am using an android phone and a windows 10 PC. Both saw a SSID being broadcast at one point but I could never connect. If I setup WLAN as a station I can connect to my router just fine but when I try setting WLAN as an AP I see nothing. I powered off and on the Gpy with Boot.py and Main.py having no code in them and I cannot see any AP and cannot FTP to the default 192.168.4.1.



  • Most of such Problems on newer firmware are related to the pybytes defaults.

    Defautls changed from setting up an own Network to connecting to the pybytes network.

    I guess that the solution will be:

    • without serial: setting up a network it likes to have and to change the pybytes settings.
    • with serial: browse the forum for the settings in your code . Or if the updater contains it already upload the firmware with deselected pybyte.


  • @guyc What version of firmware? I had problems with 1.20.2.rc6
    see https://github.com/pycom/pycom-micropython-sigfox/issues/430
    Which computer? Which phone?


Log in to reply
 

Pycom on Twitter