Author Topic: Why can't I netcat into my Rigol DS2072A ? Linux, LAN, etc.  (Read 1293 times)

0 Members and 1 Guest are viewing this topic.

Offline LinuxGuy123Topic starter

  • Contributor
  • Posts: 12
  • Country: ca
Why can't I netcat into my Rigol DS2072A ? Linux, LAN, etc.
« on: August 23, 2022, 05:42:02 pm »
Hi.

I'm trying to send some SCPI message to my DS2072A and I'm not getting any responses.

It is connect to my local network via DHCP at 192.168.1.125.  I can ping it with no problem.

My workstation is running Fedora 36 Linux.

I've tried to send several commands, such as:

Code: [Select]
echo ":DISPLAY:DATA? ON,OFF,PNG" | nc -w1 192.168.1.125 5555 | dd bs=1 skip=11 of=image.png
echo “:SYST:LANG?” | nc -w1 192.168.1.125 5555

# echo ":DISPLAY:DATA? ON,OFF,PNG" | nc -w1 -4 192.168.1.125 5555 | dd bs=1 skip=11 of=image.png
^C
0+0 records in
0+0 records out
0 bytes copied, 136.488 s, 0.0 kB/s




I've tried this both as a regular user and as SU.  What am I missing ?

Thanks

Do I have to enable something on the scope to enable it to reply to SCPI commands ?

Are there any simple tests othre than ping <scope IP> to test why it isn't work ?

My scope is software version 00.03.03.sp1.  Do I need to update it before SCPI commands will work ?



« Last Edit: August 23, 2022, 06:22:27 pm by LinuxGuy123 »
 

Offline gnif

  • Administrator
  • *****
  • Posts: 1704
  • Country: au
  • Views and opinions are my own
    • AMD
Re: Why can't I netcat into my Rigol DS2072A ? Linux, LAN, etc.
« Reply #1 on: August 23, 2022, 06:11:28 pm »
I've tried this both as a regular user and as SU.  What am I missing ?

There is no need to do this as `root` as your regular user can open outgoing ports using netcat just fine. While I can't speak to the issue you're having as I am not familiar with the device or the protocol, you should know that unless you specify `-n` to `echo` it will also output a carrage return, which might be messing things up.

For example

Code: [Select]
echo -n ":DISPLAY:DATA? ON,OFF,PNG" | nc -w1 192.168.1.125 5555 | dd bs=1 skip=11 of=image.png
 

Offline LinuxGuy123Topic starter

  • Contributor
  • Posts: 12
  • Country: ca
Re: Why can't I netcat into my Rigol DS2072A ? Linux, LAN, etc.
« Reply #2 on: August 23, 2022, 06:28:24 pm »
There is no need to do this as `root` as your regular user can open outgoing ports using netcat just fine.
OK.

Quote
While I can't speak to the issue you're having as I am not familiar with the device or the protocol, you should know that unless you specify `-n` to `echo` it will also output a carrage return, which might be messing things up.

Are these commands supposed to be sent with a CR or a CR/LF or nothing ?

Thanks for the reply.
 

Offline gnif

  • Administrator
  • *****
  • Posts: 1704
  • Country: au
  • Views and opinions are my own
    • AMD
Re: Why can't I netcat into my Rigol DS2072A ? Linux, LAN, etc.
« Reply #3 on: August 23, 2022, 06:37:15 pm »
Are these commands supposed to be sent with a CR or a CR/LF or nothing ?

That's what I meant, I am unsure if they are, but the `echo` command by default will output a line-feed (\n) if you do not specify the -n switch if you are unaware. This can and has caught me out on occasion in the past.
You can explicitly output a line feed (\n) or a carriage return (\r) with `echo` by using the -e switch, for example

Code: [Select]
echo -ne "SomeText\r\n"

As to why it's not working, if it isn't this, someone here with more experience will need to provide an answer I am sorry.
« Last Edit: August 23, 2022, 06:39:23 pm by gnif »
 

Offline LinuxGuy123Topic starter

  • Contributor
  • Posts: 12
  • Country: ca
Re: Why can't I netcat into my Rigol DS2072A ? Linux, LAN, etc.
« Reply #4 on: August 23, 2022, 07:21:07 pm »
I still can't connect it over the LAN, but USB works.

Code: [Select]
echo "*IDN?" > /dev/usbtmc0; cat /dev/usbtmc0
RIGOL TECHNOLOGIES,DS2072A,DS2D164752690,00.03.03.SP1

I'll update the firmware and report back.
 

Offline mag_therm

  • Frequent Contributor
  • **
  • Posts: 783
  • Country: us
Re: Why can't I netcat into my Rigol DS2072A ? Linux, LAN, etc.
« Reply #5 on: August 23, 2022, 07:37:01 pm »
I use ssh on linux but have not used nc, so not familiar.

Firstly, are you sure that nc is listening as a server on the Rigol?

To check that , you could run nmap like this, (install it first if you don't have it).

nmap -Pn 192.168.1.125

IT takes a minute or two. That will tell you all ports that are open and have servers.

Here is an example of nmap response:
$ nmap -Pn 192.168.1.16
Starting Nmap 7.80 ( https://nmap.org ) at 2022-08-23 15:31 EDT
Nmap scan report for 192.168.1.16
Host is up (0.0054s latency).
Not shown: 998 filtered ports
PORT     STATE SERVICE
21/tcp   open  ftp
3389/tcp open  ms-wbt-server

Nmap done: 1 IP address (1 host up) scanned in 4.89 second
 

Offline LinuxGuy123Topic starter

  • Contributor
  • Posts: 12
  • Country: ca
Re: Why can't I netcat into my Rigol DS2072A ? Linux, LAN, etc.
« Reply #6 on: August 23, 2022, 09:47:58 pm »
$ nmap -Pn 192.168.1.125
Starting Nmap 7.92 ( https://nmap.org ) at 2022-08-23 15:30 MDT
Nmap scan report for 192.168.1.125
Host is up (0.037s latency).
Not shown: 997 closed tcp ports (conn-refused)
PORT     STATE SERVICE
80/tcp   open  http
111/tcp  open  rpcbind
5555/tcp open  freeciv

Nmap done: 1 IP address (1 host up) scanned in 0.70 seconds

I updated via USB.  I'll post the process in another thread.

My network connection works now.

$ echo "*IDN?" | nc -w1 -4 192.168.1.125 5555
RIGOL TECHNOLOGIES,DS2302A,DS2DXXXXX,00.03.06

Turns out these scopes have an HTTP server in them.   

Thanks for your help. 

« Last Edit: August 23, 2022, 10:12:08 pm by LinuxGuy123 »
 

Offline LinuxGuy123Topic starter

  • Contributor
  • Posts: 12
  • Country: ca
Re: Why can't I netcat into my Rigol DS2072A ? Linux, LAN, etc.
« Reply #7 on: August 23, 2022, 10:13:25 pm »
Quote
I use ssh on linux but have not used nc, so not familiar.

Have you logged into a Rigol scope using ssh ?
 

Offline mag_therm

  • Frequent Contributor
  • **
  • Posts: 783
  • Country: us
Re: Why can't I netcat into my Rigol DS2072A ? Linux, LAN, etc.
« Reply #8 on: August 23, 2022, 11:06:22 pm »
No, I have a new GW Instek GDS 1202B.
So far I use USB media in the front socket  to transfer files.
There is a big manual about comms but I have not had time yet to get into it.

But if your Rigol had ssh server up, you would have seen it on nmap.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf