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

socket.timeout: timed out #9

Open
TajVeerThiara opened this issue Jan 14, 2020 · 12 comments
Open

socket.timeout: timed out #9

TajVeerThiara opened this issue Jan 14, 2020 · 12 comments

Comments

@TajVeerThiara
Copy link

I repeatedly get a socket.timeout: timeout when I try to run the following python script using the OpenRadar repository.

import csv
from datetime import datetime
import matplotlib.pyplot as plt
import numpy as np
from numpy import savetxt
import mmwave as mm
from mmwave.dataloader import DCA1000
START_CHIRP_TX = 0
END_CHIRP_TX = 2
CHIRP_LOOPS = 128
NUM_CHIRPS_PER_FRAME = (END_CHIRP_TX - START_CHIRP_TX + 1) * CHIRP_LOOPS
NUM_RX = 4
NUM_ADC_SAMPLES = 128
print('start')
dca = DCA1000()
i = 0
while True:
i = i + 1
adc_data = dca.read()
frame3d = dca.organize(adc_data, NUM_CHIRPS_PER_FRAME, NUM_RX, NUM_ADC_SAMPLES)
frame2d = frame3d[:,1,:]
frame2dFt1d = mm.dsp.range_processing(frame2d)
phase = np.angle(frame2dFt1d)
plt.imshow(abs(frame2dFt1d), cmap='viridis')
plt.colorbar()
plt.pause(0.05)
plt.clf()
radar_cube = mm.dsp.range_processing(adc_data)
datetime_object = datetime.now()
print(datetime.now(), "Done frame", i)

image

@owapola
Copy link

owapola commented Feb 21, 2020

Hi Guys,

is there any update on this? I just bumped into the same issue socket timeout. Is there any update here?

I have checked with wireshark and found that the data is indeed streaming over udp. However, the python script seems not able to sniff the data. I noticed that at the same time mmwave studio is listening and capturing correctly? Tension between different udp servers?

@TajVeerThiara Have you been able to fix the issue?

@Immapizzapie @jtang10 @edwin-pan @arjung128 Would you provide some hints here?

@edwin-pan
Copy link
Collaborator

I just ran the code listed above and also ran into the socket timeout issue.

However, when I restarted my kernel via IPython (I'm using Spyder 4.01 via Anaconda) without stopping the data stream from the radar, I got the following output:

Issue_9

Perhaps you should try opening a new terminal as the data streams. The UTP port might be jammed. There's still a lot of work to be done to massage out the connection between OpenRadar and the TI platform. If you'd like to put a pull request.... it'd be much appreciated :)

@owapola
Copy link

owapola commented Mar 2, 2020

Hi Edwin,

thanks a lot for your investigation. We tried to reproduce this without any success. We suspect that this is because of multiple sockets listening to the same udp port (python and mmwave studio). We tried the following two approaches:

  • bind a python socket first and then start mmwave and follow the process
  • start streaming and then kill the mmwave cmdline recorder process (which is listening on the same port)

Neither solved the timeout problem. I guess then the exact sequence to start streaming really matters as apparently you have been able to do it. Would you please shed some more light here? Please note that we use IWR6843 but I don't think that would play any difference.

For the moment, we solved the problem with a different approach. We used pyshark to sniff the udp port and it seems to work. However, it is not as fast as we would expect.

Thanks 👍

@Carbord
Copy link

Carbord commented Dec 7, 2020

I just ran the code listed above and also ran into the socket timeout issue.

However, when I restarted my kernel via IPython (I'm using Spyder 4.01 via Anaconda) without stopping the data stream from the radar, I got the following output:

Issue_9

Perhaps you should try opening a new terminal as the data streams. The UTP port might be jammed. There's still a lot of work to be done to massage out the connection between OpenRadar and the TI platform. If you'd like to put a pull request.... it'd be much appreciated :)

Hi Edwin,
I tried to reproduce this but still got a socket.timeout: timeout. Have you figured out any better solutions to fix this issue so that this repository can be used to collect data in real time?
timeout

@Carbord
Copy link

Carbord commented Dec 9, 2020

Hi Edwin,

thanks a lot for your investigation. We tried to reproduce this without any success. We suspect that this is because of multiple sockets listening to the same udp port (python and mmwave studio). We tried the following two approaches:

  • bind a python socket first and then start mmwave and follow the process
  • start streaming and then kill the mmwave cmdline recorder process (which is listening on the same port)

Neither solved the timeout problem. I guess then the exact sequence to start streaming really matters as apparently you have been able to do it. Would you please shed some more light here? Please note that we use IWR6843 but I don't think that would play any difference.

For the moment, we solved the problem with a different approach. We used pyshark to sniff the udp port and it seems to work. However, it is not as fast as we would expect.

Thanks

Hello, when I ran into the code listed above, I still got a socket.timeout: timeout issue. Would you be kind to share how you solved the issue by using pyshark? Thanks~

@deltaRing
Copy link

Have you opened mmwave studio and configurated it? I encounter this problem at first, too. But when I set the frame option in mmwave studio to 128 and it works great.

@Samleo8
Copy link

Samleo8 commented Jul 8, 2021

I am also currently facing the same issue with socket.timeout and tried the above solutions to no avail.. are there any updates to the issue?

@obabarin
Copy link

Have you opened mmwave studio and configurated it? I encounter this problem at first, too. But when I set the frame option in mmwave studio to 128 and it works great.

I am using the OOB demos and found that I can't set the frame above the default values. when I do this, the demo refuses to run. So changing the frame rate doesn't look like the right solution still.

i'll appreciate other suggestions.

@smaxfish
Copy link

closing firewall works like a charm :)

@chomchom69420
Copy link

Hi, was anyone able to solve this issue? I am having a weird issue here: I am receiving a socket.timeout timeout error only on my Jetson Nano or Raspberry Pi but when I run the same code on Ubuntu on my PC it works like a charm and data is being read from the socket.

On my Jetson Nano, I tried to check if the packets are coming by using the following command
sudo tcpdump | grep 4098

The packets are being received alright. However, whenever I try to read from using the recvfrom function, I get the socket timeout error.

Does anyone have a solution for this? Or has anyone else experienced this?

@chomchom69420
Copy link

chomchom69420 commented Nov 11, 2023

closing firewall works like a charm :)

@smaxfish hi, what do you mean by closing the firewall? do you mean disabling ufw or iptables? I have tried disabling ufw, didn't work. I also tried disabling iptables (whatever I could understand from online articles) by flushing the rules and setting all rules to ACCEPT (don't know if this should do it - if anyone knows about this, please let me know) but it still didn't work.

Please let me know how you did it.

@smaxfish
Copy link

smaxfish commented Nov 16, 2023 via email

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

No branches or pull requests

9 participants