Cannot create feeds in Emoncms version 8 on Windows XP

Hello,

I've just recently discovered emoncms. I use it on a Windows XP computer together with Openremote. My intention was to log the actual temperature in my living room and to follow up the time the heating is on per day. The data is sent from a KNX thermostat to Openremote, which in turn sends the data (input) to Emoncms.

First I installed Emoncms 6.9, which worked well. I made a dashboard  which is displayed on my Android tablet using the Openremote software. 

Then I saw on the emoncms website there was a new release for Windows: Emoncms 8. I did a completely fresh install of Emoncms 8, following the instructions on the website (I created a folder D:\emoncmsdata and in that folder I created three subfolders: phpfiwa, phpfina and phptimeseries).

The first problem I encountered with Emoncms 8 was that the inputs weren't detected anymore. Then I found out that the input API has changed a bit. It seems you also need to put a node ID to the http json request (this is not mentioned in the Input API helper of Emoncms 8). After changing this in Openremote, the inputs were detected again by Emoncms 8.

But now I am completely stuck. When I try to create a feed I get an error message every time I click the Add button: 

"ERROR: feed can not be created, undefined."

What goes wrong?

Paul Reed's picture

Re: Cannot create feeds in Emoncms version 8 on Windows XP

Yes, v8.0 is a lot more unforgiving in respect of the input format.

I don't know how you are posting data, but I had to change my input format from JSON to CSV in order that  I could create feeds.

Have you tried posting via

http://192.168.1.72/emoncms/input/post.json?node=22&csv=100,200,300

obviously changing IP addresses to yours. Try posting a few times and then see if you can log node 22 to a feed.

 

Paul

Tom's picture

Re: Cannot create feeds in Emoncms version 8 on Windows XP

Hello Paul,

Under attachment I've added a ZIP-file with two screenshots (PNG-format): one is the input page, the other the input process page showing the error message.

I have only two inputs at the moment. Under column "key":
1. senActTemp: the measured room temperature (in Dutch: kamertemperatuur).
2. vsenHeating: value is 1 when heating is ON, value is 0 when heating is OFF.

The names of the input keys are defined in Openremote and sent together with the values to Emoncms (in Openremote the values are stored in "sensors"). This seems to work OK in Emoncms version 8. I can see that the time intervals on the input page under column "last updated" are reset every time a value arrives at Emoncms.

The format for sending values to Emoncms is defined in Openremote using a XML-file:

<bean id = "emonCMSLogger"
     class = "org.openremote.controller.statuscache.emoncms.EmonDataLogger">
    <property name = "emonURL"
             value = "http://localhost/emoncms/input/post.json?&amp;apikey=[My Key];node=0&amp;json="/>
    <property name = "sensors">
      <list>
        <value>senActTemp</value>
        <value>vsenHeating</value>
      </list>
    </property>
</bean>

As you can see in the snippet above I hard-coded the node ID as "node=0" (in Emoncms version 6.9 it was not necessary to add a node ID).

Trouble begins when I try to create a feed. When I click the Add button, the error message appears as you can see in the second screenshot.

Paul Reed's picture

Re: Cannot create feeds in Emoncms version 8 on Windows XP

I can't view your screenshots as I'm  posting from my phone at the moment, but looking at your code above, I would suspect that its the URL format that v8.0 is not happy with. Have you tried posting some data via your browser as per my post above.

Also, I would avoid using node 0, as its supposed to be reserved for OOK use.

Paul

Tom's picture

Re: Cannot create feeds in Emoncms version 8 on Windows XP

Hey Paul,

I tried but without any success.

I posted a few times some values via my browser using the format http://192.168.3.111/emoncms/input/post.json?node=22&csv=116,194,588 as you proposed. I used different values each time. The inputs are accepted but when I try to create a feed the same error message comes up again.

Can it have something to do with the folders "phpfiwa", "phpfina" and "phptimeseries"? This is new in version 8.0. I created these under the path D:\emoncmsdata\phpfiwa, etc. and I also changed the file "settings.php" accordingly (as described on the website under the instructions for installing under Windows). In version 6.9 i used the MySql engine. It was not needed to create extra folders.

I saw some similar threads about not being able to create feeds with version 8 on the forum but those referred to Linux systems. I couldn't extract anything useful from them that was helpful for my situation.

Do you know perhaps in which script file the error message "ERROR: feed could not be created, undefined" can be found? I searched for it already this morning, but couldn't find it so far. Maybe I can find a clue about what is going wrong over there (although I have little programming skills)?

Tom

 

 

Paul Reed's picture

Re: Cannot create feeds in Emoncms version 8 on Windows XP

OK, back home now, and had a look at your screenshots. I can see that your input node 'keys' are a text value which you have assigned within the json string. As far as I'm aware, the 'Key' value should be an incremental number in v8.0 which is assigned automatically by emoncms, and not dictated by the posting string.
Presumably when you posted data via the URL I posted above, it created node 22 and contained 3 inputs within in, and each input assigned a incrementing 'Key' which is how I think it should be.

The site documentation does need a lot of work to catch up after this upgrade, and no mention of Windows is made in the emoncms Github read.me...

I'm not familiar with 'Windows' emoncms, so can't advise you much further, but from my personal experiences with v8.0, I would look more closely at the input format. 

 

Paul

Tom's picture

Re: Cannot create feeds in Emoncms version 8 on Windows XP

Hey Paul,

Thanks for your support. In the meantime I found out that every time I click the Add button to create a feed on the input/process page entries are written to the "apache_error.log" file. I tried to create a feed with each of the three available feed engines: phpfina, phpfiwa and phptimeseries. I did this with the inputs I created via the browser using the format you proposed (comma separated values and using the same node id 22). Each time the same error message appeared, saying that the feed cannot be created.

It is to mention however that if the phpfina engine is selected a feed is created, but that feed doesn't seem to accept any input values and its status stays inactive all the time. And if you try to export that feed, a new browser screen comes up displaying the word "false".

In the error log file I see that the paths I defined in "settings.php" get internally corrupted. In "settings.php" I inserted the following path names (as described in the installing instructions for Windows on the emoncms website):

'phpfiwa'=>array(
            'datadir'=>"D:\emoncmsdata\phpfiwa\ "
        ),
        'phpfina'=>array(
            'datadir'=>"D:\emoncmsdata\phpfina\ "
        ),
        'phptimeseries'=>array(
            //'datadir'=>"D:\emoncmsdata\phptimeseries\ "
        )

);

(Note also that I had to add an extra white space before the ending quote of each path string, otherwise I got a parsing error coming from "index.php". This issue was mentioned in the installing instructions for Windows on the website).

In the "apache_error.log" file however I find these path names:
1. in case of phpfiwa: D:\x1bmoncmsdata\\phpfiwa\\ 34.meta
2. in case of phpfina: D:\x1bmoncmsdata\\phpfina\\
3. in case of phptimeseries: D:\x1bmoncmsdata\\phptimeseries\\ feed_36.MYD

So it seems that:
1. the first letter "e" of the folder name "emoncmsdata" gets internally replaced by "x1b"
2. backslashes between folder and file names are doubled
3. there is a white space between the last backslash and the filename (this stems from the fact I had to add the extra white space in order to avoid the parsing error).

I'm not sure if the double backslashes and the extra white space can cause trouble, but I am pretty sure that first of all the internal replacement of the letter "e" by "x1b" is preventing the feeds from being created (or being used in case of phpfina). This looks to me as a bug in the new version 8.0 running on Windows.
Unfortunately I don't have the programming skills to fix this myself, so I hope that someone in the development team of emoncms will find some time to take care of it.
In the meantime I will continue to use the old version 6.9, which runs pretty smoothly on Windows XP (however do you know if it possible to remove the automatically generated texts that appear on some of the visualisations, for example I have a bargraph that shows how long heating is on each day, but instead of time kWh is displayed. That doesn't look nice and it is confusing)

For completeness I added a fragment of the apache_error log file (PDF) under attachment, showing the error and warning messages with the corresponding stack trace, so you can see from which method in which file the error is coming. (I cleaned up  the log file a bit, removing the time stamps and other overhead data).

Tom

JBecker's picture

Re: Cannot create feeds in Emoncms version 8 on Windows XP

Seems that V8.0 is not running very well on Windows. I have a lot of very similar problems on Windows Home server. I also get this "ERROR: feed can not be created, undefined." But, if i try with the PHPFIWA, I get the same message trying first time and a message like "Error. feed already exists" on the second time!?! Feeds are created then and they show new values every time they are updated with new input, but nothing is stored anywhere. Not very useful at the moment.

BR, Jörg.

PS: I have set pathnames like 'phpfiwa'=>array('datadir'=>"F:\emoncmsdata\phpfiwa ") in settings.php. Is this correct (type of slash (Backslash) and no backslash and extra space at the end? But i have tried all possible forms already.

And, I do not get any error messages like you in the apache error log.

PPS: I am not complaining! I understand that Windows installations are not the primary goal! Just saying that it does not work as easily as one could perhaps assume :-)

 

 

 

 

Paul Reed's picture

Re: Cannot create feeds in Emoncms version 8 on Windows XP

Tom, hang in there, I'm sure that you will get some help soon.

Today has not been a good day in the forum as repeated attempts at spamming the site has disrupted and diverted attention.

 

Paul

Schism's picture

Re: Cannot create feeds in Emoncms version 8 on Windows XP

Can you put the paths inside single quotes instead? Your problem is this: http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.double

It's very unlikely that it will work with double quotes, as that means that every backslash is creating an escape character (for instance, \n is the new line). This is also why you have to leave a space before the closing double quote - \" is not the quote character that terminates the string, but a literal quote character within the string (which then isn't closed at all).

\e is the escape character,  which is why your system isn't very happy with the resulting file path, and why you had to add a space before the closing quotes. Single quotes should make things much happier.

JBecker's picture

Re: Cannot create feeds in Emoncms version 8 on Windows XP

Very good hint. With pathnames like 'phpfiwa'=>array('datadir'=>'F:/emoncmsdata/phpfiwa/') creating feeds works for me now without error message. But there is still no decent data written (four five files appear under 'F:/emoncmsdata/phpfiwa/' now with names '1_0.dat', 1_1.dat', 1_2.dat', '1_3.dat' and '1.meta' showing changing contents).

Ups, have to correct what I just wrote. After some time, the size of the 1_0.dat is increasing now and I can see data in the graph!

Its working now! Thanks a lot, Dave!

BR, Jörg.

 

 

TrystanLea's picture

Re: Cannot create feeds in Emoncms version 8 on Windows XP

Brilliant, I will correct the documentation.

Tom's picture

Re: Cannot create feeds in Emoncms version 8 on Windows XP

Hey,

I am back again. I followed the instructions from Schism above. I replaced in the file "settings.php" the double quotes in the path strings by single quotes. Now I have good news, but I am afraid I still have some bad news too.

When I omit the white space after the last backslash in the path strings, I still get the parsing error coming from "index.php", although I've inserted the path strings between single quotes. So, I inserted the white space again. And now comes the good news:

By using single quotes and a white space after the last backslash in the path strings I can now create feeds with the engines PHPFIWA and PHPTIMESERIES. No more errors anymore with these two engines. I can see that the feeds get updated, I can export the values into a csv file and I can create visualisations.

But now comes the bad news:

When I try to use the engine PHPFINA the error message "ERROR: feed could not be created, undefined" still comes up. Nevertheless on the feed page the PHPFINA feeds are displayed, but they stay inactive. On the input page under "process list" only the input processes linked to PHPFIWA and PHPTIMESERIES feeds are visible. I've added a screenshot of the feed page and the input page (see attachment).
When I click the Add-button on the input/process page after having selected the engine PHPFINA entries are written into the "apache_error.log" (note: I'm using Wampserver). I attached a PDF-document to this post showing the error messages that come into the log together with the stack traces. It seems that the method "checkpermissions()" in PHPFina.php is still making trouble...

Tom

 

TrystanLea's picture

Re: Cannot create feeds in Emoncms version 8 on Windows XP

Thanks a lot Tom, looks like we better remove checkpermission then, its just an additional check.

I will also add the note about the whitespace back into the documentation, is there a pattern to when its needed and when it isnt?

TrystanLea's picture

Re: Cannot create feeds in Emoncms version 8 on Windows XP

I've removed it

Tom's picture

Re: Cannot create feeds in Emoncms version 8 on Windows XP

Hello Trystan,

Concerning the whitespace. I use emoncms with Wampserver on a Windows XP computer. I obviously need that whitespace. But it seems, when I read the last post from Jörg Becker, who mentioned in a previous post that he uses Windows Home Server, that he can omit the whitespace.

Tom

Tom's picture

Re: Cannot create feeds in Emoncms version 8 on Windows XP

I did the test after Trystan has removed the "checkpermission" method in "phpfina.php" and on my computer, running Wampserver and Windows XP, the three feed engines (phpfiwa, phpfina and phptimeseries) seem to work alright now with emoncms version 8.0!

Thanks a lot for the quick and very helpful support.

Tom 

Schism's picture

Re: Cannot create feeds in Emoncms version 8 on Windows XP

Sorry, my first post was too early in the morning to think this far ahead. \' is how you put a literal single quote mark into a string delimited by single quotes. If you want to add a backslash at the end, you'll need to double it to tell PHP that you really mean for it to be a backslash.

For example, 

$path = 'c:\hello\world\\';

 

Mostly I'd think you should avoid putting a space at the end (although emoncms could get smart and strip spaces from the ends of paths before trying to use them).

JBecker's picture

Re: Cannot create feeds in Emoncms version 8 on Windows XP

I am using slashes instead of backslashes ('phpfiwa'=>array('datadir'=>'F:/emoncmsdata/phpfiwa/')).

Does this make sense? (ok, at least it works)

 

(and I still get the error 'Fatal error: Call to a member function fetch_object() on a non-object in C:\wamp\www\emoncms\Modules\admin\update_class.php on line 70' if I try 'Update&check' under 'Admin'. Tom, can you try this and see what happens for you?)

Tom's picture

Re: Cannot create feeds in Emoncms version 8 on Windows XP

Hello Jörg,

I tried it out. I don't get any error when I click the "Update & Check"-button, but I get an empty browser window with only the title "Update database".

Tom

sferrol's picture

Re: Cannot create feeds in Emoncms version 8 on Windows XP

Hi,

I can't configurate feeds in shared linux hosting.

Have a look to the attach file. The system put the feeds on the main path "/html/emoncms"

Thanks

Off Topic - see ukmoose post below. - Paul

ukmoose's picture

Re: Cannot create feeds in Emoncms version 8 on Windows XP

sferrol,

Using your full email address as your forum name probably isn't a good idea.

You can change it by logging in and going to "My Account" (right hand side) > Edit > Profile.

 

Your issue also is probably not related to the forum post you added to ( specific to Windows XP), please could you post again as a new post with a title that explains your issue such as "Cannot configure feeds on shared linux hosting".  This will help people with a similar problem find the result in the forum.

 

 

 

sferrol's picture

Re: Cannot create feeds in Emoncms version 8 on Windows XP

Hi ukmoose,

thanks for your advice.

my profile name is different than my email.
I don't know why my email still appears.

 

Robert Wall's picture

Re: Cannot create feeds in Emoncms version 8 on Windows XP

Your USERNAME is the same as your email address - that is why it appears. If you cannot change it, any of the moderators can. If you want me to change it, send a PM and tell me what you want to use as your user name.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.