E-blocks 2 Bluetooth (BL0170)

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

Moderators: Benj, Mods

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

E-blocks 2 Bluetooth (BL0170)

Post by VladimirRepin »

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: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: E-blocks 2 Bluetooth (BL0170)

Post by Benj »

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: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: E-blocks 2 Bluetooth (BL0170)

Post by Benj »

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/D ... 02506B.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 366 times

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

Re: E-blocks 2 Bluetooth (BL0170)

Post by VladimirRepin »

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: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: E-blocks 2 Bluetooth (BL0170)

Post by Benj »

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 9654 times

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

Re: E-blocks 2 Bluetooth (BL0170)

Post by VladimirRepin »

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: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: E-blocks 2 Bluetooth (BL0170)

Post by Benj »

Hello,

Yes that should be possible, the easiest way is to use an USB to TTL serial adapter with flying leads and then connect the leads to the E-block.

Something like this would likely do a good job.
https://cpc.farnell.com/pro-signal/usb- ... 9gQAvD_BwE

Post Reply