Connecting to PyBytes Via Wifi.

  • I went through the PyCom firmware update process and pasted the activation token. I assume this generates the pybytes_config.json file.

    The console window displays the message:

    "WiFi connection established
    Pybytes connected successfully (using the built-in pybytes library)"

    I am having two issues after this point:

    1. I cannot type any commands in the atom Terminal even though there is no code running in the or blocking the microcontroller.
    2. In the device panel(after refreshing) on the Pybytes website interface states that the device is never connected.

    This is the data in the pybytes_config.json file (fields starred out are for security reasons).

    {"wifi": {"ssid": "******", "password": "******"}, "wlan_antenna": 0, "dump_ca": false, "server": "", "ssl": false, "lte": {"apn": null, "cid": 1, "reset": false, "carrier": null, "band": null, "type": null}, "device_id": "**********", "network_preferences": ["wifi"], "ota_server": {"port": 443, "domain": ""}, "pybytes_autostart": true, "username": "********"}

    The device_id field matches the device_id field on the pybytes website.

  • Hi @jirkakrepl !
    Thank you so much for your prompt reply!

    The error was caused due to restrictions in our internal work wifi system, after taking it home it worked within seconds.
    The debug mode really helped in solving that error. It made me realize I was continuously getting data_packet receive errors.


  • Hi @katoa_mangu

    I just tried the same process on my side. It worked fine.
    I've opened the Pycom firmware updater and pasted the activation token.

    Then firmware updater wrote the Pybytes device config to a device and updated the firmware.
    Then the device restarted and was connected to Pybytes. The last connection time was updated.

    I tried pymakr and I can evaluate expression in REPL

    rst:0x1 (POWERON_RESET),boot:0x12 (SPI_FAST_FLASH_BOOT)
    configsip: 0, SPIWP:0xee
    mode:DIO, clock div:1
    entry 0x400a05d0
    WMAC: 240AC4C82F88
    Firmware: 1.20.1.r2
    Pybytes: 1.3.0
    Initialized watchdog for WiFi and LTE connection with timeout 1260000 ms
    WiFi connection established
    Pybytes connected successfully (using the built-in pybytes library)
    Pybytes configuration read from /flash/pybytes_config.json
    Pycom MicroPython 1.20.1.r2 [v1.11-06dfad0] on 2019-11-30; FiPy with ESP32
    Pybytes Version: 1.3.0
    Type "help()" for more information.
    >>> 2+2

    It's strange that it is not working for you.
    Can you to change the Wifi network in your device profile and then try to provision it again?

    Also, enable debugging, maybe you spot something there
    import pycom; pycom.nvs_set('pybytes_debug', 6)

    You can also try to completely erase a device with erase_all command
    Beware that after doing erase_all device will not boot up properly until you the flash firmware (doing the firmware update with firmware updater)

Log in to reply

Pycom on Twitter