Loosing connection with Bpod

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Loosing connection with Bpod
#1
Hi Josh,

I have been having some instability issues with the Bpod 0.7 running on a Windows 7. I am using the Gen2 repository and the StateMachine_v16_Bpod0_789 firmware. It was working fine but today, when running a protocol, after a few trials the Bpod stops working and I get the following error:

Code:
Error using ArCOMObject_Bpod/read (line 286)

Error: The serial port returned 0 bytes.

Some times Windows also says that he no longer recognizes the USB device, in the middle of protocol run.
I tried re-uploading the firmware, and Windows reboot does not help either.
I'll continue testing it to see if I can figure the problem out, but maybe you could give me a hint?
Best,
Sebastian.
Reply
#2
Hi Sebastian

Can you please paste the entire MATLAB error message? This will help me determine which line it's crashing on.
How long was it working fine before this started? Did problems start shortly after the firmware update? 
What other devices are on the USB hub?
Also, what is the model of computer?

Thanks,

Josh
Reply
#3
Hi again, Sebastian.


I found a bug in firmware v16 that may be causing your issue. It's resolved in v17 in the Gen2 repository.

Thank you for the bug report!

Best,

Josh
Reply
#4
Hi Josh,

I've upgraded the firmware and am still running into this exact same issue (no data returned when RunStateMatrix is run). It has only been occurring on some rigs but not others which has slightly different peripheral devices plugged in.

Thanks,
Tim
Reply
#5
Hi Tim

Are you using Sebastian's exact setup? If not, which OS and MATLAB version? Do you have Psychtoolbox installed?
Can you please paste the entire MATLAB error message? This will help me determine which line it's crashing on.
What ports and modules do you have plugged into the Bpod device, and which other USB devices into the same USB hub?
Did you use Settings > Ports from the Bpod console, to select only the ports that are plugged in?

Thanks,
Josh
Reply
#6
Hi Josh,

it's me again, I come back to this thread since I am still having the same issue with the Bpod. Below I copy the error I am getting :

Code:
Error using ArCOMObject_Bpod/read (line 291)
Error: The serial port returned 0 bytes.

Error in RunStateMachine (line 41)
       SMA_Confirmed = BpodSystem.SerialPort.read(1, 'uint8');

Error in RunStateMatrix (line 2)
RawEvents = RunStateMachine;

Error in MyProtocolGONOGO (line 180)
   RawEvents = RunStateMatrix;

Error in run (line 96)
evalin('caller', [script ';']);

Error in NewLaunchManager>LaunchProtocol (line 695)
run(ProtocolPath);

Error while evaluating DestroyedObject Callback

This happens randomly in the middle of experiments. Sometimes I can run long protocols (~a couple of hours) without any problem, and sometimes after 20-30 minutes of protocol running Matlab throws this error. 
I have the Bpod 0.7 on a Windows 7 machine with Psychotoolbox installed, and I am using the Gen2 repo and the StateMachine_v16_Bpod0_789 firmware.
The computer has a mouse, a pair of speakers and webcam connected through USB. 
In Settings > Ports on the Bpod console I have only Port 1 input enabled (the only port I am using). 
For a moment I had the impression that when re-uploading the firmware to the Bpod things went better, but it is hard to tell since errors are so random. Regarding the firmware update, I should say that I followed the instructions in the Bpod wiki, however I cannot complete the upload through the Native Port as indicated, the upload stalls at some point. Typically I get this in the Arduino software during the firmware upload:

Code:
Write 44212 bytes to flash (173 pages)

[                              ] 0% (0/173 pages)
[==                            ] 9% (17/173 pages)

And it does not progress further. However, if uploaded through the Programming Port, things run smoothly (of course I then reconnect the Bpod through the native USB port).


I should admit that I still have to test the Bpod with another USB cable (will soon buy a new one), but I wanted to know what was your opinion on this. 

Thank you in advance.
Best,
Sebastian.
Reply
#7
Hi Sebastian

If you routinely experience a stalled firmware upload, the Arduino Due board in your Bpod may have failed. Firmware upload should proceed from the native USB port with no problem. The USB cable is another possibility.

If we sold you the Bpod in the past year, we'll ship you a replacement Arduino Due board at no cost - just email your request to support@sanworks.io

On a separate topic, you need to use the latest state machine firmware with the current Bpod_Gen2 repo MATLAB software. The software *should* error out, with a message to update, if your firmware is old. Firmware is up to v18 now, and has been moved to: 

https://github.com/sanworks/Bpod_StateMachine_Firmware

In this repository, the branch indicates the firmware version (a setup recommended by developers at Champalimaud Foundation, to simplify collaboration with the pyBpod project). You'll want to use firmware matching your board from the /Preconfigured/ folder, in your case /Preconfigured/StateMachine-Bpod0_789/

I'd also pull a fresh copy of Bpod_Gen2, since it sounds like you weren't being notified about old firmware.

Please let us know what you'd like to do, and whether swapping the USB cable helps.

-Josh (From Hana's account)
Reply
#8
Hi Josh,

thanks again for your quick response. 
Yes, it seems that I was missing the updates. I re-pulled the Bpod Gen2 repository and updated the firmware.

I still wasn't able to upload the firmware through the USB native port, only through the programming port. And when disconnecting and reconnecting the Bpod in different USB ports in the governing machine, sometimes the Bpod wasn't recognized, and was labeled as "Unknown device" in the Bus controllers section on Window's Device Manager. But then I changed the USB-miniUSB cable for a new (and quite shorter) one and the Bpod was consistently recognized and I could upload the firmware through the native port. The previous cable was 3 m long (the Bpod is not close to the governing machine). With this long cable, when the PC was able to recognize the Bpod and the firmware uploaded through the programming port, I was able to run Bpod on Matlab but was having these random miscommunication between Matlab and the Bpod. Naive question: do you think that the length of the cable could introduce some sort of delay that was messing things up? Or is it just a malfunctioning cable? I ask because if I have to use a shorter cable I should rearrange the setup.

Thanks again,
Sebastian.
Reply
#9
Hi Sebastian

I'm glad you were able to troubleshoot it to the cable.
We routinely use USB cables up to 1 meter with Bpod, without communication issues.
Bpod ships with this cable, which is USB2 compliant and shielded. The equivalent shielded 3 meter cable is this one - though we haven't explicitly tested it. A bad cable, or a cable with the wrong specs, could definitely result in data loss due to noise. I would also be aware of the power budget of your computer's USB hub - since Bpod has an on-board solenoid valve driver, it pulls ~300mA. If you have many other power-hungry devices on the hub, you may not have enough power to run Bpod properly.  In this case, powering it with a 12VDC adapter (i.e. this one) will eliminate Bpod's power draw from the USB hub. 

I hope this helps!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)