Problem with Bitalino Android API

Python, Java, Android OS, etc.
DavidGMarquez
Posts: 7
Joined: Fri Jul 18, 2014 10:27 am

Problem with Bitalino Android API

Postby DavidGMarquez » Thu Dec 21, 2017 11:33 am

Hello

I am having problems with the Bitalino Android API (https://github.com/BITalinoWorld/revolution-android-api)

I just downloaded the sample app and the it connects to the device correctly and I can record the signals.
However, I don't receive the Lux Signal it is always 0:
12-21 12:17:22.623 1628-1628/info.plux.pluxapi.sampleapp D/BTHCommunication: setState() CONNECTED -> CONNECTED
12-21 12:17:22.625 1628-1628/info.plux.pluxapi.sampleapp D/DeviceActivity: 20:16:02:26:59:04: Seq: 0; Analog: [517, 505, 0, 497, 38, 0]; Digital: [1, 1, 0, 0]
12-21 12:17:22.625 1628-1628/info.plux.pluxapi.sampleapp D/DeviceActivity: 20:16:02:26:59:04: Seq: 1; Analog: [505, 508, 0, 494, 38, 0]; Digital: [1, 1, 0, 0]
12-21 12:17:22.626 1628-1628/info.plux.pluxapi.sampleapp D/DeviceActivity: 20:16:02:26:59:04: Seq: 2; Analog: [512, 507, 0, 497, 38, 0]; Digital: [1, 1, 0, 0]
12-21 12:17:22.626 1628-1628/info.plux.pluxapi.sampleapp D/DeviceActivity: 20:16:02:26:59:04: Seq: 3; Analog: [518, 507, 0, 502, 38, 0]; Digital: [1, 1, 0, 0]
12-21 12:17:22.626 1628-1628/info.plux.pluxapi.sampleapp D/DeviceActivity: 20:16:02:26:59:04: Seq: 4; Analog: [508, 507, 0, 501, 38, 0]; Digital: [1, 1, 0, 0]
12-21 12:17:22.626 1628-1628/info.plux.pluxapi.sampleapp D/DeviceActivity: 20:16:02:26:59:04: Seq: 5; Analog: [514, 506, 0, 496, 38, 0]; Digital: [1, 1, 0, 0]
12-21 12:17:22.627 1628-1628/info.plux.pluxapi.sampleapp D/DeviceActivity: 20:16:02:26:59:04: Seq: 6; Analog: [498, 506, 0, 508, 38, 0]; Digital: [1, 1, 0, 0]
12-21 12:17:22.627 1628-1628/info.plux.pluxapi.sampleapp D/DeviceActivity: 20:16:02:26:59:04: Seq: 7; Analog: [508, 504, 0, 514, 38, 0]; Digital: [1, 1, 0, 0]
12-21 12:17:22.627 1628-1628/info.plux.pluxapi.sampleapp D/DeviceActivity: 20:16:02:26:59:04: Seq: 8; Analog: [512, 503, 0, 501, 38, 0]; Digital: [1, 1, 0, 0]

However if I change (Line 330, DeviceActivity.java)
bitalino.start(new int[]{0,1,2,3,4,5}, 1000);
for
bitalino.start(new int[]{4,5}, 1000);
To just record accelerometer and Lux, I obtain something like this:
12-21 12:26:06.109 2167-2167/info.plux.pluxapi.sampleapp D/DeviceActivity: 20:16:02:26:59:04: Seq: 1; Analog: [0, 0, 0, 0, 622, 92]; Digital: [1, 1, 0, 0]
12-21 12:26:06.112 2167-2167/info.plux.pluxapi.sampleapp D/DeviceActivity: 20:16:02:26:59:04: Seq: 2; Analog: [0, 0, 0, 0, 623, 82]; Digital: [1, 1, 0, 0]
12-21 12:26:06.112 2167-2167/info.plux.pluxapi.sampleapp D/DeviceActivity: 20:16:02:26:59:04: Seq: 3; Analog: [0, 0, 0, 0, 623, 58]; Digital: [1, 1, 0, 0]
12-21 12:26:06.112 2167-2167/info.plux.pluxapi.sampleapp D/DeviceActivity: 20:16:02:26:59:04: Seq: 4; Analog: [0, 0, 0, 0, 622, 54]; Digital: [1, 1, 0, 0]
12-21 12:26:06.113 2167-2167/info.plux.pluxapi.sampleapp D/DeviceActivity: 20:16:02:26:59:04: Seq: 5; Analog: [0, 0, 0, 0, 622, 65]; Digital: [1, 1, 0, 0]
12-21 12:26:06.113 2167-2167/info.plux.pluxapi.sampleapp D/DeviceActivity: 20:16:02:26:59:04: Seq: 6; Analog: [0, 0, 0, 0, 621, 79]; Digital: [1, 1, 0, 0]
12-21 12:26:06.114 2167-2167/info.plux.pluxapi.sampleapp D/DeviceActivity: 20:16:02:26:59:04: Seq: 7; Analog: [0, 0, 0, 0, 621, 94]; Digital: [1, 1, 0, 0]
12-21 12:26:06.114 2167-2167/info.plux.pluxapi.sampleapp D/DeviceActivity: 20:16:02:26:59:04: Seq: 8; Analog: [0, 0, 0, 0, 622, 99]; Digital: [1, 1, 0, 0]
12-21 12:26:06.114 2167-2167/info.plux.pluxapi.sampleapp D/DeviceActivity: 20:16:02:26:59:04: Seq: 9; Analog: [0, 0, 0, 0, 622, 104]; Digital: [1, 1, 0, 0]
12-21 12:26:06.115 2167-2167/info.plux.pluxapi.sampleapp D/DeviceActivity: 20:16:02:26:59:04: Seq: 10; Analog: [0, 0, 0, 0, 624, 100]; Digital: [1, 1, 0, 0]
12-21 12:26:06.115 2167-2167/info.plux.pluxapi.sampleapp D/DeviceActivity: 20:16:02:26:59:04: Seq: 11; Analog: [0, 0, 0, 0, 622, 93]; Digital: [1, 1, 0, 0]
12-21 12:26:06.115 2167-2167/info.plux.pluxapi.sampleapp D/DeviceActivity: 20:16:02:26:59:04: Seq: 12; Analog: [0, 0, 0, 0, 623, 81]; Digital: [1, 1, 0, 0]
12-21 12:26:06.116 2167-2167/info.plux.pluxapi.sampleapp D/DeviceActivity: 20:16:02:26:59:04: Seq: 13; Analog: [0, 0, 0, 0, 623, 59]; Digital: [1, 1, 0, 0]
12-21 12:26:06.116 2167-2167/info.plux.pluxapi.sampleapp D/DeviceActivity: 20:16:02:26:59:04: Seq: 14; Analog: [0, 0, 0, 0, 623, 54]; Digital: [1, 1, 0, 0]
12-21 12:26:06.116 2167-2167/info.plux.pluxapi.sampleapp D/DeviceActivity: 20:16:02:26:59:04: Seq: 15; Analog: [0, 0, 0, 0, 624, 65]; Digital: [1, 1, 0, 0]
(In the same conditions and illumination)

I know that there is a difference in the bits per channel when you use more than 4 channels but still I find this very strange.

To check I also tried with the JAVA SDK and I obtained something like this:0 seq: 0 515 504 0 516 38 3
1 seq: 1 511 504 0 523 38 3
2 seq: 2 507 507 0 516 38 4
3 seq: 3 511 507 0 511 38 5
4 seq: 4 510 505 0 510 38 6
5 seq: 5 507 506 0 511 38 6
6 seq: 6 505 505 0 510 38 6
7 seq: 7 503 505 0 495 38 6
8 seq: 8 508 505 0 495 38 5
9 seq: 9 500 506 0 480 38 4
10 seq: 10 512 506 0 478 38 3
11 seq: 11 510 505 0 484 38 3
12 seq: 12 509 507 0 476 38 4
13 seq: 13 508 506 0 472 38 5
14 seq: 14 508 506 0 467 38 6
15 seq: 15 515 505 0 468 38 6
16 seq: 0 519 504 0 452 38 6

That in my opinion makes more sense.

Best Regards

GTelo
Posts: 4
Joined: Mon Mar 06, 2017 10:29 am

Re: Problem with Bitalino Android API

Postby GTelo » Thu Dec 21, 2017 5:45 pm

Hi David,

thank you very much for you constructive feedback. You are right, there was a problem with the frame parser. I have already fixed the issue and pushed it to the GitHub repository.

Best regards,
Gonçalo Telo

DavidGMarquez
Posts: 7
Joined: Fri Jul 18, 2014 10:27 am

Re: Problem with Bitalino Android API

Postby DavidGMarquez » Thu Dec 21, 2017 6:33 pm

Hi Gonçalo Telo

Many thanks for the fast answer and solution! You are great!

Yeah I checkout the last version and it seems that is working now I think that maybe you changed the code of the sample app also and now it doesn't print the samples in the Log so I can't show you the result but in the screen I can see that is know registering something in the Lux sensor. BTW I think that if you click twice in the connect button the application starts doing something strange (but is just the sample-app so is not a big deal).

Again many thanks for solving this issue so fast, it was driving me crazy.

David


Return to “Programming APIs”




cron