I am using an arduino with HM-10 Bluetooth module. I am able to detect other HM-10(slave) in the vicinity of HM-10(master). In HM-10 datasheet AT+RSSI? command is mentioned which i tried with all possible combinations, but i am unable to extract the rssi value. Is there any way such that i can determine the rssi value using arduino on serial monitor. Any relevant code other than the command will be appreciated.
thanks in advance.
According to the "datasheet", "This command only used by Remote device query when connected."
Basically, to get this to work, you will need to set your slave to remote control mode with the AT command
AT+MODE2
Then, connect your master and slave. After this is done, you should be able to send the master the command "AT+RSSI?", it will send it to the slave, which will pick it up now that is in remote control mode. The slave will then reply with its RSSI value.
Related
I am trying to write standalone ESP8266 code so that it can communicate to wifi and change its states. For this, what I want to do is to send some command "AT+CWMODE=1" or "AT+CWMODE=3" to ESP8266 via code and toggle them on push button tap.
So, like in Arduino there is a Serial.write which writes on a serial monitor via SoftwareSerial class.
But when I am sending Serial.write("AT+CWMODE=1") it prints on the monitor as a string rather than changing the wifi state.
Is there a way to send AT commands without using Arduino chip software serial pins?
Thanks.
Sorted out the issue. All those who are new like me to ESP world, I did the serial.write "AT" commands using wifi classes of Esp8266.
You need to connect the board as ESP8266 Generic Module and send/receive data using ESP8266Wifi class, by reading the scanned networks, changing mode, using Serial.read on the connected devices on Access point of Esp8266.
Let me know if someone need help on this future, I will be happy to help.
When I send any commands to the HM10 BLE Bluetooth module, it sends the commands through bluetooth instead of the HM10 module processing the command. For example, I expected to send AT and have the module respond with "OK", but it sends the text "AT" through the bluetooth connection. I have tried sending the command with no bluetooth connection and the same thing happens. I have also tried sending the command via bluetooth instead of the serial connected to the device and I get the same thing.
When HM10 is connected to remote ble device it is in transparent mode. To put it into AT mode you need break connection or not establish it at all.
For breaking connection use reset/break pins. Reset is 12 pin and Break seems to be 23 pin.
It has sense to look IMME parameter of the module (page 32 of datasheet).
IMME Query/Set Module work type
1: When module is powered on, only respond the AT Command, don’t do
anything. Until AT + START, AT+CON, AT+CONNL commands is received.
0: When power on, module will start work immediately Default: 0
Also be carefull with strings endings, usually string doesn't need to be terminated with any symbol at all: AT, but some H11 need the string to end with CRLF: AT\r\n
Maybe (Maybe) your problem because of using clone module, try this solution with upload genuine firmware to your hm-10.
How to flash genuine HM-10 firmware on CC2541
I had problem close from your problem but for me no matter what I send I don't receive anything even to connected device, but after I upload that firmware, and change Module work mode to 1 (AT+MODE1) become able to send command even from connected device.
I am using an HM-10 module and Arduino UNO.
My requirement is to read data from ibeacons near me using Arduino. Is it possible? I have not been able to find any articles on this. All articles talk about connecting your android phone with arduino. Any idea?
Yes, it is possible. I'm using an HM-10 as an iBeacon detector (linksprite.com BLE 4.0 shield), and it is successfully detecting a RadBeacon running in iBeacon mode. Firmware on my HM-10 is version 540.
Before it would detect the RadBeacon, I had to send the HM-10 the following commands:
AT+ROLE1
AT+IMME1
AT+RESET
Then I used the AT-DISI? command, and the serial monitor is showing the broadcast received from the RadBeacon (and one other beacon) as follows (for example):
OK+DISISOK+DISC:4C000215:2G234454CF6D5A0FADF2F4911BA9FFA7:00000001AC:0CF3EE041CCE:-052OK+DISC:00000000:00000000000000000000000000000000:0000000000:B9782E08068C:-071OK+DISCE
In this example, the HM-10 is detecting my RadBeacon which has UUID of 2G234454...with signal strength of -052. It is also detecting another BLE beacon (my AppleTV downstairs) with UUID of B9782E08068C with signal strength of -071.
I'm definitely not very knowledgable about any of this stuff, but it seems to be working for me so far. Next challenge for me will be to figure out how to parse the text data being received. I'm mostly interested in the distance/signal strength data in order to trigger an action when the RadBeacon gets very close to the HM-10.
[Full disclosure: I jumbled some of the UUID numbers above since I'm not sure if any of this information is private or hackable or whatever]
[By the way, the nRF8001 BLE Shield will not do this since it only runs in peripheral mode.]
Yes, you can get the Min and Max number of the nearby iBeacons.
You need to Attach hm-10 to Arduino Uno.
Try using this Library : https://github.com/dinosd/BLE_PROXIMITY
You can configure suitable AT commands if you want to configure it. But it should work with default settings as well.
Use SoftwareSerial to access HM-10.
In firmware version V539 of the HM-10, it adds an AT command to list nearby iBeacons. The command is AT+DISI?. You would simply need to set up the Arduion to send that command over a serial port and parse the data it returns.
I am able to connect and upload the WifiStatus example per the instructions on the Arduino Site/Examples/Yun. However, when I hit the serial monitor button it is supposed to print out the relevant Wifi stats, instead it says "unable to connect" and the final line goes a bit further..."unable to connect: is the sketch using the bridge". Any ideas? A post suggested reseting the 32U4, which I did, but no luck.
Incidently, all of this is over Wifi. Board and port are set per instructions. Yun pings fine and receives the uploaded sketch fine.
More code is usually more illuminating... so you might get better answers when you provide more information.
"is the sketch using the bridge" seems to indicate that there is some problem with the Bridge library. Is it being initialized? Did initialization (i.e., "Bridge.begin()" succeed?
A sketch with bridge functional and serial monitor via network connection cannot be running simultaneously as they use the same hardware connection.
You may use the serial monitor via USB port, or Serial TX/RX pins, or SoftwareSerial for this.
I am attempting to send some data from Processing to my Arduino over the serial connection so that the Arduino can control an LED strip. Could I view the serial monitor while this transfer was taking place?
It is irking me that I cannot use any Serial.println statements (for debugging) while Processing is communicating with the Arduino. Everytime I try I get
Serial port 'COM3' already in use. Try quitting any programs that may be using it.
Is there a way for this serial communication to take place while I view the serial monitor at the same time?
The fact that the error message mentions COM3 suggests you are running on Windows. Unfortunately Windows doesn't allow multiple processes to simultaneously connect to the same serial port. This is different from Unix-based systems which do allow simultaneous serial port connections.
Using a Linux host, I have used a Python script send commands whilst monitoring results on the serial monitor. I seem to recall I had to open the serial monitor first and then run the other program.
Unfortunately, I can't help you with how to achieve that in Processing.
There is an application called Portmon that will allow you to monitor the serial communications on your PC.
Try 2 Serial communication,
Imagine you have already given USB as COM3 have a bluetooth device connected to your arduino Tx & Rx port, Let that be COM8. Now view COM3 in Arduino and COM8 in Processing.I could do this.