Hey, first time here and I wanted to ask about BLE arduino development: I have an ESP32 dev kit v1 that I am able to create an server using the example of its arduino library with some changes (which seems to be close to a broadcaster to me) and I wanted to be able to scan its name and process some information from it using an HC-05+arduino uno.
The objective is to be able to easily change the ESP32 name (i.e: "MyEsp32 - info1") identify part of the name "MyEsp32" and then treat the information "info1" to for example turning on a LED by creating an static map
i.e:
if info == info1 {
digitalWrite(LED_BUILTIN, HIGH);
}
else if info==info2{
servoPosition==90;
}
Sorry If the programming examples dont follow the correct syntax (still learning C/Arduino)
I wanted to be able to scan its name and process some information from it
That is easily done, but this:
The objective is to be able to easily change the ESP32 name (i.e: "MyEsp32 - info1") identify part of the name "MyEsp32" and then treat the information "info1" to for example turning on a LED by creating an static map
I do not understand.
Here is an example to illustrate parsing a string and acting on a part of the string. It is my best guess as to what you want to do.
// parse an input string and act on input
// C. Goulding
char str[] = "MyEsp32 - info2"; // the input string
char message[20]; // will hold "name"
char info[10]; // will hold "info"
void setup()
{
Serial.begin(115200);
// strtok reference http://www.cplusplus.com/reference/cstring/strtok/
char* ptr;
ptr = strtok(str, "-");
strcpy(message, ptr);
ptr = strtok(NULL, "-");
strcpy (info, ptr);
Serial.print(" message = ");
Serial.print(message);
Serial.print(" info = ");
Serial.println( info);
// strcmp reference http://www.cplusplus.com/reference/cstring/strcmp/
if (strcmp(info, " info1") == 0)
{
Serial.println("option one ");
}
else if (strcmp(info, " info2") == 0)
{
Serial.println(" option two ");
}
else if (strcmp(info, " info3") == 0)
{
Serial.println(" option three ");
}
else
{
Serial.println("invalid data ");
}
}
void loop()
{
}
It isn't, but that might not be the problem. The post is so incoherent but I think he wants to communicate ESP32kit<>Uno+HC05. I have never done this and it depends on ESP32's bluetooth being backwards compatible with BT2. I believe he might want to configure ESP using the Uno.
Ok, I think I was a bit confusing with the project and the ideas I want to implement. As of right now I have 2 ESP32 modules, 2 HC-05 Modules and some arduinos for this project, after a first validation of the project we are probably going to change the ESP32 for commercial bluetooth badges (this is a school project).
The project itself is to create an indoor guidance system using Bluetooth.
The idea is to create a wearable circuit that transmits a signal saying where the user wants to go. So the user arrives at the reception of the building, the receptionist configure the wearable depending on the room the user wants to go. The wearable should transmit the information nonstop. Then another circuit needs to be constantly listening, when it receives the room the user wants to go it is going to control a lamp system that shows the right direction.
We had no idea the required modules we needed for that and we had a deadline and a small budget to command the components so the project leader ended up commanding two ESP32 devkits v1 and 2 HC-05 modules.
As of right now we found that the ESP32 is the easiest one to use as reconfigurable, this is why we wanted to use it as the wearable.
While the HC-05 should allow us to listen nonstop while still having the rest of the arduino to control the lamp system. The lamp system is correctly working.
We need then to be able to send an signal from the ESP32 and read it using the HC-05, and from this signal extract the room information.
The plan is to create an static map of the rooms, i.e: if room A => lamps indicate the user should go left, if room B => lamps indicate the user should go right.
The confusion for us is how to create this broadcast and listening system in autonomous way (it seems everything related to the HC-05 needs to be configured using the serial monitor from arduino IDE), if someone can explain, and also how to extract the room information from the broadcast signal from the wearable
gtheis:
Ok, I think I was a bit confusing with the project and the ideas I want to implement.
You are absolutely right about that, but "bit" was not really the word to use here..
The project itself is to create an indoor guidance system using Bluetooth.
The idea is to create a wearable circuit that transmits a signal saying where the user wants to go. So the user arrives at the reception of the building, the receptionist configure the wearable depending on the room the user wants to go. The wearable should transmit the information nonstop. Then another circuit needs to be constantly listening, when it receives the room the user wants to go it is going to control a lamp system that shows the right direction.
I submit this is fanciful nonsense - you are just kidding yourself. However, you may be able to come up with some sort of beacon/proximity system, which may be where the inspiration for this came from, if you ditch the HC-05s and use BT4 devices instead, they being more suitable for that sort of thing. Try the robot forum.
Nick_Pyner:
I submit this is fanciful nonsense - you are just kidding yourself. However, you may be able to come up with some sort of beacon/proximity system, which may be where the inspiration for this came from, if you ditch the HC-05s and use BT4 devices instead, they being more suitable for that sort of thing. Try the robot forum.
Well this was proposed by a professor, so we need to implement it or at least get to justify why it is nonsense. I cannot simply ditch the HC-05 because we can't command anymore. As of right now I am trying to figure out how to make this work with the material I have. Why to change to the robot forum?
I am a bit lost in all this but the way I interput this project.
you have a building, say one long hallway.
you walk in, tell the receptioniast you want to go to room 105.
she keys in 105 into the 'disk' and hands it to you
you start walking and pass 115, then 116, the disk sees that the numbers are ascending and tells you to turn around.
you get to 105 and it indicates you have arrived.
every room would need to have one sender for your receiver to pick up.
if multiple floors are involved, then the unit would point to the closest stair or elevator.
you mentioned a static map. that would mean that you want to display a floorplan, and maybe a dot to show where you are and maybe a second dot to show where you want to arrive ?
=========
why the robot forum ? because those that post there work with the type of stuff you want to do.
project guidance is just that guidance
Nick_Pyner gave you some guidance. go to the robot forum.
===========
my suggestion is to create a flow chart so that you have the project worked out and so that you can communicate that to us.
it does sound like you want to use GPS and eliminate all the Bluetooth sensors, show your position in the building and that of the destination.
the way I see this, you would need one device at each room.
with GPS, you only need one device for the traveler.
That would be a very good thing to do.
Being a professor does not mean sitting on the right hand of God. You will be amazed how stupid the propositions of professors can be, and you might start by reading my original post and contemplate the advantages, if any, of using BLE as a beacon/positioning device, and consequences then of operating in conjunction with an HC-05 - if it is indeed backward-compatible with HC-05.