Esp8266 wifi on aurdino nano


#1

Hi all,

Have Cayenne running succesfully on a RPI2, running 2 temp chips and a 8-channel relay…

Ultimate goal is to use this to monitor and manage my tropical aquarium.

Now I’e completed PoC on teh RPI2, I’d like to migrate this all to a small as possible, cheap as possible platform for permenant install.

I’d like to use the Arduino Nano (which I note is supported), but i’d like to connect this to wifi using an esp8266 board.

Looking at the Cayenne docs, the Esp8266 isnt explicitly documented with sketches etc, unlike the other wifi hats etc…

Is this possible with Cayenne?

Thanks


#2

Hi Cy,

Most of us are using the ESP8266 as is. There is a library to allow you to translate your sketches and flash them to the ESP directly. See my HowTo Esp8266

The ESP modules are not supported yet by Cayenne, however, many of us in the community are gleefully using them (follow the HowTo).

@Ian do you know if anyone has made the Huzzah board work as a wifi slave with the NodeMCU AT command set? There is code to do this in the Blynk library, through the serial port, I’ve just never tried it.

Now there is enough IO on the ESP-12 for you to drive your relays:

There is only one ADC input though. It works up to 3.3V on the ESP-12s, but there can be only one (Highlander reference, if you’re not with the lingo).

You can certainly get the I2C and SPI interfaces going though and chose your sensor.

This would put you into a fairly compact device for under 20 bucks by my estimates.

Craig


#3

Thanks for coming back to me so quickly Craig! :slight_smile:

I did have a fiddle with the Uno and ESP8266 (usual “Wifi temp sensor”), but couldnt get anything stable to work, so gave up and moved onto RPI2… :frowning:

So, based on your comment above, saying the ESP-12 has enough IO’s to run an 8 channel relay (I’ll only be using 4 channels, plus 2 x DS18B20 ) and the pic in your how to of the ESP connected to a relay, I take it your not saying the ESP8266 can run Cayenne on it’s own?

So, if I get a nano (now discontinued by Arduino it seems), I’d set up wifi access on the ESP8266 via the Arduino, then just install Cayenne as normal, and it just “finds” the wifi connection?

Sorry, bit new to all this, but getting more of an idea since I got the Pi to actually work ;).


#4

Assuming the ESP8266 is just used as a Wifi connection, would I not just connect the senors to the Nano?

(I know the ESP does have basic memory and processor, but surely thats not enough to run Cayenne on its own?).


#5

The ESP will run standalone without another Arduino device is what I am saying. You just flash it directly from the Arduino IDE following the HowTo.

I have not worked with the DS18B20s but I believe it doesn’t require any special I/O so the driver should work just fine for the ESPs.

Craig


#6

Wow! :slight_smile:

So I wouldnt need an RPI or Arduino at all?

That really is massive! :slight_smile:

Not very good with the ESP’s yet (after my failure last time), but have bookmarked your HowTo and will look at when I get back from hols…

Your help and advice is very much apreciated! :slight_smile:


#7

You are welcome. That is what we are here for. The ESPs kind of snuck up on us and the fact that some bright bunny integrated it with the Arduino IDE is an amazing breakthrough.

Craig


#8

Hi Cy,

Its interesting to read your posts, I’m going through a similar learning curve seemingly.

I started with Arduino using RPi for Ethernet comms but had a lot of issues. Then I tried RPi on its own which was very solid except its too limiting for my needs. I too am attracted to the small form factor of the Arduino Nano and/or ESP8266 but I have started testing with an UNO and Ethernet shield and don’t find the dashboard as solid and reliable as the RPi and that’s on Ethernet!

So I’m in two minds whether to continue down the Arduino/ESP route or ramp up the IO capabilities of the RPi.

Cheers

Pete


#9

Hi Pete,

Yes, I know what you mean…

However, the though of a full Rpi sat there “just” running two temp sensors and a relay seems a bit of a waste :wink: .

I’ve been watching the ESP’s since they came out, bought one when they first came out, but was rather put off when I couldnt get a damn thing to work… that and my knock-off Uno have been sat in my “bit box” ever since! :wink:

Still, if we can make a 1" ESP do what I’m thinking, for a few ££, then just - WOW! :slight_smile:

My skills are at best “intelligent bodger” - I’ve been building PC’s for decades, but my electronic skills are at best surprised if something works! However, I like trying projects like this to “push beyong” my comfort zone…

Also, I’m crap at soldering! :wink:
I get the idea, just darned if I can get it to what it’s supposed to… :wink:

I’ll get a new ESP and see where we go…

C


#10

@kreggly

What do we think to the ESP-12E, say a set of three like this?

Do the job, no?


#11

:grinning:

Great to hear. It seems like I’m theoretically more qualified than you but my efforts seem a hell of a lot like “intelligent bodging” most of the time so you aren’t alone there! - :laughing:

I too think the RPI is total overkill for most of this stuff and especially as I need analogue more than digital IO. I bought a job-lot of dirt cheap Arduino Nano’s and its annoying that they are relatively hard to interface to Cayenne with Ethernet and even more annoying that they could be replaced entirely by a ESP with wifi included!

Good luck with it

Cheers

Pete


#12

Really depends on what you want to do.

You can get the modules for like 2 bucks on AliExpress, then a breakout board for another 50 cents, and a really good LDO for another 10 cents (150mV).

http://www.aliexpress.com/item/2015-New-version-1PCS-ESP-12F-ESP-12E-upgrade-ESP8266-remote-serial-Port-WIFI-wireless-module/32643052680.html

http://www.aliexpress.com/item/1pcs-lot-ESP8266-serial-WIFI-model-ESP-07-Authenticity-Guaranteed/32310095382.html

http://www.aliexpress.com/item/ESP8266-serial-WIFI-wireless-transceiver-module-MT7681-3DBI-gain-antenna/32299565188.html

http://www.aliexpress.com/item/ESP8266-serial-WIFI-module-adapter-plate-Applies-to-ESP-07-ESP-08-ESP-12/32277216644.html
http://www.aliexpress.com/item/100PCS-HT7333-A-HT7333-3-3V-SOT-89-Low-Power-Consumption-LDO-Voltage-Regulator/32637341350.html

http://www.aliexpress.com/item/4-channel-relay-module-Microcontroller-development-board-relay-expansion-board-support-AVR-51-PIC-channel-relay/615781241.html

You then just get a 3.3V logic USB to RS232 converter, some relay boards, and away you go.

For a programming cable, I prefer the FTDI ones as they pinout matches the Arduino Mini:

https://www.amazon.com/GearMo®-Header-TTL-232R-3V3-Windows-Support/dp/B004LBXO2A/ref=sr_1_1?ie=UTF8&qid=1471459429&sr=8-1&keywords=rs232+3v3

You could power it with this, so don’t even need the LDO.

Buy a couple DS sensors, and as they say, Bob’s your uncle.

Craig

Ps. Here’s another one that is cheaper. you just need to supply your own USB cable and header ribbon.
https://www.amazon.com/Blue3D-Ft232rl-Serial-Adapter-Arduino/dp/B012YUANZK/ref=sr_1_3?ie=UTF8&qid=1471459429&sr=8-3&keywords=rs232+3v3


#13

Thanks for the effort putting that together for me Craig…

A nice new project for when I get back from hols! :slight_smile:


#14

NP. All stuff I’ve already played with and tried out. Only the RS232 adapters I haven’t tried as I have an original FTDI one. Only problem is that my FTDI one only outputs 5V so it’s not suitable for powering the ESPs directly, thus the need for a regulator.


#15

Coming back to using the ESP as a shield…

I played around with this on the weekend and was able to satisfy the underlying Blynk requirements with an updated esp shield header file, etc, but the Cayenne class does not support the overload of the Cayenne.begin function with the extra parameter for the ESP8266 handle.

Might want to look into this @bestes if the ESP with the NodeMCU firmware is to be supported as a shield on future roadmaps.

Cheers,

Craig