How to know if datamine logs are stored on USB (not Vera)?

Hi everyone,

I have installed the Datamine2 plugin on Vera edge (and UI7). I closely followed the instruction in the recent update of Datamine2 documentation. Specifically, I first put a FAT32 formatted USB drive and enabled Save logs on USB through Vera interface. Next, I changed SetDataDirectory to /tmp/log/cmh/dataMine and SetManualMount to 1. I had not specified a SetMountUUID. Everything seemed to work correctly.

I think the fact that Vera logs are stored on USB together with setting Datamine directory as above imply that all the data is stored on USB drive. However, I removed the USB to check the amount of stored data and also to check if there is any new file written to it. But it seems that the format on USB is changed, and on my Windows system the disk was not accessible. I am doubtful about the logs location because the Datamine2 device on Vera dashboard shows:

disk total: 502060 kb
disk used: 27012 kb
disk free: 448712 kb

but the original size of USB is 8GB.

Can someone please tell me where the log files are written in my system? and how to access them in Linux environment?

P.S. I noticed that all the channels are gone the moment I removed USB. Redefining the variables is Ok, but DM keeps saying that Vera is restarted and the channels/graphs are deleted automatically, after each time. Other Vera functions are running Ok. Is this because I removed USB?

Regards,
Mona

Hi Mona,

When you enable Vera logging onto USB it will reformat your USB drive as a Unix ext partition which is not readable by Windows. Don’t confuse Vera logging with dataMine2 logging which is quite different, so unless you specifically need it (which I suspect you don’t) you should disable save logs on USB through the Vera interface.

Next try reformatting your USB drive on Windows plug it back into Vera and set the SetDataDirectory to the default of /dataMine/ and SetManualMount to the default 0.

Hit Reload on Vera then go to the dataMine web page, you should see a dialogue asking you to select your USB stick.

Let us know how you get on…

Hello and thank you for the reply.

I turned Vera power off and on once and it seems that DM is now stable. It has kept the variables during the night and graphs are accessible :slight_smile:

To clarify things, I should add that my goal is to have the vera network work locally, i.e. without connecting to mios servers. This way the system will only work though LAN, is faster, and more secure. It just crossed my mind that Vera can’t keep its old logs on cloud, as it is used to. So, to avoid the internal memory of Vera being used up, I enabled saving logs on USB.

Of course, I am very new to Vera and perhaps my worries about Vera memory and logs are unnecessary. I will appreciate if you help on this. Also, how do you interpret the disk space values I reported above (the used space is now 4040 kb)?

Thanks a lot,
Mona

Hi Mona,

Glad to be of help. I’m not sure what happens if it can’t access the remote server, but my suspicion is that it will save up to a maximum of 10 logs in a compressed format which will use up very little space and nothing to worry about. There is a config file cmh.conf in /etc/cmh where you can set the behaviour. Unless you are an application developer there isn’t really any need to keep old Vera logs.

The space being reported is by executing a “df” command on your log directory. When you selected Vera logging to USB, it would have reformatted your USB stick with the ext filing system with a fairly small partition (512MB?) making the rest of your 8GB stick unavailable. If you want the rest of your stick back you will need to create a separate ext partition on it.

However, I highly recommend that you don’t store your Vera logs on the same USB stick as your dataMine logs as I’ve heard horror stories of the whole lot being wiped at random.

I don’t really need Vera logs. Although I was hoping to see a more user-friendly log of the interactions in the system (for example, to diagnose why my sensor didn’t trigger the scenario and the like). Vera log is currently more complicated than I can fully use.

So, how should I proceed with disabling USB logging for Vera? I guess I uncheck USB in the Log tab, and then reformat USB by windows and follow the parameter settings as suggested in table 1 of datamine2 document. Is this the way to go? Probably datamine data will be lost, though.

Regards,
Mona

There is a plugin called EventWatcher that I use to keep track of what is happening in my system (the downside is that this is another plugin that needs some resources from your Vera) . The event list contains events since last loop restart (a loop restart clears the list) but I also send the events to a syslog server so nothing is lost. Here is a screen dump from my syslog events just as an example.

This is great! :smiley: I didn’t know there is such a plugin. It will be much of help, thank you.

Hi back,

I unabled usb logging for Vera. Then deleted the partition and recovered all the initial space on it (8GB). Did the formating and plugged it into Vera edge. I also changed setManualMount back to 0, and loaded Datamine web interface. However, I don’t see any UUID listed in the start up dialog. I have uninstalled and reinstalled Datamine 2 several times with no luck.

I am attaching an screenshot of the variables. Here I have configured it manually using the usb label (not UUID), and also have the values of diskTotal etc. deleted (they were irrelevant). I have also attached datamine debug report.

Can someone please help? I appreciate any hint.
Thanks!

Hi @hmomeni.

What model of Vera unit do you have?
I see from your debug output that there is nothing in sections 2 and 4 which are the outputs of the blkid command and fdisk command respectively. I’ve heard that the blkid command is not supported on some Vera machines so this may be the issue.

To make things worse, I just spotted a bug in my code which means that the mount code isn’t executed if SetManualMount is 1, however, setting it to 0 will still perform a manual mount if there is a value in SetMountPoint (i’ll fix this in the next release)

try setting SetMountPoint to /dev/sda1 (or wherever your USB is) and SetManualMount to 0.

Thank you @ConstantSphere. I am using Vera Edge with firmware 1.7.1707 (the latest version apparently) and UI7.
I tried changing the SetMountPoint to /dev/sda1 and SetManualMount to 0, but still no USB drive is shown in the Datamine dialog.

I almost know nothing about linux, how can I find the address of my USB drive on Vera system? I have uninstalled and reinstalled Datamine several times. Not sure if this creates multiple mounting points or possible complications in future ???

Also, by default the SetDataDirectory and diskTotal are preset with the values /dataMine/ and 9600, respectively.

I appreciate any help or advice. Thank you for taking the time.

Mona

Hi @hmomeni - Sorry, it’s take a while to get back to you. So I think that the Vera Edge does not support all the commands necessary to identify where your USB is mounted, so unfortunately you will never see any devices in the USB dialog on your machine.

The workaround is to go for a manual mount and looking at images online, it seems the Vera Edge only has one USB port and as long as you don’t have a USB hub it’s likely to have the address “/dev/sda1” (this is a bit of a guess). Looking at your log you set this to “dev/sda1” with a slash missing, so you need to correct this.

Once you have tried this could you attached another debug log?

Hello @ ConstantSphere and thank you.

That’s right, VeraEdge has only one USB port.
I tried manual mounting by giving SetManualMount a value of 1. The Datamine interface shows that it is connected to Vera Edge, but it has not updated the Light Sensor channel (it is supposed to be updated every 4mins), and does not show its current value correctly. So I think that manual mounting is not working.

But it does show all the variables of devices in my system. I have attached the log. Thank you again for this support.
Regards,
Mona

Just wanted to inform that Datamine is creating the plots for two channels I have chosen. I attached another debug file, although sections 2 and 4 are still empty.

There seems to be some errors in the file regarding the opening of an address. As the disk information is not correctly identified, would you please help me know where Datamine is putting its data? I am worried that it’s on Vera’s memory…

Regards,
Mona

Hi @hmomeni - sections 2 and 4 of the debug will always be blank on your machine as it doesn’t support the relevant commands (which are also used to find the USB location). I’d certainly say that you are logging directly into Vera memory - when you get it working on USB, you will lose all of your configuration and data to date unless you copy it across.

Other than that there are a couple of things going on here…

  1. your mount point contains some html markup, perhaps from a copy and paste: [tt]SetMountPoint -/dev/sda1[/tt]. It should just be [tt]/dev/sda1[/tt]
  2. There is a bug in the manual mount process that the attached file should fix. Can you upload this into your Luup files.

Once you have done both of the above, can you try again and send me another debug file if it doesn’t work.

Hello and thank you @ConstantSphere.

I followed the two steps as you had advised and I think it is now all set, because it is showing the capacity of my USB drive correctly. Should I check anything else?

I am deeply grateful for (and at the same time impressed by) the time and effort you put on solving this issue. :smiley:
Regards,
Mona

You are welcome. Please don’t forget to review dataMine2 in the app store!

Hi all,

I just used this forum because it similar to my case that I want to ask about (the same machine, same UI version and windows computer).

In fact, I followed the whole explanation that written from @hmomeni and @ConstantSphere (Thanks for you both guys) and I got until I can see the graphs in my data mine web page, when I used the setting that shows in the attached images, as well as I attached my debug page.
Now, I want to get the data out from Vera because I need to use it with different computer software such as a Matlab or Python as an inputs. So I have some questions here:

  • Do I need to change the setting that appear in the attached image ?
  • As I understand from the DataMaine2 documentation, its recommended to use a different USB for saving the Vera’s log.
  • After I set the setting and the logs is already saved in the USB, how can I get them out using a windows computer.

I will appreciate any help from you guys.
Many Thanks in advance

Gad