Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: invalid literal for int() with base 16: '0 0' #3

Closed
Tecnosoft-dev opened this issue Sep 2, 2021 · 31 comments
Closed

ValueError: invalid literal for int() with base 16: '0 0' #3

Tecnosoft-dev opened this issue Sep 2, 2021 · 31 comments

Comments

@Tecnosoft-dev
Copy link

hi robots

when running backupfirmeware.py it starts reading normally until 28% shows this error:

Screenshot_7

the instument that i m reading from is working, i have tested also with another working station and the same error is shown,

i m using python 3.4.1 installed on win7 pack 1, 32 bit arch.

as i have a few experience in programing i think the error is because the int with base 16 cant quary more data

so what is the simple solution

@Tecnosoft-dev
Copy link
Author

@Tecnosoft-dev

This comment has been minimized.

@robots
Copy link
Owner

robots commented Sep 3, 2021

Hi, the data coming from station looks wrong.
It should be 16 pairs of numbers, not triplets as in your case. I would suggest trying with more recent python version and pyserial. Python 3.4 is very old one. I work with 3.9.

@Tecnosoft-dev
Copy link
Author

Tecnosoft-dev commented Sep 3, 2021

I installed the most recent python version 32 bit on windows 10, and tried again the same error apears, but now it ends in 7 % or 23 % of reading not 28%.

This is the header of the printed log:
16306934931072306024146367326349

@Tecnosoft-dev
Copy link
Author

This what is being in buttom of one of my two instrument:
IMG_20210903_200240

To know i have tried dumping three models of instrument but the same error apears, one of them working perfectly 5605, the others 5605 and 5601 not working:
5605: we have changed the two internal batteries missing bad side effects like loosing internal program, now it is not connecting and not detected at all by the CU "please connect the instrument..." But it runs with it self.

5601: the cu tells "unsupported instrument model", and says also "internal batteries expired"
But still not functioning.

@Tecnosoft-dev

This comment has been minimized.

@Tecnosoft-dev

This comment has been minimized.

@Tecnosoft-dev
Copy link
Author

Tecnosoft-dev commented Sep 4, 2021

@Tecnosoft-dev
Copy link
Author

i also tried updating pyserial to the most recent version by following this video:

https://www.youtube.com/watch?v=Pf-cGzOQmXU

but still the same error uisng your unmodified code

@Tecnosoft-dev
Copy link
Author

IMG_20210904_111932_1

I'm trying with this new suggested code so it may solve the bank reading error "too many ..."

@Tecnosoft-dev
Copy link
Author

Now its showing another error when is in bank reading 21%:
IMG_20210904_113352_1

I think i haven't touched the problem's head yet, i think i have the same instrument of yours.

@Tecnosoft-dev
Copy link
Author

If you don't mind can you send me your extracted firmware file so i directly upload it to 5605 or 5601 or 5603.

@Tecnosoft-dev

This comment has been minimized.

@Tecnosoft-dev
Copy link
Author

Is there any different between running the code in python program and running it in black command console of windows,
I mean showing those errors.

@Tecnosoft-dev
Copy link
Author

I used cmd to run tha prog so everything worked as wanted.

@AkramBsn
Copy link

AkramBsn commented Sep 5, 2021

sir can you send me firmware for 5603 dr200+ please if possible i have problem with mine not working for me :/ ??

@robots
Copy link
Owner

robots commented Sep 6, 2021

@Tecnosoft-dev so the dump worked ?

@Tecnosoft-dev
Copy link
Author

Tecnosoft-dev commented Sep 6, 2021

yah, worked but only for 5605 but not with 5601 (because for 5605 i copied a healthy firmware from a real working 5605),

5601 i dumped the memory into a file then i replaced the old two internal batteries then i re-upload the file forcingly (skipping errors) but in the end it still showing "unsupported instrument model, please contact..." despite the "internal battery expired" is really solved.

so i need a another healthy dump for 5601 and 5603, if you have the two or at least one please send it to this mail:
wassilfacile@gmail.com

or just send them to this telegram number:
00213657579261

this a group i recently created:
https://t.me/joinchat/ynKvrixzgOE5OTQ0

@Tecnosoft-dev
Copy link
Author

@robots
Copy link
Owner

robots commented Sep 9, 2021

5601 i dumped the memory into a file then i replaced the old two internal batteries then i re-upload the file forcingly (skipping errors) but in the end it still showing "unsupported instrument model, please contact..." despite the "internal battery expired" is really solved.

What does it mean "skipping"errors ?

so i need a another healthy dump for 5601 and 5603, if you have the two or at least one please send it to this mail:

Its not that easy, Its not just firmware you are uploading but also configuration of station and calibration. These stations come in many different configurations - different EDM modules, radio, tracker, etc. Calibration values are valid only for the angle sensors in the station and values from different station will work but will provide you wrong readout.

@robots robots closed this as completed Sep 9, 2021
@Tecnosoft-dev
Copy link
Author

Skipping errors: putting # before sys.exit and some other lines, because sometimes it doesn't upload normally.
About values: because uploading a working firmware remain as one of resting probabilities i could test, even if values may deffer, so if it works i believe the issue is not in hardware but in software. Like that i can move to next step, which is looking at adjusting values.

@Tecnosoft-dev
Copy link
Author

You may know that before:
IMG_20210909_084422

I converted the firmware resulted using a site hex to ascii.

@Tecnosoft-dev
Copy link
Author

When i compared two firmwares one of working station and one of not working, i see that all the difference is in the head of the two files (from 0 to about 310 lines), the rest lines are exactly the same (from about 310 to the last).
May this help!

@robots
Copy link
Owner

robots commented Sep 9, 2021

Yes, the begining is the working ram and data. Some of the data is working buffers for serial port, and some is the calibration data.

@Tecnosoft-dev
Copy link
Author

You may noticed (from Michelle 's papers he captured in survey connect forum) they used a program named: HexLoader, and by searching i founded a copy in GitHub.

I made the previous comparison by compare plugin of notepad++, its useful.

I actually downloaded the firmwares of 5601 and 5603 before reinstalling the two new 3V batteries.
But as i told you before i uploaded the firmwares and yes the stations revived (no more battery messages) but "unsupported instrument model" and "detected but not connecting" still the same problems.

So by converting the a file from hex into ascii (image above), i see a lot of values i fairly believe they are the values mentioned in Michelle's papers.

So to put you in the image, i just came with an idea of making somehow a new file contains the same program but only the values will be changed (depends on the station uniques), but a problem of number of lines will came up, so to solve this:

  1. We need a working firmware of each station model
  2. A program that analysis the old firmware and extract all values included.
  3. Another program merges between the healthy firmware and the old values of the station.
  4. Upload the new firmware file.

@robots
Copy link
Owner

robots commented Sep 9, 2021

As i said, its not that easy :-)

what you are seeing .. those texts ... are actually serial port buffers. Data that was sent over serial port or received over serial port. Label values are in binary. You can actually modify those, almost any of them, over serial port! After you login into station and unlock those labels.

Problem is, that you don't know which label you need to change to what value.

@Tecnosoft-dev
Copy link
Author

Would you please tell me how to change them, how to convert them to human readable text and return them back to hex buffers.
Because "unsupported instrument model" message apears and don't let cu to use station, for that i have a probability the old firmware was corrupted before i downloaded it, so i think changing 'model' value may solve the problem

@robots
Copy link
Owner

robots commented Sep 10, 2021

You can access all labels from serial port of station. There is no need to access them in hex editor and change them. Problem is that, all labels are numbers and those numbers are not very well documented.

@Tecnosoft-dev
Copy link
Author

Tecnosoft-dev commented Sep 10, 2021

Would you please show me an example of code on how to read a value and write it.

@Tecnosoft-dev
Copy link
Author

Why gdm_write can't change value 100 (gdm model) it just results: 20.8, when i read the value it still the same.

@robots
Copy link
Owner

robots commented Sep 18, 2021

https://github.com/robots/gdm/tree/master/docu/workshopscan
here .. have fun with labels :-)
to read label you need to use Rx,nn ... where x is the "subsystem name", S- servo board, G - gdm, A angle board, etc, nn is the label number
to Write .. Wx,nn=value
all commands are sent over serial port. Some labels are locked, you need to unlock it (as the script does in the beginning - seed/key)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants