Converting a wifi outlet to an nRF24 MySensors device



  • So recently I purchased some wifi controlled outlet adapters from Walmart. These are based off of ESP 8266 modules which I was able to reprogram. I had them working for a bit, but was having trouble getting some parts to work right with my Vera controller. Here is what the devices looked like:
    0_1486799422087_upload-f28c5153-ba94-45dd-93c6-56d83bdec6e0
    And here is what the guts of the device looked like. This is with dupont cables connected to the module from when I reprogrammed it.
    0_1486799620127_upload-4a41056b-d8db-4b45-8ef5-96767c7f7a10
    Most of my setup for MySensors uses an nRF24 network, and based on the fact that I was having some trouble getting some of the devices to work, I thought I'd give a shot at converting these to nRF24L01+ nodes. I cut some proto board the same size as the inner module and drilled identical holes to make it fit the same as the old 8266 controller. Space was a real concern as I needed to get a pro mini and an nRf24 radio inside the case. I used a 3.3v pro mini with the radio connected to a harness so I could tuck that around the plug socket for space. Here is a picture of the first new test assembly next to the old original controller. I was able to incorporate a micro-switch and an LED to show the on/off status of the relay. The switch works with the front power button on the cover. The radio is hanging underneath the white board with the colored wire harness.
    0_1486800436701_upload-5bc3fdbb-8674-4df2-84a2-f894965fb9ae
    Since the board connected to the main power board with 3 wires, it made it easy enough to connect. The 3 wires were GND, +5V and relay signal.

    I have since made 2 more of these, but haven't taken pictures of one of those yet. I will post a few more pictures this weekend.

    The old ESP8266 boards that I removed I can re-purpose down the line when I have more time to figure out the plugin for my Vera.


  • Admin

    Did you try to running MySensors on the ESP controlling the relay?



  • @hek I did not. Correct me if I'm wrong though, but my understanding of the ESP version of MySensors code is that a device on the ESP network cannot communicate node to node with a device on the nRF24 network. I have never done node to node communication, so one of the things that I want to try in the next week (partly to learn how) is to set up my wall switch that I built to talk directly to these 3 nodes. The idea is to eliminate the need for Vera to be in the mix for these devices. The way I have them set up now, I have scenes set up that basically say, when this switch is turned on or off, turn this light on or off. If the Vera were to go down I would loose control of these lights for the period that it is down.


  • Admin

    Yes, you are correct. You would have to handle the logic on vera if you want to route/trigger messages between gateway instances.


  • Mod

    Not sure if it helps, but shouldn't it be possible to use the esp instead of the pro mini? Not as gateway, just as regular mcu with nrf node (with wifi turned off).



  • @mfalkvidd I would be open for that if there is an example of how to set it up. Currently I have the 3 that I recently bought converted with pro minis, but I had thought of purchasing a few more of these to use in places around the house. If all I had to add was an nRF24 radio, it would make setup easier and cheaper.


  • Mod

    @dbemowsk I think you would just upload the same sketch you use for the pro minis today (compiled for the esp board of course).



  • @mfalkvidd I kind of figured that, but I was more talking about the connections to the ESP module. How do I wire in the nRF24 and to what GPIO pins. Depending on what pins are needed to connect the nRF24, I would need to check whether those pins are broken out on the ESP module used in this thing. I looked at this module and compared it to a number of commercially available ones and could not find one that matched. Luckily someone on Hack-A-Day had done all of the leg work to diagram this module.


Log in to reply
 

Looks like your connection to MySensors Forum was lost, please wait while we try to reconnect.