Giter Site home page Giter Site logo

Comments (132)

brianrho avatar brianrho commented on July 18, 2024

No, I said to provide a screenshot of the python console itself after the image is done being transferred. Dont paste the text. Upload an image of the console.

from fpm.

brianrho avatar brianrho commented on July 18, 2024

Also turn off debug, when you do this

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

When i turn off debuging the python exe doesnt work:
image it creates blank image, with no content.

With debugging is open, i get this:
image This creates image as seen in above comments

from fpm.

brianrho avatar brianrho commented on July 18, 2024

Okay. So this is the latest version of the library, right? And in the first case, you get "Timeout!" after waiting for a few seconds?

from fpm.

brianrho avatar brianrho commented on July 18, 2024

The "Timeout!" doesn't show immediately the image stream begins?

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

Yes it dosnt show immediately, it takes like 10 or little more seconds. And this is latest version of library, with R551 uncommented line

from fpm.

brianrho avatar brianrho commented on July 18, 2024

It seems your module has a different image size of 192x192. I've pushed a change to the python script. Assign True to FPM_R551_MODULE at the top and run it. Let me know how it works out

from fpm.

brianrho avatar brianrho commented on July 18, 2024

It's important that debugging is turned off for this sketch because the debug messages go through the same Serial port as the image stream, so all those debug strings end up getting written to the bmp file, which isnt what you want.

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

I get same error:
image
Did you recompiled python exe or it read from that file?

from fpm.

brianrho avatar brianrho commented on July 18, 2024

No I haven't rebuilt the exe. Can you run the python script?

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

I edite phyton file, but i dont see changes, so i assume your changes is only on file, not on .exe, to build exe from python file i cant yet, i had lots of trouble with python on Windows 10, would be good if you could build it

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

Ok nevermond, i did run python file, and i got image however it doesnt look as expected either:
test

from fpm.

brianrho avatar brianrho commented on July 18, 2024

Let me see the console output.

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

image

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

According to documentation image buffer size can be 192x192 with depth of 8
image

from fpm.

brianrho avatar brianrho commented on July 18, 2024

Yeah, made a mistake. In the python code, change the WIDTH = 96 to 192.

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

I tried that myself, i still get error. Console looks like this:
image
Image looks like this:
othertest

from fpm.

brianrho avatar brianrho commented on July 18, 2024

That looks like the very last packet. Can you try running it again? I want to see if the failure is consistent

from fpm.

brianrho avatar brianrho commented on July 18, 2024

I think you didnt change this line FPM_R551_MODULE = False to True like I said. The arduino ends up waiting forever for another packet, when the image stream is already completed.

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

Two tries out of five did not gave error message, however rest of the tries gave same error message. All scanned images was same size.
Code is:
image

from fpm.

brianrho avatar brianrho commented on July 18, 2024

What is the exact size? Check the properties of the generated image and send a screenshot of that. Also a screenshot of the console output when there was no error.

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

Scanned image size is 192x192 pixels
Console look like this:
port is COM3 and bound is 57600
image

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

As well im using python -m pip install pyserial as for serial import for python, that maybe be other kind of serial?

from fpm.

brianrho avatar brianrho commented on July 18, 2024

No, its fine. Run the sketch, but use the serial monitor instead.

from fpm.

brianrho avatar brianrho commented on July 18, 2024

Looks like the problem isnt with the script, its with the module not sending FPM_ENDDATAPACKET to show that its done.

from fpm.

brianrho avatar brianrho commented on July 18, 2024

You haven't made any changes to the image_to_pc sketch, right?

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

No, i havent, only to FPM.h library, where i uncommented one line of code
/* R551 is different in a few ways (no high-speed search, off-by-one template indices)
uncomment this line if you have one of those */
#define FPM_R551_MODULE

from fpm.

brianrho avatar brianrho commented on July 18, 2024

Okay. Comment out line 663 outStream->write(byte); in FPM.cpp. Enable debugging. Then run the sketch with the serial monitor alone. Let me see what is printed in the last few packets of the image, before the error shows up.

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

[+]Got header
[+]Address: 0xFFFFFFFF
[+]PID: 0x2
[+]Length: 128
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 80 EF 1 FF FF FF FF 8 0 82 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
Read data failed: -1

Error receiving packet 80

And this is like 1/3 shorter than rest

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

At beginning it seems to get normal packages but on the end only FF's appear

from fpm.

brianrho avatar brianrho commented on July 18, 2024

The FFs arent a problem, they just show that most of the image is white pixels as expected.
Comment out these debug lines in the code:

[+]Got header
[+]Address: 0xFFFFFFFF

As well as line 670: FPM_DEBUG_HEX(byte); FPM_DEBUG_PRINT(" ");

I want only the PID and length to be printed.

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

Before stream:
[+]PID: 0x7
[+]Length: 1

On the stream:
[+]PID: 0x2
[+]Length: 128
Read data failed: -1

Error receiving packet 144

from fpm.

brianrho avatar brianrho commented on July 18, 2024

Run it a few more times, check that it gives the same result and stops at the same packet

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

Yes its always same packet

from fpm.

brianrho avatar brianrho commented on July 18, 2024

And this is the very last packet always:

[+]PID: 0x2
[+]Length: 128

Can you check if any packet has a PID of 0x8?

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

There is no packet with PID 0x8

from fpm.

brianrho avatar brianrho commented on July 18, 2024

At line 662 in FPM.cpp, change this:

if (outStream != NULL) {
      outStream->write(byte);
}

to

if (outStream != NULL) {
      outStream->write(byte);
      chksum += byte;
}

and this at 684:
if (outStream == NULL && to_check != chksum)
to:
if (to_check != chksum)

from fpm.

brianrho avatar brianrho commented on July 18, 2024

Let me know if it prints "Wrong chksum" for any packet.

from fpm.

brianrho avatar brianrho commented on July 18, 2024

outStream->write(byte); should still be commented out as before.

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

It prints that for every stream packet

[+]Wrong chksum

Read data failed: -1

Error receiving packet 0

from fpm.

brianrho avatar brianrho commented on July 18, 2024

What of the PID and length? There was no wrong chksum in the earlier commands, right?

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

[+]Wrong chksum
[+]PID: 0x2
[+]Length: 128

[+]Wrong chksum

Read data failed: -1

Error receiving packet 0

It was all the time while stream begin, before stream, there there was this:
[+]Length: 1
[+]PID: 0x7

from fpm.

brianrho avatar brianrho commented on July 18, 2024

You mean, there was no "wrong chksum" before the stream began, but then after that, each packet has a wrong chksum? ALL the packets with wrong chksums have a PID of 0x2?

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

Yes

from fpm.

brianrho avatar brianrho commented on July 18, 2024

Uncomment line 670: FPM_DEBUG_HEX(byte); FPM_DEBUG_PRINT(" "); and the other debug lines (Header and address only). I want to see the entire packet as its printed. Use pastebin.com to send a dump of everything printed in the serial monitor.

from fpm.

brianrho avatar brianrho commented on July 18, 2024

Also send a copy of your FPM.cpp in another paste.

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

https://pastebin.com/Xcpz16Vv the serial monitor
https://pastebin.com/vZpz5D75 fpm.cpp file

from fpm.

brianrho avatar brianrho commented on July 18, 2024

Have you restarted the module, since you started using it to get images?

from fpm.

brianrho avatar brianrho commented on July 18, 2024

The packet length setting is being ignored for some reason and it could be because it hasn't taken hold yet.

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

Probably not, how do i reset it? using reset pin or just unplug?

from fpm.

brianrho avatar brianrho commented on July 18, 2024

Just unplug from power and try again.

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

There is same error

from fpm.

brianrho avatar brianrho commented on July 18, 2024

Okay then. Lets reset the packet length to 32 and restart. Change this line in the sketch:

uint8_t value = FPM_PLEN_128;

to:

uint8_t value = FPM_PLEN_32;

Restart the module and try the sketch again. Update the serial monitor dump at the same pastebin link.

from fpm.

brianrho avatar brianrho commented on July 18, 2024

Remove the header and address debug messages too

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

https://pastebin.com/SRYQ6X1J new pastebin, because i cant edit old one

from fpm.

brianrho avatar brianrho commented on July 18, 2024

How are you powering the module?

from fpm.

brianrho avatar brianrho commented on July 18, 2024

The Arduino Uno 3.3V pin?

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

yes, as i showed you in the first email i sent

from fpm.

brianrho avatar brianrho commented on July 18, 2024

Do you have another 3.3V source? Maybe a USB-TTL adapter? The arduino 3.3V pin can supply only 50mA max and I want to rule out power as a possible cause.

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

I dont have anoter adapter apart arduino, but i di have Raspberry Pi3, thi i dont know if its any help

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

And i do have 5V phone charger, but that also is not an option

from fpm.

brianrho avatar brianrho commented on July 18, 2024

Yeah try powering the sensor with the RPi 3.3V pin, no need to connect anything else to the RPi, just power it. Run the sketch again and update the dump. You can update it at the bottom

from fpm.

brianrho avatar brianrho commented on July 18, 2024

Sorry, you can edit it at the top of the text window. Just use Find in your browser to search for "edit"

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

Apparently i have to be logged in to be able to edit so i just rather paste new ones
https://pastebin.com/5hiCpBND

Error seems to be same

from fpm.

brianrho avatar brianrho commented on July 18, 2024

Okay. Run it again. Seems the very first image packet has a correct checksum but the ones that follow are wrong.

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

https://pastebin.com/tVU2i7zR

this is what i got now

from fpm.

brianrho avatar brianrho commented on July 18, 2024

Okay comment out the address, PID and length messages. Only the image bytes should be printed and "wrong chksum"

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

https://pastebin.com/TxLStMxC

from fpm.

brianrho avatar brianrho commented on July 18, 2024

Run the "set_parameters" example. It will change the baud rate to 9600. Then run the image_to_pc again with SoftwareSerial baud rate of 9600.

from fpm.

brianrho avatar brianrho commented on July 18, 2024

Remember to comment out the Address debug messages.

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

Apparently for some reason Arduino does not recognize fingerprint anymore

from fpm.

brianrho avatar brianrho commented on July 18, 2024

Did you update this line fserial.begin(57600); to fserial.begin(9600);?

from fpm.

brianrho avatar brianrho commented on July 18, 2024

The baud rate is now 9600 so you need to change it in your sketch

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

Alright, now i get Unknow error
image

from fpm.

brianrho avatar brianrho commented on July 18, 2024

Is this with the "image_to_pc" sketch?

from fpm.

brianrho avatar brianrho commented on July 18, 2024

Restart the module and run the sketch

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

image
I get this and nothingh happen after this

from fpm.

brianrho avatar brianrho commented on July 18, 2024

Looks like the debug messages are disabled

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

Now i get this
https://pastebin.com/JDTf2cv6

from fpm.

brianrho avatar brianrho commented on July 18, 2024

Set this: uint8_t value = FPM_PLEN_32; back to 128. And disable the printing of the Address and Chksum. ONLY the bytes should be printed.

from fpm.

brianrho avatar brianrho commented on July 18, 2024

Restart the module after you change the packet length to 128.

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

It printed everything in one line:
https://pastebin.com/KXcL05aB

from fpm.

brianrho avatar brianrho commented on July 18, 2024

Disable debug. Run the sketch and wait for the image stream to complete. You wont see any bytes printed except the final error/success message.

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

image

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

Seems like it read all bytes 192x192

from fpm.

brianrho avatar brianrho commented on July 18, 2024

yes. The problem seems to have been the delays from the debug messages. Try running this with the python script now.

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

image
Time out appeared instantly

from fpm.

brianrho avatar brianrho commented on July 18, 2024

Oh yeah, you need to put back this line: outStream->write(byte); in FPM.cpp so the bytes actually get written

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

Do i leave cheksum as well?

from fpm.

brianrho avatar brianrho commented on July 18, 2024

Yeah leave it as is

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

image
asdasd

from fpm.

brianrho avatar brianrho commented on July 18, 2024

Use this script instead: https://pastebin.com/wenMKKGN. It seems the module datasheet is also wrong and every byte of the image is being sent, not half. The script expects 18432 bytes not 36864

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

asdasdasdasdasdasd
Now i can almost see image, however its somehow divided into 3 and bottom is just white

from fpm.

brianrho avatar brianrho commented on July 18, 2024

Let me see the console output

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

image

from fpm.

brianrho avatar brianrho commented on July 18, 2024

This result is the same everytime?

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

Yea

from fpm.

brianrho avatar brianrho commented on July 18, 2024

At this point, the issue is the format of the image. I assumed its a simple grid of 192x192 like they said but if its not then it will require some analysis to detect the image dimensions. Try this: https://pastebin.com/wenMKKGN. I've set the image size to 384x192.

from fpm.

brianrho avatar brianrho commented on July 18, 2024

If it doesn't work, we'll have to leave it for now. You can send me the raw 192*192 image and I can check it out later. Maybe you can also search the web for the R551 SDK or contact sellers/manufacturers. Ask them about the image dimensions.

from fpm.

baku-hatsu avatar baku-hatsu commented on July 18, 2024

asdasdasdasdasdasd
sometest
These are 192x192 and 384x192
I will try contact seller for dimentions, but i think they wont be any of help

from fpm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.