Arduino Remote Home #14

in #steemmakers6 years ago

Some time ago I said I was having trouble with my web-server and I was going to dig deep into the code for answers. Well I did. But before I blabber on about that, I would like to brief you in on some of my Steemit activities.

If you’ve been following you know I’ve said from the beginning that I intended to blog about my home-automation project, in the hope that someone may find something useful. Since that time I have posted things that aren’t even remotely related. So I subjected you to things that I’m sure didn’t interest you. To stay on track I’ve purchased a second Steem account, @dydosoar. There I’ll be inter-acting with the community at large. If you’re interested, I’ll be posting how I did it over there. Please understand I have never been a social media type guy. Oh sure I’ve dabbled a bit, mostly just reading up on stuff, trying to make sure my kids didn’t get bullied, but never really jump in and posted or commented a bunch, like I have here. So I apologize for allowing myself to stray. With that said, I wish to be as forthright as I can, and maintain, the high level of integrity that I was raised with. For that reason I will no longer waste your limited time on things outside the scope of Arduino, Home-automation, DIY or anything else not tech related. I felt compelled to be open and honest. Please forgive my digression.

As for my server issues I’m pretty sure I accidentally discovered the cause of my problem. I believe I mentioned that the server had been working for quite some time, then randomly stopped responding. So, as lead to believe, I triple checked the code. Line by line, I checked each and every character until I was quite sure, that the code was not the issue. I did find that I had assigned two different output actions to a single input action, but that wouldn’t crash the server. It would only give me the first output and would never reach the part to execute the second output. It would have really screwed with my mind, but never would it stop the server from responding.

So my discovery happened late last night when I was reviewing the data being output on the Arduino serial monitor. I opened it to check the AJAX request, response text being sent back to the browser. It should have been a long text string. But because I downloaded an earlier version of my code, one where I used the serial println() to print the actual headers of the HTTP requests being made, it showed several requests I wasn’t expecting. This fortunate accident revealed, requests for a favicon jpg, or some derivative of that. I guess this is what is called a spider or a port scanner attack. Either way what I believe is happening is that these, seemingly random connections, are not releasing the server and is locking it up. The Arduino ethernet client/server information I have read, states that the ethernet shield 912D94E4-0C33-4167-A30D-5298E14B6784.jpegcan only have four concurrent connections. This, if it is what is actually happening, explains everything. I’m so happy. After hours spent searching for answers, I finally stumble across a possible cause!

My father always says “The harder the problem, the simpler the solution “. Not that fixing it will be simple for me. At this point I could set up a date logger to the SD card but I really don’t care who, or when these requests/connections are made. I need to, if not prevent them, at least end the connection as quickly as possible. Sounding like I need to setup some security. Maybe a log in option. Not entirely sure what that will entail but once I figure it out I’ll be sure and fill you in. If anyone has thoughts on this, I certainly would appreciate a comment on it.

As for any progress on the project, nothing to update you on other than I’m taking two weeks off in July to work on it. I’ll be getting down and dirty installing the second floor control box.50E0AB98-06B2-4C6C-A8CC-C7BF08335B9E.jpeg

Also hoping to tidy up some other bits as well. Like this mess.
E850FE47-3B74-441B-8345-824B60791372.jpegAll those wires will connect laundry room lights, master bedroom lights and fan, first floor bathroom lights and first hallway lights.

Until next time,

A683466E-C410-4A6E-8600-1D0C90BDE476.jpeg

Sort:  

Congratulations @electricswine! You have completed the following achievement on Steemit and have been rewarded with new badge(s) :

<p dir="auto"><a href="http://steemitboard.com/@electricswine" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link"><img src="https://images.hive.blog/768x0/https://steemitimages.com/70x80/http://steemitboard.com/notifications/votes.png" srcset="https://images.hive.blog/768x0/https://steemitimages.com/70x80/http://steemitboard.com/notifications/votes.png 1x, https://images.hive.blog/1536x0/https://steemitimages.com/70x80/http://steemitboard.com/notifications/votes.png 2x" /> Award for the number of upvotes <p dir="auto"><sub><em>Click on the badge to view your Board of Honor.<br /> <sub><em>If you no longer want to receive notifications, reply to this comment with the word <code>STOP <p dir="auto"><strong><span>Do not miss the last post from <a href="/@steemitboard">@steemitboard:<br /> <a href="https://steemit.com/steemitboard/@steemitboard/steemitboard-world-cup-contest-brazil-vs-belgium" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">SteemitBoard World Cup Contest - Brazil vs Belgium <hr /> <p dir="auto"><strong>Participate in the <a href="https://steemit.com/steemitboard/@steemitboard/steemitboard-world-cup-contest-collect-badges-and-win-free-sbd" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">SteemitBoard World Cup Contest!<br /> Collect World Cup badges and win free SBD<br /> Support the Gold Sponsors of the contest: <a href="https://v2.steemconnect.com/sign/account-witness-vote?witness=good-karma&approve=1" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">@good-karma and <a href="https://v2.steemconnect.com/sign/account-witness-vote?witness=lukestokes.mhth&approve=1" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">@lukestokes <hr /> <blockquote> <p dir="auto">You can upvote this notification to to help all Steemit users. Learn why <a href="https://steemit.com/steemitboard/@steemitboard/http-i-cubeupload-com-7ciqeo-png" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">here!
Congratulations This post has been upvoted by SteemMakers. We are a community-based project that aims to support makers and DIYers on the blockchain in every way possible.

Join our Discord Channel to connect with us and nominate your own or somebody else's posts in our review channel.

Help us to reward you for making it ! Join our voting trail or delegate steem power to the community account.

Your post is also presented on the community website www.steemmakers.com where you can find other selected content.

If you like our work, please consider upvoting this comment to support the growth of our community. Thank you.

Congratulations @electricswine! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

<p dir="auto"><a href="http://steemitboard.com/@electricswine" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link"><img src="https://images.hive.blog/768x0/https://steemitimages.com/70x80/http://steemitboard.com/notifications/posts.png" srcset="https://images.hive.blog/768x0/https://steemitimages.com/70x80/http://steemitboard.com/notifications/posts.png 1x, https://images.hive.blog/1536x0/https://steemitimages.com/70x80/http://steemitboard.com/notifications/posts.png 2x" /> Award for the number of posts published <p dir="auto"><sub><em>Click on the badge to view your Board of Honor.<br /> <sub><em>If you no longer want to receive notifications, reply to this comment with the word <code>STOP <p dir="auto">To support your work, I also upvoted your post! <p dir="auto"><strong>Do not miss the <a href="https://steemit.com/steemitboard/@steemitboard/steemitboard-world-cup-contest-uruguay-vs-portugal" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">last post<span> from <a href="/@steemitboard">@steemitboard! <hr /> <p dir="auto"><strong>Participate in the <a href="https://steemit.com/steemitboard/@steemitboard/steemitboard-world-cup-contest-collect-badges-and-win-free-sbd" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">SteemitBoard World Cup Contest!<br /> Collect World Cup badges and win free SBD<br /> Support the Gold Sponsors of the contest: <a href="https://v2.steemconnect.com/sign/account-witness-vote?witness=good-karma&approve=1" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">@good-karma and <a href="https://v2.steemconnect.com/sign/account-witness-vote?witness=lukestokes.mhth&approve=1" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">@lukestokes <hr /> <blockquote> <p dir="auto">You can upvote this notification to to help all Steemit users. Learn why <a href="https://steemit.com/steemitboard/@steemitboard/http-i-cubeupload-com-7ciqeo-png" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">here!