Embed in your website: Help!

Hey All,

First post and need a bit of help. I would like to start embedding some of my multigraphs to my wordpress website. I am running the latest image on my Pi3 and love it. Do all I need to do is change the IP from my local to external ? or do I need to make changes to my router. Here’s my example

My website is hosted by Digital Ocean

Thanks

Hi Jeff! Welcome to the OEM community forum. (hope your node-red/npm/nodejs upgrade is still working A-OK!)

I am not able to answer anything about Wordpress - I know little to nothing about WP. I looked at the visualizations (menu Extra > Visualization) and it looks like the answer to your question is “yes” it must be an external IP address. And changes to the router would probably be needed. Keep in mind since you’d be opening up your emonPi to the internet and you’d need to lock everything down before doing so. There are a few topics on this forum about securing your setup. Search for “cloudflare” or “SSL”. Later today I’ll search thru the forum and look for something more that may help securing your emonPi.

Thanks John,

I seem to be struggling to get this to work, If I can get one to work first then I will look into security. Do you know what port I need to open to gain access to Emoncms remotely?

Thanks,
Jeff

Based on RASPBIAN JESSIE LITE (2015-11-21) SSH user,pass:pi,emonpi2016
Linux Kernal 4.1.19-v7+
RasPi Firmware & packages updated to support Raspberry Pi3 & onboard Wifi (RasPi3 BT disabled)
Tested to work on RasPi 3, 2 Model B+, B, A and even Pi zero!
Emoncms V9.5.1 | 2016.04.28 stable branch
emonHub emon-pi variant - now default HTTPS to Emoncms.org
MQTT LightWave RF OOK
NodeRED 13.4 - with custom OEM setup port:1880 user,pass:emonpi,emonpi2016
OpenHab 1.8.2 - with custom OEM setup port:8080 user,pass:pi,emonpi2016
Mosquitto MQTT server V1.4.8 with authentication port:1883 user,pass:emonpi,emonpimqtt2016
MYSQL username: emoncms, password:emonpiemoncmsmysql2016 port 3306 (not open externally)
GSM 3G USB modem support

it is the standard port 80.

Be careful!

Thanks John,

Last question…(well maybe not :))
Do I need to add user,pass to get it to work ( External IP = ...:80 emonpi,emonpi2016 )

Two bad motorcycle accidents this summer…I’m not so good with the “be careful” approach :smile:

Jeff

Do you have your emoncms set up for external access?

Assuming a standard domestic ISP the external IP address assigned to you can change as it is not “yours” it is just the one currently assigned to you. To get around that you can use a dns service like DuckDNS so that http://name-you-chose.duckdns.org always resolves to your current IP as there is a script you run on the emonPi to ping duckdns with your duckdns apikey and it nores the IP from where that came.

In addition to that you will need to change some settings in your home router, you will need to set up port-forwarding so that all traffic on external port 80 is forwarded to your emonPi’s port 80, either by hostname or by LAN IP, not all routers will do it by hostname but if you can do it that way it is preferable to a dchp assigned LAN IP because that too can change in time. You can use a static LAN IP if you choose but that is a bit more involved to set up so try by hostname first.

When you can access your emoncms from outside your network using https://www.duckdns.org/emoncms you are ready to embed some multigraphs etc, you must use the https://www.duckdns.org/emoncms url in your embedded code and ensure it contains a read-only apikey or that the feeds are public.

You do not need to use any passwords for the embedded stuff, only when you log-in yourself.

Hi Paul,

Long story, but yes I have an static external IP from my ISP. When you say " Do you have your emoncms set up for external access?" Is there setting I need to change ?

Currently at work :frowning: will test tonight :slight_smile: .

Jeff

Not in emonCMS or the emonPi (unless you go for a static LAN IP) but you do need to set up your router to forward the “port 80” traffic to the emonPi.

This might be of some help with seting up port forwarding on your router:

Ok…Still stumped and not working. Called my ISP and had the firewall opened on my radio (rural internet). When I test the port externally it is open.

This works locally http://192.168.1.100/emoncms/vis/multigraph?mid=1&embed=1
I have port forwarding to 192.168.1.100 port 80 external and internal.

Externally this should work ? http://64.64.*./emoncms/vis/multigraph?mid=1&embed=1
I get error 404 Not found

Update:
It is working now when I access my website from outside my home network, I see my multigraph. I’m still confused that when I access my website that is on an external server somewhere out on the internet from home that has my emoncms running on a pi locally I get the 404 Not found. Is there a work around for this ? It would make editing my website and the integration of emoncms visualisations much easier.