EEVblog Electronics Community Forum

Products => Test Equipment => Topic started by: 4x1md on July 17, 2018, 11:07:08 pm

Title: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: 4x1md on July 17, 2018, 11:07:08 pm
At a certain point after getting the SDG1204X-E oscilloscope I started to wonder if it might be possible to use the Bode plot function with a non-Siglent waveform generator. After some hours of researching and reverse engineering I wrote this Python program. It is a small server which emulates Siglent arbitrary waveform generator connected to LAN.

While drawing a Bode plot, the oscilloscope sends the commands to PC instead of the AWG and my program is what makes the oscilloscope think that it communicates with a genuine Siglent signal generator. The program extracts the commands sent to the generator, parses them and translates to the commands, which can be understood by the connected to the PC non-Siglent generator.

The program is written in Python. I tested it only under Linux. Later I'll test it under Windows too.

The source code and the explanations about running it are located here:

https://github.com/4x1md/sds1004x_bode (https://github.com/4x1md/sds1004x_bode)

Here is a video which shows how the program works:

https://www.youtube.com/watch?v=7PvueUHAJ78 (https://www.youtube.com/watch?v=7PvueUHAJ78)

You are welcome to discuss the program here.
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with non-Siglent AWG
Post by: bluejedi on July 29, 2018, 03:52:26 pm
At a certain point after getting the SDG1204X-E oscilloscope I started to wonder if it might be possible to use the Bode plot function with a non-Siglent waveform generator. After some hours of researching and reverse engineering I wrote this Python program. It is a small server which emulates Siglent arbitrary waveform generator connected to LAN.

While drawing a Bode plot, the oscilloscope sends the commands to PC instead of the AWG and my program is what makes the oscilloscope think that it communicates with a genuine Siglent signal generator. The program extracts the commands sent to the generator, parses them and translates to the commands, which can be understood by the connected to the PC non-Siglent generator.

Do you have any plans to add support for the MHS-5200A?
https://www.eevblog.com/forum/testgear/mhs-5200a-serial-protocol-reverse-engineered/ (https://www.eevblog.com/forum/testgear/mhs-5200a-serial-protocol-reverse-engineered/)

Except for the UI and max. frequency the MHS-5200A looks functionally similar to the JDS6600 (but I'm unaware if their interface command language / format is similar).
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with non-Siglent AWG
Post by: 4x1md on July 29, 2018, 07:18:24 pm
Currently I support only the devices I have. I'll add one more model which is very similar to BK4075.

It would be nice to add more generators but currently I have no idea how to do it without having the specific model. Maybe I'll have to work together with somebody who has it and can test my code.
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with non-Siglent AWG
Post by: xenganier on August 07, 2018, 09:56:57 pm
Thanks for doing this.  I have it working with an RPi3 running Dietpi and it works well except for a few glitches.  Especially on medium and high resolution modes the JDS6600 goes to zero frequency once in awhile, maybe three times on a 20-20k sweep.   In your video near the end on high res yours does it too.  I tried raising Sleeptime in steps up to 100ms but it didn't seem to make a difference.  Any idea what might be going on? 
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with non-Siglent AWG
Post by: 4x1md on August 11, 2018, 09:20:47 pm
Thanks for doing this.  I have it working with an RPi3 running Dietpi and it works well except for a few glitches.  Especially on medium and high resolution modes the JDS6600 goes to zero frequency once in awhile, maybe three times on a 20-20k sweep.   In your video near the end on high res yours does it too.  I tried raising Sleeptime in steps up to 100ms but it didn't seem to make a difference.  Any idea what might be going on?
No. I'll try to understand when I have free time.
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with non-Siglent AWG
Post by: ltwin8 on November 05, 2018, 07:03:36 pm
Would be cool to just add a RPi into the JDS6600 Case and use LAN of it, but without display etc. is that possible? and yes how?

I have a RPi B, would it be enough?

thanks for the answers
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with non-Siglent AWG
Post by: Dundarave on November 21, 2018, 03:08:12 am
Excellent work making the non-Siglent AWGs work with the SDS1004X-E!  :clap:  It's been fun to play with: I loaded the script up on a Raspberry PI and it worked brilliantly with the scope and my AWG.

Following your JDS6600.py driver file as a template, I've managed to modify it to support the FeelTech FY6600 AWG using a copy of the FY6600 comm protocol that I found somewhere on the net.  It works pretty well, but I had to crank the inter-command Sleeptime up to 500ms in order to reliably pass your test script:  It doesn't seem to affect anything with the actual Bode plotting activity, as the commands from the scope come relatively slowly.

I've tested it as much as I could, and I'd now like to make the driver file available to all: Can I email it to you for inclusion in your Git repository? Or is there a better way to make it available?  Note - Jan. 27/19: Added fy6600.py & the FY6600 comm protocol here per a reader request.

Cheers -
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with non-Siglent AWG
Post by: tautech on November 21, 2018, 04:47:58 am
Excellent work making the non-Siglent AWGs work with the SDS1004X-E!  :clap:  It's been fun to play with: I loaded the script up on a Raspberry PI and it worked brilliantly with the scope and my AWG.

Following your JDS6600.py driver file as a template, I've managed to modify it to support the FeelTech FY6600 AWG using a copy of the FY6600 comm protocol that I found somewhere on the net.  It works pretty well, but I had to crank the inter-command Sleeptime up to 500ms in order to reliably pass your test script:  It doesn't seem to affect anything with the actual Bode plotting activity, as the commands from the scope come relatively slowly.

I've tested it as much as I could, and I'd now like to make the driver file available to all: Can I email it to you for inclusion in your Git repository? Or is there a better way to make it available?

Cheers -
Welcome to the forum.

How large is it ? Up to 1 Mb you can attach it to a reply/post even if it's not a permitted file type by just adding .(dot)<permitted type> and mentioning to remove .dot<permitted type>.

Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with non-Siglent AWG
Post by: 4x1md on November 21, 2018, 06:51:01 am
Excellent work making the non-Siglent AWGs work with the SDS1004X-E!  :clap:  It's been fun to play with: I loaded the script up on a Raspberry PI and it worked brilliantly with the scope and my AWG.

Following your JDS6600.py driver file as a template, I've managed to modify it to support the FeelTech FY6600 AWG using a copy of the FY6600 comm protocol that I found somewhere on the net.  It works pretty well, but I had to crank the inter-command Sleeptime up to 500ms in order to reliably pass your test script:  It doesn't seem to affect anything with the actual Bode plotting activity, as the commands from the scope come relatively slowly.

I've tested it as much as I could, and I'd now like to make the driver file available to all: Can I email it to you for inclusion in your Git repository? Or is there a better way to make it available?

Cheers -
My script is open source. You can open a pull request on GitHub and I'll merge the changes with the main repository. If you don't want to deal with GitHub you can just send me your version of the script and I'll add your changes myself.

The only thing I'll ask you is to test your driver as good as possible, because I don't own a FY6600 and therefore I'm not able to test it myself.

Thanks for your work.
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with non-Siglent AWG
Post by: 4x1md on November 21, 2018, 06:54:22 am
Would be cool to just add a RPi into the JDS6600 Case and use LAN of it, but without display etc. is that possible? and yes how?

I have a RPi B, would it be enough?

thanks for the answers
It seems possible. You'll have to connect its UART to the JDS6600. If you want to work directly with the scope without using the LAN, the RPi must also run a DHCP server. You'll also need a power supply which can provide enough power to both AWG and RPi.
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with non-Siglent AWG
Post by: ltwin8 on November 21, 2018, 07:58:30 pm
Can someone post a guide on facebook on how to run this on a raspberry and how to connect? (unidentified AWG, unable to connect to AWG) I dont get my scope to connect to the Raspberry.

Maybe someone can upload an image of the SD card for the raspberry? I have no experience in raspberry and linux with respect to this task.

Would be very lucky if someone could help me. Thanks
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: 4x1md on January 30, 2019, 10:09:46 pm
I uploaded the FY6600 driver to the main repository on GitHub. Sorry for such a long delay.

Dundarave, thanks for your contribution.
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: Andreax1985 on January 31, 2019, 09:34:26 am
Is this good also for FY6800 AWG model?
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: 4x1md on January 31, 2019, 09:39:33 am
Is this good also for FY6800 AWG model?
I'm not familiar with FY6800. You can try to run the awg_tests.py and see if it works.
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: gamerpaddy on February 06, 2019, 01:24:40 pm
Could this be ported onto a Microcontroller with networking?
Like a Arduino with Network shield or ESP8266/32 over wifi?
<i may have asked this a while ago on one of your youtube videos, cant remember>

Unfourtainly i lack the skills to do this, but it seems more cost effective than using a raspberry pi.
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: 4x1md on February 07, 2019, 08:51:03 am
Could this be ported onto a Microcontroller with networking?
Like a Arduino with Network shield or ESP8266/32 over wifi?
<i may have asked this a while ago on one of your youtube videos, cant remember>

Unfourtainly i lack the skills to do this, but it seems more cost effective than using a raspberry pi.
It may be possible but I can't say anything about ESP8266/32 because I've never worked with them and I don't know if they have enough ROM and RAM for such program.
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: Rerouter on February 07, 2019, 09:02:30 am
Defiantly can be emulated, you just need to emulated a few commands, Basicwave, Output and IDN

For the IDN String you can look into the earlier python project for converting the commands for another brand AWG,

The scope uses output to turn on the AWG output, then justs broadcasts basicwave with different fixed frequencies for each measurement step.

I should also mention you don't need anything as grand as a VI library to deal with SCPI messages, just treat them like standard packets
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: gamerpaddy on February 08, 2019, 07:09:12 am
there's certainly enough ram/flash available for this kind of stuff.
i tried my best but after 6 hours and headache im only halfway there, but at the most inefficient way possible. i bet this gets the worst code 2019 award.

I managed to make the "test connection" thing succeed and the siglent allready sent me some AWG parameters.
im using a arduino leonardo with a Ethernet shield, LAN cable directly into the scope.
(https://i.imgur.com/ZLgOVjN.png)


Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: MrTick on April 23, 2019, 11:26:55 am
Hi this is my very first message on eevblog, so hello everybody! :)

I've just recently got my hands on SDS1104X-E and I was looking for the solution to connect it to FY6800 AWG.
Thanks 4x1md for reverse engineering the Siglent communication protocol and your very nice solution.
But as I think using pc/raspberry to just translate the messages is an overkill, I've implemented similar code for ESP8266.

FY6800 has a nice uart connector on the back, the logic levels are 3,3V, the VCC is 5V however, so you need to find some way to drop it to 3.3V.
(I've realized that just when writing this post, fortunately my ESP-01 survived all tests fed directly from 5v. Currently I just soldered yellow LED in series, it seems to be dropping the voltage to ~3.2V)

I've used the simplest ESP-01 module.

Currently only FY6800 is supported, FY6600 and clones should work also.

https://github.com/PanKaczka/espBode

To compile the code I'm using the standard Arduino-ESP library: https://github.com/esp8266/Arduino

To use it in your own environment you need to edit esp_config.h, so WiFi mode, network name and password matches your network configuration.
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: tinhead on April 23, 2019, 11:44:29 am
Hi this is my very first message on eevblog, so hello everybody! :)

Hi ho

I've implemented similar code for ESP8266

cool, dzieki/thanks Jakub
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: 4x1md on April 23, 2019, 06:09:15 pm
I've just recently got my hands on SDS1104X-E and I was looking for the solution to connect it to FY6800 AWG.
Thanks 4x1md for reverse engineering the Siglent communication protocol and your very nice solution.
But as I think using pc/raspberry to just translate the messages is an overkill, I've implemented similar code for ESP8266.

FY6800 has a nice uart connector on the back, the logic levels are 3,3V, the VCC is 5V however, so you need to find some way to drop it to 3.3V.
(I've realized that just when writing this post, fortunately my ESP-01 survived all tests fed directly from 5v. Currently I just soldered yellow LED in series, it seems to be dropping the voltage to ~3.2V)

I've used the simplest ESP-01 module.

Currently only FY6800 is supported, FY6600 and clones should work also.
Welcome and thank you very much for sharing this project.

It can be a good idea to develop a small PCB with a simple circuitry for voltage and logic level conversion. It can even be made like a plug which fits the rear connector of the AWG.
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: imo on April 23, 2019, 06:42:23 pm
Would it be possible to create following setup:
- ESP8266 module
- DDS 0-60MHz 2Vpp out, wired to the ESP module
and use it with 1104X-E as the AWG?
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: 4x1md on April 23, 2019, 06:44:47 pm
Would it be possible to create following setup:
- ESP8266 module
- DDS 0-60MHz 2Vpp out, wired to the ESP module
and use it with 1104X-E as the AWG?
I think yes. 2Vpp out must be defined in Bode settings of the oscilloscope.
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: 4x1md on April 23, 2019, 06:46:10 pm
The PCB I'm speaking about can be something like this one but with a female header connector which can be plugged directly into FY6600/JDS6600.
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: MikeLud on April 24, 2019, 03:35:52 am
I just ordered some ESP-01 and goodies to see if I can get my FY6800 and SDS1104X-E play nice.
(http://)
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: Old Printer on April 24, 2019, 03:57:28 pm
I have only had my 1104x-e a week now so still feeling my way along. Right now my best AWG is my Analog Discovery 2. While limited in frequency, it's other controls are pretty versatile. This has me wondering about the possibility to interface these two...
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: 4x1md on April 24, 2019, 06:39:47 pm
I have only had my 1104x-e a week now so still feeling my way along. Right now my best AWG is my Analog Discovery 2. While limited in frequency, it's other controls are pretty versatile. This has me wondering about the possibility to interface these two...
It may be possible but I'm not familiar with this device so I can't tell you more.
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: MikeLud on April 27, 2019, 04:18:32 am
I modified an ESP-01 Adapter as shown in photos below and I am having issues with communication. It work for about 30 seconds to a minute then I get the error shown in photo below. I tried several delay settings but had no luck. Does anyone know how to get it to work.

Thanks in Advance,

Mike
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: MikeLud on April 27, 2019, 04:28:07 am
MrTick

I added a Pull Request to fix a compile issue I had.
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: MikeLud on April 28, 2019, 01:48:20 am
I figured out what was causing my communication issues. It was having the scope set to DHCP, once I set the scope to a static IP it works like a charm. Below are some photos of the final setup.

4x1md & MrTick,

Thanks for all of your hard work on this great non-Siglent AWG hack. :-+

Mike
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: 4x1md on June 01, 2019, 05:01:03 pm
Has anybody tried my code with Bode Plot II from the new FW 6.1.33?
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: MrTick on June 02, 2019, 09:43:25 am
Has anybody tried my code with Bode Plot II from the new FW 6.1.33?

Hi, thanks for the heads up, I've just upgraded my SDS.
I've tested only my ESP SW, though it communicates exactly same like your implementation.
It still works without any problems, no additional AWG verifications were introduced :)

I'm attaching sample sweep output from a diy 40db attenuator.
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: rf-loop on June 02, 2019, 04:07:03 pm


Hi, thanks for the heads up, I've just upgraded my SDS.
I've tested only my ESP SW, though it communicates exactly same like your implementation.
It still works without any problems, no additional AWG verifications were introduced :)

I'm attaching sample sweep output from a diy 40db attenuator.

(https://www.eevblog.com/forum/testgear/siglent-sds1104x-e-and-sds1204x-e-bode-plot-with-non-siglent-awg/?action=dlattach;attach=752853;image)

If look your image it looks weird. Exept it tell your AWG is working with Siglent what was perhaps main thing.

But then, your setup and settings are possible totally mess.

What signal goes to reference channel (Ch1)

First make sure your signal source (AWG) output go  to your DUT (in your case your selfmade attenuator) input and exactly same signal goes to Ch1 (as long as you have not defined other channel for reference).
Then your DUT (device under test - your attenuator) output goes to Ch2 (because in your image you have selected it (or it is just as scope default).

First it need be sure these signal connections are ok.

Then need look about your BodePlot II settings are right if need.

Basic signal connections (user can free select channels including what is ref channel)

You have measured attenuator but your display show "40 - 60dB" amplifier.


In attached image Ch4 is selected for DUT out but scope factory default is Ch2
(Ch4 is selected for main DUT out in image related to other things = with 1 in 1 out system can keep 1GHz samplerate but also Ch4 is far from Ch1 so it may crosstalk with strong reference signal bit less than Ch2 if need get all out from dynamic range = in basic works just forget this and happy use Ch1 Ch2 pair)
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: MrTick on June 02, 2019, 06:20:20 pm
If look your image it looks weird. Exept it tell your AWG is working with Siglent what was perhaps main thing.

But then, your setup and settings are possible totally mess.

You are totally right.

First I've swapped CH1 and CH2, so the reference was connected wrongly to a CH2 instead of CH1.
That's why all results should be basically multiplied by -1 (or - better, the connection should be fixed and measurements done again).

Second: calling my device a 40dB attenuator is an insult for attenuators :)
It's just bunch metalized resistors soldered together and clamped into a BNC connector, it behaves correctly up till ~10MHz, then it's good only for testing Bode plots :)
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: aimc on September 03, 2019, 12:51:39 am
This looks very interesting. I am wondering though if the scopes communication protocol is the same for serial USB? Did you try to communicate with the Arduino? I am thinking along the line of using one USB (to the scope) and the simple serial connection to the FY6800. The Leonardo (32U4) would be suitable as it has 4 UART's that can be used with the serial(1...n) library. Do you think that is a doable approach? I have worked successfully with asynchronous handshakes between a Leonardo and an ESP, so it would require some changes to your code and of course hardware. Even with USB to the FY6800 (in which case you may need a second MCU for the USB chip) I think this could be a better solution since you don't need to depend on a WiFi connection in your local network. The extra cable and PSU plug pack should not be a problem.

Let me know what you think.
cheers
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: 4x1md on September 03, 2019, 05:59:12 am
This looks very interesting. I am wondering though if the scopes communication protocol is the same for serial USB? Did you try to communicate with the Arduino? I am thinking along the line of using one USB (to the scope) and the simple serial connection to the FY6800. The Leonardo (32U4) would be suitable as it has 4 UART's that can be used with the serial(1...n) library. Do you think that is a doable approach? I have worked successfully with asynchronous handshakes between a Leonardo and an ESP, so it would require some changes to your code and of course hardware. Even with USB to the FY6800 (in which case you may need a second MCU for the USB chip) I think this could be a better solution since you don't need to depend on a WiFi connection in your local network. The extra cable and PSU plug pack should not be a problem.
Is may be a good idea. As far, as I know, these Chinese AWGs can provide 5V on their rear header connector. It means that you'll not need an additional PSU for the external USB-AWG connection board. It will be interesting to try but the problem is that I'm not familiar with USB protocols. I'd be happy to work together with somebody on this.
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: MrTick on September 03, 2019, 09:47:03 am
Handling the USB using AVR devices was always a tricky issue.
USB signals can reach dozens of Mbps that frequently is hard to handle for 16MHz CPUs.
https://www.obdev.at/products/vusb/index.html (https://www.obdev.at/products/vusb/index.html) is a good place to start.
Another thing would be to connect Siglent AWG to PCs USB and see what kind of device shows up. It's possible that it's just another serial-usb COM port, then the direct USB-AWG interface should be doable on a AVR.

Another thing, if you don't want to use external WiFi network you may use 8266 in an access-point mode, where the scope would connect directly to the network generated by AWG and no additional routers/networks is necessary.
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: Rerouter on September 03, 2019, 09:49:58 am
The scope shows up as a test and measure device, the AWG as a class I have not seen before.
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: MrTick on September 03, 2019, 09:57:24 am
Both the scope and the AWG show up as USB class SCPI devices.
That sounds promising. SCPI is basically a text protocol often exchanged via more or less exotic serial implementation. I'll try to connect some arduinos to the scope when I'm back at home.

Would it be possible for you to share the USB Vendor/Device IDs of the Siglent AWG? (We'll probably need that to mimic the AWG with Arduino)
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: Rerouter on September 03, 2019, 10:06:44 am
For the scope its
USB Test and Measurement Device
VID: F4EC
PID: EE38
REV: 9999

For the AWG its
USB Serial Bus Devices
Description: SAG1021
VID: F4ED
PID: EE3A
REV: 0100
Manufacturer: Shenzhen Siglent Co., Ltd.
Device Instance Path: USB\VID_F4ED&PID_EE3A\SAG10DAQ1R0000 (zero'd out my serial number)

If you need anything else, just ask, as i would be interested in knowing how to drive the thing from windows.
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: aimc on November 04, 2019, 03:28:54 pm
I am also thinking along using the build-in USB FTDI of any Arduino board to communicate with the scope. Especially then the simple serial RS232 library could be used. Downside is that debugging via this port is no longer available, but this could be temporarily managed by alternative means (e.g. via a I2C LCD Display). More importantly is the question if this serial <-> USB FTDI can be used on the scope at all, and what parameters (baud rate etc.) are appropriate? Did anyone here experiment with this? The scope's USB accepts any PC connection and WiFi dongle, but what does it do with the FTDI that requires a driver on a PC? Also then the USP could power the Arduino board and all levels to the FeelTech remain 5V TTL. Only concern is the connection of the scope and AWR grounds, that where we all know might be problematic with the FeelTech. But then again this will happen anyways via the grounds of the DUT. Any input is appreciated, thanks in advance :)
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: aimc on December 07, 2019, 08:14:08 pm
Just wanted to let you know that I opened a pull request on your GIT repo - adding the STL's for a enclosure - if you are interested that is... Otherwise the fork is available at https://github.com/AimcLsc/espBode. (sorry for the crudity, I am new to GIT...)
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: BlackICE on February 25, 2020, 07:26:49 am
I want to thank MrTick for the ESP code he put on GitHub. I downloaded to and modified it to work with an ESP32 that I had already. I haven't fully tested it yet. But go it to communicate with the scope and it isn't complaining when I run a fake bode plot without any input or outputs.

The ESP32 has 3 serial ports so I used one for debug output and another for talking to the FY6900. I had change some code because a member function availableForWrite() doesn't exist for the ESP32 libraries.


/* availableForWrite() doesn't exist for esp32 so we do differently

        while(!client.availableForWrite());
        client.write((uint8_t*)&response, sizeof(rpcresp_getport));

*/

changed to:

        while (sizeof(rpcresp_getport) != client.write((uint8_t*)&response, sizeof(rpcresp_getport)))
   DEBUG("ERROR: client.write2");
;


#include <ESP8266WiFi.h>

changed to

#include <esp_wifi.h>

Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: BlackICE on March 25, 2020, 06:11:07 am
Just noticed the waveforms were distorted, had jitter in timing and amplitude. Turns out powering an ESP32 from the 5V output on the back is drawing too much current. After I disconnecting the 5V wire the waveforms were now as before.
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: BlackICE on March 30, 2020, 11:30:58 pm
Using the bode II stimulus in units other than amplitude (eg. dBV, dBu) doesn't work. I looked at the code and those commands are not being handled. The FY6900 I have doesn't have those units either but it should be strait forward to convert from dB units to amplitude to get the desired results, although the FY6900 display will show volts. Any interest for me to do so and to post the code back to GitHub?
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: ewaller on May 01, 2020, 09:49:24 pm
I have been playing with 4x1md's code and have expanded on it quite a bit. And have ported it to Python 3.

I now have a full blown CLI program that controls an FY6800 allowing control of both channels for waveform, amplitude, offset and duty cycle.  It can control modulation, VCO and counter functions, and can upload wave forms to the instrument.  I used 4x1md's code to provide the a server that emulates a Siglent generator so this can be used as an external source for Bode plots (works great, by the way).   

The major difference is that I use a Raspbery-pi running ser2py to expose the USB-serial instrument to a TCP/IP network to permit streaming via TCP socket.

And, still a bit hackish, wrote some code to covert black and white graphic images from raster to vector format, and generate waveform files that can be uploaded to the instrument as X channel and Y channel wave forms that are then displayed on an XY scope.

If there is any interest, I can clean this up and put it on Github.  I would like to give 4x1md a chance to review it first as well.   Here is a screen shot of this morning's hack session:
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: ewaller on May 01, 2020, 09:51:21 pm
Another example
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: 4x1md on May 01, 2020, 09:55:47 pm
Yes, I'd like to see the improvements and merge them to the master branch. I think, that now, thanks to the coronavirus, I'll have free time for code maintenance.
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: cdc3oo on May 25, 2020, 07:44:06 am
Yes, I'd like to see the improvements and merge them to the master branch. I think, that now, thanks to the coronavirus, I'll have free time for code maintenance.

Hello

First time poster.

First of all, I want to warmly thank you for sharing your code.

I tried to run master on WIN and had issues with Python 2.7 or 3.7 raising errors. Also, wireshark showed oddities in some RPC replies payload.
I decided to fix these, simplified the server code a little bit and worked on the statements giving errors at runtime.

Actually connectivity test is working like a charm with 6.1.33 while protocol is OK according to wireshark
I have to check it works well end to end with the Feeltech (no other AWG here) and also to do non-regression tests on a *nix machine.

If interested, I can send you the diff once I'm done with this.

Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: acugnini on May 26, 2020, 05:51:34 pm
Is it possible to upload a waveform to the SDS1202X-E?  I know downloading is possible, using either EasyScopeX or by opening an IP socket, but what about the reverse?  (I want to upload a waveform and then perform an FFT on the data.) --agc
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: cdc3oo on May 27, 2020, 06:00:57 am
Using the bode II stimulus in units other than amplitude (eg. dBV, dBu) doesn't work. I looked at the code and those commands are not being handled. The FY6900 I have doesn't have those units either but it should be strait forward to convert from dB units to amplitude to get the desired results, although the FY6900 display will show volts. Any interest for me to do so and to post the code back to GitHub?

Hello I missed your post before writing my first one...

Unless you already did it, here is the code which should work with others AWGs:


            elif args[n] == "AMPDBM":
                 self.awg.set_amplitude(channel, 0.77459*2.82843*pow(10,float(args[n+1])/20))
                 n += 2


Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: timkoers on June 29, 2020, 01:10:38 pm
Hi all!

I am planning to buy a AWG that is supported by this awesome hack.

Is there any list with (un-)officially supported AWG's, with their development status?

At first I looked for the JDS6600 but now I'm leaning towards the FY6800 or FY6900.
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: aljordan on July 26, 2020, 04:31:25 pm
Thank you very much for creating this script and making it available. It works great with a Koolertron signal generator, which appears to be a re-branded jds6600 available on Amazon. I first tried running it from my laptop running Manjaro Linux, but the oscilloscope wouldn't connect. Maybe the ports were locked down. Instead I installed pip and pyserial on a Raspberry Pi running Diet Pi and had no issues connecting and running plots.

Thanks again.
Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: ptype on September 17, 2020, 04:16:46 pm
I tried this today with a FY2300 and it worked the first attempt with no problems.  Thanks!

For those who would rather not open a port as root, there is a built-in way to do internal NAT (port forwarding) in Linux.

First open up awg_server.py

and change

  RPCBIND_PORT = 111
  VXI11_PORT = 703


to

  RPCBIND_PORT = 8000
  VXI11_PORT = 8001


next run this at the commandline to set up the port forward

  sudo iptables -t nat -A PREROUTING -p tcp --dport 111 -j REDIRECT --to-port 8000

Now you can run bode.py as an unprivileged user (no sudo needed):

  python bode.py <awg_name> <serial_port> <baud_rate>

clean up the port forward at any time with a reboot.  There are also iptables commands to delete the port forward but that seemed like TMI for this post.


Title: Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
Post by: Archades on September 28, 2020, 05:48:37 am
Has anyone tried this with a Uni-T UTG962?