element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Merry Boxes & LEDs
  • Challenges & Projects
  • Project14
  • Merry Boxes & LEDs
  • More
  • Cancel
Merry Boxes & LEDs
Blog The Connected Trees are Working!
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Merry Boxes & LEDs to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: ntewinkel
  • Date Created: 8 Jan 2019 5:34 AM Date Created
  • Views 1719 views
  • Likes 10 likes
  • Comments 10 comments
  • wifi
  • merryboxesledsch
  • xmas
  • motion
  • esp8266
  • arduino
  • wemos
  • sensor
Related
Recommended

The Connected Trees are Working!

ntewinkel
ntewinkel
8 Jan 2019
image

Merry Boxes & LEDs

Enter Your Project for a chance to win a Maker Tool Kit, an Oscilloscope Grand Prize for the project that brings the Most Joy to the Heart, and Gift to Gives!

Back to The Project14 homepage image

Project14 Home
Monthly Themes
Monthly Theme Poll

 

Hooray!

 

I've made some real progress today, thank goodness!

 

You might recall the saga of motion sensors constantly sensing motion. That saga continued over the weekend and it was driving me nuts.

I finally decided to swap out to using pushbuttons, but those also still continuously acted like the buttons were being pressed.

I thought I might have burnt out a GPIO pin or something, the way it was behaving. Given that the motion sensors take 5v input, I did end up hooking up the button to 5v (not sure if I pressed one or not!), and then realized YIKES! the button needs to go to 3.3v for the GPIO to handle it.

 

Then this morning I thought I'd try hooking things up the same way I had it programmed on the Witty Wi-Fi - using the same GPIO as the Witty uses for the button and for the LEDs.

That then led me to wonder about the Wemos documentation that mentions pull-ups and pull-downs. I was thinking that meant the same as on the other Arduinos where you can, in code, specify input_pullup and pulldown.

HOWEVER, after looking at the schematics I see that's not the case for the Wemos! On the Wemos they are actual physical external resistors, not programmable.

 

So, note to self for later, and anyone else who might be interested:

GPIO0 (D3) and GPIO2 (D4, also built-in LED) are both connected with 10k resistors to 3.3v

GPIO15 (D8) has a 10k resistor to GND.

 

I suppose I could have used D8 for the button/sensor input and saved a bit of soldering. Actually no, because the Tree requires 5v.

 

So, I reprogrammed the trees to use the new pin assignments, swapped around the wires, and then hooked up pushbuttons for the time being to test it out.

 

And it works!

 

So at this point, I have both trees working nicely with pushbuttons. I can press the button on tree 1 to light the tree-top on 1, and send a message to tree 2 to light up that tree; and vice-versa.

Kinda cool how that works.

 

In this video I'm using the MQTT Websocket Client provided by HiveMQ to inspect the traffic that's being sent between my trees, which are both being powered by USB power adapters (one tablet charger, the other using an official Raspberry Pi power adapter). There are no wires between them, and all the MQTT traffic goes via the Internet to the HiveMQ broker, and back to my trees.

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

 

Next I'll try the motion sensors again to see if in all the confusion maybe I just misinterpreted what was going on. Fingers crossed!

 

ps, (edit),

The other thing I ran into on the weekend was that the Wemos boards were becoming unresponsive when I turned them on. sigh. Upon investigating that issue I noticed that my WiFi network was just not accepting them anymore. Resetting the network cleared that up.

 

But that also inspired me to add some startup code to flash LEDs to show progress. It flashes the blue LED a couple of times at startup, then flashes once with every WiFi network connection retry. Then when the tree is ready, it flashes all the LEDs on the main tree once as a signal.

When starting up, the trees also send a "Hello world" message to the other tree, so whichever tree starts up first will see the other tree coming online and will flash to acknowledge it.

 

Edit again:

I tested with a motion sensor on one tree and ran into the same repeated-triggering problem as in my previous post.

Still suspecting it might be power related, I hooked up an external power source (battery pack USB charger) to only power the motion sensor. I connected grounds together.

That works reliably now!

 

So to me that means if I want to use the motion sensors for the final build, that I'll have to figure out a better way to power them. Maybe intercept the input power, or bypass some bits on the sensors themselves. For this project I feel I've learned plenty already, and I'm running out of time. So I will stick with the easier push-buttons and wrap them up into a (hopefully) neat little package. Plus I've come to feel that the buttons give a more Christmassy "thinking of you" moment, rather than just random people (or cats) walking by.

 

Here's a picture of that test with external power:

image

(yes, that button is still half connected, to 3.3v - I'm not making THAT mistake again! image )

 

-Nico

 

Previous posts:

Connected Christmas Trees

Assembling the Trees

Finally! Two Trees Assembled

Two Trees by a Tree

Connecting the Tree to the Internet

Motion Sensor on Wemos

Trees! one with motion sickness...

Motion Sensor Issues, continued

 

Next post:

Merry Boxes - A Project Within a Project

Connected Christmas Trees - Finished!

  • Sign in to reply

Top Comments

  • genebren
    genebren over 6 years ago +2
    Nicely done. I am glad that you have gotten to the bottom of your mystery and come up with a good solution to the issues. Good work! Gene
  • dubbie
    dubbie over 6 years ago +2
    Very interesting project. I like the Christmas trees and the network connection is just so good. One day I'll have to get the hang of this internet stuff. Dubbie
  • ipv1
    ipv1 over 6 years ago in reply to Jan Cumps +2
    Amazon just stole MongoDB and is going closed source. I expect something similar is going to happen with FreeRTOS.
Parents
  • ipv1
    ipv1 over 6 years ago

    Nice. I was given a lot of grief over MQTT and wifi security a few months ago in a project. It is great for internal projects though.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 6 years ago in reply to ipv1

    Amazon has ammended a port of FreeRTOS with TLS and MQTT. I haven't checked it out yet.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • ipv1
    ipv1 over 6 years ago in reply to Jan Cumps

    Amazon just stole MongoDB and is going closed source. I expect something similar is going to happen with FreeRTOS. image

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • ipv1
    ipv1 over 6 years ago in reply to Jan Cumps

    Amazon just stole MongoDB and is going closed source. I expect something similar is going to happen with FreeRTOS. image

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
  • Jan Cumps
    Jan Cumps over 6 years ago in reply to ipv1

    They implemented a database that complies with the API.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • ipv1
    ipv1 over 6 years ago in reply to Jan Cumps

    ... which is now closed source and forked from an opensource project? I maybe wrong though but it just seems like a strange practice.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 6 years ago in reply to ipv1

    Mongo suggests it's copied, in a tweet. Amazone says they started from scratch.

    If it's scenario 1, it would be a licence violation. If it's scenario 2, then that's allowed.

    You can not license API headers and processor OPCODES. In the light of fair competition.

    You can license implementations.

     

    I may be corrected here by experts on the matter image

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • balearicdynamics
    balearicdynamics over 6 years ago in reply to Jan Cumps

    a

    Far to be an expert, mine is just a thought. Then next times will reveal what happens really. Maybe Amazon has acquired the package of MongoDB in the same way Digia has done with Qt? Now you can download a GMU GPL license with no content limitations or buy a licensed version. All from Digia. IMHO, this will be the optimum scenario, we also see in the case of the PyCharm, as well as many other, not last the same Autodesk Fusion360 CAD application (with limitations; I don't love too much their licensing policies)


    Enrico

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 6 years ago in reply to balearicdynamics

    Amazone did not acquire the software. According to MongoDB, Amazon consistently ignored them image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube