E-blocks 2 Bluetooth (BL0170)

For E-blocks user to discuss using E-blocks and programming for them.

Moderators: Benj, Mods

VladimirRepin
Posts: 26
Joined: Tue Sep 18, 2018 5:22 pm
Has thanked: 1 time
Been thanked: 3 times
Contact:

E-blocks 2 Bluetooth (BL0170)

Postby VladimirRepin » Tue Sep 18, 2018 6:27 pm

Hi,

I'm having trouble to connect between two BL0170 (E-blocks2) modules via Bluetooth.

I tried different ways.Also I tried to use AT commands but I dont get it.
E-blocks2 component macros differ from earlier components (for E-blocks1), there are no necessary macros for BL0170 .

Now I am must use ONLY AT-commands?
Unfortunately, I can not use the AT-commands, because there are no suitable macros.

I hope you can help me with my problem. With another component in this series (WLAN BL0136) aslo was a problem, but after the update Flowcode8 from Benj its all worked.

Thanks in advance for your help.

User avatar
Benj
Matrix Staff
Posts: 14312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4404 times
Been thanked: 4128 times
Contact:

Re: E-blocks 2 Bluetooth (BL0170)

Postby Benj » Wed Sep 19, 2018 10:35 am

Hello,

The current macros assume that the board will be connected from a PC or from a phone.

I'll make some additions to the component to allow for things like scanning and connections to be established via the BL0170 boards.

User avatar
Benj
Matrix Staff
Posts: 14312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4404 times
Been thanked: 4128 times
Contact:

Re: E-blocks 2 Bluetooth (BL0170)

Postby Benj » Wed Sep 26, 2018 1:07 pm

Hello,

I have now added some additional macros to the BL0170 and RN4677 components to allow you to read the MAC address and connect to a MAC address. You will need to record the MAC address of the unit you wish to connect to and then use this when connecting.

Currently nothing to do an enquiry as I had a quick go and this wasn't doing what I expected. Highly likely it's me doing things wrong so I'll keep on at this.

I have also exposed the EnterCommandMode, SendCommand and LeaveCommandMode macros so you can call additional commands as required.

The datasheet here lists the various commands if you should need anything extra.
http://ww1.microchip.com/downloads/en/DeviceDoc/50002506B.pdf

Here is an example project where I have two bluetooth modules connected to the same dsPIC EB2 upstream board.
BluetoothTest.fcfx
(17.75 KiB) Downloaded 49 times

VladimirRepin
Posts: 26
Joined: Tue Sep 18, 2018 5:22 pm
Has thanked: 1 time
Been thanked: 3 times
Contact:

Re: E-blocks 2 Bluetooth (BL0170)

Postby VladimirRepin » Mon Oct 08, 2018 3:31 pm

Bluetooth module BL0170 uses Microchip RN4677 AT commands, right?

I tried various commands from here :
http://ww1.microchip.com/downloads/en/D ... 02377A.pdf

But they do not work, it may be a matter of syntax.
Could you tell me how to work with AT commands correctly?

User avatar
Benj
Matrix Staff
Posts: 14312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4404 times
Been thanked: 4128 times
Contact:

Re: E-blocks 2 Bluetooth (BL0170)

Postby Benj » Tue Oct 09, 2018 10:56 am

Hello,

Bluetooth module BL0170 uses Microchip RN4677 AT commands, right?


I wouldn't call them AT commands as they generally start with the command string with "AT" but yes the document you are looking at has the correct commands for the module.

Here is the ConnectToMAC command in action from section 2.5.6 of the datasheet.

BTCmd.jpg
BTCmd.jpg (29.86 KiB) Viewed 1583 times

VladimirRepin
Posts: 26
Joined: Tue Sep 18, 2018 5:22 pm
Has thanked: 1 time
Been thanked: 3 times
Contact:

Re: E-blocks 2 Bluetooth (BL0170)

Postby VladimirRepin » Fri Oct 19, 2018 1:22 pm

Hello ,

Can I use the WaitForValue macro when connecting to a module via a mobile device or PC?
I could not detect the "CONNECT" value when connected via smartphone.

Therefore, I wanted to know, how can I work with the module through the PC terminal? (if its possible)

Thanks in advance for the answer

User avatar
Benj
Matrix Staff
Posts: 14312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4404 times
Been thanked: 4128 times
Contact:

Re: E-blocks 2 Bluetooth (BL0170)

Postby Benj » Fri Oct 19, 2018 5:24 pm