# How to connect a ping sonar to raspberry pi 3 a type for b+

**URL:** <https://discuss.bluerobotics.com/t/how-to-connect-a-ping-sonar-to-raspberry-pi-3-a-type-for-b/12864>\
**Category:** Ping Sonar Devices\
**Created:** [September 4, 2022, 7:48pm UTC](https://discuss.bluerobotics.com/t/how-to-connect-a-ping-sonar-to-raspberry-pi-3-a-type-for-b/12864 "2022-09-04T19:48:31Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahmedrashed](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@ahmedrashed](https://discuss.bluerobotics.com/u/ahmedrashed)\
**Post date:** [September 4, 2022, 7:48pm UTC](https://discuss.bluerobotics.com/t/how-to-connect-a-ping-sonar-to-raspberry-pi-3-a-type-for-b/12864/1 "2022-09-04T19:48:31Z")

</div>

I bought a type sensor ping sonar from here  
[https://bluerobotics.com/store/sensors-sonars-cameras/sonar/ping-sonar-r2-rp/](https://bluerobotics.com/store/sensors-sonars-cameras/sonar/ping-sonar-r2-rp/)  
You did not clarify how to connect this sensor to raspberry pi With clear and detailed steps, as I could not install a file “AppImage” for raspberry pi This response was

```auto
pi@raspberrypi:~/Desktop/sonar $ chmod a+x pingviewer-Release.AppImage
pi@raspberrypi:~/Desktop/sonar $ ./pingviewer-Release.AppImage
-bash: ./pingviewer-Release.AppImage: cannot execute binary file: Exec format error

```

Please explain the connect method to raspberry pi clearly And what should be proven from libraries in advance

---

<div class="post-metadata">

**Author:** ![EliotBR](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/eliotbr/32/6937_2.png) [@EliotBR](https://discuss.bluerobotics.com/u/EliotBR)\
**Post date:** [September 6, 2022, 2:12am UTC](https://discuss.bluerobotics.com/t/how-to-connect-a-ping-sonar-to-raspberry-pi-3-a-type-for-b/12864/2 "2022-09-06T02:12:32Z")

</div>

Hi @ahmedrashed, welcome to the forum 🙂

To start with, what are you actually trying to achieve here?

[Ping Viewer](https://docs.bluerobotics.com/ping-viewer) is a display software that runs on a topside computer. While you should be able to [compile it yourself](https://discuss.bluerobotics.com/t/ping-viewer-on-raspberry-pi/7076) if you actually want to run it on a Raspberry Pi, that would be a very rare use-case. An ordinary workflow would involve one of

1. Ping Viewer (topside computer) → tether → [BlueOS](https://docs.bluerobotics.com/ardusub-zola/software/onboard/BlueOS-1.0/) (onboard computer (Raspberry Pi)) → [Ping Sonar](https://bluerobotics.com/store/sensors-sonars-cameras/sonar/ping-sonar-r2-rp/) / [Ping360](https://bluerobotics.com/store/sensors-sonars-cameras/sonar/ping360-sonar-r1-rp/) (via USB)
  - most common approach on a vehicle

2. Ping Viewer (topside computer) → tether → [Ethernet Switch](https://bluerobotics.com/store/comm-control-power/tether-interface/ethswitch/) → Ping360 ([ethernet configuration](https://bluerobotics.com/learn/changing-communications-interface-on-the-ping360/))
  - higher performance approach for Ping360 (not relevant for Ping Sonar)

3. Ping Viewer (topside computer) → Ping Sonar / Ping360 (via USB)
  - commonly used when initially testing sensor, without a vehicle

4. manual control via code library (computer/Raspberry Pi/Arduino/etc) → Ping Sonar / Ping360 (via serial/USB/ethernet as relevant)
  - used for custom integrations
  - see “Technical Details” on Ping device product pages for library links

---

<div class="post-metadata">

**Author:** ![ahmedrashed](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@ahmedrashed](https://discuss.bluerobotics.com/u/ahmedrashed)\
**Post date:** [September 6, 2022, 9:24pm UTC](https://discuss.bluerobotics.com/t/how-to-connect-a-ping-sonar-to-raspberry-pi-3-a-type-for-b/12864/3 "2022-09-06T21:24:52Z")

</div>

Hi  
I am using the fourth case. and want to connect the ping 1D to raspberry pi 3 and use the qt tool to display the result in windows. but I could not install the sonar to the raspberry pi to read data from nor open it in the raspberry pi itself.  
another problem is when I install ping viewer in windows and connect it to the sonar the confidence never crosses 40%. I search the forum and found that you suggested checking the wiring so I changed it but the results are still the same, unstable readings with confidence below 40% which is also unstable and varies continuously from zero to 40.  
do you know why?  
and please show me if there is a way to define the sonar in raspberry pi.

---

<div class="post-metadata">

**Author:** ![EliotBR](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/eliotbr/32/6937_2.png) [@EliotBR](https://discuss.bluerobotics.com/u/EliotBR)\
**Post date:** [September 8, 2022, 6:59am UTC](https://discuss.bluerobotics.com/t/how-to-connect-a-ping-sonar-to-raspberry-pi-3-a-type-for-b/12864/4 "2022-09-08T06:59:40Z")

</div>

> [@ahmedrashed](#):
>
> I am using the fourth case. and want to connect the ping 1D to raspberry pi 3 and use the qt tool to display the result in windows.

That’s contradictory - if you’re wanting to control it with the code running on the Raspberry Pi (workflow example 4.) then you won’t be using Ping Viewer and won’t have another computer connected. If you’re wanting to do use a Raspberry Pi as a proxy (that passes along communication to and from your topside Windows computer) then that’s workflow example 1. and you’ll need to install BlueOS or something else that can act appropriately.

> [@ahmedrashed](#):
>
> another problem is when I install ping viewer in windows and connect it to the sonar the confidence never crosses 40%. I search the forum and found that you suggested checking the wiring so I changed it but the results are still the same, unstable readings with confidence below 40% which is also unstable and varies continuously from zero to 40.  
> do you know why?

How are you testing it?

If it’s in an enclosed space or operating around other sonar equipment then it’s very possible there are too many reflections / too much sound around for it to operate properly.

> [@ahmedrashed](#):
>
> and please show me if there is a way to define the sonar in raspberry pi.

I don’t know what you mean by this. If you’re looking to get started with code-based control of the sensor I’d recommend starting out with our [`bluerobotics-ping`](https://github.com/bluerobotics/ping-python) Python library.

---

<div class="post-metadata">

**Author:** ![ahmedrashed](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@ahmedrashed](https://discuss.bluerobotics.com/u/ahmedrashed)\
**Post date:** [September 15, 2022, 5:32pm UTC](https://discuss.bluerobotics.com/t/how-to-connect-a-ping-sonar-to-raspberry-pi-3-a-type-for-b/12864/5 "2022-09-15T17:32:54Z")

</div>

> [@EliotBR](#):
>
> use a Raspberry Pi as a proxy (that passes along communication to and from your topside Windows computer) then that’s workflow example 1. and you’ll need to install BlueOS or something else that can act appropriately.

I want to use a Raspberry Pi as a proxy (that passes along communication to and from your topside Windows computer) I have ubuntu system and a raspberry pi 3 B+  
Please explain the steps that I must follow

---

<div class="post-metadata">

**Author:** ![EliotBR](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/eliotbr/32/6937_2.png) [@EliotBR](https://discuss.bluerobotics.com/u/EliotBR)\
**Post date:** [September 16, 2022, 8:19am UTC](https://discuss.bluerobotics.com/t/how-to-connect-a-ping-sonar-to-raspberry-pi-3-a-type-for-b/12864/6 "2022-09-16T08:19:44Z")

</div>

> [@ahmedrashed](#):
>
> I want to use a Raspberry Pi as a proxy

You can either

1. [Install BlueOS](https://docs.bluerobotics.com/ardusub-zola/software/onboard/BlueOS-1.0/installation/) on your Raspberry Pi, and do the relevant [topside network configuration](https://docs.bluerobotics.com/ardusub-zola/software/onboard/BlueOS-1.0/getting-started/#network-configuration)
  - Doing this replaces any other software you have on your Raspberry Pi, but if the only purpose of the Raspberry Pi is to pass along the ping sonar communications then that’s fine

2. Install our [`bluerobotics-ping`](https://github.com/bluerobotics/ping-python) Python library on your Raspberry Pi, and run the [`pingproxy.py`](https://github.com/bluerobotics/ping-python/blob/master/tools/pingproxy.py) tool, after which it should be detectable by Ping Viewer on the topside computer
  - This is lightweight, but requires a little more knowledge and effort on your part to set up and run
  - you need to manually find the device to connect to (e.g. by running `ls /dev/tty*`)
  - you’ll also need to manually set up [running on startup](https://learn.sparkfun.com/tutorials/how-to-run-a-raspberry-pi-program-on-startup#method-3-systemd) (if that’s a feature you want)

---

<div class="post-metadata">

**Author:** ![ahmedrashed](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@ahmedrashed](https://discuss.bluerobotics.com/u/ahmedrashed)\
**Post date:** [September 16, 2022, 10:14pm UTC](https://discuss.bluerobotics.com/t/how-to-connect-a-ping-sonar-to-raspberry-pi-3-a-type-for-b/12864/7 "2022-09-16T22:14:53Z")

</div>

Thank you very much, my brother, I started to become clear  
But how can you be detectable by Ping Viewer on the topside computer?  
I have installed َQt tool version 5.15.2 in topside computer and raspberry pi Is this tool with this version to do this purpose, or is there an easier way?  
And if she is doing this purpose, please explain the way of linking  
I hope that you will be excused because I am a startingever in learning this things and I would like to use more of your products in the future and work on them  
So can you give me a way to directly communicate with you because I am working on the completion of the graduation project and the date of delivery next week

---

<div class="post-metadata">

**Author:** ![ahmedrashed](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@ahmedrashed](https://discuss.bluerobotics.com/u/ahmedrashed)\
**Post date:** [September 19, 2022, 12:29am UTC](https://discuss.bluerobotics.com/t/how-to-connect-a-ping-sonar-to-raspberry-pi-3-a-type-for-b/12864/8 "2022-09-19T00:29:15Z")

</div>

Hello everyone,  
Uploading: 2022-09-19\_042252.jpg…  
 ![2022-09-19_042252](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/2/27073ab9493ac894af0ff34ecd00f50759f640d9.jpeg)

we are trying to set up the Ping Echosounder with a custom Raspberry using pingproxy.py provided in the ping-python package

 ![2022-09-19_042339](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/3/3ccec3d6fad94f8cbc1bf3e0b1a6bc87bbd6bcb2.jpeg)

The device appears in PingViewer’s device manager  
Why i cant detect device in the ping viewer for Windows or Linux system via UDP  
I connect Ping1D to USB port for rasbperry and i was run pingproxy in raspberry then i was open ping view in pc  
raspberry pi 3 b+ and install `bluerobotics-ping` lib  
and run pingproxy.py as you see in screenshort

---

<div class="post-metadata">

**Author:** ![ahmedrashed](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@ahmedrashed](https://discuss.bluerobotics.com/u/ahmedrashed)\
**Post date:** [September 19, 2022, 12:33am UTC](https://discuss.bluerobotics.com/t/how-to-connect-a-ping-sonar-to-raspberry-pi-3-a-type-for-b/12864/9 "2022-09-19T00:33:38Z")

</div>

I also use this code and no result  
 ![2022-09-19_043217](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/1/1cab2e4cbca3648528067574ac554a0c8cadb382.jpeg)

---

<div class="post-metadata">

**Author:** ![ahmedrashed](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@ahmedrashed](https://discuss.bluerobotics.com/u/ahmedrashed)\
**Post date:** [September 19, 2022, 12:41am UTC](https://discuss.bluerobotics.com/t/how-to-connect-a-ping-sonar-to-raspberry-pi-3-a-type-for-b/12864/10 "2022-09-19T00:41:59Z")

</div>

I want to do this  
Ping Sonar → BLUART → Raspberry Pi 3B → [pingproxy]→ Topside pc (windows or linux [Ping Viewer]

---

<div class="post-metadata">

**Author:** ![EliotBR](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/eliotbr/32/6937_2.png) [@EliotBR](https://discuss.bluerobotics.com/u/EliotBR)\
**Post date:** [September 19, 2022, 4:36am UTC](https://discuss.bluerobotics.com/t/how-to-connect-a-ping-sonar-to-raspberry-pi-3-a-type-for-b/12864/11 "2022-09-19T04:36:57Z")

</div>

Hi @ahmedrashed,

I’ve moved your new post and comments to this post, since it’s on the same topic.

> [@ahmedrashed](#):
>
> I also use this code and no result
> 
> ```shell
> pi@raspberrypi:/usr/local/bin $ python3 pingproxy.py --device /dev/ttyUSB1
> 
> ```

pingproxy does not have any printed output, so “no result” most likely means it’s running as intended.

Since you seem to be using PuTTY you presumably know the IP address of your Raspberry Pi. In Ping Viewer can you try making a Manual Connection, and selecting

- **Device:** Ping1D
- **Communication:** UDP
- **UDP Host:** \<your Raspberry Pi IP address\>
- **UDP Port:** 9090

(while `pingproxy.py` is running on the Raspberry Pi)

---

<div class="post-metadata">

**Author:** ![ahmedrashed](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@ahmedrashed](https://discuss.bluerobotics.com/u/ahmedrashed)\
**Post date:** [September 22, 2022, 8:01pm UTC](https://discuss.bluerobotics.com/t/how-to-connect-a-ping-sonar-to-raspberry-pi-3-a-type-for-b/12864/12 "2022-09-22T20:01:24Z")

</div>

Thank you, my friend, the method has succeeded  
I have another inquiry regarding the use of sonar to study the tidal status  
What is the code used in this process and you can operate on

---

<div class="post-metadata">

**Author:** ![EliotBR](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/eliotbr/32/6937_2.png) [@EliotBR](https://discuss.bluerobotics.com/u/EliotBR)\
**Post date:** [September 23, 2022, 7:36am UTC](https://discuss.bluerobotics.com/t/how-to-connect-a-ping-sonar-to-raspberry-pi-3-a-type-for-b/12864/13 "2022-09-23T07:36:43Z")

</div>

> [@ahmedrashed](#):
>
> I have another inquiry regarding the use of sonar to study the tidal status  
> What is the code used in this process and you can operate on

I’m not certain what you mean by this, or what you’re trying to achieve.

I haven’t used our Ping Sonar to study tides before, so I don’t have code targeted to that use-case. If you’re using Ping Viewer it will automatically log the profile and distance data in the [`Sensor_Log`](https://docs.bluerobotics.com/ping-viewer/logging-and-user-files/) folder, which you can replay with Ping Viewer or [retrieve for analysis (with code)](https://discuss.bluerobotics.com/t/retrieve-ping-sonar-data-for-analysis/11795). Alternatively you can use code to control the sensor, in which case you can [record the data to a csv](https://discuss.bluerobotics.com/t/recording-ping-data-onboard/12187) as it gets created.
