get some data, full revolution in steps of 10 gradians (9 degrees)
for gradians in range(0, 400, 10):
print(p.transmitAngle(gradians))
but for some reason i get None values this time can you help me with it?
P.S. I’m using jetson Nano and i got the recommended libraries downloaded.Check the usbport with lsusb to see whether my device is recognising the sonar and it is.I dont no what to do next.
This string is missing a closing curly brace, which should be a syntax error. I’d recommend posting code in code blocks in future - see the How to Use the Blue Robotics Forum post for how to do that
More generally, did the initialisation work? If not, are you sure the device is actually at /dev/ttyUSB0? If initialisation fails then none of the other interactions with the sonar will work either.
Thank you for the code advice I’ll try to do that on further posts.
The code that i posted was from an earlier post and it send me through this forum by you (i suggest you correct that one as well) and i corrected that one but somehow i just forget to correct it again while i was posting this recent post. And i am positive that it is connected to /dev/ttyUSB0 i checked it with lsusb and also got some info via serial.What else can i do?
This was the code from that post, which already has the relevant closing brace. I haven’t edited that since I wrote it, so presumably it was just a copying error
If you managed to get some info then perhaps the connection is fine? Again, did the initialisation work?
If the device isn’t connecting or initialising as expected, but you know that the port is correct, it may help to
ensure you’re using a suitable power supply for the Ping360 (11-25V, >5W capacity)
update to the latest version of the library
restart the Ping360
unplug and re-plug the connection to the Jetson Nano
Hi I’d like to confirm that that the power supply should be greater than 5W? cause in ,im running into this exact same problem and the datasheet says max power supply=5W so right now i have it set to 12V 0.4 A, the output is 12V 0.08A
ive connected it to my ground station laptop
Also another thing is that im testing it from a benchtop setup, so i havent put it in water or anything, not sure if thats the problem
Hi @axppxsky -
Operating it on the bench, dry, shouldn’t cause an issue.
The Ping360 should be fine at 12V with a .4 A power supply limit, unless you see the voltage dropping and that limit being hit.
I’m assuming you don’t hear the rotation start when you run the code?
Have you been able to use the unit normally with your computer and PingViewer, via the direct USB connection?
If not, it may be worth opening the unit, confirming it is dry and plugged in correctly, with the expected LED activity during use?
You’re right. I dont hear any rotation start when i run the code.
However the initialised line does return true.
No i havent been able to use pingviewer, due to system compatibility issues. but that shouldnt be the necessary right? as i could test it with the code too?
Also yes i have connected it via direct USB to the laptop.
Is opening the unit the only way? I know the Sonar hasnt been underwater for more than a year now, so i would assume it should be dry?
Hi @axppxsky -
If it’s rotating ok, the data it returns could be 0 if the unit is in air?
What OS are you using that Pingviewer is not compatible with? It is the best way to confirm the hardware is functional easily, even in air.
Hi @axppxsky -
By cannot work in air, Eliot means you will not collect any data when the unit is in air, as the sound waves are ultrasonic and transitioning from the oil-filled housing to a medium of different density (air instead of water.)
I would recommend trying another computer or updating your OS to verify the hardware works. Or putting the device in water, yes. Best of luck!
Hi @axppxsky -
Before you saw that screen, you should have seen a connection screen where detected Ping devices are listed. Was that the case? How is the Ping360 connected to the machine running Ping Viewer?
Hi @axppxsky -
If you can hear the sonar head moving in the ping360, and it communicates as expected as you’ve shown but no data is present, your hardware may have a problem. Have you opened the unit before? I’d recommend verifying the transducer and wires on the backside of the PCB are connected with no signs of corrosion.
following up to the above, ive recieved a new sonarwhich works fine, and i can see the data on pingviewer. however im trying to run this code
from brping import Ping360
# connect to and initialize device
p = Ping360()
p.connect_serial('/dev/ttyUSB0', 115200)
print(f'{p.initialize() = }')
# set some settings
print(p.set_number_of_samples(200))
print(p.set_gain_setting(1))
# get some data, full revolution in steps of 10 gradians (9 degrees)
for gradians in range(0, 400, 10):
print(p.transmitAngle(gradians))