Send Sensor Data via Wifi to Laptop

Hi everyone

We have a student project where we try to give a blind person audio feedback when driving an rc car.

The car is equipped with LIDAR and ultrasonic sensors. These sensors measure the distance to obstacles, which should then be sent to a laptop via a wifi connection. A python script will take up these values and transform them into the audiofeedback.

I was able to connect the Arduino to my laptop and to my phone. But my python script doesn't get any data from the Arduino. I tried it with UDP.

Has anyone done something similar?

We are using an Arduino R4 Wifi and I used and tried to adapt following codes:
https://docs.arduino.cc/tutorials/uno-r4-wifi/wifi-examples#access-point
https://docs.arduino.cc/tutorials/uno-r4-wifi/wifi-examples#wi-fi-udp-send-receive-string

I got a lot of error messages about the IP address and the Port:
[WinError 10049] The requested address is not valid in its context

I really don't know how to proceed, ChatGPT isn't of much help (mostly because I know too few to ask good questions).

I would be happy for feedback and of course provide much more information if needed.

In the end of the project we have to make a video. We will happily mention anyone that helped us reach our goals!

Have you considered Bluetooth? It will have a lot less latency then the internet.

We considered Bluetooth before.
Right now we generate the sound with buzzers, that are attached to the car. However, this kind of audiofeedback is not loud enough when the car is driving. We then tried to send it via Bluetooth, using the mozzi sound library and AD2P, but I got an error the esp_idf_version, which I wasn't able to resolve, which is why we decided to just send the data and generate the sound on the pc.

Do you think Bluetooth would be better to send the sensordata? Is this possible?

We thought Wifi should have a greater range and would be faster?

1 Like

No doubt about it and yes it is faster but when stating latency I am referring to the amount of time from when for example a button is pressed and the actual action occurs. Bluetooth is point to point, WiFi is not, it runs a serendipitous route, which will add time. The amount of time will vary depending on WiFi traffic, system loading, etc. It is your project so wherever works for you is the best.

Thank you for the reply.

I think in this case it would be wise to reconsider bluetooth, but not sending the tone like before, but the sensor data. Have you maybe done this before and know how to do it?

We are all new to this and using Arduino for the first time, so any links/ideas/tipps are helpful for us to dig in deeper.

1 Like

is it possible to run ESP-now or a WiFi Access point on a Arduino R4 Wifi

1 Like

Yes it's possible to make an Access Point on the arduino and I was able to do that.
Reading into the file on your link I think it could be an option to have a second arduino connected to my pc which gets data from the one on the car.
Like this I could send the data to the second arduino and option a) feed them into my laptop or option b) generate the sound on the arduino itself --> not having the need of a laptop

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.