November 22, 2024, 08:17:20 PM

MOD-BT connected with 32U4

Started by Mauro, April 14, 2016, 10:23:07 PM

Previous topic - Next topic

Mauro

Hi everybody,
I'm new on the forum and on BT communication but I would like learn more.

I bought 2 Olimexino 32U4 board and 2 MOD-BT but I'm in trouble to see, and than join, the MOD-BT from a android phone.

On the phone all is setting right.

On 32U4 I loaded the code to abilitate power on UEXT connection :

pinMode(8, OUTPUT);
digitalWrite(8, LOW);
Serial1.begin (115200); // initialize hardware UART


Just after che code uploading, the MOD-BT led il flashig one time then is not lighting any more.
Using a tester I have 3,3V on pin 1.

In both case, after the code loading, with MOD-BT connected via USB or external power supply, it is not visible from phone.

How should I do to become visible, mybe some AT command to set on the code ?

I appreciate so much some help

Thank to all

Ciao

LubOlimex

Hey,

Did you use this as a basis for your project: https://www.olimex.com/Products/Duino/AVR/OLIMEXINO-328/resources/OLIMEXINO-328+MOD-BT_library+examples.zip ?

Note that you need to make some slight adjustments in the ino file since the example was made for OLIMEXINO-328.

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

Mauro

LubOlimex Thanks for answer.

I tried the example;

I added in example setup secton the code :

pinMode(8, OUTPUT); // POWER to MOD-BT
digitalWrite(8, LOW);

The arduino compiler give me the following error :
looks missing the typedef.h code.

--------

In file included from TEST_MOD-BT_FROM_FORUM.ino:22:0:
C:\Program Files (x86)\Arduino\libraries\Bluetooth/Bluetooth.h:43:62: fatal error: typedef.h: No such file or directory
#include <typedef.h>   // unsigned char, u32, ... definitions
                                                              ^
compilation terminated.

---------

I looked in internet and in the library manager of arduino IDE but seams typedef.h should be specific for Bluethoot.h code.

I planned to use 32U4, Mod-BT and BB-VNH3SP30 for a commercial project starting in July that will use hopfully 50-100 boars each months.

Than please I need your support to start communicate with MOD-BT. Please tell me if is better that i contact the olimexino support or not.

Just a secon question: Is it normal that the power led on the MOD-BT board is just flashing one time after the pinMode(8, OUTPUT); digitalWrite(8, LOW); code,  or should stay ON ?!

Thank's you

Best regards

Ciao

Stanimir5F

Hello Mauro.
You are on the right track to initialize the UEXT power pin.

As for the compiling error simply comment/remove the line with
#include <typedef.h>
inside the bluetooth.h file, line 43.
The developer of this project has left our company few years ago and it's unknown for me why this header file is included, since the type definitions aren't used at all.

Stan, Olimex
May the Source be with You!

Mauro

Thank'you Stanimir5F,

I'm going to try it next days.
Sorry I did't think it .. just remove the line of code ...  :P.

I will let you know.

Ciao

Mauro

Hi everybody,

I removed the line  #include <typedef.h>.

Now arduino IDE compile it and upload to the 32U4.

Still is not possible to "see" the MOD-BT.

I tried to change the init boudrate without any effect.

I'm in worry that the board is not right powered on becouse after the power led flashing during upload, the led remain off. ( Even if I measure 3,3 V using test meter on the right power pin ).

Please any suggestions ?

Looks me very strange that no tip are present on internet on how work with 32U4 coupled with MOD-BT. :-\

Thank a lot

Ciao

LubOlimex

Hey,

We have a lot of modules and a lot of boards and it is impossible to write the software for each combination. The code of OLIMEXINO-328 and MOD-BT is good enough but requires slight adjustment to get it working.

Instead of explaining I decided to test it myself and applied the required changes (the main difference was that the library used serial and OLIMEXINO-32U4 uses serial1; note that OLIMEXINO-328 has one serial interface while OLIMEXINO-32U4 has two serial interfaces). You can find the library and the example for OLIMEXINO-32U4 and MOD-BT here: https://www.olimex.com/Products/Duino/AVR/OLIMEXINO-32U4/resources/MOD-BT-OLIMEXINO-32U4.zip

Refer to the README.txt file inside.

You would need an application for your phone and tablet. I used this one:

https://play.google.com/store/apps/details?id=Qwerty.BluetoothTerminal

The Bluetooth example was tested with Google Nexus 4, LG Leon, Sony Xperia Z3+.

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex