Author Topic: HOW-TO: Add WiFi to your arduino projects with ESP8266  (Read 13775 times)

0 Members and 1 Guest are viewing this topic.

mexicanto

  • Contributor
  • ***
  • Posts: 55
  • Karma: 1
    • View Profile
Re: HOW-TO: Add WiFi to your arduino projects with ESP8266
« Reply #15 on: December 30, 2015, 12:34:26 AM »
Thank you Dave and Kalle,

I need both, sending and receiving from/to VC-Arduino
because i need all the 3 pins (at least) (1 analog +  1 button + led)
this post is my project

http://voxcommando.com/forum/index.php?topic=1679.msg21000#msg21000

Kalle, I was reading that forum, but thank you for your support, is greatly appreciate
I'm going to experiment with the module and arduino, and I will post my results

thanks again, and happy new year
« Last Edit: December 30, 2015, 01:24:52 AM by mexicanto »

mexicanto

  • Contributor
  • ***
  • Posts: 55
  • Karma: 1
    • View Profile
Re: HOW-TO: Add WiFi to your arduino projects with ESP8266
« Reply #16 on: January 14, 2016, 04:00:51 AM »
Hi Everybody,

I am working witha esp8266-01
i am able to turn on and off a led if i open a web browser and type:

http://192.168.1.2/gpio/1         

http://192.168.1.2/gpio/0

on and off, respectively
and the web page respond:

GPIO is now high

GPIO is now low

respectively too

I have tried this in the LCB

TCP.Single.WrileLn             /gpio/1\x0a                 192.168.1.2          80

with no success, any help will be greatly apreciate

thanks


Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2318
  • Karma: 47
    • View Profile
Re: HOW-TO: Add WiFi to your arduino projects with ESP8266
« Reply #17 on: January 14, 2016, 04:11:58 AM »
You must use the scrape action in the LCB.


Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.0.9-->
<command id="386" name="ESP8266" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Scrape</cmdType>
    <params>
      <param>http://192.168.1.2/gpio/1</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.Speak</cmdType>
    <params>
      <param>the LED is now ON</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>set pin to high</phrase>
</command>
***********  get excited and make things  **********

mexicanto

  • Contributor
  • ***
  • Posts: 55
  • Karma: 1
    • View Profile
Re: HOW-TO: Add WiFi to your arduino projects with ESP8266
« Reply #18 on: January 14, 2016, 05:17:53 AM »
It works perfect !!!

Thank you very much Kalle !!!

Also, any suggestion to do the opposite ?? push a button on the esp8266
and generate an event on VC ?

I know i have to program the ESP8266 as a server, not a client

thanks again

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2318
  • Karma: 47
    • View Profile
Re: HOW-TO: Add WiFi to your arduino projects with ESP8266
« Reply #19 on: January 14, 2016, 05:32:41 AM »
If you are able to program the udp function on the ESP, you can send a message which starts with  -  "VC.TriggerEvent&&""event name&&""payload1&&""payload2&&" ...
***********  get excited and make things  **********

mexicanto

  • Contributor
  • ***
  • Posts: 55
  • Karma: 1
    • View Profile
Re: HOW-TO: Add WiFi to your arduino projects with ESP8266
« Reply #20 on: January 14, 2016, 05:36:49 AM »
Thanks again Kalle,

I will try that tomorrow and share my results

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: HOW-TO: Add WiFi to your arduino projects with ESP8266
« Reply #21 on: January 14, 2016, 09:49:40 AM »
Why all the quotation marks Kalle?

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2318
  • Karma: 47
    • View Profile
Re: HOW-TO: Add WiFi to your arduino projects with ESP8266
« Reply #22 on: January 14, 2016, 09:59:43 AM »
Haha sorry - this is how it looks in the arduino code:


String udpMsg = "VC.TriggerEvent&&""RF read&&"+String(mySwitch.getReceivedValue())+"&&"+...
***********  get excited and make things  **********

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: HOW-TO: Add WiFi to your arduino projects with ESP8266
« Reply #23 on: January 14, 2016, 10:45:13 AM »
Still looks wrong to me.  Is there something wrong with your browser?

Shouldn't it be more like this?
Code: [Select]
String udpMsg = "VC.TriggerEvent&&EventName&&"+String(mySwitch.getReceivedValue())+"&&Payload2Here"
« Last Edit: January 14, 2016, 10:47:22 AM by jitterjames »

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2318
  • Karma: 47
    • View Profile
Re: HOW-TO: Add WiFi to your arduino projects with ESP8266
« Reply #24 on: January 14, 2016, 11:33:01 AM »
No, with my browser is everything ok. I copied the code from our blaster sketch and it works fine.
***********  get excited and make things  **********

Dave

  • $upporter
  • Sr. Member
  • *****
  • Posts: 139
  • Karma: 31
    • View Profile
Re: HOW-TO: Add WiFi to your arduino projects with ESP8266
« Reply #25 on: January 14, 2016, 12:47:43 PM »
Kalle, James is right. The two quotation marks between "...&&" and "RF read&&" are not needed and don't make sense.

rajibgupta

  • Jr. Member
  • **
  • Posts: 6
  • Karma: 0
    • View Profile
Re: HOW-TO: Add WiFi to your arduino projects with ESP8266
« Reply #26 on: April 09, 2016, 08:00:40 AM »
Hello,

I flashed this firmware and everything is working perfectly. But after I enter the wifi ssid and password,it gets connected but how do I find the IP address ? Does it have an AT command to get the IP address info ?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: HOW-TO: Add WiFi to your arduino projects with ESP8266
« Reply #27 on: April 09, 2016, 08:18:20 AM »
Can you use your router to view connected clients?

rajibgupta

  • Jr. Member
  • **
  • Posts: 6
  • Karma: 0
    • View Profile
Re: HOW-TO: Add WiFi to your arduino projects with ESP8266
« Reply #28 on: April 09, 2016, 08:50:58 AM »
Yes,I can do that but that is not a convenient way to do that because there are thousands of types of routers and each having different settings .

By the way, can this firmware support uploading program to arduino over the air ?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: HOW-TO: Add WiFi to your arduino projects with ESP8266
« Reply #29 on: April 09, 2016, 09:00:09 AM »
That’s it!
The ESP should now connect to your network. You can find its IP e.g. with AutoScan-Network.

Presumably you only have one router...

Anyway did you try AutoScan-Network as suggested in the instructions?