Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Bluetooth Low Energy
Started by Lerg Oct 21 2016 08:55 PM

38 replies to this topic
release android ios
[TOPIC CONTROLS]
Page 2 of 2 1 2
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#26

rsp355

[GLOBAL: userInfoPane.html]
rsp355
  • Observer

  • 10 posts
  • Corona SDK

Hi, 

 

Any updates on this plug-in? Please let me know if there is any further work planned for this anytime soon. If not I will try to look into another SDK as bluetooth is now essential for communication for my project and I cannot keep waiting. 

 

Thank you. 



[TOPIC: post.html]
#27

Lerg

[GLOBAL: userInfoPane.html]
Lerg
  • Contributor

  • 533 posts
  • Corona Staff

rsp355, hi. Sorry, there won't be any work on that plugin for a while. Too complex to support and I don't have the time for that unfortunately.

 

Thanks.



[TOPIC: post.html]
#28

flippersms-222

[GLOBAL: userInfoPane.html]
flippersms-222
  • Observer

  • 1 posts
  • Corona SDK

Hi there,

 

Thanks very much for creating this BLE library...

 

Just getting started with having a go at Corona and Bluetooth, and just wondered if anyone could point me in the right direction. All I need to do is list all the currently available BLE devices (unpaired or paired). What code would I use to do this?

 

I'm guessing from the example code it is something similar to this:

 

 

 bluetooth.startScan(function (event)
            if event.device.name == deviceToSearch then
                device = event.device
            end
            print('Scan event:', json.prettify(event))
        end, 5000)
 
But instead of checking if each device matchs the search string (deviceToSearch), it just appends it into an array?
 
Thanks!

  • vaijuskb likes this

[TOPIC: post.html]
#29

zombieboffinstudioltd

[GLOBAL: userInfoPane.html]
zombieboffinstudioltd
  • Enthusiast

  • 39 posts
  • Corona SDK

Hello,

 

Please can some one help? I'm trying to use the bluetooth plugin but keep getting the following error message:

ERROR: Runtime error/Users/liamyoung/Desktop/Mirror/Smart Mirror/ENGINE/storyboard.lua:1642: module 'plugin_bluetooth' not found:
no field package.preload['plugin_bluetooth']
no file '/Users/liamyoung/Library/Application Support/Corona/Simulator/Plugins/plugin_bluetooth.lua'
no file '/Users/liamyoung/Desktop/Mirror/Smart Mirror/plugin_bluetooth.lua'
no file '/Applications/CoronaSDK/Corona Simulator.app/Contents/Resources/plugin_bluetooth.lua'
no file '/Users/liamyoung/Library/Application Support/Corona/Simulator/Plugins/plugin_bluetooth.dylib'
no file './plugin_bluetooth.dylib'
no file '/Applications/CoronaSDK/Corona Simulator.app/Contents/Resources/plugin_bluetooth.dylib'

I've added the plugin in build settings and then the required plugin request in Menu Scene but every time it says the plugin can't be found. I'added the two bits of code in my app for using the bluetooth plugin. 

 

Build Settings:

plugins = 
        {
                ['plugin.bluetooth'] = 
                {
                    publisherId = 'com.spiralcodestudio',
                    supportedPlatforms = { android=true };
                },
        },

Menu Scene:

local bluetoothObj = require( "plugin.bluetooth" );

I'm currently using Enterprise v2016.2830, hopefully that not the cause as it not to old of a version of Corona. 

 

Many thanks

 

Liam 



[TOPIC: post.html]
#30

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,527 posts
  • Enterprise

The minimum build of Corona that works with the Bluetooth plugin is 2906.

 

Rob



[TOPIC: post.html]
#31

vaijuskb

[GLOBAL: userInfoPane.html]
vaijuskb
  • Observer

  • 2 posts
  • Corona SDK

I have an problem in Scanning Near by devices

It will not show the all mobile device.

Any solution for this..??

Thank you



[TOPIC: post.html]
#32

vaijuskb

[GLOBAL: userInfoPane.html]
vaijuskb
  • Observer

  • 2 posts
  • Corona SDK

 

Hi there,

 

Thanks very much for creating this BLE library...

 

Just getting started with having a go at Corona and Bluetooth, and just wondered if anyone could point me in the right direction. All I need to do is list all the currently available BLE devices (unpaired or paired). What code would I use to do this?

 

I'm guessing from the example code it is something similar to this:

 

 

 bluetooth.startScan(function (event)
            if event.device.name == deviceToSearch then
                device = event.device
            end
            print('Scan event:', json.prettify(event))
        end, 5000)
 
But instead of checking if each device matchs the search string (deviceToSearch), it just appends it into an array?
 
Thanks!

 

I have also same problem with BLE plugin..

Mobile devices which having bluetooth is ON but its not showing those devices..

Please help me out



[TOPIC: post.html]
#33

solca

[GLOBAL: userInfoPane.html]
solca
  • Enthusiast

  • 57 posts
  • Corona SDK

Hi, i'm new in corona labs.

 

How can I use the plugin to check the status of the bluetooth, without receiving the alert message where the user activates or rejects it?

 

Thanks in advance for your answer.

 

Solón



[TOPIC: post.html]
#34

Scott Harrison

[GLOBAL: userInfoPane.html]
Scott Harrison
  • Corona Geek

  • 1,785 posts
  • Enterprise

My plugin can check that

https://marketplace.coronalabs.com/plugin/bluetooth-for-android

[TOPIC: post.html]
#35

jonathan.carle

[GLOBAL: userInfoPane.html]
jonathan.carle
  • Observer

  • 14 posts
  • Corona SDK

I noticed that the BLE code hasn't been updated in about a year. I am curious if I can still use it for my current project or if it is dead in the water because it might take me a while to figure it out (I am a novice). Also, does it work with iPhone? Lastly, I saw that @Lerg is too busy to work on the project as of May. Is this still the case?

 

Thanks



[TOPIC: post.html]
#36

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,527 posts
  • Enterprise

Hi @jonathan.carle.  Really, only @lerg can answer this question. Maybe send him a PM?

 

Rob



[TOPIC: post.html]
#37

CoraDias

[GLOBAL: userInfoPane.html]
CoraDias
  • Observer

  • 1 posts
  • Corona SDK

Hi...i am a new user here. In my case I need a way to connect one device with other. The idea is to transfer a little amount of data, and, if possible, perhaps a file with about 10-20Kbyts.Can your plugging allow to connect 2 devices , that run the very same lua application, and can send/receive information between two devices?

 

printed board assembly



[TOPIC: post.html]
#38

andrea_corte

[GLOBAL: userInfoPane.html]
andrea_corte
  • Enthusiast

  • 36 posts
  • Corona SDK

Good evening

I'm using this LERG plugin.
I was able to connect to the bluetooth module and read the feature.
my code:
 
           if event.name == 'onConnectionStateChange' then
                event.gatt:discoverServices() 
            end
            
             if event.name == 'onServicesDiscovered' and not event.isError then
                local services = event.gatt:getServices()
                for i = 1, #services do
                    print('Service:', json.prettify(services[i]))
                    testo3.text = json.prettify(services[4])
                    testo1.text =  #services
                    local characteristics = services[4]:getCharacteristics()
                    
                    for j = 1, #characteristics do
                        timer.performWithDelay(j * 3000, function()
                            event.gatt:readCharacteristic(characteristics[j])
 
                        end)
                    end
                end
            end
 
   
           if event.name == 'onCharacteristicRead' and not event.isError then
                testo1.text = event.characteristic:getValue()  
           end
           
           
           if event.name == 'onCharacteristicWrite' and not event.isError then
                event.characteristic:SetValue("")  
           end
            
        end
        bluetooth.connect({
            device = device,
            autoconnect = true,
            onCharacteristicChanged = listener,
            onCharacteristicRead = listener,
            onCharacteristicWrite = listener,
            onConnectionStateChange = listener,
            onDescriptorRead = listener,
            onDescriptorWrite = listener,
            onReadRemoteRssi = listener,
            onReliableWriteCompleted = listener,
            onServicesDiscovered = listener
        })
    end}
 
now the problem I could not write the feature.
I added the event 'onCharacteristicWrite' but I never go there.
can someone help me with a small code?
I need to write a string to the module's characteristic
I really need it for a project to be delivered right away.
Please help me
Thank you all


[TOPIC: post.html]
#39

andrea_corte

[GLOBAL: userInfoPane.html]
andrea_corte
  • Enthusiast

  • 36 posts
  • Corona SDK

I'm sorry for the lack of response but it seems to have found what I need.

 
I can not just disconnect the bluetooth module through the command:
 
bluetooth.disconnect (address)
 
As an address I tried both to enter the address of my module as a string and to take it as the value of the bluetooth function:
 
         bluetooth.startScan (function (event)
              if event.device.name == deviceToSearch then
 
                 device = event.device
 
                 address = device.address
 
             end
         end, 5000)
 
the only way I have to disconnect my bluetooth module is to use event.gatt: disconnect () but I do not like the operation.
 
 
Can someone help me or tell me if there is a problem in the plugin ??
 
Best regards
 



[topic_controls]
Page 2 of 2 1 2
 
[/topic_controls]

Also tagged with one or more of these keywords: release, android, ios