Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - WakeArray

Pages: 1
1
TinyDuino Processors & TinyShields / Re: TinyScreen Smartwatch
« on: March 21, 2015, 12:34:04 AM »
So while looking for a fix for the bluetooth connection crashing I've found a filed bug report for Android 5 bluetooth issues. They aren't specific to BLE and they seem to all be coming from owners of Nexus and recent Motorola devices. All of which run a vanilla version of Android 5. Having found this and thinking that it was simply an issue with Android 5, I tried the Nordic Semiconductor's app "nRF UART v2.0" and low and behold, it works. Kind of. The watch disconnects like crazy, but I can get it to receive messages I send. The letter D followed by the time in a "yyyy MM dd h m s" format will set the time and get the counter started on the Arduino, sending a 1 followed by a message shows on the top line of the bottom of the screen and sending a 2 shows on the bottom line.

These tests prove that the phone and the OS aren't the reason the app isn't working. This is a plus. I'm just not sure what part of the app isn't working. :/

Edit: It looks like Android 5.0 had a major update to the BluetoothLE scanning API to reduce power consumption. That info is documented here: http://developer.radiusnetworks.com/2014/10/28/android-5.0-scanning.html

Far as I can tell, the older offending code lies in this block. Lines 108-146 of ScanActivity.java. Android studio is enjoying pointing out that 'startLeScan' and 'stopLeScan' are currently depreciated. I'll attempt to adjust this code tomorrow. Currently, I'm a bit too sleepy. Also, Ben Rose might be a bit better at doing this if he has time.

Code: [Select]
    private BluetoothAdapter.LeScanCallback mLeScanCallback =
            new BluetoothAdapter.LeScanCallback() {
                @Override
                public void onLeScan(final BluetoothDevice device, int rssi,
                                     byte[] scanRecord) {
                    runOnUiThread(new Runnable() {
                        @Override
                        public void run() {

                            mLeDeviceListAdapter.addDevice(device);
                            mLeDeviceListAdapter.notifyDataSetChanged();
                        }
                    });
                }
            };

    private void scanLeDevice(final boolean enable) {
        if (enable) {
            handler = new Handler();
            // Stops scanning after a pre-defined scan period.
            handler.postDelayed(new Runnable() {
                @Override
                public void run() {
                    //Debug.ShowText(getApplicationContext(),"scan timed out after " + SCAN_PERIOD/1000 + " seconds.");
                    isScanning = false;
                    mBluetoothAdapter.stopLeScan(mLeScanCallback);
                    invalidateOptionsMenu();
                }
            }, SCAN_PERIOD);

            isScanning = true;
            mBluetoothAdapter.startLeScan(mLeScanCallback);
        } else {
            isScanning = false;
            mBluetoothAdapter.stopLeScan(mLeScanCallback);
        }


    }

2
TinyDuino Processors & TinyShields / Re: TinyScreen Smartwatch
« on: March 20, 2015, 12:23:29 AM »
I'm using your compiled one. Again, it launches fine but when I click on the BLEWatch the app just crashes.

I think I've realised the problem. When both you and jpencausse had the same issues on your Nexus 5's I guessed that it might be an issue with Android 5.0. I've tested this on my Nexus 4 also running Android 5. It experiences the same issue. I believe there may be some out of date APIs to blame here, I'll look into it and do some testing and get back on here when I have an answer. I'm not a SUPER experienced Android programmer though, so any help I can get on this is much appreciated.

That being said I will state what I know to anyone who might be able to help. Both the Nexus 4 I've just used for testing and the Nexus 5's are running stock Android 5. A manufacturer customized version like the one provided for the S5 and Note 4's may fair differently, if someone can test this, that'll be great. I'd test it myself, but I don't work for the next two days.

3
TinyDuino Processors & TinyShields / Re: TinyScreen Smartwatch
« on: March 19, 2015, 02:14:27 PM »
I install the app from codebench
https://codebender.cc/sketch:91833#TinyScreen_Smartwatch.ino

And use the copiled APK on a Nexus 5 too. The app do not see the URT advertiser and crash when clicking on an other (Shine, StickNFind, ...).

If you added the TinyScreen Smartwatch code recently, it should be advertising the name BLEWatch instead of URT, Ben Rose was kind enough to change the name to something more appropriate to its code. The Shine and StickNFind aren't compatible with the TinyCircuits app and the app doesn't currently have a graceful way of failing.

Make sure you're using the most recent version of the Smartwatch files from CodeBender and when it starts up look for BLEWatch. It should be there.

4
TinyDuino Processors & TinyShields / Re: TinyScreen Smartwatch
« on: March 19, 2015, 02:04:49 PM »
OK. Thanks for this. I was able to get a brand new phone and the app launched. I saw BLEWatch but whenever I tried to connect it kept crashing. At the watch time is still incorrect but when I press a button on the side it now says "No Notifications" which it didn't say before.

I tried to send a text to the phone and see if it showed a notification but it still says no notifications even thought I got the text.

Couple of questions: Did you compile the TinyCircuits BLE app yourself in Android Studio or use the precompiled one I provided earlier in this thread? Are you using the stock texting app on the phone or did you change it to something like Hangouts?

If you compiled it yourself, try to precompiled one I posted earlier, I've confirmed that it works on my Note 4 to send notifications from the default texting app and will notify you of phone calls from the default phone app. If you'd like I have a heavily modified version of the app that will send all notifications(for better or for worse) so you can at least know it's working for some notifications.

5
TinyDuino Processors & TinyShields / Re: TinyScreen Smartwatch
« on: March 18, 2015, 11:14:56 PM »
WakeArray, thanks, and the software is at https://www.nordicsemi.com/eng/Products/2.4GHz-RF/nRFgo-Studio

You'll also need the Nordic's library at https://github.com/NordicSemiconductor/ble-sdk-arduino/releases

Open nRFgo Studio, click on nRF8001 Configuration, then open the xml file under the ble_uart_project_template in the library. You can change the advertising name under GAP settings. Then generate services.h and replace the old file in your sketch folder.

Overkill procedure for changing the name, but that's that. It looks like it's possible to change it during run time, but I can't find the function that sets the name. For now, I've just changed the CodeBender example to advertise as BLEWatch instead of URT, at least.

Overkill or not, your help is appreciated. I'll have a look into it in the morning. :)

6
TinyDuino Processors & TinyShields / Re: TinyScreen Smartwatch
« on: March 18, 2015, 11:02:16 PM »
Ah, OK. Gotcha. I'd like to get the Android app working. The phone is an Galaxy S II (SGH-T989).

Sadly even though the S2 shipped with a Broadcom chipset capable of bluetooth 4.0, it was never enabled in software. Part of this is because Android had no default support for Bluetooth 4.0 till nearly 2 years later and by that time the chipset was so outdated writing software to make it work was not a priority.

The S3 was the first Android phone with software support for 4.0 and it wasn't even widely used because Samsung had to make their own support for it, a support that was entirely different from Google's own implimention nearly a year later.

Edit: Turns out Broadcom wrote their own drivers for it and it can be used in Android 4.3(The version of Android that first supported bluetooth 4.0). Only downside is that you have to root and install a newer rom for it to work. From the sounds of it CM11 should support this.

TL;DR: To the best of my knowledge there's simply no easy way to make this work with the S2 without rooting.

Source: I worked for Best Buy selling phones for 4 years.

7
TinyDuino Processors & TinyShields / Re: TinyScreen Smartwatch
« on: March 16, 2015, 11:03:52 PM »
If anyone would like the already compiled Android app to test without downloading the code and compiling it, the unmodified app is right here.

https://drive.google.com/file/d/0Bwvr66JlAk_7N21yQmNYbzJvZEk/view?usp=sharing

8
TinyDuino Processors & TinyShields / Re: TinyScreen Smartwatch
« on: March 16, 2015, 10:28:34 PM »
ainfield, we do not yet have an iPhone app, it's something we'll have but I don't know exactly when.
There's no TinyDuino app, but Nordic has one. https://itunes.apple.com/us/app/nrf-uart/id614594903?mt=8
That app will let you communicate directly over UART to the TinyDuino. If you look at the Android app you can find the commands you'd need to send so you can test and build your own iPhone app around it.

The name/ID is set through the Nordic setup code which needs to be generated with their software.
Do you have a link to the software we'd need to rename it? I'm not a personal fan of the URT name. ;)

Pages: 1
SMF spam blocked by CleanTalk