Author Topic: Hacking the Rigol DHO800/900 Scope  (Read 1831103 times)

mwb1100, Rajeshpk and 13 Guests are viewing this topic.

Offline norbert.kiszka

  • Frequent Contributor
  • **
  • Posts: 520
  • Country: pl
Re: Hacking the Rigol DHO800/900 Scope
« Reply #3325 on: January 16, 2025, 10:26:44 am »
Using sed to edit two lines in one script and only once, sounds crazy. sed is more like for automation, when You have 1000 files and You need to change one line in every of them.

It's clever actually, no risk of messing with the line endings or the file permissions, non interactive and less error prone.
And also no requirement to have a text editor on the target system, and often if there is one, it's none other than vi (not even vim), which is next to useless to anyone who is not an alien from an outer space.

Sed is a great tool which works fine and is a natural choice in such situations.

Vi is good enough on this scope to do a simple editing. Personally I prefer nano, because of muscle memory with shortcuts.

Also, there is sshfs which makes possible to use any editor (and any software like file browsing) that You want, because You can mount scope file system via network. All You need is ip address, login and password. Right now Im using Krusader, which can use sshfs without need to call mount - external software (executed from Krusader) in 99.9% cases takes ip and credentials, so I don't need to worry about anything.
 
The following users thanked this post: RAPo

Offline Fungus

  • Super Contributor
  • ***
  • Posts: 17581
  • Country: 00
Re: Hacking the Rigol DHO800/900 Scope
« Reply #3326 on: January 16, 2025, 02:21:59 pm »
Vi is good enough on this scope to do a simple editing.

Sure, so long as you grew up using it.

If you never used it you'll fail to do anything with vi.
 

Offline norbert.kiszka

  • Frequent Contributor
  • **
  • Posts: 520
  • Country: pl
Re: Hacking the Rigol DHO800/900 Scope
« Reply #3327 on: January 16, 2025, 02:31:44 pm »
Vi is good enough on this scope to do a simple editing.

Sure, so long as you grew up using it.

If you never used it you'll fail to do anything with vi.

RTFM is good enough. 5 minutes of basic usage and You are good to go. Being too much lazy is not helpful.

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 7313
  • Country: fi
    • My home page and email address
Re: Hacking the Rigol DHO800/900 Scope
« Reply #3328 on: January 16, 2025, 03:32:22 pm »
sed means any non-linux person can copy/paste those two lines and do it safely.
Yep.  Notably, GNU 'sed -i' –– the one used in the Rigol –– uses the safe modification pattern, where the output is saved to a new file in the same directory under name starting with .sed, then closed, and if successful thus far, hard-linked over the old file.  In all inode-based filesystems, this is the correct, safe pattern.  (The only thing one might ask is for an option to do a fsync() after closing the new file before the hardlinking.)

For non-Linux/non-command line users, I recommend nano (nano-editor.org) for modifying files by hand.  It is controlled via Ctrl+Key, and the main commands shown at the bottom of the screen, with Ctrl represented by ^ as is common in Unix/POSIX-land.  If the distro contains a full installation, it even has syntax highlighting.  It's no vi or emacs, but it is simpler, more lightweight, and newbie-frendly: a ten second explanation suffices to get users going (^ = Ctrl key, commands are Ctrl+key, press Ctrl+G for help).  However, I do not know whether it is included in the Rigol installation.
« Last Edit: January 16, 2025, 03:34:34 pm by Nominal Animal »
 

Offline AndyBig

  • Frequent Contributor
  • **
  • Posts: 519
  • Country: ru
Re: Hacking the Rigol DHO800/900 Scope
« Reply #3329 on: January 16, 2025, 06:21:59 pm »
However, I do not know whether it is included in the Rigol installation.
The nano command is not recognized in the oscilloscope command line.
 
The following users thanked this post: Nominal Animal

Online mwb1100

  • Frequent Contributor
  • **
  • Posts: 620
  • Country: us
Re: Hacking the Rigol DHO800/900 Scope
« Reply #3330 on: January 17, 2025, 05:24:26 am »
I've been using vi for years.  I can't figure out how to exit it.

https://unix.stackexchange.com/questions/3334/how-do-i-quit-from-vi
 

Offline Fungus

  • Super Contributor
  • ***
  • Posts: 17581
  • Country: 00
Re: Hacking the Rigol DHO800/900 Scope
« Reply #3331 on: January 17, 2025, 03:38:17 pm »
I've been using vi for years.  I can't figure out how to exit it.

https://unix.stackexchange.com/questions/3334/how-do-i-quit-from-vi

"SHIFT-ZZ" if you want to write the changes.

":Q!" if you don't.

(Obviously!  :) )
 

Offline cte

  • Regular Contributor
  • *
  • Posts: 65
  • Country: de
Re: Hacking the Rigol DHO800/900 Scope
« Reply #3332 on: January 17, 2025, 03:52:09 pm »
I've been using vi for years.  I can't figure out how to exit it.

https://unix.stackexchange.com/questions/3334/how-do-i-quit-from-vi

"SHIFT-ZZ" if you want to write the changes.

":Q!" if you don't.

(Obviously!  :) )

... but with a lower-case «q»   ;)
⚡ To avoid electric shock, ensure that your instrument is correctly grounded.
 

Offline TheoB

  • Regular Contributor
  • *
  • Posts: 157
  • Country: nl
Re: Hacking the Rigol DHO800/900 Scope
« Reply #3333 on: January 17, 2025, 08:41:27 pm »
OK, I bricked my DH0804.
2484447-0
The rigol.scope app keeps stopping or stops (both messages I get). I think it's in a state that needs to be reset. But how? I can still access it by adb, so I probably need to "clean" some state. A factory default would be ok.
It happened while I was sending SCPI commands to set the instrument in a certain state.
« Last Edit: January 18, 2025, 09:21:25 am by TheoB »
 

Offline cte

  • Regular Contributor
  • *
  • Posts: 65
  • Country: de
Re: Hacking the Rigol DHO800/900 Scope
« Reply #3334 on: January 17, 2025, 08:48:50 pm »
@TheoB: Did you try adb logcat?
⚡ To avoid electric shock, ensure that your instrument is correctly grounded.
 

Offline TheoB

  • Regular Contributor
  • *
  • Posts: 157
  • Country: nl
Re: Hacking the Rigol DHO800/900 Scope
« Reply #3335 on: January 17, 2025, 09:02:13 pm »
Now I did, see attachment. It's gzipped, but I had to rename the extension to zip to upload...


My next try would be to reset the app using

adb shell pm clear com.rigol.scope

I just want some advice before I do this and make things worse.

I have made a complete backup of /rigol/data when the scope was new. So I have a backup.
« Last Edit: January 17, 2025, 09:57:21 pm by TheoB »
 

Offline iMo

  • Super Contributor
  • ***
  • Posts: 5649
  • Country: gw
Re: Hacking the Rigol DHO800/900 Scope
« Reply #3336 on: January 17, 2025, 10:14:39 pm »
..I have made a complete backup of /rigol/data when the scope was new. So I have a backup.
How you did it? Via the adb somehow? (A high time to do it here as well :o )
Readers discretion is advised..
 

Offline TheoB

  • Regular Contributor
  • *
  • Posts: 157
  • Country: nl
Re: Hacking the Rigol DHO800/900 Scope
« Reply #3337 on: January 17, 2025, 10:28:45 pm »
adb pull /rigol/
 

Offline TheoB

  • Regular Contributor
  • *
  • Posts: 157
  • Country: nl
Re: Hacking the Rigol DHO800/900 Scope
« Reply #3338 on: January 17, 2025, 10:35:45 pm »
Fixed it  :phew:

I send this command to the scope:
Code: [Select]
:SYSTem:PON DEFaultand rebooted
https://www.eevblog.com/forum/testgear/rigol-dho800900-new-firmware-1-03/msg5636739/#msg5636739

I also reset the data of the app, but I think it did not help (the rigol app kept restarting, but I did not reboot..)
Code: [Select]
adb shell am start -a android.settings.SETTINGSThen goto Apps, select RIGOL_SCOPE, Storage, Clear Data

All credits go to @mrisco
 
The following users thanked this post: Fungus, iMo, AndyBig, cte

Online RAPo

  • Frequent Contributor
  • **
  • Posts: 905
  • Country: nl
Re: Hacking the Rigol DHO800/900 Scope
« Reply #3339 on: January 18, 2025, 10:32:32 am »
Is the demo available for download/testing?
 

Offline AndyBig

  • Frequent Contributor
  • **
  • Posts: 519
  • Country: ru
Re: Hacking the Rigol DHO800/900 Scope
« Reply #3340 on: January 19, 2025, 03:36:01 pm »
I've put my project of a modified application on Github in more or less order :)
https://github.com/Andy-Big/Rigol-DHO800-900-Sparrow_mod
 
The following users thanked this post: RAPo, norbert.kiszka

Online RAPo

  • Frequent Contributor
  • **
  • Posts: 905
  • Country: nl
Re: Hacking the Rigol DHO800/900 Scope
« Reply #3341 on: January 19, 2025, 04:24:05 pm »
Thanks!

I've put my project of a modified application on Github in more or less order :)
https://github.com/Andy-Big/Rigol-DHO800-900-Sparrow_mod
 

Online RAPo

  • Frequent Contributor
  • **
  • Posts: 905
  • Country: nl
Re: Hacking the Rigol DHO800/900 Scope
« Reply #3342 on: January 19, 2025, 04:51:53 pm »
I think there is a small thing to be desired: The actual version of theminstalled mod  is not displayed in the splash screen; see the image.

Could you add in the start menu (next to power) a user customisable button (would love to start the FFT_avg application
from mrisco in that way).

Thanks!

I've put my project of a modified application on Github in more or less order :)
https://github.com/Andy-Big/Rigol-DHO800-900-Sparrow_mod
« Last Edit: January 19, 2025, 05:08:59 pm by RAPo »
 
The following users thanked this post: AndyBig

Offline AndyBig

  • Frequent Contributor
  • **
  • Posts: 519
  • Country: ru
Re: Hacking the Rigol DHO800/900 Scope
« Reply #3343 on: January 19, 2025, 09:13:17 pm »
I think there is a small thing to be desired: The actual version of theminstalled mod  is not displayed in the splash screen; see the image.
I deliberately did not put a specific version number, but left XXX instead. Just so as not to redo the picture every time :) The version number can be seen in the Uitlity -> About menu, there the modification version number will be indicated before the firmware version, for example (a003)00.01.04.00.02.
Could you add in the start menu (next to power) a user customisable button (would love to start the FFT_avg application
from mrisco in that way).
Honestly, I can't imagine how to make it customizable. But even if it is somehow done, you will still need an external keyboard to switch between applications. And having a keyboard, you can do whatever you want without additional buttons in the application :)
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 7313
  • Country: fi
    • My home page and email address
Re: Hacking the Rigol DHO800/900 Scope
« Reply #3344 on: January 20, 2025, 02:07:19 am »
If you need custom buttons for your DHO800/900 series scope, you can easily do so.  The cheap RISC-V microcontrollers with native USB from WCH and others are well suited for custom USB HID devices, and automagically supported in Android (due to Android using the Linux input subsystem), no drivers needed, and you can combine keyboard, mouse, and trackpad/touch in the same HID device without any issues.  Development is particularly easy if you have a Linux workstation to work on, both toolchain-wise and because you'll have the same input subsystem to test and examine your minikeypad device on.

(My first actual microcontroller project was a Teensy 2.0++ Arcade controller plank –– well, Baltic Birch 75×25cm glulam board –– so I could play puzzle platformer Flash games online with a nice arcade stick and microswitch buttons.  Those Flash games – and web games in general, still - tend to use various keyboard controls, so I added a hexadecimal encoder to select between various layouts, key events each button and digital joystick direction would generate. Love it; I'm tempted to make a desktop cabinet around an old 24" 1920×1080 IPS display I have, and one of my Linux SBCs.)
 

Online RAPo

  • Frequent Contributor
  • **
  • Posts: 905
  • Country: nl
Re: Hacking the Rigol DHO800/900 Scope
« Reply #3345 on: January 20, 2025, 08:15:41 am »
Honestly, I can't imagine how to make it customizable. But even if it is somehow done, you will still need an external keyboard to switch between applications. And having a keyboard, you can do whatever you want without additional buttons in the application :)

I deliberately did not put a specific version number, but left XXX instead. Just so as not to redo the picture every time :) The version number can be seen in the Uitlity -> About menu, there the modification version number will be indicated before the firmware version, for example (a003)00.01.04.00.02.
Could you add in the start menu (next to power) a user customisable button (would love to start the FFT_avg application
from mrisco in that way).
Honestly, I can't imagine how to make it customizable. But even if it is somehow done, you will still need an external keyboard to switch between applications. And having a keyboard, you can do whatever you want without additional buttons in the application :)
 

Online RAPo

  • Frequent Contributor
  • **
  • Posts: 905
  • Country: nl
Re: Hacking the Rigol DHO800/900 Scope
« Reply #3346 on: January 20, 2025, 08:16:58 am »
That is a possibilty, but I was looking for a software only implementation.

If you need custom buttons for your DHO800/900 series scope, you can easily do so.  The cheap RISC-V microcontrollers with native USB from WCH and others are well suited for custom USB HID devices, and automagically supported in Android (due to Android using the Linux input subsystem), no drivers needed, and you can combine keyboard, mouse, and trackpad/touch in the same HID device without any issues.  Development is particularly easy if you have a Linux workstation to work on, both toolchain-wise and because you'll have the same input subsystem to test and examine your minikeypad device on.

(My first actual microcontroller project was a Teensy 2.0++ Arcade controller plank –– well, Baltic Birch 75×25cm glulam board –– so I could play puzzle platformer Flash games online with a nice arcade stick and microswitch buttons.  Those Flash games – and web games in general, still - tend to use various keyboard controls, so I added a hexadecimal encoder to select between various layouts, key events each button and digital joystick direction would generate. Love it; I'm tempted to make a desktop cabinet around an old 24" 1920×1080 IPS display I have, and one of my Linux SBCs.)
 

Offline AndyBig

  • Frequent Contributor
  • **
  • Posts: 519
  • Country: ru
Re: Hacking the Rigol DHO800/900 Scope
« Reply #3347 on: January 20, 2025, 08:46:08 am »
If you need custom buttons for your DHO800/900 series scope, you can easily do so.  The cheap RISC-V microcontrollers with native USB from WCH and others are well suited for custom USB HID devices
It's much easier to buy a ready-made solution like this - https://aliexpress.ru/item/1005005473649108.html :)
A full keyboard plus a trackpad with mouse buttons, all in a miniature wireless design the size of a palm. I use this one.
 
The following users thanked this post: RAPo

Offline norbert.kiszka

  • Frequent Contributor
  • **
  • Posts: 520
  • Country: pl
Re: Hacking the Rigol DHO800/900 Scope
« Reply #3348 on: January 20, 2025, 08:29:44 pm »
Some people tried to run this scope with fan disconnected and it didn't work when CPU get some temp like 60-70 °C.

Right now I reached 69 °C (almost full CPU load, but PLL is not working, so practically there is no heat from FPGA, DAC and AFE).


Offline AndyBig

  • Frequent Contributor
  • **
  • Posts: 519
  • Country: ru
Re: Hacking the Rigol DHO800/900 Scope
« Reply #3349 on: January 24, 2025, 03:00:06 pm »
I updated the modified application a little.
The panel with measurements is now without a background and all items in it are pressed down. This allows you to see the oscillogram better when only 3-4 measurements are active.
And I disabled the vertical scale jumping from left to right and back when opening and closing the measurement panel, it was confusing. Now the scale is always on the left.
https://github.com/Andy-Big/Rigol-DHO800-900-Sparrow_mod/releases/tag/a004_00.01.04.00.02

 
The following users thanked this post: tv84, shapirus, ebourg, norbert.kiszka


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf