UnicodeError when I upload a project with Pybyte



  • Hello, I have been experimenting with Pybytes and Pymakr online. After several attempt to get the code upload via Pymakr in Pybytes, I settled with using the zip file option and manually starting the Pybytes on the Gpy device. I uploaded the code, clicked save and export, and selected the device, device came online, and everything ticked green on the interface. But once I click close on the interface, it always throw an error in the REPL of my VSCode. The error is shown below:

    >>> 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 286, in __process_recv_message
    UnicodeError:
    

    The size of the whole folder is around 10kb and I check if the LTE is still connected by doing a simple print(socket.getaddrinfo('pybytes.pycom.io', 80)) , with the result return the Ip Address. Thank you



  • An update:

    Thank you for the offline support. To give an update for the community to benefit from, the reason for the failure was due to a special character in the python file not covered by the ASCII format. The advice was to use only ASCII format in all the text/python files.



  • Hello Gijs, thank you for responding. To further elaborate, kindly find steps below:

    • On the Pybytes console, I clicked on the Pymakr option located at left hand side menu bar , then selected the "upload a zip file option"
    • After uploading, the files were shown in the Pymakr console. Files included main.py, boot.py, lib/some_module.py, ... lib/some_other_module.py
    • After checking, all the necessary files were present
    • So I clicked on the "save/export" located on the top right corner of the console page
    • Then I selected the required device and waited for it to come online
    • Upload started and a few of the files were uploaded and updated on the board. Midway into the upload, the aforementioned error pops up in the console of VS code connected to the device (Gpy).

    I have tried both LTE and WiFi to confirm if it was a connectivity issue, however, both returned the same error. I also captured the debug messages in a log file (Is it okay to send the log file through the CSR email ?). Thank you



  • Hi,

    Could you elaborate what you mean with this:

    But once I click close on the interface

    I tried to reproduce your issue by provisioning the device to Pybytes with Wifi and the activation string (worked), the opening Pymakr online in Pybytes and load the files (worked), change the files, hit save and upload (worked) and could not reproduce the output you're getting.
    You mention using a zip file option, though I'm not sure what you mean with that exactly. I could imagine the zip file throwing the UnicodeError, as it is not a unicode format (and the operation throwing the error is a String decode), though let me know if I'm wrong.

    Best,
    Gijs


Log in to reply
 

Pycom on Twitter