Hi, Im new to all of these RF stuff but Im working in a project that has to have good indoors range, I was thinking on using an ESP8266 connected to a sensor, the sensor would be located on the rooftop, so the modem is two stories down. I thought I could use a RFM69 instead of the ESP8266 but this way I cant connect the sensor to wifi directly so...
Can I connect lets say an arduino RX to the RFM69 and the TX to the ESP8266?
Sorry in advance for the silly question.
Best regards.
Quote from: [email protected] on June 21, 2015, 11:34:11 PM
Can I connect lets say an arduino RX to the RFM69 and the TX to the ESP8266?
Sorry in advance for the silly question.
Not silly at all, we all have to start somewhere.
RFM69 talks over SPI (to the host microcontroller), not serial. The ESP module talks over serial. So the RFM69 is hosted by the microcontroller (Moteino/atmega328). That talks wirelessly to a receiver of the same kind, which can also have a ESP8266 on it. But be aware that the ESP requires a lot of current when transmitting so you will need a permanent power supply for that receiver RFM69+ESP relay node.
You can certainly have your receiver relay data to your wifi/LAN through a ESP8266. You would need a receiver moteino that talks to your ESP via serial (use the hardware serial pins if you can, or use a software serial on other 2 pins). Or if you can spare a few more bucks you could use a Pi which is my favorite solution. In that case you can have all your data processed and logged and control of your nodes on the Pi without the need of anything else. See this page (https://lowpowerlab.com/gateway) for what is possible.
In any case I'd be curious to see if an ESP8266 can penetrate through the levels of your house and give you the range you need... would be an interesting barebones RFM69-vs-ESP8266 range test.
Quote from: Felix on June 22, 2015, 07:30:10 AM
<snip>
You can certainly have your receiver relay data to your wifi/LAN through a ESP8266. You would need a receiver moteino that talks to your ESP via serial (use the hardware serial pins if you can, or use a software serial on other 2 pins). Or if you can spare a few more bucks you could use a Pi which is my favorite solution. In that case you can have all your data processed and logged and control of your nodes on the Pi without the need of anything else. See this page (https://lowpowerlab.com/gateway) for what is possible.
In any case I'd be curious to see if an ESP8266 can penetrate through the levels of your house and give you the range you need... would be an interesting barebones RFM69-vs-ESP8266 range test.
A good compromise would be a Moteino Mega which has to hardware serial ports (one for debug/program download, one for your ESP8266 interface) and would be lower cost than a Moteino/Pi combination.
Tom
Hi Felix, thanks for your fast response.
Since Im making a prototype of what its supposed to be a final product im trying it to be as cost efective and reliable as I can, so if I use a pi, the cost would go up.
Since the gateway would be indoors I dont have the power problem, since the sensor would be outside I was thinking of the RFM69 and a solar panel with a li_ion battery.
Can you recommend a version of the esp8266? Im thinking about testing version 1 with pcb antena, version 3 which has ceramic and version 7 which has ceramic, or external.
A good compromise would be a Moteino Mega which has to hardware serial ports (one for debug/program download, one for your ESP8266 interface) and would be lower cost than a Moteino/Pi combination.
Tom
[/quote]
Thanks for your suggestion Tom.
I have not adopted ESP8266 and have no interest in it at this time, so I cannot have a good suggestion for you. Maybe someone else has some advice of using the ESP with a Moteino board?
If:
1) You don't plan on running it on a battery
2) The ESP8266 provides ample range/penetration
3) The sensors you want to use work with the ESP8266
4)You don't mind writing most of the code yourself
the least complicated (from a hardware perspective) solution is to connect the sensors directly to the ESP8266 and use that to expose the data to your LAN. You have lots of options for programming the ESP8266. If you are already familiar with the Arduino environment that would probably be the simplest starting point. As far as range goes, I got better penetration from an ESP-01 with the built-in antenna than I did from a Pi with an Edimax EW-7811Un wireless adapter. I suspect you would get similar results from any of the ESP8266 modules that have similar antenna configurations. You could also eek out a few more dB by using a module that supports an external antenna. ESP-07 supports both internal and external antenna, exposes multiple GPIO pins, is cheap but not breadboard friendly. The Olimex board IMHO is a better made solution, I snagged one of these last month http://www.amazon.com/ESP8266-EVB-ESP8266-internet-complete-MOD-WIFI-ESP8266-DEV/dp/B00SRRS5NM for $12.95 with free shipping which was an absolute steal for what you get. It's currently $20 which is still reasonable relative to what an ARM-based Arduino with a WiFi shield would cost you.
If for whatever reason you need to connect a Moteino to your ESP8266, the simplest solution as people have already said is a serial connection between the two. You could probably reuse 95% of the code from the "Spark Core as a gateway post" from a week ago https://lowpowerlab.com/forum/index.php/topic,1152.0.html. If you want to minimize the amount of glue code you have to write, stick with the Moteino/Pi combination because most of the work has already been done.
Jra thanks for your detailed answer, I ordered esp01, 03 & 07 I'll test all. Also the RFM69 so I can compare. They should arrive soon.
Most of the following can be found on http://www.esp8266.com/ and https://github.com/esp8266/Arduino and you should probably ask any ESP8266-specific questions there. To save you and anyone else who is interested from crawling over the same broken glass:
1) The silkscreen on the ESP-07/12/12e modules may have GPIO4/GPIO5 reversed. Connect an LED and run a blink sketch to determine which is which before committing a design to PCB
2) These things draw a lot of current, more so than a Moteino with an RFM69HW. The 3V output from the builtin regulator on a CP2102 Serial TTL adapter is insufficient to reliably run an ESP8266, plan on a 3V3 regulator that can deliver at least 300ma. Some of the breakout boards on OSH Park have regulators on them.
3) If you use the official Arduino IDE (1.6.4 or higher) and add support for the ESP8266 via the Board Manager mechanism, you will need to manually fiddle with putting the board into download mode. If you build the IDE from the esp8266 repository and connect DTR to GPIO0 and RTS to the CH_PD/Reset pin this will happen for you automagically.
4) If you use any I2C peripherals you need to call Wire.begin() with the pins you plan to use for SDA/SCL because there are no standard mappings unlike the Arduino AVR/ARM world. This may require some tweaks to libraries that call Wire.begin() as part of their initialization.