1

I need to use ESP8266 standalone. I want to connect HM-10 bluetooth module to it and fire its AT commands and read the UUID of devices nearby.

I can do that by firing AT commands on HM-10 from Arduino and FT232RL. But how do I do it in Lua?

Sam Protsenko
  • 14,045
  • 4
  • 59
  • 75
Dushyant Bangal
  • 6,048
  • 8
  • 48
  • 80

1 Answers1

0

Initially I didn't fully understand what the problem is. So, I was reluctant to give an answer based on vague ideas and assumptions. So, it seems you have an Arduino BT from which you send data to an HM-10 which is connected to the ESP8266. What the FT232RL's role is I still don't understand but it doesn't seem relevant in the context of the question.

Wire/solder the HM-10 pins 1 & 2 to the ESP8266 RX/TX. Then you can read data using the NodeMCU UART module: https://nodemcu.readthedocs.org/en/dev/en/modules/uart. uart.on() allows to register callbacks triggered when data is received.

In case your ESP device is a NodeMCU devkit you might have to use uart.alt() depending on which RX/TX pins the HM-10 is connected to. The devkit has more than one set of RX/TX pins, see https://github.com/nodemcu/nodemcu-devkit-v1.0/.

Marcel Stör
  • 22,695
  • 19
  • 92
  • 198
  • I'm using the HM-10 to scan for iBeacons. I was able to fire the AT commands from Arduino and FT232RL, but didnt know how to do it from Lua. Thanks! :) – Dushyant Bangal Apr 25 '16 at 09:40