openxc / openxc-vehicle-simulator

BSD 3-Clause "New" or "Revised" License
63 stars 44 forks source link

Exception in thread after new connection #35

Open justinjdickow opened 10 years ago

justinjdickow commented 10 years ago

Tried on two different computers, a Mac with OS X 10.9.3 and ODroid with ubuntu 14.04. I'm connecting using a network device. Dev phone is a Galaxy Nexus. When I connect to the emulator the terminal logs

New connection to 0.0.0.0 from ('192.168.0.151', 53557)
Exception in thread Thread-3:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/home/odroid/Projects/openxc-vehicle-simulator/enabler_connection.py", line 68, in run
    data = self.connection.recv(1024)
error: [Errno 104] Connection reset by peer

Exception while sending data: [Errno 32] Broken pipe
Connection dropped.

On the phone I do not receive any callbacks and logcat spams

WAIT_FOR_CONCURRENT_GC blocked
GC_CONCURRENT freed
justinjdickow commented 10 years ago

anyone out there?

sudo-a13 commented 10 years ago

@justinjdickow so not sure about your specific problem, but am able to get the simulator to work. Can you confirm the version of the openxc-enabler you are using?

DaveMelcher commented 10 years ago

Sorry Justin, I've been on paternity leave. I'll push this toward the top of my queue.

DaveMelcher commented 10 years ago

@justinjdickow When you see this, does your sim continue to function? If yes, I've replicated the issue, and I'm looking into it. (Replicated with a Mac OSX 10.9.4 and a Google Nexus 4.)

@sudipto13 the exception doesn't kill the simulator. Everything seems to continue working. Whatever's screwing up, it seems to be recovering.

justinjdickow commented 10 years ago

@DaveMelcher Yes, the sim continues to function - good news on this one is that I was able to get access to a Lincoln Navigator and the application I built worked as expected. Hoping to be able to obtain new vehicles soon, but working with the sim would be amazing.

Do you think it will work with a different phone?

DaveMelcher commented 10 years ago

It might be a network issue of some kind.

A clarification: Yesterday I replicated the error message, but the connection wasn't dropped. Everything worked just fine. Today I'm on a different network, and I can't replicate the error message. (Same computer, same phone, same software build.)

Is there anything distinctive about the wifi you're on?

DaveMelcher commented 10 years ago

Hey @justinjdickow , What happens if you comment out handler.start() in listen_loop(self, this_ip) ?

(It's on line 41 in my editor.) The Enabler doesn't actually send anything to the sim, I'm not sure why we're checking for it. (And I notice that the function that actually processes that is never called.)

Let me know how that goes, and if you still get consistent disconnects, please post the new error here.

peplin commented 10 years ago

The Enabler doesn't actually send anything to the sim, I'm not sure why we're checking for it

It does! I use it very often for testing if a command is sent properly from my app, through the Enabler to the VI (added the feature here: https://github.com/openxc/openxc-vehicle-simulator/commit/71035ca0a2a823a01de7a000b3ac3bc0cff7515c)

DaveMelcher commented 10 years ago

Well shoot. (Yeah, I misread the line in simulator.py.)

@justinjdickow , Try the experiment anyway and let me know if it changes the behavior of the disconnect. I'm still having a heck of a time reliably replicating this.