Error: The connection failed, please try again

Bit of a noob question, possibly… I installed my pre-built emonpi around 3 months ago and at that time I setup emoncms on iOS and it worked fine. I have changed my iphone recently and now when I scan the QR code from the emoncms “my account” page, I get a connection failed error. I actually get a nag that the connection must be https first, so I change the http prefix manually to https, then get the connection error. I’m pretty technical but am loathe to start digging in without asking for some advice first, given that I didn’t build the box myself and don’t want to cause irrecoverable mayhem! All help gratefully received.


This sounds like an iOS issue with your new phone if it worked previously.

Could there be a Apple restriction to force you to use https?

The connection error due to you changing the prefix will probably be because you do not have ssl set up on your server (or do you?).

The original message about the connection must be https sounds like an attempt to get you to always use a https connection, which is good advise if one is available, but not always the case. Is there a setting in the phone to relax that restriction that you may have set in your other phone and since forgotten about?

[disclaimer - I do not use apple at all so this is not an informed opinion, just logical thinking]

Hi Paul. Thanks for replying. It’s a thing called App Transport Security (ATS) which apple introduced in iOS 9 which is forcing an HTTPS connection and I don’t think it can be disabled at the handset. It’s weird because it appears to have been enforced for a while now and this used to work on my old phone, but it certainly seems to be b0rking things now. You’re right - I don’t have SSL setup,

So if this is a case of Apple breaking the app connection with good intentions, I can’t be the only one with this issue?


@mattjgalloway’s ya man, but I’ve not seen him here on the forum for a while.

You could try reporting the issue through the app or visiting the repo

or take a look through some of the related threads here for some info

OK thank you

Howdy! (Hi @pb66 - very long time since being active here indeed!)

It’s right that you do indeed need to be using HTTPS. Apple require that for apps these days. However there is an exception for the emonpi and *.local domains. I can’t add any arbitrary domain into there, because Apple would reject the app. Could it be that now your emonpi is called something different?

Also - should be a massive update coming to the iOS app soon - so watch out for that!

1 Like

Doh! It is like Chrome complaining about no HTTPS on non-routable/private IP addresses - just plain stupid.

I do agree with the HTTPS everywhere sentiment but not on my own internal, non-routable LAN. (I’ll get my hat…)

What is the URL that your emoncms instance is on @borpin?

I’m a Non IOS player so that bit doesn’t impact me. It was just a general rant about implementing a good theory in a stupid way. :rofl:

I don’t use iOS either, plus I have SSL on all my instances. But just FYI my local network uses .home not .local and it’s a run of the mill BT homehub5, I can’t see any setting to change it either.

Yes it is a pain that some use one and other the other. I’m moving to the point of only using the wired port on my Home Hub and the rest is Ubiquiti kit. Bought the AP and it is great, just need the USG now. I’m also moving to using Pi-Hole for all my DNS (via cloudflared DoH). Not sure yet if DHCP will be done by the USG or the Pi-Hole ATM. Ideally I’ll have 2 networks, one direct (no ad blocking) and the other via the Pi-Hole.

I just cannot be bothered with SSL internally though.

Hi - thanks for the info. Yes, that’ll be it then as my emonpi is on my home domain, so I’ll make an exception for it in DHCP so that it reverts to .local, then give emoncmsios another go. Makes perfect sense. I wouldn’t want to annoy Apple, after all. It’s not like it’s my equipment on my network in my hou… oh, wait… :slight_smile:

Thanks guys, I really appreciate it.


Awesome! Let me know if it doesn’t work still once you’ve tried that.