Mobile app - QR Code

@JumpMaster Take a look at the error log for the web server and see if you have any divide by zero errors logged when using the app - logs on the emonpi are full of them.

In the mean time I am going to investigate the API some more and get some traffic captures going to see if I can figure out where the problem is - my initial reaction that there is a problem in the emoncms code may or may not be correct - plus the reason I see the issue with my Pi, and you don’t on your hosted platform may be entirely due to the performance of those boxes - the real question is if you have the same error in the logs or not.

I’ll do some more digging and feed back soon.

Why get the full feed list every time? I’d have thought that this was only needed when selecting the feed as the input.

Connection error issue moved to it’s own thread - Android App "CONNECTION ERROR"

I din’t believe there is a way make a request and limit it to two or more feeds. I think it costs less to receive all feed values rather than make multiple http requests.

OK, my understanding of ‘full feed list’ might be different. I was thinking you were requesting a list of all the available feeds each time.

You’re right. I have found an alternative. I’m also looking at how to automatically select the feeds as per MyElectric (which looks for feed names use ans use_kwh).

Old update request.
https://emoncms.org/feed/list.json

Potential new request only selecting two feed values.
https://emoncms.org/feed/fetch.json?ids=2,3

Just do not assume everyone is using the MyElectric module :wink:

1 Like

Automatic configuration only assume that the required feeds are called use and use_kwh. No requirement to use MyElectric.

1 Like

Wow, great work.

I’ve just tested the beta app. The QR code would not scan at first using my Motorola MotoX so I tried my friends S3 Mini and it worked right away. Then I tried again with my phone and it scanned but said ‘invalid QR’, finaly third time lucky my phone managed to scan the code.

This could be an issue with my phone/camera but the inbuilt scanner seems to work every time.

Anyway great progress :thumbsup: . Let me know if I can provide some more tested report feedback / help.

@glyn.hudson the issues scanning the QR code are possibly down to the size of the image vs the amount of data held within the QR code (the more data you cram in there the smaller the squares become) - its at the point where I am thinking we should make it a little bigger, but I don’t want it taking over the page :slight_smile:

Suggest we wait for some more reviews and bump the size later if required, in the mean time you can test the same effect by zooming the page and then trying to scan it with your MotoX.

Ah I was testing on my work PC with a old large TFT monitor. Testing on my laptop (Chromebook Pixel) that has a much denser better LCD DPI the QR scans every time using my motoX :smile:.

No harm in marking the QR code larger, I’m sure @Andy_Taylor can do this. There is plenty of space on the account page. Are there are recommended sizes for QR codes? Would be good to allow for low resolution LCD’s.

@Gwil could you test the QR code on the old Acer Chromebook at work that has a very low DPI?

The QR could could be made larger to bring it in line with the API Key length.

That looks good to me. Filling out the left column will look better and also perform better.

The scanning can be a bit random. Sometimes as soon as the barcode gets into view of the camera it scans and other times it takes a lot of moving the phone closer/farther to/from the screen before it scans. It usually works every time though.

Is there an official recommendation to call the feeds use and use_kwh? I would personally prefer usage but that’s just me being picky :blush:

@glyn.hudson Pull #519 created.

This enlarges the QR code for better reading, it still doesn’t fill the left column, but its certainly larger.

They are the keywords Trystan has chosen for the apps module, they are used in the MyElectric, MySolar(AKA MySolarPV) and MySolar & Wind (AKA MyEnergy) along with “solar”, “solar_kwh” and “import_kwh”

it would be nice to maintain some consistency as the resent change to these keywords meant many of us had to rename our feeds from,the previous “house_power” and “solar_power” etc for the new apps to work, those changes also involved changing some feed types that had the knock on effect of breaking the android app config.

The alternative is to maintain duplicate feeds or avoid using the “auto” config, neither is ideal.

Is there any way the qr code(s) or the data from them could be retained and a “use saved QR code” function added to allow easy switching between accounts as a interim solution to a multi-instance app?

@pb66 I have to ask the potentially dumb question - why do you need to have more than one app / more than one set of settings? I may be totally wrong here, but I think that you can export the feeds from more than one emonpi into one emoncms.org account. - There is every chance that I completely made that up, but no doubt someone will correct me shortly if that isn’t the case.

You can indeed have several emonbases reporting to any one emoncms instance on any server, emonhub will also send your data from any one emonbase to multiple target emoncms servers.

A multi-instance app would be of great interest to many users, for many different reasons.

As a developer I have many emoncms accounts of interest across multiple servers, either test accounts of my own or accounts I have setup/maintain for other users.

I also have clients, and then some of those are also in the business of providing energy saving technologies, LED lighting and efficient heating etc they too need on demand access to multiple accounts for their clients/projects.

There are also other ways the app can be used for example as an end user that has PV they wish to use the MyElectric app to monitor solar and solar_kwh rather than use and use_kwh for a simple way of tracking how much they are earning from the PV as opposed to the MySolar way of presenting data.

When we previously discussed this there were users that showed an interest to monitor specific items eg an electric vehicle or a heated pool etc. The MyElectric and the android apps are power and energy displays that could have many other uses. eg I would like to see my off-peak use separate to my peak use, if it was easily done that is, it’s not important to me but it would be nice there is no reason it cannot be done beyond the app(s) only able to show a single power and energy pair of feeds.

Take a look at the original Android app thread the discussion on multi instance isabout halfway through and mentions side swiping or “carouseling” though mutliple screens/feeds/accounts,

1 Like

Thanks a lot to everyone who’s helped.

QR code setup is now live on Google play Emoncms app V1.2.2 and Emoncms stable release V9.6 :grinning:.

Just done a blog to highlight. I’ve asked @TrystanLea to merge changes into Emoncms.org.

I’ll add a me too to this. I started a thread here as well.

Can I suggest that the text in the App under the QR section points out the minimum Emoncms version required? Might confuse someone who has not followed this thread.