Android Question B4A communication to Arduino with GSM or Bluethooth

Henrig

Member
Licensed User
Longtime User
Hello,
My idea is to run a maximum of High/Lowe output from Arduino Mega 256,
according to the distance (same room, far, far away) the GSM does the job and if I close Bluetooth does the work
So far I run more than 50 input/output, all this is just an exercise and goes well with all GSM SIM900,

You can see a picture here:
http://forum.arduino.cc/index.php?topic=252733.msg1830283#msg1830283

So I'm on the Bluetooth part that will work when I'm near, I may be using the WIFI also

I used bluetooth.zip for the B4A part as a sample to start
Bluetooth.zip to Arduino works correctly, but not the Arduino to B4A
I cant implement it on B4A to ARDUINO
in fact the last three line cuts the Bluethooth and it stop,

The Arduino Mega code:

B4X:
// **********************************************
// Module HC06 with bluetooth sending AT commands
// And display the Result © response module
// Code http://nicolasz68.blogspot.fr/2012/09/module-bluetooth-jy-mcu-v104-pour.html
// *********************************************** / *
#include <SoftwareSerial.h> // Software Serial Port
#include <string.h>
#include <PRINT.H>
#include <serial.h>
10 // #define RxD Pin 10 RX (pin0 = serial) Green 19
11 // #define TxD Pin 11 TX, you can change black 18
SoftwareSerial BTSerie (RxD, TxD);

String msg = String ("");
void setup ()
{
   Serial.begin (9600); // 115200 if you want
   delay (500);
   Serial.println ("Hello - Ready for AT commands");
   // Setup bluetooth
   pinMode (RxD, INPUT);
   pinMode (TxD, OUTPUT);
   BTSerie.begin (9600); // 57600
   delay (500); // 1200
   BTSerie.print ("AT + VERSION"); // Ask the NÂ ° version
   delay (500);
   BTSerie.print ("\ n");
}

void loop ()
{
   // We read character by character on BTSerie and to Repeat on the Terminal Series
   recvChar tank;
   String msg;

   if (BTSerie.available ()) {
    while (BTSerie.available ()) {// While There is more to BE read, keep reading.
      recvChar = (unsigned char) BTSerie.read ();
      msg + = String (recvChar);
    }
      Serial.print (msg);
      Serial.println ("");
      msg = "";
   }

   // if (BTSerie.available ()) {
   // while (BTSerie.available ()) {// While There is more to BE read, keep reading.
   // msg + = (unsigned char) BTSerie.read ();
   } //

   if (Serial.available ()) {
     recvChar Serial.read = ();
     BTSerie.write (recvChar);
     //BTSerie.write (Serial.read ());
   }
      //Serial.print(msg);
}

I'm not sure what to put as a function to receive the characters in B4A,
yet the code works perfectly for B4A to Arduino but not the other way

Thank you for your interest if you give me a track
kind regards
Henry
 

Henrig

Member
Licensed User
Longtime User
I'not an advanced user of B4A
Can you tell me more about the lines to add ?
where to write these lines ?
how to connect this AsyncStream TXT.bas ?

And I'll also have to use binary, so How to connects AsyncStreamsObject too ?

Now when I open B4A I have A Error << mssing jar file for lybrary: c: \ android Basic4 \ libraries \ AndroidManifest.xml >>

How do I fix this please?
Thank you to all
Henry
 
Upvote 0

Henrig

Member
Licensed User
Longtime User
hello
I can not get rid with this HError:

B4X:
Parsing code.                           0.00
Compiling code.                         0.03
Compiling layouts code.                 0.00
Generating R file.                      0.13
Compiling generated Java code.          Error
javac 1.7.0_17
src\anywheresoftware\b4a\samples\bluetooth\main.java:3: error: cannot find symbol
import anywheresoftware.b4a.B4AMenuItem;
                           ^
  symbol:   class B4AMenuItem
  location: package anywheresoftware.b4a
1 error


The following objects added permissions (duplicates are ignored):
BluetoothAdmin:
    android.permission.BLUETOOTH
    android.permission.BLUETOOTH_ADMIN
Serial:
    android.permission.BLUETOOTH

how to continue my project?
Thank you for your help.
Henry
 
Upvote 0

Henrig

Member
Licensed User
Longtime User
this is 2.17
I don't know what to do to restarts and I need it
your product is good software but it makes me mad
If I already have a license, it will cost me less if I take a professional whith newest version
I can remove the current version and ave the more recent pro

Thank you for your help
Henry
 
Upvote 0

Henrig

Member
Licensed User
Longtime User
Hello,
I paid the license. 04/02/2013 9:52 p.m.
IS THE VERSION 2.71 in you can see in the picture
I can tell you the number provided by email

But my problem remains,
Does new version while help me ?
What is the latest ?

thank you
Henrig
 

Attachments

  • version.jpg
    version.jpg
    24.2 KB · Views: 209
  • version.jpg
    version.jpg
    24.2 KB · Views: 207
Upvote 0
Top