Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to receive data message from dashboard #71

Closed
donbonjenbi opened this issue Dec 30, 2020 · 3 comments · Fixed by #74
Closed

Unable to receive data message from dashboard #71

donbonjenbi opened this issue Dec 30, 2020 · 3 comments · Fixed by #74
Labels
bug for issues

Comments

@donbonjenbi
Copy link

Describe the problem

Upon receiving a data message from the dashboard, I'm getting the following error:

Actual behavior

Exception in thread Thread-2:
Traceback (most recent call last):
File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
File "/usr/lib/python3.7/threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.7/dist-packages/Hologram/CustomCloud.py", line 336, in __incoming_connection_thread
recv += result
TypeError: can only concatenate str (not "bytes") to str

Steps to reproduce the behavior

result = hologram.network.connect()
hologram.initializeReceiveSocket()
for i in range(20):
   message = self.hologram.popReceivedMessage()
   print(f"Data_msg received:  {message}" if message else "no data_msg")

System information

  • Linux
  • hologram-python version: 0.9.0
  • Python 3.7
  • NOVA + SARA-R10M
@donbonjenbi donbonjenbi added the bug for issues label Dec 30, 2020
@donbonjenbi
Copy link
Author

I got it to work if I modify the following in CustomCloud.py:

    def __incoming_connection_thread(self, clientsocket):

        clientsocket.settimeout(RECEIVE_TIMEOUT)

        # Keep parsing the received data until timeout or receive no more data.
        recv = ''

changed to:

    def __incoming_connection_thread(self, clientsocket):

        clientsocket.settimeout(RECEIVE_TIMEOUT)

        # Keep parsing the received data until timeout or receive no more data.
        recv = b''

@DomAmato
Copy link
Contributor

DomAmato commented Jan 5, 2021

Thanks for pointing this out, ill make a fix for it

@DomAmato
Copy link
Contributor

DomAmato commented Jan 5, 2021

Should be fixed by #74

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug for issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants