New Homepage › Forums › Communication Shields › Android Cannot Auto Connect Even if 1SheeldPlus is Within Range
This topic contains 6 replies, has 4 voices, and was last updated by Rubbie 1 year, 8 months ago. This post has been viewed 507 times
-
AuthorPosts
-
April 27, 2018 at 7:29 AM #71343
Dear,
I brought 2 units of 1SheeldPlus two days back. I notice that android app has no auto-connect facility, user should tap the SCAN button prior it can connect to the hardware (every time want to connect). Also, I want a solution that will automatically start 1Sheeld app and connect to the desired 1sheeld hardware after booting the android phone.My intention of this project is for our metering, this phone should all the time be connected to the 1sheeld hardware to get the desired reading; whenever it is in the range of bluetooth, it should connect directly without manual intervention to SCAN it.
Can you please suggest solution?
Regards,
MarkMay 24, 2018 at 3:54 PM #73420Hey mredbautista,
Actually, you are right about that you have to press the SCAN to connect ti 1Sheeld board, but after pressing it you don’t have to select 1Sheeld board every time as 1Sheeld Android App has the feature of auto connectivity and you can activate it when you press SCAN and below the discover 1Sheeld ID (ex: #7896) you have to check the box says “Connect Automatically to This Device”, then press on the 1Sheeld ID and now you are connected to it where you don’t have to select the 1Sheeld manually the next time you open the App.And unfortunately, there is no way to automate the whole process of connectivity as you want since 1Sheeld is a separate App and there is no way to handle the opening and the pressing on SCAN automatically or even by another App.
Sorry for the inconvenience 🙂
August 26, 2018 at 7:12 AM #92889Dear Amr,
Thank you for the reply and insights.Is there a way that my android 1shield app can automatically connect (after pairing) to a particular 1shieldplus every time I start the app (without pressing any button after 1shield app start-up)? Just like other music bluetooth device.
August 26, 2018 at 1:20 PM #92961Hi,
I have noticed that you asked about this before and “Ahmed” suggested using Tasker to automate the opening of the application + scanning + connecting to the 1Sheeld. I think that was a good solution to your issue.
Have you Given it a try?
And for your question, one possible solution is to go for the Android App open source code and you can edit the function part responsible for “SCAN” button to automate it once the App is started-up.
May 26, 2019 at 10:29 PM #175471Hi,
Maybe not the right place to ask it. But is there a piece of code that’s shows on a LED that Bluetooth is still connected? The 1sheeld board has a blue LED that does the same thing. But I want to control my own LED.
Thanks in advance
May 27, 2019 at 3:39 PM #176315Hey,
This is applicable since 1Sheeld has some fundamental functions you can check them in this blog.
And I have made this code for you, compiled and worked properly .. just connect a LED on pin 13 and the LED will be ON till the App is connected, hence it will go OFF.
C++1234567891011121314151617181920#include <OneSheeld.h>void setup(){/* Start communication. */OneSheeld.begin();pinMode(13 , OUTPUT);}void loop(){if ( OneSheeld.isAppConnected() ){digitalWrite(13 , LOW);}else{digitalWrite(13 , HIGH);}OneSheeld.delay(200);}May 29, 2019 at 9:06 PM #178804Thanks Amr!
-
AuthorPosts
You must be logged in to reply to this topic.