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

setup for Huawei P8 with AN97 #11

Closed
ErnstTom opened this issue Apr 29, 2020 · 92 comments
Closed

setup for Huawei P8 with AN97 #11

ErnstTom opened this issue Apr 29, 2020 · 92 comments

Comments

@ErnstTom
Copy link

Dear Peter Stroiber
now i have some time to try the UVC app.
but a lot of things are new to me, unknown.
How to set up a Huawei P8 (non-lite) mobile phone with AN97 endoscope.
i have tried many apps but all of them only work with the high-end and samsung device only.
and I think the huawei p8 isn't weak either

@Peter-St
Copy link
Owner

Hello,

up to now I wasn't able to test these Kirin Processors with my app, so I can only give you some advices.
I think this app could work with your mobile phone, but I don't know how good or bad the usb-source of your phone is.

Basically you start to detect the camera. You take a look at the Interface's and Endpoints of your endoskop, to get sure it's a uvc device. And at last you try to get some data of your camera.
For getting some data you use the manual uvc set up method.
You can choose the lowest values for the resolution.
If you start with 1 PacketsPerRequest and 1 ActiveUrbs you need to find the right Maxpacketsize (/Altsetting) for your devices.
So you try out all the Maxpacketsize's of your camera and start a testrun.
The testrun where you get the most bytes back from your camera, is the right one.
You keep this Maxpacketsize and try then to raise the PacketsPerRequest and ActiveUrbs. Perhaps only to an amount of 4, perhaps higher. When you notice, the bytes gets smaller, or the stream fails, you have to lower these values again.

Good luck.

@ErnstTom
Copy link
Author

ErnstTom commented May 3, 2020 via email

@Peter-St
Copy link
Owner

Peter-St commented May 3, 2020

Please post your values or adjust a screenshot from your values.

@ErnstTom
Copy link
Author

ErnstTom commented May 3, 2020 via email

@Peter-St
Copy link
Owner

Peter-St commented May 3, 2020

Please post the pictures, or give a link to the pictures...

@ErnstTom
Copy link
Author

ErnstTom commented May 3, 2020 via email

@Peter-St
Copy link
Owner

Peter-St commented May 3, 2020

Load the screenshots up to google drive and post the link.
Or you click on the pictue icon direct in the github dialog menu, select an item and post it.

@ErnstTom
Copy link
Author

ErnstTom commented May 4, 2020

the attached:
1
2
3
4

@Peter-St
Copy link
Owner

Peter-St commented May 4, 2020

Hello Ernst,

the values from the 1st Picture should fit.

The 2nd Picture does not matter up to now.

In the 3rd and 4th Picture your Value for PacketsPerRequest and ActiveUrbs are much too high.

Start with 1 and 1 for those two Values.

Normally you do not have to edit the values in the edit/save menu.

You can try out then the -Controltransfer-Testrun- Button and attach the output again with a screenshot.

@ErnstTom
Copy link
Author

ErnstTom commented May 4, 2020

Dear Peter St.
10
11
12
13
14
15

I tried a lot of settings all the way through - not all the variations.
and the flash drive (10) and camera (11), which run on a pc, are recognized by OTG usb.
but an error comes (14,15-failed to start the camera stream).
Maybe you really can't use the device?
You have a token that is a non-Samsung mobile,
maybe even another type of Huaweien running the app?

@Peter-St
Copy link
Owner

Peter-St commented May 5, 2020

Please post the output of the first menu (Video Probe-Commit Controls) in the -Controltransfer-Testrun- menu with your selected values.
So far,

Peter

@ErnstTom
Copy link
Author

ErnstTom commented May 5, 2020

Dear Peter St.
I send the printscreens
21
22

maybe it's only OTG capable but not UVC support?
I just asked the Hungarian huawei if they think he knows the device.

@Peter-St
Copy link
Owner

Peter-St commented May 5, 2020

If you have the possibility to debug your phone over android studio with a PC / Laptop, we get exacter outputs, whats failing.

The thing what fails is the control transfer sended to the endoscop. Perhaps a weak OTG adapter (I also had one) If you have another otg hub, try it.

Eventually, if you have a linux machine on you Pc, you can post the output of:
lsusb -v -d xxxx:xxxx
First xxxx is vendor id / Second xxx is the product id.

@Peter-St
Copy link
Owner

Peter-St commented May 5, 2020

Hui, ok,

We got 1 working controltransfer.

The value 614400 was sended from your endoscop device and fits so far...

@Peter-St
Copy link
Owner

Peter-St commented May 5, 2020

One thing is strange, but should not matter up to now --> Your Hint value changed from 1 to 0 after the first control transfer

@Peter-St
Copy link
Owner

Peter-St commented May 5, 2020

I will give you a link with a debug apk, which you can install on your Phone and then plz run the same method with the same values ...

@ErnstTom
Copy link
Author

ErnstTom commented May 5, 2020

There are only win98 and 7. (PC, LT).
I don’t understand exactly what to do - I don’t understand that much on mobile android. Or should I read something connected to pc / lt?
Original (added cable, connector - but I tried other USB A / USB C converters as well). In the case of flash drive, ok.
AN97 endoscope available in the Far East.
31
32
33
34
35
36
37
38
39

@Peter-St
Copy link
Owner

Peter-St commented May 5, 2020

Plz wait, Till I get the apk finished ...

Your endoscop camera is an UVC device.
We have to send 4 Controltransfers to your Endoskop Camera to Set it up with your Selected Values. --> The process is automatically handled by the app, but fails in your case.

@Peter-St
Copy link
Owner

Peter-St commented May 5, 2020

Download this apk and run it with the same values.

https://drive.google.com/open?id=1lJ9hJyqAg-EqPGJUPZpdk_bN7gEPS2Jk

@Peter-St
Copy link
Owner

Peter-St commented May 5, 2020

Again attach the output of the first menu (Video Probe-Commit Controls) in the -Controltransfer-Testrun- menu with your selected values.

@ErnstTom
Copy link
Author

ErnstTom commented May 5, 2020

Thank You
I make that, meine ich, morgen kann ich darüber eine Rückmeldungen senden

@ErnstTom
Copy link
Author

ErnstTom commented May 6, 2020

answer from Huawei:
"In our experience, the Endoscope cannot be connected to the P8.
For compatibility with other external devices, I suggest that you contact your manufacturer or distributor. "

@ErnstTom
Copy link
Author

ErnstTom commented May 6, 2020

I deleted the old one last night and installed the new one - but unfortunately the result is the same.

41
42
43
44
45

@Peter-St
Copy link
Owner

Peter-St commented May 6, 2020

Hmm,

At this Picture:
81081945-da110600-8ef2-11ea-8a9d-2103175ba3eb
you got a valid return from your endoscop.
Try to receive the same output again.
Perhaps uninstall and reinstall from Play Store, to test the old version too.

How you got the working Output?

@ErnstTom
Copy link
Author

ErnstTom commented May 7, 2020

ALL RIGHT.
although the first page of the image you mentioned (05.05.17: 07) also showed an error while initializing the camera.
(the image comes with the original (playstore) version)
51
52
53
54

@ErnstTom
Copy link
Author

ErnstTom commented May 7, 2020

Dear Peter
but surely there is a fault in one of my devices.
I've already kidnapped you a lot of your time.
although if it came together, many huawei owners would surely be happy.

@Peter-St
Copy link
Owner

Peter-St commented May 7, 2020

Hmm,

if you could also spend some time, you could install android studio on your PC and try to debug this issue by your self.
I would update a Win Version of my github repo, because this on is for Limux, don't know if you could load it on Win.

The other way would be to test apk's uploaded by me. You have to give me then each time feedback. --> it's also not clear to me why the currently linked apk don't have the same return, like the one on Play Store.

Choice is to you.

@ErnstTom
Copy link
Author

ErnstTom commented May 8, 2020

Sorry, but I can't identify based on the text what and where to download for pc testing.

@Peter-St
Copy link
Owner

Peter-St commented May 8, 2020

Ok, then we will try to debug over sample apps, which I will upload.

Explanation:
The source code in this repo was written with Android-Studio. This is the most common tool for writing apps for Android Platforms. Other Programs for App Building for example are Eclipse or Netbeans or...
If you have no experience in Android-Studio for now, it will be much too hard for you to set it up and next try to debug an app on your own.

@Peter-St
Copy link
Owner

Please test these 3 apks and post only the output, if you receive a sucessful return from the endoscop.
Camera 0:
https://drive.google.com/open?id=1-Ss0H9swlJcq6xOmeigb3W_NdN3XaUlu
Camera 1:
https://drive.google.com/open?id=13KsZKfuBeOH0h2O4wyzI_2DtcU0269x7
Camera 2:
https://drive.google.com/open?id=17UIye2qzvH0lvzjUHwkWVUYyVyA8jxFA

So far,

Peter

@ErnstTom
Copy link
Author

Sehr Geehrte Peter
die Einstellungen sind gleich mit pemcam2.
Leider das Ergebnisse für mich auch.
penc3-1log.txt
Screenshot_2020-05-17-12-25-36

@Peter-St
Copy link
Owner

Hello Ernst,

With the pen cam, try to click the manual method, and when you get the exception, then post the log.txt.

So far,

Peter

@ErnstTom
Copy link
Author

endoscope data0 (May 25, 25):
if I click on the actual stream after test the stream then there are already reset values in the setup after it flows
endc0-1log.txt
endc0-2log.txt
endc0-3log.txt
endc0-4log.txt

Screenshot_2020-05-17-12-51-05
Screenshot_2020-05-17-12-55-10
Screenshot_2020-05-17-12-57-21
Screenshot_2020-05-17-12-58-47
Screenshot_2020-05-17-12-58-59
Screenshot_2020-05-17-12-59-54

@ErnstTom
Copy link
Author

answer for 12.48
performing the operation with penc3 - same as before - javc java error and no logtxt.
manually set according to the attachment, but atest the stream after resetting the settings
penc3-2log.txt
Screenshot_2020-05-17-13-13-10

@Peter-St
Copy link
Owner

Ok, some good news for your endoscop camera.
With 16 packetsPerRequest and 16 Active Urbs you received the best solution up to now.
In the log file endc0-3log.txt you can see, that the longest frames were 537479 bytes long.
Normally all frames you receive from the endoscop should be 614400 bytes long.

Lets continue testing with:
32 packetsPerRequest and 32 ActiveUrbs
64 PacketsPerRequest and 64 ActiveUrbs
16 PacketsPerRequest 64 ActiveUrbs
64 PacketsPerRequest 16 ActiveUrbs

Post again all 4 log files.

@Peter-St
Copy link
Owner

And plz attach the log file from the pen camera, when you click on SetUpWithUvcSettings and you get the Arrayindexoutofbounds Exception.

@Peter-St
Copy link
Owner

Run all methods with you Pen Camera.
--> Find the cam
--> List up the Camera
--> Set Up With UVC Settings.

You do not need to perform a Testrun, because first the other buttons need to work.

In your logfile there need to be an output like this:
setUpWithUvcSettings - clicked
setUpWithUvcSettings // Error during openCam(false):

At last you can attach the log.txt file.

@Peter-St
Copy link
Owner

You can try this apk with your endoscope camera:
https://drive.google.com/open?id=1kkG8m40ksJe8SqbWltmXv_OxSOBOnCZB

With this version I think you are able to start the stream with the "Start the Camera Stream" button.
First run the manual method --> Save your values.
Then return to Main and next click on "Start the Camera Stream" --> Transmission start.
Hope it works.

@ErnstTom
Copy link
Author

it is only up to 32 in the manual, rewritten with manual modification - appendices.
the camera stream did not indicate an error in either case. photo and video are also allowed. ONLY there was no image on the monitor that could have saved.
endc1-1log.txt
endc1-2log.txt
endc1-3log.txt
endc1-4log.txt
Screenshot_2020-05-17-14-50-33
Screenshot_2020-05-17-14-53-38
Screenshot_2020-05-17-14-56-06
Screenshot_2020-05-17-14-57-56

video folder with size 0 files. I couldn't find where to save the photos.

@Peter-St
Copy link
Owner

If no more output comes from your Phone, then restart.

Sadly the frames get bigger than 614400 bytes, which means something is not correct.

Plz adjust the outputs from the Pen Cam.

@ErnstTom
Copy link
Author

this now applies to the endoscope or penis.
the phone or app needs to be restarted.
I logged in and out of the app several times.
I have to do each with a different app.
my last data was for the endoscope.
the output since, where should I set it?

@Peter-St
Copy link
Owner

Best to reboot the phone one times, when something not works.

@Peter-St
Copy link
Owner

For your Pen Cam:

Run all methods with you Pen Camera.
--> Find the cam
--> List up the Camera
--> Set Up With UVC Settings.

You do not need to perform a Testrun, because first the other buttons need to work.

In your logfile there need to be an output like this:
setUpWithUvcSettings - clicked
setUpWithUvcSettings // Error during openCam(false):

At last you can attach the log.txt file.

@Peter-St
Copy link
Owner

With your Endoscop Camera use highest values 16 / 16 for ActiveUrbs / PacketsPerRequest.

@ErnstTom
Copy link
Author

I restarted it several times even after the settings.
I tried: 1/1, 1/4, 8/8, 16/16, 32/32, 64/64, usw.
which were in the former.
now none of the settings get the error message that cannot connect to the camera. but the monitor is blank (no picture). the exposure happens, but there is probably nothing empty on the save that it d don't put in the uvc folder because there is no such folder there. but not in dcim either.

@Peter-St
Copy link
Owner

Peter-St commented May 17, 2020

Yes,

when you look into the log.txt file, you notice, that most of the data is 00:

data = 00 00 00 00 00 00 00 00 00

and all frames contains an error.
This means, the data you receive from the camera is not valid.

I don't know how to solve it up to now.

It's as you said, the camera does not accept other camera settings for some reason.

@ErnstTom
Copy link
Author

although the same name, but I overwrote it with the returnee.
in this version, the camera stream always, as before, prints failed to start camera streaming. although exposure also goes after, but there is nothing, no picture.
endc0-5log.txt
endc0-6log.txt
endc0-7log.txt
endc0-8log.txt
Screenshot_2020-05-17-16-32-04
Screenshot_2020-05-17-16-34-25
Screenshot_2020-05-17-16-38-50
Screenshot_2020-05-17-16-44-41
Screenshot_2020-05-17-16-49-31

@ErnstTom
Copy link
Author

in the meantime, i asked kkmoon (an97) and huawei to comment on whether there is a possibility of a connection and that there is no conflict of interest.
Not to work in vain. I hope we get and correct answer.
The good time is coming, the virus is gone.?, You can go to work - if you have what.

@Peter-St
Copy link
Owner

One question:

When you run the manul setupwithuvcsettings Method, how many resolutions can you choose there?
Al the 5 Resolutions? -> 640x480 / 352x288 / 320x240 / 176x144 / 160x120

Can you attach the log.txt, when you choose an other resolution, than 640x480?

@ErnstTom
Copy link
Author

yes, all 5 are optional.
I now chose the usual small medium. the result is unfortunately the same - "failed to" for camera streaming
endc0-xlog.txt
Screenshot_2020-05-17-20-24-26

@Peter-St
Copy link
Owner

Peter-St commented May 23, 2020

Hello Ernst,

this app delivers more results from the endoscop camera to the log file:
https://drive.google.com/open?id=1c_GFZf19rFL4ipdZViE7PZegcFHRF8-g

  • Set up with the manual Method
  • Press the "Video-Probe-Commit Control" Button
  • Press "Test the Stream" Button
    Adjust the log.txt file again.

So far,

Peter

@ErnstTom
Copy link
Author

Hello,
the result is the same - in a week there wasn’t even any read feedback, although I asked huawei and kkmoon via contact us on their own website. I suspect this form of image display is officially banned. Although Huawe, as a Chinese manufacturer, wants to prove at all costs that its devices are no worse than Taiwanese.
endsc5-1log.txt
endsc5-2log.txt
endsc5-3log.txt
Screenshot_2020-05-23-16-09-22
Screenshot_2020-05-23-16-11-27

@Peter-St
Copy link
Owner

Hello Ernst,

perhaps some good news for you !

I sucessfuly got this endoscop to work on my devices!
The 4th Controltransfer allways returns an error --> on my pc as on my android devs.
But:
It don't matter, that the 4th control transfer doesn't work, because the camera initializes the values you enter and commit it already with the 3rd controltransfer, which is sucessful !!

So please try out the following on your Device:
Connect the Cam.
Find Button,
List Button,
Set up with the manual Method !
3072
4 Packets
4 Urbs
YUY2
160 x 120 ---> Here choose the lowest Value !!!!
666667 ------> Highest Value, because then less Frames arrive ...
Save
'ok' ---> Savefile is then 'dev' I think ...

Next "Video Probe Commit Control ! --> You have to see there 3 sucessful Controltransfers and the last failed one!
The failed one does not matter, because the camera is then initialized !
Then the "Test The Stream" Button:
you can post a screenshot here again, if you want ...
My Frames here are between 10000 and 30000 bytes long --> all ones different, --> I don't know why they are different but it works with this settings.

If you get an output there --> Return to Main and then "Start The Stream Button" --> Start Transmission --> Start the Camera !

If for some reason the Button "Video Probe Commit Control" returns 4 times "null" --> disconnect the camera and connect again, restart the app and run the manual method again.

@ErnstTom
Copy link
Author

hello
I did it 3x
log file was not created for some reason
Screenshot_2020-05-27-11-03-17
Screenshot_2020-05-27-11-03-32
Screenshot_2020-05-27-11-03-45
Screenshot_2020-05-27-11-04-24
Screenshot_2020-05-27-11-04-57
Screenshot_2020-05-27-11-05-09
Screenshot_2020-05-27-11-05-22
Screenshot_2020-05-27-11-06-14
Screenshot_2020-05-27-11-07-04

@Peter-St
Copy link
Owner

Hm,
from the last log files I noticed, that most of the frames byte value of your endoscope is:
0x00
So this would be the reason, that nothing is displayed, when starting the camera stream.

Perhaps it could be, that I'm using a litle bit newer version of this endoscope, because it's already linked to the AN98 apk from the play store.

I also noticed, that other apps working far more better than mine, using the standard uvc driver. I will have to spend some time on this behavior, to update my app, that it also receives the same data than with the original uvc driver.

If I can solve it, you can give em another try.

So far,

Peter

@ErnstTom
Copy link
Author

Dear Peter

go ahead.
I've been buying and trying for 2.5 to 3 years. Not vital, it would have been good. When I bought it on ebay, I didn’t know the binding of my phone / camera / program yet.
Just after trying out the different apps and reading the comments and other afterwards.
It's "old."
It might go with another, but it might not work the same way. I like your UVC because it is at least adjustable and you can see the settings. Another app just prints that no reason.
Ernst

@Peter-St
Copy link
Owner

Hello Ernst Tom,

if you still have your phone and Camera, you cam try it out again.

I have added a new driver (Libusb support). With this approach the devices are a lot more faster than before.

You can do the Setup like described in this post before and perhaps the outputs are getting better.

@ErnstTom
Copy link
Author

welcome Peter.
of course I still have everything because the tools aren't bad anyway.
although I intend to add a samsung a41 (a21s?).
of course i will try uvc-camera again?
but I do not intend to hold you up as I did before.
I was just interested.
E. T.

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

2 participants