All times are UTC + 8 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Oct 11th, '17, 00:17 
Offline
Newbie
Newbie

Joined: Jun 7th, '16, 21:09
Posts: 34
Gender: Male
Are you human?: yes
Location: Easley, SC U.S.A.
Internet Access for Arduino Controls

Goal: Provide internet access from any internet-enabled device to my Arduino based Aquaponics control system.

I needed to access my Arduino control system from anywhere via my cell phone or tablet. I get my internet service from a cable supplier, no problem. Except that ISP provides a dynamic IP address to my cable-modem; a fixed IP cost more money. The cable-modem is connected to my wifi-modem for the house and work shop via an wifi-extender. The control system accesses the internet via the wifi-extender>wifi-modem>cable-modem>ISP>… while my development computer, a Mac portable, floats between the wifi-modem and the extender. My development computer access the control system via the wifi intranet as usual. But when not at home or via my cell phone’s G4 network, access is problematic due to the dynamic IP. Nothing new there.

There are services to manage this home network access problem by monitoring the dynamic IP changes and supplying a static URL to access my home intranet. This gives me a direct internet connection to my control system. Such services range from free with limited capabilities to expensive with extensive capabilities.

For my DIY aquaponics control system, free is always best to try first. But I found free service too limited. For example, control system responses were returned as HTML embedded in a frames page, including advertisements, generated by the free service provider. Too arcane for my needs because I want to provide a ‘restful’ API on my web site for all aspects of my Aquaponics control system’s monitoring, alerting and controlling. (I already have a domain name and shared hosted web space, site.)

Plan:

1. Provide WiFi access to my control system as a simple intranet WiFi access point.
2. Insure access point extensibility for control system growth and changes.
3. Build a website API for bi-directional access with my control system for:
.- managing my dynamic IP to eliminate problematic control system access,
.- receive control system and sensor data for historical storage,
.- access and passthrough [to user] current control system and sensor data,
.- send system control commands and data from the user, and
.- receive and passthrough [to user] alerting messages and data.
4. Provide simple access security.

My plan is an outline of current needs and wants. A ‘proof-of-concept’ test system with most of these items, is already implemented and has been running well for some time now. Cheap is always a guideline for me and although I develop on multiple Arduinos [Uno, Uno-WiFi, mega], I deployed the test system on less costly Arduino Mega clones. I also use a cheap ESP8266 E-12 nodeMCU by HiLetgo [$4 - $9 USD] for WiFi access using bi-directional I2C communications with the Arduino Mega clones. The nodeMCU provides the intranet access point with a simple API for external communications.

Image

...more to come if any one is interested.

Greg


Top
 Profile  
Reply with quote  
    Advertisement
 
PostPosted: Dec 2nd, '17, 00:51 
Offline
Valued Contributor
Valued Contributor

Joined: Nov 29th, '17, 03:08
Posts: 55
Gender: Male
Are you human?: YES
Location: USA, TX
That is way past my realm of knowledge, but if someone saw your (open?) ip address, they could easily connect and screw with your system...


Top
 Profile  
Reply with quote  
PostPosted: Dec 5th, '17, 00:25 
Offline
Bordering on Legend
Bordering on Legend

Joined: Jan 6th, '15, 06:49
Posts: 432
Gender: Male
Are you human?: when in a good mood
Location: Santee, CA USA
Definitely following...

My Arduino is a simple timer control for repeat sequencing of 3 valves. I would like to add sensors and a wifi connection / web and smartphone interface.

I have multiple smart switch devices that operate without a hub over wifi. These are all controllable from my phone using various apps. I also have a cable ISP (Cox) and dynamic IP address. But somehow all the smart apps like WEMO, KASA, Alexa, Ecobee, etc. seem to deal with the dynamic IP address without any issues. If they can manage this, why can't the Arduino be recognized in a similar manner?

Ultimately I would like to have something like a SCADA interface to monitor and control my system remotely, as well as log and record data, generate graphs, etc.

I am already using smart switches for simple timing of devices like turning off my tilapia heater during peak electric demand rates, auto fill of my holding tank for de-chlorination, and transfer of de-chlorinated water to my rain barrel top off system.

I want to make my Arduino more of a calendar based timer instead of a simple counter loop, but I have not researched how to do this yet - too far from the top of the priority list.

- Dave

_________________
800 gal sys 2016
IBC system 1/2015
simple flood & drain
5 growbeds

9 kW Solar Electric 2011

"Aquaponics...solar-powered nanotechnology that produces fresh vegetables and meat, while purifying water..." - Rick Op, Houston Texas.


Top
 Profile  
Reply with quote  
PostPosted: Dec 8th, '17, 00:57 
Offline
Newbie
Newbie

Joined: Jun 7th, '16, 21:09
Posts: 34
Gender: Male
Are you human?: yes
Location: Easley, SC U.S.A.
Hi Dave.

I use a website w/ 'rest-like' api as a gateway for all external access to my control system. So is any where, any device -> website via an API. This can have security as any site. The API calls the control system as part of the API's back-end delivering data and accepting control commands. This too can have multiple layers of security. The data returned and control change confirmations are returned to the accessing device, via the browser.

The website is an extensible restful php page/system. The controls interface is via the Arduino IDE on an ESP8266 nodeMCU communicating with the [local] Arduino boards via I2C using a DLC, SDA and GND wiring. It's backend is simply handling the server calls like:
Code:
    server.on("/", handleRoot);
    server.on("/index", handleRoot);
    server.on("/help",  handleHelp);
    server.on("/data",  handleSendData);

The website's API is like:
Code:
    api.website.com/data
    api.website.com/help
    api.website.com/change?heaterStatus=off

Example: api.website.com/data returns a JSON string like:
Code:
{"DateTime":"12/07/2017 12:07:43","keyValue":956,"sumptankTemp":74.60,"tankroomTemp":65.50,"greenhouseTemp":65.20, "outsideTemp":51.70,"growbed1SiphonState":0,"growbed2SiphonState":0,"growbed3SiphonState":0, "growbed1FlowRate":2.00,"growbed2FlowRate":1.60,"growbed3FlowRate":1.20,"fishtank1Temp":73.90, "fishtank2Temp":74.30,"fishtank1FlowRate":4.50,"fishtank2FlowRate":0.00,"heaterInlet":75.90, "heaterOutlet":77.20,"heaterStatus":1,"bucketsFlowRate":0.80,"bucketsSiphonState":0}

SUMMARY
- Controls accessible from any device's browser - no special device-aps
- No fixed IP required
- System's security can be locked down
- Website is a PHP based API class on a commercial shared hosted service
- WiFi access point is via ESP8266 (low cost, Arduino IDE)
- Easy to add website SQL based backend for historical data
- Independent of other Iot services like ThingSpeak
- Extensible although NOTt commercial grade


I do share if it sounds like this DIY approach could help you.
Just let me know.

Greg


Top
 Profile  
Reply with quote  
PostPosted: Dec 8th, '17, 10:12 
Offline
Newbie
Newbie

Joined: Jun 7th, '16, 21:09
Posts: 34
Gender: Male
Are you human?: yes
Location: Easley, SC U.S.A.
Dave,

...I forgot to mention the RTC board.

A Real-Time-Clock brings the Arduino controls into the "current local time" for events scheduled by time of day, weekday and even calendar date and time.

I use an I2C device (couple of bucks) as an add-on. It can be checked/reset via periodic queries like on reboot, or every 5-minute to a web based service for date and time validation, taking your local timezones, daylight savings, etc.. into consideration.

There are many web based calendar scripts (PHP, javascript, etc.) in the public domain and available to use or include in the main website. Basically, add and remove a date/time event to process via the control system is all that is needed plus a persistent pending queue.

My system is "near-real-time." Milliseconds do not [really] matter. That is, polling is based on intervals like 5, 10 and 30 seconds, minutes even in some cases. So to the exact nanosecond timing is not necessary - except for electrical fault issues which are handled physically, think GFCI power.

So scheduled events like: 2017/12/23 18:33:16 may occur at 2017/12/23 18:33:16 +/- some milliseconds of error, without system issues.

Scheduling events now and later are, I believe, easy to implement although I have not required such yet.

As above, let me know.

Greg


Top
 Profile  
Reply with quote  
PostPosted: Dec 9th, '17, 00:36 
Offline
Bordering on Legend
Bordering on Legend

Joined: Jan 6th, '15, 06:49
Posts: 432
Gender: Male
Are you human?: when in a good mood
Location: Santee, CA USA
Thanks for all the info. I understand some of it, though I'm sure as I get more involved the rest will become clear. I'm sure I'll have questions when that time comes.

_________________
800 gal sys 2016
IBC system 1/2015
simple flood & drain
5 growbeds

9 kW Solar Electric 2011

"Aquaponics...solar-powered nanotechnology that produces fresh vegetables and meat, while purifying water..." - Rick Op, Houston Texas.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 8 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB® Forum Software © phpBB Group
Portal by phpBB3 Portal © phpBB Türkiye
[ Time : 0.180s | 19 Queries | GZIP : Off ]