Author Topic: Need help hacking DP832 for multicolour option.  (Read 61164 times)

0 Members and 2 Guests are viewing this topic.

Offline mike47203

  • Contributor
  • Posts: 6
  • Country: us
Re: Need help hacking DP832 for multicolour option.
« Reply #275 on: July 10, 2019, 01:56:48 am »
So, I am trying to enable the 16m option on my newly upgraded DG1022Z using what starec and tv84 mentioned here, but I am not having any luck. It seems I haven't successfully modified riglol1.03d to make it work. I changed the private key and the character maps, but generated key is still incorrect. I am sure I am missing something. Any help would be appreciated.

I attached a diff file of how I changed riglol.
« Last Edit: July 10, 2019, 02:47:48 am by mike47203 »
 

Offline starec

  • Contributor
  • Posts: 5
  • Country: sk
Re: Need help hacking DP832 for multicolour option.
« Reply #276 on: July 10, 2019, 11:09:14 am »
Ok, 1-2 weeks ago i've modified riglol 1.03d for DG1000Z generation/calculation

here is a full source code:
Code: [Select]
char version[]             = "Riglol 1.03d";
char DP832_private_key[]   = "5C393C30FACCF4"; //publ: 0x5EC2D25AE85124
char DS2000_private_key[]  = "8EEBD4D04C3771"; //publ: 0x8445B2BE29E5C7
char DSA815_private_key[]  = "80444DFECE903E"; //publ: 0x691213692D18FA
char DS1000Z_private_key[] = "6F1106DDA994DA"; //publ: 0x58E9F183B924BB
char DG1000Z_private_key[] = "7412E98108CAB0"; //publ: 0x586E719859AF6C

static char* ascii_map;
static const char ascii_map_dg[] = "MNBVCXZASDFGHJKLPUYTREWQ23456789";
static const char ascii_map_[] = "23456789ASDFGHJKLPUYTREWQMNBVCXZ";

char no_private_key[]      = "";

/*
** sign the secret message (serial + opts) with the private key
*/
void ecssign(char *serial, char *options, char *privk, char *lic1, char *lic2) {
    char prime1[]  = "AEBF94CEE3E707";
    char prime2[]  = "AEBF94D5C6AA71";
    char curve_a[] = "2982";
    char curve_b[] = "3408";
    char point1[]  = "7A3E808599A525";
    char point2[]  = "28BE7FAFD2A052";
    int k_offset = 0; // optionally change ecssign starting offset (changes lic1; makes different licenses)
    mirsys(800, 16)->IOBASE = 16;

    sha sha1;
    shs_init(&sha1);

    char *ptr = serial;
    while(*ptr) shs_process(&sha1, *ptr++);
    ptr = options;
    while(*ptr) shs_process(&sha1, *ptr++);

    char h[20];
    shs_hash(&sha1, h);
    big hash = mirvar(0);
    bytes_to_big(20, h, hash);

    big a = mirvar(0);
    instr(a, curve_a);
    big b = mirvar(0);
    instr(b, curve_b);
    big p = mirvar(0);
    instr(p, prime1);
    big q = mirvar(0);
    instr(q, prime2);
    big Gx = mirvar(0);
    instr(Gx, point1);
    big Gy = mirvar(0);
    instr(Gy, point2);
    big d = mirvar(0);
    instr(d, privk);
    big k = mirvar(0);
    big r = mirvar(0);
    big s = mirvar(0);
    big k1 = mirvar(0);
    big zero = mirvar(0);

    big f1 = mirvar(17);
    big f2 = mirvar(53);
    big f3 = mirvar(905461);
    big f4 = mirvar(60291817);

    incr(k, k_offset, k);
    epoint *G = epoint_init();
    epoint *kG = epoint_init();
    ecurve_init(a, b, p, MR_PROJECTIVE);
    epoint_set(Gx, Gy, 0, G);

    for(;;) {
        incr(k, 1, k);

        if(divisible(k, f1) || divisible(k, f2) || divisible(k, f3) || divisible(k, f4))
            continue;

        ecurve_mult(k, G, kG);
        epoint_get(kG, r, r);
        divide(r, q, q);

        if(mr_compare(r, zero) == 0)
            continue;

        xgcd(k, q, k1, k1, k1);
        mad(d, r, hash, q, q, s);
        mad(s, k1, k1, q, q, s);

        if(!divisible(s, f1) && !divisible(s, f2) && !divisible(s, f3) && !divisible(s, f4))
            break;
    }

    cotstr(r, lic1);
    cotstr(s, lic2);
}

/*
** convert string to uppercase chars
*/
char *strtoupper(char *str) {
    char *p;
    for (p=str; *p; p++)
        *p = toupper(*p);
    return str;
}

/*
** prepend a char to a string
*/
char *prepend(char *c, char *str) {
    int i;

    for (i = strlen(str); i >= 0; i--) {
        str[i + 1] = str[i];
    }

    str[0] = *c;
    return c;
}

/*
** convert hex-ascii-string to rigol license format
*/
void map_hex_to_rigol(char *io) {
    unsigned long long b = 0;
    int i = 0;
    char map[] = {
        'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
        'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R',
        'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
        '2', '3', '4', '5', '6', '7', '8', '9'
    };

    /* hex2dez */
    while (io[i] != '\0') {
        if (io[i] >= '0' && io[i] <= '9') {
            b = b * 16 + io[i] - '0';
        } else if (io[i] >= 'A' && io[i] <= 'F') {
            b = b * 16 + io[i] - 'A' + 10;
        } else if (io[i] >= 'a' && io[i] <= 'f') {
            b = b * 16 + io[i] - 'a' + 10;
        }
        i++;
    }

    for (i = 3; ; i--) {
        io[i] = map[b & 0x1F];
        if (i == 0) break;
        b >>= 5;
    }

    io[4] = '\0';
}

char *get_version() {
  char *v;

  v=version;
  return v;
}

void show_help(char *cmd) {
    printf("%s\n", get_version());
    printf("\n");
    printf("Usage: %s <sn> <opts> <privkey>\n", cmd);
    printf("  <sn>       serial number of device (D............)\n");
    printf("  <opts>     device options, 4 characters, see below\n");
    printf("  <privkey>  private key (optional)\n");
    printf("\n");
    printf("DP832 starting from v1.09 device options:\n");
    printf("  first character:  F = official, B = trial\n");
    printf("  F3PT - Accuracy\n");
    printf("  F6PT - Analyzer and Monitor\n");
    printf("  F6LT - LAN\n");
    printf("  FALT - RS232\n");
    printf("  FLLT - Trigger\n");
    printf("\n");
    printf("DP832 up to v1.06 device options:\n");
    printf("  first character:  M = official, 5 = trial\n");
    printf("  MWSS - Trigger\n");
    printf("  MWTB - Accuracy\n");
    printf("  MWTC - LAN and RS232\n");
    printf("  MWTE - Analyzer and Monitor\n");
    printf("\n");
    printf("DS1000z device options:\n");
    printf("  DSAB - Advanced Triggers\n");
    printf("  DSAC - Decoders\n");
    printf("  DSAE - 24M Memory\n");
    printf("  DSAJ - Recorder\n");
    printf("  DSBA - 500uV Vertical\n");
    printf("\n");
    printf("DG1000z device options:\n");
    printf("  JBNE - 16M Memory\n");
    printf("\n");
    printf("DS2000 device options:\n");
    printf("  first character:  D = official, V = trial\n");
    printf("  DSAB - Advanced Triggers\n");
    printf("  DSAC - Decoders\n");
    printf("  DSAE - 56M Memory\n");
    printf("  DSAJ - 100MHz\n");
    printf("  DSAS - 200MHz\n");
    printf("  DSAZ - all options\n");
    printf("\n");
    printf("DS4000 device options:\n");
    printf("  first character:  D = official, V = trial\n");
    printf("  DSHB - RS232 Decoder\n");
    printf("  DSHC - SPI Decoder\n");
    printf("  DSHE - I2C Decoder\n");
    printf("  DSHJ - CAN Decode\n");
    printf("  DSHS - FlexRay Decoder\n");
    printf("  DSH9 - all options\n");
    printf("\n");
    printf("DSA815 device options:\n");
    printf("  first character:  A = official, S = trial\n");
    printf("  AAAB - Tracking Generator\n");
    printf("  AAAC - Advnced Measurement Kit\n");
    printf("  AAAD - 10Hz RBW\n");
    printf("  AAAE - EMI/Quasi Peak\n");
    printf("  AAAF - VSWR\n");
    printf("\n");
    printf("MAKE SURE YOUR FIRMWARE IS UP TO DATE BEFORE APPLYING ANY KEYS\n");
}

static int ascii_to_bin(char c)
{
    int i;

    for (i = 0; i < 0x20; i++)
        if (ascii_map[i] == c)
            break;
    return i;
}

static char *options_4to5(const char *opt4, char *opt5)
{
    int map[] = { 0, 3, 2, 1 };
    int i, opt = 0;

    for (i = 0; i < 4; i++)
        opt = (opt << 5) | ascii_to_bin(opt4[map[i]]);
    for (i = 0; i < 5; i++) {
        opt5[i] = ascii_map[opt & 0x0F];
        opt >>= 4;
    }
    opt5[i] = 0;
    return opt5;
}

static void format_license_dp832_109(char *lic1_code, char *lic2_code,
                                     char *options, char *licence, int isDG)
{
    const int map1dp[] = { 4, 11, 16, 23, 0, 24, 6, 22, 8, 20, 18, 25 };
    const int map2dp[] = { 3, 14, 19, 9, 26, 5, 1, 10, 12, 13, 15, 21 };
    const int map3dp[] = { 2, 7, 17, 27 };

    const int map1dg[] = {3, 0xE, 0x13, 9, 0x1A, 5, 7, 0x11, 0xC, 0x18, 6, 0x16};
    const int map2dg[] = {4, 0xB, 0x10, 0x17, 0, 8, 0x14, 0x1B, 2, 0xD, 0xF, 0x15};
    const int map3dg[] = {1, 0xA, 0x12, 0x19};

    const int *map1 = isDG?map1dg:map1dp;
    const int *map2 = isDG?map2dg:map2dp;
    const int *map3 = isDG?map3dg:map3dp;
    unsigned long long k;
    int i;

    k = strtoll(lic1_code, NULL, 16);
    for (i = 0; k < (1ULL << 51); i++)
        k = (k << 4) | 0;
    k = (k << 4) | i;
    for (i = 0; i < 12; i++) {
        licence[map1[i]] = ascii_map[k & 0x1F];
        k >>= 5;
    }

    k = strtoll(lic2_code, NULL, 16);
    for (i = 0; k < (1ULL << 51); i++)
        k = (k << 4) | 5;
    k = (k << 4) | i;
    for (i = 0; i < 12; i++) {
        licence[map2[i]] = ascii_map[k & 0x1F];
        k >>= 5;
    }

    if (isDG) {
        int map[] = { 0, 3, 2, 1 };
char *opt = strdup(options);
for (i = 0; i < 4; i++)
    opt[i] = options[map[i]];
for (i = 0; i < 4; i++)
    licence[map3[i]] = opt[3 - i];
        free(opt);
    }
    else
for (i = 0; i < 4; i++)
    licence[map3[i]] = options[i];

    licence[28] = 0;
}

static void format_license_classic(char *lic1_code, char *lic2_code,
                                   char *options, char *licence)
{
    char *lic_all, *chunk, *temp;
    int i, j;

    /* fix missing zeroes */
    while (strlen(lic1_code) < 14) {
        prepend("0", lic1_code);
    }
    while (strlen(lic2_code) < 14) {
        prepend("0", lic2_code);
    }

    /* combine lic1 and lic2 */
    lic_all = (char*)calloc(128, 1);
    temp = (char*)calloc(128, 1);
    chunk = (char*)calloc(6, 1);
    strcpy(lic_all, lic1_code);
    strcat(lic_all, "0");
    strcat(lic_all, lic2_code);
    strcat(lic_all, "0");

    /* generate serial */
    i=0;
    while (i < strlen(lic_all)) {
        memcpy(chunk, lic_all + i, 5);
        map_hex_to_rigol(chunk);
        strcat(temp, chunk);
        i = i + 5;
    }

    /* add options and "-" */
    j = 0;
    for(i = 0; i <= strlen(temp); ) {
       switch(j) {
         case 1:  licence[j] = options[0];  break;
         case 7:  licence[j] = '-';         break;
         case 10: licence[j] = options[1];  break;
         case 15: licence[j] = '-';         break;
         case 19: licence[j] = options[2];  break;
         case 23: licence[j] = '-';         break;
         case 28: licence[j] = options[3];  break;
         default: licence[j] = temp[i];
                  i++;
       }
       j++;
    }
    licence[j] = '\0';

    /* cleen up */
    free(lic_all);
    free(chunk);
    free(temp);
}

char *make_licence(char *serial, char *options, char* priv_key)
{
    char options_buffer[8], *opts = options;
    char *lic1_code, *lic2_code, *lic_all;
    char *chunk, *temp, *licence;
    int i, j;

    /* convert string to uppercase chars */
    strtoupper(serial);
    strtoupper(options);
    strtoupper(priv_key);

    int isDG = strncmp(serial, "DG1", 3)?0:1;
    /* convert options string format for DP832 with firmware >= 1.09 or for DG1000Z*/
    if ((!strncmp(serial, "DP8", 3) && options[0] != 'M' && options[0] != '5') || isDG)
        opts = options_4to5(options, options_buffer);

    /* sign the message */
    lic1_code = (char*)calloc(64, 1);
    lic2_code = (char*)calloc(64, 1);
    ecssign(serial, opts, priv_key, lic1_code, lic2_code);

    /* format licence string */
    licence = (char*)calloc(128, 1);
if ((!strncmp(serial, "DP8", 3) && *options != 'M' && *options != '5') || isDG)
        format_license_dp832_109(lic1_code, lic2_code, options, licence, isDG);
    else
        format_license_classic(lic1_code, lic2_code, options, licence);

    /* cleen up */
    free(lic1_code);
    free(lic2_code);

    return licence;
}

char *select_priv_key(char *serial) {
    char *priv_key;

    strtoupper(serial);
    if      (!strncmp(serial, "DS1", 3)) priv_key = DS1000Z_private_key;
    else if (!strncmp(serial, "DS2", 3)) priv_key = DS2000_private_key;
    else if (!strncmp(serial, "DS4", 3)) priv_key = DS2000_private_key;
    else if (!strncmp(serial, "DSA", 3)) priv_key = DSA815_private_key;
    else if (!strncmp(serial, "DP8", 3)) priv_key = DP832_private_key;
    else if (!strncmp(serial, "DG1", 3)) priv_key = DG1000Z_private_key;
    else                                 priv_key = no_private_key;

    return priv_key;
}

int main(int argc, char *argv[0]) {
    char *serial, *options, *priv_key, *licence;

    /* parse input */
    if (!((argc == 3 || argc == 4))) {
        show_help(argv[0]);
        exit(1);
    }
    serial = argv[1];
    options = argv[2];

    ascii_map = strncmp(serial, "DG1", 3)?(char*)ascii_map_:(char*)ascii_map_dg;

    if (argc == 4) priv_key = argv[3];
    else {
        priv_key = select_priv_key(serial);
        if (strlen(priv_key) == 0) {
            show_help(argv[0]);
            printf("\nERROR: UNKNOW DEVICE WITHOUT PRIVATKEY\n");
            exit(1);
        }
    }

    if (strlen(priv_key) != 14) {
        show_help(argv[0]);
        printf("\nERROR: INVALID PRIVATE KEY LENGTH\n");
        exit(1);
    }
    if (strlen(serial) < 13) {
        show_help(argv[0]);
        printf("\nERROR: INVALID SERIAL LENGTH\n");
        exit(1);
    }
    if (strlen(options) != 4) {
        show_help(argv[0]);
        printf("\nERROR: INVALID OPTIONS LENGTH\n");
        exit(1);
    }

    licence = make_licence(serial, options, priv_key);
    printf("%s\n", licence);
    free(licence);
}

Edit: I've added missing line to the function ecssign
« Last Edit: July 13, 2019, 08:16:16 am by starec »
 
The following users thanked this post: thm_w, RoGeorge, Houseman, 1anX, thierer, WhichEnt2, bd139, mike47203, ppsilva, blubillcanada

Offline firstcolle

  • Regular Contributor
  • *
  • Posts: 127
  • Country: it
Re: Need help hacking DP832 for multicolour option.
« Reply #277 on: July 10, 2019, 07:30:20 pm »
Many many thanks!!!
DP832 hacked to DP832A
DG1022z hacked to DG1062z

i only miss the 16M option, i can't find the procedure in the thread.
 

Offline tv84

  • Super Contributor
  • ***
  • Posts: 1449
  • Country: pt
Re: Need help hacking DP832 for multicolour option.
« Reply #278 on: July 10, 2019, 08:44:28 pm »
Edit: Of course I could try using :SYSTem:TYPE DM3068    As this would be the natural command, and we know :SYSTem:TYPE? works to find the Model Type.  It seems like it may be low risk? ?   But I don't want to brick my unit.

Edit 2: I used  :SYSTem:TYPE DM3068 plus various combinations of the command structure and nothing worked to do anything.  The plus side is that all is still OK with my DM3058E. So no 6 1/2 digits for it, but its not bricked either.

:) "I won't brick it..." 5 sec later "Let's do it.."

Well, I think any of those special "set" commands (as always) only work with a vendor USB disk inserted.
 
The following users thanked this post: ted572

Offline tv84

  • Super Contributor
  • ***
  • Posts: 1449
  • Country: pt
Re: Need help hacking DP832 for multicolour option.
« Reply #279 on: July 10, 2019, 08:45:44 pm »
i only miss the 16M option, i can't find the procedure in the thread.

The procedure is in the previous msg (to yours)!
 

Offline ted572

  • Frequent Contributor
  • **
  • Posts: 405
  • Country: ca
Re: Need help hacking DP832 for multicolour option.
« Reply #280 on: July 10, 2019, 10:59:55 pm »
Edit: Of course I could try using :SYSTem:TYPE DM3068    As this would be the natural command, and we know :SYSTem:TYPE? works to find the Model Type.  It seems like it may be low risk? ?   But I don't want to brick my unit.

Edit 2: I used  :SYSTem:TYPE DM3068 plus various combinations of the command structure and nothing worked to do anything.  The plus side is that all is still OK with my DM3058E. So no 6 1/2 digits for it, but its not bricked either.

:) "I won't brick it..." 5 sec later "Let's do it.."

Well, I think any of those special "set" commands (as always) only work with a vendor USB disk inserted.
Hello TV84:  Ok, I'm ready to do it, but what should I use for a 'Vendor USB Disk'?  Can I get one at Walmart, or Amazon?  Hi Hi, Ted
PS  : BTW Hi Hi is similar to Ha Ha.

Edit:  I'm not worried about bricking it as the DM3058 and E version firmware are the same package.  Whereas the DM3068 is apparently different(?).  Although I just noticed and the DM3058/E and DM3068 LDR firmware files are same size.  So that is interesting, maybe at one time the DM3058 was going to be also be used for the DM3068 hardware platform.  Anyway I'm looking forward to going ahead on changing the Model Name, although I don't necessarily have high expectations.
« Last Edit: July 10, 2019, 11:33:04 pm by ted572 »
 

Offline ted572

  • Frequent Contributor
  • **
  • Posts: 405
  • Country: ca
Re: Need help hacking DP832 for multicolour option.
« Reply #281 on: July 11, 2019, 12:30:48 am »
I added color coded labels to my DM832 as part of its conversion to a DM832A.  Unfortunately I used the camera's Flash that ended up washing out the colors, although the actual label colors are quite well matched to those of the LCD's Classic Display.

Edit:  New replacement photo.  I added Color to the three Channel selection buttons.  Had to use Flash again because the ambient lighting wasn't sufficient.

Last Edit: Added information about Using Sharpie Permanent Color Markers for adding LCD matching colors.

The colors are from Sharpie Permanent Color Markers (fine tip). You will have go to where they have a huge selection of different color markers, or otherwise get a large (qty 24) assortment package that you can select your particular colors from (confirm that your colors are included). The DC Output labels can be numbered using Dry-Transfer Decals. I had some old miscellaneous VHF Tape labels that simplified things for me.

My channel Button colors, and DC Output number label colors match the LCD display colors very well. You do have to coat the Buttons several times over a couple of days to get the markers to stain the buttons sufficiently, and the results look great. They will basically be permanent, although you can use a solvent on them to lighten the color if required as you go along. You can use gasoline as a solvent (Suggestion! Stay away from open flames). Gasoline will not affect the number label on the buttons, and it is also safe to use on the front panel's surface.  You may prefer using a less volatile solvent, but this works well for me. 
« Last Edit: July 26, 2019, 10:32:04 pm by ted572 »
 

Online Gandalf_Sr

  • Super Contributor
  • ***
  • Posts: 1634
  • Country: us
Re: Need help hacking DP832 for multicolour option.
« Reply #282 on: July 11, 2019, 12:47:42 am »
Hello TV84:  Ok, I'm ready to do it, but what should I use for a 'Vendor USB Disk'?  Can I get one at Walmart, or Amazon?  Hi Hi, Ted
You make it yourself, it's just a USB drive formatted in a particular way with a specific file on it.  Use any old or new USB drive and follow the instructions in this post which is all of 1 page back.
If at first you don't succeed, get a bigger hammer
 
The following users thanked this post: ted572

Online Gandalf_Sr

  • Super Contributor
  • ***
  • Posts: 1634
  • Country: us
Re: Need help hacking DP832 for multicolour option.
« Reply #283 on: July 11, 2019, 12:51:18 am »
I added color coded labels to my DM832 as part of its conversion to a DM832A.  Unfortunately I used the camera's Flash that ended up washing out the colors, although the actual label colors are quite well matched to those of the LCD's Classic Display.
Sweet! Where did you get those labels from?
If at first you don't succeed, get a bigger hammer
 

Offline ted572

  • Frequent Contributor
  • **
  • Posts: 405
  • Country: ca
Re: Need help hacking DP832 for multicolour option.
« Reply #284 on: July 11, 2019, 02:21:10 am »
I added color coded labels to my DM832 as part of its conversion to a DM832A.  Unfortunately I used the camera's Flash that ended up washing out the colors, although the actual label colors are quite well matched to those of the LCD's Classic Display.
Sweet! Where did you get those labels from?https://www.eevblog.com/forum/Smileys/default/facepalm.gif
Hello Gandalf:  For information on how I added Labels and Color to my PD832 to DP832A conversion Front Panel please see ->    https://www.eevblog.com/forum/testgear/need-help-hacking-dp832-for-multicolour-option/msg2540175/#msg2540175

Thanks for the info on the USB Image file that you provided a path to for me.  It hasn't helped, but I don't know if the USB Disk Image is the problem.  Or if it is just that the hack for the DM3058E doesn't do anything, which I kind of expected before (that it wouldn't work).  I have to play with this some more, and also see if I can reformat (low level of course) the USB drive back to its original 256 GB.  Right now its total capacity is at about 31 MB.  So the image must have been 31 MB, although the size of the image file itself was around 16.4 MB.  I know that this is what happens when you transfer a disk image file to a USB drive, so I'm not concerned.  But as I said I don't know if the image process worked properly yet.

Thanks for your assistance, Ted

Edit: Added Link for information about using Sharpie Permanent Color Markers for adding LCD matching colors, etc, and nothing requires disassembly.
« Last Edit: July 26, 2019, 10:30:12 pm by ted572 »
 

Online Gandalf_Sr

  • Super Contributor
  • ***
  • Posts: 1634
  • Country: us
Re: Need help hacking DP832 for multicolour option.
« Reply #285 on: July 11, 2019, 09:30:50 am »
@ted572
You're welcome.  If the USB drive reads and has a single file on it then it's almost certainly good and not the reason things aren't working for you.  Mine worked in a DG1022Z and DP832.  If you issue the model command via tenet and get a message like "unrecognized command" on the screen on the screen of device you're trying to upgrade but do get responses to *IDN? then it's probably a bad USB drive - maybe one that the device doesn't like for some reason.  However, a drive you created from the disk image is more likely to work than one you created yourself by formatting and copying the file to the drive.

I don't know if it's possible to upgrade a DM3058E using the USB method, has anyone else done that?
If at first you don't succeed, get a bigger hammer
 

Offline TurboTom

  • Frequent Contributor
  • **
  • Posts: 751
  • Country: de
Re: Need help hacking DP832 for multicolour option.
« Reply #286 on: July 11, 2019, 10:41:20 am »
The DM3068 DMM's digital circuitry is built around an Analog Devices Blackfin DSP, I assume it's a similar situation with the DM3058(E). It appears that only Rigol's more recent gear that's based on the Freescale/NXP i.MX or Texas Instrument Sitara ARM Core SOCs can be accessed via the "Magic Stick" method. So your attempts to "talk to" your DM3058E may be futile...  :(
 
The following users thanked this post: ted572

Offline ted572

  • Frequent Contributor
  • **
  • Posts: 405
  • Country: ca
Re: Need help hacking DP832 for multicolour option.
« Reply #287 on: July 11, 2019, 12:29:36 pm »
Thank you Gandalf and Tom for your comments.  Yes I believe that the USB SCPI commands aren't going change this to a DM3068.  I never had high expectations for it, but I wanted to give it a shot.  The DM3058 firmware wold need to modified to do the job of getting 6 1/2 digit display, and that is beyond my capability.

Side note: I send the Rigol SCPI commands via USB using 'Messinstrumente' (Measuring instruments - program for data transfer and control) which is very easy and always works for me.  You enter the SCPI command in the command window and then press Send/Receive.  The command goes out and a second later you see the results as received data.  A good test to see that all is working OK is to send *IDN?, and you should see a reply (Receive Data) with your Model Number and S/N.  Other commands may reply with something like 'Command Executed OK'.  If the command is invalid the program will simply time out 'without a reply', or 'Invalid Command', etc. in 3 - 6 seconds.

I just wondered why I didn't read about anyone else using this for the DP832 to DP832A Mod?  There is a USB type B connector on the back of the unit for this, in addition to the USB type A connector for the USB drive.  It seemed to me that everyone was using LAN or RS232 when the USB is so easy.

Rigol Ultra Sigma would also work for sending USB SCPI commands, but at the expense of adding about 500 GB to your computer, and not being able to uninstall it ALL without manually searching for left over Files and Registry entries.  Even using the more complete Uninstallers such as 'Revo Uninstaller', they won't catch everything, as there will still be well over ten items that won't be automatically cleaned out.

PS:  'Messinstrumente' is a portable program that doesn't get installed on your computer.  You can simply run it from a USB drive, the Desk Top, etc.

Edit: By request, here is a English link to 'Messinstrumente' (Measuring instruments - program for data transfer and control) ->  https://translate.google.com/translate?hl=en&sl=de&u=http://peter.dreisiebner.at/messinstrumente/index.htm
« Last Edit: July 16, 2019, 12:02:40 am by ted572 »
 

Offline das_strobel

  • Contributor
  • Posts: 10
  • Country: de
Re: Need help hacking DP832 for multicolour option.
« Reply #288 on: July 11, 2019, 12:51:25 pm »
Ok, 1-2 weeks ago i've modified riglol 1.03d for DG1000Z generation/calculation

here is a full source code:
...

I tried to make use of this code. I downloaded the sources from http://gotroot.ca/rigol/riglol/ and replaced the original riglol.c with your code. It didn't compile first, because all the #includes where missing. I added them and it compiled. But still no cigar. The compiled executable runs in general (putting out the help text etc.) but if I try to generate the 16MB option key it just hangs without any message. I can kill the program with Ctrl-C, though.

I did all that using Ubuntu 18.04 running in the native Linux environment on Win10.

Any idea?
 

Offline firstcolle

  • Regular Contributor
  • *
  • Posts: 127
  • Country: it
Re: Need help hacking DP832 for multicolour option.
« Reply #289 on: July 11, 2019, 02:24:23 pm »
i tried to compile with c compiler but it give me some errors..
wich compiler should i use?

i only miss the 16M option, i can't find the procedure in the thread.

The procedure is in the previous msg (to yours)!
 

Offline tv84

  • Super Contributor
  • ***
  • Posts: 1449
  • Country: pt
Re: Need help hacking DP832 for multicolour option.
« Reply #290 on: July 11, 2019, 05:56:06 pm »
i tried to compile with c compiler but it give me some errors..
wich compiler should i use?

That's a tricky question because the riglol / rigup source codes have some bugs (in terms buffer overruns, unallocated pointers, 32 bits vs 64 bits compilation, etc...). Most guys that are able to compile them do some corrections in order to accomplish it.

If all was good, any compiler should work.

For riglol try compilation in 32 bits or 64 bits, to start.
 

Offline mike47203

  • Contributor
  • Posts: 6
  • Country: us
Re: Need help hacking DP832 for multicolour option.
« Reply #291 on: July 12, 2019, 12:34:36 am »
Starec;

Thanks so much for the code you posted for the modified riglol. I was able to make that work. I did find that one line was missing that caused the program to hang. In the ecssign function at line 41 in your post "instr(a, curve_a)" is missing. Once I added that, it work perfectly. Much appreciated.

It seems that may be the problem other people were having. If you diff the posted code against the original riglol.c it is apparent what needs to be changed. I had no trouble compiling and running in Linux. Can't say if it works for any other platform.
« Last Edit: July 12, 2019, 12:41:07 am by mike47203 »
 

Offline das_strobel

  • Contributor
  • Posts: 10
  • Country: de
Re: Need help hacking DP832 for multicolour option.
« Reply #292 on: July 12, 2019, 09:45:04 am »
It seems that may be the problem other people were having. If you diff the posted code against the original riglol.c it is apparent what needs to be changed. I had no trouble compiling and running in Linux. Can't say if it works for any other platform.

Thanks, mike47203! This did the trick also for me. I changed the line, compiled again on my Ubuntu on WSL on Win10, and voila the program runs and the generated key works. 8) :-+ :-+ :-+
 

Offline starec

  • Contributor
  • Posts: 5
  • Country: sk
Re: Need help hacking DP832 for multicolour option.
« Reply #293 on: July 13, 2019, 07:30:31 am »
In the ecssign function at line 41 in your post "instr(a, curve_a)" is missing. Once I added that, it work perfectly. Much appreciated.
Yes indeed,
i wrote my own application in Windows and was all in there. This copied code was from riglol source itself. I only added my changes and no checked the remaining code so i didn't notice the missing line - my fault. However as tv84 been noted the riglol source codes have some bugs. I'd added (at least) releasing of acquired memory in the fn ecssign as follows
Code: [Select]
mirkill(a);
mirkill(b);
mirkill(p);
mirkill(q);
mirkill(Gx);
mirkill(Gy);
mirkill(d);
mirkill(k);
mirkill(r);
mirkill(s);
mirkill(k1);
mirkill(zero);
mirkill(f1);
mirkill(f2);
mirkill(f3);
mirkill(f4);
mirkill(hash);
epoint_free(G);
epoint_free(kG);
mirexit();
 

Offline tv84

  • Super Contributor
  • ***
  • Posts: 1449
  • Country: pt
Re: Need help hacking DP832 for multicolour option.
« Reply #294 on: July 13, 2019, 08:28:30 am »
I'd added (at least) releasing of acquired memory in the fn ecssign as follows

Yep, even this simple thing is missing...  When one runs a single time, less important but if we start reusing, etc, etc all type of weird things start to happen.

Of course the way mem is allocated and the var types/casts are the biggest problem.

riglol is more polished, rigup is much worse. Nonetheless the authors deserve all the credits for creating those tools.
 

Offline Marc M.

  • Regular Contributor
  • *
  • Posts: 132
  • Country: us
Re: Need help hacking DP832 for multicolour option.
« Reply #295 on: July 13, 2019, 10:38:07 pm »
... The USB drive must be formatted as FAT, not FAT32 or exFAT. On...

For some reason this isn't always the case.  I just grabbed a brand new 8Gb pre-formatted FAT32 card (older SanDisk HC1), stuck the file on it and powered the supply up with the USB adapter plugged in.  I connected to a Windows laptop with UltraSigma installed and sent IDN to confirm the connection, then issued the :PROJ.... command.  I think it spit out an error but I saw an OK at the bottom so I went ahead and power cycled the supply.  It came up in not-so glorious color.  Arrggh, the pale color pallet of grey, white, and light blues is terrible, but I do like the 3 color classic main display. 

Aesthetics aside, I had to jump thru some hoops before I got the above result.  I bought an early supply with the original hardware and firmware (1.04 maybe?) on it.  When I tried it on that firmware it flipped me off with an error.  I remembered there was an issue with newer firmware and hacked options which was no reversible so I never bothered to update it.  Since this hack changes it to an A model, all options are  turned on automatically so any risk to previously hacked options won't matter.  I updated the boot loader, then the firmware, and finally the analogs with the latest revision I found somewhere on Rigol's site.  After that was complete, I reconnected, issued the PROJ command and it worked without a problem.  So SD cards are just hit/miss as I violated both the 2 to 4 gig limit and the no FAT32 rules. YMWV but I'd try whatever card you have at hand.

On my already way too long, I'll be dead long before half of it gets done To Do list, I plan on pulling the front panel off and changing out the green LEDs behind the channel enable buttons to reflect the channel color to help differentiate them (at least while they're turned on). Anyone happen to know what size they are?  I voided my warranty long ago dealing with the overheating regulator issue, and I've probably had it longer than 3 years anyway.  Rigol could make a killing selling replacement 832A buttons!
Don't replace the cap, just empty the filter!
 

Online Gandalf_Sr

  • Super Contributor
  • ***
  • Posts: 1634
  • Country: us
Re: Need help hacking DP832 for multicolour option.
« Reply #296 on: July 13, 2019, 11:41:31 pm »
Changing the LEDs to match the channel colors is a great idea.  I found that my drive was formatted to FAT worked so I think that FAT32 is not absolutely essential.
If at first you don't succeed, get a bigger hammer
 

Offline tv84

  • Super Contributor
  • ***
  • Posts: 1449
  • Country: pt
Re: Need help hacking DP832 for multicolour option.
« Reply #297 on: July 14, 2019, 09:03:56 am »
These equipments use Linux filesystems so all 3 FAT types should work when we are reading/writing files.

The only limitation is that some Rigol equipments do some USB vendor disk verification (when one wants to do the "upgrades") with direct disk access functions and those should match a specific FAT type or may end up in unpredictable results.
 

Offline Marc M.

  • Regular Contributor
  • *
  • Posts: 132
  • Country: us
Re: Need help hacking DP832 for multicolour option.
« Reply #298 on: July 14, 2019, 04:18:57 pm »
A special thanks again to everybody in the EEVBlog Community who contributed to all the reverse engineering efforts within the Rigol product range which allowed me to maximize the potential of my DSA815, DS2072, and now DP832.  My only regret was buying a DG4162 instead of a 4062  :palm:.  You guys rock!

I said screw it, stayed up late and swapped out the LED's which were 0806's.  I didn't have any in purple, so I stuck a red one in for now.  Got some purple and some hopefully yellower yellow LEDs heading this way from China.  All I can say is Wow! what a difference.  I was worried the replacements wouldn't be bright enough but I was wrong, they are quite a bit brighter than the stock green ones.  I'm so happy with the results, one of these days I'm going to pull my Rigol DS2072 apart and replace the front panel LEDs on that because the green ones on that are barely visible.

I was also surprised to see provisions for a set of 4th channel buttons both on the PCB and the molding in the front case.  I had sniffed around looking for a photo of the front keyboard to determine the LED size ahead of time but couldn't find one.  Dave didn't pull the front board when he did his teardown either so here's a shot of mine for the curious.
Don't replace the cap, just empty the filter!
 
The following users thanked this post: thm_w, 1anX

Offline 1anX

  • Regular Contributor
  • *
  • Posts: 190
  • Country: au
Re: Need help hacking DP832 for multicolour option.
« Reply #299 on: July 16, 2019, 10:41:22 am »
Marc M where are you getting your smd 0806 leds from?
Looks great with the coloured leds and if cheap from China I think I will do the same to mine just for fun!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf