streaming stops on Raspberry Pi via Wifi shield+cyton / D2 LED behaves weirdly

fizzafarooq008fizzafarooq008 UET, Lahore
edited November 2019 in Wifi Shield

I modified test_wifi.py provided by OpenBCI and working with my code for quite a long time and it was running fine on windows. Now, as I want to run my project on Raspberry Pi I shifted the code on Pi but now it is causing few problems related to connectivity with wifi shield. On the first run, when board is powered on and Pi is connected to OpenBCI-XXXX, the code runs fine for some time but then suddenly streaming stops and D2 led on wifi shield turned off. D2 led quite weirdly turns on for a slight moment with very very dim light every 5-6 seconds. Pi's wifi shows that it is connected to wifi shield but the streaming stopped. When I stop my code execution, D2 led remains turned on (without blinking) till i re-run my code. upon re-running, this time streaming do not start and D2 Led shows similar weird behavior. and following error occurs.


Traceback (most recent call last):
File "/home/pi/.local/lib/python3.5/site-packages/urllib3/connectionpool.py", line 672, in urlopen
chunked=chunked,
File "/home/pi/.local/lib/python3.5/site-packages/urllib3/connectionpool.py", line 421, in _make_request
six.raise_from(e, None)
File "", line 3, in raise_from
File "/home/pi/.local/lib/python3.5/site-packages/urllib3/connectionpool.py", line 416, in _make_request
httplib_response = conn.getresponse()
File "/usr/lib/python3.5/http/client.py", line 1198, in getresponse
response.begin()
File "/usr/lib/python3.5/http/client.py", line 297, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.5/http/client.py", line 266, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/pi/.local/lib/python3.5/site-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/home/pi/.local/lib/python3.5/site-packages/urllib3/connectionpool.py", line 720, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "/home/pi/.local/lib/python3.5/site-packages/urllib3/util/retry.py", line 400, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/home/pi/.local/lib/python3.5/site-packages/urllib3/packages/six.py", line 734, in reraise
raise value.with_traceback(tb)
File "/home/pi/.local/lib/python3.5/site-packages/urllib3/connectionpool.py", line 672, in urlopen
chunked=chunked,
File "/home/pi/.local/lib/python3.5/site-packages/urllib3/connectionpool.py", line 421, in _make_request
six.raise_from(e, None)
File "", line 3, in raise_from
File "/home/pi/.local/lib/python3.5/site-packages/urllib3/connectionpool.py", line 416, in _make_request
httplib_response = conn.getresponse()
File "/usr/lib/python3.5/http/client.py", line 1198, in getresponse
response.begin()
File "/usr/lib/python3.5/http/client.py", line 297, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.5/http/client.py", line 266, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/pi/Desktop/fizza/Online_testing_wheelchair_v3_25_10_19/main_online_wheelchair.py", line 174, in
shield.set_channel_settings(channel=i + 1, use_srb1=False)
File "/home/pi/Desktop/fizza/Online_testing_wheelchair_v3_25_10_19/openbci_wifi.py", line 456, in set_channel_settings
self.wifi_write(command_send)
File "/home/pi/Desktop/fizza/Online_testing_wheelchair_v3_25_10_19/openbci_wifi.py", line 260, in wifi_write
json={'command': output})
File "/home/pi/.local/lib/python3.5/site-packages/requests/api.py", line 116, in post
return request('post', url, data=data, json=json, **kwargs)
File "/home/pi/.local/lib/python3.5/site-packages/requests/api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "/home/pi/.local/lib/python3.5/site-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/home/pi/.local/lib/python3.5/site-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/home/pi/.local/lib/python3.5/site-packages/requests/adapters.py", line 498, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))


I can not figure out why this issue occurs only with Pi and not on windows.

Comments

  • wjcroftwjcroft Mount Shasta, CA
    edited November 2019

    Fizza, hi.

    (1) Have you tried streaming from the Cyton to your Raspberry PI, using only the Cyton dongle plugged into the Pi? [Without Shield?]
    (2) Which model Pi is this? Are you running the latest Raspbian version? It sounds possible that the Wifi support on the Pi version you have, could have some bugs.
    (3) Is this Pi capable of running the OpenBCI_GUI? This may require the Pi 4.

    See the "Important Notes" section at the top of the page: https://shop.openbci.com/collections/frontpage/products/wifi-shield

    Regards, William

  • retiututretiutut Louisiana, USA

    I'm also interested in any and all OpenBCI + Raspberry Pi setups. Hope to hear Fizza's response to William.

  • Thanks for replying. I am using Pi 3 B+ that runs Raspbian GNU/Linux 9.4
    No, I have not tried streaming from Cyton to Pi using dongle, as I have been using Wifi-shield from the beginning on windows system. I tried to run OpenBCI_GUI on Pi but it did not run.
    I think the driver for wifi provided by OpenBCI will work well on Ubuntu, as I have once ran OpenBCI_GUI on it. If it worked then I might install Ubuntu on Pi and then try my code.

  • retiututretiutut Louisiana, USA
    edited November 2019

    We would have to make a special version of the GUI that would run on ARM and all of the libraries for the GUI.

    So for now, I do not expect the GUI to run on a Raspberry pi until a special edition is made and tested on a RPi 4. RPi 3 is not powerful enough to run GUI well.

Sign In or Register to comment.