Sensors on ethernet (ESP8266)
I'm a complete noob that bought a Vera about a month ago. I've been playing with Arduinos for about 8 years but I'm still at noob level because my memory is extremely poor and I can't ever seem to memorize programming syntax or remember the details of anything I learned for very long.
What I'm trying to do is this: I want to make my own sensors that communicate with the Vera over ethernet. These can either be on an Arduino with ethernet/wifi transceiver or on an Adafruit feather Huzzah (ESP8266).
My question is how do I do this?
I read the tutorial about the ESP8266 on here but it seems to be aimed at using it to receive RFM69 data and then forward it onto your ethernet network. That's not what I'm trying to do here.
What I'm trying to do is directly read sensors (such as a DHT22) and then somehow send the readings to the Vera. I don't know how to do this.
Can anyone offer assistance?
@Marshall MySensors doesn't communicate over ethernet/WiFi. So if you're determined on using ethernet/Wifi as as your transport layer, MySensors isn't the right choice.
But you should check out all of the great projects build by the community members. And maybe it convinces you to start using MySensors. Going the MySensors way makes things really easy, because MySensors handles a lot of things for you. Things you'd otherwise have to program yourself.
Going the MySensors way makes things really easy, because MySensors handles a lot of things for you. Things you'd otherwise have to program yourself.
I like easy. And I'm really bad at programming.
I have a couple of Arduinos and some RFM69 transceivers. Also, I guess it should be easy to make a RFM69/Ethernet gateway since I can attach a RFM69 to my ESP8266.
What is the easiest way to get started adding sensors?
@Marshall The most easiest way is:
Choose your controller type. Since you have Vera and MySensors was originally developped for Vera, you could just try a simple serial gateway. An Arduino Uno or Nano will do. They have a USB interface which you can plug into your Vera controller.
I advice new MySensors users to begin with the serial gateway. It's just the most easy one in is almost plug and play.
From here on you can add all the sensors you need.
Hope this helps. If you have any more questions, that hesitate to ask them.
Marshall last edited by Marshall
I followed the instructions for a serial gateway but unfortunately it just doesn't work. It looks like the Vera cannot talk to it.
Here's what I'm working with: I have a couple of Moteino R5 USB devices that I bought a while back. They have the built-in RFM69 tranceiver.
My plan is to hook one up to the Vera to use as the gateway, and then the other will be my sensor node. I'm going to hook a DHT11 to it so it can measure temperature and humidity.
I opened the GatewaySerial sketch from the MySensors-master folder (which for some reason is completely different than the SerialGateway sketch on this page: https://www.mysensors.org/buil/serial_gateway) and edited the file. I had to comment out the NRF24 and uncomment the RFM69 entry. I uploaded the sketch to the Moteino.
I checked the Moteino via serial monitor and see it doing its thing:
0;255;3;0;9;Starting gateway (RRNGA-, 2.0.0)
0;255;3;0;14;Gateway startup complete.
0;255;3;0;9;No registration required
0;255;3;0;9;Init complete, id=0, parent=0, distance=0, registration=1
I then log onto the Vera and attempt to create the gateway device. I uploaded the LUUP files and basically followed the instructions on this page: https://www.mysensors.org/controller/vera
However after I create the Arduino device, it says "Lua Startup Failure". And that's it, I'm dead in the water there. I did try it again with the ESP8266 as the device and I get no errors, it just doesn't seem to work. But I figured I'd start from the basics and concentrate on getting the serial version to work first. I see posts from a couple of years ago stating that you have to use the nano for a gateway. Is that still a problem? Because mine is an Uno clone, not a nano.
@Marshall If Vera can not see the USB serial port it means that the device you are using does not have a supported USB serial chip. Vera should recognize FTDI chips but might be missing the driver for other chips.
@korttoma I'm wondering if something is corrupted on the Vera because it should see the Moteino. It has a FTDI FT231XS chip so I'd think it should work.
I guess I'll also try getting the ESP8266 Wifi gateway to work even though that has problems too.
Somtimes it is as simple as using another USB cable, some USB cables are of poor quality.
@Marshall I do use a Vera2 and Vera3.
I my case sometimes the USB gateway is not recognized by tVera.
My start up procedure:
- switch on Vera (with out USB MySensors Gateway)
- wait a while to let it boot
- connect the MySensors GW (make sure the USB light comes on after a couple of seconds otherwise disconnect it and reconnect it again, not sure if a VeraPlus has a USB led)
- press reload button in UI (if the USB port is not shown in port configuration) again wait for Vera to be ready
- go to serial port config to see is port is available now.
- Make sure you set the serial speed (baud) setting correct and press save
I made some good progress tonight and was able to get the USB Moteino to work as the gateway.
It turned out the problem was that I had the incorrect serial port settings in Apps>Develop Apps>Serial Port Configuration. I pretty much had all the wrong settings in there. The Baud rate was wrong and I had selected the wrong device in "used by device". I fixed those settings and now it works.
To test it I used another Moteino to read a light sensors and report back to the Vera. That worked without a problem.
The next step is to find out how to create custom sensors that aren't in my Arduino Examples.
Thanks for all of your help everyone.
@Marshall It's always great to hear from people that their problems are solved. And it's also great that you were able to solve it on your own!
I actually think that most things you'd wanna create are available through the build page.
Since it's a pity to have one Arduino per sensors, the next step would be to try to combine some sketches. I mean Arduino's are relatively cheap. But if you use only 50% of their capabilities and would use another for another sensors, it will end up being more expensive than needed.