Bluetooth presence (via HC05 and Jeenode)
Thanks Brett for clarifying,
i've added the line
sendBluetoothCommand("AT", SYNC);
sendBluetoothCommand("AT+NAME=blueNode", SYNC);
// AT+ROLE=p1
// p1 - 0 Slave Role, 1 Master Role, 2 Slave-Loop role.
sendBluetoothCommand("AT+ROLE=1", SYNC);
sendBluetoothCommand("AT+CMODE=1", SYNC);
sendBluetoothCommand("AT+INIT", SYNC);
// AT+INQM=p1,p2,p3
// p1 - 0 inquire_mode_standad, 1 inquire_mode_rssi
// p2 - maximum number of bluetooth devices response
// p3 - the maximum of limited inquiring time. 1~48 (1.28s ~ 61.44s)
// 15*1.28 = 19sec
sendBluetoothCommand("AT+INQM=0,5,15", SYNC);
Same output alas...
[BlueNode.1]18 g212 @ 868Mhz
SYNC> AT
OK
SYNC> AT+NAME=blueNode
OK
SYNC> AT+ROLE=1
OK
SYNC> AT+CMODE=1
OK
SYNC> AT+INIT
ERROR:(17)
SYNC> AT+INQM=0,5,15
OK
ASYNC> AT+INQ
OK
OK
OK
OK
ASYNC> AT+INQ
OK
OK
OK
OK
OK
ASYNC> AT+INQ
OK
ASYNC> AT+INQ
Andrew
Andrew that's a bummer. I don't know what could be wrong with your BT device its almost as if the antenna isn't connected!? You ordered from a different supplier this time?
You have set everything just like Gary and I have so all things being equal lets blame the hardware.
Brett
Brett
Sure is, as long as im not doing something stupid i dont mind blaming the hardware.
not much else i can think other than provide a 5v supply prehaps
original order was from the UK (more expensive but same week postage)
Thanks
Andrew
Andrew
I have surrendered after fighting with 2 of these devices. Same response as you. Interestingly the second module I ordered was slightly different from the first, but behaved exactly the same.
John
Hi John,
Thats a real shame, and i was thinking i was doing something very wrong....well my 2nd modeule is on its way over from a different supplier heres hoping!!
Thanks,
Andrew
Its got to be how its being initialized but if everybody has the same unit how can this be so?
That make 3 units between Andrew and John that just don't function with my code, ok I missed out the AT+INIT and when I retested my code I got error(16) "SSP not initalized" but onced Iadded AT+INIT got error(17) "already initialized" and the unit worked, as per my wiki page.
I find that hard to believe the defect rate is this high. Maybe I should buy another and hope I get a dud so I can investigate. This is surreal. Gary are you using my code or some other variant? What is your AT sequence?
Yours work right?
Brett
Andrew
Have you noticed that the module starts to flash fast ie it drops out of command mode. I have tried every combination of commands, including delays between them, on 2 modules. I give up! On to the next project.
John
John,
Yes i get two slow flashes, then it drops into fast flashing.
i dont want to give up just yet :)
Andrew
New HC-05 arrived today, the comms board it sits on is a different design with different pinouts so thats something positive as it ensures its a different batch
Im stuggling to get any serial debug out of the latest sketch, can somebody verify this works ok for them?
http://livebox-hah.googlecode.com/svn/trunk/userapps/arduino/Bluetooth/B...
thanks
Andrew
Did you enable debug - it is turned off by default. You should get something!?
Brett
Brett,
So it is, I missed that i will remove the comments from //#define SERIAL 1
Thanks
Andrew
After enabling Debug this is the current output
Sadly no OK from the first AT command
[BlueNode.1]18 g212 @ 868Mhz
SYNC> AT
Thanks for the info,
I need to check the FTDI levels for the new board, the new adaptor board suggests the comms needs to be at 3.3v
its also possible it requires a 5v + supply and not 3v
no switch as far as i can see....
Old on Left, new on Right
Thanks Garry,
Regarding the supply V+, i've not read the specification fully but Brett does mention 3.3V was sufficient, this may however be for the type of adapter board variant he is using, something i need to check to rule out supply issues.
my old module gave me nice OK Acks, it just didnt detect any devices so i suspect its faulty as theres not much we have not tested.
The new module doesnt even go as far as to respond, tried various comm rates but from my understanding once in AT mode it will communicate at 38400 which is what Bretts sketch is setup for, prehaps i need to concentrate in getting this adaptor board / hc-05 module into AT mode, the config could be different
This is the second variant - http://www.ebay.co.uk/itm/201005161594?ssPageName=STRK:MEWNX:IT&_trksid=...
Thanks
Andrew
Mine is also the same as the one on the left. I do recall doing an AT+RESET manually when I first played around with this device. That was never included in the sketch you could always try putting that in your startup seq see if it helps any.
Brett
Thanks Brett,
I've added the Reset to my script and reverted back to my original HC-05 as the replacement (on the right in the image) will not respond at any baud rate
heres is my current output, still not devices detected so i may purchase module #3
[BlueNode.1]18 g212 @ 868Mhz
SYNC> AT+RESET
OK
SYNC> AT
OK
SYNC> AT+NAME=blueNode
OK
SYNC> AT+ROLE=1
OK
SYNC> AT+CMODE=1
OK
SYNC> AT+INIT
OK
SYNC> AT+INQM=0,5,15
OK
ASYNC> AT+INQ
OK
ASYNC> AT+INQ
OK
ASYNC> AT+INQ
OK
ASYNC> AT+INQ
This is all most frustrating. Andrew I would be interested to see if Garys code work for you. Gary I would be interest to know if my code work for you !
Brett
Thank you Garry,
Thats a great offer, i will PM you
Brett, it sure is, i did test my original module with Garrys code above and had the same result but i will give it a test with the newer module just to be sure.
thanks both
Andrew
Garry is there any way we could make use of arp-scan to give us active ip's on the network?
I've been using arp scan with my Raspi, it seems to work OK with my wife's 4S but is not really reliable with my 3GS.
This is the line from my python script:
ping4s = Popen("arp-scan 192.168.0.5-192.168.0.10 | grep xx:xx:xx:xx:73:44; echo command returned $?",shell=True, stdout=PIPE).stdout
If I scan a subnet that goes via an L3 router that bridge network segments inside my ESX box, every VM inside comes back with the same MAC address. The L3 router is correctly subtituting its MAC so it can relay traffic. For a flat network space this will work but beware if you are routing traffic over several IP spaces (like I do).
brett@beaglebone:~$ sudo arp-scan 192.168.4.0/24
Interface: eth0, datalink type: EN10MB (Ethernet)
Starting arp-scan 1.8.1 with 256 hosts (http://www.nta-monitor.com/tools/arp-scan/)
192.168.4.1 00:0c:29:3d:c7:c6 VMware, Inc.
192.168.4.33 00:0c:29:3d:c7:c6 VMware, Inc.
192.168.4.65 00:0c:29:3d:c7:c6 VMware, Inc.
192.168.4.97 00:0c:29:3d:c7:c6 VMware, Inc.
192.168.4.129 00:0c:29:3d:c7:c6 VMware, Inc.
192.168.4.161 00:0c:29:3d:c7:c6 VMware, Inc.
192.168.4.193 00:0c:29:3d:c7:c6 VMware, Inc.
192.168.4.225 00:0c:29:3d:c7:c6 VMware, Inc.
OR
Given you know the target MAC you can also use arpping - 0 means it there 1 is a failure.
brett@beaglebone:~$ sudo arping -c1 -ieth0 -q 00:14:bf:8e:7e:e4; echo $?
0
brett@beaglebone:~$ sudo arping -c1 -ieth0 -q 00:14:bf:8e:7e:e9; echo $?
1
Given this is already the exit code it makes it easier to call, you don't need a popen. In LUA its a one liner.
retval = os.execute("arping -c 1 -i eth0 -q 00:14:bf:8e:7e:e4")
Setup a timer to do this say one a minute and update a BSC endpoint STATE to be on/off etc...
Oh and "arping" is already on your livebox too !
Brett
Once you're back to the pi there is also l2ping using a Bluetooth USB dongle and bluezutills as well as harp. Its a shame that there doesn't appear to be a serial Bluetooth module that supports it only discovery.
Thanks Garry
I will be sure to let you know how i get on
thanks again
When I arping on my livebox using a MAC I get 'bad address XX:XX:XX:XX:XX:XX' but an ip address is accepted.
Dunno if I'm doing something wrong.
Same result here Allan, I also have to use -Ibr0 as the port
Well blow me down with a feather!!
Garry kindly sent me his module which was proven to work with his and bretts code above
and it worked first time!!!
incredibly frustrating that my two modules both dont respond but hey ho! atleast i now know it wasnt a ID10T error :)
OK
SYNC> AT+INIT
ERROR:(17)
SYNC> AT+INQM=0,5,15
+INQ:25:56:D697BD,0,7FFF
device=25:56:D697BD type=0 rssi=7FFF
ASYNC> AT+INQ
+INQ:1D:DF:71E8E0,240400,7FFF
device=1D:DF:71E8E0 type=240400 rssi=7FFF
+INQ:1D:DF:71E8D5,240400,7FFF
device=1D:DF:71E8D5 type=240400 rssi=7FFF
+INQ:CDD:EF:BD6E8D,5A020C,7FFF
device=CDD:EF:BD6E8D type=5A020C rssi=7FFF
now to test with some of the 5 or 6 handsets i have gathered up in the past few weeks as a result of attempting to get this working
Garry, you are the man! thanks so much
Andrew
Andrew
Glad you had some success. Like you I have 2 of these devices, both different from different sources.
Both headed for the bin!!
Hi guys
So glad it worked for you Andrew, but now I need you guys' help. I am now on my third HC-05 module and they all start flashing as soon as I give them the INQ command. Have any of oyu found a way to solve it? If not, do you have a link, make or model to one I can try and purchase that might work for me?
It should probably be noted, that I am doing Arduino for my project.
I have a Stack Overflow question about it as well: http://stackoverflow.com/questions/23221336/hc-05-bluetooth-rssi-not-wor...
I really hope you can help. I am reaching in the dark here...
Hi Houen,
so basically it falls out of programming mode?
I really wish i could advise you on how to get it working but as discussed above it seems we are missing something between different comms boards or the QC on these modules is terrible and a shed load do not work at all.
The module Garry supplied me with is identical to my original module (i.e same comms board) and worked 1st time, my original modules appear to have behaved as yours did.
maybe 4th time lucky?
Thanks
Andrew
Hi Houen,
so basically it falls out of programming mode?
I really wish i could advise you on how to get it working but as discussed above it seems we are missing something between different comms boards or the QC on these modules is terrible and a shed load do not work at all.
The module Garry supplied me with is identical to my original module (i.e same comms board) and worked 1st time, my original modules appear to have behaved as yours did.
maybe 4th time lucky?
Thanks
Andrew
Andrew I updated the wiki page on the blue node with some sample output. I'll paste again here.
I flash this onto my arduno and reattached my bluetooth device to make sure I wasn't going mad.