Alternate Portal

Related to the Portal
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Alternate Portal

Post by rimai »

And you said that it does the same thing when using an internal ip as well?
I just want to eliminate the loopback issue.
Did you try sniffing the network traffic to see if the server is getting any connection at all, even if it is broken?
Roberto.
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Alternate Portal

Post by binder »

rimai wrote:And you said that it does the same thing when using an internal ip as well?
I just want to eliminate the loopback issue.
Did you try sniffing the network traffic to see if the server is getting any connection at all, even if it is broken?
Correct. internal and external ip yields same result. not a loopback issue. my router handles the loopback appropriately.

no, i have not sniffed any network traffic yet. that will be the next step. i was also going to try to use the wifi utility to reprogram my wifi module thinking that may help. i will see what i come up with today.
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Alternate Portal

Post by binder »

I figured out my problem and got things working. I used the wifi utility to program my module so I could see how the defaults were set. Turns out, I was only doing half of what I needed to do in regards to getting it to update. Now I haven't tested this more because it is working, but this is what I needed to do. I needed to change the host ip to my public ip and my host dns name to my public domain name.

Code: Select all

set ip host XXX.XXX.XXX.XXX
set dns name my.domain.name
I'm sure I could have set things to be based solely on my internal network but I opted to go this route. I will have to test more in the future. As soon as I plugged the module back into my controller and started viewing my webserver logs, I could see the requests and commands coming through just fine. So I know that works now and that I can receive the data from the controller. On to pulling the data from my database..... :ugeek:
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Alternate Portal

Post by binder »

success!!!

i now have my own portal logging my data for me. i can receive the data from my controller and i can pull the data from it using my android app (i have it tweaked to work with my portal specifically though for testing).

i don't have anything being displayed on the webserver for my portal other than listing what devices are connected and giving a form to add a new device. this can be fixed in the future though.

the good news is everything works and can be deployed easily for people. so you could run your own custom portal/data logger on something like a raspberry pi (hence my internal name raPiPortal). i have to continue to tweak the main page and the settings and everything but it's looking pretty good and working fairly well for me so far. this could be great for those with multiple devices (like a fish shop or dealer or something) or someone who wants to keep all their data "in-house" and do other things with the data.

anyways, just thought i'd share my progress. :geek:
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Alternate Portal

Post by rimai »

Awesome!!!
Roberto.
User avatar
joshlawless
Posts: 138
Joined: Thu May 23, 2013 2:52 pm

Re: Alternate Portal

Post by joshlawless »

Just wanted to stick my head in this and announce I'd be very interested in this feature, even if it required some legwork.

I'd be much more comfortable in the security of my tank if I could have the WiFi module communicating with a webserver on my LAN, behind my firewall, to avoid the port-forwarding and the reliance on basic HTTP auth to protect my tank from unauthorized tinkering.

If you were willing to share the changes you made to the libraries, the configuration you passed with the WiFi utility, and the code running on your webserver, I'd be very grateful.
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Alternate Portal

Post by binder »

joshlawless wrote:Just wanted to stick my head in this and announce I'd be very interested in this feature, even if it required some legwork.

I'd be much more comfortable in the security of my tank if I could have the WiFi module communicating with a webserver on my LAN, behind my firewall, to avoid the port-forwarding and the reliance on basic HTTP auth to protect my tank from unauthorized tinkering.

If you were willing to share the changes you made to the libraries, the configuration you passed with the WiFi utility, and the code running on your webserver, I'd be very grateful.
sure thing.

i just pushed the webserver code to my github account:
https://github.com/curtbinder/rapiportal

i added comments to the README file on how to set it up. hopefully i got all the steps in there. i haven't really messed with this since last year. i was going on my comments and code.

this is just a bare basics start. my php skills are very limited. i also have not updated the database code to reflect the newer fields in the database.

also, i believe you need to create the "device" in the database first. the "device" is the name you use inside the Portal("username"); command. Typically that is your portal username but this custom portal will allow you to have multiple devices all sending data to it. so you can create your own names and such.

feel free to look around the code and test it out and all. i may add in more comments about setting it up and possibly fill in the missing database fields for it to handle....just depends on what all i have going on this weekend. if i get the backend working good, then the main thing would be to get a simple frontend created for displaying the data. i know it sends the data out just fine when queried because i had it working with my android app.

anyways, let me know if you have questions.
Smotz
Posts: 412
Joined: Sat Mar 30, 2013 5:02 pm
Location: CT, USA

Re: Alternate Portal

Post by Smotz »

following..
dlplunkett44
Posts: 74
Joined: Mon Aug 05, 2013 3:16 am

Re: Alternate Portal

Post by dlplunkett44 »

Is this ready to be used? I am getting a raspberry pi and would love to be able to log all of the data and make graphs over time.
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Alternate Portal

Post by binder »

dlplunkett44 wrote:Is this ready to be used? I am getting a raspberry pi and would love to be able to log all of the data and make graphs over time.
I haven't worked on it in a while. it needs to be updated to handle the newer commands. It also does not have any specific interface for it. I didn't have a lot of time for it and there didn't seem to be a lot of interest in it either.
Do you have any coding experience? would you be able to help?

Sent from my XT1585 using Tapatalk
dlplunkett44
Posts: 74
Joined: Mon Aug 05, 2013 3:16 am

Re: Alternate Portal

Post by dlplunkett44 »

I do not have much coding experience but I am willing to learn what is necessary. What is the current state of this? What newer commands is it not able to do? As far as an interface, do you mean a web page to display the data? Is it capable of storing the data into a database?
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Alternate Portal

Post by binder »

dlplunkett44 wrote:I do not have much coding experience but I am willing to learn what is necessary. What is the current state of this? What newer commands is it not able to do? As far as an interface, do you mean a web page to display the data? Is it capable of storing the data into a database?
In it's current state, it should be able to store the data in a database (i believe it's set for SQLite database). I don't recall how / if it displays the data on a web page. It is designed to be used for internal usages because of no authentication and such.
It only receives data and can serve data in terms of sending out the status requests. It does not issue any commands to the controller, nor does it accept commands to be relayed.
I would have to test it and see what it does since I do not recall off hand.
It is written in PHP and an authentication, display, and management interface is needed.
dlplunkett44
Posts: 74
Joined: Mon Aug 05, 2013 3:16 am

Re: Alternate Portal

Post by dlplunkett44 »

Thanks for the info. I'm going to load it into my pi in the next few days and see where I can get with it. How often does the controller send data?
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Alternate Portal

Post by binder »

dlplunkett44 wrote:Thanks for the info. I'm going to load it into my pi in the next few days and see where I can get with it. How often does the controller send data?
every 15 minutes by default but i believe that can be changed in the libraries (not user configurable, but hard coded)


Sent from my iPad using Tapatalk
Post Reply