element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • More
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • More
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • More
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • More
  • Store
    Store
    • Visit Your Store
    • Choose Another Store
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Bluetooth Unleashed Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Bluetooth Unleashed Design Challenge
  • More
  • Cancel
Bluetooth Unleashed Design Challenge
Blog PlantProtector3100 - Bernhard - Bluetooth Unleashed #1.2 - Mesh network is not workable
  • Blog
  • Forum
  • Documents
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: bernhardmayer
  • Date Created: 20 Jul 2018 8:18 AM Date Created
  • Views 133 views
  • Likes 2 likes
  • Comments 2 comments
  • plantprotector3100
  • bluetoothunleashed
  • designchallenge
Related
Recommended

PlantProtector3100 - Bernhard - Bluetooth Unleashed #1.2 - Mesh network is not workable

bernhardmayer
bernhardmayer
20 Jul 2018

I gave the mesh networking several tries but at the moment it is simply not workable.

 

Mesh network is not workable.

 

At least not now.

 

IMHO the STSW-BNRG-Mesh is not workable for the maker community. There exists this library and there are also examples included. But these examples work only with Keil uVision or IAR Embedded Workbench and both of them are proprietary and require a licence. Both of them have also a free version where the code size is limited to 32 kB. But the example has a code size of about 70 kB. So could either buy a licence for about 3000 Euro or use the evaluation licence which is limited to a few days of usage. Both option are not usable for a reasonable development. The use of the library with an open source compiler like arm-gcc is prohibited because its a closed source library and only delivered as object file. And this object file only works with Keil uVision or IAR Embedded Workbench.

 

So at the moment this library is not usable for the maker community. There remains only the hope that in future releases of the library a version for the arm-gcc is also included.

 

Switch to X-CUBE-BLE1

 

Since the mesh networking was a dead end I decided to use the regular Bluetooth low energy library which is called X-CUBE-BLE1 (https://www.st.com/en/embedded-software/x-cube-ble1.html This is included in the CubeMX software and there are also examples included which work with the System Workbench for STM32 which uses arm-gcc Furthermore there is also a example included which works with the  NUCLEO-L053R8NUCLEO-L053R8 board which was one of the featured boards of this design challenge So the premises are now much better

 

BLE GATT profile

 

GATT is an acronym for the Generic Attribute Profile und this profile is used in BLE to exchange little peaces of data. They are called handles. One could also see it as the bluetooth way to read and write registers like it is implemented in many protocols in the automation world. For my application this seems to be perfect since I only want to read the status of several sensors via Bluetooth. Write access is not even necessary.

 

There is also a SensorDemo application example included in the library. This uses the GATT profile and simulates an accelerometer and an environmet sensor. After pushing the button on the evaluation board the sensor values or manipulated. So i started with this demo and examined the output via bluetooth.

 

BLE on Linux using BlueZ

 

For further testing I used a computer with Ubuntu 16.04 and Bluetooth 4.2 USB stick which is capable of Bluetooth low energy. The Bluetooth function comes with the BlueZ package. First you can scan for available Bluetooth devices with hcitool:

hcitool dev

This shows the following output on my computer (one bluetooth device connected):

Devices:
    hci0    00:1A:7D:DA:71:14

Next scan for BLE devices within range:

sudo hcitool lescan

This shows:

LE Scan ...
02:80:E1:00:34:12 BlueNRG

So 02:80:E1:00:34:12 is our device (the NUCLEO board).

You can display more information on this device with

sudo hcitool leinfo 02:80:E1:00:34:12

This shows:

Requesting information ...
    Handle: 71 (0x0047)
    LMP Version: 4.1 (0x7) LMP Subversion: 0x3107
    Manufacturer: ST Microelectronics (48)
    Features: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00

So now we are definitely sure that this is our device!

 

For further analysation we use gatttool and we use it in the interactive mode where we can send one command after one another to the same device. To setup the tool we use the command:

sudo gatttool -b 02:80:E1:00:34:12 -I

Then you have to connect with "connect". After successful connction the MAC address turns blue.

Then you can list the primary handles with "primary" or all handles with "char-desc". These handles are defined in the source code.

You can show the value of one handle (for example handle 0x001b) with "char-read-hnd 0x001b". This is the handle for the simulated humidity sensor and its value changes with every read.

You can see the output of all the commands in the following screenshot.

 

What's next?

 

Next time I am going to change the values of the handles and connect real sensors.

Anonymous

Top Comments

  • DAB
    DAB over 4 years ago +1

    I had not heard of mesh, so your attempt was a good lesson for any newbie about understanding the components you choose for a design.

     

    "Free" software does not mean it comes without cost.

     

    Great…

Parents
  • DAB
    DAB over 4 years ago

    I had not heard of mesh, so your attempt was a good lesson for any newbie about understanding the components you choose for a design.

     

    "Free" software does not mean it comes without cost.

     

    Great job.

     

    DAB

    • Cancel
    • Vote Up +1 Vote Down
    • Reply
    • More
    • Cancel
Comment
  • DAB
    DAB over 4 years ago

    I had not heard of mesh, so your attempt was a good lesson for any newbie about understanding the components you choose for a design.

     

    "Free" software does not mean it comes without cost.

     

    Great job.

     

    DAB

    • Cancel
    • Vote Up +1 Vote Down
    • Reply
    • More
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2022 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • Facebook
  • Twitter
  • linkedin
  • YouTube