Setting up an emonPi - some newbie questions

I bought two ESP8266 as I didn’t realise the emonPi (bought last week so will be “new”) had built in wifi. Would I be best served by removing it from the emonPi and just using one ESP8266 on the emonTx3 ?

I have an AC Vrms “plug/brick” attached to both the emonPi and to the emonTx3, and also a 5v dc “plug/brick” connected to each. (The emonTx3 must be connecting to a network, as otherwise it wouldn’t appear within the Inputs page???)

I will continue with two Vrms inputs then, one on the emonPi and one on the emonTx3; thanks.

Thanks for the comments re: the CTs and batching them up in software, but I’ll work on that when I can at least set them up properly and graph the Inputs first. I’m keen to go step by step as it’s a steep learning curve …

I don’t think it’s doing any good, and it might be confusing the Pi’s system - put it that way. But the networking experts might have a different view.

Not having an ESP8266 to play with, I can’t offer a suggestion for why it’s not updating, other than it’s not connected to your network or the emonTx is not sending data to it in the correct format. But I think that’s the default setting now. Can your router see the ESP on your network?

We probably need help here from @pb66 .

This made me think a bit. Not wanting to hijack the topic but maybe something Haffle might want to consider too.
I too am using emonpi to measure Main house usage (1 ct) and EV Charging (2nd ct)
However my setup is a bit different. Portugal rules dictate the main EV charger breaker (and the differencial breaker - not sure how its called in English) needs to be located near the main house breaker box. This to be sure the lenght of cable is protected in case of a accidental Cut/Dig/Etc.
This means, from the powersource to the charger theres about 50 meters.

For convenience i am using emonpi at the mainbreaker board, reading Utility grid coming in, then the circuit going out towards the Charger. So Utility comes in → 1 line feeds main house breaker box, 1 line feeds EV Charger. However this means AFTER the CT placement theres about 50 meters of 6mm2 cable.

From what you mentioned Robert, on its own, this will introduce a % of error on the reading?

Also as a side note, on CT placement.
I noticed that while the EV Charger was off, i was having a residual 23-25w read on that CT. I looked and by mistake i noticed the ct cable was following in parallele the charger cables.
I made sure the CT never followed them for more than a few cms and now the residual 25w disapeared. I am getting 0 (-1 / +1w).
Is there a “best practices” when guiding the CTs into the cables and managing the excess lead to avoid or try to reduce noise/inductance on the CT leads?

Thanks!

You can look up the name in Portuguese at Electropedia. From what you describe, I think it is a Residual Current Device.

A 6 mm² two-core copper cable has a voltage drop of 7.3 mV/A/m, so at the maximum current of 49 A (at 30 °C ambient) that’s voltage drop of 17.88 V and the power going to heat the cable is 876 W. So about 7.8%.

The standard advice for low voltage control and signal cables is to run them as far away as possible from power cables (some say 2 m, but in almost every case I’ve seen, that’s impossible), and where it is necessary for them to cross, to do so at 90°.

It’s certainly got me confused! :smile:

How have you got the esp connected to the emonpi? Do you mean via wifi or do you mean “fitted” to it? That would take some hacking both physically and code wise to get an esp working on an emonpi.

Looking at your pdf I wonder why you opted for the arrangement you have rather than putting the emonpi in the office as it only needs 2 CT’s, that would give you 2 more CT’s in the house to measure the Grid (import/export) and the feed to the garage CU (is there any other circuits connected to CU #3 or CU #4 that do not go thru CT’s A,B,C or D ? (or spare MCB slots where future circuits might appear?)

Where is the office relative to the house and garage? If the emonPi was fitted there, would the RFM have a better chance of working? (ie is the office more central signal wise than the house?)

Where is you data being stored? Are you using the local emoncms on the emonPi or another instance (emoncms.org?) your pdf suggests emoncms is off-site.

When data arrives at emoncms from different devices the timing and order becomes pretty important as you cannot sum 6 values together and get good results if 2 of them haven’t arrived yet (for example).

Whilst WiFi (emonESP) is sometimes a better option than RFM that isn’t always the case. If your devices were all within a small radius and RFM worked really well it could, in this instance be superior to using the emonESP’s because the wifi aspect add’s potential network issues, even with a total local setup (ie not dependent on a outside internet connection) your devices are still reliant on the wifi router (unless you set up the emonpi as an AP and connect directly).

However, if the RFM signal is poor and the emonESP can get a wifi signal without issue, then the WiFi option is possibly the way to go. Because your core measurements (grid and PV) are on different devices, it becomes more important to get this bit right.

The emonPi will be a 3B(+?) and have both on-board wifi and Ethernet, so you could set up the emonPi in AP mode to set up a private “OEM” wifi network that didn’t use your router if you preferred that route, that would mean the emonPi would need to use the Ethernet cable to connect to the LAN and on to the WAN via your router, if you prefer to use all WiFi instaead of an Ethernet cable, you can (might need some changes to the emonPi SW?) you would need to add a USB WiFi dongle (not an emonESP) to do that easily.

The reason you maybe seeing inputs but they are not updating could be that one or more individual updates got through at some point, the inputs are created automatically in emoncms when unknown inputs arrive. Could it be that the emonESP was working at some point but you’ve changed something? It could be that a transmission from remote emonTx’s RFM has managed to reach your emonPi during setup? The rfm is not disabled when the emonESP is fitted (and there is no manual way of disabling it) so it is possible to receive the same data twice via both methods if the rfm is in range and the wifi is connected.

Where are you pointing the emonESP? MQTT or HTTP? local emonpi or emoncms.org?

1 Like

There are times in life when I wished the ground would open up and swallow me whole; yesterday was one such day :worried: :worried: :worried:

To correct previous inaccuracies … I do NOT have an ESP8266 (ESP) attached to the emonPi (Pi), only the emonTx (Tx). Sorry. Both units have a short rubber aerial attached, so presume they are connected via wifi (rather than r/f?) - or at least they were at some stage for the CT & Vrms info to appear on my local emonCMS (CMS). But again today the Tx data is “red” on CMS, so comms are not working as they should. Maybe they (briefly) connected via rf in the first instance? Certainly I have never been able to find a generic SSID like the “emonESP_1679732” suggested in the Setup Guide.

I have removed the RJ45 temp sensor from the Tx as it was fouling the ESP; I will request a break out cable from the Shop with my next order. I have also removed the JS2 jumper from both Tx to enable them to work with both AC and DC power bricks and the ESP.

It is a great idea to locate the Pi in my Office, and put my second Tx in the house (ordered as Node 7), as that will give me more options re: which cables to add a CT sensor. (Monitoring the office came in late to my thoughts, hence Plan A!). But for now I will leave it as a two box system until I can eat least get the comms sorted out.

I have managed to get some graphs produced on both a laptop browser & on the iOS app, but only on WLAN; getting it routed via emonCMS.org’s servers will be done later. I will also leave the solar PV aspect out for now.

Lastly, the distance between the house panel and the garage panel is “only” about 25m (just checked on Google Earth), BUT it has some serious walls & cars etc in the way. I opted for the wifi route as I have good WLAN conenctectivity between the two buildings. The Office is 50m from the house and 60m from the garage, but with a couple of barns & several walls inbetween. I have a Cat5e cable running from the house to the office, with (same name SSID) access points everywhere.

I’m still at a loss re: how to fix the comms issue between the house (Pi) and garage (Tx) …

Two additional thoughts…

I now see that the short rubber antenna (433Mhz SMA Antenna) is not for wi-fi, so its’ presence is irrelevant for me?
Is there a way to factory (/hard?) reset an emonTx v3? Perhaps doing so and starting again might be worth a try?

Hi Julian, it sounds to me like the bit that’s giving you trouble is the emonESP. If you are able to use your iOS app with the emonPi then that is connected no problem.

The emonTx is effectively reset every time you take the power away, only the node id and rfm frequency etc is held in eeprom. None of which will effect the use of the emonESP. The emonTx will just sit there spitting out data on it’s serial port (and rfm) whether the emonESP is functional or not.

The emonESP may have a reset, but I’m not that clued up with the emonESP to tell you how to do that off-hand, (I will take a quick look for you to see if i can find a link.).

However, just so we’re clear as to what it is you are trying. The emonESP ships in AP mode, when you power it up, it should broadcast a SSId so that you can use your mobile or your PC to connect directly to the emonESP’s own network via wifi, not via your network router and not using the emonPi. When you have connected to the emonESP using your PC or mobile (normal wifi network connections, close to the emonESP location) you then add your home network details ssid and password etc on the emonESP page.

So to recap, the emonPi bit is done, the emonTx “just works”. You only need to sort out the emonESP connection with your home LAN, independently of any other parts, that is solely the emonESP.

Once you have connected to the emonESP and can enter your home network details, then the emonPi’s details can be entered, either at the same time as the LAN details or by navigating to the emonESP after it connects to your LAN.

I read thru the emonESP info in the repo (GitHub - openenergymonitor/EmonESP: ESP8266 WIFI serial to emoncms link) and whilst i couldn’t find a “factory reset” as such it does say

Holding the boot button at startup (for about 10’s) will force AP mode. This is useful when trying to connect the unit to a new WiFi network.

But there is no picture of the emonESP or what the boot button is so i hope it’s labelled on the emonESP.

I would recommend trying to force APmode and then search for the SSID again, with your mobile or laptop, if you still can’t see an SSID for the emonESP after forcing it into AP mode you should maybe contact the shop support email as the unit maybe faulty, or need the FW reflashing which you will need a usb to serial programmer to do (and indeed shouldn’t need to with a pre-programmed unit).

Correct, the rubber antenna’s are solely for the rfm network, neither the emonESP or emonPI have external WiFi antenna, they use traces on the printed circuit boards.

My fingers are crossed for you :crossed_fingers:

1 Like

Paul, thank you so much; your drawing attention to the ESP specifically has helped me enormously. I managed to get the ESP to re-boot and found the new SSID; changing my laptop wifi to that SSID & then telling the ESP to connect to my WLAN worked. I can now connect to & interact with the ESP on my laptop when connected to the home WLAN. On 192.168.1.38. Good news. :+1:

Inevitably this then brings me on to a couple of other questions …

Reading through the OEM guide at Using the emonTx v3 with the ESP8266 Huzzah WIFI module - Guide | OpenEnergyMonitor I can the the “4.Latest Data” values changing slightly over time, but the emonpi.local > Inputs for the emonTx3 are still showing as red (implying no fresh data); so whilst the Tx is harvesting data from it’s CT & Vrms sensors it is still not passing this through to emonpi.local.

On the emonESP page at 192.168.1.38 I have entered “emoncms.org” in the Emoncms Server* box, left the path blank, put “emontx3” in the Emoncms Node Name* box, entered my Write Apikey and then Save. I have not done anything in the MQTT or Admin sections. But the box then comes back as “Connected:No”. Hmmm.

Am I getting confused re: where the data is held; I half thought that my emonPi was storing data locally (thinking I’d move it up to emoncms.org at a later date), and perhaps this - along with uploading the Tx data to emoncms.org may be putting data in two places?

Also, is there a difference between my openenergymonitor shop username and password and my emoncms username and password? Currently they are different.

TIA

Yes they are all different, your OEM forum your OEM shop and your emoncms.org username/passwords are all independent of each other, As are the different emoncms instances.

It sounds a little like you maybe confusing emoncms and emoncms.org to be one thing. emoncms is a software that is run at a domain called emoncms.org. It is also installed on your emonPi and that emoncms instance is hosted on your own LAN. They are separate accounts and independent of each other. At emoncms.org you are just a user (as am I and many others here) on your emonPi instance of emoncms, you are the admin (and most likely the only user).

Not only can they both have different username/passwords, but they will also have different apikeys too (each instance/account will have 2 apikeys, one readonly and one readwrite).

This sounds like you have added the emoncms.org (not the emonpi) url. If you have added the readwrite apikey from your local emoncms, your data will be getting rejected from emoncms.org as unauthorised, that maybe why you are getting a “not connected” message, the url will definitely be why you see no updates on your local emoncms (emonpi).

You can do one of 2 things here, change the apikey to the emoncms.org one to see your data there or change the url to your local emoncms, that maybe accessible as http://emonpi or you may need to use the IP address displayed on the emonPi lcd.

You mentioned setting up emoncms.org at a later date, do you intend to send to both local and remote emoncms? The emonESP can only send to one place by http. I understand it can also publish to MQTT (I assume it can do both rather than one or the other!). So if you intend to send to both, you might want to set up MQTT for the local emoncms and use http for emoncms.org. You can use either for the local emoncms, but emoncms.org will only do http not mqtt.

If you think setting up mqtt will be too involved at this point, you could just use http locally for now and when you “later” set up emoncms.org, you will just need to change the details then.

Good to hear you are making progress, it can be a steep curve (even with just an emonPi alone), so you’re not doing bad.

1 Like

OK, I am now making some progress :blush:

I have created a log-in with emoncms.org, linked it to my Open Energy Monitor Shop email address, and has a load of “feed credit” applied.
I have logged back in to my emonTx3’s emonESP via a local IP and told it to store the data at emoncms.org, giving my emoncms.org a/c apikey . That then changed the Connected from No to Yes. Woohoo.
I have created a Feed from one Tx3 Input (CT#1), and that then graphs within emoncms.org. Woohoo again.

I think I now need to clear out where I was sending an old feed (most likely to emoncms.local on the emonPi as I could only access it via LAN and not WAN), and then set up the other Tx Inputs to Feeds.

How do I tell the emonPi to send its Inputs to emoncms.org instead of the current emoncms.local? I can’t seem to find that page :flushed:

When I have managed the above, I can then start to think about manipulating some of the inputs/feeds, so I can display things like real time export to grid figures (cf PV panels).

Is there a way to set an alert based on an Input? For example, I’d like to receive an email if the kW of the wire that comes in to the garage from the panels on CT#x is zero, at (say) 11:00 and (say) 16:00 every day. Or maybe something like IFTTT can be brought in to the emon universe? Sometimes the panels trip out & I can be unaware of this for longer than is ideal…

There should be a emonhub config page in your local emoncms. On that page there should be a text editor box with some settings resembling these (emonhub/conf/emonhub.conf at v2.1.2 · openenergymonitor/emonhub · GitHub) the overall page will look very different but the settings within that page should be the same.

You would need to add your emoncms.org readwrite apikey to this section in place of the x’s and save.
emonhub/conf/emonhub.conf at v2.1.2 · openenergymonitor/emonhub · GitHub

Once you do that your emonPi data will be sent to both your local and remote emoncms’s.

That is because you have not configured a way into your emonpi on your home network. There are at least 2 different ways to do this should you wish. Your emonpi has a software called Dataplicity installed, that is a 3rd party secure site that can tunnel your emonpi out to thier site so that you can access your emonPi server via thier site without configuring your home network for incoming external traffic. Setting up Dataplicity is in the OEM guides, it can be found here on the forum with a search or you can visit thier site for info.

The alternative way is to “portforward” the inbound port 80 at your router to the emonpi, it’s just a router setting (assuming you have a faily stock router/network setup) and then you will be able to access your emonPi from the WAN using your external IP to your router, which will forward traffic to your emonPi. Using the IP address can be a pain if your ISP is in the habit of periodically changing it, the way to combat that is to use a dynamic DNS service (eg duckdns) where you can set up a sub-domain like myemonpiathome.duckdns.org and either the emonpi or your router can keep the ddns service automatically updated with your current IP allocated by the ISP.

There are differewnces between the local emoncms and emoncms.org. For example, emoncms.org is a chargable service, you have credits from your purchases but if/when that runs out it will cost you money (not alot though) to continue using the hosted service. There are also some features that are not accessible on the hosted emoncms.org. The local version of emoncms is full featured. However, you ill have to to the “housekeeping” with the local emoncms to keep it up to date, where as emoncms.org will be maintained for you.

I’m not trying to talk you out of using emoncms.org, I just wanted you to have all the facts before you commit, this stuff can be addictive and I didn’t want you to plough many hours into snazzy dashboards on emoncms.org and then find you needed a feature that wasn’t available or you start collecting so many feeds that the hosted version becomes expensive etc etc.

Indeed all this is possible, alas the email alerts are one of those things that is on the local version only though. But there are ways around it, you could use IFTTT, there is (IIRC) a emoncms widget (or whatever the right term is on IFTTT) . You can also install node-red and do it that way too. Beware though unless you are using all local data and services you are dependent on the network too, so doing it all “in-house” can have even more benefits when you venture into control, automation and alerts etc.

I have now set up a small system with an emonPi and two emonTx3 (c/w ESP8266). All reporting through to emoncms.org . From this I have created a variety of Inputs. And from them I have created a variety of Feeds (one Feed per Input).

Two questions …

  1. If I have already set up Input A to create a Feed A, and Input B to create a Feed B, how can I set up a third Feed C which is the combined value of Input A and Input B?
  2. Is there a way within the “old” version of Dashboard to display a value numerically from an Input - ie “1,108 watts” - with the value refreshing every 10 seconds or so? It would be helpful to display such a figure for near-real-time PV generation for example. This would help us know when we can put the dishwasher on :crazy_face:

TIA

Indeed you can - or with values from Feeds A & B.

I’m not sure what you mean by that. On a Dashboard, you can add a “Feed Value” widget which will give you a numerical value.

Thanks Robert - but I have still not quite worked out how I can create a Feed C from combining Feed A and Feed B (as examples); On the Feeds page on emoncms.org there is nowhere to create a new Feed; so where would I create it?

Your answer to the second part was perfect, and I have now done that. As an aside, is there a way to “round” data being fed in to a Feed Value on the Dashboard? Seeing, for example, the value of PV generation as “2614” is less good than, say, 2,600 or even 2600 at a quick glance.
TIA

On the Inputs page. Take an existing input, at the end of the processing do Reset to ZERO, then you can start afresh with (say) +feed or +input.

I don’t know how, or even if, you can round values in emonCMS.

To create feed C,

  • Add a + feed entry to the Input A process list, Select feed B from the Arg drop down menu
  • Select Log to feed
  • Select CREATE NEW
  • Give the new feed a name
  • Select an Engine
  • Select a time interval
  • Click Add
  • Click the Changed, press to save button

Done

Thanks both - that works as desired. It is really quite a powerful system! :sunglasses:

I Added a RTZ to an input list as you suggested, and it returns the value of only one feed.

The point about RTZ is processing starts afresh, so if the units have changed earlier in the chain, that isn’t carried forward.