M minitech Member Licensed User Longtime User Jun 11, 2014 #1 Hi, Has anyone used the camera led as a low speed data transfer medium. I have looked through info and cannot find how to modulate the led
Hi, Has anyone used the camera led as a low speed data transfer medium. I have looked through info and cannot find how to modulate the led
andymc Well-Known Member Licensed User Longtime User Jun 11, 2014 #2 That's an awesome idea. But no, sorry I haven't tried it. You would probably use a version of morse code, this will be a very slow way to transfer data though and could cause you issues with epileptic users! Might be better to try using high pitch audio transmission. Upvote 0
That's an awesome idea. But no, sorry I haven't tried it. You would probably use a version of morse code, this will be a very slow way to transfer data though and could cause you issues with epileptic users! Might be better to try using high pitch audio transmission.
M minitech Member Licensed User Longtime User Jun 11, 2014 #3 The process would be used to transfer data to a piece of equipment so the phone would be pointed away from the user, although I take on board that reflection could still cause some users a problem. For the application a warning would probably suffice. Yes a series of simple codes is the idea. Binary coded not morse which is of course coded letters. But worth considering Upvote 0
The process would be used to transfer data to a piece of equipment so the phone would be pointed away from the user, although I take on board that reflection could still cause some users a problem. For the application a warning would probably suffice. Yes a series of simple codes is the idea. Binary coded not morse which is of course coded letters. But worth considering
stevel05 Expert Licensed User Longtime User Jun 11, 2014 #4 How bright would the light need to be? You may have a chance using a flashing white (or whatever color is most easily received) panel on a black or contrasting background. Upvote 0
How bright would the light need to be? You may have a chance using a flashing white (or whatever color is most easily received) panel on a black or contrasting background.
stevel05 Expert Licensed User Longtime User Jun 11, 2014 #5 Here you go try this. Requires permission: Code: Copy AddPermission("android.permission.CAMERA") To be added to the manifest. Turn on with: Code: Copy Cam.InitializeStatic("android.hardware.Camera") Cam = Cam.RunMethod("open",Null) Dim Par As JavaObject = Cam.RunMethod("getParameters",Null) Par.RunMethod("setFlashMode",Array As Object("torch")) Cam.RunMethod("setParameters",Array As Object(Par)) and Off with Code: Copy Cam.RunMethod("release",Null) Works on my Sony experia. Test project attached. Attachments Flash.zip Flash.zip 7.2 KB · Views: 424 Last edited: Jun 11, 2014 Upvote 0
Here you go try this. Requires permission: Code: Copy AddPermission("android.permission.CAMERA") To be added to the manifest. Turn on with: Code: Copy Cam.InitializeStatic("android.hardware.Camera") Cam = Cam.RunMethod("open",Null) Dim Par As JavaObject = Cam.RunMethod("getParameters",Null) Par.RunMethod("setFlashMode",Array As Object("torch")) Cam.RunMethod("setParameters",Array As Object(Par)) and Off with Code: Copy Cam.RunMethod("release",Null) Works on my Sony experia. Test project attached.
M minitech Member Licensed User Longtime User Jun 11, 2014 #6 Thanks for reply Steve. I will try that on my Samsung later. Just got tied up with some other issue. Will let you know. Upvote 0
Thanks for reply Steve. I will try that on my Samsung later. Just got tied up with some other issue. Will let you know.
M minitech Member Licensed User Longtime User Jun 11, 2014 #7 Just tried but does not work on my Samsung. Will have to check later. Cheers Upvote 0
stevel05 Expert Licensed User Longtime User Jun 11, 2014 #8 Try changing the flash mode from "torch" to "on", apparently it may work for up to 5 seconds. But that should be enough for your purposes. If that doesn't work you can try adding one or both of these to your Manifest: Code: Copy AddPermission("android.permission.FLASHLIGHT") AddManifestText("android.permission-group.HARDWARE_CONTROLS") Upvote 0
Try changing the flash mode from "torch" to "on", apparently it may work for up to 5 seconds. But that should be enough for your purposes. If that doesn't work you can try adding one or both of these to your Manifest: Code: Copy AddPermission("android.permission.FLASHLIGHT") AddManifestText("android.permission-group.HARDWARE_CONTROLS")
M minitech Member Licensed User Longtime User Jun 11, 2014 #9 Still a NO. Will have to leave for a while to get some other bits sorted. Thanks Upvote 0
M minitech Member Licensed User Longtime User Jun 19, 2014 #10 Still bogged down with coding other parts of this project. will get back to it and post results as soon as I can Upvote 0
Still bogged down with coding other parts of this project. will get back to it and post results as soon as I can
M minitech Member Licensed User Longtime User Aug 4, 2014 #11 Been a while but update from tests are that although some control of the led is possible, it seems that it is not stable enough in the system to provide consistently equal width pulses needed for decoding. Using timer seems to have some problems which are probably system related in that timer seems not to have priority when kicked off so timings not stable. Someone else is doing tests which this post is based on so waiting for some more details. It may turn out to be unusable for transmit of binary data field. Upvote 0
Been a while but update from tests are that although some control of the led is possible, it seems that it is not stable enough in the system to provide consistently equal width pulses needed for decoding. Using timer seems to have some problems which are probably system related in that timer seems not to have priority when kicked off so timings not stable. Someone else is doing tests which this post is based on so waiting for some more details. It may turn out to be unusable for transmit of binary data field.
Gaver Powers Member Licensed User Longtime User Oct 27, 2014 #12 I was able to get this sample to work on a Note 2 running Android 4.1.2 When I try to run it on a Note 3 with Android 4.4.2 it fails to turn the light on. If I run the example in the CameraEx class / library - the light function works as expected. Any thoughts as to why it would fail in A 4.4.2? G Last edited: Oct 27, 2014 Upvote 0
I was able to get this sample to work on a Note 2 running Android 4.1.2 When I try to run it on a Note 3 with Android 4.4.2 it fails to turn the light on. If I run the example in the CameraEx class / library - the light function works as expected. Any thoughts as to why it would fail in A 4.4.2? G
M minitech Member Licensed User Longtime User Oct 27, 2014 #13 Can only assume that they have changed permissions, or the hardware has a mask ! As for original idea of transmitting data I think that the chances of achieving stable pulse width's to decode is a pipe dream on Android, unless somebody knows differently. So for the time being I am abandoning this idea for communications. Upvote 0
Can only assume that they have changed permissions, or the hardware has a mask ! As for original idea of transmitting data I think that the chances of achieving stable pulse width's to decode is a pipe dream on Android, unless somebody knows differently. So for the time being I am abandoning this idea for communications.
Gaver Powers Member Licensed User Longtime User Oct 28, 2014 #14 I see, I'm using the code above to turn a light on - not for pulse width modulated communication. I'm hoping the author might have a simple solution to the problem I'm seeing. I tried the recommended changes (above) - no joy. G Upvote 0
I see, I'm using the code above to turn a light on - not for pulse width modulated communication. I'm hoping the author might have a simple solution to the problem I'm seeing. I tried the recommended changes (above) - no joy. G
Gaver Powers Member Licensed User Longtime User Oct 29, 2014 #15 I found a reference in an Android Forum that says. "Try turning "Smart Stabilization" off...For some idiotic reason Samsung decided to bundle the "Night Mode" into the stabilization option, so more often than not, the phone will try to take pictures with longer exposure rather than firing up the flash." Will try this later today and see if it solves the problem. G Upvote 0
I found a reference in an Android Forum that says. "Try turning "Smart Stabilization" off...For some idiotic reason Samsung decided to bundle the "Night Mode" into the stabilization option, so more often than not, the phone will try to take pictures with longer exposure rather than firing up the flash." Will try this later today and see if it solves the problem. G
Gaver Powers Member Licensed User Longtime User Oct 29, 2014 #16 Is there a way to dump the cam.parameters - so I can see the correct name of the smart_stabilization parameter and maybe turn it off just ahead of activating the light? G Upvote 0
Is there a way to dump the cam.parameters - so I can see the correct name of the smart_stabilization parameter and maybe turn it off just ahead of activating the light? G