Author Topic: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG  (Read 43518 times)

bateau020 and 8 Guests are viewing this topic.

Offline ExHamHack

  • Newbie
  • Posts: 1
  • Country: au
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #100 on: May 12, 2022, 02:33:28 am »
Hi cent,

I have done some work getting this to work with a JDS2800. I suspect it may have a similar command structure to the JDS6600. It is not perfect and my coding ability is not great. I have it working, however I do get a few glitches occasionally. I suspect the JDS2800 gets overrun with the commands some times and misses one every so often, may be local network related too. I Let it run a couple of times and I usually get a clean sweep. 

In my situation I needed a fixed IP address and a pull up resistor on the ESP8266 module Tx pin.
If you point a web browser at the module IP address you should be able to see if it is working and what it is outputting even if its not compatible with your WaveGen

I have posted my updates to a Github fork at  https://github.com/Hamhackin/espBode/blob/master/JDS2800.md , it follow work done by others SQ6SFO and TimKoers.

 

Offline ceut

  • Regular Contributor
  • *
  • Posts: 154
  • Country: fr
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #101 on: May 15, 2022, 09:25:37 am »
Hi cent,

I have done some work getting this to work with a JDS2800. I suspect it may have a similar command structure to the JDS6600. It is not perfect and my coding ability is not great. I have it working, however I do get a few glitches occasionally. I suspect the JDS2800 gets overrun with the commands some times and misses one every so often, may be local network related too. I Let it run a couple of times and I usually get a clean sweep. 

In my situation I needed a fixed IP address and a pull up resistor on the ESP8266 module Tx pin.
If you point a web browser at the module IP address you should be able to see if it is working and what it is outputting even if its not compatible with your WaveGen

I have posted my updates to a Github fork at  https://github.com/Hamhackin/espBode/blob/master/JDS2800.md , it follow work done by others SQ6SFO and TimKoers.

Hello,
Thank you very much for your work !  :-+ :-+
I will try this later this day, as I have removed ESP and all from my JDS :-\


Edit: I have compared your "esp_jds2800.cpp" and the JDS6600 Communication Protocol PDF: it seems you have right  ;)
All commands starts with "w" and a number to, then, set the right value
Will post the result  :-+


Edit2: It works !
My JDS6600 seems to receive the good command, I have checked the voltage in Vpp and Vrms mode, and also frequency  :-+  It seems that this happens at about 1 time per second ?
Now I have to learn how to use it correctly and try to check a Focal speaker filter  :D

Also, I have not find any webserver on the ESP IP, so I don't know how to check the output ? ???
« Last Edit: May 15, 2022, 10:24:10 pm by ceut »
 

Offline ceut

  • Regular Contributor
  • *
  • Posts: 154
  • Country: fr
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #102 on: May 17, 2022, 08:38:50 pm »
Here is my integration on the back of my JDS6600.
My router is at about 4 meters, but the signal is weak, the integrated antenna is very small, I think I have to mod that now :-\

Maybe some of you have some (simple) ideas for modding this little PCB antenna ?  ???


Edit: I have switched my wifi to channel 13 and I have a lot better response from the ESP now  :-+
(from the ping cmd)
I will check but I think I don't have to mod the antenna now  8)
« Last Edit: May 17, 2022, 10:16:12 pm by ceut »
 

Offline ganevson

  • Contributor
  • !
  • Posts: 25
  • Country: bg
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #103 on: November 09, 2022, 07:40:29 pm »

Hello
Does anyone have experience with a Bode plot between the SDS1104X-E and the PSG9080?
Thanks
 

Offline NickKUK

  • Contributor
  • Posts: 10
  • Country: gb
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #104 on: November 10, 2022, 12:38:57 pm »
Hi,
I have used the 1104x-e bode plot with a standard Apple Mac mini phono jack before using a software AWG I wrote as an extension to a GitHub python project. I've dug out the python code and attached to the post. I suspect the same mechanism can be used to connect to any sound card and let the scope control the pitch (sorry no amplitude or other swanky features). On the Mac mini 2019 this worked from 5Hz to 20KHz before the active filters hit the sound.



I've since got a SDG1032X hacked to 60MHz so I've not used it for a bit.
« Last Edit: November 10, 2022, 12:40:35 pm by NickKUK »
 
The following users thanked this post: arvidb

Offline OsciX

  • Contributor
  • Posts: 16
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #105 on: January 17, 2023, 02:06:56 am »
Do you think that support for the Sony/Tektronix AWG2021 can be added? I understand this is a bit older than some of the generators here, so I'm mainly wondering if it's *technically* possible. I've done a fair bit of SCPI, and I wouldn't mind forking it to add my function generator :)
 

Offline istvan

  • Newbie
  • Posts: 3
  • Country: ro
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #106 on: April 29, 2023, 06:32:10 pm »
Hello, I read your post, I also have a jds6600 signal generator, and a siglent sds 2202x-e oscilloscope, I try to write the sketch on esp=01 (esp8266) via usb programmer, but every time a compilation error appears. can you help me, I don't know where I'm going wrong. how did you proceed step by step I'm not familiar with programming and I don't know where I'm going wrong. I followed the steps posted by Tim
here is massage: In file included from C:\Users\dell\Downloads\espBode-master (1)\espBode-master\espBode\esp_parser.h:5,
                 from C:\Users\dell\Downloads\espBode-master (1)\espBode-master\espBode\esp_network.cpp:4:
C:\Users\dell\Downloads\espBode-master (1)\espBode-master\espBode\esp_fy6800.h:91:8: warning: extra tokens at end of #endif directive [-Wendif-labels]
   91 | #endif _ESP_FY6800_H_
      |        ^~~~~~~~~~~~~~
In file included from C:\Users\dell\Downloads\espBode-master (1)\espBode-master\espBode\espBode.ino:4:
C:\Users\dell\Downloads\espBode-master (1)\espBode-master\espBode\esp_fy6800.h:91:8: warning: extra tokens at end of #endif directive [-Wendif-labels]
   91 | #endif _ESP_FY6800_H_
      |        ^~~~~~~~~~~~~~
C:\Users\dell\Downloads\espBode-master (1)\espBode-master\espBode\espBode.ino: In function 'void loop()':
C:\Users\dell\Downloads\espBode-master (1)\espBode-master\espBode\espBode.ino:54:43: warning: 'WiFiClient WiFiServer::available(uint8_t*)' is deprecated: Renamed to accept(). [-Wdeprecated-declarations]
   54 |         rpc_client = rpc_server.available();
      |                                           ^
In file included from C:\Users\dell\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\libraries\ESP8266WiFi\src/ESP8266WiFi.h:40,
                 from C:\Users\dell\Downloads\espBode-master (1)\espBode-master\espBode\espBode.ino:1:
C:\Users\dell\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\libraries\ESP8266WiFi\src/WiFiServer.h:85:14: note: declared here
   85 |   WiFiClient available(uint8_t* status = NULL) __attribute__((deprecated("Renamed to accept().")));
      |              ^~~~~~~~~
C:\Users\dell\Downloads\espBode-master (1)\espBode-master\espBode\espBode.ino:64:43: warning: 'WiFiClient WiFiServer::available(uint8_t*)' is deprecated: Renamed to accept(). [-Wdeprecated-declarations]
   64 |         lxi_client = lxi_server.available();
      |                                           ^
In file included from C:\Users\dell\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\libraries\ESP8266WiFi\src/ESP8266WiFi.h:40,
                 from C:\Users\dell\Downloads\espBode-master (1)\espBode-master\espBode\espBode.ino:1:
C:\Users\dell\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\libraries\ESP8266WiFi\src/WiFiServer.h:85:14: note: declared here
   85 |   WiFiClient available(uint8_t* status = NULL) __attribute__((deprecated("Renamed to accept().")));
      |              ^~~~~~~~~
C:\Users\dell\Downloads\espBode-master (1)\espBode-master\espBode\esp_network.cpp: In function 'uint8_t handleVxi11(uint8_t*, WiFiClient)':
esp_network.cpp:222:1: error: control reaches end of non-void function [-Werror=return-type]
  222 | }
      | ^
cc1plus.exe: some warnings being treated as errors
exit status 1
control reaches end of non-void function [-Werror=return-type]
 

Offline jemarro12

  • Contributor
  • Posts: 21
  • Country: es
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #107 on: October 16, 2023, 07:26:30 pm »
As some users said previously, i'd like to use RIGOL DG911 as AWG.
I know some basic C from the programming course in University but certainly i´m really lost in pthon.
Could a more advanced programmer if it will be possible nor difficult to do that?
Thanks guys!
 

Offline switchleg

  • Newbie
  • Posts: 2
  • Country: ca
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #108 on: December 06, 2023, 12:32:37 am »
For anyone using a JDS6600 I have fixed the 0hz bug where the AWG does not take the desired frequency causing spikes in the bode plot.  Also supports ESP32 boards.

https://github.com/Switchleg1/espBode
 

Offline bigpriap

  • Newbie
  • Posts: 1
  • Country: ro
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #109 on: February 08, 2024, 08:27:09 pm »
2008274-02008280-1 [ Specified attachment is not available ] [ Specified attachment is not available ]  If you are like me, attracted by the idea of controlling FY6900-60M with Siglent,, as many succeeded, beware of the new models! bought one SDS1104X-E SW V 6.1.37R10, Uboot-OS V 8.3, FPGA V 2021-11-08 HW V 09-06 and one FeelElec FY6900-60M Version V1 .5 .5 .1. 3.I tried many versions of the espbode codes from Github, none works. Voltage settings are OK but if I set frequency, to say, 28Hz on Siglent the AWG is interpreting as 20 Mhz! So I can only run Bode plots betewwn 1 to 60 MHz., not exactly audio domain 😊
I believe is the same problem as I read about FY6900-100M, maybe a frequency digit more that its not backward compatible. I was trying to divide the frequency output on ESP sketch with no results. I am not good enough to modify the software without help but I am ready to test any ideas. Thank you.
P.S. Using the code posted in the previous post by by: switchleg  decimals works, so maybe THIS IS THE WAY. Thank U @by: switchleg!


« Last Edit: February 08, 2024, 09:02:45 pm by bigpriap »
 

Offline switchleg

  • Newbie
  • Posts: 2
  • Country: ca
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #110 on: February 28, 2024, 04:16:51 pm »
You are very welcome. Yes, I fixed multiple bugs and cleaned up the code a bit.
 

Online bateau020

  • Frequent Contributor
  • **
  • Posts: 270
  • Country: fr
Re: Siglent SDS1000X-E and SDS800X-HD: Bode plot with a non-Siglent AWG
« Reply #111 on: May 01, 2024, 02:02:31 pm »
The SDS800X-HD (SDS804X-HD/SDS814X-HD/SDS824X-HD) changed the initialization phase (uses UDP instead of TCP for the port mapping phase, and requires VXI port changes), and as a result, the original script does not work on that scope.
In case you "upgraded" your scope and still want to use the script, see my repo https://github.com/hb020/sds1004x_bode/

I based my fork on the work from Don Becker, and went from there. It includes the following improvements:

* Python 3 migration (Python 2 is dead)
* AD9910 Arduino Shield (thanks Don Becker)
* Rigol DG800/DG900 series AWGs over Ethernet or USB. In theory, you might even be able use this implementation to connect to other Ethernet or USB connected SCPI 1992.0 standard compatible devices.
* Unit-T Uni-Trend UTG1000x (thanks alfredfo) (since 2024-06-27)
* more Feeltech FY devices (since 2024-08-25)

Opened a PR into the original repo.

EDIT: updated to latest content, since I got a PR on my fork. Will keep doing so if/when they arrive, and will add dates.
« Last Edit: August 26, 2024, 02:38:33 pm by bateau020 »
 

Offline Knutselaar

  • Newbie
  • Posts: 3
  • Country: nl
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #112 on: May 25, 2024, 06:06:28 pm »
Hi All,

This is my first post of EEVblog, and I thank everybody for the real work they have done to make this possible.

I have only been shopping here, combined all and made some minor changes.

I've been struggeling with connecting FY6900 SWVersion 1.5.5.1.3 (delivered nov 2023) to my SDS1104X-E SWVersion 6.1.37R10 (delivered may 2024):

The result of my struggle:


I use the espBode-master date 08-12-2020

I had to add ESP_Telnet to my library

I use in the Arduino IDE: the library ESP8266 by ESP8266 community version 2.7.4

In SDS1104X-E Utility--page2/4--I/O--IP Set-- DHCP Disabled

I have discovered that the SDS1104X-E only remembers the first 9 charachters of the WiFi PSK after power down!

I use the TL-WN725N WiFi adapter from TP-LINK for my SDA1104X-E, the WiFi signal must be strong, otherwise you have no steady connection!

I use a 3V3 regulator in my adapter between the ESP01S and FY6900. The uP in de FY6900 has a 3V3 interface. The CH340 has also a 3V3 interface.

In my FY6900 the resistors between CH340 and TTL connector and uP are:
R30 and R32 are 300 Ohm between TTL and uP, R19 and R20 are 2k between CH340 an uP, no need to change!

In esp_config.h change:
*******************************************************************
#define WIFI_MODE_AP
//#define WIFI_MODE_CLIENT

/* WiFi credentials */
#define WIFI_SSID             "wlan_ssid"
#define WIFI_PSK              "wlan_key"

/* Comment this for DHCP. However you'll need to obtain IP somehow. */
#define STATIC_IP
*******************************************************************
 
Into

*******************************************************************
//#define WIFI_MODE_AP
#define WIFI_MODE_CLIENT

/* WiFi credentials */
#define WIFI_SSID             "Your_wlan_ssid"
#define WIFI_PSK              "Your_wlan_key"// no more than 9 charachters, otherwise you have to change your password of your network first

/* Comment this for DHCP. However you'll need to obtain IP somehow. */
//#define STATIC_IP
*******************************************************************
 

The compilerfault:
esp_network.cpp:222:1: error: control reaches end of non-void function [-Werror=return-type]
  222 | }

I inserted quick and dirty an extra line with return 0; in the file esp_network.cpp at line 222, and had no problems afterwards.

Original code: in file "esp_network.cpp" at end of function: "uint8_t handleVxi11(uint8_t *packet, WiFiClient client)"
*******************************************************************
         client.write((uint8_t*)&write_response, sizeof(rcpresp_devReadWrite));
        return 0;
        break;
    }
 }
*******************************************************************
Inserted line with return 0; at line 222:
*******************************************************************
         client.write((uint8_t*)&write_response, sizeof(rcpresp_devReadWrite));
        return 0;
        break;
    }
    return 0;
}
*******************************************************************

The problem of frequency adjustment in the new FY6900 60MHz mentioned by bigpriap a few posts back:

I have changed in esp_fy6900.cpp line 64 and 73 from

snprintf(command, 19, "WMF%08lu000000\n", frequency);

 Into

snprintf(command, 19, "WMF%08lu\n", frequency);


In order to see the IP adress of your ESP01S you have to remove the slashes on line 56 of esp_config.h
//#define DEBUG_PRINTS
becomes:
#define DEBUG_PRINTS

Compile and write to the ESP01S

Start the EPS01S an look at the Serial monitor.

After reading and writing down the IP adress (to be used in the bode plot-menu of the SDS1104X-E), put the slashes back:

//#define DEBUG_PRINTS

and compile and write to the ESP01S and the ESP01S is ready to be used.



Ik hope that this information helps others to get it working.


 

Offline Knutselaar

  • Newbie
  • Posts: 3
  • Country: nl
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #113 on: May 29, 2024, 08:38:46 pm »
Some improvements:


I have encountered loss of connection on a following day.
I checked the IP-adress of the ISP01S and it was different than the day before.

So I changed to static IP-adress in the ESP01S in "esp_config.h":
The choice for "192.168.0.155" is because the network gives IP-adresses upwards from
"192.168.0.100", so 155 is not likely to have double IP's in a home network.
****************************************************
#define STATIC_IP

/* Static ip configuration */
#ifdef STATIC_IP
  #define ESP_IP              192,168,0,155 // 192,168,0,??? is equal to your network
  #define ESP_MASK            255,255,255,0
  #define ESP_GW              192,168,0,0   // 192,168,0,??? is equal to your network
#endif
****************************************************
Above changes are implemenred in the new espBode-master.ZIP file below.

Also in the SDS1104X-E I swiched DHCP Off and set the static IP-adress to 192.168.0.150

I have the Amplitude and Frequency of CH2 coupled to CH1.

The SDS1104X-E sends every frequency command twice to CH1, I stopped the second message.

I also added the driver for the FY3224S as signal generator for the bode plot.

Here are the schematic of the ESP01S coupled to the FY3224S and the source-files espBode-master.




 

Offline Knutselaar

  • Newbie
  • Posts: 3
  • Country: nl
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #114 on: May 29, 2024, 08:43:39 pm »
Second attempt attatchment espBode-master.zip
 

Offline awakephd

  • Regular Contributor
  • *
  • Posts: 101
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #115 on: August 29, 2024, 01:27:18 pm »
I realize this is a very late response, and I may be about to "teach grandma to suck eggs" as the saying goes (tell you what you already know) ... apologies if that is the case.

On choosing an IP address - Knutselaar suggests 192.168.0.155, with the idea that 155 is unlikely to be taken. This is probably going to work most of the time, assuming one's wifi router is set to start addresses at 192.168.0.100 ... but there is a better way: Most (nearly all?) wifi routers will allow you to reserve IP addresses, generally by MAC. Once reserved, you can be confident that no other device will receive that IP address from the router.

Again, I apologize if I am repeating the obvious / mansplaining / etc.!
« Last Edit: August 29, 2024, 05:07:50 pm by awakephd »
 

Offline das_strobel

  • Contributor
  • Posts: 13
  • Country: de
Re: Siglent SDS1000X-E and SDS800X-HD: Bode plot with a non-Siglent AWG
« Reply #116 on: September 06, 2024, 10:14:43 am »
The SDS800X-HD (SDS804X-HD/SDS814X-HD/SDS824X-HD) changed the initialization phase (uses UDP instead of TCP for the port mapping phase, and requires VXI port changes), and as a result, the original script does not work on that scope.
In case you "upgraded" your scope and still want to use the script, see my repo https://github.com/hb020/sds1004x_bode/

Thanks for this work. I cloned your repo and tried it with my brand new SDS1000X HD and my old Rigol DG1062Z (predecessor of the DG800 series) and it works beautifully using "dg800" for the awg parameter. So again: Great work!

I few small comments:

I'm using Ubuntu 22.04 LTS and the lates Python available from the default repos is 3.11, default is 3.10. You have a few debug strings that use the relaxed f-format syntax from 3.12. This unnecessarily breaks the script for the older versions. I fixed it on my side (it is just replacing a few double quotes with single quotes) and then everything works. I'd suggest you might want to change this to make the script more compatible. I can provide you a PR to your repo if you wish.

There is way of running this script without sudo, which enabled me to use the debugger on the script in vscode without running the whole vscode as root:
Code: [Select]
sudo setcap 'CAP_NET_BIND_SERVICE+ep' /bin/python3.10Downside is this enables all python instances to be able to serve privileged ports... But I found this more convenient for debugging.

The final comment will probably only apply to very few people but I wanted to share my findings. Maybe it helps somebody. I got this error message when I started the script:
Code: [Select]
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  [...]
  File ".../sds1004x_bode/sds1004x_bode/awg_server.py", line 88, in create_socket
    sock.bind((host, port))
OSError: [Errno 98] Address already in use
This was due to the fact that on my Linux machine rpcbind was running which is needed by nfs.server. After temporarily stopping it using the command
Code: [Select]
sudo systemctl stop rpcbind.socket rpcbind.service
the script finally worked. Rpcbind can be started again with
Code: [Select]
sudo systemctl start rpcbind.socket rpcbind.service
 

Online bateau020

  • Frequent Contributor
  • **
  • Posts: 270
  • Country: fr
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #117 on: September 06, 2024, 10:20:47 am »
...I cloned your repo
...few small comments

Thanks for the heads up. I will add the proposed changes and comments to the repo. A PR would be best, but I will try to reproduce, since it seems easy to do.
 

Offline das_strobel

  • Contributor
  • Posts: 13
  • Country: de
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #118 on: September 06, 2024, 10:52:11 am »
A PR would be best, but I will try to reproduce, since it seems easy to do.

To spare you some work here is the git diff
Code: [Select]
$ git diff
diff --git a/sds1004x_bode/awg_server.py b/sds1004x_bode/awg_server.py
index 59b1958..b8aea46 100644
--- a/sds1004x_bode/awg_server.py
+++ b/sds1004x_bode/awg_server.py
@@ -101,7 +101,7 @@ class AwgServer(object):
 
         print("Starting AWG server...")
         print(f"Listening on {self.host}")
-        print(f"RPCBIND on {"UDP" if self.portmap_on_udp else "TCP"} port {self.rpcbind_port}")
+        print(f"RPCBIND on {'UDP' if self.portmap_on_udp else 'TCP'} port {self.rpcbind_port}")
         print(f"VXI-11 on TCP port {self.vxi11_port}")
 
         print("Creating sockets...")
diff --git a/sds1004x_bode/awgdrivers/dg800.py b/sds1004x_bode/awgdrivers/dg800.py
index 0db9c19..3b60f0e 100644
--- a/sds1004x_bode/awgdrivers/dg800.py
+++ b/sds1004x_bode/awgdrivers/dg800.py
@@ -26,6 +26,7 @@ WAVEFORM_COMMANDS = {
 # Default AWG settings
 DEFAULT_LOAD = 50
 DEFAULT_OUTPUT_ON = False
+DEBUG_OUT = True
 
 
 class RigolDG800(BaseAWG):
@@ -100,7 +101,7 @@ class RigolDG800(BaseAWG):
             self.enable_output(2, on)
         else:
             self.channel_on[channel - 1] = on
-            self._send_command(f":OUTPUT{channel}:STATE {"ON" if on else "OFF"}")
+            self._send_command(f":OUTPUT{channel}:STATE {'ON' if on else 'OFF'}")
 
     def set_frequency(self, channel: int, freq: float):
         if DEBUG_OUT:
diff --git a/sds1004x_bode/awgdrivers/utg1000x.py b/sds1004x_bode/awgdrivers/utg1000x.py
index b0437be..96af648 100644
--- a/sds1004x_bode/awgdrivers/utg1000x.py
+++ b/sds1004x_bode/awgdrivers/utg1000x.py
@@ -100,7 +100,7 @@ class UTG1000x(BaseAWG):
             self.enable_output(2, on)
         else:
             self.channel_on[channel - 1] = on
-            self._send_command(f":CHAN{channel}:OUTPUT {"ON" if on else "OFF"}")
+            self._send_command(f":CHAN{channel}:OUTPUT {'ON' if on else 'OFF'}")
 
     def set_frequency(self, channel: int, freq: float):
         if DEBUG_OUT:

 

Online bateau020

  • Frequent Contributor
  • **
  • Posts: 270
  • Country: fr
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #119 on: September 06, 2024, 11:25:28 am »
Done. Added some better debugging in the port opening. Tested under Python 3.8. and later.
 
The following users thanked this post: das_strobel

Offline awakephd

  • Regular Contributor
  • *
  • Posts: 101
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #120 on: September 11, 2024, 10:48:06 pm »
I have just gotten a FeelTech FY6900-60M (running firmware version 1.5.4), and was eager to try connecting it to my SDS804X-HD scope using either of the methods discussed in this thread. I first tried the espBode route, making a simple adapter board to connect to the TTL power and serial connector on the back. I downloaded Knutselaar's code, as it seemed to be the most recent (and has a recent success) and uploaded it to an ESP-01 using the Arduino IDE with no problems. I then connected it to the FY6900. I am getting the 3.3v power out of my regulator, and the ESP-01 is connecting to my network. I can ping it with no problems. But the scope refuses to recognize it when I set up the wifi to connect to the ESP-01.

I tried using telnet to connect to the ESP-01. The connection appeared to be successful. However, I could not generate any response from the FY6900 regardless of the command I tried to send it. I am not at all confident that this approach would work in any case ... or should it?

So, I have just now tried the python sds1004x-bode program, the version by bateau020 that adds the ability to talk with the SDS804X. I'm running on Ubuntu 24.04.

I was able to start the program, and it appears to connect to the FY6900, or thinks it does ... and the SDS804X can connect successfully. But apparently the FY6900 is not responding to the commands:

Code: [Select]
sudo python3 bode.py fy -udp
Initializing AWG...
AWG: fy
Port: /dev/ttyUSB0
IDN: fy
AWG initialized.
Starting AWG server...
Listening on 0.0.0.0
RPCBIND on UDP port 111
VXI-11 on TCP port 9010
Creating sockets...

Waiting for connection request...

Incoming connection from 192.168.0.201:809.
VXI-11 CREATE_LINK, SCPI command: inst0
VXI-11 DEVICE_WRITE, SCPI command: IDN-SGLT-PRI?
VXI-11 DEVICE_READ, SCPI command: None
VXI-11 DESTROY_LINK, SCPI command: None
VXI-11 moving to TCP port 9011

Waiting for connection request...

Incoming connection from 192.168.0.201:809.
VXI-11 CREATE_LINK, SCPI command: inst0
VXI-11 DEVICE_WRITE, SCPI command: IDN-SGLT-PRI?
VXI-11 DEVICE_READ, SCPI command: None
VXI-11 DESTROY_LINK, SCPI command: None
VXI-11 moving to TCP port 9012

Waiting for connection request...

Incoming connection from 192.168.0.201:809.
VXI-11 CREATE_LINK, SCPI command: inst0
VXI-11 DEVICE_WRITE, SCPI command: C1:OUTP LOAD,50;BSWV WVTP,SINE,PHSE,0,FRQ,15000,AMP,2,OFST,0;OUTP ON
C1:OUTP LOAD,50;BSWV WVTP,SINE,PHSE,0,FRQ,15000,AMP,2,OFST,0;OUTP ON
Warning: WMF00015000000000 did not produce an expected response after 2 retries
Traceback (most recent call last):
  File "/home/uwake/Software/FY6900/sds1004x_bode-master/sds1004x_bode/bode.py", line 45, in <module>
    server.start()
  File "/home/uwake/Software/FY6900/sds1004x_bode-master/sds1004x_bode/awg_server.py", line 120, in start
    self.main_loop()
  File "/home/uwake/Software/FY6900/sds1004x_bode-master/sds1004x_bode/awg_server.py", line 140, in main_loop
    self.process_lxi_requests()
  File "/home/uwake/Software/FY6900/sds1004x_bode-master/sds1004x_bode/awg_server.py", line 244, in process_lxi_requests
    self.parser.parse_scpi_command(scpi_command)
  File "/home/uwake/Software/FY6900/sds1004x_bode-master/sds1004x_bode/command_parser.py", line 49, in parse_scpi_command
    self.parse_bswv(args, channel)
  File "/home/uwake/Software/FY6900/sds1004x_bode-master/sds1004x_bode/command_parser.py", line 80, in parse_bswv
    self.awg.set_amplitude(channel, ampl)
  File "/home/uwake/Software/FY6900/sds1004x_bode-master/sds1004x_bode/awgdrivers/base_awg.py", line 42, in set_amplitude
    raise NotImplementedError()
NotImplementedError

Some additional information in case it is relevant:

Ubuntu "sees" the scope, connecting to it as /dev/ttyUSB0. This port is in the dialout group, of which I am a member - but shouldn't matter in any case since this is being run under sudo.

I tried running the FY6900 software via wine. It runs ... but no matter what I do, I can't get it to recognize the FY6900. I tried running the software in a Windows 10 VirtualBox, enabling the USB device. And ... it runs just fine, controlling the FY6900. So apparently the FY6900 USB port is operating correctly, at least with Windows.

I thought about trying to run the python program under Windows, but the README.md file only seems to reference a Linux environment, so I was unsure whether that was possible. And in any case, I don't particularly want to have to run this through a VirtualBox instance. For that matter, my ultimate goal is to run it via the ESP-01.

Help! Does anyone have any suggestions, tricks, or helpful questions to offer?

The FY6900 is the 60M version, running version 1.5.4
 

Offline awakephd

  • Regular Contributor
  • *
  • Posts: 101
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #121 on: September 11, 2024, 11:20:09 pm »
A bit more data: I was able to connect to the scope attached with USB via a terminal program (putty, gtkterm) both in Windows and in Linux - I can type in a command and see the change on the FY6900. So I do have connectivity, at least through USB. For the ESP-01, perhaps I am running into the issue of needing to adjust the resistor(s) feeding the TX and/or RX lines? Is there any way to do this on my adapter board, rather than inside the unit? I am not completely opposed to opening it up, but I would prefer to hold off until I am sure that I will keep the unit.

But that still would not explain why the sds1004x_bode program does not work. Again, any help will be most appreciated!
« Last Edit: September 11, 2024, 11:23:15 pm by awakephd »
 

Online bateau020

  • Frequent Contributor
  • **
  • Posts: 270
  • Country: fr
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #122 on: Yesterday at 04:54:26 am »
Can you test the other fy driver: fy6600? 
That "fy" driver is really new, and I haven't been able to test it (don't have a FY AWG), and this is indeed a bug.
Also, this is better for discussions in github than here. I have created an issue in github and will do some debugging in the coming days by mocking the fy AWG.   

Can you set "VERBOSE = True" (instead of "VERBOSE = False" as it is now) in the fy or the fy6600 driver? That can help debugging.
About Windows, it should work, but that is unlikely to solve the issue. Absolutely no need for virtualbox. This is really basic, in theory it should even run in a raspi.

I avoid WiFi as much as I can in the lab, so I haven't looked at ESP-01, but I will be able to help porting it. I am just not sure which fork to get, there are multiple forks and I see nothing that regroups all efforts.

EDIT: found a stupid bug (missing one letter in a function name). The "fy" driver should be better now. Tell me if it works. Still willing to work on ESP-01, but what fork should I start from?
« Last Edit: Yesterday at 12:21:05 pm by bateau020 »
 

Offline awakephd

  • Regular Contributor
  • *
  • Posts: 101
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #123 on: Yesterday at 12:45:48 pm »
bateau020, you are not only a gentleman and a scholar but also a saint to take this on! Many thanks. I am away from my "lab" (aka, desk piled with things in a corner of my house) at the moment, but will check out both the updated fy and the fy6600 drivers. I will also check on how to respond on Github.

On the ESP-01 code, I used the link provided by Knutselaar about 10 posts back in this thread. As best I can tell, his tweaks have not been ported back to Github, and I maybe shouldn't have started with that code - my thinking was that this represented a recent successful attempt.

What I missed until now is that he is using an SDS1104X, and that is what the code is set for. As I was digging through the espBode code last night I realized that 1) it does not include the UDP adjustment that you made to the python code, and 2) the code could use some improvement - at least in my ever-so-humble opinion. Currently, the code is essentially C, even though written in a C++ environment. I think it could be made much less confusing with judicious use of some C++ classes - for example, a class that "automaticaly" handles the endian-swap needed to go between the network and the ESP, rather than having to call the swap routine at various points on various pieces of the data. And don't get me started on the uint8_t **data parameter that is passed into the receiveRpcPacket function ... which then uses malloc to create a memory block without checking to see if it succeeds, which is then passed back to the calling function, which has to remember to free it ... even if it wasn't actually created. Yikes!

All that to say, I have already been thinking about taking on an update of the espBode code, both to include the SDS804X, and to make it easier to use going forward. Any interest in collaboration? I have to confess that I have never collaborated on something like this before, so I don't know how it would work, and I certainly won't be offended if you'd rather not.
 

Online bateau020

  • Frequent Contributor
  • **
  • Posts: 270
  • Country: fr
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #124 on: Yesterday at 01:01:05 pm »
All that to say, I have already been thinking about taking on an update of the espBode code, both to include the SDS804X, and to make it easier to use going forward. Any interest in collaboration? I have to confess that I have never collaborated on something like this before, so I don't know how it would work, and I certainly won't be offended if you'd rather not.

Sure, no problem. Collaborating is easy with github.
One of the problems I have is that I cannot test all of the code, as I only have 1 AWG. Collaboration will help here.
Another problem is that I no longer have my SDS1000 (non-HD). I ported the python code when I had both scopes. Am thinking about making the code really VXI compliant (opening both UDP and TCP ports), and my lack of test subjects is really hampering. Collaboration will again help here.

I will take a look at the existing forks do an assessment of where to start from.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf