Pybytes Pymakr terminal no longer working



  • The Pybytes Pymakr no longer works for all of my devices (both WiFi and LTE). When I try to connect via the online terminal, the REPL spits out this error:

    Unhandled exception in thread started by <bound_method>
    Traceback (most recent call last):
      File "_msg_handl.py", line 259, in _io_thread_func
      File "_msg_handl.py", line 197, in _receive_packet
      File "_mqtt_core.py", line 398, in _recv_callback
      File "_mqtt_core.py", line 368, in _parse_publish
      File "_mqtt_core.py", line 341, in _notify_message
      File "_mqtt.py", line 91, in set_callback
      File "_pybytes_protocol.py", line 249, in __process_recv_message
      File "_flash_control_OTA.py", line 125, in get_flash_hierarchy
    OSError: [Errno 2] ENOENT
    

    I don't think this is any fault of my own since I used to use this feature all the time, and it doesn't work in its most basic configuration. Anyone have any input here?

    Thanks,
    Troy



  • Hi,
    I can imagine that. I have put it on the bugs-list for Pymakr online a while back (when you first mentioned it), but it might be some time before we get to it (there's always more..) . I think the issue is related to having such a large file not fitting in the receive buffer of the device, though Im not sure.
    At the moment I cannot think of a quick-fix for this issue, except for splitting the files into multiple smaller files, I think that should work



  • @Gijs Hi Gijis - this error you refer to about loading large files into pymaker - can you elaborate on this? I've been having issues creating releases and I've found that it's due to either the compressed file being too large (~75kb) or the uncompressed files being too large (~275kb). Do you know if it is the total size that matters, or perhaps a single file in the folder that causes the problem? My largest file is 57kb.

    This error really sucks, is there any effort being made to fix it? I've been posting all over the forum but no one is acknowledging my pleas.

    Best,
    Troy



  • Solved my issue - it was how I was establishing the MQTT connection to Pybytes.

    For various reasons (which I won't cover) I cannot use the autostart or connect() functions, I need to manually establish a Pybytes connection.

    For anyone looking to do this in the future, you need to call all of the following for the connection to emulate the library functions:

    pybytes.__pybytes_connection.__network_type = 1
    pybytes.__pybytes_connection.__initialise_watchdog()
    pybytes.__pybytes_connection.communication_protocol('wifi')
    pybytes.enable_terminal()
    pybytes.send_ping_message()

    With this your terminal and other functions should work as normal - but allows you to manage creation of the internet connections.



  • @Gijs I can confirm I'm getting this issue as well. 1.20.2.r1, Pybytes 1.6.0. G01

    I've deleted some files of my build but still getting the issue over LTE and Wifi when I manually connect to Pybytes using pybytes.connect_wifi() or pybytes.connect_lte() functions

    When I use pybytes.connect() it seems more robust.

    This is a fairly big issues with the pybytes connection library (no timeout on lte.attached blocking whole application, only single wifi ssid allowed, limited handling of disconnects) - which has forced me to use the manual connection functions.

    UPDATE - removed most files from my device but no change

    EDIT- realised my error was slightly different:

    Unhandled exception in thread started by <bound_method>
    Traceback (most recent call last):
    File "_msg_handl.py", line 259, in _io_thread_func
    File "_msg_handl.py", line 197, in _receive_packet
    File "_mqtt_core.py", line 398, in _recv_callback
    File "_mqtt_core.py", line 368, in _parse_publish
    File "_mqtt_core.py", line 341, in _notify_message
    File "_mqtt.py", line 91, in set_callback
    File "_pybytes_protocol.py", line 392, in __process_recv_message
    KeyError: 255



  • Hi Gijs,

    I can confirm that it is due to the file sizes in my file system. I removed about 50kb of files reducing the filesystem size from 330kb to 284 kb, and now it works.

    Thanks for the info.

    Cheers,
    Troy



  • Hi Gijs,

    Firmware version 1.20.2.r1
    but it I think it also happens on all 1.20.2 versions. I'm not sure if it happens on previous version
    1.6MB / 4MB memory used

    Please let me know if you need any other information, I'm happy to help as this is a very useful feature for me.

    Thanks,
    Troy



  • Hi,
    Unfortunately I cannot reproduce the error you are describing..
    I know there is an error related to loading large files into Pymakr online (buffer size) and a fault where it blanks out when there are no files on the device, but I have yet to see this one.

    Could you perhaps provide some more details? Which firmware version are you running?

    Best,
    Gijs


Log in to reply
 

Pycom on Twitter